PageSourceSearch

https://phimec.vercel.app/assets/index-C-p09EmV.js

js phimec.vercel.app collected 2026-10-03 07:29:01 UTC 1,848,681 bytes, 8,286 lines download raw bytes

vendor: 5,810 bytes, lines 1-9
1var TT=t=>{throw TypeError(t)};var s_=(t,e,n)=>e.has(t)||TT("Cannot "+n);var we=(t,e,n)=>(s_(t,e,"read from private field"),n?n.call(t):e.get(t)),qt=(t,e,n)=>e.has(t)?TT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),St=(t,e,n,r)=>(s_(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),lr=(t,e,n)=>(s_(t,e,"access private method"),n);var vp=(t,e,n,r)=>({set _(i){St(t,e,i,n)},get _(){return we(t,e,r)}});function bj(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var oi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function z1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var OI={exports:{}},Av={},DI={exports:{}},It={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var Ch=Symbol.for("react.element"),wj=Symbol.for("react.portal"),Ej=Symbol.for("react.fragment"),Sj=Symbol.for("react.strict_mode"),Tj=Symbol.for("react.profiler"),Aj=Symbol.for("react.provider"),Mj=Symbol.for("react.context"),Cj=Symbol.for("react.forward_ref"),Rj=Symbol.for("react.suspense"),Pj=Symbol.for("react.memo"),Ij=Symbol.for("react.lazy"),AT=Symbol.iterator;function Nj(t){return t===null||typeof t!="object"?null:(t=AT&&t[AT]||t["@@iterator"],typeof t=="function"?t:null)}var kI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},LI=Object.assign,FI={};function Gu(t,e,n){this.props=t,this.context=e,this.refs=FI,this.updater=n||kI}Gu.prototype.isReactComponent={};Gu.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")};Gu.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function UI(){}UI.prototype=Gu.prototype;function H1(t,e,n){this.props=t,this.context=e,this.refs=FI,this.updater=n||kI}var G1=H1.prototype=new UI;G1.constructor=H1;LI(G1,Gu.prototype);G1.isPureReactComponent=!0;var MT=Array.isArray,jI=Object.prototype.hasOwnProperty,$1={current:null},BI={key:!0,ref:!0,__self:!0,__source:!0};function VI(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)jI.call(e,r)&&!BI.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Ch,type:t,key:s,ref:o,props:i,_owner:$1.current}}function Oj(t,e){return{$$typeof:Ch,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function W1(t){return typeof t=="object"&&t!==null&&t.$$typeof===Ch}function Dj(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var CT=/\/+/g;function o_(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Dj(""+t.key):e.toString(36)}function Cm(t,e,n,r,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case Ch:case wj:o=!0}}if(o)return o=t,i=i(o),t=r===""?"."+o_(o,0):r,MT(i)?(n="",t!=null&&(n=t.replace(CT,"$&/")+"/"),Cm(i,e,n,"",function(c){return c})):i!=null&&(W1(i)&&(i=Oj(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(CT,"$&/")+"/")+t)),e.push(i)),1;if(o=0,r=r===""?".":r+":",MT(t))for(var a=0;a<t.length;a++){s=t[a];var l=r+o_(s,a);o+=Cm(s,e,n,l,i)}else if(l=Nj(t),typeof l=="function")for(t=l.call(t),a=0;!(s=t.next()).done;)s=s.value,l=r+o_(s,a++),o+=Cm(s,e,n,l,i);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function yp(t,e,n){if(t==null)return t;var r=[],i=0;return Cm(t,r,"","",function(s){return e.call(n,s,i++)}),r}function kj(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var kr={current:null},Rm={transition:null},Lj={ReactCurrentDispatcher:kr,ReactCurrentBatchConfig:Rm,ReactCurrentOwner:$1};function zI(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 9,435 bytes, lines 9-33
9It.Children={map:yp,forEach:function(t,e,n){yp(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return yp(t,function(){e++}),e},toArray:function(t){return yp(t,function(e){return e})||[]},only:function(t){if(!W1(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};It.Component=Gu;It.Fragment=Ej;It.Profiler=Tj;It.PureComponent=H1;It.StrictMode=Sj;It.Suspense=Rj;It.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Lj;It.act=zI;It.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=LI({},t.props),i=t.key,s=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=$1.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)jI.call(e,l)&&!BI.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Ch,type:t.type,key:i,ref:s,props:r,_owner:o}};It.createContext=function(t){return t={$$typeof:Mj,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Aj,_context:t},t.Consumer=t};It.createElement=VI;It.createFactory=function(t){var e=VI.bind(null,t);return e.type=t,e};It.createRef=function(){return{current:null}};It.forwardRef=function(t){return{$$typeof:Cj,render:t}};It.isValidElement=W1;It.lazy=function(t){return{$$typeof:Ij,_payload:{_status:-1,_result:t},_init:kj}};It.memo=function(t,e){return{$$typeof:Pj,type:t,compare:e===void 0?null:e}};It.startTransition=function(t){var e=Rm.transition;Rm.transition={};try{t()}finally{Rm.transition=e}};It.unstable_act=zI;It.useCallback=function(t,e){return kr.current.useCallback(t,e)};It.useContext=function(t){return kr.current.useContext(t)};It.useDebugValue=function(){};It.useDeferredValue=function(t){return kr.current.useDeferredValue(t)};It.useEffect=function(t,e){return kr.current.useEffect(t,e)};It.useId=function(){return kr.current.useId()};It.useImperativeHandle=function(t,e,n){return kr.current.useImperativeHandle(t,e,n)};It.useInsertionEffect=function(t,e){return kr.current.useInsertionEffect(t,e)};It.useLayoutEffect=function(t,e){return kr.current.useLayoutEffect(t,e)};It.useMemo=function(t,e){return kr.current.useMemo(t,e)};It.useReducer=function(t,e,n){return kr.current.useReducer(t,e,n)};It.useRef=function(t){return kr.current.useRef(t)};It.useState=function(t){return kr.current.useState(t)};It.useSyncExternalStore=function(t,e,n){return kr.current.useSyncExternalStore(t,e,n)};It.useTransition=function(){return kr.current.useTransition()};It.version="18.3.1";DI.exports=It;var O=DI.exports;const De=z1(O),HI=bj({__proto__:null,default:De},[O]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var Fj=O,Uj=Symbol.for("react.element"),jj=Symbol.for("react.fragment"),Bj=Object.prototype.hasOwnProperty,Vj=Fj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,zj={key:!0,ref:!0,__self:!0,__source:!0};function GI(t,e,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)Bj.call(e,r)&&!zj.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:Uj,type:t,key:s,ref:o,props:i,_owner:Vj.current}}Av.Fragment=jj;Av.jsx=GI;Av.jsxs=GI;OI.exports=Av;var _=OI.exports,$I={exports:{}},hi={},WI={exports:{}},qI={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(t){function e($,B){var G=$.length;$.push(B);e:for(;0<G;){var k=G-1>>>1,z=$[k];if(0<i(z,B))$[k]=B,$[G]=z,G=k;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var B=$[0],G=$.pop();if(G!==B){$[0]=G;e:for(var k=0,z=$.length,q=z>>>1;k<q;){var ne=2*(k+1)-1,ee=$[ne],j=ne+1,Q=$[j];if(0>i(ee,G))j<z&&0>i(Q,ee)?($[k]=Q,$[j]=G,k=j):($[k]=ee,$[ne]=G,k=ne);else if(j<z&&0>i(Q,G))$[k]=Q,$[j]=G,k=j;else break e}}return B}function i($,B){var G=$.sortIndex-B.sortIndex;return G!==0?G:$.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,f=null,u=3,h=!1,g=!1,v=!1,m=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w($){for(var B=n(c);B!==null;){if(B.callback===null)r(c);else if(B.startTime<=$)r(c),B.sortIndex=B.expirationTime,e(l,B);else break;B=n(c)}}function x($){if(v=!1,w($),!g)if(n(l)!==null)g=!0,V(S);else{var B=n(c);B!==null&&H(x,B.startTime-$)}}function S($,B){g=!1,v&&(v=!1,p(E),E=-1),h=!0;var G=u;try{for(w(B),f=n(l);f!==null&&(!(f.expirationTime>B)||$&&!A());){var k=f.callback;if(typeof k=="function"){f.callback=null,u=f.priorityLevel;var z=k(f.expirationTime<=B);B=t.unstable_now(),typeof z=="function"?f.callback=z:f===n(l)&&r(l),w(B)}else r(l);f=n(l)}if(f!==null)var q=!0;else{var ne=n(c);ne!==null&&H(x,ne.startTime-B),q=!1}return q}finally{f=null,u=G,h=!1}}var I=!1,M=null,E=-1,C=5,T=-1;function A(){return!(t.unstable_now()-T<C)}function R(){if(M!==null){var $=t.unstable_now();T=$;var B=!0;try{B=M(!0,$)}finally{B?P():(I=!1,M=null)}}else I=!1}var P;if(typeof y=="function")P=function(){y(R)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,F=D.port2;D.port1.onmessage=R,P=function(){F.postMessage(null)}}else P=function(){m(R,0)};function V($){M=$,I||(I=!0,P())}function H($,B){E=m(function(){$(t.unstable_now())},B)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_continueExecution=function(){g||h||(g=!0,V(S))},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return u},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function($){switch(u){case 1:case 2:case 3:var B=3;break;default:B=u}var G=u;u=B;try{return $()}finally{u=G}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,B){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var G=u;u=$;try{return B()}finally{u=G}},t.unstable_scheduleCallback=function($,B,G){var k=t.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?k+G:k):G=k,$){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=G+z,$={id:d++,callback:B,priorityLevel:$,startTime:G,expirationTime:z,sortIndex:-1},G>k?($.sortIndex=G,e(c,$),n(l)===null&&$===n(c)&&(v?(p(E),E=-1):v=!0,H(x,G-k))):($.sortIndex=z,e(l,$),g||h||(g=!0,V(S))),$},t.unstable_shouldYield=A,t.unstable_wrapCallback=function($){var B=u;return function(){var G=u;u=B;try{return $.apply(this,arguments)}finally{u=G}}}})(qI);WI.exports=qI;var Hj=WI.exports;/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var Gj=O,fi=Hj;function Re(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var KI=new Set,Ff={};function zl(t,e){yu(t,e),yu(t+"Capture",e)}function yu(t,e){for(Ff[t]=e,t=0;t<e.length;t++)KI.add(e[t])}var ho=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rx=Object.prototype.hasOwnProperty,$j=/^[: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]*$/,RT={},PT={};function Wj(t){return rx.call(PT,t)?!0:rx.call(RT,t)?!1:$j.test(t)?PT[t]=!0:(RT[t]=!0,!1)}function qj(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function Kj(t,e,n,r){if(e===null||typeof e>"u"||qj(t,e,n,r))return!0;
vendor: 5,200 bytes, lines 33-34
33if(r)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 Lr(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var rr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){rr[t]=new Lr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];rr[e]=new Lr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){rr[t]=new Lr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){rr[t]=new Lr(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){rr[t]=new Lr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){rr[t]=new Lr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){rr[t]=new Lr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){rr[t]=new Lr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){rr[t]=new Lr(t,5,!1,t.toLowerCase(),null,!1,!1)});var q1=/[\-:]([a-z])/g;function K1(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(q1,K1);rr[e]=new Lr(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(q1,K1);rr[e]=new Lr(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(q1,K1);rr[e]=new Lr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){rr[t]=new Lr(t,1,!1,t.toLowerCase(),null,!1,!1)});rr.xlinkHref=new Lr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){rr[t]=new Lr(t,1,!1,t.toLowerCase(),null,!0,!0)});function X1(t,e,n,r){var i=rr.hasOwnProperty(e)?rr[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(Kj(e,n,i,r)&&(n=null),r||i===null?Wj(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var Ao=Gj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_p=Symbol.for("react.element"),Pc=Symbol.for("react.portal"),Ic=Symbol.for("react.fragment"),Y1=Symbol.for("react.strict_mode"),ix=Symbol.for("react.profiler"),XI=Symbol.for("react.provider"),YI=Symbol.for("react.context"),Q1=Symbol.for("react.forward_ref"),sx=Symbol.for("react.suspense"),ox=Symbol.for("react.suspense_list"),Z1=Symbol.for("react.memo"),Wo=Symbol.for("react.lazy"),QI=Symbol.for("react.offscreen"),IT=Symbol.iterator;function Cd(t){return t===null||typeof t!="object"?null:(t=IT&&t[IT]||t["@@iterator"],typeof t=="function"?t:null)}var bn=Object.assign,a_;function Kd(t){if(a_===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);a_=e&&e[1]||""}return`
34`+a_+t}var l_=!1;function c_(t,e){if(!t||l_)return"";l_=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var r=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){r=c}t.call(e.prototype)}else{try{throw Error()}catch(c){r=c}t()}}
vendor: 8,484 bytes, lines 34-37
34catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
35`),s=r.stack.split(`
36`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
37`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{l_=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Kd(t):""}function Xj(t){switch(t.tag){case 5:return Kd(t.type);case 16:return Kd("Lazy");case 13:return Kd("Suspense");case 19:return Kd("SuspenseList");case 0:case 2:case 15:return t=c_(t.type,!1),t;case 11:return t=c_(t.type.render,!1),t;case 1:return t=c_(t.type,!0),t;default:return""}}function ax(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 Ic:return"Fragment";case Pc:return"Portal";case ix:return"Profiler";case Y1:return"StrictMode";case sx:return"Suspense";case ox:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case YI:return(t.displayName||"Context")+".Consumer";case XI:return(t._context.displayName||"Context")+".Provider";case Q1:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Z1:return e=t.displayName||null,e!==null?e:ax(t.type)||"Memo";case Wo:e=t._payload,t=t._init;try{return ax(t(e))}catch{}}return null}function Yj(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 ax(e);case 8:return e===Y1?"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 Ma(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ZI(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Qj(t){var e=ZI(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function xp(t){t._valueTracker||(t._valueTracker=Qj(t))}function JI(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=ZI(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function lg(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 lx(t,e){var n=e.checked;return bn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function NT(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Ma(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function e2(t,e){e=e.checked,e!=null&&X1(t,"checked",e,!1)}function cx(t,e){e2(t,e);var n=Ma(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?ux(t,e.type,n):e.hasOwnProperty("defaultValue")&&ux(t,e.type,Ma(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function OT(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+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 ux(t,e,n){(e!=="number"||lg(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Xd=Array.isArray;function Wc(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Ma(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function dx(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Re(91));return bn({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function DT(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(Re(92));if(Xd(n)){if(1<n.length)throw Error(Re(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Ma(n)}}function t2(t,e){var n=Ma(e.value),r=Ma(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function kT(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function n2(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function fx(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?n2(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var bp,r2=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(bp=bp||document.createElement("div"),bp.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=bp.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Uf(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var pf={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},Zj=["Webkit","ms","Moz","O"];Object.keys(pf).forEach(function(t){Zj.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),pf[e]=pf[t]})});function i2(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||pf.hasOwnProperty(t)&&pf[t]?(""+e).trim():e+"px"}function s2(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=i2(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var Jj=bn({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 hx(t,e){if(e){if(Jj[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Re(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Re(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Re(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Re(62))}}function px(t,e){if(t.indexOf("-")===-1)return typeof e.is=="str
37ing";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 mx=null;function J1(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var gx=null,qc=null,Kc=null;function LT(t){if(t=Ih(t)){if(typeof gx!="function")throw Error(Re(280));var e=t.stateNode;e&&(e=Iv(e),gx(t.stateNode,t.type,e))}}function o2(t){qc?Kc?Kc.push(t):Kc=[t]:qc=t}function a2(){if(qc){var t=qc,e=Kc;if(Kc=qc=null,LT(t),e)for(t=0;t<e.length;t++)LT(e[t])}}function l2(t,e){return t(e)}function c2(){}var u_=!1;function u2(t,e,n){if(u_)return t(e,n);u_=!0;try{return l2(t,e,n)}finally{u_=!1,(qc!==null||Kc!==null)&&(c2(),a2())}}function jf(t,e){var n=t.stateNode;if(n===null)return null;var r=Iv(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(Re(231,e,typeof n));return n}var vx=!1;if(ho)try{var Rd={};Object.defineProperty(Rd,"passive",{get:function(){vx=!0}}),window.addEventListener("test",Rd,Rd),window.removeEventListener("test",Rd,Rd)}catch{vx=!1}function eB(t,e,n,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(d){this.onError(d)}}var mf=!1,cg=null,ug=!1,yx=null,tB={onError:function(t){mf=!0,cg=t}};function nB(t,e,n,r,i,s,o,a,l){mf=!1,cg=null,eB.apply(tB,arguments)}function rB(t,e,n,r,i,s,o,a,l){if(nB.apply(this,arguments),mf){if(mf){var c=cg;mf=!1,cg=null}else throw Error(Re(198));ug||(ug=!0,yx=c)}}function Hl(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function d2(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function FT(t){if(Hl(t)!==t)throw Error(Re(188))}function iB(t){var e=t.alternate;if(!e){if(e=Hl(t),e===null)throw Error(Re(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return FT(i),t;if(s===r)return FT(i),e;s=s.sibling}throw Error(Re(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(Re(189))}}if(n.alternate!==r)throw Error(Re(190))}if(n.tag!==3)throw Error(Re(188));return n.stateNode.current===n?t:e}function f2(t){return t=iB(t),t!==null?h2(t):null}function h2(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=h2(t);if(e!==null)return e;t=t.sibling}return null}var p2=fi.unstable_scheduleCallback,UT=fi.unstable_cancelCallback,sB=fi.unstable_shouldYield,oB=fi.unstable_requestPaint,Rn=fi.unstable_now,aB=fi.unstable_getCurrentPriorityLevel,ew=fi.unstable_ImmediatePriority,m2=fi.unstable_UserBlockingPriority,dg=fi.unstable_NormalPriority,lB=fi.unstable_LowPriority,g2=fi.unstable_IdlePriority,Mv=null,Es=null;function cB(t){if(Es&&typeof Es.onCommitFiberRoot=="function")try{Es.onCommitFiberRoot(Mv,t,void 0,(t.current.flags&128)===128)}catch{}}var Qi=Math.clz32?Math.clz32:fB,uB=Math.log,dB=Math.LN2;function fB(t){return t>>>=0,t===0?32:31-(uB(t)/dB|0)|0}var wp=64,Ep=4194304;function Yd(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 fg(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Yd(a):(s&=o,s!==0&&(r=Yd(s)))}else o=n&~i,o!==0?r=Yd(o):s!==0&&(r=Yd(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-Qi(e),i=1<<n,r|=t[n],e&=~i;return r}function hB(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pB(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-Qi(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=hB(a,e)):l<=e&&(t.expiredLanes|=a),s&=~a}}function _x(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function v2(){var t=wp;return wp<<=1,!(wp&4194240)&&(wp=64),t}function d_(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Rh(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Qi(e),t[e]=n}function mB(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 r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-Qi(n),s=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~s}}function tw(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Qi(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var Yt=0;function y2(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var _2,nw,x2,b2,w2,xx=!1,Sp=[],ha=null,pa=null,ma=null,Bf=new Map,Vf=new Map,Xo=[],gB="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function jT(t,e){switch(t){case"focusin":case"focusout":ha=null;break;case"dragenter":case"dragleave":pa=null;break;case"mouseover":case"mouseout":ma=null;break;case"pointerover":case"pointerout":Bf.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vf.delete(e.pointerId)}}function Pd(t,e,n,r,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=Ih(e),e!==null&&nw(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}
vendor: 1,995 bytes, line 37
37function vB(t,e,n,r,i){switch(e){case"focusin":return ha=Pd(ha,t,e,n,r,i),!0;case"dragenter":return pa=Pd(pa,t,e,n,r,i),!0;case"mouseover":return ma=Pd(ma,t,e,n,r,i),!0;case"pointerover":var s=i.pointerId;return Bf.set(s,Pd(Bf.get(s)||null,t,e,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Vf.set(s,Pd(Vf.get(s)||null,t,e,n,r,i)),!0}return!1}function E2(t){var e=hl(t.target);if(e!==null){var n=Hl(e);if(n!==null){if(e=n.tag,e===13){if(e=d2(n),e!==null){t.blockedOn=e,w2(t.priority,function(){x2(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Pm(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=bx(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);mx=r,n.target.dispatchEvent(r),mx=null}else return e=Ih(n),e!==null&&nw(e),t.blockedOn=n,!1;e.shift()}return!0}function BT(t,e,n){Pm(t)&&n.delete(e)}function yB(){xx=!1,ha!==null&&Pm(ha)&&(ha=null),pa!==null&&Pm(pa)&&(pa=null),ma!==null&&Pm(ma)&&(ma=null),Bf.forEach(BT),Vf.forEach(BT)}function Id(t,e){t.blockedOn===e&&(t.blockedOn=null,xx||(xx=!0,fi.unstable_scheduleCallback(fi.unstable_NormalPriority,yB)))}function zf(t){function e(i){return Id(i,t)}if(0<Sp.length){Id(Sp[0],t);for(var n=1;n<Sp.length;n++){var r=Sp[n];r.blockedOn===t&&(r.blockedOn=null)}}for(ha!==null&&Id(ha,t),pa!==null&&Id(pa,t),ma!==null&&Id(ma,t),Bf.forEach(e),Vf.forEach(e),n=0;n<Xo.length;n++)r=Xo[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Xo.length&&(n=Xo[0],n.blockedOn===null);)E2(n),n.blockedOn===null&&Xo.shift()}var Xc=Ao.ReactCurrentBatchConfig,hg=!0;function _B(t,e,n,r){var i=Yt,s=Xc.transition;Xc.transition=null;try{Yt=1,rw(t,e,n,r)}finally{Yt=i,Xc.transition=s}}function xB(t,e,n,r){var i=Yt,s=Xc.transition;Xc.transition=null;try{Yt=4,rw(t,e,n,r)}finally{Yt=i,Xc.transition=s}}function rw(t,e,n,r){if(hg){var i=bx(t,e,n,r);
vendor: 10,986 bytes, line 37
37if(i===null)b_(t,e,r,pg,n),jT(t,r);else if(vB(i,t,e,n,r))r.stopPropagation();else if(jT(t,r),e&4&&-1<gB.indexOf(t)){for(;i!==null;){var s=Ih(i);if(s!==null&&_2(s),s=bx(t,e,n,r),s===null&&b_(t,e,r,pg,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else b_(t,e,r,null,n)}}var pg=null;function bx(t,e,n,r){if(pg=null,t=J1(r),t=hl(t),t!==null)if(e=Hl(t),e===null)t=null;else if(n=e.tag,n===13){if(t=d2(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return pg=t,null}function S2(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(aB()){case ew:return 1;case m2:return 4;case dg:case lB:return 16;case g2:return 536870912;default:return 16}default:return 16}}var la=null,iw=null,Im=null;function T2(){if(Im)return Im;var t,e=iw,n=e.length,r,i="value"in la?la.value:la.textContent,s=i.length;for(t=0;t<n&&e[t]===i[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===i[s-r];r++);return Im=i.slice(t,1<r?1-r:void 0)}function Nm(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Tp(){return!0}function VT(){return!1}function pi(t){function e(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Tp:VT,this.isPropagationStopped=VT,this}return bn(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Tp)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Tp)},persist:function(){},isPersistent:Tp}),e}var $u={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sw=pi($u),Ph=bn({},$u,{view:0,detail:0}),bB=pi(Ph),f_,h_,Nd,Cv=bn({},Ph,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ow,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Nd&&(Nd&&t.type==="mousemove"?(f_=t.screenX-Nd.screenX,h_=t.screenY-Nd.screenY):h_=f_=0,Nd=t),f_)},movementY:function(t){return"movementY"in t?t.movementY:h_}}),zT=pi(Cv),wB=bn({},Cv,{dataTransfer:0}),EB=pi(wB),SB=bn({},Ph,{relatedTarget:0}),p_=pi(SB),TB=bn({},$u,{animationName:0,elapsedTime:0,pseudoElement:0}),AB=pi(TB),MB=bn({},$u,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),CB=pi(MB),RB=bn({},$u,{data:0}),HT=pi(RB),PB={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},IB={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},NB={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function OB(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=NB[t])?!!e[t]:!1}function ow(){return OB}var DB=bn({},Ph,{key:function(t){if(t.key){var e=PB[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Nm(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?IB[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ow,charCode:function(t){return t.type==="keypress"?Nm(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Nm(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),kB=pi(DB),LB=bn({},Cv,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),GT=pi(LB),FB=bn({},Ph,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ow}),UB=pi(FB),jB=bn({},$u,{propertyName:0,elapsedTime:0,pseudoElement:0}),BB=pi(jB),VB=bn({},Cv,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),zB=pi(VB),HB=[9,13,27,32],aw=ho&&"CompositionEvent"in window,gf=null;ho&&"documentMode"in document&&(gf=document.documentMode);var GB=ho&&"TextEvent"in window&&!gf,A2=ho&&(!aw||gf&&8<gf&&11>=gf),$T=" ",WT=!1;function M2(t,e){switch(t){case"keyup":return HB.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function C2(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Nc=!1;function $B(t,e){switch(t){case"compositionend":return C2(e);case"keypress":return e.which!==32?null:(WT=!0,$T);case"textInput":return t=e.data,t===$T&&WT?null:t;default:return null}}function WB(t,e){if(Nc)return t==="compositionend"||!aw&&M2(t,e)?(t=T2(),Im=iw=la=null,Nc=!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.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return A2&&e.locale!=="ko"?null:e.data;default:return null}}var qB={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function qT(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!qB[t.type]:e==="textarea"}function R2(t,e,n,r){o2(r),e=mg(e,"onChange"),0<e.length&&(n=new sw("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var vf=null,Hf=null;function KB(t){B2(t,0)}function Rv(t){var e=kc(t);if(JI(e))return t}function XB(t,e){if(t==="change")return e}var P2=!1;if(ho){var m_;if(ho){var g_="oninput"in document;if(!g_){var KT=document.createElement("div");KT.setAttribute("oninput","return;"),g_=typeof KT.oninput=="function"}m_=g_}else m_=!1;P2=m_&&(!document.documentMode||9<document.documentMode)}function XT(){vf&&(vf.detachEvent("onpropertychange",I2),Hf=vf=null)}function I2(t){if(t.propertyName==="value"&&Rv(Hf)){var e=[];R2(e,Hf,t,J1(t)),u2(KB,e)}}function YB(t,e,n){t==="focusin"?(XT(),vf=e,Hf=n,vf.attachEvent("onpropertychange",I2)):t==="focusout"&&XT()}function QB(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Rv(Hf)}function ZB(t,e){if(t==="click")return Rv(e)}function JB(t,e){if(t==="input"||t==="change")return Rv(e)}function eV(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Ji=typeof Object.is=="function"?Object.is:eV;function Gf(t,e){if(Ji(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!rx.call(e,i)||!Ji(t[i],e[i]))return!1}return!0}function YT(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function QT(t,e){var n=YT(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=YT(n)}}function N2(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?N2(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function O2(){for(var t=window,e=lg();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=lg(t.document)}return e}function lw(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 tV(t){var e=O2(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&N2(n.ownerDocument.documentElement,n)){if(r!==null&&lw(n)){if(e=r.start,t=r.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 i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=QT(n,s);var o=QT(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.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<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var nV=ho&&"documentMode"in document&&11>=document.documentMode,Oc=null,wx=null,yf=null,Ex=!1;function ZT(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ex||Oc==null||Oc!==lg(r)||(r=Oc,"selectionStart"in r&&lw(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 4,501 bytes, line 37
37sNode:r.focusNode,focusOffset:r.focusOffset}),yf&&Gf(yf,r)||(yf=r,r=mg(wx,"onSelect"),0<r.length&&(e=new sw("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Oc)))}function Ap(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Dc={animationend:Ap("Animation","AnimationEnd"),animationiteration:Ap("Animation","AnimationIteration"),animationstart:Ap("Animation","AnimationStart"),transitionend:Ap("Transition","TransitionEnd")},v_={},D2={};ho&&(D2=document.createElement("div").style,"AnimationEvent"in window||(delete Dc.animationend.animation,delete Dc.animationiteration.animation,delete Dc.animationstart.animation),"TransitionEvent"in window||delete Dc.transitionend.transition);function Pv(t){if(v_[t])return v_[t];if(!Dc[t])return t;var e=Dc[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in D2)return v_[t]=e[n];return t}var k2=Pv("animationend"),L2=Pv("animationiteration"),F2=Pv("animationstart"),U2=Pv("transitionend"),j2=new Map,JT="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ha(t,e){j2.set(t,e),zl(e,[t])}for(var y_=0;y_<JT.length;y_++){var __=JT[y_],rV=__.toLowerCase(),iV=__[0].toUpperCase()+__.slice(1);Ha(rV,"on"+iV)}Ha(k2,"onAnimationEnd");Ha(L2,"onAnimationIteration");Ha(F2,"onAnimationStart");Ha("dblclick","onDoubleClick");Ha("focusin","onFocus");Ha("focusout","onBlur");Ha(U2,"onTransitionEnd");yu("onMouseEnter",["mouseout","mouseover"]);yu("onMouseLeave",["mouseout","mouseover"]);yu("onPointerEnter",["pointerout","pointerover"]);yu("onPointerLeave",["pointerout","pointerover"]);zl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));zl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));zl("onBeforeInput",["compositionend","keypress","textInput","paste"]);zl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));zl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));zl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),sV=new Set("cancel close invalid load scroll toggle".split(" ").concat(Qd));function eA(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,rB(r,e,void 0,t),t.currentTarget=null}function B2(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;eA(i,a,c),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;eA(i,a,c),s=l}}}if(ug)throw t=yx,ug=!1,yx=null,t}function nn(t,e){var n=e[Cx];n===void 0&&(n=e[Cx]=new Set);var r=t+"__bubble";n.has(r)||(V2(e,t,2,!1),n.add(r))}function x_(t,e,n){var r=0;e&&(r|=4),V2(n,t,r,e)}var Mp="_reactListening"+Math.random().toString(36).slice(2);function $f(t){if(!t[Mp]){t[Mp]=!0,KI.forEach(function(n){n!=="selectionchange"&&(sV.has(n)||x_(n,!1,t),x_(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Mp]||(e[Mp]=!0,x_("selectionchange",!1,e))}}function V2(t,e,n,r){switch(S2(e)){case 1:var i=_B;break;case 4:i=xB;break;default:i=rw}n=i.bind(null,e,n,t),i=void 0,!vx||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function b_(t,e,n,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;
vendor: 5,317 bytes, lines 37-38
37if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=hl(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}u2(function(){var c=s,d=J1(n),f=[];e:{var u=j2.get(t);if(u!==void 0){var h=sw,g=t;switch(t){case"keypress":if(Nm(n)===0)break e;case"keydown":case"keyup":h=kB;break;case"focusin":g="focus",h=p_;break;case"focusout":g="blur",h=p_;break;case"beforeblur":case"afterblur":h=p_;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=zT;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=EB;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=UB;break;case k2:case L2:case F2:h=AB;break;case U2:h=BB;break;case"scroll":h=bB;break;case"wheel":h=zB;break;case"copy":case"cut":case"paste":h=CB;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=GT}var v=(e&4)!==0,m=!v&&t==="scroll",p=v?u!==null?u+"Capture":null:u;v=[];for(var y=c,w;y!==null;){w=y;var x=w.stateNode;if(w.tag===5&&x!==null&&(w=x,p!==null&&(x=jf(y,p),x!=null&&v.push(Wf(y,x,w)))),m)break;y=y.return}0<v.length&&(u=new h(u,g,null,n,d),f.push({event:u,listeners:v}))}}if(!(e&7)){e:{if(u=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",u&&n!==mx&&(g=n.relatedTarget||n.fromElement)&&(hl(g)||g[po]))break e;if((h||u)&&(u=d.window===d?d:(u=d.ownerDocument)?u.defaultView||u.parentWindow:window,h?(g=n.relatedTarget||n.toElement,h=c,g=g?hl(g):null,g!==null&&(m=Hl(g),g!==m||g.tag!==5&&g.tag!==6)&&(g=null)):(h=null,g=c),h!==g)){if(v=zT,x="onMouseLeave",p="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(v=GT,x="onPointerLeave",p="onPointerEnter",y="pointer"),m=h==null?u:kc(h),w=g==null?u:kc(g),u=new v(x,y+"leave",h,n,d),u.target=m,u.relatedTarget=w,x=null,hl(d)===c&&(v=new v(p,y+"enter",g,n,d),v.target=w,v.relatedTarget=m,x=v),m=x,h&&g)t:{for(v=h,p=g,y=0,w=v;w;w=sc(w))y++;for(w=0,x=p;x;x=sc(x))w++;for(;0<y-w;)v=sc(v),y--;for(;0<w-y;)p=sc(p),w--;for(;y--;){if(v===p||p!==null&&v===p.alternate)break t;v=sc(v),p=sc(p)}v=null}else v=null;h!==null&&tA(f,u,h,v,!1),g!==null&&m!==null&&tA(f,m,g,v,!0)}}e:{if(u=c?kc(c):window,h=u.nodeName&&u.nodeName.toLowerCase(),h==="select"||h==="input"&&u.type==="file")var S=XB;else if(qT(u))if(P2)S=JB;else{S=QB;var I=YB}else(h=u.nodeName)&&h.toLowerCase()==="input"&&(u.type==="checkbox"||u.type==="radio")&&(S=ZB);if(S&&(S=S(t,c))){R2(f,S,n,d);break e}I&&I(t,u,c),t==="focusout"&&(I=u._wrapperState)&&I.controlled&&u.type==="number"&&ux(u,"number",u.value)}switch(I=c?kc(c):window,t){case"focusin":(qT(I)||I.contentEditable==="true")&&(Oc=I,wx=c,yf=null);break;case"focusout":yf=wx=Oc=null;break;case"mousedown":Ex=!0;break;case"contextmenu":case"mouseup":case"dragend":Ex=!1,ZT(f,n,d);break;case"selectionchange":if(nV)break;case"keydown":case"keyup":ZT(f,n,d)}var M;if(aw)e:{switch(t){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Nc?M2(t,n)&&(E="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(A2&&n.locale!=="ko"&&(Nc||E!=="onCompositionStart"?E==="onCompositionEnd"&&Nc&&(M=T2()):(la=d,iw="value"in la?la.value:la.textContent,Nc=!0)),I=mg(c,E),0<I.length&&(E=new HT(E,t,null,n,d),f.push({event:E,listeners:I}),M?E.data=M:(M=C2(n),M!==null&&(E.data=M)))),(M=GB?$B(t,n):WB(t,n))&&(c=mg(c,"onBeforeInput"),0<c.length&&(d=new HT("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:c}),d.data=M))}B2(f,e)})}function Wf(t,e,n){return{instance:t,listener:e,currentTarget:n}}function mg(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=jf(t,n),s!=null&&r.unshift(Wf(t,s,i)),s=jf(t,e),s!=null&&r.push(Wf(t,s,i))),t=t.return}return r}function sc(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function tA(t,e,n,r,i){for(var s=e._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=jf(n,s),l!=null&&o.unshift(Wf(n,l,a))):i||(l=jf(n,s),l!=null&&o.push(Wf(n,l,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var oV=/\r\n?/g,aV=/\u0000|\uFFFD/g;function nA(t){return(typeof t=="string"?t:""+t).replace(oV,`
38`).replace(aV,"")}function Cp(t,e,n){if(e=nA(e),nA(t)!==e&&n)throw Error(Re(425))}function gg(){}var Sx=null,Tx=null;function Ax(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Mx=typeof setTimeout=="function"?setTimeout:void 0,lV=typeof clearTimeout=="function"?clearTimeout:void 0,rA=typeof Promise=="function"?Promise:void 0,cV=typeof queueMicrotask=="function"?queueMicrotask:typeof rA<"u"?function(t){return rA.resolve(null).then(t).cat
vendor: 4,639 bytes, line 38
38ch(uV)}:Mx;function uV(t){setTimeout(function(){throw t})}function w_(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),zf(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);zf(e)}function ga(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function iA(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Wu=Math.random().toString(36).slice(2),ys="__reactFiber$"+Wu,qf="__reactProps$"+Wu,po="__reactContainer$"+Wu,Cx="__reactEvents$"+Wu,dV="__reactListeners$"+Wu,fV="__reactHandles$"+Wu;function hl(t){var e=t[ys];if(e)return e;for(var n=t.parentNode;n;){if(e=n[po]||n[ys]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=iA(t);t!==null;){if(n=t[ys])return n;t=iA(t)}return e}t=n,n=t.parentNode}return null}function Ih(t){return t=t[ys]||t[po],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function kc(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(Re(33))}function Iv(t){return t[qf]||null}var Rx=[],Lc=-1;function Ga(t){return{current:t}}function ln(t){0>Lc||(t.current=Rx[Lc],Rx[Lc]=null,Lc--)}function Jt(t,e){Lc++,Rx[Lc]=t.current,t.current=e}var Ca={},_r=Ga(Ca),$r=Ga(!1),Cl=Ca;function _u(t,e){var n=t.type.contextTypes;if(!n)return Ca;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Wr(t){return t=t.childContextTypes,t!=null}function vg(){ln($r),ln(_r)}function sA(t,e,n){if(_r.current!==Ca)throw Error(Re(168));Jt(_r,e),Jt($r,n)}function z2(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Re(108,Yj(t)||"Unknown",i));return bn({},n,r)}function yg(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ca,Cl=_r.current,Jt(_r,t),Jt($r,$r.current),!0}function oA(t,e,n){var r=t.stateNode;if(!r)throw Error(Re(169));n?(t=z2(t,e,Cl),r.__reactInternalMemoizedMergedChildContext=t,ln($r),ln(_r),Jt(_r,t)):ln($r),Jt($r,n)}var to=null,Nv=!1,E_=!1;function H2(t){to===null?to=[t]:to.push(t)}function hV(t){Nv=!0,H2(t)}function $a(){if(!E_&&to!==null){E_=!0;var t=0,e=Yt;try{var n=to;for(Yt=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}to=null,Nv=!1}catch(i){throw to!==null&&(to=to.slice(t+1)),p2(ew,$a),i}finally{Yt=e,E_=!1}}return null}var Fc=[],Uc=0,_g=null,xg=0,xi=[],bi=0,Rl=null,ro=1,io="";function al(t,e){Fc[Uc++]=xg,Fc[Uc++]=_g,_g=t,xg=e}function G2(t,e,n){xi[bi++]=ro,xi[bi++]=io,xi[bi++]=Rl,Rl=t;var r=ro;t=io;var i=32-Qi(r)-1;r&=~(1<<i),n+=1;var s=32-Qi(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ro=1<<32-Qi(e)+i|n<<i|r,io=s+t}else ro=1<<s|n<<i|r,io=t}function cw(t){t.return!==null&&(al(t,1),G2(t,1,0))}function uw(t){for(;t===_g;)_g=Fc[--Uc],Fc[Uc]=null,xg=Fc[--Uc],Fc[Uc]=null;for(;t===Rl;)Rl=xi[--bi],xi[bi]=null,io=xi[--bi],xi[bi]=null,ro=xi[--bi],xi[bi]=null}var ci=null,ai=null,dn=!1,Wi=null;function $2(t,e){var n=Ai(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function aA(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,ci=t,ai=ga(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,ci=t,ai=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Rl!==null?{id:ro,overflow:io}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Ai(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,ci=t,ai=null,!0):!1;default:return!1}}function Px(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Ix(t){if(dn){var e=ai;if(e){var n=e;if(!aA(t,e)){if(Px(t))throw Error(Re(418));e=ga(n.nextSibling);var r=ci;e&&aA(t,e)?$2(r,n):(t.flags=t.flags&-4097|2,dn=!1,ci=t)}}else{if(Px(t))throw Error(Re(418));t.flags=t.flags&-4097|2,dn=!1,ci=t}}}function lA(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;ci=t}function Rp(t){if(t!==ci)return!1;if(!dn)return lA(t),dn=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Ax(t.type,t.memoizedProps)),e&&(e=ai)){if
vendor: 25,808 bytes, lines 38-40
38(Px(t))throw W2(),Error(Re(418));for(;e;)$2(t,e),e=ga(e.nextSibling)}if(lA(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Re(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){ai=ga(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}ai=null}}else ai=ci?ga(t.stateNode.nextSibling):null;return!0}function W2(){for(var t=ai;t;)t=ga(t.nextSibling)}function xu(){ai=ci=null,dn=!1}function dw(t){Wi===null?Wi=[t]:Wi.push(t)}var pV=Ao.ReactCurrentBatchConfig;function Od(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Re(309));var r=n.stateNode}if(!r)throw Error(Re(147,t));var i=r,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof t!="string")throw Error(Re(284));if(!n._owner)throw Error(Re(290,t))}return t}function Pp(t,e){throw t=Object.prototype.toString.call(e),Error(Re(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function cA(t){var e=t._init;return e(t._payload)}function q2(t){function e(p,y){if(t){var w=p.deletions;w===null?(p.deletions=[y],p.flags|=16):w.push(y)}}function n(p,y){if(!t)return null;for(;y!==null;)e(p,y),y=y.sibling;return null}function r(p,y){for(p=new Map;y!==null;)y.key!==null?p.set(y.key,y):p.set(y.index,y),y=y.sibling;return p}function i(p,y){return p=xa(p,y),p.index=0,p.sibling=null,p}function s(p,y,w){return p.index=w,t?(w=p.alternate,w!==null?(w=w.index,w<y?(p.flags|=2,y):w):(p.flags|=2,y)):(p.flags|=1048576,y)}function o(p){return t&&p.alternate===null&&(p.flags|=2),p}function a(p,y,w,x){return y===null||y.tag!==6?(y=P_(w,p.mode,x),y.return=p,y):(y=i(y,w),y.return=p,y)}function l(p,y,w,x){var S=w.type;return S===Ic?d(p,y,w.props.children,x,w.key):y!==null&&(y.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Wo&&cA(S)===y.type)?(x=i(y,w.props),x.ref=Od(p,y,w),x.return=p,x):(x=jm(w.type,w.key,w.props,null,p.mode,x),x.ref=Od(p,y,w),x.return=p,x)}function c(p,y,w,x){return y===null||y.tag!==4||y.stateNode.containerInfo!==w.containerInfo||y.stateNode.implementation!==w.implementation?(y=I_(w,p.mode,x),y.return=p,y):(y=i(y,w.children||[]),y.return=p,y)}function d(p,y,w,x,S){return y===null||y.tag!==7?(y=Tl(w,p.mode,x,S),y.return=p,y):(y=i(y,w),y.return=p,y)}function f(p,y,w){if(typeof y=="string"&&y!==""||typeof y=="number")return y=P_(""+y,p.mode,w),y.return=p,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case _p:return w=jm(y.type,y.key,y.props,null,p.mode,w),w.ref=Od(p,null,y),w.return=p,w;case Pc:return y=I_(y,p.mode,w),y.return=p,y;case Wo:var x=y._init;return f(p,x(y._payload),w)}if(Xd(y)||Cd(y))return y=Tl(y,p.mode,w,null),y.return=p,y;Pp(p,y)}return null}function u(p,y,w,x){var S=y!==null?y.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return S!==null?null:a(p,y,""+w,x);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case _p:return w.key===S?l(p,y,w,x):null;case Pc:return w.key===S?c(p,y,w,x):null;case Wo:return S=w._init,u(p,y,S(w._payload),x)}if(Xd(w)||Cd(w))return S!==null?null:d(p,y,w,x,null);Pp(p,w)}return null}function h(p,y,w,x,S){if(typeof x=="string"&&x!==""||typeof x=="number")return p=p.get(w)||null,a(y,p,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case _p:return p=p.get(x.key===null?w:x.key)||null,l(y,p,x,S);case Pc:return p=p.get(x.key===null?w:x.key)||null,c(y,p,x,S);case Wo:var I=x._init;return h(p,y,w,I(x._payload),S)}if(Xd(x)||Cd(x))return p=p.get(w)||null,d(y,p,x,S,null);Pp(y,x)}return null}function g(p,y,w,x){for(var S=null,I=null,M=y,E=y=0,C=null;M!==null&&E<w.length;E++){M.index>E?(C=M,M=null):C=M.sibling;var T=u(p,M,w[E],x);if(T===null){M===null&&(M=C);break}t&&M&&T.alternate===null&&e(p,M),y=s(T,y,E),I===null?S=T:I.sibling=T,I=T,M=C}if(E===w.length)return n(p,M),dn&&al(p,E),S;if(M===null){for(;E<w.length;E++)M=f(p,w[E],x),M!==null&&(y=s(M,y,E),I===null?S=M:I.sibling=M,I=M);return dn&&al(p,E),S}for(M=r(p,M);E<w.length;E++)C=h(M,p,E,w[E],x),C!==null&&(t&&C.alternate!==null&&M.delete(C.key===null?E:C.key),y=s(C,y,E),I===null?S=C:I.sibling=C,I=C);return t&&M.forEach(function(A){return e(p,A)}),dn&&al(p,E),S}function v(p,y,w,x){var S=Cd(w);if(typeof S!="function")throw Error(Re(150));if(w=S.call(w),w==null)throw Error(Re(151));for(var I=S=null,M=y,E=y=0,C=null,T=w.next();M!==null&&!T.done;E++,T=w.next()){M.index>E?(C=M,M=null):C=M.sibling;var A=u(p,M,T.value,x);if(A===null){M===null&&(M=C);break}t&&M&&A.alternate===null&&e(p,M),y=s(A,y,E),I===null?S=A:I.sibling=A,I=A,M=C}if(T.done)return n(p,M),dn&&al(p,E),S;if(M===null){for(;!T.done;E++,T=w.next())T=f(p,T.value,x),T!==null&&(y=s(T,y,E),I===null?S=T:I.sibling=T,I=T);return dn&&al(p,E),S}for(M=r(p,M);!T.done;E++,T=w.next())T=h(M,p,E,T.value,x),T!==null&&(t&&T.alternate!==null&&M.delete(T.key===null?E:T.key),y=s(T,y,E),I===null?S=T:I.sibling=T,I=T);return t&&M.forEach(function(R){return e(p,R)}),dn&&al(p,E),S}function m(p,y,w,x){if(typeof w=="object"&&w!==null&&w.type===Ic&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case _p:e:{for(var S=w.key,I=y;I!==null;){if(I.key===S){if(S=w.type,S===Ic){if(I.tag===7){n(p,I.sibling),y=i(I,w.props.children),y.return=p,p=y;break e}}else if(I.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Wo&&cA(S)===I.type){n(p,I.sibling),y=i(I,w.props),y.ref=Od(p,I,w),y.return=p,p=y;break e}n(p,I);break}else e(p,I);I=I.sibling}w.type===Ic?(y=Tl(w.props.children,p.mode,x,w.key),y.return=p,p=y):(x=jm(w.type,w.key,w.props,null,p.mode,x),x.ref=Od(p,y,w),x.return=p,p=x)}return o(p);case Pc:e:{for(I=w.key;y!==null;){if(y.key===I)if(y.tag===4&&y.stateNode.containerInfo===w.containerInfo&&y.stateNode.implementation===w.implementation){n(p,y.sibling),y=i(y,w.children||[]),y.return=p,p=y;break e}else{n(p,y);break}else e(p,y);y=y.sibling}y=I_(w,p.mode,x),y.return=p,p=y}return o(p);case Wo:return I=w._init,m(p,y,I(w._payload),x)}if(Xd(w))return g(p,y,w,x);if(Cd(w))return v(p,y,w,x);Pp(p,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,y!==null&&y.tag===6?(n(p,y.sibling),y=i(y,w),y.return=p,p=y):(n(p,y),y=P_(w,p.mode,x),y.return=p,p=y),o(p)):n(p,y)}return m}var bu=q2(!0),K2=q2(!1),bg=Ga(null),wg=null,jc=null,fw=null;function hw(){fw=jc=wg=null}function pw(t){var e=bg.current;ln(bg),t._currentValue=e}function Nx(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Yc(t,e){wg=t,fw=jc=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Gr=!0),t.firstContext=null)}function Ri(t){var e=t._currentValue;if(fw!==t)if(t={context:t,memoizedValue:e,next:null},jc===null){if(wg===null)throw Error(Re(308));jc=t,wg.dependencies={lanes:0,firstContext:t}}else jc=jc.next=t;return e}var pl=null;function mw(t){pl===null?pl=[t]:pl.push(t)}function X2(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,mw(e)):(n.next=i.next,i.next=n),e.interleaved=n,mo(t,r)}function mo(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var qo=!1;function gw(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Y2(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function lo(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function va(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Ut&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,mo(t,n)}return i=r.interleaved,i===null?(e.next=e,mw(r)):(e.next=i.next,i.next=e),r.interleaved=e,mo(t,n)}function Om(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,tw(t,n)}}function uA(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Eg(t,e,n,r){var i=t.updateQueue;qo=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var d=t.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(s!==null){var f=i.baseState;o=0,d=c=l=null,a=s;do{var u=a.lane,h=a.eventTime;if((r&u)===u){d!==null&&(d=d.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=t,v=a;switch(u=e,h=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){f=g.call(h,f,u);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,u=typeof g=="function"?g.call(h,f,u):g,u==null)break e;f=bn({},f,u);break e;case 2:qo=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,u=i.effects,u===null?i.effects=[a]:u.push(a))}else h={eventTime:h,lane:u,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=h,l=f):d=d.next=h,o|=u;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;u=a,a=u.next,u.next=null,i.lastBaseUpdate=u,i.shared.pending=null}}while(!0);if(d===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Il|=o,t.lanes=o,t.memoizedState=f}}function dA(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(Re(191,i));i.call(r)}}}var Nh={},Ss=Ga(Nh),Kf=Ga(Nh),Xf=Ga(Nh);function ml(t){if(t===Nh)throw Error(Re(174));return t}function vw(t,e){switch(Jt(Xf,e),Jt(Kf,t),Jt(Ss,Nh),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:fx(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=fx(e,t)}ln(Ss),Jt(Ss,e)}function wu(){ln(Ss),ln(Kf),ln(Xf)}function Q2(t){ml(Xf.current);var e=ml(Ss.current),n=fx(e,t.type);e!==n&&(Jt(Kf,t),Jt(Ss,n))}function yw(t){Kf.current===t&&(ln(Ss),ln(Kf))}var vn=Ga(0);function Sg(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 S_=[];function _w(){for(var t=0;t<S_.length;t++)S_[t]._workInProgressVersionPrimary=null;S_.length=0}var Dm=Ao.ReactCurrentDispatcher,T_=Ao.ReactCurrentBatchConfig,Pl=0,yn=null,Un=null,Kn=null,Tg=!1,_f=!1,Yf=0,mV=0;function cr(){throw Error(Re(321))}function xw(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Ji(t[n],e[n]))return!1;return!0}function bw(t,e,n,r,i,s){if(Pl=s,yn=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Dm.current=t===null||t.memoizedState===null?_V:xV,t=n(r,i),_f){s=0;do{if(_f=!1,Yf=0,25<=s)throw Error(Re(301));s+=1,Kn=Un=null,e.updateQueue=null,Dm.current=bV,t=n(r,i)}while(_f)}if(Dm.current=Ag,e=Un!==null&&Un.next!==null,Pl=0,Kn=Un=yn=null,Tg=!1,e)throw Error(Re(300));return t}function ww(){var t=Yf!==0;return Yf=0,t}function fs(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kn===null?yn.memoizedState=Kn=t:Kn=Kn.next=t,Kn}function Pi(){if(Un===null){var t=yn.alternate;t=t!==null?t.memoizedState:null}else t=Un.next;var e=Kn===null?yn.memoizedState:Kn.next;if(e!==null)Kn=e,Un=t;else{if(t===null)throw Error(Re(310));Un=t,t={memoizedState:Un.memoizedState,baseState:Un.baseState,baseQueue:Un.baseQueue,queue:Un.queue,next:null},Kn===null?yn.memoizedState=Kn=t:Kn=Kn.next=t}return Kn}function Qf(t,e){return typeof e=="function"?e(t):e}function A_(t){var e=Pi(),n=e.queue;if(n===null)throw Error(Re(311));n.lastRenderedReducer=t;var r=Un,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,c=s;do{var d=c.lane;if((Pl&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:t(r,c.action);else{var f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,yn.lanes|=d,Il|=d}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,Ji(r,e.memoizedState)||(Gr=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do s=i.lane,yn.lanes|=s,Il|=s,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function M_(t){var e=Pi(),n=e.queue;if(n===null)throw Error(Re(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,s=e.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=t(s,o.action),o=o.next;while(o!==i);Ji(s,e.memoizedState)||(Gr=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function Z2(){}function J2(t,e){var n=yn,r=Pi(),i=e(),s=!Ji(r.memoizedState,i);if(s&&(r.memoizedState=i,Gr=!0),r=r.queue,Ew(nN.bind(null,n,r,t),[t]),r.getSnapshot!==e||s||Kn!==null&&Kn.memoizedState.tag&1){if(n.flags|=2048,Zf(9,tN.bind(null,n,r,i,e),void 0,null),Xn===null)throw Error(Re(349));Pl&30||eN(n,e,i)}return i}function eN(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=yn.updateQueue,e===null?(e={lastEffect:null,stores:null},yn.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function tN(t,e,n,r){e.value=n,e.getSnapshot=r,rN(e)&&iN(t)}function nN(t,e,n){return n(function(){rN(e)&&iN(t)})}function rN(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Ji(t,n)}catch{return!0}}function iN(t){var e=mo(t,1);e!==null&&Zi(e,t,1,-1)}function fA(t){var e=fs();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Qf,lastRenderedState:t},e.queue=t,t=t.dispatch=yV.bind(null,yn,t),[e.memoizedState,t]}function Zf(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=yn.updateQueue,e===null?(e={lastEffect:null,stores:null},yn.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function sN(){return Pi().memoizedState}function km(t,e,n,r){var i=fs();yn.flags|=t,i.memoizedState=Zf(1|e,n,void 0,r===void 0?null:r)}function Ov(t,e,n,r){var i=Pi();r=r===void 0?null:r;var s=void 0;if(Un!==null){var o=Un.memoizedState;if(s=o.destroy,r!==null&&xw(r,o.deps)){i.memoizedState=Zf(e,n,s,r);return}}yn.flags|=t,i.memoizedState=Zf(1|e,n,s,r)}function hA(t,e){return km(8390656,8,t,e)}function Ew(t,e){return Ov(2048,8,t,e)}function oN(t,e){return Ov(4,2,t,e)}function aN(t,e){return Ov(4,4,t,e)}function lN(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function cN(t,e,n){return n=n!=null?n.concat([t]):null,Ov(4,4,lN.bind(null,e,t),n)}function Sw(){}function uN(t,e){var n=Pi();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&xw(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function dN(t,e){var n=Pi();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&xw(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function fN(t,e,n){return Pl&21?(Ji(n,e)||(n=v2(),yn.lanes|=n,Il|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Gr=!0),t.memoizedState=n)}function gV(t,e){var n=Yt;Yt=n!==0&&4>n?n:4,t(!0);var r=T_.transition;T_.transition={};try{t(!1),e()}finally{Yt=n,T_.transition=r}}function hN(){return Pi().memoizedState}function vV(t,e,n){var r=_a(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},pN(t))mN(e,n);else if(n=X2(t,e,n,r),n!==null){var i=Cr();Zi(n,t,r,i),gN(n,e,r)}}function yV(t,e,n){var r=_a(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(pN(t))mN(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Ji(a,o)){var l=e.interleaved;l===null?(i.next=i,mw(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=X2(t,e,i,r),n!==null&&(i=Cr(),Zi(n,t,r,i),gN(n,e,r))}}function pN(t){var e=t.alternate;return t===yn||e!==null&&e===yn}function mN(t,e){_f=Tg=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function gN(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,tw(t,n)}}var Ag={readContext:Ri,useCallback:cr,useContext:cr,useEffect:cr,useImperativeHandle:cr,useInsertionEffect:cr,useLayoutEffect:cr,useMemo:cr,useReducer:cr,useRef:cr,useState:cr,useDebugValue:cr,useDeferredValue:cr,useTransition:cr,useMutableSource:cr,useSyncExternalStore:cr,useId:cr,unstable_isNewReconciler:!1},_V={readContext:Ri,useCallback:function(t,e){return fs().memoizedState=[t,e===void 0?null:e],t},useContext:Ri,useEffect:hA,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,km(4194308,4,lN.bind(null,e,t),n)},useLayoutEffect:function(t,e){return km(4194308,4,t,e)},useInsertionEffect:function(t,e){return km(4,2,t,e)},useMemo:function(t,e){var n=fs();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=fs();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=vV.bind(null,yn,t),[r.memoizedState,t]},useRef:function(t){var e=fs();return t={current:t},e.memoizedState=t},useState:fA,useDebugValue:Sw,useDeferredValue:function(t){return fs().memoizedState=t},useTransition:function(){var t=fA(!1),e=t[0];return t=gV.bind(null,t[1]),fs().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=yn,i=fs();if(dn){if(n===void 0)throw Error(Re(407));n=n()}else{if(n=e(),Xn===null)throw Error(Re(349));Pl&30||eN(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,hA(nN.bind(null,r,s,t),[t]),r.flags|=2048,Zf(9,tN.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=fs(),e=Xn.identifierPrefix;if(dn){var n=io,r=ro;n=(r&~(1<<32-Qi(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Yf++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=mV++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},xV={readContext:Ri,useCallback:uN,useContext:Ri,useEffect:Ew,useImperativeHandle:cN,useInsertionEffect:oN,useLayoutEffect:aN,useMemo:dN,useReducer:A_,useRef:sN,useState:function(){return A_(Qf)},useDebugValue:Sw,useDeferredValue:function(t){var e=Pi();return fN(e,Un.memoizedState,t)},useTransition:function(){var t=A_(Qf)[0],e=Pi().memoizedState;return[t,e]},useMutableSource:Z2,useSyncExternalStore:J2,useId:hN,unstable_isNewReconciler:!1},bV={readContext:Ri,useCallback:uN,useContext:Ri,useEffect:Ew,useImperativeHandle:cN,useInsertionEffect:oN,useLayoutEffect:aN,useMemo:dN,useReducer:M_,useRef:sN,useState:function(){return M_(Qf)},useDebugValue:Sw,useDeferredValue:function(t){var e=Pi();return Un===null?e.memoizedState=t:fN(e,Un.memoizedState,t)},useTransition:function(){var t=M_(Qf)[0],e=Pi().memoizedState;return[t,e]},useMutableSource:Z2,useSyncExternalStore:J2,useId:hN,unstable_isNewReconciler:!1};function zi(t,e){if(t&&t.defaultProps){e=bn({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function Ox(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:bn({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Dv={isMounted:function(t){return(t=t._reactInternals)?Hl(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=Cr(),i=_a(t),s=lo(r,i);s.payload=e,n!=null&&(s.callback=n),e=va(t,s,i),e!==null&&(Zi(e,t,i,r),Om(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=Cr(),i=_a(t),s=lo(r,i);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=va(t,s,i),e!==null&&(Zi(e,t,i,r),Om(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Cr(),r=_a(t),i=lo(n,r);i.tag=2,e!=null&&(i.callback=e),e=va(t,i,r),e!==null&&(Zi(e,t,r,n),Om(e,t,r))}};function pA(t,e,n,r,i,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!Gf(n,r)||!Gf(i,s):!0}function vN(t,e,n){var r=!1,i=Ca,s=e.contextType;return typeof s=="object"&&s!==null?s=Ri(s):(i=Wr(e)?Cl:_r.current,r=e.contextTypes,s=(r=r!=null)?_u(t,i):Ca),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Dv,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function mA(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Dv.enqueueReplaceState(e,e.state,null)}function Dx(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},gw(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=Ri(s):(s=Wr(e)?Cl:_r.current,i.context=_u(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(Ox(t,e,s,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&Dv.enqueueReplaceState(i,i.state,null),Eg(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Eu(t,e){try{var n="",r=e;do n+=Xj(r),r=r.return;while(r);var i=n}catch(s){i=`
39Error generating stack: `+s.message+`
40`+s.stack}return{value:t,source:e,stack:i,digest:null}}function C_(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function kx(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var wV=typeof WeakMap=="function"?WeakMap:Map;function yN(t,e,n){n=lo(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Cg||(Cg=!0,$x=r),kx(t,e)},n}function _N(t,e,n){n=lo(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){kx(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){kx(t,e),typeof r!="function"&&(ya===null?ya=new Set([this]):ya.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function gA(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new wV;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=LV.bind(null,t,e,n),e.then(t,t))}function vA(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 yA(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,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=lo(-1,1),e.tag=2,va(n,e,1))),n.lanes|=1),t)}var EV=Ao.ReactCurrentOwner,Gr=!1;function Ar(t,e,n,r){e.child=t===null?K2(e,null,n,r):bu(e,t.child,n,r)}function _A(t,e,n,r,i){n=n.render;var s=e.ref;return Yc(e,i),r=bw(t,e,n,r,s,i),n=ww(),t!==null&&!Gr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,go(t,e,i)):(dn&&n&&cw(e),e.flags|=1,Ar(t,e,r,i),e.child)}function xA(t,e,n,r,i){if(t===null){var s=n.type;return typeof s=="function"&&!Nw(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,xN(t,e,s,r,i)):(t=jm(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Gf,n(o,r)&&t.ref===e.ref)return go(t,e,i)}return e.flags|=1,t=xa(s,r),t.ref=e.ref,t.return=e,e.child=t}function xN(t,e,n,r,i){if(t!==null){var s=t.memoizedProps;if(Gf(s,r)&&t.ref===e.ref)if(Gr=!1,e.pendingProps=r=s,(t.lanes&i)!==0)t.flags&131072&&(Gr=!0);else return e.lanes=t.lanes,go(t,e,i)}return Lx(t,e,n,r,i)}function bN(t,e,n){var r=e.pendingProps,i=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Jt(Vc,ri),ri|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Jt(Vc,ri),ri|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Jt(Vc,ri),ri|=r}else s!==null?(r=s.baseLanes|n,e.memoizedState=null):r=n,Jt(Vc,ri),ri|=r;return Ar(t,e,i,n),e.child}function wN(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}
vendor: 7,846 bytes, line 40
40function Lx(t,e,n,r,i){var s=Wr(n)?Cl:_r.current;return s=_u(e,s),Yc(e,i),n=bw(t,e,n,r,s,i),r=ww(),t!==null&&!Gr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,go(t,e,i)):(dn&&r&&cw(e),e.flags|=1,Ar(t,e,n,i),e.child)}function bA(t,e,n,r,i){if(Wr(n)){var s=!0;yg(e)}else s=!1;if(Yc(e,i),e.stateNode===null)Lm(t,e),vN(e,n,r),Dx(e,n,r,i),r=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Ri(c):(c=Wr(n)?Cl:_r.current,c=_u(e,c));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&mA(e,o,r,c),qo=!1;var u=e.memoizedState;o.state=u,Eg(e,r,o,i),l=e.memoizedState,a!==r||u!==l||$r.current||qo?(typeof d=="function"&&(Ox(e,n,d,r),l=e.memoizedState),(a=qo||pA(e,n,a,r,u,l,c))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,Y2(t,e),a=e.memoizedProps,c=e.type===e.elementType?a:zi(e.type,a),o.props=c,f=e.pendingProps,u=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Ri(l):(l=Wr(n)?Cl:_r.current,l=_u(e,l));var h=n.getDerivedStateFromProps;(d=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||u!==l)&&mA(e,o,r,l),qo=!1,u=e.memoizedState,o.state=u,Eg(e,r,o,i);var g=e.memoizedState;a!==f||u!==g||$r.current||qo?(typeof h=="function"&&(Ox(e,n,h,r),g=e.memoizedState),(c=qo||pA(e,n,c,r,u,g,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&u===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&u===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=g),o.props=r,o.state=g,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&u===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&u===t.memoizedState||(e.flags|=1024),r=!1)}return Fx(t,e,n,r,s,i)}function Fx(t,e,n,r,i,s){wN(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&oA(e,n,!1),go(t,e,s);r=e.stateNode,EV.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=bu(e,t.child,null,s),e.child=bu(e,null,a,s)):Ar(t,e,a,s),e.memoizedState=r.state,i&&oA(e,n,!0),e.child}function EN(t){var e=t.stateNode;e.pendingContext?sA(t,e.pendingContext,e.pendingContext!==e.context):e.context&&sA(t,e.context,!1),vw(t,e.containerInfo)}function wA(t,e,n,r,i){return xu(),dw(i),e.flags|=256,Ar(t,e,n,r),e.child}var Ux={dehydrated:null,treeContext:null,retryLane:0};function jx(t){return{baseLanes:t,cachePool:null,transitions:null}}function SN(t,e,n){var r=e.pendingProps,i=vn.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),Jt(vn,i&1),t===null)return Ix(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):(o=r.children,t=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Fv(o,r,0,null),t=Tl(t,r,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=jx(n),e.memoizedState=Ux,t):Tw(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return SV(t,e,o,r,a,i,n);if(s){s=r.fallback,o=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=xa(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=xa(a,s):(s=Tl(s,o,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=t.child.memoizedState,o=o===null?jx(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~n,e.memoizedState=Ux,r}return s=t.child,t=s.sibling,r=xa(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Tw(t,e){return e=Fv({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Ip(t,e,n,r){return r!==null&&dw(r),bu(e,t.child,null,n),t=Tw(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function SV(t,e,n,r,i,s,o){if(n)return e.flags&256?(e.flags&=-257,r=C_(Error(Re(422))),Ip(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=Fv({mode:"visible",children:r.children},i,0,null),s=Tl(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&bu(e,t.child,null,o),e.child.memoizedState=jx(o),e.memoizedState=Ux,s);if(!(e.mode&1))return Ip(t,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(Re(419)),r=C_(s,r,void 0),Ip(t,e,o,r)}if(a=(o&t.childLanes)!==0,Gr||a){if(r=Xn,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,mo(t,i),Zi(r,t,i,-1))}return Iw(),r=C_(Error(Re(421))),Ip(t,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=FV.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,ai=ga(i.nextSibling),ci=e,dn=!0,Wi=null,t!==null&&(xi[bi++]=ro,xi[bi++]=io,xi[bi++]=Rl,ro=t.id,io=t.overflow,Rl=e),e=Tw(e,r.children),e.flags|=4096,e)}function EA(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Nx(t.return,e,n)}function R_(t,e,n,r,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function TN(t,e,n){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(Ar(t,e,r.children,n),r=vn.current,r&2)r=r&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&&EA(t,n,e);else if(t.tag===19)EA(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}r&=1}if(Jt(vn,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&Sg(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),R_(e,!1,i,n,s);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Sg(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}R_(e,!0,n,null,s);break;
vendor: 4,244 bytes, line 40
40case"together":R_(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Lm(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function go(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Il|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Re(153));if(e.child!==null){for(t=e.child,n=xa(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=xa(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function TV(t,e,n){switch(e.tag){case 3:EN(e),xu();break;case 5:Q2(e);break;case 1:Wr(e.type)&&yg(e);break;case 4:vw(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Jt(bg,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Jt(vn,vn.current&1),e.flags|=128,null):n&e.child.childLanes?SN(t,e,n):(Jt(vn,vn.current&1),t=go(t,e,n),t!==null?t.sibling:null);Jt(vn,vn.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return TN(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Jt(vn,vn.current),r)break;return null;case 22:case 23:return e.lanes=0,bN(t,e,n)}return go(t,e,n)}var AN,Bx,MN,CN;AN=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}};Bx=function(){};MN=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,ml(Ss.current);var s=null;switch(n){case"input":i=lx(t,i),r=lx(t,r),s=[];break;case"select":i=bn({},i,{value:void 0}),r=bn({},r,{value:void 0}),s=[];break;case"textarea":i=dx(t,i),r=dx(t,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=gg)}hx(n,r);var o;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Ff.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Ff.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&nn("scroll",t),s||a===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(e.updateQueue=c)&&(e.flags|=4)}};CN=function(t,e,n,r){n!==r&&(e.flags|=4)};function Dd(t,e){if(!dn)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function ur(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function AV(t,e,n){var r=e.pendingProps;switch(uw(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ur(e),null;case 1:return Wr(e.type)&&vg(),ur(e),null;case 3:return r=e.stateNode,wu(),ln($r),ln(_r),_w(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Rp(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Wi!==null&&(Kx(Wi),Wi=null))),Bx(t,e),ur(e),null;case 5:yw(e);
vendor: 33,371 bytes, line 40
40var i=ml(Xf.current);if(n=e.type,t!==null&&e.stateNode!=null)MN(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(Re(166));return ur(e),null}if(t=ml(Ss.current),Rp(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[ys]=e,r[qf]=s,t=(e.mode&1)!==0,n){case"dialog":nn("cancel",r),nn("close",r);break;case"iframe":case"object":case"embed":nn("load",r);break;case"video":case"audio":for(i=0;i<Qd.length;i++)nn(Qd[i],r);break;case"source":nn("error",r);break;case"img":case"image":case"link":nn("error",r),nn("load",r);break;case"details":nn("toggle",r);break;case"input":NT(r,s),nn("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},nn("invalid",r);break;case"textarea":DT(r,s),nn("invalid",r)}hx(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Cp(r.textContent,a,t),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Cp(r.textContent,a,t),i=["children",""+a]):Ff.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&nn("scroll",r)}switch(n){case"input":xp(r),OT(r,s,!0);break;case"textarea":xp(r),kT(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=gg)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=n2(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[ys]=e,t[qf]=r,AN(t,e,!1,!1),e.stateNode=t;e:{switch(o=px(n,r),n){case"dialog":nn("cancel",t),nn("close",t),i=r;break;case"iframe":case"object":case"embed":nn("load",t),i=r;break;case"video":case"audio":for(i=0;i<Qd.length;i++)nn(Qd[i],t);i=r;break;case"source":nn("error",t),i=r;break;case"img":case"image":case"link":nn("error",t),nn("load",t),i=r;break;case"details":nn("toggle",t),i=r;break;case"input":NT(t,r),i=lx(t,r),nn("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=bn({},r,{value:void 0}),nn("invalid",t);break;case"textarea":DT(t,r),i=dx(t,r),nn("invalid",t);break;default:i=r}hx(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?s2(t,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&r2(t,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Uf(t,l):typeof l=="number"&&Uf(t,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ff.hasOwnProperty(s)?l!=null&&s==="onScroll"&&nn("scroll",t):l!=null&&X1(t,s,l,o))}switch(n){case"input":xp(t),OT(t,r,!1);break;case"textarea":xp(t),kT(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Ma(r.value));break;case"select":t.multiple=!!r.multiple,s=r.value,s!=null?Wc(t,!!r.multiple,s,!1):r.defaultValue!=null&&Wc(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=gg)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return ur(e),null;case 6:if(t&&e.stateNode!=null)CN(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(Re(166));if(n=ml(Xf.current),ml(Ss.current),Rp(e)){if(r=e.stateNode,n=e.memoizedProps,r[ys]=e,(s=r.nodeValue!==n)&&(t=ci,t!==null))switch(t.tag){case 3:Cp(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Cp(r.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ys]=e,e.stateNode=r}return ur(e),null;case 13:if(ln(vn),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(dn&&ai!==null&&e.mode&1&&!(e.flags&128))W2(),xu(),e.flags|=98560,s=!1;else if(s=Rp(e),r!==null&&r.dehydrated!==null){if(t===null){if(!s)throw Error(Re(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Re(317));s[ys]=e}else xu(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;ur(e),s=!1}else Wi!==null&&(Kx(Wi),Wi=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||vn.current&1?Bn===0&&(Bn=3):Iw())),e.updateQueue!==null&&(e.flags|=4),ur(e),null);case 4:return wu(),Bx(t,e),t===null&&$f(e.stateNode.containerInfo),ur(e),null;case 10:return pw(e.type._context),ur(e),null;case 17:return Wr(e.type)&&vg(),ur(e),null;case 19:if(ln(vn),s=e.memoizedState,s===null)return ur(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)Dd(s,!1);else{if(Bn!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Sg(t),o!==null){for(e.flags|=128,Dd(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)s=n,t=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,t=o.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return Jt(vn,vn.current&1|2),e.child}t=t.sibling}s.tail!==null&&Rn()>Su&&(e.flags|=128,r=!0,Dd(s,!1),e.lanes=4194304)}else{if(!r)if(t=Sg(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Dd(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!dn)return ur(e),null}else 2*Rn()-s.renderingStartTime>Su&&n!==1073741824&&(e.flags|=128,r=!0,Dd(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Rn(),e.sibling=null,n=vn.current,Jt(vn,r?n&1|2:n&1),e):(ur(e),null);case 22:case 23:return Pw(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ri&1073741824&&(ur(e),e.subtreeFlags&6&&(e.flags|=8192)):ur(e),null;case 24:return null;case 25:return null}throw Error(Re(156,e.tag))}function MV(t,e){switch(uw(e),e.tag){case 1:return Wr(e.type)&&vg(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return wu(),ln($r),ln(_r),_w(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return yw(e),null;case 13:if(ln(vn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Re(340));xu()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ln(vn),null;case 4:return wu(),null;case 10:return pw(e.type._context),null;case 22:case 23:return Pw(),null;case 24:return null;default:return null}}var Np=!1,gr=!1,CV=typeof WeakSet=="function"?WeakSet:Set,Ye=null;function Bc(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Tn(t,e,r)}else n.current=null}function Vx(t,e,n){try{n()}catch(r){Tn(t,e,r)}}var SA=!1;function RV(t,e){if(Sx=hg,t=O2(),lw(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,d=0,f=t,u=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(a=o+i),f!==s||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)u=f,f=h;for(;;){if(f===t)break t;if(u===n&&++c===i&&(a=o),u===s&&++d===r&&(l=o),(h=f.nextSibling)!==null)break;f=u,u=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Tx={focusedElem:t,selectionRange:n},hg=!1,Ye=e;Ye!==null;)if(e=Ye,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ye=t;else for(;Ye!==null;){e=Ye;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 v=g.memoizedProps,m=g.memoizedState,p=e.stateNode,y=p.getSnapshotBeforeUpdate(e.elementType===e.type?v:zi(e.type,v),m);p.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Re(163))}}catch(x){Tn(e,e.return,x)}if(t=e.sibling,t!==null){t.return=e.return,Ye=t;break}Ye=e.return}return g=SA,SA=!1,g}function xf(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Vx(e,n,s)}i=i.next}while(i!==r)}}function kv(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 r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function zx(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 RN(t){var e=t.alternate;e!==null&&(t.alternate=null,RN(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ys],delete e[qf],delete e[Cx],delete e[dV],delete e[fV])),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 PN(t){return t.tag===5||t.tag===3||t.tag===4}function TA(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||PN(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 Hx(t,e,n){var r=t.tag;if(r===5||r===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=gg));else if(r!==4&&(t=t.child,t!==null))for(Hx(t,e,n),t=t.sibling;t!==null;)Hx(t,e,n),t=t.sibling}function Gx(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Gx(t,e,n),t=t.sibling;t!==null;)Gx(t,e,n),t=t.sibling}var Zn=null,$i=!1;function Do(t,e,n){for(n=n.child;n!==null;)IN(t,e,n),n=n.sibling}function IN(t,e,n){if(Es&&typeof Es.onCommitFiberUnmount=="function")try{Es.onCommitFiberUnmount(Mv,n)}catch{}switch(n.tag){case 5:gr||Bc(n,e);case 6:var r=Zn,i=$i;Zn=null,Do(t,e,n),Zn=r,$i=i,Zn!==null&&($i?(t=Zn,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Zn.removeChild(n.stateNode));break;case 18:Zn!==null&&($i?(t=Zn,n=n.stateNode,t.nodeType===8?w_(t.parentNode,n):t.nodeType===1&&w_(t,n),zf(t)):w_(Zn,n.stateNode));break;case 4:r=Zn,i=$i,Zn=n.stateNode.containerInfo,$i=!0,Do(t,e,n),Zn=r,$i=i;break;case 0:case 11:case 14:case 15:if(!gr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Vx(n,e,o),i=i.next}while(i!==r)}Do(t,e,n);break;case 1:if(!gr&&(Bc(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Tn(n,e,a)}Do(t,e,n);break;case 21:Do(t,e,n);break;case 22:n.mode&1?(gr=(r=gr)||n.memoizedState!==null,Do(t,e,n),gr=r):Do(t,e,n);break;default:Do(t,e,n)}}function AA(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new CV),e.forEach(function(r){var i=UV.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ui(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:Zn=a.stateNode,$i=!1;break e;case 3:Zn=a.stateNode.containerInfo,$i=!0;break e;case 4:Zn=a.stateNode.containerInfo,$i=!0;break e}a=a.return}if(Zn===null)throw Error(Re(160));IN(s,o,i),Zn=null,$i=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Tn(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)NN(e,t),e=e.sibling}function NN(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Ui(e,t),ls(t),r&4){try{xf(3,t,t.return),kv(3,t)}catch(v){Tn(t,t.return,v)}try{xf(5,t,t.return)}catch(v){Tn(t,t.return,v)}}break;case 1:Ui(e,t),ls(t),r&512&&n!==null&&Bc(n,n.return);break;case 5:if(Ui(e,t),ls(t),r&512&&n!==null&&Bc(n,n.return),t.flags&32){var i=t.stateNode;try{Uf(i,"")}catch(v){Tn(t,t.return,v)}}if(r&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,o=n!==null?n.memoizedProps:s,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&e2(i,s),px(a,o);var c=px(a,s);for(o=0;o<l.length;o+=2){var d=l[o],f=l[o+1];d==="style"?s2(i,f):d==="dangerouslySetInnerHTML"?r2(i,f):d==="children"?Uf(i,f):X1(i,d,f,c)}switch(a){case"input":cx(i,s);break;case"textarea":t2(i,s);break;case"select":var u=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?Wc(i,!!s.multiple,h,!1):u!==!!s.multiple&&(s.defaultValue!=null?Wc(i,!!s.multiple,s.defaultValue,!0):Wc(i,!!s.multiple,s.multiple?[]:"",!1))}i[qf]=s}catch(v){Tn(t,t.return,v)}}break;case 6:if(Ui(e,t),ls(t),r&4){if(t.stateNode===null)throw Error(Re(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(v){Tn(t,t.return,v)}}break;case 3:if(Ui(e,t),ls(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{zf(e.containerInfo)}catch(v){Tn(t,t.return,v)}break;case 4:Ui(e,t),ls(t);break;case 13:Ui(e,t),ls(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Cw=Rn())),r&4&&AA(t);break;case 22:if(d=n!==null&&n.memoizedState!==null,t.mode&1?(gr=(c=gr)||d,Ui(e,t),gr=c):Ui(e,t),ls(t),r&8192){if(c=t.memoizedState!==null,(t.stateNode.isHidden=c)&&!d&&t.mode&1)for(Ye=t,d=t.child;d!==null;){for(f=Ye=d;Ye!==null;){switch(u=Ye,h=u.child,u.tag){case 0:case 11:case 14:case 15:xf(4,u,u.return);break;case 1:Bc(u,u.return);var g=u.stateNode;if(typeof g.componentWillUnmount=="function"){r=u,n=u.return;try{e=r,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(v){Tn(r,n,v)}}break;case 5:Bc(u,u.return);break;case 22:if(u.memoizedState!==null){CA(f);continue}}h!==null?(h.return=u,Ye=h):CA(f)}d=d.sibling}e:for(d=null,f=t;;){if(f.tag===5){if(d===null){d=f;try{i=f.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=i2("display",o))}catch(v){Tn(t,t.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(v){Tn(t,t.return,v)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===t)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Ui(e,t),ls(t),r&4&&AA(t);break;case 21:break;default:Ui(e,t),ls(t)}}function ls(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(PN(n)){var r=n;break e}n=n.return}throw Error(Re(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Uf(i,""),r.flags&=-33);var s=TA(t);Gx(t,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=TA(t);Hx(t,a,o);break;default:throw Error(Re(161))}}catch(l){Tn(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function PV(t,e,n){Ye=t,ON(t)}function ON(t,e,n){for(var r=(t.mode&1)!==0;Ye!==null;){var i=Ye,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Np;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||gr;a=Np;var c=gr;if(Np=o,(gr=l)&&!c)for(Ye=i;Ye!==null;)o=Ye,l=o.child,o.tag===22&&o.memoizedState!==null?RA(i):l!==null?(l.return=o,Ye=l):RA(i);for(;s!==null;)Ye=s,ON(s),s=s.sibling;Ye=i,Np=a,gr=c}MA(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,Ye=s):MA(t)}}function MA(t){for(;Ye!==null;){var e=Ye;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:gr||kv(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!gr)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:zi(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&dA(e,s,r);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}dA(e,o,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&zf(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Re(163))}gr||e.flags&512&&zx(e)}catch(u){Tn(e,e.return,u)}}if(e===t){Ye=null;break}if(n=e.sibling,n!==null){n.return=e.return,Ye=n;break}Ye=e.return}}function CA(t){for(;Ye!==null;){var e=Ye;if(e===t){Ye=null;break}var n=e.sibling;if(n!==null){n.return=e.return,Ye=n;break}Ye=e.return}}function RA(t){for(;Ye!==null;){var e=Ye;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{kv(4,e)}catch(l){Tn(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){Tn(e,i,l)}}var s=e.return;try{zx(e)}catch(l){Tn(e,s,l)}break;case 5:var o=e.return;try{zx(e)}catch(l){Tn(e,o,l)}}}catch(l){Tn(e,e.return,l)}if(e===t){Ye=null;break}var a=e.sibling;if(a!==null){a.return=e.return,Ye=a;break}Ye=e.return}}var IV=Math.ceil,Mg=Ao.ReactCurrentDispatcher,Aw=Ao.ReactCurrentOwner,Mi=Ao.ReactCurrentBatchConfig,Ut=0,Xn=null,Dn=null,nr=0,ri=0,Vc=Ga(0),Bn=0,Jf=null,Il=0,Lv=0,Mw=0,bf=null,zr=null,Cw=0,Su=1/0,eo=null,Cg=!1,$x=null,ya=null,Op=!1,ca=null,Rg=0,wf=0,Wx=null,Fm=-1,Um=0;function Cr(){return Ut&6?Rn():Fm!==-1?Fm:Fm=Rn()}function _a(t){return t.mode&1?Ut&2&&nr!==0?nr&-nr:pV.transition!==null?(Um===0&&(Um=v2()),Um):(t=Yt,t!==0||(t=window.event,t=t===void 0?16:S2(t.type)),t):1}function Zi(t,e,n,r){if(50<wf)throw wf=0,Wx=null,Error(Re(185));Rh(t,n,r),(!(Ut&2)||t!==Xn)&&(t===Xn&&(!(Ut&2)&&(Lv|=n),Bn===4&&Yo(t,nr)),qr(t,r),n===1&&Ut===0&&!(e.mode&1)&&(Su=Rn()+500,Nv&&$a()))}function qr(t,e){var n=t.callbackNode;pB(t,e);var r=fg(t,t===Xn?nr:0);if(r===0)n!==null&&UT(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&UT(n),e===1)t.tag===0?hV(PA.bind(null,t)):H2(PA.bind(null,t)),cV(function(){!(Ut&6)&&$a()}),n=null;else{switch(y2(r)){case 1:n=ew;break;case 4:n=m2;break;case 16:n=dg;break;case 536870912:n=g2;break;default:n=dg}n=VN(n,DN.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function DN(t,e){if(Fm=-1,Um=0,Ut&6)throw Error(Re(327));var n=t.callbackNode;if(Qc()&&t.callbackNode!==n)return null;var r=fg(t,t===Xn?nr:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=Pg(t,r);else{e=r;var i=Ut;Ut|=2;var s=LN();(Xn!==t||nr!==e)&&(eo=null,Su=Rn()+500,Sl(t,e));do try{DV();break}catch(a){kN(t,a)}while(!0);hw(),Mg.current=s,Ut=i,Dn!==null?e=0:(Xn=null,nr=0,e=Bn)}if(e!==0){if(e===2&&(i=_x(t),i!==0&&(r=i,e=qx(t,i))),e===1)throw n=Jf,Sl(t,0),Yo(t,r),qr(t,Rn()),n;if(e===6)Yo(t,r);else{if(i=t.current.alternate,!(r&30)&&!NV(i)&&(e=Pg(t,r),e===2&&(s=_x(t),s!==0&&(r=s,e=qx(t,s))),e===1))throw n=Jf,Sl(t,0),Yo(t,r),qr(t,Rn()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(Re(345));case 2:ll(t,zr,eo);break;case 3:if(Yo(t,r),(r&130023424)===r&&(e=Cw+500-Rn(),10<e)){if(fg(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){Cr(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=Mx(ll.bind(null,t,zr,eo),e);break}ll(t,zr,eo);break;case 4:if(Yo(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var o=31-Qi(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=Rn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*IV(r/1960))-r,10<r){t.timeoutHandle=Mx(ll.bind(null,t,zr,eo),r);break}ll(t,zr,eo);break;case 5:ll(t,zr,eo);break;default:throw Error(Re(329))}}}return qr(t,Rn()),t.callbackNode===n?DN.bind(null,t):null}function qx(t,e){var n=bf;return t.current.memoizedState.isDehydrated&&(Sl(t,e).flags|=256),t=Pg(t,e),t!==2&&(e=zr,zr=n,e!==null&&Kx(e)),t}function Kx(t){zr===null?zr=t:zr.push.apply(zr,t)}function NV(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!Ji(s(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Yo(t,e){for(e&=~Mw,e&=~Lv,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Qi(e),r=1<<n;t[n]=-1,e&=~r}}function PA(t){if(Ut&6)throw Error(Re(327));Qc();var e=fg(t,0);if(!(e&1))return qr(t,Rn()),null;var n=Pg(t,e);if(t.tag!==0&&n===2){var r=_x(t);r!==0&&(e=r,n=qx(t,r))}if(n===1)throw n=Jf,Sl(t,0),Yo(t,e),qr(t,Rn()),n;if(n===6)throw Error(Re(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,ll(t,zr,eo),qr(t,Rn()),null}function Rw(t,e){var n=Ut;Ut|=1;try{return t(e)}finally{Ut=n,Ut===0&&(Su=Rn()+500,Nv&&$a())}}function Nl(t){ca!==null&&ca.tag===0&&!(Ut&6)&&Qc();var e=Ut;Ut|=1;var n=Mi.transition,r=Yt;try{if(Mi.transition=null,Yt=1,t)return t()}finally{Yt=r,Mi.transition=n,Ut=e,!(Ut&6)&&$a()}}function Pw(){ri=Vc.current,ln(Vc)}function Sl(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,lV(n)),Dn!==null)for(n=Dn.return;n!==null;){var r=n;switch(uw(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&vg();break;case 3:wu(),ln($r),ln(_r),_w();break;case 5:yw(r);break;case 4:wu();break;case 13:ln(vn);break;case 19:ln(vn);break;case 10:pw(r.type._context);break;case 22:case 23:Pw()}n=n.return}if(Xn=t,Dn=t=xa(t.current,null),nr=ri=e,Bn=0,Jf=null,Mw=Lv=Il=0,zr=bf=null,pl!==null){for(e=0;e<pl.length;e++)if(n=pl[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}pl=null}return t}function kN(t,e){do{var n=Dn;try{if(hw(),Dm.current=Ag,Tg){for(var r=yn.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Tg=!1}if(Pl=0,Kn=Un=yn=null,_f=!1,Yf=0,Aw.current=null,n===null||n.return===null){Bn=1,Jf=e,Dn=null;break}e:{var s=t,o=n.return,a=n,l=e;if(e=nr,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var u=d.alternate;u?(d.updateQueue=u.updateQueue,d.memoizedState=u.memoizedState,d.lanes=u.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=vA(o);if(h!==null){h.flags&=-257,yA(h,o,a,s,e),h.mode&1&&gA(s,c,e),e=h,l=c;var g=e.updateQueue;if(g===null){var v=new Set;v.add(l),e.updateQueue=v}else g.add(l);break e}else{if(!(e&1)){gA(s,c,e),Iw();break e}l=Error(Re(426))}}else if(dn&&a.mode&1){var m=vA(o);if(m!==null){!(m.flags&65536)&&(m.flags|=256),yA(m,o,a,s,e),dw(Eu(l,a));break e}}s=l=Eu(l,a),Bn!==4&&(Bn=2),bf===null?bf=[s]:bf.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var p=yN(s,l,e);uA(s,p);break e;case 1:a=l;var y=s.type,w=s.stateNode;if(!(s.flags&128)&&(typeof y.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ya===null||!ya.has(w)))){s.flags|=65536,e&=-e,s.lanes|=e;var x=_N(s,a,e);uA(s,x);break e}}s=s.return}while(s!==null)}UN(n)}catch(S){e=S,Dn===n&&n!==null&&(Dn=n=n.return);continue}break}while(!0)}function LN(){var t=Mg.current;return Mg.current=Ag,t===null?Ag:t}function Iw(){(Bn===0||Bn===3||Bn===2)&&(Bn=4),Xn===null||!(Il&268435455)&&!(Lv&268435455)||Yo(Xn,nr)}function Pg(t,e){var n=Ut;Ut|=2;var r=LN();(Xn!==t||nr!==e)&&(eo=null,Sl(t,e));do try{OV();break}catch(i){kN(t,i)}while(!0);if(hw(),Ut=n,Mg.current=r,Dn!==null)throw Error(Re(261));return Xn=null,nr=0,Bn}function OV(){for(;Dn!==null;)FN(Dn)}function DV(){for(;Dn!==null&&!sB();)FN(Dn)}function FN(t){var e=BN(t.alternate,t,ri);t.memoizedProps=t.pendingProps,e===null?UN(t):Dn=e,Aw.current=null}function UN(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=MV(n,e),n!==null){n.flags&=32767,Dn=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Bn=6,Dn=null;return}}else if(n=AV(n,e,ri),n!==null){Dn=n;return}if(e=e.sibling,e!==null){Dn=e;return}Dn=e=t}while(e!==null);Bn===0&&(Bn=5)}function ll(t,e,n){var r=Yt,i=Mi.transition;try{Mi.transition=null,Yt=1,kV(t,e,n,r)}finally{Mi.transition=i,Yt=r}return null}function kV(t,e,n,r){do Qc();while(ca!==null);if(Ut&6)throw Error(Re(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(Re(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(mB(t,s),t===Xn&&(Dn=Xn=null,nr=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Op||(Op=!0,VN(dg,function(){return Qc(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Mi.transition,Mi.transition=null;var o=Yt;Yt=1;var a=Ut;Ut|=4,Aw.current=null,RV(t,n),NN(n,t),tV(Tx),hg=!!Sx,Tx=Sx=null,t.current=n,PV(n),oB(),Ut=a,Yt=o,Mi.transition=s}else t.current=n;if(Op&&(Op=!1,ca=t,Rg=i),s=t.pendingLanes,s===0&&(ya=null),cB(n.stateNode),qr(t,Rn()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Cg)throw Cg=!1,t=$x,$x=null,t;return Rg&1&&t.tag!==0&&Qc(),s=t.pendingLanes,s&1?t===Wx?wf++:(wf=0,Wx=t):wf=0,$a(),null}function Qc(){if(ca!==null){var t=y2(Rg),e=Mi.transition,n=Yt;try{if(Mi.transition=null,Yt=16>t?16:t,ca===null)var r=!1;else{if(t=ca,ca=null,Rg=0,Ut&6)throw Error(Re(331));var i=Ut;for(Ut|=4,Ye=t.current;Ye!==null;){var s=Ye,o=s.child;if(Ye.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(Ye=c;Ye!==null;){var d=Ye;switch(d.tag){case 0:case 11:case 15:xf(8,d,s)}var f=d.child;if(f!==null)f.return=d,Ye=f;else for(;Ye!==null;){d=Ye;var u=d.sibling,h=d.return;if(RN(d),d===c){Ye=null;break}if(u!==null){u.return=h,Ye=u;break}Ye=h}}}var g=s.alternate;if(g!==null){var v=g.child;if(v!==null){g.child=null;do{var m=v.sibling;v.sibling=null,v=m}while(v!==null)}}Ye=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,Ye=o;else e:for(;Ye!==null;){if(s=Ye,s.flags&2048)switch(s.tag){case 0:case 11:case 15:xf(9,s,s.return)}var p=s.sibling;if(p!==null){p.return=s.return,Ye=p;break e}Ye=s.return}}var y=t.current;for(Ye=y;Ye!==null;){o=Ye;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,Ye=w;else e:for(o=y;Ye!==null;){if(a=Ye,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:kv(9,a)}}catch(S){Tn(a,a.return,S)}if(a===o){Ye=null;break e}var x=a.sibling;if(x!==null){x.return=a.return,Ye=x;break e}Ye=a.return}}if(Ut=i,$a(),Es&&typeof Es.onPostCommitFiberRoot=="function")try{Es.onPostCommitFiberRoot(Mv,t)}catch{}r=!0}return r}finally{Yt=n,Mi.transition=e}}return!1}function IA(t,e,n){e=Eu(n,e),e=yN(t,e,1),t=va(t,e,1),e=Cr(),t!==null&&(Rh(t,1,e),qr(t,e))}function Tn(t,e,n){if(t.tag===3)IA(t,t,n);else for(;e!==null;){if(e.tag===3){IA(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ya===null||!ya.has(r))){t=Eu(n,t),t=_N(e,t,1),e=va(e,t,1),t=Cr(),e!==null&&(Rh(e,1,t),qr(e,t));break}}e=e.return}}function LV(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=Cr(),t.pingedLanes|=t.suspendedLanes&n,Xn===t&&(nr&n)===n&&(Bn===4||Bn===3&&(nr&130023424)===nr&&500>Rn()-Cw?Sl(t,0):Mw|=n),qr(t,e)}function jN(t,e){e===0&&(t.mode&1?(e=Ep,Ep<<=1,!(Ep&130023424)&&(Ep=4194304)):e=1);var n=Cr();t=mo(t,e),t!==null&&(Rh(t,e,n),qr(t,n))}function FV(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),jN(t,n)}function UV(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Re(314))}r!==null&&r.delete(e),jN(t,n)}var BN;BN=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||$r.current)Gr=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Gr=!1,TV(t,e,n);Gr=!!(t.flags&131072)}else Gr=!1,dn&&e.flags&1048576&&G2(e,xg,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Lm(t,e),t=e.pendingProps;var i=_u(e,_r.current);Yc(e,n),i=bw(null,e,r,t,i,n);var s=ww();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Wr(r)?(s=!0,yg(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,gw(e),i.updater=Dv,e.stateNode=i,i._reactInternals=e,Dx(e,r,t,n),e=Fx(null,e,r,!0,s,n)):(e.tag=0,dn&&s&&cw(e),Ar(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Lm(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=BV(r),t=zi(r,t),i){case 0:e=Lx(null,e,r,t,n);break e;case 1:e=bA(null,e,r,t,n);break e;case 11:e=_A(null,e,r,t,n);break e;case 14:e=xA(null,e,r,zi(r.type,t),n);break e}throw Error(Re(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:zi(r,i),Lx(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:zi(r,i),bA(t,e,r,i,n);case 3:e:{if(EN(e),t===null)throw Error(Re(387));r=e.pendingProps,s=e.memoizedState,i=s.element,Y2(t,e),Eg(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Eu(Error(Re(423)),e),e=wA(t,e,r,n,i);break e}else if(r!==i){i=Eu(Error(Re(424)),e),e=wA(t,e,r,n,i);break e}else for(ai=ga(e.stateNode.containerInfo.firstChild),ci=e,dn=!0,Wi=null,n=K2(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(xu(),r===i){e=go(t,e,n);break e}Ar(t,e,r,n)}e=e.child}return e;case 5:return Q2(e),t===null&&Ix(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,Ax(r,i)?o=null:s!==null&&Ax(r,s)&&(e.flags|=32),wN(t,e),Ar(t,e,o,n),e.child;case 6:return t===null&&Ix(e),null;case 13:return SN(t,e,n);case 4:return vw(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=bu(e,null,r,n):Ar(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:zi(r,i),_A(t,e,r,i,n);case 7:return Ar(t,e,e.pendingProps,n),e.child;case 8:return Ar(t,e,e.pendingProps.children,n),e.child;case 12:return Ar(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,Jt(bg,r._currentValue),r._currentValue=o,s!==null)if(Ji(s.value,o)){if(s.children===i.children&&!$r.current){e=go(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=lo(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Nx(s.return,n,e),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Re(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Nx(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ar(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Yc(e,n),i=Ri(i),r=r(i),e.flags|=1,Ar(t,e,r,n),e.child;case 14:return r=e.type,i=zi(r,e.pendingProps),i=zi(r.type,i),xA(t,e,r,i,n);case 15:return xN(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:zi(r,i),Lm(t,e),e.tag=1,Wr(r)?(t=!0,yg(e)):t=!1,Yc(e,n),vN(e,r,i),Dx(e,r,i,n),Fx(null,e,r,!0,t,n);case 19:return TN(t,e,n);case 22:return bN(t,e,n)}throw Error(Re(156,e.tag))};function VN(t,e){return p2(t,e)}function jV(t,e,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ai(t,e,n,r){return new jV(t,e,n,r)}function Nw(t){return t=t.prototype,!(!t||!t.isReactComponent)}function BV(t){if(typeof t=="function")return Nw(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Q1)return 11;if(t===Z1)return 14}return 2}function xa(t,e){var n=t.alternate;return n===null?(n=Ai(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.deleti
vendor: 6,830 bytes, line 40
40ons=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 jm(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")Nw(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Ic:return Tl(n.children,i,s,e);case Y1:o=8,i|=8;break;case ix:return t=Ai(12,n,e,i|2),t.elementType=ix,t.lanes=s,t;case sx:return t=Ai(13,n,e,i),t.elementType=sx,t.lanes=s,t;case ox:return t=Ai(19,n,e,i),t.elementType=ox,t.lanes=s,t;case QI:return Fv(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case XI:o=10;break e;case YI:o=9;break e;case Q1:o=11;break e;case Z1:o=14;break e;case Wo:o=16,r=null;break e}throw Error(Re(130,t==null?t:typeof t,""))}return e=Ai(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function Tl(t,e,n,r){return t=Ai(7,t,r,e),t.lanes=n,t}function Fv(t,e,n,r){return t=Ai(22,t,r,e),t.elementType=QI,t.lanes=n,t.stateNode={isHidden:!1},t}function P_(t,e,n){return t=Ai(6,t,null,e),t.lanes=n,t}function I_(t,e,n){return e=Ai(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function VV(t,e,n,r,i){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=d_(0),this.expirationTimes=d_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=d_(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ow(t,e,n,r,i,s,o,a,l){return t=new VV(t,e,n,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ai(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},gw(s),t}function zV(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Pc,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function zN(t){if(!t)return Ca;t=t._reactInternals;e:{if(Hl(t)!==t||t.tag!==1)throw Error(Re(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Wr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Re(171))}if(t.tag===1){var n=t.type;if(Wr(n))return z2(t,n,e)}return e}function HN(t,e,n,r,i,s,o,a,l){return t=Ow(n,r,!0,t,i,s,o,a,l),t.context=zN(null),n=t.current,r=Cr(),i=_a(n),s=lo(r,i),s.callback=e??null,va(n,s,i),t.current.lanes=i,Rh(t,i,r),qr(t,r),t}function Uv(t,e,n,r){var i=e.current,s=Cr(),o=_a(i);return n=zN(n),e.context===null?e.context=n:e.pendingContext=n,e=lo(s,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=va(i,e,o),t!==null&&(Zi(t,i,o,s),Om(t,i,o)),o}function Ig(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function NA(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Dw(t,e){NA(t,e),(t=t.alternate)&&NA(t,e)}function HV(){return null}var GN=typeof reportError=="function"?reportError:function(t){console.error(t)};function kw(t){this._internalRoot=t}jv.prototype.render=kw.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(Re(409));Uv(t,e,null,null)};jv.prototype.unmount=kw.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Nl(function(){Uv(null,t,null,null)}),e[po]=null}};function jv(t){this._internalRoot=t}jv.prototype.unstable_scheduleHydration=function(t){if(t){var e=b2();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Xo.length&&e!==0&&e<Xo[n].priority;n++);Xo.splice(n,0,t),n===0&&E2(t)}};function Lw(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Bv(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function OA(){}function GV(t,e,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Ig(o);s.call(c)}}var o=HN(e,r,t,0,null,!1,!1,"",OA);return t._reactRootContainer=o,t[po]=o.current,$f(t.nodeType===8?t.parentNode:t),Nl(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Ig(l);a.call(c)}}var l=Ow(t,0,!1,null,null,!1,!1,"",OA);return t._reactRootContainer=l,t[po]=l.current,$f(t.nodeType===8?t.parentNode:t),Nl(function(){Uv(e,l,n,r)}),l}function Vv(t,e,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Ig(o);a.call(l)}}Uv(e,o,t,i)}else o=GV(n,e,t,i,r);return Ig(o)}_2=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Yd(e.pendingLanes);n!==0&&(tw(e,n|1),qr(e,Rn()),!(Ut&6)&&(Su=Rn()+500,$a()))}break;case 13:Nl(function(){var r=mo(t,1);if(r!==null){var i=Cr();Zi(r,t,1,i)}}),Dw(t,1)}};nw=function(t){if(t.tag===13){var e=mo(t,134217728);if(e!==null){var n=Cr();Zi(e,t,134217728,n)}Dw(t,134217728)}};x2=function(t){if(t.tag===13){var e=_a(t),n=mo(t,e);if(n!==null){var r=Cr();Zi(n,t,e,r)}Dw(t,e)}};b2=function(){return Yt};w2=function(t,e){var n=Yt;try{return Yt=t,e()}finally{Yt=n}};gx=function(t,e,n){switch(e){case"input":if(cx(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=Iv(r);if(!i)throw Error(Re(90));JI(r),cx(r,i)}}}break;case"textarea":t2(t,n);break;case"select":e=n.value,e!=null&&Wc(t,!!n.multiple,e,!1)}};l2=Rw;c2=Nl;var $V={usingClientEntryPoint:!1,Events:[Ih,kc,Iv,o2,a2,Rw]},kd={findFiberByHostInstance:hl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},WV={bundleType:kd.bundleType,version:kd.version,rendererPackageName:kd.rendererPackageName,rendererConfig:kd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ao.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=f2(t),t===null?null:t.stateNode},findFiberByHostInstance:kd.findFiberByHostInstance||HV,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Dp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dp.isDisabled&&Dp.supportsFiber)try{Mv=Dp.inject(WV),Es=Dp}catch{}}hi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$V;hi.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Lw(e))throw Error(Re(200));return zV(t,e,null,n)};hi.createRoot=function(t,e){if(!Lw(t))throw Error(Re(299));var n=!1,r="",i=GN;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Ow(t,1,!1,null,null,n,!1,r,i),t[po]=e.current,$f(t.nodeType===8?t.parentNode:t),new kw(e)};hi.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(Re(188)):(t=Object.keys(t).join(","),Error(Re(268,t)));return t=f2(e),t=t===null?null:t.stateNode,t};hi.flushSync=function(t){return Nl(t)};hi.hydrate=function(t,e,n){if(!Bv(e))throw Error(Re(200));return Vv(null,t,e,!0,n)};hi.hydrateRoot=function(t,e,n){if(!Lw(t))throw Error(Re(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=GN;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=HN(e,null,t,1,n??null,i,!1,s,o),t[po]=e.current,$f(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new jv(e)};hi.render=function(t,e,n){if(!Bv(e))throw Error(Re(200));return Vv(null,t,e,!1,n)};hi.unmountComponentAtNode=function(t){if(!Bv(t))throw Error(Re(40));return t._reactRootContainer?(Nl(function(){Vv(null,null,t,!1,function(){t._reactRootContainer=null,t[po]=null})}),!0):!1};hi.unstable_batchedUpdates=Rw;hi.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Bv(n))throw Error(Re(200));if(t==null||t._reactInternals===void 0)throw Error(Re(38));return Vv(t,e,n,!1,r)};hi.version="18.3.1-next-f1338f8080-20240426";function $N(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($N)}catch(t){console.error(t)}}$N(),$I.exports=hi;var qu=$I.exports;const WN=z1(qu);var qN,DA=qu;qN=DA.createRoot,DA.hydrateRoot;/**
41 * @remix-run/router v1.20.0
42 *
43 * Copyright (c) Remix Software Inc.
44 *
45 * This source code is licensed under the MIT license found in the
46 * LICENSE.md file in the root directory of this source tree.
47 *
48 * @license MIT
49 */function eh(){return eh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},eh.apply(this,arguments)}var ua;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(ua||(ua={}));const kA="popstate";function qV(t){t===void 0&&(t={});function e(r,i){let{pathname:s,search:o,hash:a}=r.location;return Xx("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Ng(i)}return XV(e,n,null,t)}function Pn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function KN(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function KV(){return Math.random().toString(36).substr(2,8)}function LA(t,e){return{usr:t.state,key:t.key,idx:e}}function Xx(t,e,n,r){return n===void 0&&(n=null),eh({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Ku(e):e,{state:n,key:e&&e.key||r||KV()})}function Ng(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Ku(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function XV(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=ua.Pop,l=null,c=d();c==null&&(c=0,o.replaceState(eh({},o.state,{idx:c}),""));function d(){return(o.state||{idx:null}).idx}function f(){a=ua.Pop;let m=d(),p=m==null?null:m-c;c=m,l&&l({action:a,location:v.location,delta:p})}function u(m,p){a=ua.Push;let y=Xx(v.location,m,p);c=d()+1;let w=LA(y,c),x=v.createHref(y);try{o.pushState(w,"",x)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(x)}s&&l&&l({action:a,location:v.location,delta:1})}function h(m,p){a=ua.Replace;let y=Xx(v.location,m,p);c=d();let w=LA(y,c),x=v.createHref(y);o.replaceState(w,"",x),s&&l&&l({action:a,location:v.location,delta:0})}function g(m){let p=i.location.origin!=="null"?i.location.origin:i.location.href,y=typeof m=="string"?m:Ng(m);return y=y.replace(/ $/,"%20"),Pn(p,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,p)}let v={get action(){return a},get location(){return t(i,o)},listen(m){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(kA,f),l=m,()=>{i.removeEventListener(kA,f),l=null}},createHref(m){return e(i,m)},createURL:g,encodeLocation(m){let p=g(m);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:u,replace:h,go(m){return o.go(m)}};return v}var FA;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(FA||(FA={}));function YV(t,e,n){return n===void 0&&(n="/"),QV(t,e,n,!1)}function QV(t,e,n,r){let i=typeof e=="string"?Ku(e):e,s=Fw(i.pathname||"/",n);if(s==null)return null;let o=XN(t);ZV(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=c5(s);a=a5(o[l],c,r)}return a}function XN(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(Pn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not val
49id. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=ba([r,l.relativePath]),d=n.concat(l);s.children&&s.children.length>0&&(Pn(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),XN(s.children,e,d,c)),!(s.path==null&&!s.index)&&e.push({path:c,score:s5(c,s.index),routesMeta:d})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of YN(s.path))i(s,o,l)}),e}function YN(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=YN(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function ZV(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:o5(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const JV=/^:[\w-]+$/,e5=3,t5=2,n5=1,r5=10,i5=-2,UA=t=>t==="*";function s5(t,e){let n=t.split("/"),r=n.length;return n.some(UA)&&(r+=i5),e&&(r+=t5),n.filter(i=>!UA(i)).reduce((i,s)=>i+(JV.test(s)?e5:s===""?n5:r5),r)}function o5(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function a5(t,e,n){let{routesMeta:r}=t,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,d=s==="/"?e:e.slice(s.length)||"/",f=jA({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},d),u=l.route;if(!f&&c&&n&&!r[r.length-1].route.index&&(f=jA({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!f)return null;
vendor: 6,917 bytes, lines 49-58
49Object.assign(i,f.params),o.push({params:i,pathname:ba([s,f.pathname]),pathnameBase:h5(ba([s,f.pathnameBase])),route:u}),f.pathnameBase!=="/"&&(s=ba([s,f.pathnameBase]))}return o}function jA(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=l5(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((c,d,f)=>{let{paramName:u,isOptional:h}=d;if(u==="*"){let v=a[f]||"";o=s.slice(0,s.length-v.length).replace(/(.)\/+$/,"$1")}const g=a[f];return h&&!g?c[u]=void 0:c[u]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:t}}function l5(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),KN(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function c5(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return KN(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Fw(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function u5(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Ku(t):t;return{pathname:n?n.startsWith("/")?n:d5(n,e):e,search:p5(r),hash:m5(i)}}function d5(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function N_(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"].  Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function f5(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Uw(t,e){let n=f5(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function jw(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Ku(t):(i=eh({},t),Pn(!i.pathname||!i.pathname.includes("?"),N_("?","pathname","search",i)),Pn(!i.pathname||!i.pathname.includes("#"),N_("#","pathname","hash",i)),Pn(!i.search||!i.search.includes("#"),N_("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let f=e.length-1;if(!r&&o.startsWith("..")){let u=o.split("/");for(;u[0]==="..";)u.shift(),f-=1;i.pathname=u.join("/")}a=f>=0?e[f]:"/"}let l=u5(i,a),c=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const ba=t=>t.join("/").replace(/\/\/+/g,"/"),h5=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),p5=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,m5=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function g5(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const QN=["post","put","patch","delete"];new Set(QN);const v5=["get",...QN];new Set(v5);/**
50 * React Router v6.27.0
51 *
52 * Copyright (c) Remix Software Inc.
53 *
54 * This source code is licensed under the MIT license found in the
55 * LICENSE.md file in the root directory of this source tree.
56 *
57 * @license MIT
58 */function th(){return th=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},th.apply(this,arguments)}const Bw=O.createContext(null),y5=O.createContext(null),Wa=O.createContext(null),zv=O.createContext(null),Mo=O.createContext({outlet:null,matches:[],isDataRoute:!1}),ZN=O.createContext(null);function _5(t,e){let{relative:n}=e===void 0?{}:e;Xu()||Pn(!1);let{basename:r,navigator:i}=O.useContext(Wa),{hash:s,pathname:o,search:a}=eO(t,{relative:n}),l=o;return r!=="/"&&(l=o==="/"?r:ba([r,o])),i.createHref({pathname:l,search:a,hash:s})}function Xu(){return O.useContext(zv)!=null}function Vs(){return Xu()||Pn(!1),O.useContext(zv).location}function JN(t){O.useContext(Wa).static||O.useLayoutEffect(t)}function Oh(){let{isDataRoute:t}=O.useContext(Mo);return t?N5():x5()}function x5(){Xu()||Pn(!1);let t=O.useContext(Bw),{basename:e,future:n,navigator:r}=O.useContext(Wa),{matches:i}=O.useContext(Mo),{pathname:s}=Vs(),o=JSON.stringify(Uw(i,n.v7_relativeSplatPath)),a=O.useRef(!1);return JN(()=>{a.current=!0}),O.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let f=jw(c,JSON.parse(o),s,d.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:ba([e,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[e,r,o,s,t])}function Vw(){let{matches:t}=O.useContext(Mo),e=t[t.length-1];return e?e.params:{}}function eO(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=O.useContext(Wa),{matches:i}=O.useContext(Mo),{pathname:s}=Vs(),o=JSON.stringify(Uw(i,r.v7_relativeSplatPath));return O.useMemo(()=>jw(t,JSON.parse(o),s,n==="path"),[t,o,s,n])}function b5(t,e){return w5(t,e)}function w5(t,e,n,r){Xu()||Pn(!1);let{navigator:i}=O.useContext(Wa),{matches:s}=O.useContext(Mo),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=Vs(),d;if(e){var f;let m=typeof e=="string"?Ku(e):e;l==="/"||(f=m.pathname)!=null&&f.startsWith(l)||Pn(!1),d=m}else d=c;let u=d.pathname||"/",h=u;if(l!=="/"){let m=l.replace(/^\//,"").split("/");h="/"+u.replace(/^\//,"").split("/").slice(m.length).join("/")}let g=YV(t,{pathname:h}),v=M5(g&&g.map(m=>Object.assign({},m,{params:Object.assign({},a,m.params),pathname:ba([l,i.encodeLocation?i.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?l:ba([l,i.encodeLocation?i.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),s,n,r);return e&&v?O.createElement(zv.Provider,{value:{location:th({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:ua.Pop}},v):v}function E5(){let t=I5(),e=g5(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return O.createElement(O.Fragment,null,O.createElement("h2",null,"Unexpected Application 
58Error!"),O.createElement("h3",{style:{fontStyle:"italic"}},e),n?O.createElement("pre",{style:i},n):null,null)}const S5=O.createElement(E5,null);class T5 extends O.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?O.createElement(Mo.Provider,{value:this.props.routeContext},O.createElement(ZN.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function A5(t){let{routeContext:e,match:n,children:r}=t,i=O.useContext(Bw);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),O.createElement(Mo.Provider,{value:e},r)}function M5(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var s;if(!n)return null;if(n.errors)t=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(i=n)==null?void 0:i.errors;if(a!=null){let d=o.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||Pn(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=d),f.route.id){let{loaderData:u,errors:h}=n,g=f.route.loader&&u[f.route.id]===void 0&&(!h||h[f.route.id]===void 0);if(f.route.lazy||g){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((d,f,u)=>{let h,g=!1,v=null,m=null;n&&(h=a&&f.route.id?a[f.route.id]:void 0,v=f.route.errorElement||S5,l&&(c<0&&u===0?(g=!0,m=null):c===u&&(g=!0,m=f.route.hydrateFallbackElement||null)));let p=e.concat(o.slice(0,u+1)),y=()=>{let w;return h?w=v:g?w=m:f.route.Component?w=O.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,O.createElement(A5,{match:f,routeContext:{outlet:d,matches:p,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||u===0)?O.createElement(T5,{location:n.location,revalidation:n.revalidation,component:v,error:h,children:y(),routeC
58ontext:{outlet:null,matches:p,isDataRoute:!0}}):y()},null)}var tO=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(tO||{}),Og=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Og||{});function C5(t){let e=O.useContext(Bw);return e||Pn(!1),e}function R5(t){let e=O.useContext(y5);return e||Pn(!1),e}function P5(t){let e=O.useContext(Mo);return e||Pn(!1),e}function nO(t){let e=P5(),n=e.matches[e.matches.length-1];return n.route.id||Pn(!1),n.route.id}function I5(){var t;let e=O.useContext(ZN),n=R5(Og.UseRouteError),r=nO(Og.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function N5(){let{router:t}=C5(tO.UseNavigateStable),e=nO(Og.UseNavigateStable),n=O.useRef(!1);return JN(()=>{n.current=!0}),O.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,th({fromRouteId:e},s)))},[t,e])}function zw(t){let{to:e,replace:n,state:r,relative:i}=t;Xu()||Pn(!1);let{future:s,static:o}=O.useContext(Wa),{matches:a}=O.useContext(Mo),{pathname:l}=Vs(),c=Oh(),d=jw(e,Uw(a,s.v7_relativeSplatPath),l,i==="path"),f=JSON.stringify(d);return O.useEffect(()=>c(JSON.parse(f),{replace:n,state:r,relative:i}),[c,f,i,n,r]),null}function gn(t){Pn(!1)}function O5(t){let{basename:e="/",children:n=null,location:r,navigationType:i=ua.Pop,navigator:s,static:o=!1,future:a}=t;Xu()&&Pn(!1);let l=e.replace(/^\/*/,"/"),c=O.useMemo(()=>({basename:l,navigator:s,static:o,future:th({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=Ku(r));let{pathname:d="/",search:f="",hash:u="",state:h=null,key:g="default"}=r,v=O.useMemo(()=>{let m=Fw(d,l);return m==null?null:{location:{pathname:m,search:f,hash:u,state:h,key:g},navigationType:i}},[l,d,f,u,h,g,i]);return v==null?null:O.createElement(Wa.Provider,{value:c},O.createElement(zv.Provider,{children:n,value:v}))}function O_(t){let{children:e,location:n}=t;return b5(Yx(e),n)}new Promise(()=>{});function Yx(t,e){e===void 0&&(e=[]);let n=[];return O.Children.forEach(t,(r,i)=>{if(!O.isValidElement(r))return;let s=[...e,i];if(r.type===O.Fragment){n.push.apply(n,Yx(r.props.children,s));return}r.type!==gn&&Pn(!1),!r.props.index||!r.props.children||Pn(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Yx(r.props.children,s)),n.push(o)}),n}/**
59 * React Router DOM v6.27.0
60 *
61 * Copyright (c) Remix Software Inc.
62 *
63 * This source code is licensed under the MIT license found in the
64 * LICENSE.md file in the root directory of this source tree.
65 *
66 * @license MIT
67 */function Qx(){return Qx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Qx.apply(this,arguments)}function D5(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function k5(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function L5(t,e){return t.button===0&&(!e||e==="_self")&&!k5(t)}const F5=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],U5="6";try{window.__reactRouterVersion=U5}catch{}const j5="startTransition",BA=HI[j5];function B5(t){let{basename:e,children:n,future:r,window:i}=t,s=O.useRef();s.current==null&&(s.current=qV({window:i,v5Compat:!0}));let o=s.current,[a,l]=O.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},d=O.useCallback(f=>{c&&BA?BA(()=>l(f)):l(f)},[l,c]);return O.useLayoutEffect(()=>o.listen(d),[o,d]),O.createElement(O5,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const V5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",z5=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kn=O.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:s,replace:o,state:a,target:l,to:c,preventScrollReset:d,viewTransition:f}=e,u=D5(e,F5),{basename:h}=O.useContext(Wa),g,v=!1;if(typeof c=="string"&&z5.test(c)&&(g=c,V5))try{let w=new URL(window.location.href),x=c.startsWith("//")?new URL(w.protocol+c):new URL(c),S=Fw(x.pathname,h);x.origin===w.origin&&S!=null?c=S+x.search+x.hash:v=!0}catch{}let m=_5(c,{relative:i}),p=H5(c,{replace:o,state:a,target:l,preventScrollReset:d,relative:i,viewTransition:f});function y(w){r&&r(w),w.defaultPrevented||p(w)}return O.createElement("a",Qx({},u,{href:g||m,onClick:v||s?r:y,ref:n,target:l}))});var VA;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(VA||(VA={}));var zA;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(zA||(zA={}));function H5(t,e){let{target:n,replace:r,state:i,preventScrollReset:s,relative:o,viewTransition:a}=e===void 0?{}:e,l=Oh(),c=Vs(),d=eO(t,{relative:o});return O.useCallback(f=>{if(L5(f,n)){f.preventDefault();let u=r!==void 0?r:Ng(c)===Ng(d);l(t,{replace:u,state:i,preventScrollReset:s,relative:o,viewTransition:a})}},[c,l,d,r,i,n,t,s,o,a])}var Hv=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Gv=typeof window>"u"||"Deno"in globalThis;function Hi(){}function G5(t,e){return typeof t=="function"?t(e):t}function $5(t){return typeof t=="number"&&t>=0&&t!==1/0}function W5(t,e){return Math.max(t+(e||0)-Date.now(),0)}function HA(t,e){return typeof t=="function"?t(e):t}function q5(t,e){return typeof t=="function"?t(e):t}function GA(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==Hw(o,e.options))return!1}else if(!rh(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||s&&!s(e))}function $A(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(nh(e.options.mutationKey)!==nh(s))return!1}else if(!rh(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function Hw(t,e){return((e==null?void 0:e.queryKeyHashFn)||nh)(t)}function nh(t){return JSON.stringify(t,(e,n)=>Zx(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function rh(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!rh(t[n],e[n])):!1}function rO(t,e){if(t===e)return t;const n=WA(t)&&WA(e);
vendor: 20,990 bytes, line 67
67if(n||Zx(t)&&Zx(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),o=s.length,a=n?[]:{};let l=0;for(let c=0;c<o;c++){const d=n?c:s[c];(!n&&r.includes(d)||n)&&t[d]===void 0&&e[d]===void 0?(a[d]=void 0,l++):(a[d]=rO(t[d],e[d]),a[d]===t[d]&&t[d]!==void 0&&l++)}return i===o&&l===i?t:a}return e}function WA(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Zx(t){if(!qA(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!qA(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function qA(t){return Object.prototype.toString.call(t)==="[object Object]"}function K5(t){return new Promise(e=>{setTimeout(e,t)})}function X5(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?rO(t,e):e}function Y5(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function Q5(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var Gw=Symbol();function iO(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Gw?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var xl,ra,cu,TI,Z5=(TI=class extends Hv{constructor(){super();qt(this,xl);qt(this,ra);qt(this,cu);St(this,cu,e=>{if(!Gv&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){we(this,ra)||this.setEventListener(we(this,cu))}onUnsubscribe(){var e;this.hasListeners()||((e=we(this,ra))==null||e.call(this),St(this,ra,void 0))}setEventListener(e){var n;St(this,cu,e),(n=we(this,ra))==null||n.call(this),St(this,ra,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){we(this,xl)!==e&&(St(this,xl,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof we(this,xl)=="boolean"?we(this,xl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},xl=new WeakMap,ra=new WeakMap,cu=new WeakMap,TI),sO=new Z5,uu,ia,du,AI,J5=(AI=class extends Hv{constructor(){super();qt(this,uu,!0);qt(this,ia);qt(this,du);St(this,du,e=>{if(!Gv&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){we(this,ia)||this.setEventListener(we(this,du))}onUnsubscribe(){var e;this.hasListeners()||((e=we(this,ia))==null||e.call(this),St(this,ia,void 0))}setEventListener(e){var n;St(this,du,e),(n=we(this,ia))==null||n.call(this),St(this,ia,e(this.setOnline.bind(this)))}setOnline(e){we(this,uu)!==e&&(St(this,uu,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return we(this,uu)}},uu=new WeakMap,ia=new WeakMap,du=new WeakMap,AI),Dg=new J5;function e6(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function t6(t){return Math.min(1e3*2**t,3e4)}function oO(t){return(t??"online")==="online"?Dg.isOnline():!0}var aO=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function D_(t){return t instanceof aO}function lO(t){let e=!1,n=0,r=!1,i;const s=e6(),o=v=>{var m;r||(u(new aO(v)),(m=t.abort)==null||m.call(t))},a=()=>{e=!0},l=()=>{e=!1},c=()=>sO.isFocused()&&(t.networkMode==="always"||Dg.isOnline())&&t.canRun(),d=()=>oO(t.networkMode)&&t.canRun(),f=v=>{var m;r||(r=!0,(m=t.onSuccess)==null||m.call(t,v),i==null||i(),s.resolve(v))},u=v=>{var m;r||(r=!0,(m=t.onError)==null||m.call(t,v),i==null||i(),s.reject(v))},h=()=>new Promise(v=>{var m;i=p=>{(r||c())&&v(p)},(m=t.onPause)==null||m.call(t)}).then(()=>{var v;i=void 0,r||(v=t.onContinue)==null||v.call(t)}),g=()=>{if(r)return;let v;const m=n===0?t.initialPromise:void 0;try{v=m??t.fn()}catch(p){v=Promise.reject(p)}Promise.resolve(v).then(f).catch(p=>{var I;if(r)return;const y=t.retry??(Gv?0:3),w=t.retryDelay??t6,x=typeof w=="function"?w(n,p):w,S=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,p);if(e||!S){u(p);return}n++,(I=t.onFail)==null||I.call(t,n,p),K5(x).then(()=>c()?void 0:h()).then(()=>{e?u(p):g()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?g():h().then(g),s)}}function n6(){let t=[],e=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{e?t.push(a):i(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var Mr=n6(),bl,MI,cO=(MI=class{constructor(){qt(this,bl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$5(this.gcTime)&&St(this,bl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Gv?1/0:5*60*1e3))}clearGcTimeout(){we(this,bl)&&(clearTimeout(we(this,bl)),St(this,bl,void 0))}},bl=new WeakMap,MI),fu,hu,vi,pr,Ah,wl,Gi,Js,CI,r6=(CI=class extends cO{constructor(n){super();qt(this,Gi);qt(this,fu);qt(this,hu);qt(this,vi);qt(this,pr);qt(this,Ah);qt(this,wl);St(this,wl,!1),St(this,Ah,n.defaultOptions),this.setOptions(n.options),this.observers=[],St(this,vi,n.cache),this.queryKey=n.queryKey,this.queryHash=n.queryHash,St(this,fu,s6(this.options)),this.state=n.state??we(this,fu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var n;return(n=we(this,pr))==null?void 0:n.promise}setOptions(n){this.options={...we(this,Ah),...n},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&we(this,vi).remove(this)}setData(n,r){const i=X5(this.state.data,n,this.options);return lr(this,Gi,Js).call(this,{data:i,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),i}setState(n,r){lr(this,Gi,Js).call(this,{type:"setState",state:n,setStateOptions:r})}cancel(n){var i,s;const r=(i=we(this,pr))==null?void 0:i.promise;return(s=we(this,pr))==null||s.cancel(n),r?r.then(Hi).catch(Hi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(we(this,fu))}isActive(){return this.observers.some(n=>q5(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Gw||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(n=0){return this.state.isInvalidated||this.state.data===void 0||!W5(this.state.dataUpdatedAt,n)}onFocus(){var r;const n=this.observers.find(i=>i.shouldFetchOnWindowFocus());n==null||n.refetch({cancelRefetch:!1}),(r=we(this,pr))==null||r.continue()}onOnline(){var r;const n=this.observers.find(i=>i.shouldFetchOnReconnect());n==null||n.refetch({cancelRefetch:!1}),(r=we(this,pr))==null||r.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),we(this,vi).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(r=>r!==n),this.observers.length||(we(this,pr)&&(we(this,wl)?we(this,pr).cancel({revert:!0}):we(this,pr).cancelRetry()),this.scheduleGc()),we(this,vi).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||lr(this,Gi,Js).call(this,{type:"invalidate"})}fetch(n,r){var c,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(we(this,pr))return we(this,pr).continueRetry(),we(this,pr).promise}if(n&&this.setOptions(n),!this.options.queryFn){const u=this.observers.find(h=>h.options.queryFn);u&&this.setOptions(u.options)}const i=new AbortController,s=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(St(this,wl,!0),i.signal)})},o=()=>{const u=iO(this.options,r),h={queryKey:this.queryKey,meta:this.meta};return s(h),St(this,wl,!1),this.options.persister?this.options.persister(u,h,this):u(h)},a={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};s(a),(c=this.options.behavior)==null||c.onFetch(a,this),St(this,hu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&lr(this,Gi,Js).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const l=u=>{var h,g,v,m;D_(u)&&u.silent||lr(this,Gi,Js).call(this,{type:"error",error:u}),D_(u)||((g=(h=we(this,vi).config).onError)==null||g.call(h,u,this),(m=(v=we(this,vi).config).onSettled)==null||m.call(v,this.state.data,u,this)),this.scheduleGc()};return St(this,pr,lO({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,abort:i.abort.bind(i),onSuccess:u=>{var h,g,v,m;if(u===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(p){l(p);return}(g=(h=we(this,vi).config).onSuccess)==null||g.call(h,u,this),(m=(v=we(this,vi).config).onSettled)==null||m.call(v,u,this.state.error,this),this.scheduleGc()},onError:l,onFail:(u,h)=>{lr(this,Gi,Js).call(this,{type:"failed",failureCount:u,error:h})},onPause:()=>{lr(this,Gi,Js).call(this,{type:"pause"})},onContinue:()=>{lr(this,Gi,Js).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),we(this,pr).start()}},fu=new WeakMap,hu=new WeakMap,vi=new WeakMap,pr=new WeakMap,Ah=new WeakMap,wl=new WeakMap,Gi=new WeakSet,Js=function(n){const r=i=>{switch(n.type){case"failed":return{...i,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...i6(i.data,this.options),fetchMeta:n.meta??null};case"success":return{...i,data:n.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:n.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=n.error;return D_(s)&&s.revert&&we(this,hu)?{...we(this,hu),fetchStatus:"idle"}:{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...n.state}}};this.state=r(this.state),Mr.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),we(this,vi).notify({query:this,type:"updated",action:n})})},CI);function i6(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:oO(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function s6(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ps,RI,o6=(RI=class extends Hv{constructor(e={}){super();qt(this,ps);this.config=e,St(this,ps,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??Hw(i,n);let o=this.get(s);return o||(o=new r6({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){we(this,ps).has(e.queryHash)||(we(this,ps).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=we(this,ps).get(e.queryHash);n&&(e.destroy(),n===e&&we(this,ps).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Mr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return we(this,ps).get(e)}getAll(){return[...we(this,ps).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>GA(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>GA(e,r)):n}notify(e){Mr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Mr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Mr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ps=new WeakMap,RI),ms,Tr,El,gs,Go,PI,a6=(PI=class extends cO{constructor(n){super();qt(this,gs);qt(this,ms);qt(this,Tr);qt(this,El);this.mutationId=n.mutationId,St(this,Tr,n.mutationCache),St(this,ms,[]),this.state=n.state||l6(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){we(this,ms).includes(n)||(we(this,ms).push(n),this.clearGcTimeout(),we(this,Tr).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){St(this,ms,we(this,ms).filter(r=>r!==n)),this.scheduleGc(),we(this,Tr).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){we(this,ms).length||(this.state.status==="pending"?this.scheduleGc():we(this,Tr).remove(this))}continue(){var n;return((n=we(this,El))==null?void 0:n.continue())??this.execute(this.state.variables)}async execute(n){var s,o,a,l,c,d,f,u,h,g,v,m,p,y,w,x,S,I,M,E;St(this,El,lO({fn:()=>this.options.mutationFn?this.options.mutationFn(n):Promise.reject(new Error("No mutationFn found")),onFail:(C,T)=>{lr(this,gs,Go).call(this,{type:"failed",failureCount:C,error:T})},onPause:()=>{lr(this,gs,Go).call(this,{type:"pause"})},onContinue:()=>{lr(this,gs,Go).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>we(this,Tr).canRun(this)}));const r=this.state.status==="pending",i=!we(this,El).canStart();try{if(!r){lr(this,gs,Go).call(this,{type:"pending",variables:n,isPaused:i}),await((o=(s=we(this,Tr).config).onMutate)==null?void 0:o.call(s,n,this));const T=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,n));T!==this.state.context&&lr(this,gs,Go).call(this,{type:"pending",context:T,variables:n,isPaused:i})}const C=await we(this,El).start();return await((d=(c=we(this,Tr).config).onSuccess)==null?void 0:d.call(c,C,n,this.state.context,this)),await((u=(f=this.options).onSuccess)==null?void 0:u.call(f,C,n,this.state.context)),await((g=(h=we(this,Tr).config).onSettled)==null?void 0:g.call(h,C,null,this.state.variables,this.state.context,this)),await((m=(v=this.options).onSettled)==null?void 0:m.call(v,C,null,n,this.state.context)),lr(this,gs,Go).call(this,{type:"success",data:C}),C}catch(C){try{throw await((y=(p=we(this,Tr).config).onError)==null?void 0:y.call(p,C,n,this.state.context,this)),await((x=(w=this.options).onError)==null?void 0:x.call(w,C,n,this.state.context)),await((I=(S=we(this,Tr).config).onSettled)==null?void 0:I.call(S,void 0,C,this.state.variables,this.state.context,this)),await((E=(M=this.options).onSettled)==null?void 0:E.call(M,void 0,C,n,this.state.context)),C}finally{lr(this,gs,Go).call(this,{type:"error",error:C})}}finally{we(this,Tr).runNext(this)}}},ms=new WeakMap,Tr=new WeakMap,El=new WeakMap,gs=new WeakSet,Go=function(n){const r=i=>{switch(n.type){case"failed":return{...i,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...i,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:n.error,failureCount:i.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Mr.batch(()=>{we(this,ms).forEach(i=>{i.onMutationUpdate(n)}),we(this,Tr).notify({mutation:this,type:"updated",action:n})})},PI);function l6(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ti,Mh,II,c6=(II=class extends Hv{constructor(e={}){super();qt(this,ti);qt(this,Mh);this.config=e,St(this,ti,new Map),St(this,Mh,Date.now())}build(e,n,r){const i=new a6({mutationCache:this,mutationId:++vp(this,Mh)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){const n=kp(e),r=we(this,ti).get(n)??[];r.push(e),we(this,ti).set(n,r),this.notify({type:"added",mutation:e})}remove(e){var r;const n=kp(e);if(we(this,ti).has(n)){const i=(r=we(this,ti).get(n))==null?void 0:r.filter(s=>s!==e);i&&(i.length===0?we(this,ti).delete(n):we(this,ti).set(n,i))}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=(r=we(this,ti).get(kp(e)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===e}runNext(e){var r;const n=(r=we(this,ti).get(kp(e)))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Mr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...we(this,ti).values()].flat()}find(e){const n={exact:!0,...e};return this.getAll().find(r=>$A(n,r))}findAll(e={}){return this.getAll().filter(n=>$A(e,n))}notify(e){Mr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Mr.batch(()=>Promise.all(e.map(n=>n.continue().catch(Hi))))}},ti=new WeakMap,Mh=new WeakMap,II);function kp(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function KA(t){return{onFetch:(e,n)=>{var d,f,u,h,g;const r=e.options,i=(u=(f=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:u.direction,s=((h=e.state.data)==null?void 0:h.pages)||[],o=((g=e.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let v=!1;const m=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(e.signal.aborted?v=!0:e.signal.addEventListener("abort",()=>{v=!0}),e.signal)})},p=iO(e.options,e.fetchOptions),y=async(w,x,S)=>{if(v)return Promise.reject();if(x==null&&w.pages.length)return Promise.resolve(w);const I={queryKey:e.queryKey,pageParam:x,direction:S?"backward":"forward",meta:e.options.meta};m(I);const M=await p(I),{maxPages:E}=e.options,C=S?Q5:Y5;return{pages:C(w.pages,M,E),pageParams:C(w.pageParams,x,E)}};if(i&&s.length){const w=i==="backward",x=w?u6:XA,S={pages:s,pageParams:o},I=x(r,S);a=await y(S,I,w)}else{const w=t??s.length;do{const x=l===0?o[0]??r.initialPageParam:XA(r,a);if(l>0&&x==null)break;a=await y(a,x),l++}while(l<w)}return a};e.options.persister?e.fetchFn=()=>{var v,m;return(m=(v=e.options).persister)==null?void 0:m.call(v,c,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=c}}}function XA(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function u6(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Sn,sa,oa,pu,mu,aa,gu,vu,NI,d6=(NI=class{constructor(t={}){qt(this,Sn);qt(this,sa);qt(this,oa);qt(this,pu);qt(this,mu);qt(this,aa);qt(this,gu);qt(this,vu);St(this,Sn,t.queryCache||new o6),St(this,sa,t.mutationCache||new c6),St(this,oa,t.defaultOptions||{}),St(this,pu,new Map),St(this,mu,new Map),St(this,aa,0)}mount(){vp(this,aa)._++,we(this,aa)===1&&(St(this,gu,sO.subscribe(async t=>{t&&(await this.resumePausedMutations(),we(this,Sn).onFocus())})),St(this,vu,Dg.subscribe(async t=>{t&&(await this.resumePausedMutations(),we(this,Sn).onOnline())})))}unmount(){var t,e;vp(this,aa)._--,we(this,aa)===0&&((t=we(this,gu))==null||t.call(this),St(this,gu,void 0),(e=we(this,vu))==null||e.call(this),St(this,vu,void 0))}isFetching(t){return we(this,Sn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return we(this,sa).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=we(this,Sn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const n=this.defaultQueryOptions(t),r=we(this,Sn).build(this,n);return t.revalidateIfStale&&r.isStaleByTime(HA(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(e)}}getQueriesData(t){return we(this,Sn).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=we(this,Sn).get(r.queryHash),s=i==null?void 0:i.state.data,o=G5(e,s);if(o!==void 0)return we(this,Sn).build(this,r).setData(o,{...n,manual:!0})}
67setQueriesData(t,e,n){return Mr.batch(()=>we(this,Sn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=we(this,Sn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=we(this,Sn);Mr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=we(this,Sn),r={type:"active",...t};return Mr.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t={},e={}){const n={revert:!0,...e},r=Mr.batch(()=>we(this,Sn).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(Hi).catch(Hi)}invalidateQueries(t={},e={}){return Mr.batch(()=>{if(we(this,Sn).findAll(t).forEach(r=>{r.invalidate()}),t.refetchType==="none")return Promise.resolve();const n={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(n,e)})}refetchQueries(t={},e){const n={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=Mr.batch(()=>we(this,Sn).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Hi)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Hi)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=we(this,Sn).build(this,e);return n.isStaleByTime(HA(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Hi).catch(Hi)}fetchInfiniteQuery(t){return t.behavior=KA(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Hi).catch(Hi)}ensureInfiniteQueryData(t){return t.behavior=KA(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Dg.isOnline()?we(this,sa).resumePausedMutations():Promise.resolve()}getQueryCache(){return we(this,Sn)}getMutationCache(){return we(this,sa)}getDefaultOptions(){return we(this,oa)}setDefaultOptions(t){St(this,oa,t)}setQueryDefaults(t,e){we(this,pu).set(nh(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...we(this,pu).values()];let n={};return e.forEach(r=>{rh(t,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(t,e){we(this,mu).set(nh(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...we(this,mu).values()];let n={};return e.forEach(r=>{rh(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...we(this,oa).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Hw(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===Gw&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...we(this,oa).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){we(this,Sn).clear(),we(this,sa).clear()}},Sn=new WeakMap,sa=new WeakMap,oa=new WeakMap,pu=new WeakMap,mu=new WeakMap,aa=new WeakMap,gu=new WeakMap,vu=new WeakMap,NI),f6=O.createContext(void 0),h6=({client:t,children:e})=>(O.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),_.jsx(f6.Provider,{value:t,children:e}));function tt(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function p6(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function $v(...t){return e=>t.forEach(n=>p6(n,e))}function hn(...t){return O.useCallback($v(...t),t)}function m6(t,e){const n=O.createContext(e),r=s=>{const{children:o,...a}=s,l=O.useMemo(()=>a,Object.values(a));return _.jsx(n.Provider,{value:l,children:o})};r.displayName=t+"Provider";function i(s){const o=O.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function qa(t,e=[]){let n=[];function r(s,o){const a=O.createContext(o),l=n.length;n=[...n,o];const c=f=>{var p;const{scope:u,children:h,...g}=f,v=((p=u==null?void 0:u[t])==null?void 0:p[l])||a,m=O.useMemo(()=>g,Object.values(g));return _.jsx(v.Provider,{value:m,children:h})};c.displayName=s+"Provider";function d(f,u){var v;const h=((v=u==null?void 0:u[t])==null?void 0:v[l])||a,g=O.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[c,d]}const i=()=>{const s=n.map(o=>O.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return O.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,g6(i,...e)]}function g6(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:c}
vendor: 5,877 bytes, line 67
67)=>{const f=l(s)[`__scope${c}`];return{...a,...f}},{});return O.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var Ol=O.forwardRef((t,e)=>{const{children:n,...r}=t,i=O.Children.toArray(n),s=i.find(v6);if(s){const o=s.props.children,a=i.map(l=>l===s?O.Children.count(o)>1?O.Children.only(null):O.isValidElement(o)?o.props.children:null:l);return _.jsx(Jx,{...r,ref:e,children:O.isValidElement(o)?O.cloneElement(o,void 0,a):null})}return _.jsx(Jx,{...r,ref:e,children:n})});Ol.displayName="Slot";var Jx=O.forwardRef((t,e)=>{const{children:n,...r}=t;if(O.isValidElement(n)){const i=_6(n);return O.cloneElement(n,{...y6(r,n.props),ref:e?$v(e,i):i})}return O.Children.count(n)>1?O.Children.only(null):null});Jx.displayName="SlotClone";var $w=({children:t})=>_.jsx(_.Fragment,{children:t});function v6(t){return O.isValidElement(t)&&t.type===$w}function y6(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{s(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function _6(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var x6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],kt=x6.reduce((t,e)=>{const n=O.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?Ol:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(a,{...o,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Ww(t,e){t&&qu.flushSync(()=>t.dispatchEvent(e))}function Or(t){const e=O.useRef(t);return O.useEffect(()=>{e.current=t}),O.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function b6(t,e=globalThis==null?void 0:globalThis.document){const n=Or(t);O.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var w6="DismissableLayer",eb="dismissableLayer.update",E6="dismissableLayer.pointerDownOutside",S6="dismissableLayer.focusOutside",YA,uO=O.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Dh=O.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=t,c=O.useContext(uO),[d,f]=O.useState(null),u=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=O.useState({}),g=hn(e,M=>f(M)),v=Array.from(c.layers),[m]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),p=v.indexOf(m),y=d?v.indexOf(d):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,x=y>=p,S=A6(M=>{const E=M.target,C=[...c.branches].some(T=>T.contains(E));!x||C||(i==null||i(M),o==null||o(M),M.defaultPrevented||a==null||a())},u),I=M6(M=>{const E=M.target;[...c.branches].some(T=>T.contains(E))||(s==null||s(M),o==null||o(M),M.defaultPrevented||a==null||a())},u);return b6(M=>{y===c.layers.size-1&&(r==null||r(M),!M.defaultPrevented&&a&&(M.preventDefault(),a()))},u),O.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(YA=u.body.style.pointerEvents,u.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),QA(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(u.body.style.pointerEvents=YA)}},[d,u,n,c]),O.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),QA())},[d,c]),O.useEffect(()=>{const M=()=>h({});return document.addEventListener(eb,M),()=>document.removeEventListener(eb,M)},[]),_.jsx(kt.div,{...l,ref:g,style:{pointerEvents:w?x?"auto":"none":void 0,...t.style},onFocusCapture:tt(t.onFocusCapture,I.onFocusCapture),onBlurCapture:tt(t.onBlurCapture,I.onBlurCapture),onPointerDownCapture:tt(t.onPointerDownCapture,S.onPointerDownCapture)})});Dh.displayName=w6;var T6="DismissableLayerBranch",dO=O.forwardRef((t,e)=>{const n=O.useContext(uO),r=O.useRef(null),i=hn(e,r);return O.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),_.jsx(kt.div,{...t,ref:i})});dO.displayName=T6;function A6(t,e=globalThis==null?void 0:globalThis.document){const n=Or(t),r=O.useRef(!1),i=O.useRef(()=>{});return O.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){fO(E6,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function M6(t,e=globalThis==null?void 0:globalThis.document){const n=Or(t),r=O.useRef(!1);return O.useEffect(()=>{const i=s=>{s.target&&!r.current&&fO(S6,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function QA(){const t=new CustomEvent(eb);document.dispatchEvent(t)}function fO(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?Ww(i,s):i.dispatchEvent(s)}var C6=Dh,R6=dO,Ra=globalThis!=null&&globalThis.document?O.useLayoutEffect:()=>{},P6=HI.useId||(()=>{}),I6=0;function Al(t){const[e,n]=O.useState(P6());return Ra(()=>{t||n(r=>r??String(I6++))},[t]),t||(e?`radix-${e}
67`:"")}const N6=["top","right","bottom","left"],Pa=Math.min,ii=Math.max,kg=Math.round,Lp=Math.floor,Ia=t=>({x:t,y:t}),O6={left:"right",right:"left",bottom:"top",top:"bottom"},D6={start:"end",end:"start"};function tb(t,e,n){return ii(t,Pa(e,n))}function vo(t,e){return typeof t=="function"?t(e):t}function yo(t){return t.split("-")[0]}function Yu(t){return t.split("-")[1]}function qw(t){return t==="x"?"y":"x"}function Kw(t){return t==="y"?"height":"width"}function Na(t){return["top","bottom"].includes(yo(t))?"y":"x"}function Xw(t){return qw(Na(t))}function k6(t,e,n){n===void 0&&(n=!1);const r=Yu(t),i=Xw(t),s=Kw(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Lg(o)),[o,Lg(o)]}function L6(t){const e=Lg(t);return[nb(t),e,nb(e)]}function nb(t){return t.replace(/start|end/g,e=>D6[e])}function F6(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function U6(t,e,n,r){const i=Yu(t);let s=F6(yo(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(nb)))),s}function Lg(t){return t.replace(/left|right|bottom|top/g,e=>O6[e])}function j6(t){return{top:0,right:0,bottom:0,left:0,...t}}function hO(t){return typeof t!="number"?j6(t):{top:t,right:t,bottom:t,left:t}}function Fg(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function ZA(t,e,n){let{reference:r,floating:i}=t;const s=Na(e),o=Xw(e),a=Kw(o),l=yo(e),c=s==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,u=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:d,y:r.y-i.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Yu(e)){case"start":h[o]-=u*(n&&c?-1:1);break;case"end":h[o]+=u*(n&&c?-1:1);break}return h}const B6=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:f}=ZA(c,r,l),u=r,h={},g=0;for(let v=0;v<a.length;v++){const{name:m,fn:p}=a[v],{x:y,y:w,data:x,reset:S}=await p({x:d,y:f,initialPlacement:r,placement:u,strategy:i,middlewareData:h,rects:c,platform:o,elements:{reference:t,floating:e}});d=y??d,f=w??f,h={...h,[m]:{...h[m],...x}},S&&g<=50&&(g++,typeof S=="object"&&(S.placement&&(u=S.placement),S.rects&&(c=S.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:d,y:f}=ZA(c,u,l)),v=-1)}return{x:d,y:f,placement:u,strategy:i,middlewareData:h}};async function ih(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:u=!1,padding:h=0}=vo(e,t),g=hO(h),m=a[u?f==="floating"?"reference":"floating":f],p=Fg(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),y=f==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),x=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},S=Fg(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:w,strategy:l}):y);return{top:(p.top-S.top+g.top)/x.y,bottom:(S.bottom-p.bottom+g.bottom)/x.y,left:(p.left-S.left+g.left)/x.x,right:(S.right-p.right+g.right)/x.x}}const V6=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:d=0}=vo(t,e)||{};if(c==null)return{};const f=hO(d),u={x:n,y:r},h=Xw(i),g=Kw(h),v=await o.getDimensions(c),m=h==="y",p=m?"top":"left",y=m?"bottom":"right",w=m?"clientHeight":"clientWidth",x=s.reference[g]+s.reference[h]-u[h]-s.floating[g],S=u[h]-s.reference[h],I=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let M=I?I[w]:0;(!M||!await(o.isElement==null?void 0:o.isElement(I)))&&(M=a.floating[w]||s.floating[g]);const E=x/2-S/2,C=M/2-v[g]/2-1,T=Pa(f[p],C),A=Pa(f[y],C),R=T,P=M-v[g]-A,D=M/2-v[g]/2+E,F=tb(R,D,P),V=!l.arrow&&Yu(i)!=null&&D!==F&&s.reference[g]/2-(D<R?T:A)-v[g]/2<0,H=V?D<R?D-R:D-P:0;return{[h]:u[h]+H,data:{[h]:F,centerOffset:D-F-H,...V&&{alignmentOffset:H}},reset:V}}}),z6=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...m}=vo(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const p=yo(i),y=Na(a),w=yo(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=u||(w||!v?[Lg(a)]:L6(a)),I=g!=="none";!u&&I&&S.push(...U6(a,v,g,x));const M=[a,...S],E=await ih(e,m),C=[];let T=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&C.push(E[p]),f){const D=k6(i,o,x);C.push(E[D[0]],E[D[1]])}if(T=[...T,{placement:i,overflows:C}],!C.every(D=>D<=0)){var A,R;const D=(((A=s.flip)==null?void 0:A.index)||0)+1,F=M[D];if(F)return{data:{index:D,overflows:T},reset:{placement:F}};let V=(R=T.filter(H=>H.overflows[0]<=0).sort((H,$)=>H.overflows[1]-$.overflows[1])[0])==null?void 0:R.placement;if(!V)switch(h){case"bestFit":{var P;const H=(P=T.filter($=>{if(I){const B=Na($.placement);return B===y||B==="y"}return!0}).map($=>
vendor: 5,988 bytes, line 67
67[$.placement,$.overflows.filter(B=>B>0).reduce((B,G)=>B+G,0)]).sort(($,B)=>$[1]-B[1])[0])==null?void 0:P[0];H&&(V=H);break}case"initialPlacement":V=a;break}if(i!==V)return{reset:{placement:V}}}return{}}}};function JA(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function eM(t){return N6.some(e=>t[e]>=0)}const H6=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=vo(t,e);switch(r){case"referenceHidden":{const s=await ih(e,{...i,elementContext:"reference"}),o=JA(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:eM(o)}}}case"escaped":{const s=await ih(e,{...i,altBoundary:!0}),o=JA(s,n.floating);return{data:{escapedOffsets:o,escaped:eM(o)}}}default:return{}}}}};async function G6(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=yo(n),a=Yu(n),l=Na(n)==="y",c=["left","top"].includes(o)?-1:1,d=s&&l?-1:1,f=vo(e,t);let{mainAxis:u,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*d,y:u*c}:{x:u*c,y:h*d}}const $6=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await G6(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},W6=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:m=>{let{x:p,y}=m;return{x:p,y}}},...l}=vo(t,e),c={x:n,y:r},d=await ih(e,l),f=Na(yo(i)),u=qw(f);let h=c[u],g=c[f];if(s){const m=u==="y"?"top":"left",p=u==="y"?"bottom":"right",y=h+d[m],w=h-d[p];h=tb(y,h,w)}if(o){const m=f==="y"?"top":"left",p=f==="y"?"bottom":"right",y=g+d[m],w=g-d[p];g=tb(y,g,w)}const v=a.fn({...e,[u]:h,[f]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[u]:s,[f]:o}}}}}},q6=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=vo(t,e),d={x:n,y:r},f=Na(i),u=qw(f);let h=d[u],g=d[f];const v=vo(a,e),m=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const w=u==="y"?"height":"width",x=s.reference[u]-s.floating[w]+m.mainAxis,S=s.reference[u]+s.reference[w]-m.mainAxis;h<x?h=x:h>S&&(h=S)}if(c){var p,y;const w=u==="y"?"width":"height",x=["top","left"].includes(yo(i)),S=s.reference[f]-s.floating[w]+(x&&((p=o.offset)==null?void 0:p[f])||0)+(x?0:m.crossAxis),I=s.reference[f]+s.reference[w]+(x?0:((y=o.offset)==null?void 0:y[f])||0)-(x?m.crossAxis:0);g<S?g=S:g>I&&(g=I)}return{[u]:h,[f]:g}}}},K6=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...c}=vo(t,e),d=await ih(e,c),f=yo(i),u=Yu(i),h=Na(i)==="y",{width:g,height:v}=s.floating;let m,p;f==="top"||f==="bottom"?(m=f,p=u===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(p=f,m=u==="end"?"top":"bottom");const y=v-d.top-d.bottom,w=g-d.left-d.right,x=Pa(v-d[m],y),S=Pa(g-d[p],w),I=!e.middlewareData.shift;let M=x,E=S;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(E=w),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(M=y),I&&!u){const T=ii(d.left,0),A=ii(d.right,0),R=ii(d.top,0),P=ii(d.bottom,0);h?E=g-2*(T!==0||A!==0?T+A:ii(d.left,d.right)):M=v-2*(R!==0||P!==0?R+P:ii(d.top,d.bottom))}await l({...e,availableWidth:E,availableHeight:M});const C=await o.getDimensions(a.floating);return g!==C.width||v!==C.height?{reset:{rects:!0}}:{}}}};function Wv(){return typeof window<"u"}function Qu(t){return pO(t)?(t.nodeName||"").toLowerCase():"#document"}function ui(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function zs(t){var e;return(e=(pO(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function pO(t){return Wv()?t instanceof Node||t instanceof ui(t).Node:!1}function es(t){return Wv()?t instanceof Element||t instanceof ui(t).Element:!1}function Ns(t){return Wv()?t instanceof HTMLElement||t instanceof ui(t).HTMLElement:!1}function tM(t){return!Wv()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ui(t).ShadowRoot}function kh(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=ts(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function X6(t){return["table","td","th"].includes(Qu(t))}function qv(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Yw(t){const e=Qw(),n=es(t)?ts(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Y6(t){let e=Oa(t);for(;Ns(e)&&!Tu(e);){if(Yw(e))return e;if(qv(e))return null;e=Oa(e)}return null}function Qw(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Tu(t){return["html","body","#document"].includes(Qu(t))}function ts(t){return ui(t).getComputedStyle(t)}function Kv(t){return es(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Oa(t){if(Qu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||tM(t)&&t.host||zs(t);return tM(e)?e.host:e}function mO(t){const e=Oa(t);return Tu(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ns(e)&&kh(e)?e:mO(e)}function sh(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=mO(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=ui(i);if(s){const a=rb(o);
vendor: 4,742 bytes, line 67
67return e.concat(o,o.visualViewport||[],kh(i)?i:[],a&&n?sh(a):[])}return e.concat(i,sh(i,[],n))}function rb(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function gO(t){const e=ts(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Ns(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=kg(n)!==s||kg(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Zw(t){return es(t)?t:t.contextElement}function Zc(t){const e=Zw(t);if(!Ns(e))return Ia(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=gO(e);let o=(s?kg(n.width):n.width)/r,a=(s?kg(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Q6=Ia(0);function vO(t){const e=ui(t);return!Qw()||!e.visualViewport?Q6:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Z6(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ui(t)?!1:e}function Dl(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Zw(t);let o=Ia(1);e&&(r?es(r)&&(o=Zc(r)):o=Zc(t));const a=Z6(s,n,r)?vO(s):Ia(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(s){const u=ui(s),h=r&&es(r)?ui(r):r;let g=u,v=rb(g);for(;v&&r&&h!==g;){const m=Zc(v),p=v.getBoundingClientRect(),y=ts(v),w=p.left+(v.clientLeft+parseFloat(y.paddingLeft))*m.x,x=p.top+(v.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,d*=m.x,f*=m.y,l+=w,c+=x,g=ui(v),v=rb(g)}}return Fg({width:d,height:f,x:l,y:c})}function J6(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=zs(r),a=e?qv(e.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Ia(1);const d=Ia(0),f=Ns(r);if((f||!f&&!s)&&((Qu(r)!=="body"||kh(o))&&(l=Kv(r)),Ns(r))){const u=Dl(r);c=Zc(r),d.x=u.x+r.clientLeft,d.y=u.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x,y:n.y*c.y-l.scrollTop*c.y+d.y}}function ez(t){return Array.from(t.getClientRects())}function ib(t,e){const n=Kv(t).scrollLeft;return e?e.left+n:Dl(zs(t)).left+n}function tz(t){const e=zs(t),n=Kv(t),r=t.ownerDocument.body,i=ii(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=ii(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+ib(t);const a=-n.scrollTop;return ts(r).direction==="rtl"&&(o+=ii(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function nz(t,e){const n=ui(t),r=zs(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=Qw();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function rz(t,e){const n=Dl(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=Ns(t)?Zc(t):Ia(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function nM(t,e,n){let r;if(e==="viewport")r=nz(t,n);else if(e==="document")r=tz(zs(t));else if(es(e))r=rz(e,n);else{const i=vO(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Fg(r)}function yO(t,e){const n=Oa(t);return n===e||!es(n)||Tu(n)?!1:ts(n).position==="fixed"||yO(n,e)}function iz(t,e){const n=e.get(t);if(n)return n;let r=sh(t,[],!1).filter(a=>es(a)&&Qu(a)!=="body"),i=null;const s=ts(t).position==="fixed";let o=s?Oa(t):t;for(;es(o)&&!Tu(o);){const a=ts(o),l=Yw(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||kh(o)&&!l&&yO(t,o))?r=r.filter(d=>d!==o):i=a,o=Oa(o)}return e.set(t,r),r}function sz(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?qv(e)?[]:iz(e,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,d)=>{const f=nM(e,d,i);return c.top=ii(f.top,c.top),c.right=Pa(f.right,c.right),c.bottom=Pa(f.bottom,c.bottom),c.left=ii(f.left,c.left),c},nM(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function oz(t){const{width:e,height:n}=gO(t);return{width:e,height:n}}function az(t,e,n){const r=Ns(e),i=zs(e),s=n==="fixed",o=Dl(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=Ia(0);if(r||!r&&!s)if((Qu(e)!=="body"||kh(i))&&(a=Kv(e)),r){const h=Dl(e,!0,s,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&(l.x=ib(i));let c=0,d=0;if(i&&!r&&!s){const h=i.getBoundingClientRect();d=h.top+a.scrollTop,c=h.left+a.scrollLeft-ib(i,h)}const f=o.left+a.scrollLeft-l.x-c,u=o.top+a.scrollTop-l.y-d;return{x:f,y:u,width:o.width,height:o.height}}function k_(t){return ts(t).position==="static"}function rM(t,e){if(!Ns(t)||ts(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return zs(t)===n&&(n=n.ownerDocument.body),n}function _O(t,e){const n=ui(t);if(qv(t))return n;if(!Ns(t)){let i=Oa(t);for(;i&&!Tu(i);){if(es(i)&&!k_(i))return i;i=Oa(i)}return n}let r=rM(t,e);for(;r&&X6(r)&&k_(r);)r=rM(r,e);
vendor: 9,887 bytes, line 67
67return r&&Tu(r)&&k_(r)&&!Yw(r)?n:r||Y6(t)||n}const lz=async function(t){const e=this.getOffsetParent||_O,n=this.getDimensions,r=await n(t.floating);return{reference:az(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function cz(t){return ts(t).direction==="rtl"}const uz={convertOffsetParentRelativeRectToViewportRelativeRect:J6,getDocumentElement:zs,getClippingRect:sz,getOffsetParent:_O,getElementRects:lz,getClientRects:ez,getDimensions:oz,getScale:Zc,isElement:es,isRTL:cz};function dz(t,e){let n=null,r;const i=zs(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:d,width:f,height:u}=t.getBoundingClientRect();if(a||e(),!f||!u)return;const h=Lp(d),g=Lp(i.clientWidth-(c+f)),v=Lp(i.clientHeight-(d+u)),m=Lp(c),y={rootMargin:-h+"px "+-g+"px "+-v+"px "+-m+"px",threshold:ii(0,Pa(1,l))||1};let w=!0;function x(S){const I=S[0].intersectionRatio;if(I!==l){if(!w)return o();I?o(!1,I):r=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(x,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,y)}n.observe(t)}return o(!0),s}function fz(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Zw(t),d=i||s?[...c?sh(c):[],...sh(e)]:[];d.forEach(p=>{i&&p.addEventListener("scroll",n,{passive:!0}),s&&p.addEventListener("resize",n)});const f=c&&a?dz(c,n):null;let u=-1,h=null;o&&(h=new ResizeObserver(p=>{let[y]=p;y&&y.target===c&&h&&(h.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(e)})),n()}),c&&!l&&h.observe(c),h.observe(e));let g,v=l?Dl(t):null;l&&m();function m(){const p=Dl(t);v&&(p.x!==v.x||p.y!==v.y||p.width!==v.width||p.height!==v.height)&&n(),v=p,g=requestAnimationFrame(m)}return n(),()=>{var p;d.forEach(y=>{i&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),f==null||f(),(p=h)==null||p.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const hz=$6,pz=W6,mz=z6,gz=K6,vz=H6,iM=V6,yz=q6,_z=(t,e,n)=>{const r=new Map,i={platform:uz,...n},s={...i.platform,_c:r};return B6(t,e,{...i,platform:s})};var Bm=typeof document<"u"?O.useLayoutEffect:O.useEffect;function Ug(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Ug(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!Ug(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function xO(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function sM(t,e){const n=xO(t);return Math.round(e*n)/n}function L_(t){const e=O.useRef(t);return Bm(()=>{e.current=t}),e}function xz(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[d,f]=O.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[u,h]=O.useState(r);Ug(u,r)||h(r);const[g,v]=O.useState(null),[m,p]=O.useState(null),y=O.useCallback($=>{$!==I.current&&(I.current=$,v($))},[]),w=O.useCallback($=>{$!==M.current&&(M.current=$,p($))},[]),x=s||g,S=o||m,I=O.useRef(null),M=O.useRef(null),E=O.useRef(d),C=l!=null,T=L_(l),A=L_(i),R=L_(c),P=O.useCallback(()=>{if(!I.current||!M.current)return;const $={placement:e,strategy:n,middleware:u};A.current&&($.platform=A.current),_z(I.current,M.current,$).then(B=>{const G={...B,isPositioned:R.current!==!1};D.current&&!Ug(E.current,G)&&(E.current=G,qu.flushSync(()=>{f(G)}))})},[u,e,n,A,R]);Bm(()=>{c===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[c]);const D=O.useRef(!1);Bm(()=>(D.current=!0,()=>{D.current=!1}),[]),Bm(()=>{if(x&&(I.current=x),S&&(M.current=S),x&&S){if(T.current)return T.current(x,S,P);P()}},[x,S,P,T,C]);const F=O.useMemo(()=>({reference:I,floating:M,setReference:y,setFloating:w}),[y,w]),V=O.useMemo(()=>({reference:x,floating:S}),[x,S]),H=O.useMemo(()=>{const $={position:n,left:0,top:0};if(!V.floating)return $;const B=sM(V.floating,d.x),G=sM(V.floating,d.y);return a?{...$,transform:"translate("+B+"px, "+G+"px)",...xO(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:G}},[n,a,V.floating,d.x,d.y]);return O.useMemo(()=>({...d,update:P,refs:F,elements:V,floatingStyles:H}),[d,P,F,V,H])}const bz=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?iM({element:r.current,padding:i}).fn(n):{}:r?iM({element:r,padding:i}).fn(n):{}}}},wz=(t,e)=>({...hz(t),options:[t,e]}),Ez=(t,e)=>({...pz(t),options:[t,e]}),Sz=(t,e)=>({...yz(t),options:[t,e]}),Tz=(t,e)=>({...mz(t),options:[t,e]}),Az=(t,e)=>({...gz(t),options:[t,e]}),Mz=(t,e)=>({...vz(t),options:[t,e]}),Cz=(t,e)=>({...bz(t),options:[t,e]});var Rz="Arrow",bO=O.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return _.jsx(kt.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:_.jsx("polygon",{points:"0,0 30,0 15,10"})})});bO.displayName=Rz;var Pz=bO;function Iz(t,e=[]){let n=[];function r(s,o){const a=O.createContext(o),l=n.length;n=[...n,o];function c(f){const{scope:u,children:h,...g}=f,v=(u==null?void 0:u[t][l])||a,m=O.useMemo(()=>g,Object.values(g));return _.jsx(v.Provider,{value:m,children:h})}function d(f,u){const h=(u==null?void 0:u[t][l])||a,g=O.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,d]}const i=()=>{const s=n.map(o=>O.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return O.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,Nz(i,...e)]}function Nz(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(s)[`__scope${c}`];return{...a,...f}},{});return O.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function wO(t){const[e,n]=O.useState(void 0);return Ra(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,a=c.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var Jw="Popper",[EO,Xv]=Iz(Jw),[Oz,SO]=EO(Jw),TO=t=>{const{__scopePopper:e,children:n}=t,[r,i]=O.useState(null);return _.jsx(Oz,{scope:e,anchor:r,onAnchorChange:i,children:n})};TO.displayName=Jw;var AO="PopperAnchor",MO=O.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=SO(AO,n),o=O.useRef(null),a=hn(e,o);return O.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:_.jsx(kt.div,{...i,ref:a})});MO.displayName=AO;var eE="PopperContent",[Dz,kz]=EO(eE),CO=O.forwardRef((t,e)=>{var Q,Z,re,se,ye,Ue;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:u=!1,updatePositionStrategy:h="optimized",onPlaced:g,...v}=t,m=SO(eE,n),[p,y]=O.useState(null),w=hn(e,Ie=>y(Ie)),[x,S]=O.useState(null),I=wO(x),M=(I==null?void 0:I.width)??0,E=(I==null?void 0:I.height)??0,C=r+(s!=="center"?"-"+s:""),T=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},A=Array.isArray(c)?c:[c],R=A.length>0,P={padding:T,boundary:A.filter(Fz),altBoundary:R},{refs:D,floatingStyles:F,placement:V,isPositioned:H,middlewareData:$}=xz({strategy:"fixed",placement:C,whileElementsMounted:(...Ie)=>fz(...Ie,{animationFrame:h==="always"}),elements:{reference:m.anchor},middleware:[wz({mainAxis:i+E,alignmentAxis:o}),l&&Ez({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Sz():void 0,...P}),l&&Tz({...P}),Az({...P,apply:({elements:Ie,rects:je,availableWidth:Ke,availableHeight:Xe})=>{const{width:dt,height:K}=je.reference,de=Ie.floating.style;de.setProperty("--radix-popper-available-width",`${Ke}px`),de.setProperty("--radix-popper-available-height",`${Xe}px`),de.setProperty("--radix-popper-anchor-width",`${dt}px`),de.setProperty("--radix-popper-anchor-height",`${K}px`)}}),x&&Cz({element:x,padding:a}),Uz({arrowWidth:M,arrowHeight:E}),u&&Mz({strategy:"referenceHidden",...P})]}),[B,G]=IO(V),k=Or(g);Ra(()=>{H&&(k==null||k())},[H,k]);const z=(Q=$.arrow)==null?void 0:Q.x,q=(Z=$.arrow)==null?void 0:Z.y,ne=((re=$.arrow)==null?void 0:re.centerOffset)!==0,[ee,j]=O.useState();return Ra(()=>{p&&j(window.getComputedStyle(p).zIndex)},[p]),_.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:H?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(se=$.transformOrigin)==null?void 0:se.x,(ye=$.transformOrigin)==null?void 0:ye.y].join(" "),...((Ue=$.hide)==null?void 0:Ue.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:_.jsx(Dz,{scope:n,placedSide:B,onArrowChange:S,arrowX:z,arrowY:q,shouldHideArrow:ne,children:_.jsx(kt.div,{"data-side":B,"data-align":G,...v,ref:w,style:{...v.style,animation:H?void 0:"none"}})})})});CO.displayName=eE;var RO="PopperArrow",Lz={top:"bottom",right:"left",bottom:"top",left:"r
67ight"},PO=O.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=kz(RO,r),o=Lz[s.placedSide];return _.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:_.jsx(Pz,{...i,ref:n,style:{...i.style,display:"block"}})})});PO.displayName=RO;function Fz(t){return t!==null}var Uz=t=>({name:"transformOrigin",options:t,fn(e){var m,p,y;const{placement:n,rects:r,middlewareData:i}=e,o=((m=i.arrow)==null?void 0:m.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[c,d]=IO(n),f={start:"0%",center:"50%",end:"100%"}[d],u=(((p=i.arrow)==null?void 0:p.x)??0)+a/2,h=(((y=i.arrow)==null?void 0:y.y)??0)+l/2;let g="",v="";return c==="bottom"?(g=o?f:`${u}px`,v=`${-l}px`):c==="top"?(g=o?f:`${u}px`,v=`${r.floating.height+l}px`):c==="right"?(g=`${-l}px`,v=o?f:`${h}px`):c==="left"&&(g=`${r.floating.width+l}px`,v=o?f:`${h}px`),{data:{x:g,y:v}}}});function IO(t){const[e,n="center"]=t.split("-");return[e,n]}var jz=TO,NO=MO,OO=CO,DO=PO,Bz="Portal",Yv=O.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[i,s]=O.useState(!1);Ra(()=>s(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?WN.createPortal(_.jsx(kt.div,{...r,ref:e}),o):null});Yv.displayName=Bz;function Vz(t,e){return O.useReducer((n,r)=>e[n][r]??n,t)}var is=t=>{const{present:e,children:n}=t,r=zz(e),i=typeof n=="function"?n({present:r.isPresent}):O.Children.only(n),s=hn(r.ref,Hz(i));return typeof n=="function"||r.isPresent?O.cloneElement(i,{ref:s}):null};is.displayName="Presence";function zz(t){const[e,n]=O.useState(),r=O.useRef({}),i=O.useRef(t),s=O.useRef("none"),o=t?"mounted":"unmounted",[a,l]=Vz(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return O.useEffect(()=>{const c=Fp(r.current);s.current=a==="mounted"?c:"none"},[a]),Ra(()=>{const c=r.current,d=i.current;if(d!==t){const u=s.current,h=Fp(c);t?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&u!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),Ra(()=>{if(e){let c;const d=e.ownerDocument.defaultView??window,f=h=>{const v=Fp(r.current).includes(h.animationName);if(h.target===e&&v&&(l("ANIMATION_END"),!i.current)){const m=e.style.animationFillMode;e.style.animationFillMode="forwards",c=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=m)})}},u=h=>{h.target===e&&(s.current=Fp(r.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",f),e.addEventListener("animationend",f),()=>{d.clearTimeout(c),e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",f),e.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:O.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Fp(t){return(t==null?void 0:t.animationName)||"none"}function Hz(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function Zu({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=Gz({defaultProp:e,onChange:n}),s=t!==void 0,o=s?t:r,a=Or(n),l=O.useCallback(c=>{if(s){const f=typeof c=="function"?c(t):c;f!==t&&a(f)}else i(c)},[s,t,i,a]);return[o,l]}function Gz({defaultProp:t,onChange:e}){const n=O.useState(t),[r]=n,i=O.useRef(r),s=Or(e);return O.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}var $z="VisuallyHidden",Qv=O.forwardRef((t,e)=>_.jsx(kt.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));Qv.displayName=$z;var Wz=Qv,[Zv,gge]=qa("Tooltip",[Xv]),tE=Xv(),kO="TooltipProvider",qz=700,oM="tooltip.open",[Kz,LO]=Zv(kO),FO=t=>{const{__scopeTooltip:e,delayDuration:n=qz,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=t,[o,a]=O.useState(!0),l=O.useRef(!1),c=O.useRef(0);return O.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),_.jsx(Kz,{scope:e,isOpenDelayed:o,delayDuration:n,onOpen:O.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:O.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:O.useCallback(d=>{l.current=d}
vendor: 5,959 bytes, line 67
67,[]),disableHoverableContent:i,children:s})};FO.displayName=kO;var UO="Tooltip",[vge,Jv]=Zv(UO),sb="TooltipTrigger",Xz=O.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Jv(sb,n),s=LO(sb,n),o=tE(n),a=O.useRef(null),l=hn(e,a,i.onTriggerChange),c=O.useRef(!1),d=O.useRef(!1),f=O.useCallback(()=>c.current=!1,[]);return O.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),_.jsx(NO,{asChild:!0,...o,children:_.jsx(kt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:tt(t.onPointerMove,u=>{u.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:tt(t.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:tt(t.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:tt(t.onFocus,()=>{c.current||i.onOpen()}),onBlur:tt(t.onBlur,i.onClose),onClick:tt(t.onClick,i.onClose)})})});Xz.displayName=sb;var Yz="TooltipPortal",[yge,Qz]=Zv(Yz,{forceMount:void 0}),Au="TooltipContent",jO=O.forwardRef((t,e)=>{const n=Qz(Au,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=t,o=Jv(Au,t.__scopeTooltip);return _.jsx(is,{present:r||o.open,children:o.disableHoverableContent?_.jsx(BO,{side:i,...s,ref:e}):_.jsx(Zz,{side:i,...s,ref:e})})}),Zz=O.forwardRef((t,e)=>{const n=Jv(Au,t.__scopeTooltip),r=LO(Au,t.__scopeTooltip),i=O.useRef(null),s=hn(e,i),[o,a]=O.useState(null),{trigger:l,onClose:c}=n,d=i.current,{onPointerInTransitChange:f}=r,u=O.useCallback(()=>{a(null),f(!1)},[f]),h=O.useCallback((g,v)=>{const m=g.currentTarget,p={x:g.clientX,y:g.clientY},y=n9(p,m.getBoundingClientRect()),w=r9(p,y),x=i9(v.getBoundingClientRect()),S=o9([...w,...x]);a(S),f(!0)},[f]);return O.useEffect(()=>()=>u(),[u]),O.useEffect(()=>{if(l&&d){const g=m=>h(m,d),v=m=>h(m,l);return l.addEventListener("pointerleave",g),d.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",v)}}},[l,d,h,u]),O.useEffect(()=>{if(o){const g=v=>{const m=v.target,p={x:v.clientX,y:v.clientY},y=(l==null?void 0:l.contains(m))||(d==null?void 0:d.contains(m)),w=!s9(p,o);y?u():w&&(u(),c())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,d,o,c,u]),_.jsx(BO,{...t,ref:s})}),[Jz,e9]=Zv(UO,{isInside:!1}),BO=O.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=t,l=Jv(Au,n),c=tE(n),{onClose:d}=l;return O.useEffect(()=>(document.addEventListener(oM,d),()=>document.removeEventListener(oM,d)),[d]),O.useEffect(()=>{if(l.trigger){const f=u=>{const h=u.target;h!=null&&h.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),_.jsx(Dh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:_.jsxs(OO,{"data-state":l.stateAttribute,...c,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[_.jsx($w,{children:r}),_.jsx(Jz,{scope:n,isInside:!0,children:_.jsx(Wz,{id:l.contentId,role:"tooltip",children:i||r})})]})})});jO.displayName=Au;var VO="TooltipArrow",t9=O.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=tE(n);return e9(VO,n).isInside?null:_.jsx(DO,{...i,...r,ref:e})});t9.displayName=VO;function n9(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function r9(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function i9(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function s9(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s].x,l=e[s].y,c=e[o].x,d=e[o].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(i=!i)}return i}function o9(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),a9(e)}function a9(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var l9=FO,zO=jO;function HO(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=HO(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function GO(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=HO(t))&&(r&&(r+=" "),r+=e);return r}const nE="-",c9=t=>{const e=d9(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(nE);return a[0]===""&&a.length!==1&&a.shift(),$O(a,e)||u9(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},$O=(t,e)=>{var o;if(t.length===0)return e.classGroupId;
vendor: 4,984 bytes, line 67
67const n=t[0],r=e.nextPart.get(n),i=r?$O(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(nE);return(o=e.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},aM=/^\[(.+)\]$/,u9=t=>{if(aM.test(t)){const e=aM.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},d9=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return h9(Object.entries(t.classGroups),n).forEach(([s,o])=>{ob(o,r,s,e)}),r},ob=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:lM(e,i);s.classGroupId=n;return}if(typeof i=="function"){if(f9(i)){ob(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{ob(o,lM(e,s),n,r)})})},lM=(t,e)=>{let n=t;return e.split(nE).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},f9=t=>t.isThemeGetter,h9=(t,e)=>e?t.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[e+o,a])):s);return[n,i]}):t,p9=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},WO="!",m9=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],s=e.length,o=a=>{const l=[];let c=0,d=0,f;for(let m=0;m<a.length;m++){let p=a[m];if(c===0){if(p===i&&(r||a.slice(m,m+s)===e)){l.push(a.slice(d,m)),d=m+s;continue}if(p==="/"){f=m;continue}}p==="["?c++:p==="]"&&c--}const u=l.length===0?a:a.substring(d),h=u.startsWith(WO),g=h?u.substring(1):u,v=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:v}};return n?a=>n({className:a,parseClassName:o}):o},g9=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},v9=t=>({cache:p9(t.cacheSize),parseClassName:m9(t),...c9(t)}),y9=/\s+/,_9=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],o=t.trim().split(y9);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:d,hasImportantModifier:f,baseClassName:u,maybePostfixModifierPosition:h}=n(c);let g=!!h,v=r(g?u.substring(0,h):u);if(!v){if(!g){a=c+(a.length>0?" "+a:a);continue}if(v=r(u),!v){a=c+(a.length>0?" "+a:a);continue}g=!1}const m=g9(d).join(":"),p=f?m+WO:m,y=p+v;if(s.includes(y))continue;s.push(y);const w=i(v,g);for(let x=0;x<w.length;++x){const S=w[x];s.push(p+S)}a=c+(a.length>0?" "+a:a)}return a};function x9(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=qO(e))&&(r&&(r+=" "),r+=n);return r}const qO=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=qO(t[r]))&&(n&&(n+=" "),n+=e);return n};function b9(t,...e){let n,r,i,s=o;function o(l){const c=e.reduce((d,f)=>f(d),t());return n=v9(c),r=n.cache.get,i=n.cache.set,s=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=_9(l,n);return i(l,d),d}return function(){return s(x9.apply(null,arguments))}}const tn=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},KO=/^\[(?:([a-z-]+):)?(.+)\]$/i,w9=/^\d+\/\d+$/,E9=new Set(["px","full","screen"]),S9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,T9=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,A9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,M9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,C9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qs=t=>Jc(t)||E9.has(t)||w9.test(t),ko=t=>Ju(t,"length",L9),Jc=t=>!!t&&!Number.isNaN(Number(t)),F_=t=>Ju(t,"number",Jc),Ld=t=>!!t&&Number.isInteger(Number(t)),R9=t=>t.endsWith("%")&&Jc(t.slice(0,-1)),bt=t=>KO.test(t),Lo=t=>S9.test(t),P9=new Set(["length","size","percentage"]),I9=t=>Ju(t,P9,XO),N9=t=>Ju(t,"position",XO),O9=new Set(["image","url"]),D9=t=>Ju(t,O9,U9),k9=t=>Ju(t,"",F9),Fd=()=>!0,Ju=(t,e,n)=>{const r=KO.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},L9=t=>T9.test(t)&&!A9.test(t),XO=()=>!1,F9=t=>M9.test(t),U9=t=>C9.test(t),j9=()=>{const t=tn("colors"),e=tn("spacing"),n=tn("blur"),r=tn("brightness"),i=tn("borderColor"),s=tn("borderRadius"),o=tn("borderSpacing"),a=tn("borderWidth"),l=tn("contrast"),c=tn("grayscale"),d=tn("hueRotate"),f=tn("invert"),u=tn("gap"),h=tn("gradientColorStops"),g=tn("gradientColorStopPositions"),v=tn("inset"),m=tn("margin"),p=tn("opacity"),y=tn("padding"),w=tn("saturate"),x=tn("scale"),S=tn("sepia"),I=tn("skew"),M=tn("space"),E=tn("translate"),C=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",bt,e],R=()=>[bt,e],P=()=>["",qs,ko],D=()=>["auto",Jc,bt],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],
vendor: 12,070 bytes, line 67
67V=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",bt],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>[Jc,bt];return{cacheSize:500,separator:":",theme:{colors:[Fd],spacing:[qs,ko],blur:["none","",Lo,bt],brightness:k(),borderColor:[t],borderRadius:["none","","full",Lo,bt],borderSpacing:R(),borderWidth:P(),contrast:k(),grayscale:B(),hueRotate:k(),invert:B(),gap:R(),gradientColorStops:[t],gradientColorStopPositions:[R9,ko],inset:A(),margin:A(),opacity:k(),padding:R(),saturate:k(),scale:k(),sepia:B(),skew:k(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",bt]}],container:["container"],columns:[{columns:[Lo]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...F(),bt]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ld,bt]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",bt]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",Ld,bt]}],"grid-cols":[{"grid-cols":[Fd]}],"col-start-end":[{col:["auto",{span:["full",Ld,bt]},bt]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[Fd]}],"row-start-end":[{row:["auto",{span:[Ld,bt]},bt]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",bt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",bt]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[M]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[M]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",bt,e]}],"min-w":[{"min-w":[bt,e,"min","max","fit"]}],"max-w":[{"max-w":[bt,e,"none","full","min","max","fit","prose",{screen:[Lo]},Lo]}],h:[{h:[bt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[bt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[bt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[bt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Lo,ko]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",F_]}],"font-family":[{font:[Fd]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",bt]}],"line-clamp":[{"line-clamp":["none",Jc,F_]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",qs,bt]}],"list-image":[{"list-image":["none",bt]}],"list-style-type":[{list:["none","disc","decimal",bt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",qs,ko]}],"underline-offset":[{"underline-offset":["auto",qs,bt]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",bt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",bt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),N9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",I9]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},D9]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[p]}],"border-style":[{border:[...V(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[p]}],"divide-style":[{divide:V()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[qs,bt]}],"outline-w":[{outline:[qs,ko]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[qs,ko]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Lo,k9]}],"shadow-color":[{shadow:[Fd]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Lo,bt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",bt]}],duration:[{duration:k()}],ease:[{ease:["linear","in","out","in-out",bt]}],delay:[{delay:k()}],animate:[{animate:["none","spin","ping","pulse","bounce",bt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Ld,bt]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[I]}],"skew-y":[{"skew-y":[I]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",bt]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",bt]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
67],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",bt]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[qs,ko,F_]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},B9=b9(j9);function Mt(...t){return B9(GO(t))}const V9=l9,z9=O.forwardRef(({className:t,sideOffset:e=4,...n},r)=>_.jsx(zO,{ref:r,sideOffset:e,className:Mt("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));z9.displayName=zO.displayName;const H9=1,G9=1e6;let U_=0;function $9(){return U_=(U_+1)%Number.MAX_SAFE_INTEGER,U_.toString()}const j_=new Map,cM=t=>{if(j_.has(t))return;const e=setTimeout(()=>{j_.delete(t),Ef({type:"REMOVE_TOAST",toastId:t})},G9);j_.set(t,e)},W9=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,H9)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?cM(n):t.toasts.forEach(r=>{cM(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Vm=[];let zm={toasts:[]};function Ef(t){zm=W9(zm,t),Vm.forEach(e=>{e(zm)})}function Rt({...t}){const e=$9(),n=i=>Ef({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>Ef({type:"DISMISS_TOAST",toastId:e});return Ef({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}function q9(){const[t,e]=O.useState(zm);return O.useEffect(()=>(Vm.push(e),()=>{const n=Vm.indexOf(e);n>-1&&Vm.splice(n,1)}),[t]),{...t,toast:Rt,dismiss:n=>Ef({type:"DISMISS_TOAST",toastId:n})}}function K9(t,e=[]){let n=[];function r(s,o){const a=O.createContext(o),l=n.length;n=[...n,o];function c(f){const{scope:u,children:h,...g}=f,v=(u==null?void 0:u[t][l])||a,m=O.useMemo(()=>g,Object.values(g));return _.jsx(v.Provider,{value:m,children:h})}function d(f,u){const h=(u==null?void 0:u[t][l])||a,g=O.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,d]}const i=()=>{const s=n.map(o=>O.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return O.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,X9(i,...e)]}function X9(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:c}
67)=>{const f=l(s)[`__scope${c}`];return{...a,...f}},{});return O.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function rE(t){const e=t+"CollectionProvider",[n,r]=K9(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=h=>{const{scope:g,children:v}=h,m=De.useRef(null),p=De.useRef(new Map).current;return _.jsx(i,{scope:g,itemMap:p,collectionRef:m,children:v})};o.displayName=e;const a=t+"CollectionSlot",l=De.forwardRef((h,g)=>{const{scope:v,children:m}=h,p=s(a,v),y=hn(g,p.collectionRef);return _.jsx(Ol,{ref:y,children:m})});l.displayName=a;const c=t+"CollectionItemSlot",d="data-radix-collection-item",f=De.forwardRef((h,g)=>{const{scope:v,children:m,...p}=h,y=De.useRef(null),w=hn(g,y),x=s(c,v);return De.useEffect(()=>(x.itemMap.set(y,{ref:y,...p}),()=>void x.itemMap.delete(y))),_.jsx(Ol,{[d]:"",ref:w,children:m})});f.displayName=c;function u(h){const g=s(t+"CollectionConsumer",h);return De.useCallback(()=>{const m=g.collectionRef.current;if(!m)return[];const p=Array.from(m.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((x,S)=>p.indexOf(x.ref.current)-p.indexOf(S.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:l,ItemSlot:f},u,r]}var iE="ToastProvider",[sE,Y9,Q9]=rE("Toast"),[YO,_ge]=qa("Toast",[Q9]),[Z9,ey]=YO(iE),QO=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=t,[a,l]=O.useState(null),[c,d]=O.useState(0),f=O.useRef(!1),u=O.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${iE}\`. Expected non-empty \`string\`.`),_.jsx(sE.Provider,{scope:e,children:_.jsx(Z9,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:O.useCallback(()=>d(h=>h+1),[]),onToastRemove:O.useCallback(()=>d(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:u,children:o})})};QO.displayName=iE;var ZO="ToastViewport",J9=["F8"],ab="toast.viewportPause",lb="toast.viewportResume",JO=O.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=J9,label:i="Notifications ({hotkey})",...s}=t,o=ey(ZO,n),a=Y9(n),l=O.useRef(null),c=O.useRef(null),d=O.useRef(null),f=O.useRef(null),u=hn(e,f,o.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=o.toastCount>0;O.useEffect(()=>{const m=p=>{var w;r.length!==0&&r.every(x=>p[x]||p.code===x)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[r]),O.useEffect(()=>{const m=l.current,p=f.current;if(g&&m&&p){const y=()=>{if(!o.isClosePausedRef.current){const I=new CustomEvent(ab);p.dispatchEvent(I),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const I=new CustomEvent(lb);p.dispatchEvent(I),o.isClosePausedRef.current=!1}},x=I=>{!m.contains(I.relatedTarget)&&w()},S=()=>{m.contains(document.activeElement)||w()};return m.addEventListener("focusin",y),m.addEventListener("focusout",x),m.addEventListener("pointermove",y),m.addEventListener("pointerleave",S),window.addEventListener("blur",y),window.addEventListener("focus",w),()=>{m.removeEventListener("focusin",y),m.removeEventListener("focusout",x),m.removeEventListener("pointermove",y),m.removeEventListener("pointerleave",S),window.removeEventListener("blur",y),window.removeEventListener("focus",w)}}},[g,o.isClosePausedRef]);const v=O.useCallback(({tabbingDirection:m})=>{const y=a().map(w=>{const x=w.ref.current,S=[x,...f8(x)];return m==="forwards"?S:S.reverse()});return(m==="forwards"?y.reverse():y).flat()},[a]);return O.useEffect(()=>{const m=f.current;if(m){const p=y=>{var S,I,M;const w=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!w){const E=document.activeElement,C=y.shiftKey;if(y.target===m&&C){(S=c.current)==null||S.focus();return}const R=v({tabbingDirection:C?"backwards":"forwards"}),P=R.findIndex(D=>D===E);B_(R.slice(P+1))?y.preventDefault():C?(I=c.current)==null||I.focus():(M=d.current)==null||M.focus()}};return m.addEventListener("keydown",p),()=>m.removeEventListener("keydown",p)}},[a,v]),_.jsxs(R6,{ref:l,role:"region","aria-label":i.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&_.jsx(cb,{ref:c,onFocusFromOutsideViewport:()=>{const m=v({tabbingDirection:"forwards"});B_(m)}}),_.jsx(sE.Slot,{scope:n,children:_.jsx(kt.ol,{tabIndex:-1,...s,ref:u})}),g&&_.jsx(cb,{ref:d,onFocusFromOutsideViewport:()=>{const m=v({tabbingDirection:"backwards"});B_(m)}})]})});JO.displayName=ZO;var eD="ToastFocusProxy",cb=O.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,s=ey(eD,n);return _.jsx(Qv,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:o=>{var c;const a=o.relatedTarget;!((c=s.viewport)!=null&&c.contains(a))&&r()}})});cb.displayName=eD;var ty="Toast",e8="toast.swipeStart",t8="toast.swipeMove",n8="toast.swipeCancel",r8="toast.swipeEnd",tD=O.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...o}=t,[a=!0,l]=Zu({prop:r,defaultProp:i,onChange:s});return _.jsx(is,{present:n||a,children:_.jsx(o8,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:Or(t.onPause),onResume:Or(t.onResume),onSwipeStart:tt(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:tt(t.onSwipeMove,c=>{const{x:d,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:tt(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:tt(t.onSwipeEnd,c=>{const{x:d,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});tD.displayName=ty;var[i8,s8]=YO(ty,{onClose(){}}),o8=O.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:u,onSwipeEnd:h,...g}=t,v=ey(ty,n),[m,p]=O.useState(null),y=hn(e,D=>p(D)),w=O.useRef(null),x=O.useRef(null),S=i||v.duration,I=O.useRef(0),M=O.useRef(S),E=O.useRef(0),{onToastAdd:C,onToastRemove:T}=v,A=Or(()=>{var F;(m==null?void 0:m.contains(document.activeElement))&&((F=v.viewport)==null||F.focus()),o()}),R=O.useCallback(D=>
67{!D||D===1/0||(window.clearTimeout(E.current),I.current=new Date().getTime(),E.current=window.setTimeout(A,D))},[A]);O.useEffect(()=>{const D=v.viewport;if(D){const F=()=>{R(M.current),c==null||c()},V=()=>{const H=new Date().getTime()-I.current;M.current=M.current-H,window.clearTimeout(E.current),l==null||l()};return D.addEventListener(ab,V),D.addEventListener(lb,F),()=>{D.removeEventListener(ab,V),D.removeEventListener(lb,F)}}},[v.viewport,S,l,c,R]),O.useEffect(()=>{s&&!v.isClosePausedRef.current&&R(S)},[s,S,v.isClosePausedRef,R]),O.useEffect(()=>(C(),()=>T()),[C,T]);const P=O.useMemo(()=>m?lD(m):null,[m]);return v.viewport?_.jsxs(_.Fragment,{children:[P&&_.jsx(a8,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:P}),_.jsx(i8,{scope:n,onClose:A,children:qu.createPortal(_.jsx(sE.ItemSlot,{scope:n,children:_.jsx(C6,{asChild:!0,onEscapeKeyDown:tt(a,()=>{v.isFocusedToastEscapeKeyDownRef.current||A(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:_.jsx(kt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":v.swipeDirection,...g,ref:y,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:tt(t.onKeyDown,D=>{D.key==="Escape"&&(a==null||a(D.nativeEvent),D.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,A()))}),onPointerDown:tt(t.onPointerDown,D=>{D.button===0&&(w.current={x:D.clientX,y:D.clientY})}),onPointerMove:tt(t.onPointerMove,D=>{if(!w.current)return;const F=D.clientX-w.current.x,V=D.clientY-w.current.y,H=!!x.current,$=["left","right"].includes(v.swipeDirection),B=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,G=$?B(0,F):0,k=$?0:B(0,V),z=D.pointerType==="touch"?10:2,q={x:G,y:k},ne={originalEvent:D,delta:q};H?(x.current=q,Up(t8,f,ne,{discrete:!1})):uM(q,v.swipeDirection,z)?(x.current=q,Up(e8,d,ne,{discrete:!1}),D.target.setPointerCapture(D.pointerId)):(Math.abs(F)>z||Math.abs(V)>z)&&(w.current=null)}),onPointerUp:tt(t.onPointerUp,D=>{const F=x.current,V=D.target;if(V.hasPointerCapture(D.pointerId)&&V.releasePointerCapture(D.pointerId),x.current=null,w.current=null,F){const H=D.currentTarget,$={originalEvent:D,delta:F};uM(F,v.swipeDirection,v.swipeThreshold)?Up(r8,h,$,{discrete:!0}):Up(n8,u,$,{discrete:!0}),H.addEventListener("click",B=>B.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),a8=t=>{const{__scopeToast:e,children:n,...r}=t,i=ey(ty,e),[s,o]=O.useState(!1),[a,l]=O.useState(!1);return u8(()=>o(!0)),O.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:_.jsx(Yv,{asChild:!0,children:_.jsx(Qv,{...r,children:s&&_.jsxs(_.Fragment,{children:[i.label," ",n]})})})},l8="ToastTitle",nD=O.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return _.jsx(kt.div,{...r,ref:e})});nD.displayName=l8;var c8="ToastDescription",rD=O.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return _.jsx(kt.div,{...r,ref:e})});rD.displayName=c8;var iD="ToastAction",sD=O.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?_.jsx(aD,{altText:n,asChild:!0,children:_.jsx(oE,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${iD}\`. Expected non-empty \`string\`.`),null)});sD.displayName=iD;var oD="ToastClose",oE=O.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=s8(oD,n);return _.jsx(aD,{asChild:!0,children:_.jsx(kt.button,{type:"button",...r,ref:e,onClick:tt(t.onClick,i.onClose)})})});oE.displayName=oD;var aD=O.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return _.jsx(kt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function lD(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),d8(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...lD(r))}}),e}function Up(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?Ww(i,s):i.dispatchEvent(s)}var uM=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),s=r>i;return e==="left"||e==="right"?s&&r>n:!s&&i>n};function u8(t=()=>{}){const e=Or(t);Ra(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function d8(t){return t.nodeType===t.ELEMENT_NODE}function f8(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function B_(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var h8=QO,cD=JO,uD=tD,dD=nD,fD=rD,hD=sD,pD=oE;const dM=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,fM=GO,ny=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return fM(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=e,o=Object.keys(i).map(c=>{const d=n==null?void 0:n[c],f=s==null?void 0:s[c];if(d===null)return null;const u=dM(d)||dM(f);return i[c][u]}),a=n&&Object.entries(n).reduce((c,d)=>{let[f,u]=d;return u===void 0||(c[f]=u),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:u,...h}=d;return Object.entries(h).every(g=>{let[v,m]=g;return Array.isArray(m)?m.includes({...s,...a}[v]):{...s,...a}[v]===m})?[...c,f,u]:c},[]);return fM(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)};/**
68 * @license lucide-react v0.462.0 - ISC
69 *
70 * This source code is licensed under the ISC license.
71 * See the LICENSE file in the root directory of this source tree.
72 */const p8=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mD=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
73 * @license lucide-react v0.462.0 - ISC
74 *
75 * This source code is licensed under the ISC license.
76 * See the LICENSE file in the root directory of this source tree.
77 */var m8={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
78 * @license lucide-react v0.462.0 - ISC
79 *
80 * This source code is licensed under the ISC license.
81 * See the LICENSE file in the root directory of this source tree.
82 */const g8=O.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>O.createElement("svg",{ref:l,...m8,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:mD("lucide",i),...a},[...o.map(([c,d])=>O.createElement(c,d)),...Array.isArray(s)?s:[s]]));/**
83 * @license lucide-react v0.462.0 - ISC
84 *
85 * This source code is licensed under the ISC license.
86 * See the LICENSE file in the root directory of this source tree.
87 */const ft=(t,e)=>{const n=O.forwardRef(({className:r,...i},s)=>O.createElement(g8,{ref:s,iconNode:e,className:mD(`lucide-${p8(t)}`,r),...i}));return n.displayName=`${t}`,n};/**
88 * @license lucide-react v0.462.0 - ISC
89 *
90 * This source code is licensed under the ISC license.
91 * See the LICENSE file in the root directory of this source tree.
92 */const v8=ft("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
93 * @license lucide-react v0.462.0 - ISC
94 *
95 * This source code is licensed under the ISC license.
96 * See the LICENSE file in the root directory of this source tree.
97 */const y8=ft("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
98 * @license lucide-react v0.462.0 - ISC
99 *
100 * This source code is licensed under the ISC license.
101 * See the LICENSE file in the root directory of this source tree.
102 */const Lh=ft("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
103 * @license lucide-react v0.462.0 - ISC
104 *
105 * This source code is licensed under the ISC license.
106 * See the LICENSE file in the root directory of this source tree.
107 */const jg=ft("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
108 * @license lucide-react v0.462.0 - ISC
109 *
110 * This source code is licensed under the ISC license.
111 * See the LICENSE file in the root directory of this source tree.
112 */const _8=ft("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
112],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
113 * @license lucide-react v0.462.0 - ISC
114 *
115 * This source code is licensed under the ISC license.
116 * See the LICENSE file in the root directory of this source tree.
117 */const x8=ft("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/**
118 * @license lucide-react v0.462.0 - ISC
119 *
120 * This source code is licensed under the ISC license.
121 * See the LICENSE file in the root directory of this source tree.
122 */const Bg=ft("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);/**
123 * @license lucide-react v0.462.0 - ISC
124 *
125 * This source code is licensed under the ISC license.
126 * See the LICENSE file in the root directory of this source tree.
127 */const b8=ft("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
128 * @license lucide-react v0.462.0 - ISC
129 *
130 * This source code is licensed under the ISC license.
131 * See the LICENSE file in the root directory of this source tree.
132 */const w8=ft("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
133 * @license lucide-react v0.462.0 - ISC
134 *
135 * This source code is licensed under the ISC license.
136 * See the LICENSE file in the root directory of this source tree.
137 */const Fh=ft("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
138 * @license lucide-react v0.462.0 - ISC
139 *
140 * This source code is licensed under the ISC license.
141 * See the LICENSE file in the root directory of this source tree.
142 */const E8=ft("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
143 * @license lucide-react v0.462.0 - ISC
144 *
145 * This source code is licensed under the ISC license.
146 * See the LICENSE file in the root directory of this source tree.
147 */const gD=ft("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
148 * @license lucide-react v0.462.0 - ISC
149 *
150 * This source code is licensed under the ISC license.
151 * See the LICENSE file in the root directory of this source tree.
152 */const S8=ft("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
153 * @license lucide-react v0.462.0 - ISC
154 *
155 * This source code is licensed under the ISC license.
156 * See the LICENSE file in the root directory of this source tree.
157 */const T8=ft("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
158 * @license lucide-react v0.462.0 - ISC
159 *
160 * This source code is licensed under the ISC license.
161 * See the LICENSE file in the root directory of this source tree.
162 */const A8=ft("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/**
163 * @license lucide-react v0.462.0 - ISC
164 *
165 * This source code is licensed under the ISC license.
166 * See the LICENSE file in the root directory of this source tree.
167 */const oh=ft("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
168 * @license lucide-react v0.462.0 - ISC
169 *
170 * This source code is licensed under the ISC license.
171 * See the LICENSE file in the root directory of this source tree.
172 */const Vg=ft("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
173 * @license lucide-react v0.462.0 - ISC
174 *
175 * This source code is licensed under the ISC license.
176 * See the LICENSE file in the root directory of this source tree.
177 */const vD=ft("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
178 * @license lucide-react v0.462.0 - ISC
179 *
180 * This source code is licensed under the ISC license.
181 * See the LICENSE file in the root directory of this source tree.
182 */const ah=ft("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
183 * @license lucide-react v0.462.0 - ISC
184 *
185 * This source code is licensed under the ISC license.
186 * See the LICENSE file in the root directory of this source tree.
187 */const M8=ft("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/**
188 * @license lucide-react v0.462.0 - ISC
189 *
190 * This source code is licensed under the ISC license.
191 * See the LICENSE file in the root directory of this source tree.
192 */const hM=ft("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
193 * @license lucide-react v0.462.0 - ISC
194 *
195 * This source code is licensed under the ISC license.
196 * See the LICENSE file in the root directory of this source tree.
197 */const C8=ft("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
198 * @license lucide-react v0.462.0 - ISC
199 *
200 * This source code is licensed under the ISC license.
201 * See the LICENSE file in the root directory of this source tree.
202 */const R8=ft("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}
202],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
203 * @license lucide-react v0.462.0 - ISC
204 *
205 * This source code is licensed under the ISC license.
206 * See the LICENSE file in the root directory of this source tree.
207 */const P8=ft("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/**
208 * @license lucide-react v0.462.0 - ISC
209 *
210 * This source code is licensed under the ISC license.
211 * See the LICENSE file in the root directory of this source tree.
212 */const I8=ft("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
213 * @license lucide-react v0.462.0 - ISC
214 *
215 * This source code is licensed under the ISC license.
216 * See the LICENSE file in the root directory of this source tree.
217 */const pM=ft("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
218 * @license lucide-react v0.462.0 - ISC
219 *
220 * This source code is licensed under the ISC license.
221 * See the LICENSE file in the root directory of this source tree.
222 */const aE=ft("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
223 * @license lucide-react v0.462.0 - ISC
224 *
225 * This source code is licensed under the ISC license.
226 * See the LICENSE file in the root directory of this source tree.
227 */const ry=ft("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
228 * @license lucide-react v0.462.0 - ISC
229 *
230 * This source code is licensed under the ISC license.
231 * See the LICENSE file in the root directory of this source tree.
232 */const yD=ft("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
233 * @license lucide-react v0.462.0 - ISC
234 *
235 * This source code is licensed under the ISC license.
236 * See the LICENSE file in the root directory of this source tree.
237 */const Sf=ft("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
238 * @license lucide-react v0.462.0 - ISC
239 *
240 * This source code is licensed under the ISC license.
241 * See the LICENSE file in the root directory of this source tree.
242 */const Tf=ft("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
243 * @license lucide-react v0.462.0 - ISC
244 *
245 * This source code is licensed under the ISC license.
246 * See the LICENSE file in the root directory of this source tree.
247 */const Uh=ft("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/**
248 * @license lucide-react v0.462.0 - ISC
249 *
250 * This source code is licensed under the ISC license.
251 * See the LICENSE file in the root directory of this source tree.
252 */const lE=ft("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
253 * @license lucide-react v0.462.0 - ISC
254 *
255 * This source code is licensed under the ISC license.
256 * See the LICENSE file in the root directory of this source tree.
257 */const iy=ft("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
258 * @license lucide-react v0.462.0 - ISC
259 *
260 * This source code is licensed under the ISC license.
261 * See the LICENSE file in the root directory of this source tree.
262 */const N8=ft("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
263 * @license lucide-react v0.462.0 - ISC
264 *
265 * This source code is licensed under the ISC license.
266 * See the LICENSE file in the root directory of this source tree.
267 */const cE=ft("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
268 * @license lucide-react v0.462.0 - ISC
269 *
270 * This source code is licensed under the ISC license.
271 * See the LICENSE file in the root directory of this source tree.
272 */const O8=ft("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
273 * @license lucide-react v0.462.0 - ISC
274 *
275 * This source code is licensed under the ISC license.
276 * See the LICENSE file in the root directory of this source tree.
277 */const D8=ft("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
vendor: 5,610 bytes, lines 277-322
277y:"oel41y"}]]);/**
278 * @license lucide-react v0.462.0 - ISC
279 *
280 * This source code is licensed under the ISC license.
281 * See the LICENSE file in the root directory of this source tree.
282 */const Af=ft("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
283 * @license lucide-react v0.462.0 - ISC
284 *
285 * This source code is licensed under the ISC license.
286 * See the LICENSE file in the root directory of this source tree.
287 */const _D=ft("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
288 * @license lucide-react v0.462.0 - ISC
289 *
290 * This source code is licensed under the ISC license.
291 * See the LICENSE file in the root directory of this source tree.
292 */const ed=ft("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
293 * @license lucide-react v0.462.0 - ISC
294 *
295 * This source code is licensed under the ISC license.
296 * See the LICENSE file in the root directory of this source tree.
297 */const k8=ft("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/**
298 * @license lucide-react v0.462.0 - ISC
299 *
300 * This source code is licensed under the ISC license.
301 * See the LICENSE file in the root directory of this source tree.
302 */const Mu=ft("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
303 * @license lucide-react v0.462.0 - ISC
304 *
305 * This source code is licensed under the ISC license.
306 * See the LICENSE file in the root directory of this source tree.
307 */const L8=ft("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
308 * @license lucide-react v0.462.0 - ISC
309 *
310 * This source code is licensed under the ISC license.
311 * See the LICENSE file in the root directory of this source tree.
312 */const Gl=ft("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
313 * @license lucide-react v0.462.0 - ISC
314 *
315 * This source code is licensed under the ISC license.
316 * See the LICENSE file in the root directory of this source tree.
317 */const F8=ft("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]);/**
318 * @license lucide-react v0.462.0 - ISC
319 *
320 * This source code is licensed under the ISC license.
321 * See the LICENSE file in the root directory of this source tree.
322 */const xD=ft("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),U8=h8,bD=O.forwardRef(({className:t,...e},n)=>_.jsx(cD,{ref:n,className:Mt("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));bD.displayName=cD.displayName;const j8=ny("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),wD=O.forwardRef(({className:t,variant:e,...n},r)=>_.jsx(uD,{ref:r,className:Mt(j8({variant:e}),t),...n}));wD.displayName=uD.displayName;const B8=O.forwardRef(({className:t,...e},n)=>_.jsx(hD,{ref:n,className:Mt("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));B8.displayName=hD.displayName;const ED=O.forwardRef(({className:t,...e},n)=>_.jsx(pD,{ref:n,className:Mt("absolute right-2 top-2 rounded-md p-1 text-foreground
322/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:_.jsx(Gl,{className:"h-4 w-4"})}));ED.displayName=pD.displayName;const SD=O.forwardRef(({className:t,...e},n)=>_.jsx(dD,{ref:n,className:Mt("text-sm font-semibold",t),...e}));SD.displayName=dD.displayName;const TD=O.forwardRef(({className:t,...e},n)=>_.jsx(fD,{ref:n,className:Mt("text-sm opacity-90",t),...e}));TD.displayName=fD.displayName;function V8(){const{toasts:t}=q9();return _.jsxs(U8,{children:[t.map(function({id:e,title:n,description:r,action:i,...s}){return _.jsxs(wD,{...s,children:[_.jsxs("div",{className:"grid gap-1",children:[n&&_.jsx(SD,{children:n}),r&&_.jsx(TD,{children:r})]}),i,_.jsx(ED,{})]},e)}),_.jsx(bD,{})]})}var mM=["light","dark"],z8="(prefers-color-scheme: dark)",H8=O.createContext(void 0),G8={setTheme:t=>{},themes:[]},$8=()=>{var t;return(t=O.useContext(H8))!=null?t:G8};O.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:o,attrs:a,nonce:l})=>{let c=s==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=i?mM.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",u=(g,v=!1,m=!0)=>{let p=o?o[g]:g,y=v?g+"|| ''":`'${p}'`,w="";return i&&m&&!v&&mM.includes(g)&&(w+=`d.style.colorScheme = '${g}';`),n==="class"?v||p?w+=`c.add(${y})`:w+="null":p&&(w+=`d[s](n,${y})`),w},h=t?`!function(){${d}${u(t)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${c})){var t='${z8}',m=window.matchMedia(t);if(m.media!==t||m.matches){${u("dark")}}else{${u("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${u(o?"x[e]":"e",!0)}}${c?"":"else{"+u(s,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${u(o?"x[e]":"e",!0)}}else{${u(s,!1,!1)};}${f}}catch(t){}}();`;return O.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:h}})});var W8=t=>{switch(t){case"success":return X8;case"info":return Q8;case"warning":return Y8;case"error":return Z8;default:return null}},q8=Array(12).fill(0),K8=({visible:t})=>De.createElement("div",{className:"sonner-loading-wrapper","data-visible":t},De.createElement("div",{className:"sonner-spinner"},q8.map((e,n)=>De.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),X8=De.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},De.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Y8=De.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},De.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Q8=De.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},De.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Z8=De.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},De.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),J8=()=>{let[t,e]=De.useState(document.hidden);return De.useEffect(()=>{let n=()=>{e(document.hidden)};
322return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},ub=1,eH=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;let{message:r,...i}=e,s=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:ub++,o=this.toasts.find(l=>l.id===s),a=e.dismissible===void 0?!0:e.dismissible;return o?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:r}),{...l,...e,id:s,dismissible:a,title:r}):l):this.addToast({title:r,...i,dismissible:a,id:s}),s},this.dismiss=e=>(e||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:e,dismiss:!0})),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let i=e instanceof Promise?e:e(),s=r!==void 0;return i.then(async o=>{if(nH(o)&&!o.ok){s=!1;let a=typeof n.error=="function"?await n.error(`HTTP error! status: ${o.status}`):n.error,l=typeof n.description=="function"?await n.description(`HTTP error! status: ${o.status}`):n.description;this.create({id:r,type:"error",message:a,description:l})}else if(n.success!==void 0){s=!1;let a=typeof n.success=="function"?await n.success(o):n.success,l=typeof n.description=="function"?await n.description(o):n.description;this.create({id:r,type:"success",message:a,description:l})}}).catch(async o=>{if(n.error!==void 0){s=!1;let a=typeof n.error=="function"?await n.error(o):n.error,l=typeof n.description=="function"?await n.description(o):n.description;this.create({id:r,type:"error",message:a,description:l})}}).finally(()=>{var o;s&&(this.dismiss(r),r=void 0),(o=n.finally)==null||o.call(n)}),r},this.custom=(e,n)=>{let r=(n==null?void 0:n.id)||ub++;return this.create({jsx:e(r),id:r,...n}),r},this.subscribers=[],this.toasts=[]}},ni=new eH,tH=(t,e)=>{let n=(e==null?void 0:e.id)||ub++;return ni.addToast({title:t,...e,id:n}),n},nH=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",rH=tH,iH=()=>ni.toasts;Object.assign(rH,{success:ni.success,info:ni.info,warning:ni.warning,error:ni.error,custom:ni.custom,message:ni.message,promise:ni.promise,dismiss:ni.dismiss,loading:ni.loading},{getHistory:iH});function sH(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}sH(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-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;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
322left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
322:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
323`);function jp(t){return t.label!==void 0}var oH=3,aH="32px",lH=4e3,cH=356,uH=14,dH=20,fH=200;function hH(...t){return t.filter(Boolean).join(" ")}var pH=t=>{var e,n,r,i,s,o,a,l,c,d;let{invert:f,toast:u,unstyled:h,interacting:g,setHeights:v,visibleToasts:m,heights:p,index:y,toasts:w,expanded:x,removeToast:S,defaultRichColors:I,closeButton:M,style:E,cancelButtonStyle:C,actionButtonStyle:T,className:A="",descriptionClassName:R="",duration:P,position:D,gap:F,loadingIcon:V,expandByDefault:H,classNames:$,icons:B,closeButtonAriaLabel:G="Close toast",pauseWhenPageIsHidden:k,cn:z}=t,[q,ne]=De.useState(!1),[ee,j]=De.useState(!1),[Q,Z]=De.useState(!1),[re,se]=De.useState(!1),[ye,Ue]=De.useState(0),[Ie,je]=De.useState(0),Ke=De.useRef(null),Xe=De.useRef(null),dt=y===0,K=y+1<=m,de=u.type,_e=u.dismissible!==!1,Ae=u.className||"",ce=u.descriptionClassName||"",X=De.useMemo(()=>p.findIndex(Ne=>Ne.toastId===u.id)||0,[p,u.id]),U=De.useMemo(()=>{var Ne;return(Ne=u.closeButton)!=null?Ne:M},[u.closeButton,M]),J=De.useMemo(()=>u.duration||P||lH,[u.duration,P]),he=De.useRef(0),me=De.useRef(0),fe=De.useRef(0),Ve=De.useRef(null),[Ee,qe]=D.split("-"),st=De.useMemo(()=>p.reduce((Ne,te,xe)=>xe>=X?Ne:Ne+te.height,0),[p,X]),Ce=J8(),Pe=u.invert||f,Ge=de==="loading";me.current=De.useMemo(()=>X*F+st,[X,st]),De.useEffect(()=>{ne(!0)},[]),De.useLayoutEffect(()=>{if(!q)return;let Ne=Xe.current,te=Ne.style.height;Ne.style.height="auto";let xe=Ne.getBoundingClientRect().height;Ne.style.height=te,je(xe),v(Se=>
323Se.find(ke=>ke.toastId===u.id)?Se.map(ke=>ke.toastId===u.id?{...ke,height:xe}:ke):[{toastId:u.id,height:xe,position:u.position},...Se])},[q,u.title,u.description,v,u.id]);let He=De.useCallback(()=>{j(!0),Ue(me.current),v(Ne=>Ne.filter(te=>te.toastId!==u.id)),setTimeout(()=>{S(u)},fH)},[u,S,v,me]);De.useEffect(()=>{if(u.promise&&de==="loading"||u.duration===1/0||u.type==="loading")return;let Ne,te=J;return x||g||k&&Ce?(()=>{if(fe.current<he.current){let xe=new Date().getTime()-he.current;te=te-xe}fe.current=new Date().getTime()})():te!==1/0&&(he.current=new Date().getTime(),Ne=setTimeout(()=>{var xe;(xe=u.onAutoClose)==null||xe.call(u,u),He()},te)),()=>clearTimeout(Ne)},[x,g,H,u,J,He,u.promise,de,k,Ce]),De.useEffect(()=>{let Ne=Xe.current;if(Ne){let te=Ne.getBoundingClientRect().height;return je(te),v(xe=>[{toastId:u.id,height:te,position:u.position},...xe]),()=>v(xe=>xe.filter(Se=>Se.toastId!==u.id))}},[v,u.id]),De.useEffect(()=>{u.delete&&He()},[He,u.delete]);function ze(){return B!=null&&B.loading?De.createElement("div",{className:"sonner-loader","data-visible":de==="loading"},B.loading):V?De.createElement("div",{className:"sonner-loader","data-visible":de==="loading"},V):De.createElement(K8,{visible:de==="loading"})}return De.createElement("li",{"aria-live":u.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Xe,className:z(A,Ae,$==null?void 0:$.toast,(e=u==null?void 0:u.classNames)==null?void 0:e.toast,$==null?void 0:$.default,$==null?void 0:$[de],(n=u==null?void 0:u.classNames)==null?void 0:n[de]),"data-sonner-toast":"","data-rich-colors":(r=u.richColors)!=null?r:I,"data-styled":!(u.jsx||u.unstyled||h),"data-mounted":q,"data-promise":!!u.promise,"data-removed":ee,"data-visible":K,"data-y-position":Ee,"data-x-position":qe,"data-index":y,"data-front":dt,"data-swiping":Q,"data-dismissible":_e,"data-type":de,"data-invert":Pe,"data-swipe-out":re,"data-expanded":!!(x||H&&q),style:{"--index":y,"--toasts-before":y,"--z-index":w.length-y,"--offset":`${ee?ye:me.current}px`,"--initial-height":H?"auto":`${Ie}px`,...E,...u.style},onPointerDown:Ne=>{Ge||!_e||(Ke.current=new Date,Ue(me.current),Ne.target.setPointerCapture(Ne.pointerId),Ne.target.tagName!=="BUTTON"&&(Z(!0),Ve.current={x:Ne.clientX,y:Ne.clientY}))},onPointerUp:()=>{var Ne,te,xe,Se;if(re||!_e)return;Ve.current=null;let ke=Number(((Ne=Xe.current)==null?void 0:Ne.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Me=new Date().getTime()-((te=Ke.current)==null?void 0:te.getTime()),ge=Math.abs(ke)/Me;if(Math.abs(ke)>=dH||ge>.11){Ue(me.current),(xe=u.onDismiss)==null||xe.call(u,u),He(),se(!0);return}(Se=Xe.current)==null||Se.style.setProperty("--swipe-amount","0px"),Z(!1)},onPointerMove:Ne=>{var te;if(!Ve.current||!_e)return;let xe=Ne.clientY-Ve.current.y,Se=Ne.clientX-Ve.current.x,ke=(Ee==="top"?Math.min:Math.max)(0,xe),Me=Ne.pointerType==="touch"?10:2;Math.abs(ke)>Me?(te=Xe.current)==null||te.style.setProperty("--swipe-amount",`${xe}px`):Math.abs(Se)>Me&&(Ve.current=null)}},U&&!u.jsx?De.createElement("button",{"aria-label":G,"data-disabled":Ge,"data-close-button":!0,onClick:Ge||!_e?()=>{}:()=>{var Ne;He(),(Ne=u.onDismiss)==null||Ne.call(u,u)},className:z($==null?void 0:$.closeButton,(i=u==null?void 0:u.classNames)==null?void 0:i.closeButton)},De.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},De.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),De.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,u.jsx||De.isValidElement(u.title)?u.jsx||u.title:De.createElement(De.Fragment,null,de||u.icon||u.promise?De.createElement("div",{"data-icon":"",className:z($==null?void 0:$.icon,(s=u==null?void 0:u.classNames)==null?void 0:s.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||ze():null,u.type!=="loading"?u.icon||(B==null?void 0:B[de])||W8(de):null):null,De.createElement("div",{"data-content":"",className:z($==null?void 0:$.content,(o=u==null?void 0:u.classNames)==null?void 0:o.content)},De.createElement("div",{"data-title":"",className:z($==null?void 0:$.t
323itle,(a=u==null?void 0:u.classNames)==null?void 0:a.title)},u.title),u.description?De.createElement("div",{"data-description":"",className:z(R,ce,$==null?void 0:$.description,(l=u==null?void 0:u.classNames)==null?void 0:l.description)},u.description):null),De.isValidElement(u.cancel)?u.cancel:u.cancel&&jp(u.cancel)?De.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||C,onClick:Ne=>{var te,xe;jp(u.cancel)&&_e&&((xe=(te=u.cancel).onClick)==null||xe.call(te,Ne),He())},className:z($==null?void 0:$.cancelButton,(c=u==null?void 0:u.classNames)==null?void 0:c.cancelButton)},u.cancel.label):null,De.isValidElement(u.action)?u.action:u.action&&jp(u.action)?De.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||T,onClick:Ne=>{var te,xe;jp(u.action)&&(Ne.defaultPrevented||((xe=(te=u.action).onClick)==null||xe.call(te,Ne),He()))},className:z($==null?void 0:$.actionButton,(d=u==null?void 0:u.classNames)==null?void 0:d.actionButton)},u.action.label):null))};function gM(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}var mH=t=>{let{invert:e,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:i,closeButton:s,className:o,offset:a,theme:l="light",richColors:c,duration:d,style:f,visibleToasts:u=oH,toastOptions:h,dir:g=gM(),gap:v=uH,loadingIcon:m,icons:p,containerAriaLabel:y="Notifications",pauseWhenPageIsHidden:w,cn:x=hH}=t,[S,I]=De.useState([]),M=De.useMemo(()=>Array.from(new Set([n].concat(S.filter(k=>k.position).map(k=>k.position)))),[S,n]),[E,C]=De.useState([]),[T,A]=De.useState(!1),[R,P]=De.useState(!1),[D,F]=De.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=De.useRef(null),H=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=De.useRef(null),B=De.useRef(!1),G=De.useCallback(k=>{var z;(z=S.find(q=>q.id===k.id))!=null&&z.delete||ni.dismiss(k.id),I(q=>q.filter(({id:ne})=>ne!==k.id))},[S]);return De.useEffect(()=>ni.subscribe(k=>{if(k.dismiss){I(z=>z.map(q=>q.id===k.id?{...q,delete:!0}:q));return}setTimeout(()=>{WN.flushSync(()=>{I(z=>{let q=z.findIndex(ne=>ne.id===k.id);return q!==-1?[...z.slice(0,q),{...z[q],...k},...z.slice(q+1)]:[k,...z]})})})}),[]),De.useEffect(()=>{if(l!=="system"){F(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:k})=>{F(k?"dark":"light")})},[l]),De.useEffect(()=>{S.length<=1&&A(!1)},[S]),De.useEffect(()=>{let k=z=>{var q,ne;r.every(ee=>z[ee]||z.code===ee)&&(A(!0),(q=V.current)==null||q.focus()),z.code==="Escape"&&(document.activeElement===V.current||(ne=V.current)!=null&&ne.contains(document.activeElement))&&A(!1)};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[r]),De.useEffect(()=>{if(V.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,B.current=!1)}},[V.current]),S.length?De.createElement("section",{"aria-label":`${y} ${H}`,tabIndex:-1},M.map((k,z)=>{var q;let[ne,ee]=k.split("-");return De.createElement("ol",{key:k,dir:g==="auto"?gM():g,tabIndex:-1,ref:V,className:o,"data-sonner-toaster":!0,"data-theme":D,"data-y-position":ne,"data-x-position":ee,style:{"--front-toast-height":`${((q=E[0])==null?void 0:q.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||aH,"--width":`${cH}px`,"--gap":`${v}px`,...f},onBlur:j=>{B.current&&!j.currentTarget.contains(j.relatedTarget)&&(B.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:j=>{j.target instanceof HTMLElement&&j.target.dataset.dismissible==="false"||B.current||(B.current=!0,$.current=j.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{R||A(!1)},onPointerDown:j=>{j.target instanceof HTMLElement&&j.target.dataset.dismissible==="false"||P(!0)},onPointerUp:()=>P(!1)},S.filter(j=>!j.position&&z===0||j.position===k).map((j,Q)=>{var Z,re;return De.createElement(pH,{key:j.id,icons:p,index:Q,toast:j,defaultRichColors:c,duration:(Z=h==null?void 0:h.duration)!=null?Z:d,className:h==null?void 0:h.className,descriptionClassName:h==null?void 0:h.descriptionClassName,invert:e,visibleToasts:u,closeButton:(re=h==null?void 0:h.closeButton)!=null?re:s,interacting:R,position:k,style:h==null?void 0:h.style,unstyled:h==null?void 0:h.unstyled,classNames:h==null?void 0:h.classNames,cancelButtonStyle:h==null?void 0:h.cancelButtonStyle,actionButtonStyle:h==null?void 0:h.actionButtonStyle,removeToast:G,toasts:S.filter(se=>se.position==j.position),heights:E.filter(se=>se.position==j.position),setHeights:C,expandByDefault:i,gap:v,loadingIcon:m,expanded:T,pauseWhenPageIsHidden:w,cn:x})}))})):null};const gH=({...t})=>{const{theme:e="system"}=$8();return _.jsx(mH,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};var zg={},vH=()=>{window.va||(window.va=function(...e){window.vaq||(window.vaq=[]),window.vaq.push(e)})},yH="@vercel/analytics",_H="2.0.1";function AD(){return typeof window<"u"}function MD(){try{const t="production"}catch{}return"production"}function xH(t="auto"){if(t==="auto"){window.vam=MD();return}window.vam=t}function bH(){return(AD()?window.vam:MD())||"production"}function uE(){return bH()==="development"}function wH(t){return t.scriptSrc?zc(t.scriptSrc):uE()?"https://va.vercel-scripts.com/v1/script.debug.js":t.basePath?zc(`${t.basePath}
323/insights/script.js`):"/_vercel/insights/script.js"}function EH(t,e){var n;let r=t;if(e)try{r={...(n=JSON.parse(e))==null?void 0:n.analytics,...t}}catch{}xH(r.mode);const i={sdkn:yH+(r.framework?`/${r.framework}`:""),sdkv:_H};return r.disableAutoTrack&&(i.disableAutoTrack="1"),r.viewEndpoint&&(i.viewEndpoint=zc(r.viewEndpoint)),r.eventEndpoint&&(i.eventEndpoint=zc(r.eventEndpoint)),r.sessionEndpoint&&(i.sessionEndpoint=zc(r.sessionEndpoint)),uE()&&r.debug===!1&&(i.debug="false"),r.dsn&&(i.dsn=r.dsn),r.endpoint?i.endpoint=r.endpoint:r.basePath&&(i.endpoint=zc(`${r.basePath}/insights`)),{beforeSend:r.beforeSend,src:wH(r),dataset:i}}function zc(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")?t:`/${t}`}function SH(t={debug:!0},e){var n;if(!AD())return;const{beforeSend:r,src:i,dataset:s}=EH(t,e);if(vH(),r&&((n=window.va)==null||n.call(window,"beforeSend",r)),document.head.querySelector(`script[src*="${i}"]`))return;const o=document.createElement("script");o.src=i;for(const[a,l]of Object.entries(s))o.dataset[a]=l;o.defer=!0,o.onerror=()=>{const a=uE()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${i}. ${a}`)},document.head.appendChild(o)}function TH({route:t,path:e}){var n;(n=window.va)==null||n.call(window,"pageview",{route:t,path:e})}function AH(){if(!(typeof process>"u"||typeof zg>"u"))return zg.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function MH(){if(!(typeof process>"u"||typeof zg>"u"))return zg.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function CH(t){return O.useEffect(()=>{var e;t.beforeSend&&((e=window.va)==null||e.call(window,"beforeSend",t.beforeSend))},[t.beforeSend]),O.useEffect(()=>{SH({framework:t.framework||"react",basePath:t.basePath??AH(),...t.route!==void 0&&{disableAutoTrack:!0},...t},t.configString??MH())},[]),O.useEffect(()=>{t.route&&t.path&&TH({route:t.route,path:t.path})},[t.route,t.path]),null}const CD=O.createContext(void 0),RD=()=>{const t=O.useContext(CD);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t},RH=({children:t})=>{const[e,n]=O.useState(()=>localStorage.getItem("phimec-theme")||"system"),[r,i]=O.useState("light");return O.useEffect(()=>{const s=window.document.documentElement,o=()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",a=()=>{const l=e==="system"?o():e;i(l),s.classList.remove("light","dark"),s.classList.add(l)};if(a(),localStorage.setItem("phimec-theme",e),e==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)");return l.addEventListener("change",a),()=>l.removeEventListener("change",a)}},[e]),_.jsx(CD.Provider,{value:{theme:e,setTheme:n,actualTheme:r},children:t})},PH=(t,e,n,r)=>{var s,o,a,l;const i=[n,{code:e,...r||{}}];if((o=(s=t==null?void 0:t.services)==null?void 0:s.logger)!=null&&o.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);Ml(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(l=(a=t==null?void 0:t.services)==null?void 0:a.logger)!=null&&l.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},vM={},db=(t,e,n,r)=>{Ml(n)&&vM[n]||(Ml(n)&&(vM[n]=new Date),PH(t,e,n,r))},PD=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},fb=(t,e,n)=>{t.loadNamespaces(e,PD(t,n))},yM=(t,e,n,r)=>{if(Ml(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return fb(t,n,r);n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,PD(t,r))},IH=(t,e,n={})=>!e.languages||!e.languages.length?(db(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,i)=>{var s;if(((s=n.bindI18n)==null?void 0:s.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,t))return!1}}),Ml=t=>typeof t=="string",NH=t=>typeof t=="object"&&t!==null,OH=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,DH={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},kH=t=>DH[t],LH=t=>t.replace(OH,kH);let hb={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:LH};const FH=(t={})=>{hb={...hb,...t}},UH=()=>hb;let ID;const jH=t=>{ID=t},BH=()=>ID,VH={type:"3rdParty",init(t){FH(t.options.react),jH(t)}},zH=O.createContext();class HH{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const GH=(t,e)=>{const n=O.useRef();return O.useEffect(()=>{n.current=t},[t,e]),n.current},ND=(t,e,n,r)=>t.getFixedT(e,n,r),$H=(t,e,n,r)=>O.useCallback(ND(t,e,n,r),[t,e,n,r]),OD=(t,e={})=>{var x,S,I,M;const{i18n:n}=e,{i18n:r,defaultNS:i}=O.useContext(zH)||{},s=n||r||BH();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new HH),!s){db(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const E=(T,A)=>Ml(A)?A:NH(A)&&Ml(A.defaultValue)?A.defaultValue:Array.isArray(T)?T[T.length-1]:T,C=[E,{},!1];return C.t=E,C.i18n={},C.ready=!1,C}(x=s.options.react)!=null&&x.wait&&db(s,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...UH(),...s.options.react,...e},{useSuspense:a,keyPrefix:l}=o;let c=i||((S=s.options)==null?void 0:S.defaultNS);c=Ml(c)?[c]:c||["translation"],(M=(I=s.reportNamespaces).addUsedNamespaces)==null||M.call(I,c);const d=(s.isInitialized||s.initializedStoreOnce)&&c.every(E=>
vendor: 7,195 bytes, line 323
323IH(E,s,o)),f=$H(s,e.lng||null,o.nsMode==="fallback"?c:c[0],l),u=()=>f,h=()=>ND(s,e.lng||null,o.nsMode==="fallback"?c:c[0],l),[g,v]=O.useState(u);let m=c.join();e.lng&&(m=`${e.lng}${m}`);const p=GH(m),y=O.useRef(!0);O.useEffect(()=>{const{bindI18n:E,bindI18nStore:C}=o;y.current=!0,!d&&!a&&(e.lng?yM(s,e.lng,c,()=>{y.current&&v(h)}):fb(s,c,()=>{y.current&&v(h)})),d&&p&&p!==m&&y.current&&v(h);const T=()=>{y.current&&v(h)};return E&&(s==null||s.on(E,T)),C&&(s==null||s.store.on(C,T)),()=>{y.current=!1,s&&(E==null||E.split(" ").forEach(A=>s.off(A,T))),C&&s&&C.split(" ").forEach(A=>s.store.off(A,T))}},[s,m]),O.useEffect(()=>{y.current&&d&&v(u)},[s,l,d]);const w=[g,s,d];if(w.t=g,w.i18n=s,w.ready=d,d||!d&&!a)return w;throw new Promise(E=>{e.lng?yM(s,e.lng,c,()=>E()):fb(s,c,()=>E())})},pt=t=>typeof t=="string",Ud=()=>{let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n},_M=t=>t==null?"":""+t,WH=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},qH=/###/g,xM=t=>t&&t.indexOf("###")>-1?t.replace(qH,"."):t,bM=t=>!t||pt(t),Mf=(t,e,n)=>{const r=pt(e)?e.split("."):e;let i=0;for(;i<r.length-1;){if(bM(t))return{};const s=xM(r[i]);!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={},++i}return bM(t)?{}:{obj:t,k:xM(r[i])}},wM=(t,e,n)=>{const{obj:r,k:i}=Mf(t,e,Object);if(r!==void 0||e.length===1){r[i]=n;return}let s=e[e.length-1],o=e.slice(0,e.length-1),a=Mf(t,o,Object);for(;a.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),a=Mf(t,o,Object),a!=null&&a.obj&&typeof a.obj[`${a.k}.${s}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${s}`]=n},KH=(t,e,n,r)=>{const{obj:i,k:s}=Mf(t,e,Object);i[s]=i[s]||[],i[s].push(n)},Hg=(t,e)=>{const{obj:n,k:r}=Mf(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},XH=(t,e,n)=>{const r=Hg(t,n);return r!==void 0?r:Hg(e,n)},DD=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?pt(t[r])||t[r]instanceof String||pt(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):DD(t[r],e[r],n):t[r]=e[r]);return t},oc=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var YH={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const QH=t=>pt(t)?t.replace(/[&<>"'\/]/g,e=>YH[e]):t;class ZH{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 r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const JH=[" ",",","?","!",";"],e7=new ZH(20),t7=(t,e,n)=>{e=e||"",n=n||"";const r=JH.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const i=e7.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!i.test(t);if(!s){const o=t.indexOf(n);o>0&&!i.test(t.substring(0,o))&&(s=!0)}return s},pb=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(n);let i=t;for(let s=0;s<r.length;){if(!i||typeof i!="object")return;let o,a="";for(let l=s;l<r.length;++l)if(l!==s&&(a+=n),a+=r[l],o=i[a],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&l<r.length-1)continue;s+=l-s+1;break}i=o}return i},lh=t=>t==null?void 0:t.replace("_","-"),n7={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,r;(r=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||r.call(n,console,e)}};let r7=class mb{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||n7,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,i){return i&&!this.debug?null:(pt(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new mb(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new mb(this.logger,e)}};var xs=new r7;class sy{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,s])=>{for(let o=0;o<s;o++)i(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,s])=>{for(let o=0;o<s;o++)i.apply(i,[e,...n])})}}class EM extends sy{constructor(e,n={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,r,i={}){var c,d;const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,n],r&&(Array.isArray(r)?a.push(...r):pt(r)&&s?a.push(...r.split(s)):a.push(r)));const l=Hg(this.data,a);return!l&&!n&&!r&&e.indexOf(".")>-1&&(e=a[0],n=a[1],r=a.slice(2).join(".")),l||!o||!pt(r)?l:pb((d=(c=this.data)==null?void 0:c[e])==null?void 0:d[n],r,s)}addResource(e,n,r,i,s={silent:!1}){const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let a=[e,n];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(a=e.split("."),i=n,n=a[1]),this.addNamespaces(n),wM(this.data,a,i),s.silent||this.emit("added",e,n,r,i)}addResources(e,n,r,i={silent:!1}){for(const s in r)(pt(r[s])||Array.isArray(r[s]))&&this.addResource(e,n,s,r[s],{silent:!0});i.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,i,s,o={silent:!1,skipCopy:!1}){let a=[e,n];e.indexOf(".")>-1&&(a=e.split("."),i=r,r=n,n=a[1]),this.addNamespaces(n);let l=Hg(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?DD(l,r,s):l={...l,...r},wM(this.data,a,l),o.silent||this.emit("added",e,n,r)}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.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var kD={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,i){return t.forEach(s=>{var o;e=((o=this.processors[s])==null?void 0:o.process(e,n,r,i))??e}),e}};const SM={},TM=t=>!pt(t)&&typeof t!="boolean"&&typeof t!="number";class Gg extends sy{constructor(e,n={}){super(),WH(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
323i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=xs.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const r={...n};if(e==null)return!1;const i=this.resolve(e,r);return(i==null?void 0:i.res)!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!t7(e,r,i);if(o&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:pt(s)?[s]:s};const c=e.split(r);(r!==i||r===i&&this.options.ns.indexOf(c[0])>-1)&&(s=c.shift()),e=c.join(i)}return{key:e,namespaces:pt(s)?[s]:s}}translate(e,n,r){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(i={...i}),i||(i={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const s=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:a,namespaces:l}=this.extractFromKey(e[e.length-1],i),c=l[l.length-1];let d=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=i.lng||this.language,u=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return u?s?{res:`${c}${d}${a}`,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(i)}:`${c}${d}${a}`:s?{res:a,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(i)}:a;const h=this.resolve(e,i);let g=h==null?void 0:h.res;const v=(h==null?void 0:h.usedKey)||a,m=(h==null?void 0:h.exactUsedKey)||a,p=["[object Number]","[object Function]","[object RegExp]"],y=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,x=i.count!==void 0&&!pt(i.count),S=Gg.hasDefaultValue(i),I=x?this.pluralResolver.getSuffix(f,i.count,i):"",M=i.ordinal&&x?this.pluralResolver.getSuffix(f,i.count,{ordinal:!1}):"",E=x&&!i.ordinal&&i.count===0,C=E&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${I}`]||i[`defaultValue${M}`]||i.defaultValue;let T=g;w&&!g&&S&&(T=C);const A=TM(T),R=Object.prototype.toString.apply(T);if(w&&T&&A&&p.indexOf(R)<0&&!(pt(y)&&Array.isArray(T))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const P=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,T,{...i,ns:l}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(h.res=P,h.usedParams=this.getUsedParamsDetails(i),h):P}if(o){const P=Array.isArray(T),D=P?[]:{},F=P?m:v;for(const V in T)if(Object.prototype.hasOwnProperty.call(T,V)){const H=`${F}${o}${V}`;S&&!g?D[V]=this.translate(H,{...i,defaultValue:TM(C)?C[V]:void 0,joinArrays:!1,ns:l}):D[V]=this.translate(H,{...i,joinArrays:!1,ns:l}),D[V]===H&&(D[V]=T[V])}g=D}}else if(w&&pt(y)&&Array.isArray(g))g=g.join(y),g&&(g=this.extendTranslation(g,e,i,r));else{let P=!1,D=!1;!this.isValidLookup(g)&&S&&(P=!0,g=C),this.isValidLookup(g)||(D=!0,g=a);const V=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&D?void 0:g,H=S&&C!==g&&this.options.updateMissing;if(D||P||H){if(this.logger.log(H?"updateKey":"missingKey",f,c,a,H?C:g),o){const k=this.resolve(a,{...i,keySeparator:!1});k&&k.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 $=[];const B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&B&&B[0])for(let k=0;k<B.length;k++)$.push(B[k]);else this.options.saveMissingTo==="all"?$=this.languageUtils.toResolveHierarchy(i.lng||this.language):$.push(i.lng||this.language);const G=(k,z,q)=>{var ee;const ne=S&&q!==g?q:V;this.options.missingKeyHandler?this.options.missingKeyHandler(k,c,z,ne,H,i):(ee=this.backendConnector)!=null&&ee.saveMissing&&this.backendConnector.saveMissing(k,c,z,ne,H,i),this.emit
vendor: 31,558 bytes, line 323
323("missingKey",k,c,z,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?$.forEach(k=>{const z=this.pluralResolver.getSuffixes(k,i);E&&i[`defaultValue${this.options.pluralSeparator}zero`]&&z.indexOf(`${this.options.pluralSeparator}zero`)<0&&z.push(`${this.options.pluralSeparator}zero`),z.forEach(q=>{G([k],a+q,i[`defaultValue${q}`]||C)})}):G($,a,C))}g=this.extendTranslation(g,e,i,h,r),D&&g===a&&this.options.appendNamespaceToMissingKey&&(g=`${c}${d}${a}`),(D||P)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${d}${a}`:a,P?g:void 0,i))}return s?(h.res=g,h.usedParams=this.getUsedParamsDetails(i),h):g}extendTranslation(e,n,r,i,s){var l,c;if((l=this.i18nFormat)!=null&&l.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const d=pt(e)&&(((c=r==null?void 0:r.interpolation)==null?void 0:c.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const h=e.match(this.interpolator.nestingRegexp);f=h&&h.length}let u=r.replace&&!pt(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,r.lng||this.language||i.usedLng,r),d){const h=e.match(this.interpolator.nestingRegexp),g=h&&h.length;f<g&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,(...h)=>(s==null?void 0:s[0])===h[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${n[0]}`),null):this.translate(...h,n),r)),r.interpolation&&this.interpolator.reset()}const o=r.postProcess||this.options.postProcess,a=pt(o)?[o]:o;return e!=null&&(a!=null&&a.length)&&r.applyPostProcessor!==!1&&(e=kD.handle(a,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,n={}){let r,i,s,o,a;return pt(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),d=c.key;i=d;let f=c.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const u=n.count!==void 0&&!pt(n.count),h=u&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(pt(n.context)||typeof n.context=="number")&&n.context!=="",v=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(m=>{var p,y;this.isValidLookup(r)||(a=m,!SM[`${v[0]}-${m}`]&&((p=this.utils)!=null&&p.hasLoadedNamespace)&&!((y=this.utils)!=null&&y.hasLoadedNamespace(a))&&(SM[`${v[0]}-${m}`]=!0,this.logger.warn(`key "${i}" for languages "${v.join(", ")}" won't get resolved as namespace "${a}" 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!!!")),v.forEach(w=>{var I;if(this.isValidLookup(r))return;o=w;const x=[d];if((I=this.i18nFormat)!=null&&I.addLookupKeys)this.i18nFormat.addLookupKeys(x,d,w,m,n);else{let M;u&&(M=this.pluralResolver.getSuffix(w,n.count,n));const E=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(x.push(d+M),n.ordinal&&M.indexOf(C)===0&&x.push(d+M.replace(C,this.options.pluralSeparator)),h&&x.push(d+E)),g){const T=`${d}${this.options.contextSeparator}${n.context}`;x.push(T),u&&(x.push(T+M),n.ordinal&&M.indexOf(C)===0&&x.push(T+M.replace(C,this.options.pluralSeparator)),h&&x.push(T+E))}}let S;for(;S=x.pop();)this.isValidLookup(r)||(s=S,r=this.getResource(w,m,S,n))}))})}),{res:r,usedKey:i,exactUsedKey:s,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r,i={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(e,n,r,i):this.resourceStore.getResource(e,n,r,i)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!pt(e.replace);let i=r?e.replace:e;if(r&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const s of n)delete i[s]}return i}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class AM{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=xs.create("languageUtils")}getScriptPartFromCode(e){if(e=lh(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=lh(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(pt(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}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(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return n=i;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>{if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&(o.indexOf("-")>0&&s.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===s||o.indexOf(s)===0&&s.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),pt(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),i=[],s=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return pt(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):pt(e)&&s(this.formatLanguageCode(e)),r.forEach(o=>{i.indexOf(o)<0&&s(this.formatLanguageCode(o))}),i}}const MM={zero:0,one:1,two:2,few:3,many:4,other:5},CM={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class i7{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=xs.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const r=lh(e==="dev"?"en":e),i=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:r,type:i});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),CM;if(!e.match(/-|_/))return CM;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,n)}return this.pluralRulesCache[s]=o,o}needsPlural(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n,r={}){return this.getSuffixes(e,r).map(i=>`${n}${i}`)}getSuffixes(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,s)=>MM[i]-MM[s]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,n,r={}){const i=this.getRule(e,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const RM=(t,e,n,r=".",i=!0)=>{let s=XH(t,e,n);return!s&&i&&pt(n)&&(s=pb(t,n,r),s===void 0&&(s=pb(e,n,r))),s},V_=t=>t.replace(/\$/g,"$$$$");class s7{constructor(e={}){var n;this.logger=xs.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(r=>r),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:s,prefixEscaped:o,suffix:a,suffixEscaped:l,formatSeparator:c,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:u,nestingPrefixEscaped:h,nestingSuffix:g,nestingSuffixEscaped:v,nestingOptionsSeparator:m,maxReplaces:p,alwaysFormat:y}=e.interpolation;this.escape=n!==void 0?n:QH,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=s?oc(s):o||"{{",this.suffix=a?oc(a):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=u?oc(u):h||oc("$t("),this.nestingSuffix=g?oc(g):v||oc(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=p||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"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,r,i){var h;let s,o,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=g=>{if(g.indexOf(this.formatSeparator)<0){const y=RM(n,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,r,{...i,...n,interpolationkey:g}):y}const v=g.split(this.formatSeparator),m=v.shift().trim(),p=v.join(this.formatSeparator).trim();return this.format(RM(n,l,m,this.options.keySeparator,this.options.ignoreJSONStructure),p,r,{...i,...n,interpolationkey:m})};this.resetRegExp();const d=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((h=i==null?void 0:i.interpolation)==null?void 0:h.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>V_(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?V_(this.escape(g)):V_(g)}].forEach(g=>{for(a=0;s=g.regex.exec(e);){const v=s[1].trim();if(o=c(v),o===void 0)if(typeof d=="function"){const p=d(e,s,i);o=pt(p)?p:""}else if(i&&Object.prototype.hasOwnProperty.call(i,v))o="";else if(f){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${e}`),o="";else!pt(o)&&!this.useRawValueToEscape&&(o=_M(o));const m=g.safeValue(o);if(e=e.replace(s[0],m),f?(g.regex.lastIndex+=o.length,g.regex.lastIndex-=s[0].length):g.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,n,r={}){let i,s,o;const a=(l,c)=>{const d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;const f=l.split(new RegExp(`${d}[ ]*{`));let u=`{${f[1]}`;l=f[0],u=this.interpolate(u,o);const h=u.match(/'/g),g=u.match(/"/g);(((h==null?void 0:h.length)??0)%2===0&&!g||g.length%2!==0)&&(u=u.replace(/'/g,'"'));try{o=JSON.parse(u),c&&(o={...c,...o})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,v),`${l}${d}${u}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];o={...r},o=o.replace&&!pt(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(f=>f.trim());i[1]=d.shift(),l=d,c=!0}if(s=n(a.call(this,i[1].trim(),o),o),s&&i[0]===e&&!pt(s))return s;pt(s)||(s=_M(s)),s||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),s=""),c&&(s=l.reduce((d,f)=>this.format(d,f,r.lng,{...r,interpolationkey:i[1].trim()}),s.trim())),e=e.replace(i[0],s),this.regexp.lastIndex=0}return e}}const o7=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);e==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(o=>{if(o){const[a,...l]=o.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),d=a.trim();n[d]||(n[d]=c),c==="false"&&(n[d]=!1),c==="true"&&(n[d]=!0),isNaN(c)||(n[d]=parseInt(c,10))}})}return{formatName:e,formatOptions:n}},PM=t=>{const e={};return(n,r,i)=>{let s=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(s={...s,[i.interpolationkey]:void 0});const o=r+JSON.stringify(s);let a=e[o];return a||(a=t(lh(r),i),e[o]=a),a(n)}},a7=t=>(e,n,r)=>t(lh(n),r)(e);class l7{constructor(e={}){this.logger=xs.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?PM:a7;this.formats={number:r((i,s)=>{const o=new Intl.NumberFormat(i,{...s});return a=>o.format(a)}),currency:r((i,s)=>{const o=new Intl.NumberFormat(i,{...s,style:"currency"});return a=>o.format(a)}),datetime:r((i,s)=>{const o=new Intl.DateTimeFormat(i,{...s});return a=>o.format(a)}),relativetime:r((i,s)=>{const o=new Intl.RelativeTimeFormat(i,{...s});return a=>o.format(a,s.range||"day")}),list:r((i,s)=>{const o=new Intl.ListFormat(i,{...s});return a=>o.format(a)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=PM(n)}format(e,n,r,i={}){const s=n.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(a=>a.indexOf(")")>-1)){const a=s.findIndex(l=>l.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,a)].join(this.formatSeparator)}return s.reduce((a,l)=>{var f;const{formatName:c,formatOptions:d}=o7(l);if(this.formats[c]){let u=a;try{const h=((f=i==null?void 0:i.formatParams)==null?void 0:f[i.interpolationkey])||{},g=h.locale||h.lng||i.locale||i.lng||r;u=this.formats[c](a,g,{...d,...i,...h})}catch(h){this.logger.warn(h)}return u}else this.logger.warn(`there was no format function for ${c}`);return a},e)}}const c7=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class u7 extends sy{constructor(e,n,r,i={}){var s,o;super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=xs.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(o=(s=this.backend)==null?void 0:s.init)==null||o.call(s,r,i.backend,i)}queueLoad(e,n,r,i){const s={},o={},a={},l={};return e.forEach(c=>{let d=!0;n.forEach(f=>{const u=`${c}|${f}`;!r.reload&&this.store.hasResourceBundle(c,f)?this.state[u]=2:this.state[u]<0||(this.state[u]===1?o[u]===void 0&&(o[u]=!0):(this.state[u]=1,d=!1,o[u]===void 0&&(o[u]=!0),s[u]===void 0&&(s[u]=!0),l[f]===void 0&&(l[f]=!0)))}),d||(a[c]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,n,r){const i=e.split("|"),s=i[0],o=i[1];n&&this.emit("failedLoading",s,o,n),!n&&r&&this.store.addResourceBundle(s,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const a={};this.queue.forEach(l=>{KH(l.loaded,[s],o),c7(l,e),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{a[c]||(a[c]={});const d=l.loaded[c];d.length&&d.forEach(f=>{a[c][f]===void 0&&(a[c][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,n,r,i=0,s=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:i,wait:s,callback:o});return}this.readingCalls++;const a=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(c&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,i+1,s*2,o)},s);return}o(c,d)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(e,n);c&&typeof c.then=="function"?c.then(d=>a(null,d)).catch(a):a(null,c)}catch(c){a(c)}return}return l(e,n,a)}prepareLoading(e,n,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();pt(e)&&(e=this.languageUtils.toResolveHierarchy(e)),pt(n)&&(n=[n]);const s=this.queueLoad(e,n,r,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e,n=""){const r=e.split("|"),i=r[0],s=r[1];this.read(i,s,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${n}loading namespace ${s} for language ${i} failed`,o),!o&&a&&this.logger.log(`${n}loaded namespace ${s} for language ${i}`,a),this.loaded(e,o,a)})}saveMissing(e,n,r,i,s,o={},a=()=>{}){var l,c,d,f,u;if((c=(l=this.services)==null?void 0:l.utils)!=null&&c.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" 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(!(r==null||r==="")){if((u=this.backend)!=null&&u.create){const h={...o,isUpdate:s},g=this.backend.create.bind(this.backend);if(g.length<6)try{let v;g.length===5?v=g(e,n,r,i,h):v=g(e,n,r,i),v&&typeof v.then=="function"?v.then(m=>a(null,m)).catch(a):a(null,v)}catch(v){a(v)}else g(e,n,r,i,a,h)}!e||!e[0]||this.store.addResource(e[0],n,r,i)}}}const IM=()=>({debug:!1,initAsync:!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:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),pt(t[1])&&(e.defaultValue=t[1]),pt(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),NM=t=>{var e,n;return pt(t.ns)&&(t.ns=[t.ns]),pt(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),pt(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),((n=(e=t.supportedLngs)==null?void 0:e.indexOf)==null?void 0:n.call(e,"cimode"))<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t},Bp=()=>{},d7=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class ch extends sy{constructor(e={},n){if(super(),this.options=NM(e),this.services={},this.logger=xs,this.modules={external:[]},d7(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(pt(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const r=IM();this.options={...r,...this.options,...NM(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const i=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?xs.init(i(this.modules.logger),this.options):xs.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=l7;const d=new AM(this.options);this.store=new EM(this.options.resources,this.options);const f=this.services;f.logger=xs,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new i7(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(f.formatter=i(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new s7(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new u7(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(u,...h)=>{this.emit(u,...h)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new Gg(this.services,this.options),this.translator.on("*",(u,...h)=>{this.emit(u,...h)}),this.modules.external.forEach(u=>{u.init&&u.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Bp),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[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(c=>{this[c]=(...d)=>this.store[c](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...d)=>(this.store[c](...d),this)});const a=Ud(),l=()=>{const c=(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),a.resolve(f),n(d,f)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),a}loadResources(e,n=Bp){var s,o;let r=n;const i=pt(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const a=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(f=>{f!=="cimode"&&a.indexOf(f)<0&&a.push(f)})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>l(d)),(o=(s=this.options.preload)==null?void 0:s.forEach)==null||o.call(s,c=>l(c)),this.services.backendConnector.load(a,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(e,n,r){const i=Ud();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=Bp),this.services.backendConnector.reload(e,n,s=>{i.resolve(),r(s)}),i}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"&&kD.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<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const r=Ud();this.emit("languageChanging",e);const i=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},s=(a,l)=>{l?this.isLanguageChangingTo===e&&(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,r.resolve((...c)=>this.t(...c)),n&&n(a,(...c)=>this.t(...c))},o=a=>{var d,f;!e&&!a&&this.services.languageDetector&&(a=[]);const l=pt(a)?a:a&&a[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(pt(a)?[a]:a);c&&(this.language||i(c),this.translator.language||this.translator.changeLanguage(c),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,c)),this.loadResources(c,u=>{s(u,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),r}getFixedT(e,n,r){const i=(s,o,...a)=>{let l;typeof o!="object"?l=this.options.overloadTranslationOptionHandler([s,o].concat(a)):l={...o},l.lng=l.lng||i.lng,l.lngs=l.lngs||i.lngs,l.ns=l.ns||i.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||i.keyPrefix);const c=this.options.keySeparator||".";let d;return l.keyPrefix&&Array.isArray(s)?d=s.map(f=>`${l.keyPrefix}${c}${f}`):d=l.keyPrefix?`${l.keyPrefix}${c}${s}`:s,this.t(d,l)};return pt(e)?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=r,i}t(...e){var n;return(n=this.translator)==null?void 0:n.translate(...e)}exists(...e){var n;return(n=this.translator)==null?void 0:n.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){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 r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,l)=>{const c=this.services.backendConnector.state[`${a}|${l}`];return c===-1||c===0||c===2};if(n.precheck){const a=n.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!i||o(s,e)))}loadNamespaces(e,n){const r=Ud();return this.options.ns?(pt(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=Ud();pt(e)&&(e=[e]);const i=this.options.preload||[],s=e.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=i.concat(s),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(e){var i,s;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.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"],r=((s=this.services)==null?void 0:s.languageUtils)||new AM(IM());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){return new ch(e,n)}cloneInstance(e={},n=Bp){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},s=new ch(i);if((e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(a=>{s[a]=this[a]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r){const a=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((d,f)=>(d[f]={...l[c][f]},d),l[c]),l),{});s.store=new EM(a,i),s.services.resourceStore=s.store}return s.translator=new Gg(s.services,i),s.translator.on("*",(a,...l)=>{s.emit(a,...l)}),s.init(i,n),s.translator.options=i,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const br=ch.createInstance();br.createInstance=ch.createInstance;br.createInstance;br.dir;br.init;br.loadResources;br.reloadResources;br.use;br.changeLanguage;br.getFixedT;const f7=br.t;br.exists;br.setDefaultNamespace;br.hasLoadedNamespace;br.loadNamespaces;br.loadLanguages;const{slice:h7,forEach:p7}=[];function m7(t){return p7.call(h7.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}
vendor: 12,675 bytes, line 323
323function g7(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(t))}const OM=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,v7=function(t,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(e);let s=`${t}=${i}`;if(r.maxAge>0){const o=r.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(o)}`}if(r.domain){if(!OM.test(r.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${r.domain}`}if(r.path){if(!OM.test(r.path))throw new TypeError("option path is invalid");s+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(s+="; HttpOnly"),r.secure&&(s+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(s+="; Partitioned"),s},DM={create(t,e,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=v7(t,e,i)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let i=n[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return i.substring(e.length,i.length)}return null},remove(t,e){this.create(t,"",-1,e)}};var y7={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return DM.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:s}=e;n&&typeof document<"u"&&DM.create(n,t,r,i,s)}},_7={name:"querystring",lookup(t){var r;let{lookupQuerystring:e}=t,n;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const o=i.substring(1).split("&");for(let a=0;a<o.length;a++){const l=o[a].indexOf("=");l>0&&o[a].substring(0,l)===e&&(n=o[a].substring(l+1))}}return n}},x7={name:"hash",lookup(t){var i;let{lookupHash:e,lookupFromHashIndex:n}=t,r;if(typeof window<"u"){const{hash:s}=window.location;if(s&&s.length>2){const o=s.substring(1);if(e){const a=o.split("&");for(let l=0;l<a.length;l++){const c=a[l].indexOf("=");c>0&&a[l].substring(0,c)===e&&(r=a[l].substring(c+1))}}if(r)return r;if(!r&&n>-1){const a=s.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?(i=a[typeof n=="number"?n:0])==null?void 0:i.replace("/",""):void 0}}}return r}};let ac=null;const kM=()=>{if(ac!==null)return ac;try{if(ac=typeof window<"u"&&window.localStorage!==null,!ac)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{ac=!1}return ac};var b7={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&kM())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&kM()&&window.localStorage.setItem(n,t)}};let lc=null;const LM=()=>{if(lc!==null)return lc;try{if(lc=typeof window<"u"&&window.sessionStorage!==null,!lc)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{lc=!1}return lc};var w7={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&LM())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&LM()&&window.sessionStorage.setItem(n,t)}},E7={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let s=0;s<n.length;s++)e.push(n[s]);r&&e.push(r),i&&e.push(i)}return e.length>0?e:void 0}},S7={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},T7={name:"path",lookup(t){var i;let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(i=n[typeof e=="number"?e:0])==null?void 0:i.replace("/",""):void 0}},A7={name:"subdomain",lookup(t){var i,s;let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&((s=(i=window.location)==null?void 0:i.hostname)==null?void 0:s.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let LD=!1;try{document.cookie,LD=!0}catch{}const FD=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];LD||FD.splice(1,1);const M7=()=>({order:FD,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class UD{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=m7(n,this.options||{},M7()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(y7),this.addDetector(_7),this.addDetector(b7),this.addDetector(w7),this.addDetector(E7),this.addDetector(S7),this.addDetector(T7),this.addDetector(A7),this.addDetector(x7)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return e.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.filter(r=>r!=null&&!g7(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}UD.type="languageDetector";const C7={en:{translation:{"nav.home":"Home","nav.services":"Services","nav.projects":"Projects","nav.blog":"Blog","nav.contact":"Contact","nav.admin":"Admin","home.hero.title":"Engineering Excellence in Design","home.hero.subtitle":"Phimec delivers innovative parametric design, 3D modeling, and automation solutions for modern engineering challenges.","home.hero.cta":"Explore Our Services","home.about.title":"About Phimec","home.about.description":"We are a leading engineering design company specializing in parametric design, 3D modeling, FEA analysis, and design optimization. Our expertise spans across various industries, delivering cutting-edge solutions.","services.title":"Our Services","services.2d3d":"2D/3D Design","services.parametric":"Parametric Design","services.fea":"FEA Analysis","services.library":"Library Creation","services.transformer":"Transformer Design","services.concrete":"Concrete Mold Design","services.optimization":"Design Optimization","contact.title":"Get in Touch","contact.name":"Name","contact.email":"Email","contact.subject":"Subject","contact.message":"Message","contact.send":"Send Message","contact.success":"Message sent successfully! We'll get back to you soon.","common.loading":"Loading...","common.error":"An error occurred","common.retry":"Try Again","common.save":"Save","common.cancel":"Cancel","common.delete":"Delete","common.edit":"Edit","common.add":"Add","footer.company":"Phimec Engineering Design","footer.description":"Innovative engineering solutions for the modern world.","footer.rights":"© {{year}} Phimec. All rights reserved.","admin.dashboard.title":"Admin Dashboard","admin.settings.title":"Settings Management","admin.settings.tabGeneral":"General","admin.settings.tabLanguages":"Languages","admin.settings.tabSocial":"Social & system","admin.settings.tabAccount":"Account","admin.settings.loading":"Loading...","admin.settings.siteTitle":"Site Title","admin.settings.contactEmail":"Contact Email","admin.settings.phone":"Phone","admin.settings.address":"Address","admin.settings.siteLanguages":"Site languages","admin.settings.siteLanguagesHelp":"Enabled languages appear in the visitor language menu. At least one language must remain on.","admin.settings.socialLinks":"Social Media Links","admin.settings.selectIcon":"Select Icon","admin.settings.platformPlaceholder":"Platform (e.g. Twitter)","admin.settings.urlPlaceholder":"URL","admin.settings.removeTitle":"Remove","admin.settings.addSocialLink":"+ Add Social Link","admin.settings.maintenanceMode":"Maintenance Mode","admin.settings.save":"Save Settings","admin.settings.saving":"Saving...","admin.settings.passwordTitle":"Account password","admin.settings.sessionWithEmail":"Signed in as: {{email}}","admin.settings.passwordCurrent":"Current password","admin.settings.passwordNew":"New password","admin.settings.passwordConfirm":"Confirm new password","admin.settings.passwordSubmit":"Update password","admin.settings.passwordSubmitting":"Updating…","admin.settings.passwordOAuthNotice":"Password change is only available for accounts that sign in with email and password.","admin.settings.langSwitchAria":"Show {{name}} ({{code}}) on the site","admin.settings.toast.langLastTitle":"At least one language required","admin.settings.toast.langLastDesc":"You cannot turn off the last remaining language.","admin.settings.toast.saveNoLangTitle":"Could not save","admin.settings.toast.saveNoLangDesc":"At least one language must be enabled.","admin.settings.toast.passwordWeakTitle":"New password","admin.settings.toast.passwordWeakDesc":"Must be at least 6 characters.","admin.settings.toast.passwordMismatch":"Passwords do not match.","admin.settings.toast.passwordMismatchDesc":"Enter the same new password in both fields.","admin.settings.toast.passwordSuccessTitle":"Password updated","admin.settings.toast.passwordSuccessDesc":"Your new password has been saved.","admin.settings.toast.errorTitle":"Error","admin.settings.toast.saveSuccessTitle":"Settings saved","admin.settings.toast.saveSuccessDesc":"Your changes have been stored.","admin.settings.toast.saveErrorTitle":"Could not save settings","admin.settings.toast.saveErrorDesc":"Something went wrong. Please try again.","admin.settings.siteLangLabel.en":"English","admin.settings.siteLangLabel.tr":"Turkish","admin.settings.siteLangLabel.ar":"Arabic","admin.settings.socialIcon.Globe":"Globe","admin.settings.socialIcon.Linkedin":"LinkedIn","admin.settings.socialIcon.Youtube":"YouTube","admin.settings.socialIcon.Instagram":"Instagram","admin.settings.socialIcon.Facebook":"Facebook","admin.settings.socialIcon.Twitter":"Twitter","admin.auth.wrongPassword":"Current password is incorrect.","admin.auth.weakPassword":"New password is too weak; use at least 6 characters.","admin.auth.requiresRecentLogin":"For security, sign in again and try.","admin.auth.tooManyRequests":"Too many attempts. Try again later.","admin.auth.unknown":"Could not update password."}},tr:{translation:{"nav.home":"Ana Sayfa","nav.services":"Hizmetler","nav.projects":"Projeler","nav.blog":"Blog","nav.contact":"İletişim","nav.admin":"Yönetici","home.hero.title":"Tasarımda Mühendislik Mükemmelliği","home.hero.subtitle":"Phimec, modern mühendislik zorluklarına yenilikçi parametrik tasarım, 3D modelleme ve otomasyon çözümleri sunar.","home.hero.cta":"Hizmetlerimizi Keşfedin","home.about.title":"Phimec Hakkında","home.about.description":"Parametrik tasarım, 3D modelleme, FEA analizi ve tasarım optimizasyonu konularında uzmanlaşmış önde gelen bir mühendislik tasarım şirketiyiz.","services.title":"Hizmetlerimiz","services.2d3d":"2D/3D Tasarım","services.parametric":"Parametrik Tasarım","services.fea":"FEA Analizi","services.library":"Kütüphane Oluşturma","
323services.transformer":"Transformatör Tasarımı","services.concrete":"Beton Kalıp Tasarımı","services.optimization":"Tasarım Optimizasyonu","contact.title":"İletişime Geçin","contact.name":"İsim","contact.email":"E-posta","contact.subject":"Konu","contact.message":"Mesaj","contact.send":"Mesaj Gönder","contact.success":"Mesaj başarıyla gönderildi! En kısa sürede size dönüş yapacağız.","common.loading":"Yükleniyor...","common.error":"Bir hata oluştu","common.retry":"Tekrar Dene","common.save":"Kaydet","common.cancel":"İptal","common.delete":"Sil","common.edit":"Düzenle","common.add":"Ekle","footer.company":"Phimec Mühendislik Tasarım","footer.description":"Modern dünya için yenilikçi mühendislik çözümleri.","footer.rights":"© {{year}} Phimec. Tüm hakları saklıdır.","admin.dashboard.title":"Yönetici Paneli","admin.settings.title":"Ayarlar","admin.settings.tabGeneral":"Genel","admin.settings.tabLanguages":"Diller","admin.settings.tabSocial":"Sosyal ve sistem","admin.settings.tabAccount":"Hesap","admin.settings.loading":"Yükleniyor...","admin.settings.siteTitle":"Site başlığı","admin.settings.contactEmail":"İletişim e-postası","admin.settings.phone":"Telefon","admin.settings.address":"Adres","admin.settings.siteLanguages":"Site dilleri","admin.settings.siteLanguagesHelp":"Açık olan diller ziyaretçi dil menüsünde listelenir. En az bir dil açık kalmalıdır.","admin.settings.socialLinks":"Sosyal medya bağlantıları","admin.settings.selectIcon":"İkon seç","admin.settings.platformPlaceholder":"Platform (ör. Twitter)","admin.settings.urlPlaceholder":"URL","admin.settings.removeTitle":"Kaldır","admin.settings.addSocialLink":"+ Sosyal bağlantı ekle","admin.settings.maintenanceMode":"Bakım modu","admin.settings.save":"Ayarları kaydet","admin.settings.saving":"Kaydediliyor...","admin.settings.passwordTitle":"Hesap şifresi","admin.settings.sessionWithEmail":"Oturum: {{email}}","admin.settings.passwordCurrent":"Mevcut şifre","admin.settings.passwordNew":"Yeni şifre","admin.settings.passwordConfirm":"Yeni şifre (tekrar)","admin.settings.passwordSubmit":"Şifreyi güncelle","admin.settings.passwordSubmitting":"Güncelleniyor…","admin.settings.passwordOAuthNotice":"Şifre değişikliği yalnızca e-posta ve şifre ile giriş yapılan hesaplar için geçerlidir.","admin.settings.langSwitchAria":"{{name}} ({{code}}) dilini sitede göster","admin.settings.toast.langLastTitle":"En az bir dil açık olmalı","admin.settings.toast.langLastDesc":"Son kalan dili kapatamazsınız.","admin.settings.toast.saveNoLangTitle":"Kayıt yapılamadı","admin.settings.toast.saveNoLangDesc":"En az bir dil etkin olmalıdır.","admin.settings.toast.passwordWeakTitle":"Yeni şifre","admin.settings.toast.passwordWeakDesc":"En az 6 karakter olmalı.","admin.settings.toast.passwordMismatch":"Şifreler eşleşmiyor.","admin.settings.toast.passwordMismatchDesc":"Yeni şifreyi her iki alana da aynı şekilde girin.","admin.settings.toast.passwordSuccessTitle":"Şifre güncellendi","admin.settings.toast.passwordSuccessDesc":"Yeni şifreniz kaydedildi.","admin.settings.toast.errorTitle":"Hata","admin.settings.toast.saveSuccessTitle":"Ayarlar kaydedildi","admin.settings.toast.saveSuccessDesc":"Değişiklikleriniz kaydedildi.","admin.settings.toast.saveErrorTitle":"Ayarlar kaydedilemedi","admin.settings.toast.saveErrorDesc":"Bir sorun oluştu. Lütfen tekrar deneyin.","admin.settings.siteLangLabel.en":"İngilizce","admin.settings.siteLangLabel.tr":"Türkçe","admin.settings.siteLangLabel.ar":"Arapça","admin.settings.socialIcon.Globe":"Küre (genel)","admin.settings.socialIcon.Linkedin":"LinkedIn","admin.settings.socialIcon.Youtube":"YouTube","admin.settings.socialIcon.Instagram":"Instagram","admin.settings.socialIcon.Facebook":"Facebook","admin.settings.socialIcon.Twitter":"Twitter","admin.auth.wrongPassword":"Mevcut şifre yanlış.","admin.auth.weakPassword":"Yeni şifre çok zayıf; en az 6 karakter kullanın.","admin.auth.requiresRecentLogin":"Güvenlik nedeniyle tekrar giriş yapıp deneyin.","admin.auth.tooManyRequests":"Çok fazla deneme. Bir süre sonra tekrar deneyin.","admin.auth.unknown":"Şifre güncellenemedi."}},ar:{translation:{"nav.home":"الرئيسية","nav.services":"الخدمات","nav.projects":"المشاريع","nav.blog":"المدونة","nav.contact":"اتصل بنا","nav.admin":"إدارة","home.hero.title":"التميز الهندسي في التصميم","home.hero.subtitle":"تقدم فايمك حلول التصميم البارامتري المبتكرة والنمذجة ثلاثية الأبعاد والأتمتة للتحديات الهندسية الحديثة.","home.hero.cta":"استكشف خدماتنا","home.about.title":"حول فايمك","home.about.description":"نحن شركة رائدة في التصميم الهندسي متخصصة في التصميم البارامتري والنمذجة ثلاثية الأبعاد وتحليل FEA وتحسين التصميم.","services.title":"خدماتنا","services.2d3d":"تصميم 2D/3D","services.parametric":"التصميم البارامتري","services.fea":"تحليل FEA","services.library":"إنشاء المكتبات","services.transformer":"تصميم المحولات","services.concrete":"تصميم قوالب الخرسانة","services.optimization":"تحسين التصميم","contact.title":"تواصل معنا","contact.name":"الاسم","contact.email":"البريد الإلكتروني","contact.subject":"الموضوع","contact.message":"الرسالة","contact.send":"إرسال الرسالة","contact.success":"تم إرسال الرسالة بنجاح! سنعود إليك قريباً.","common.loading":"جاري التحميل...","common.error":"حدث خطأ","common.retry":"حاول مرة أخرى","common.save":"حفظ","common.cancel":"إلغاء","common.delete":"حذف","common.edit":"تحرير","common.add":"إضافة","footer.company":"فايمك للتصميم الهندسي","footer.description":"حلول هندسية مبتكرة للعالم الحديث.","footer.rights":"© {{year}} فايمك. جميع الحقوق محفوظة.","admin.dashboard.title":"لوحة تحكم الإدارة","admin.settings.title":"إدارة الإعدادات","admin.settings.tabGeneral":"عام","admin.settings.tabLanguages":"اللغات","admin.settings.tabSocial":"التواصل والنظام","admin.settings.tabAccount":"الحساب","admin.settings.loading":"جاري التحميل...","admin.settings.siteTitle":"عنوان الموقع","admin.settings.contactEmail":"البريد للتواصل","admin.settings.phone":"الهاتف","admin.settings.address":"العنوان","admin.settings.siteLanguages":"لغات الموقع","admin.settings.siteLanguagesHelp":"تظهر اللغات المفعّلة في قائمة لغة الزائر. يجب أن تبقى لغة واحدة على الأقل مفعّلة.","admin.settings.socialLinks":"روابط وسائل التواصل","admin.settings.selectIcon":"اختر أيقونة","admin.settings.platformPlaceholder":"المنصة (مثل Twitter)","admin.settings.urlPlaceholder":"الرابط","admin.settings.removeTitle":"إزالة","admin.settings.addSocialLink":"+ إضافة رابط اجتماعي","admin.settings.maintenanceMode":"وضع الصيانة","admin.settings.save":"حفظ الإعدادات","admin.settings.saving":"جاري الحفظ...","admin.settings.passwordTitle":"كلمة مرور الحساب","admin.settings.sessionWithEmail":"تم تسجيل الدخول كـ: {{email}}","admin.settings.passwordCurrent":"كلمة المرور الحالية","admin.settings.passwordNew":"كلمة المرور الجديدة","admin.settings.passwordConfirm":"تأكيد كلمة المرور الجديدة","admin.settings.passwordSubmit":"تحديث كلمة المرور","admin.settings.passwordSubmitting":"جاري التحديث…","admin.settings.passwordOAuthNotice":"تغيير كلمة المرور متاح فقط للحسابات التي تسجل الدخول بالبريد وكلمة المرور.","admin.settings.langSwitchAria":"إظهار {{name}} ({{code}}) على الموقع","admin.settings.toast.langLastTitle":"مطلوب لغة واحدة على الأقل","admin.settings.toast.langLastDesc":"لا يمكن إيقاف آخر لغة متبقية.","admin.settings.toast.saveNoLangTitle":"تعذر الحفظ","admin.settings.toast.saveNoLangDesc":"يجب تفعيل لغة واحدة على الأقل.","admin.settings.toast.passwordWeakTitle":"كلمة المرور الجديدة","admin.settings.toast.passwordWeakDesc":"يجب أن تكون 6 أحرف على الأقل.","admin.settings.toast.passwordMismatch":"كلمتا المرور غير متطابقتين.","admin.settings.toast.passwordMismatchDesc":"أدخل كلمة المرور الجديدة نفسها في الحقلين.","admin.settings.toast.passwordSuccessTitle":"تم تحديث كلمة المرور","admin.settings.toast.passwordSuccessDesc":"تم حفظ كلمة المرور الجديدة.","admin.settings.toast.errorTitle":"خطأ","admin.settings.toast.saveSuccessTitle":"تم حفظ الإعدادات","admin.settings.toast.saveSuccessDesc":"تم تخزين التغييرات.","admin.settings.toast.saveErrorTitle":"تعذر حفظ الإعدادات","admin.settings.toast.saveErrorDesc":"حدث خطأ. حاول مرة أخرى.","admin.settings.siteLangLabel.en":"الإنجليزية","admin.settings.siteLangLabel.tr":"التركية","admin.settings.siteLangLabel.ar":"العربية","admin.settings.socialIcon.Globe":"عالم (عام)","admin.settings.socialIcon.Linkedin":"LinkedIn","admin.settings.socialIcon.Youtube":"YouTube","admin.settings.socialIcon.Instagram":"Instagram","admin.settings.socialIcon.Facebook":"Facebook","admin.settings.socialIcon.Twitter":"Twitter","admin.auth.wrongPassword":"كلمة المرور الحالية غير صحيحة.","admin.auth.weakPassword":"كلمة المرور الجديدة ضعيفة جداً؛ استخدم 6 أحرف على الأقل.","admin.auth.requiresRecentLogin":"لأسباب أمنية، سجّل الدخول مجدداً ثم أعد المحاولة.","admin.auth.tooManyRequests":"محاولات كثيرة. حاول لاحقاً.","admin.auth.unknown":"تعذر تحديث كلمة المرور."}}};br.use(UD).use(VH).init({resources:C7,fallbackLng:"en",debug:!1,detection:{order:["localStorage","navigator","htmlTag"],lookupLocalStorage:"phimec-language",caches:["localStorage"]},interpolation:{escapeValue:!1}});const R7=()=>{};var FM={};/**
324 * @license
325 * Copyright 2017 Google LLC
326 *
327 * Licensed under the Apache License, Version 2.0 (the "License");
328 * you may not use this file except in compliance with the License.
329 * You may obtain a copy of the License at
330 *
331 *   http://www.apache.org/licenses/LICENSE-2.0
332 *
333 * Unless required by applicable law or agreed to in writing, software
334 * distributed under the License is distributed on an "AS IS" BASIS,
335 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
336 * See the License for the specific language governing permissions and
337 * limitations under the License.
338 */const jD=function(t){const e=[];let n=0;for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=i&63|128):(i&64512)===55296&&r+1<t.length&&(t.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(t.charCodeAt(++r)&1023),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},P7=function(t){const e=[];let n=0,r=0;for(;n<t.length;){const i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=t[n++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=t[n++],o=t[n++],a=t[n++],l=((i&7)<<18|(s&63)<<12|(o&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(l>>10)),e[r++]=String.fromCharCode(56320+(l&1023))}else{const s=t[n++],o=t[n++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},BD={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(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<t.length;i+=3){const s=t[i],o=i+1<t.length,a=o?t[i+1]:0,l=i+2<t.length,c=l?t[i+2]:0,d=s>>2,f=(s&3)<<4|a>>4;let u=(a&15)<<2|c>>6,h=c&63;l||(h=64,o||(u=64)),r.push(n[d],n[f],n[u],n[h])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(jD(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):P7(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<t.length;){const s=n[t.charAt(i++)],a=i<t.length?n[t.charAt(i)]:0;++i;const c=i<t.length?n[t.charAt(i)]:64;++i;const f=i<t.length?n[t.charAt(i)]:64;if(++i,s==null||a==null||c==null||f==null)throw new I7;const u=s<<2|a>>4;if(r.push(u),c!==64){const h=a<<4&240|c>>2;if(r.push(h),f!==64){const g=c<<6&192|f;r.push(g)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class I7 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const N7=function(t){const e=jD(t);return BD.encodeByteArray(e,!0)},$g=function(t){return N7(t).replace(/\./g,"")},VD=function(t){try{return BD.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
339 * @license
340 * Copyright 2022 Google LLC
341 *
342 * Licensed under the Apache License, Version 2.0 (the "License");
343 * you may not use this file except in compliance with the License.
344 * You may obtain a copy of the License at
345 *
346 *   http://www.apache.org/licenses/LICENSE-2.0
347 *
348 * Unless required by applicable law or agreed to in writing, software
349 * distributed under the License is distributed on an "AS IS" BASIS,
350 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
351 * See the License for the specific language governing permissions and
352 * limitations under the License.
353 */function O7(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
354 * @license
355 * Copyright 2022 Google LLC
356 *
357 * Licensed under the Apache License, Version 2.0 (the "License");
358 * you may not use this file except in compliance with the License.
359 * You may obtain a copy of the License at
360 *
361 *   http://www.apache.org/licenses/LICENSE-2.0
362 *
363 * Unless required by applicable law or agreed to in writing, software
364 * distributed under the License is distributed on an "AS IS" BASIS,
365 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
366 * See the License for the specific language governing permissions and
367 * limitations under the License.
368 */const D7=()=>O7().__FIREBASE_DEFAULTS__,k7=()=>{if(typeof process>"u"||typeof FM>"u")return;const t=FM.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},L7=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&VD(t[1]);return e&&JSON.parse(e)},oy=()=>{try{return R7()||D7()||k7()||L7()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},zD=t=>{var e,n;return(n=(e=oy())===null||e===void 0?void 0:e.emulatorHosts)===null||n===void 0?void 0:n[t]},HD=t=>{const e=zD(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},GD=()=>{var t;return(t=oy())===null||t===void 0?void 0:t.config},$D=t=>{var e;return(e=oy())===null||e===void 0?void 0:e[`_${t}`]};/**
369 * @license
370 * Copyright 2017 Google LLC
371 *
372 * Licensed under the Apache License, Version 2.0 (the "License");
373 * you may not use this file except in compliance with the License.
374 * You may obtain a copy of the License at
375 *
376 *   http://www.apache.org/licenses/LICENSE-2.0
377 *
378 * Unless required by applicable law or agreed to in writing, software
379 * distributed under the License is distributed on an "AS IS" BASIS,
380 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
381 * See the License for the specific language governing permissions and
382 * limitations under the License.
383 */class F7{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}/**
384 * @license
385 * Copyright 2025 Google LLC
386 *
387 * Licensed under the Apache License, Version 2.0 (the "License");
388 * you may not use this file except in compliance with the License.
389 * You may obtain a copy of the License at
390 *
391 *   http://www.apache.org/licenses/LICENSE-2.0
392 *
393 * Unless required by applicable law or agreed to in writing, software
394 * distributed under the License is distributed on an "AS IS" BASIS,
395 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
396 * See the License for the specific language governing permissions and
397 * limitations under the License.
398 */function $l(t){return t.endsWith(".cloudworkstations.dev")}async function dE(t){return(await fetch(t,{credentials:"include"})).ok}/**
399 * @license
400 * Copyright 2021 Google LLC
401 *
402 * Licensed under the Apache License, Version 2.0 (the "License");
403 * you may not use this file except in compliance with the License.
404 * You may obtain a copy of the License at
405 *
406 *   http://www.apache.org/licenses/LICENSE-2.0
407 *
408 * Unless required by applicable law or agreed to in writing, software
409 * distributed under the License is distributed on an "AS IS" BASIS,
410 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
411 * See the License for the specific language governing permissions and
412 * limitations under the License.
413 */function WD(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.');const n={alg:"none",type:"JWT"},r=e||"demo-project",i=t.iat||0,s=t.sub||t.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}}},t);return[$g(JSON.stringify(n)),$g(JSON.stringify(o)),""].join(".")}const Cf={};function U7(){const t={prod:[],emulator:[]};for(const e of Object.keys(Cf))Cf[e]?t.emulator.push(e):t.prod.push(e);return t}function j7(t){let e=document.getElementById(t),n=!1;return e||(e=document.createElement("div"),e.setAttribute("id",t),n=!0),{created:n,element:e}}let UM=!1;function fE(t,e){if(typeof window>"u"||typeof document>"u"||!$l(window.location.host)||Cf[t]===e||Cf[t]||UM)return;Cf[t]=e;function n(u){return`__firebase__banner__${u}`}const r="__firebase__banner",s=U7().prod.length>0;function o(){const u=document.getElementById(r);u&&u.remove()}function a(u){u.style.display="flex",u.style.background="#7faaf0",u.style.position="fixed",u.style.bottom="5px",u.style.left="5px",u.style.padding=".5em",u.style.borderRadius="5px",u.style.alignItems="center"}function l(u,h){u.setAttribute("width","24"),u.setAttribute("id",h),u.setAttribute("height","24"),u.setAttribute("viewBox","0 0 24 24"),u.setAttribute("fill","none"),u.style.marginLeft="-6px"}function c(){const u=document.createElement("span");
vendor: 4,150 bytes, lines 413-442
413return u.style.cursor="pointer",u.style.marginLeft="16px",u.style.fontSize="24px",u.innerHTML=" &times;",u.onclick=()=>{UM=!0,o()},u}function d(u,h){u.setAttribute("id",h),u.innerText="Learn more",u.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",u.setAttribute("target","__blank"),u.style.paddingLeft="5px",u.style.textDecoration="underline"}function f(){const u=j7(r),h=n("text"),g=document.getElementById(h)||document.createElement("span"),v=n("learnmore"),m=document.getElementById(v)||document.createElement("a"),p=n("preprendIcon"),y=document.getElementById(p)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(u.created){const w=u.element;a(w),d(m,v);const x=c();l(y,p),w.append(y,g,m,x),document.body.appendChild(w)}s?(g.innerText="Preview backend disconnected.",y.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
414<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
415</g>
416<defs>
417<clipPath id="clip0_6013_33858">
418<rect width="24" height="24" fill="white"/>
419</clipPath>
420</defs>`):(y.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
421<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
422</g>
423<defs>
424<clipPath id="clip0_6083_34804">
425<rect width="24" height="24" fill="white"/>
426</clipPath>
427</defs>`,g.innerText="Preview backend running in this workspace."),g.setAttribute("id",h)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",f):f()}/**
428 * @license
429 * Copyright 2017 Google LLC
430 *
431 * Licensed under the Apache License, Version 2.0 (the "License");
432 * you may not use this file except in compliance with the License.
433 * You may obtain a copy of the License at
434 *
435 *   http://www.apache.org/licenses/LICENSE-2.0
436 *
437 * Unless required by applicable law or agreed to in writing, software
438 * distributed under the License is distributed on an "AS IS" BASIS,
439 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
440 * See the License for the specific language governing permissions and
441 * limitations under the License.
442 */function xr(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function B7(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(xr())}function V7(){var t;const e=(t=oy())===null||t===void 0?void 0:t.forceEnvironment;if(e==="node")return!0;
442if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function z7(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function hE(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function H7(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function G7(){const t=xr();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function $7(){return!V7()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function pE(){try{return typeof indexedDB=="object"}catch{return!1}}function mE(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var s;e(((s=i.error)===null||s===void 0?void 0:s.message)||"")}}catch(n){e(n)}})}function qD(){return!(typeof navigator>"u"||!navigator.cookieEnabled)}/**
443 * @license
444 * Copyright 2017 Google LLC
445 *
446 * Licensed under the Apache License, Version 2.0 (the "License");
447 * you may not use this file except in compliance with the License.
448 * You may obtain a copy of the License at
449 *
450 *   http://www.apache.org/licenses/LICENSE-2.0
451 *
452 * Unless required by applicable law or agreed to in writing, software
453 * distributed under the License is distributed on an "AS IS" BASIS,
454 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
455 * See the License for the specific language governing permissions and
456 * limitations under the License.
457 */const W7="FirebaseError";
457class Ni extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=W7,Object.setPrototypeOf(this,Ni.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Wl.prototype.create)}}class Wl{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?q7(s,r):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new Ni(i,a,r)}}function q7(t,e){return t.replace(K7,(n,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const K7=/\{\$([^}]+)}/g;function X7(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Da(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const i of n){if(!r.includes(i))return!1;const s=t[i],o=e[i];if(jM(s)&&jM(o)){if(!Da(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function jM(t){return t!==null&&typeof t=="object"}/**
458 * @license
459 * Copyright 2017 Google LLC
460 *
461 * Licensed under the Apache License, Version 2.0 (the "License");
462 * you may not use this file except in compliance with the License.
463 * You may obtain a copy of the License at
464 *
465 *   http://www.apache.org/licenses/LICENSE-2.0
466 *
467 * Unless required by applicable law or agreed to in writing, software
468 * distributed under the License is distributed on an "AS IS" BASIS,
469 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
470 * See the License for the specific language governing permissions and
471 * limitations under the License.
472 */function jh(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function Zd(t){const e={};return t.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function Jd(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}function Y7(t,e){const n=new Q7(t,e);return n.subscribe.bind(n)}class Q7{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let i;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");Z7(e,["next","error","complete"])?i=e:i={next:e,error:n,complete:r},i.next===void 0&&(i.next=z_),i.error===void 0&&(i.error=z_),i.complete===void 0&&(i.complete=z_);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,e)}sendOne(e,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function Z7(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function z_(){}/**
473 * @license
474 * Copyright 2019 Google LLC
475 *
476 * Licensed under the Apache License, Version 2.0 (the "License");
477 * you may not use this file except in compliance with the License.
478 * You may obtain a copy of the License at
479 *
480 *   http://www.apache.org/licenses/LICENSE-2.0
481 *
482 * Unless required by applicable law or agreed to in writing, software
483 * distributed under the License is distributed on an "AS IS" BASIS,
484 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
485 * See the License for the specific language governing permissions and
486 * limitations under the License.
487 */const J7=1e3,eG=2,tG=4*60*60*1e3,nG=.5;function BM(t,e=J7,n=eG){const r=e*Math.pow(n,t),i=Math.round(nG*r*(Math.random()-.5)*2);return Math.min(tG,r+i)}/**
488 * @license
489 * Copyright 2021 Google LLC
490 *
491 * Licensed under the Apache License, Version 2.0 (the "License");
492 * you may not use this file except in compliance with the License.
493 * You may obtain a copy of the License at
494 *
495 *   http://www.apache.org/licenses/LICENSE-2.0
496 *
497 * Unless required by applicable law or agreed to in writing, software
498 * distributed under the License is distributed on an "AS IS" BASIS,
499 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
500 * See the License for the specific language governing permissions and
501 * limitations under the License.
502 */function cn(t){return t&&t._delegate?t._delegate:t}class Ii{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/**
503 * @license
504 * Copyright 2019 Google LLC
505 *
506 * Licensed under the Apache License, Version 2.0 (the "License");
507 * you may not use this file except in compliance with the License.
508 * You may obtain a copy of the License at
509 *
510 *   http://www.apache.org/licenses/LICENSE-2.0
511 *
512 * Unless required by applicable law or agreed to in writing, software
513 * distributed under the License is distributed on an "AS IS" BASIS,
514 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
515 * See the License for the specific language governing permissions and
516 * limitations under the License.
517 */const cl="[DEFAULT]";/**
518 * @license
519 * Copyright 2019 Google LLC
520 *
521 * Licensed under the Apache License, Version 2.0 (the "License");
522 * you may not use this file except in compliance with the License.
523 * You may obtain a copy of the License at
524 *
525 *   http://www.apache.org/licenses/LICENSE-2.0
526 *
527 * Unless required by applicable law or agreed to in writing, software
528 * distributed under the License is distributed on an "AS IS" BASIS,
529 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
530 * See the License for the specific language governing permissions and
531 * limitations under the License.
532 */class rG{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new F7;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){var n;const r=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),i=(n=e==null?void 0:e.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(i)return null;throw s}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(sG(e))try{this.getOrInitializeService({instanceIdentifier:cl})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(n);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=cl){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=cl){return this.instances.has(e)}getOptions(e=cl){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[s,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(s);r===a&&o.resolve(i)}return i}onInit(e,n){var r;const i=this.normalizeInstanceIdentifier(n),s=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(i,s);const o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const i of r)try{i(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:iG(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=cl){return this.component?this.component.multipleInstances?e:cl:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function iG(t){return t===cl?void 0:t}function sG(t){return t.instantiationMode==="EAGER"}/**
533 * @license
534 * Copyright 2019 Google LLC
535 *
536 * Licensed under the Apache License, Version 2.0 (the "License");
537 * you may not use this file except in compliance with the License.
538 * You may obtain a copy of the License at
539 *
540 *   http://www.apache.org/licenses/LICENSE-2.0
541 *
542 * Unless required by applicable law or agreed to in writing, software
543 * distributed under the License is distributed on an "AS IS" BASIS,
544 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
545 * See the License for the specific language governing permissions and
546 * limitations under the License.
547 */class oG{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new rG(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/**
548 * @license
549 * Copyright 2017 Google LLC
550 *
551 * Licensed under the Apache License, Version 2.0 (the "License");
552 * you may not use this file except in compliance with the License.
553 * You may obtain a copy of the License at
554 *
555 *   http://www.apache.org/licenses/LICENSE-2.0
556 *
557 * Unless required by applicable law or agreed to in writing, software
558 * distributed under the License is distributed on an "AS IS" BASIS,
559 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
560 * See the License for the specific language governing permissions and
561 * limitations under the License.
562 */var Nt;(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"})(Nt||(Nt={}));const aG={debug:Nt.DEBUG,verbose:Nt.VERBOSE,info:Nt.INFO,warn:Nt.WARN,error:Nt.ERROR,silent:Nt.SILENT},lG=Nt.INFO,cG={[Nt.DEBUG]:"log",[Nt.VERBOSE]:"log",[Nt.INFO]:"info",[Nt.WARN]:"warn",[Nt.ERROR]:"error"},uG=(t,e,...n)=>{if(e<t.logLevel)return;const r=new Date().toISOString(),i=cG[e];if(i)console[i](`[${r}]  ${t.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class ay{constructor(e){this.name=e,this._logLevel=lG,this._logHandler=uG,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Nt))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?aG[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,Nt.DEBUG,...e),this._logHandler(this,Nt.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,Nt.VERBOSE,...e),this._logHandler(this,Nt.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,Nt.INFO,...e),this._logHandler(this,Nt.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,Nt.WARN,...e),this._logHandler(this,Nt.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,Nt.ERROR,...e),this._logHandler(this,Nt.ERROR,...e)}}const dG=(t,e)=>e.some(n=>t instanceof n);let VM,zM;function fG(){return VM||(VM=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function hG(){return zM||(zM=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const KD=new WeakMap,gb=new WeakMap,XD=new WeakMap,H_=new WeakMap,gE=new WeakMap;function pG(t){const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{n(wa(t.result)),i()},o=()=>{r(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(n=>{n instanceof IDBCursor&&KD.set(n,t)}).catch(()=>{}),gE.set(e,t),e}function mG(t){if(gb.has(t))return;const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{n(),i()},o=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});gb.set(t,e)}let vb={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return gb.get(t);if(e==="objectStoreNames")return t.objectStoreNames||XD.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return wa(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function gG(t){vb=t(vb)}function vG(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(G_(this),e,...n);
562return XD.set(r,e.sort?e.sort():[e]),wa(r)}:hG().includes(t)?function(...e){return t.apply(G_(this),e),wa(KD.get(this))}:function(...e){return wa(t.apply(G_(this),e))}}function yG(t){return typeof t=="function"?vG(t):(t instanceof IDBTransaction&&mG(t),dG(t,fG())?new Proxy(t,vb):t)}function wa(t){if(t instanceof IDBRequest)return pG(t);if(H_.has(t))return H_.get(t);const e=yG(t);return e!==t&&(H_.set(t,e),gE.set(e,t)),e}const G_=t=>gE.get(t);function YD(t,e,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=wa(o);return r&&o.addEventListener("upgradeneeded",l=>{r(wa(o.result),l.oldVersion,l.newVersion,wa(o.transaction),l)}),n&&o.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{s&&l.addEventListener("close",()=>s()),i&&l.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const _G=["get","getKey","getAll","getAllKeys","count"],xG=["put","add","delete","clear"],$_=new Map;function HM(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if($_.get(e))return $_.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,i=xG.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||_G.includes(n)))return;const s=async function(o,...a){const l=this.transaction(o,i?"readwrite":"readonly");let c=l.store;return r&&(c=c.index(a.shift())),(await Promise.all([c[n](...a),i&&l.done]))[0]};return $_.set(e,s),s}gG(t=>({...t,get:(e,n,r)=>HM(e,n)||t.get(e,n,r),has:(e,n)=>!!HM(e,n)||t.has(e,n)}));/**
563 * @license
564 * Copyright 2019 Google LLC
565 *
566 * Licensed under the Apache License, Version 2.0 (the "License");
567 * you may not use this file except in compliance with the License.
568 * You may obtain a copy of the License at
569 *
570 *   http://www.apache.org/licenses/LICENSE-2.0
571 *
572 * Unless required by applicable law or agreed to in writing, software
573 * distributed under the License is distributed on an "AS IS" BASIS,
574 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
575 * See the License for the specific language governing permissions and
576 * limitations under the License.
577 */class bG{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(wG(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function wG(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const yb="@firebase/app",GM="0.13.1";/**
578 * @license
579 * Copyright 2019 Google LLC
580 *
581 * Licensed under the Apache License, Version 2.0 (the "License");
582 * you may not use this file except in compliance with the License.
583 * You may obtain a copy of the License at
584 *
585 *   http://www.apache.org/licenses/LICENSE-2.0
586 *
587 * Unless required by applicable law or agreed to in writing, software
588 * distributed under the License is distributed on an "AS IS" BASIS,
589 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
590 * See the License for the specific language governing permissions and
591 * limitations under the License.
592 */const _o=new ay("@firebase/app"),EG="@firebase/app-compat",SG="@firebase/analytics-compat",TG="@firebase/analytics",AG="@firebase/app-check-compat",MG="@firebase/app-check",CG="@firebase/auth",RG="@firebase/auth-compat",PG="@firebase/database",IG="@firebase/data-connect",NG="@firebase/database-compat",OG="@firebase/functions",DG="@firebase/functions-compat",kG="@firebase/installations",LG="@firebase/installations-compat",FG="@firebase/messaging",UG="@firebase/messaging-compat",jG="@firebase/performance",BG="@firebase/performance-compat",VG="@firebase/remote-config",zG="@firebase/remote-config-compat",HG="@firebase/storage",GG="@firebase/storage-compat",$G="@firebase/firestore",WG="@firebase/ai",qG="@firebase/firestore-compat",KG="firebase",XG="11.9.0";/**
593 * @license
594 * Copyright 2019 Google LLC
595 *
596 * Licensed under the Apache License, Version 2.0 (the "License");
597 * you may not use this file except in compliance with the License.
598 * You may obtain a copy of the License at
599 *
600 *   http://www.apache.org/licenses/LICENSE-2.0
601 *
602 * Unless required by applicable law or agreed to in writing, softw
602are
603 * distributed under the License is distributed on an "AS IS" BASIS,
604 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
605 * See the License for the specific language governing permissions and
606 * limitations under the License.
607 */const _b="[DEFAULT]",YG={[yb]:"fire-core",[EG]:"fire-core-compat",[TG]:"fire-analytics",[SG]:"fire-analytics-compat",[MG]:"fire-app-check",[AG]:"fire-app-check-compat",[CG]:"fire-auth",[RG]:"fire-auth-compat",[PG]:"fire-rtdb",[IG]:"fire-data-connect",[NG]:"fire-rtdb-compat",[OG]:"fire-fn",[DG]:"fire-fn-compat",[kG]:"fire-iid",[LG]:"fire-iid-compat",[FG]:"fire-fcm",[UG]:"fire-fcm-compat",[jG]:"fire-perf",[BG]:"fire-perf-compat",[VG]:"fire-rc",[zG]:"fire-rc-compat",[HG]:"fire-gcs",[GG]:"fire-gcs-compat",[$G]:"fire-fst",[qG]:"fire-fst-compat",[WG]:"fire-vertex","fire-js":"fire-js",[KG]:"fire-js-all"};/**
608 * @license
609 * Copyright 2019 Google LLC
610 *
611 * Licensed under the Apache License, Version 2.0 (the "License");
612 * you may not use this file except in compliance with the License.
613 * You may obtain a copy of the License at
614 *
615 *   http://www.apache.org/licenses/LICENSE-2.0
616 *
617 * Unless required by applicable law or agreed to in writing, software
618 * distributed under the License is distributed on an "AS IS" BASIS,
619 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
620 * See the License for the specific language governing permissions and
621 * limitations under the License.
622 */const Wg=new Map,QG=new Map,xb=new Map;function $M(t,e){try{t.container.addComponent(e)}catch(n){_o.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function ns(t){const e=t.name;if(xb.has(e))return _o.debug(`There were multiple attempts to register component ${e}.`),!1;xb.set(e,t);for(const n of Wg.values())$M(n,t);for(const n of QG.values())$M(n,t);return!0}function Ka(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function Ti(t){return t==null?!1:t.settings!==void 0}/**
623 * @license
624 * Copyright 2019 Google LLC
625 *
626 * Licensed under the Apache License, Version 2.0 (the "License");
627 * you may not use this file except in compliance with the License.
628 * You may obtain a copy of the License at
629 *
630 *   http://www.apache.org/licenses/LICENSE-2.0
631 *
632 * Unless required by applicable law or agreed to in writing, software
633 * distributed under the License is distributed on an "AS IS" BASIS,
634 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
635 * See the License for the specific language governing permissions and
636 * limitations under the License.
637 */const ZG={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
637d-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Ea=new Wl("app","Firebase",ZG);/**
638 * @license
639 * Copyright 2019 Google LLC
640 *
641 * Licensed under the Apache License, Version 2.0 (the "License");
642 * you may not use this file except in compliance with the License.
643 * You may obtain a copy of the License at
644 *
645 *   http://www.apache.org/licenses/LICENSE-2.0
646 *
647 * Unless required by applicable law or agreed to in writing, software
648 * distributed under the License is distributed on an "AS IS" BASIS,
649 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
650 * See the License for the specific language governing permissions and
651 * limitations under the License.
652 */class JG{constructor(e,n,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Ii("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Ea.create("app-deleted",{appName:this._name})}}/**
653 * @license
654 * Copyright 2019 Google LLC
655 *
656 * Licensed under the Apache License, Version 2.0 (the "License");
657 * you may not use this file except in compliance with the License.
658 * You may obtain a copy of the License at
659 *
660 *   http://www.apache.org/licenses/LICENSE-2.0
661 *
662 * Unless required by applicable law or agreed to in writing, software
663 * distributed under the License is distributed on an "AS IS" BASIS,
664 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
665 * See the License for the specific language governing permissions and
666 * limitations under the License.
667 */const ql=XG;function QD(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r=Object.assign({name:_b,automaticDataCollectionEnabled:!0},e),i=r.name;if(typeof i!="string"||!i)throw Ea.create("bad-app-name",{appName:String(i)});if(n||(n=GD()),!n)throw Ea.create("no-options");const s=Wg.get(i);if(s){if(Da(n,s.options)&&Da(r,s.config))return s;throw Ea.create("duplicate-app",{appName:i})}const o=new oG(i);for(const l of xb.values())o.addComponent(l);const a=new JG(n,r,o);return Wg.set(i,a),a}function ly(t=_b){const e=Wg.get(t);if(!e&&t===_b&&GD())return QD();if(!e)throw Ea.create("no-app",{appName:t});return e}function Kr(t,e,n){var r;let i=(r=YG[t])!==null&&r!==void 0?r:t;n&&(i+=`-${n}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const a=[`Unable to register library "${i}" with version "${e}":`];s&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&a.push("and"),o&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),_o.warn(a.join(" "));return}ns(new Ii(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
668 * @license
669 * Copyright 2021 Google LLC
670 *
671 * Licensed under the Apache License, Version 2.0 (the "License");
672 * you may not use this file except in compliance with the License.
673 * You may obtain a copy of the License at
674 *
675 *   http://www.apache.org/licenses/LICENSE-2.0
676 *
677 * Unless required by applicable law or agreed to in writing, softw
677are
678 * distributed under the License is distributed on an "AS IS" BASIS,
679 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
680 * See the License for the specific language governing permissions and
681 * limitations under the License.
682 */const e$="firebase-heartbeat-database",t$=1,uh="firebase-heartbeat-store";let W_=null;function ZD(){return W_||(W_=YD(e$,t$,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(uh)}catch(n){console.warn(n)}}}}).catch(t=>{throw Ea.create("idb-open",{originalErrorMessage:t.message})})),W_}async function n$(t){try{const n=(await ZD()).transaction(uh),r=await n.objectStore(uh).get(JD(t));return await n.done,r}catch(e){if(e instanceof Ni)_o.warn(e.message);else{const n=Ea.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});_o.warn(n.message)}}}async function WM(t,e){try{const r=(await ZD()).transaction(uh,"readwrite");await r.objectStore(uh).put(e,JD(t)),await r.done}catch(n){if(n instanceof Ni)_o.warn(n.message);else{const r=Ea.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});_o.warn(r.message)}}}function JD(t){return`${t.name}!${t.options.appId}`}/**
683 * @license
684 * Copyright 2021 Google LLC
685 *
686 * Licensed under the Apache License, Version 2.0 (the "License");
687 * you may not use this file except in compliance with the License.
688 * You may obtain a copy of the License at
689 *
690 *   http://www.apache.org/licenses/LICENSE-2.0
691 *
692 * Unless required by applicable law or agreed to in writing, software
693 * distributed under the License is distributed on an "AS IS" BASIS,
694 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
695 * See the License for the specific language governing permissions and
696 * limitations under the License.
697 */const r$=1024,i$=30;class s${constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new a$(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,n;try{const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=qM();if(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s))return;if(this._heartbeatsCache.heartbeats.push({date:s,agent:i}),this._heartbeatsCache.heartbeats.length>i$){const o=l$(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(o,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){_o.warn(r)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=qM(),{heartbeatsToSend:r,unsentEntries:i}=o$(this._heartbeatsCache.heartbeats),s=$g(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(n){return _o.warn(n),""}}}function qM(){return new Date().toISOString().substring(0,10)}function o$(t,e=r$){const n=[];let r=t.slice();for(const i of t){const s=n.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),KM(n)>e){s.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),KM(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class a${constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return pE()?mE().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await n$(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return WM(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return WM(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function KM(t){return $g(JSON.stringify({version:2,heartbeats:t})).length}function l$(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let r=1;r<t.length;r++)t[r].date<n&&(n=t[r].date,e=r);return e}/**
698 * @license
699 * Copyright 2019 Google LLC
700 *
701 * Licensed under the Apache License, Version 2.0 (the "License");
702 * you may not use this file except in compliance with the License.
703 * You may obtain a copy of the License at
704 *
705 *   http://www.apache.org/licenses/LICENSE-2.0
706 *
707 * Unless required by applicable law or agreed to in writing, software
708 * distributed under the License is distributed on an "AS IS" BASIS,
709 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
710 * See the License for the specific language governing permissions and
711 * limitations under the License.
712 */function c$(t){ns(new Ii("platform-logger",e=>new bG(e),"PRIVATE")),ns(new Ii("heartbeat",e=>new s$(e),"PRIVATE")),Kr(yb,GM,t),Kr(yb,GM,"esm2017"),Kr("fire-js","")}c$("");var u$="firebase",d$="11.9.1";/**
713 * @license
714 * Copyright 2020 Google LLC
715 *
716 * Licensed under the Apache License, Version 2.0 (the "License");
717 * you may not use this file except in compliance with the License.
718 * You may obtain a copy of the License at
719 *
720 *   http://www.apache.org/licenses/LICENSE-2.0
721 *
722 * Unless required by applicable law or agreed to in writing, software
723 * distributed under the License is distributed on an "AS IS" BASIS,
724 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
725 * See the License for the specific language governing permissions and
726 * limitations under the License.
727 */Kr(u$,d$,"app");var _s=function(){return _s=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},_s.apply(this,arguments)};function Bh(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function f$(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}function ek(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const h$=ek,tk=new Wl("auth","Firebase",ek());/**
728 * @license
729 * Copyright 2020 Google LLC
730 *
731 * Licensed under the Apache License, Version 2.0 (the "License");
732 * you may not use this file except in compliance with the License.
733 * You may obtain a copy of the License at
734 *
735 *   http://www.apache.org/licenses/LICENSE-2.0
736 *
737 * Unless required by applicable law or agreed to in writing, software
738 * distributed under the License is distributed on an "AS IS" BASIS,
739 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
740 * See the License for the specific language governing permissions and
741 * limitations under the License.
742 */const qg=new ay("@firebase/auth");function p$(t,...e){qg.logLevel<=Nt.WARN&&qg.warn(`Auth (${ql}): ${t}`,...e)}function Hm(t,...e){qg.logLevel<=Nt.ERROR&&qg.error(`Auth (${ql}): ${t}`,...e)}/**
743 * @license
744 * Copyright 2020 Google LLC
745 *
746 * Licensed under the Apache License, Version 2.0 (the "License");
747 * you may not use this file except in compliance with the License.
748 * You may obtain a copy of the License at
749 *
750 *   http://www.apache.org/licenses/LICENSE-2.0
751 *
752 * Unless required by applicable law or agreed to in writing, software
753 * distributed under the License is distributed on an "AS IS" BASIS,
754 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
755 * See the License for the specific language governing permissions and
756 * limitations under the License.
757 */function rs(t,...e){throw vE(t,...e)}function Ts(t,...e){return vE(t,...e)}function nk(t,e,n){const r=Object.assign(Object.assign({},h$()),{[e]:n});return new Wl("auth","Firebase",r).create(e,{appName:t.name})}function Sa(t){return nk(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function vE(t,...e){if(typeof t!="string"){const n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return tk.create(t,...e)}function lt(t,e,...n){if(!t)throw vE(e,...n)}function so(t){const e="INTERNAL ASSERTION FAILED: "+t;throw Hm(e),new Error(e)}function xo(t,e){t||so(e)}/**
758 * @license
759 * Copyright 2020 Google LLC
760 *
761 * Licensed under the Apache License, Version 2.0 (the "License");
762 * you may not use this file except in compliance with the License.
763 * You may obtain a copy of the License at
764 *
765 *   http://www.apache.org/licenses/LICENSE-2.0
766 *
767 * Unless required by applicable law or agreed to in writing, software
768 * distributed under the License is distributed on an "AS IS" BASIS,
769 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
770 * See the License for the specific language governing permissions and
771 * limitations under the License.
772 */function bb(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.href)||""}function m$(){return XM()==="http:"||XM()==="https:"}function XM(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.protocol)||null}/**
773 * @license
774 * Copyright 2020 Google LLC
775 *
776 * Licensed under the Apache License, Version 2.0 (the "License");
777 * you may not use this file except in compliance with the License.
778 * You may obtain a copy of the License at
779 *
780 *   http://www.apache.org/licenses/LICENSE-2.0
781 *
782 * Unless required by applicable law or agreed to in writing, software
783 * distributed under the License is distributed on an "AS IS" BASIS,
784 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
785 * See the License for the specific language governing permissions and
786 * limitations under the License.
787 */function g$(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(m$()||hE()||"connection"in navigator)?navigator.onLine:!0}function v$(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/**
788 * @license
789 * Copyright 2020 Google LLC
790 *
791 * Licensed under the Apache License, Version 2.0 (the "License");
792 * you may not use this file except in compliance with the License.
793 * You may obtain a copy of the License at
794 *
795 *   http://www.apache.org/licenses/LICENSE-2.0
796 *
797 * Unless required by applicable law or agreed to in writing, software
798 * distributed under the License is distributed on an "AS IS" BASIS,
799 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
800 * See the License for the specific language governing permissions and
801 * limitations under the License.
802 */class Vh{constructor(e,n){this.shortDelay=e,this.longDelay=n,xo(n>e,"Short delay should be less than long delay!"),this.isMobile=B7()||H7()}get(){return g$()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
803 * @license
804 * Copyright 2020 Google LLC
805 *
806 * Licensed under the Apache License, Version 2.0 (the "License");
807 * you may not use this file except in compliance with the License.
808 * You may obtain a copy of the License at
809 *
810 *   http://www.apache.org/licenses/LICENSE-2.0
811 *
812 * Unless required by applicable law or agreed to in writing, software
813 * distributed under the License is distributed on an "AS IS" BASIS,
814 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
815 * See the License for the specific language governing permissions and
816 * limitations under the License.
817 */function yE(t,e){xo(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}/**
818 * @license
819 * Copyright 2020 Google LLC
820 *
821 * Licensed under the Apache License, Version 2.0 (the "License");
822 * you may not use this file except in compliance with the License.
823 * You may obtain a copy of the License at
824 *
825 *   http://www.apache.org/licenses/LICENSE-2.0
826 *
827 * Unless required by applicable law or agreed to in writing, software
828 * distributed under the License is distributed on an "AS IS" BASIS,
829 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
830 * See the License for the specific language governing permissions and
831 * limitations under the License.
832 */class rk{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;so("Could not find fetch implementation, make sure you call FetchProvi
832der.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;so("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;so("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
833 * @license
834 * Copyright 2020 Google LLC
835 *
836 * Licensed under the Apache License, Version 2.0 (the "License");
837 * you may not use this file except in compliance with the License.
838 * You may obtain a copy of the License at
839 *
840 *   http://www.apache.org/licenses/LICENSE-2.0
841 *
842 * Unless required by applicable law or agreed to in writing, software
843 * distributed under the License is distributed on an "AS IS" BASIS,
844 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
845 * See the License for the specific language governing permissions and
846 * limitations under the License.
847 */const y$={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",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_REQ_TYPE:"internal-error",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",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",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",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_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
848 * @license
849 * Copyright 2020 Google LLC
850 *
851 * Licensed under the Apache License, Version 2.0 (the "License");
852 * you may not use this file except in compliance with the License.
853 * You may obtain a copy of the License at
854 *
855 *   http://www.apache.org/licenses/LICENSE-2.0
856 *
857 * Unless required by applicable law or agreed to in writing, software
858 * distributed under the License is distributed on an "AS IS" BASIS,
859 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
860 * See the License for the specific language governing permissions and
861 * limitations under the License.
862 */const _$=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],x$=new Vh(3e4,6e4);function Kl(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function Co(t,e,n,r,i={}){return ik(t,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=jh(Object.assign({key:t.config.apiKey},o)).slice(1),l=await t._getAdditionalHeaders();l["Content-Type"]="application/json",t.languageCode&&(l["X-Firebase-Locale"]=t.languageCode);const c=Object.assign({method:e,headers:l},s);return z7()||(c.referrerPolicy="no-referrer"),t.emulatorConfig&&$l(t.emulatorConfig.host)&&(c.credentials="include"),rk.fetch()(await sk(t,t.config.apiHost,n,a),c)})}async function ik(t,e,n){t._canInitEmulator=!1;const r=Object.assign(Object.assign({},y$),e);try{const i=new w$(t),s=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw Vp(t,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[l,c]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw Vp(t,"credential-already-in-use",o);if(l==="EMAIL_EXISTS")throw Vp(t,"email-already-in-use",o);if(l==="USER_DISABLED")throw Vp(t,"user-disabled",o);const d=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw nk(t,d,c);rs(t,d)}}catch(i){if(i instanceof Ni)throw i;rs(t,"network-request-failed",{message:String(i)})}}async function cy(t,e,n,r,i={}){const s=await Co(t,e,n,r,i);return"mfaPendingCredential"in s&&rs(t,"multi-factor-auth-required",{_serverResponse:s}),s}async function sk(t,e,n,r){const i=`${e}${n}?${r}`,s=t,o=s.config.emulator?yE(t.config,i):`${t.config.apiScheme}://${i}`;return _$.includes(n)&&(await s._persistenceManagerAvailable,s._getPersistenceType()==="COOKIE")?s._getPersistence()._getFinalTarget(o).toString():o}function b$(t){switch(t){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class w${clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(Ts(this.auth,"network-request-failed")),x$.get())})}}function Vp(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=Ts(t,e,r);return i.customData._tokenResponse=n,i}function YM(t){return t!==void 0&&t.enterprise!==void 0}class E${constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const n of this.recaptchaEnforcementState)if(n.provider&&n.provider===e)return b$(n.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PRO
862VIDER")}}async function S$(t,e){return Co(t,"GET","/v2/recaptchaConfig",Kl(t,e))}/**
863 * @license
864 * Copyright 2020 Google LLC
865 *
866 * Licensed under the Apache License, Version 2.0 (the "License");
867 * you may not use this file except in compliance with the License.
868 * You may obtain a copy of the License at
869 *
870 *   http://www.apache.org/licenses/LICENSE-2.0
871 *
872 * Unless required by applicable law or agreed to in writing, software
873 * distributed under the License is distributed on an "AS IS" BASIS,
874 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
875 * See the License for the specific language governing permissions and
876 * limitations under the License.
877 */async function T$(t,e){return Co(t,"POST","/v1/accounts:delete",e)}async function Kg(t,e){return Co(t,"POST","/v1/accounts:lookup",e)}/**
878 * @license
879 * Copyright 2020 Google LLC
880 *
881 * Licensed under the Apache License, Version 2.0 (the "License");
882 * you may not use this file except in compliance with the License.
883 * You may obtain a copy of the License at
884 *
885 *   http://www.apache.org/licenses/LICENSE-2.0
886 *
887 * Unless required by applicable law or agreed to in writing, software
888 * distributed under the License is distributed on an "AS IS" BASIS,
889 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
890 * See the License for the specific language governing permissions and
891 * limitations under the License.
892 */function Rf(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function A$(t,e=!1){const n=cn(t),r=await n.getIdToken(e),i=_E(r);lt(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s==null?void 0:s.sign_in_provider;return{claims:i,token:r,authTime:Rf(q_(i.auth_time)),issuedAtTime:Rf(q_(i.iat)),expirationTime:Rf(q_(i.exp)),signInProvider:o||null,signInSecondFactor:(s==null?void 0:s.sign_in_second_factor)||null}}function q_(t){return Number(t)*1e3}function _E(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return Hm("JWT malformed, contained fewer than 3 sections"),null;try{const i=VD(n);return i?JSON.parse(i):(Hm("Failed to decode base64 JWT payload"),null)}catch(i){return Hm("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function QM(t){const e=_E(t);return lt(e,"internal-error"),lt(typeof e.exp<"u","internal-error"),lt(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
893 * @license
894 * Copyright 2020 Google LLC
895 *
896 * Licensed under the Apache License, Version 2.0 (the "License");
897 * you may not use this file except in compliance with the License.
898 * You may obtain a copy of the License at
899 *
900 *   http://www.apache.org/licenses/LICENSE-2.0
901 *
902 * Unless required by applicable law or agreed to in writing, software
903 * distributed under the License is distributed on an "AS IS" BASIS,
904 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
905 * See the License for the specific language governing permissions and
906 * limitations under the License.
907 */async function Cu(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof Ni&&M$(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function M$({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/**
908 * @license
909 * Copyright 2020 Google LLC
910 *
911 * Licensed under the Apache License, Version 2.0 (the "License");
912 * you may not use this file except in compliance with the License.
913 * You may obtain a copy of the License at
914 *
915 *   http://www.apache.org/licenses/LICENSE-2.0
916 *
917 * Unless required by applicable law or agreed to in writing, software
918 * distributed under the License is distributed on an "AS IS" BASIS,
919 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
920 * See the License for the specific language governing permissions and
921 * limitations under the License.
922 */class C${constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var n;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const i=((n=this.user.stsTokenManager.expirationTime)!==null&&n!==void 0?n:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
923 * @license
924 * Copyright 2020 Google LLC
925 *
926 * Licensed under the Apache License, Version 2.0 (the "License");
927 * you may not use this file except in compliance with the License.
928 * You may obtain a copy of the License at
929 *
930 *   http://www.apache.org/licenses/LICENSE-2.0
931 *
932 * Unless required by applicable law or agreed to in writing, software
933 * distributed under the License is distributed on an "AS IS" BASIS,
934 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
935 * See the License for the specific language governing permissions and
936 * limitations under the License.
937 */class wb{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Rf(this.lastLoginAt),this.creationTime=Rf(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
938 * @license
939 * Copyright 2019 Google LLC
940 *
941 * Licensed under the Apache License, Version 2.0 (the "License");
942 * you may not use this file except in compliance with the License.
943 * You may obtain a copy of the License at
944 *
945 *   http://www.apache.org/licenses/LICENSE-2.0
946 *
947 * Unless required by applicable law or agreed to in writing, software
948 * distributed under the License is distributed on an "AS IS" BASIS,
949 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
950 * See the License for the specific language governing permissions and
951 * limitations under the License.
952 */async function Xg(t){var e;const n=t.auth,r=await t.getIdToken(),i=await Cu(t,Kg(n,{idToken:r}));lt(i==null?void 0:i.users.length,n,"internal-error");const s=i.users[0];t._notifyReloadListener(s);const o=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?ok(s.providerUserInfo):[],a=P$(t.providerData,o),l=t.isAnonymous,c=!(t.email&&s.passwordHash)&&!(a!=null&&a.length),d=l?c:!1,f={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:a,metadata:new wb(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(t,f)}async function R$(t){const e=cn(t);await Xg(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function P$(t,e){return[...t.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function ok(t){return t.map(e=>{var{providerId:n}=e,r=Bh(e,["providerId"]);return{providerId:n,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/**
953 * @license
954 * Copyright 2020 Google LLC
955 *
956 * Licensed under the Apache License, Version 2.0 (the "License");
957 * you may not use this file except in compliance with the License.
958 * You may obtain a copy of the License at
959 *
960 *   http://www.apache.org/licenses/LICENSE-2.0
961 *
962 * Unless required by applicable law or agreed to in writing, software
963 * distributed under the License is distributed on an "AS IS" BASIS,
964 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
965 * See the License for the specific language governing permissions and
966 * limitations under the License.
967 */async function I$(t,e){const n=await ik(t,{},async()=>{const r=jh({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=t.config,o=await sk(t,i,"/v1/token",`key=${s}`),a=await t._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const l={method:"POST",headers:a,body:r};return t.emulatorConfig&&$l(t.emulatorConfig.host)&&(l.credentials="include"),rk.fetch()(o,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function N$(t,e){return Co(t,"POST","/v2/accounts:revokeToken",Kl(t,e))}/**
968 * @license
969 * Copyright 2020 Google LLC
970 *
971 * Licensed under the Apache License, Version 2.0 (the "License");
972 * you may not use this file except in compliance with the License.
973 * You may obtain a copy of the License at
974 *
975 *   http://www.apache.org/licenses/LICENSE-2.0
976 *
977 * Unless required by applicable law or agreed to in writing, software
978 * distributed under the License is distributed on an "AS IS" BASIS,
979 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
980 * See the License for the specific language governing permissions and
981 * limitations under the License.
982 */class eu{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){lt(e.idToken,"internal-error"),lt(typeof e.idToken<"u","internal-error"),lt(typeof e.refreshToken<"u","internal-error");
982const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):QM(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){lt(e.length!==0,"internal-error");const n=QM(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(lt(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:i,expiresIn:s}=await I$(e,n);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:i,expirationTime:s}=n,o=new eu;return r&&(lt(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(lt(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(lt(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new eu,this.toJSON())}_performRefresh(){return so("not implemented")}}/**
983 * @license
984 * Copyright 2020 Google LLC
985 *
986 * Licensed under the Apache License, Version 2.0 (the "License");
987 * you may not use this file except in compliance with the License.
988 * You may obtain a copy of the License at
989 *
990 *   http://www.apache.org/licenses/LICENSE-2.0
991 *
992 * Unless required by applicable law or agreed to in writing, software
993 * distributed under the License is distributed on an "AS IS" BASIS,
994 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
995 * See the License for the specific language governing permissions and
996 * limitations under the License.
997 */function Fo(t,e){lt(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class Ki{constructor(e){var{uid:n,auth:r,stsTokenManager:i}=e,s=Bh(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new C$(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new wb(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const n=await Cu(this,this.stsTokenManager.getToken(this.auth,e));return lt(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return A$(this,e)}reload(){return R$(this)}_assign(e){this!==e&&(lt(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>Object.assign({},n)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new Ki(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(e){lt(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await Xg(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Ti(this.auth.app))return Promise.reject(Sa(this.auth));const e=await this.getIdToken();return await Cu(this,T$(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isA
997nonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,n){var r,i,s,o,a,l,c,d;const f=(r=n.displayName)!==null&&r!==void 0?r:void 0,u=(i=n.email)!==null&&i!==void 0?i:void 0,h=(s=n.phoneNumber)!==null&&s!==void 0?s:void 0,g=(o=n.photoURL)!==null&&o!==void 0?o:void 0,v=(a=n.tenantId)!==null&&a!==void 0?a:void 0,m=(l=n._redirectEventId)!==null&&l!==void 0?l:void 0,p=(c=n.createdAt)!==null&&c!==void 0?c:void 0,y=(d=n.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:w,emailVerified:x,isAnonymous:S,providerData:I,stsTokenManager:M}=n;lt(w&&M,e,"internal-error");const E=eu.fromJSON(this.name,M);lt(typeof w=="string",e,"internal-error"),Fo(f,e.name),Fo(u,e.name),lt(typeof x=="boolean",e,"internal-error"),lt(typeof S=="boolean",e,"internal-error"),Fo(h,e.name),Fo(g,e.name),Fo(v,e.name),Fo(m,e.name),Fo(p,e.name),Fo(y,e.name);const C=new Ki({uid:w,auth:e,email:u,emailVerified:x,displayName:f,isAnonymous:S,photoURL:g,phoneNumber:h,tenantId:v,stsTokenManager:E,createdAt:p,lastLoginAt:y});return I&&Array.isArray(I)&&(C.providerData=I.map(T=>Object.assign({},T))),m&&(C._redirectEventId=m),C}static async _fromIdTokenResponse(e,n,r=!1){const i=new eu;i.updateFromServerResponse(n);const s=new Ki({uid:n.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await Xg(s),s}static async _fromGetAccountInfoResponse(e,n,r){const i=n.users[0];lt(i.localId!==void 0,"internal-error");const s=i.providerUserInfo!==void 0?ok(i.providerUserInfo):[],o=!(i.email&&i.passwordHash)&&!(s!=null&&s.length),a=new eu;a.updateFromIdToken(r);const l=new Ki({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:o}),c={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new wb(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(s!=null&&s.length)};return Object.assign(l,c),l}}/**
998 * @license
999 * Copyright 2020 Google LLC
1000 *
1001 * Licensed under the Apache License, Version 2.0 (the "License");
1002 * you may not use this file except in compliance with the License.
1003 * You may obtain a copy of the License at
1004 *
1005 *   http://www.apache.org/licenses/LICENSE-2.0
1006 *
1007 * Unless required by applicable law or agreed to in writing, software
1008 * distributed under the License is distributed on an "AS IS" BASIS,
1009 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010 * See the License for the specific language governing permissions and
1011 * limitations under the License.
1012 */const ZM=new Map;function oo(t){xo(t instanceof Function,"Expected a class definition");let e=ZM.get(t);return e?(xo(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,ZM.set(t,e),e)}/**
1013 * @license
1014 * Copyright 2019 Google LLC
1015 *
1016 * Licensed under the Apache License, Version 2.0 (the "License");
1017 * you may not use this file except in compliance with the License.
1018 * You may obtain a copy of the License at
1019 *
1020 *   http://www.apache.org/licenses/LICENSE-2.0
1021 *
1022 * Unless required by applicable law or agreed to in writing, software
1023 * distributed under the License is distributed on an "AS IS" BASIS,
1024 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1025 * See the License for the specific language governing permissions and
1026 * limitations under the License.
1027 */class ak{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}ak.type="NONE";const JM=ak;/**
1028 * @license
1029 * Copyright 2019 Google LLC
1030 *
1031 * Licensed under the Apache License, Version 2.0 (the "License");
1032 * you may not use this file except in compliance with the License.
1033 * You may obtain a copy of the License at
1034 *
1035 *   http://www.apache.org/licenses/LICENSE-2.0
1036 *
1037 * Unless required by applicable law or agreed to in writing, software
1038 * distributed under the License is distributed on an "AS IS" BASIS,
1039 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1040 * See the License for the specific language governing permissions and
1041 * limitations under the License.
1042 */function Gm(t,e,n){return`firebase:${t}:${e}:${n}`}class tu{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=Gm(this.userKey,i.apiKey,s),this.fullPersistenceKey=Gm("persistence",i.apiKey,s),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){const n=await Kg(this.auth,{idToken:e}).catch(()=>{});return n?Ki._fromGetAccountInfoResponse(this.auth,n,e):null}return Ki._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new tu(oo(JM),e,r);const i=(await Promise.all(n.map(async c=>{if(await c._isAvailable())return c}))).filter(c=>c);let s=i[0]||oo(JM);const o=Gm(r,e.config.apiKey,e.name);let a=null;for(const c of n)try{const d=await c._get(o);if(d){let f;if(typeof d=="string"){const u=await Kg(e,{idToken:d}).catch(()=>{});if(!u)break;f=await Ki._fromGetAccountInfoResponse(e,u,d)}else f=Ki._fromJSON(e,d);c!==s&&(a=f),s=c;break}}catch{}const l=i.filter(c=>c._shouldAllowMigration);return!s._shouldAllowMigration||!l.length?new tu(s,e,r):(s=l[0],a&&await s._set(o,a.toJSON()),await Promise.all(n.map(async c=>{if(c!==s)try{await c._remove(o)}catch{}})),new tu(s,e,r))}}/**
1043 * @license
1044 * Copyright 2020 Google LLC
1045 *
1046 * Licensed under the Apache License, Version 2.0 (the "License");
1047 * you may not use this file except in compliance with the License.
1048 * You may obtain a copy of the License at
1049 *
1050 *   http://www.apache.org/licenses/LICENSE-2.0
1051 *
1052 * Unless required by applicable law or agreed to in writing, software
1053 * distributed under the License is distributed on an "AS IS" BASIS,
1054 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1055 * See the License for the specific language governing permissions and
1056 * limitations under the License.
1057 */function eC(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(dk(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(lk(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(hk(e))return"Blackberry";if(pk(e))return"Webos";if(ck(e))return"Safari";if((e.includes("chrome/")||uk(e))&&!e.includes("edge/"))return"Chrome";if(fk(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function lk(t=xr()){return/firefox\//i.test(t)}function ck(t=xr()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function uk(t=xr()){return/crios\//i.test(t)}function dk(t=xr()){return/iemobile/i.test(t)}function fk(t=xr()){return/android/i.test(t)}function hk(t=xr()){return/blackberry/i.test(t)}function pk(t=xr()){return/webos/i.test(t)}function xE(t=xr()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function O$(t=xr()){var e;return xE(t)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function D$(){return G7()&&document.documentMode===10}function mk(t=xr()){return xE(t)||fk(t)||pk(t)||hk(t)||/windows phone/i.test(t)||dk(t)}/**
1058 * @license
1059 * Copyright 2020 Google LLC
1060 *
1061 * Licensed under the Apache License, Version 2.0 (the "License");
1062 * you may not use this file except in compliance with the License.
1063 * You may obtain a copy of the License at
1064 *
1065 *   http://www.apache.org/licenses/LICENSE-2.0
1066 *
1067 * Unless required by applicable law or agreed to in writing, software
1068 * distributed under the License is distributed on an "AS IS" BASIS,
1069 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1070 * See the License for the specific language governing permissions and
1071 * limitations under the License.
1072 */function gk(t,e=[]){let n;switch(t){case"Browser":n=eC(xr());break;case"Worker":n=`${eC(xr())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${ql}/${r}`}/**
1073 * @license
1074 * Copyright 2022 Google LLC
1075 *
1076 * Licensed under the Apache License, Version 2.0 (the "License");
1077 * you may not use this file except in compliance with the License.
1078 * You may obtain a copy of the License at
1079 *
1080 *   http://www.apache.org/licenses/LICENSE-2.0
1081 *
1082 * Unless required by applicable law or agreed to in writing, software
1083 * distributed under the License is distributed on an "AS IS" BASIS,
1084 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1085 * See the License for the specific language governing permissions and
1086 * limitations under the License.
1087 */class k${constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=s=>new Promise((o,a)=>{try{const l=e(s);o(l)}catch(l){a(l)}});r.onAbort=n,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const i of n)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/**
1088 * @license
1089 * Copyright 2023 Google LLC
1090 *
1091 * Licensed under the Apache License, Version 2.0 (the "License");
1092 * you may not use this file except in compliance with the License.
1093 * You may obtain a copy of the License at
1094 *
1095 *   http://www.apache.org/licenses/LICENSE-2.0
1096 *
1097 * Unless required by applicable law or agreed to in writing, software
1098 * distributed under the License is distributed on an "AS IS" BASIS,
1099 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1100 * See the License for the specific language governing permissions and
1101 * limitations under the License.
1102 */async function L$(t,e={}){return Co(t,"GET","/v2/passwordPolicy",Kl(t,e))}/**
1103 * @license
1104 * Copyright 2023 Google LLC
1105 *
1106 * Licensed under the Apache License, Version 2.0 (the "License");
1107 * you may not use this file except in compliance with the License.
1108 * You may obtain a copy of the License at
1109 *
1110 *   http://www.apache.org/licenses/LICENSE-2.0
1111 *
1112 * Unless required by applicable law or agreed to in writing, software
1113 * distributed under the License is distributed on an "AS IS" BASIS,
1114 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1115 * See the License for the specific language governing permissions and
1116 * limitations under the License.
1117 */const F$=6;class U${constructor(e){var n,r,i,s;const o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(n=o.minPasswordLength)!==null&&n!==void 0?n:F$,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),o.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),o.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),o.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),o.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(r=e.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(s=e.forceUpgradeOnSignin)!==null&&s!==void 0?s:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var n,r,i,s,o,a;const l={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,l),this.validatePasswordCharacterOptions(e,l),l.isValid&&
1117(l.isValid=(n=l.meetsMinPasswordLength)!==null&&n!==void 0?n:!0),l.isValid&&(l.isValid=(r=l.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),l.isValid&&(l.isValid=(i=l.containsLowercaseLetter)!==null&&i!==void 0?i:!0),l.isValid&&(l.isValid=(s=l.containsUppercaseLetter)!==null&&s!==void 0?s:!0),l.isValid&&(l.isValid=(o=l.containsNumericCharacter)!==null&&o!==void 0?o:!0),l.isValid&&(l.isValid=(a=l.containsNonAlphanumericCharacter)!==null&&a!==void 0?a:!0),l}validatePasswordLengthOptions(e,n){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),i&&(n.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let i=0;i<e.length;i++)r=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}}/**
1118 * @license
1119 * Copyright 2020 Google LLC
1120 *
1121 * Licensed under the Apache License, Version 2.0 (the "License");
1122 * you may not use this file except in compliance with the License.
1123 * You may obtain a copy of the License at
1124 *
1125 *   http://www.apache.org/licenses/LICENSE-2.0
1126 *
1127 * Unless required by applicable law or agreed to in writing, software
1128 * distributed under the License is distributed on an "AS IS" BASIS,
1129 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1130 * See the License for the specific language governing permissions and
1131 * limitations under the License.
1132 */class j${constructor(e,n,r,i){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new tC(this),this.idTokenSubscription=new tC(this),this.beforeStateQueue=new k$(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=tk,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(s=>this._resolvePersistenceManagerAvailable=s)}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=oo(n)),this._initializationPromise=this.queue(async()=>{var r,i,s;if(!this._deleted&&(this.persistenceManager=await tu.create(this,e),(r=this._resolvePersistenceManagerAvailable)===null||r===void 0||r.call(this),!this._deleted)){if(!((i=this._popupRedirectResolver)===null||i===void 0)&&i._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((s=this.currentUser)===null||s===void 0?void 0:s.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const n=await Kg(this,{idToken:e}),r=await Ki._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var n;if(Ti(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(a,a))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let i=r,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,a=i==null?void 0:i._redirectEventId,l=await this.tryRedirectSignIn(e);(!o||o===a)&&(l!=null&&l.user)&&(i=l.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);
1132if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return lt(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await Xg(e)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=v$()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Ti(this.app))return Promise.reject(Sa(this));const n=e?cn(e):null;return n&&lt(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&lt(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Ti(this.app)?Promise.reject(Sa(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Ti(this.app)?Promise.reject(Sa(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(oo(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await L$(this),n=new U$(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new Wl("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await N$(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&oo(e)||this._popupRedirectResolver;lt(n,this,"argument-error"),this.redirectPersistenceManager=await tu.create(this,[oo(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(n=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,i){if(this._deleted)return()=>{};const s=typeof n=="function"?n:n.next.bind(n);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(lt(a,this,"internal-error"),a.then(()=>{o||s(this.currentUser)}),typeof n=="function"){const l=e.addObserver(n,r,i);return()=>{o=!0,l()}}else{const l=e.addObserver(n);return()=>{o=!0,l()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return lt(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=gk(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());r&&(n["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(n["X-Firebase-AppCheck"]=i),n}async _getAppCheckToken(){var e;if(Ti(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const n=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return n!=null&&n.error&&p$(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function td(t){return cn(t)}class tC{constructor(e){this.auth=e,this.observer=null,this.addObserver=Y7(n=>this.observer=n)}get next(){return lt(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
1133 * @license
1134 * Copyright 2020 Google LLC
1135 *
1136 * Licensed under the Apache License, Version 2.0 (the "License");
1137 * you may not use this file except in compliance with the License.
1138 * You may obtain a copy of the License at
1139 *
1140 *   http://www.apache.org/licenses/LICENSE-2.0
1141 *
1142 * Unless required by applicable law or agreed to in writing, software
1143 * distributed under the License is distributed on an "AS IS" BASIS,
1144 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1145 * See the License for the specific language governing permissions and
1146 * limitations under the License.
1147 */let uy={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function B$(t){uy=t}function vk(t){return uy.loadJS(t)}function V$(){return uy.recaptchaEnterpriseScript}function z$(){return uy.gapiScript}function H$(t){return`__${t}${Math.floor(Math.random()*1e6)}`}class G${constructor(){this.enterprise=new $$}ready(e){e()}execute(e,n){return Promise.resolve("token")}render(e,n){return""}}class $${ready(e){e()}execute(e,n){return Promise.resolve("token")}render(e,n){return""}}const W$="recaptcha-enterprise",yk="NO_RECAPTCHA";class q${constructor(e){this.type=W$,this.auth=td(e)}async verify(e="verify",n=!1){async function r(s){if(!n){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(o,a)=>{S$(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(l=>{if(l.recaptchaKey===void 0)a(new Error("recaptcha Enterprise site key undefined"));else{const c=new E$(l);return s.tenantId==null?s._agentRecaptchaConfig=c:s._tenantRecaptchaConfigs[s.tenantId]=c,o(c.siteKey)}}).catch(l=>{a(l)})})}function i(s,o,a){const l=window.grecaptcha;YM(l)?l.enterprise.ready(()=>{l.enterprise.execute(s,{action:e}).then(c=>{o(c)}).catch(()=>{o(yk)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new G$().execute("siteKey",{action:"verify"}):new Promise((s,o)=>{r(this.auth).then(a=>{if(!n&&YM(window.grecaptcha))i(a,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let l=V$();l.length!==0&&(l+=a),vk(l).then(()=>{i(a,s,o)}).catch(c=>{o(c)})}}).catch(a=>{o(a)})})}}async function nC(t,e,n,r=!1,i=!1){const s=new q$(t);let o;if(i)o=yk;else try{o=await s.verify(n)}catch{o=await s.verify(n,!0)}const a=Object.assign({},e);if(n==="mfaSmsEnrollment"||n==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in a){const l=a.phoneEnrollmentInfo.phoneNumber,c=a.phoneEnrollmentInfo.recaptchaToken;Object.assign(a,{phoneEnrollmentInfo:{phoneNumber:l,recaptchaToken:c,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in a){const l=a.phoneSignInInfo.recaptchaToken;Object.assign(a,{phoneSignInInfo:{recaptchaToken:l,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return a}return r?Object.assign(a,{captchaResp:o}):Object.assign(a,{captchaResponse:o}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}async function rC(t,e,n,r,i){var s;if(!((s=t._getRecaptchaConfig())===null||s===void 0)&&s.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const o=await nC(t,e,n,n==="getOobCode");return r(t,o)}else return r(t,e).catch(async o=>{if(o.code==="auth/missing-recaptcha-token"){console.log(`${n} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const a=await nC(t,e,n,n==="getOobCode");return r(t,a)}else return Promise.reject(o)})}/**
1148 * @license
1149 * Copyright 2020 Google LLC
1150 *
1151 * Licensed under the Apache License, Version 2.0 (the "License");
1152 * you may not use this file except in compliance with the License.
1153 * You may obtain a copy of the License at
1154 *
1155 *   http://www.apache.org/licenses/LICENSE-2.0
1156 *
1157 * Unless required by applicable law or agreed to in writing, software
1158 * distributed under the License is distributed on an "AS IS" BASIS,
1159 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1160 * See the License for the specific language governing permissions and
1161 * limitations under the License.
1162 */function K$(t,e){const n=Ka(t,"auth");if(n.isInitialized()){const i=n.getImmediate(),s=n.getOptions();if(Da(s,e??{}))return i;rs(i,"already-initialized")}return n.initialize({options:e})}
1162function X$(t,e){const n=(e==null?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map(oo);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function Y$(t,e,n){const r=td(t);lt(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!1,s=_k(e),{host:o,port:a}=Q$(e),l=a===null?"":`:${a}`,c={url:`${s}//${o}${l}/`},d=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})});if(!r._canInitEmulator){lt(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),lt(Da(c,r.config.emulator)&&Da(d,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=c,r.emulatorConfig=d,r.settings.appVerificationDisabledForTesting=!0,$l(o)?(dE(`${s}//${o}${l}`),fE("Auth",!0)):Z$()}function _k(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function Q$(t){const e=_k(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:iC(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:iC(o)}}}function iC(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function Z$(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}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."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}/**
1163 * @license
1164 * Copyright 2020 Google LLC
1165 *
1166 * Licensed under the Apache License, Version 2.0 (the "License");
1167 * you may not use this file except in compliance with the License.
1168 * You may obtain a copy of the License at
1169 *
1170 *   http://www.apache.org/licenses/LICENSE-2.0
1171 *
1172 * Unless required by applicable law or agreed to in writing, software
1173 * distributed under the License is distributed on an "AS IS" BASIS,
1174 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1175 * See the License for the specific language governing permissions and
1176 * limitations under the License.
1177 */class bE{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return so("not implemented")}_getIdTokenResponse(e){return so("not implemented")}_linkToIdToken(e,n){return so("not implemented")}_getReauthenticationResolver(e){return so("not implemented")}}async function J$(t,e){return Co(t,"POST","/v1/accounts:update",e)}async function eW(t,e){return Co(t,"POST","/v1/accounts:signUp",e)}/**
1178 * @license
1179 * Copyright 2020 Google LLC
1180 *
1181 * Licensed under the Apache License, Version 2.0 (the "License");
1182 * you may not use this file except in compliance with the License.
1183 * You may obtain a copy of the License at
1184 *
1185 *   http://www.apache.org/licenses/LICENSE-2.0
1186 *
1187 * Unless required by applicable law or agreed to in writing, software
1188 * distributed under the License is distributed on an "AS IS" BASIS,
1189 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1190 * See the License for the specific language governing permissions and
1191 * limitations under the License.
1192 */async function tW(t,e){return cy(t,"POST","/v1/accounts:signInWithPassword",Kl(t,e))}/**
1193 * @license
1194 * Copyright 2020 Google LLC
1195 *
1196 * Licensed under the Apache License, Version 2.0 (the "License");
1197 * you may not use this file except in compliance with the License.
1198 * You may obtain a copy of the License at
1199 *
1200 *   http://www.apache.org/licenses/LICENSE-2.0
1201 *
1202 * Unless required by applicable law or agreed to in writing, software
1203 * distributed under the License is distributed on an "AS IS" BASIS,
1204 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1205 * See the License for the specific language governing permissions and
1206 * limitations under the License.
1207 */async function nW(t,e){return cy(t,"POST","/v1/accounts:signInWithEmailLink",Kl(t,e))}async function rW(t,e){return cy(t,"POST","/v1/accounts:signInWithEmailLink",Kl(t,e))}/**
1208 * @license
1209 * Copyright 2020 Google LLC
1210 *
1211 * Licensed under the Apache License, Version 2.0 (the "License");
1212 * you may not use this file except in compliance with the License.
1213 * You may obtain a copy of the License at
1214 *
1215 *   http://www.apache.org/licenses/LICENSE-2.0
1216 *
1217 * Unless required by applicable law or agreed to in writing, software
1218 * distributed under the License is distributed on an "AS IS" BASIS,
1219 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1220 * See the License for the specific language governing permissions and
1221 * limitations under the License.
1222 */class dh extends bE{constructor(e,n,r,i=null){super("password",r),this._email=e,this._password=n,this._tenantId=i}static _fromEmailAndPassword(e,n){return new dh(e,n,"password")}static _fromEmailAndCode(e,n,r=null){return new dh(e,n,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e;if(n!=null&&n.email&&(n!=null&&n.password)){if(n.signInMethod==="password")return this._fromEmailAndPassword(n.email,n.password);if(n.signInMethod==="emailLink")return this._fromEmailAndCode(n.email,n.password,n.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return rC(e,n,"signInWithPassword",tW);case"emailLink":return nW(e,{email:this._email,oobCode:this._password});default:rs(e,"internal-error")}}async _linkToIdToken(e,n){switch(this.signInMethod){case"password":const r={idToken:n,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return rC(e,r,"signUpPassword",eW);case"emailLink":return rW(e,{idToken:n,email:this._email,oobCode:this._password});default:rs(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
1223 * @license
1224 * Copyright 2020 Google LLC
1225 *
1226 * Licensed under the Apache License, Version 2.0 (the "License");
1227 * you may not use this file except in compliance with the License.
1228 * You may obtain a copy of the License at
1229 *
1230 *   http://www.apache.org/licenses/LICENSE-2.0
1231 *
1232 * Unless required by applicable law or agreed to in writing, software
1233 * distributed under the License is distributed on an "AS IS" BASIS,
1234 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1235 * See the License for the specific language governing permissions and
1236 * limitations under the License.
1237 */async function nu(t,e){return cy(t,"POST","/v1/accounts:signInWithIdp",Kl(t,e))}/**
1238 * @license
1239 * Copyright 2020 Google LLC
1240 *
1241 * Licensed under the Apache License, Version 2.0 (the "License");
1242 * you may not use this file except in compliance with the License.
1243 * You may obtain a copy of the License at
1244 *
1245 *   http://www.apache.org/licenses/LICENSE-2.0
1246 *
1247 * Unless required by applicable law or agreed to in writing, software
1248 * distributed under the License is distributed on an "AS IS" BASIS,
1249 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1250 * See the License for the specific language governing permissions and
1251 * limitations under the License.
1252 */const iW="http://localhost";class kl extends bE{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new kl(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):rs("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
1252once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=n,s=Bh(n,["providerId","signInMethod"]);if(!r||!i)return null;const o=new kl(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const n=this.buildRequest();return nu(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,nu(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,nu(e,n)}buildRequest(){const e={requestUri:iW,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=jh(n)}return e}}/**
1253 * @license
1254 * Copyright 2020 Google LLC
1255 *
1256 * Licensed under the Apache License, Version 2.0 (the "License");
1257 * you may not use this file except in compliance with the License.
1258 * You may obtain a copy of the License at
1259 *
1260 *   http://www.apache.org/licenses/LICENSE-2.0
1261 *
1262 * Unless required by applicable law or agreed to in writing, software
1263 * distributed under the License is distributed on an "AS IS" BASIS,
1264 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1265 * See the License for the specific language governing permissions and
1266 * limitations under the License.
1267 */function sW(t){switch(t){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function oW(t){const e=Zd(Jd(t)).link,n=e?Zd(Jd(e)).deep_link_id:null,r=Zd(Jd(t)).deep_link_id;return(r?Zd(Jd(r)).link:null)||r||n||e||t}class wE{constructor(e){var n,r,i,s,o,a;const l=Zd(Jd(e)),c=(n=l.apiKey)!==null&&n!==void 0?n:null,d=(r=l.oobCode)!==null&&r!==void 0?r:null,f=sW((i=l.mode)!==null&&i!==void 0?i:null);lt(c&&d&&f,"argument-error"),this.apiKey=c,this.operation=f,this.code=d,this.continueUrl=(s=l.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(o=l.lang)!==null&&o!==void 0?o:null,this.tenantId=(a=l.tenantId)!==null&&a!==void 0?a:null}static parseLink(e){const n=oW(e);try{return new wE(n)}catch{return null}}}/**
1268 * @license
1269 * Copyright 2020 Google LLC
1270 *
1271 * Licensed under the Apache License, Version 2.0 (the "License");
1272 * you may not use this file except in compliance with the License.
1273 * You may obtain a copy of the License at
1274 *
1275 *   http://www.apache.org/licenses/LICENSE-2.0
1276 *
1277 * Unless required by applicable law or agreed to in writing, software
1278 * distributed under the License is distributed on an "AS IS" BASIS,
1279 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1280 * See the License for the specific language governing permissions and
1281 * limitations under the License.
1282 */class Xl{constructor(){this.providerId=Xl.PROVIDER_ID}static credential(e,n){return dh._fromEmailAndPassword(e,n)}static credentialWithLink(e,n){const r=wE.parseLink(n);return lt(r,"argument-error"),dh._fromEmailAndCode(e,r.code,r.tenantId)}}Xl.PROVIDER_ID="password";Xl.EMAIL_PASSWORD_SIGN_IN_METHOD="password";Xl.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
1283 * @license
1284 * Copyright 2020 Google LLC
1285 *
1286 * Licensed under the Apache License, Version 2.0 (the "License");
1287 * you may not use this file except in compliance with the License.
1288 * You may obtain a copy of the License at
1289 *
1290 *   http://www.apache.org/licenses/LICENSE-2.0
1291 *
1292 * Unless required by applicable law or agreed to in writing, software
1293 * distributed under the License is distributed on an "AS IS" BASIS,
1294 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1295 * See the License for the specific language governing permissions and
1296 * limitations under the License.
1297 */class xk{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/**
1298 * @license
1299 * Copyright 2019 Google LLC
1300 *
1301 * Licensed under the Apache License, Version 2.0 (the "License");
1302 * you may not use this file except in compliance with the License.
1303 * You may obtain a copy of the License at
1304 *
1305 *   http://www.apache.org/licenses/LICENSE-2.0
1306 *
1307 * Unless required by applicable law or agreed to in writing, software
1308 * distributed under the License is distributed on an "AS IS" BASIS,
1309 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1310 * See the License for the specific language governing permissions and
1311 * limitations under the License.
1312 */class zh extends xk{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
1313 * @license
1314 * Copyright 2020 Google LLC
1315 *
1316 * Licensed under the Apache License, Version 2.0 (the "License");
1317 * you may not use this file except in compliance with the License.
1318 * You may obtain a copy of the License at
1319 *
1320 *   http://www.apache.org/licenses/LICENSE-2.0
1321 *
1322 * Unless required by applicable law or agreed to in writing, software
1323 * distributed under the License is distributed on an "AS IS" BASIS,
1324 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1325 * See the License for the specific language governing permissions and
1326 * limitations under the License.
1327 */class Qo extends zh{constructor(){super("facebook.com")}static credential(e){return kl._fromParams({providerId:Qo.PROVIDER_ID,signInMethod:Qo.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Qo.credentialFromTaggedObject(e)}static credentialFromError(e){return Qo.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Qo.credential(e.oauthAccessToken)}catch{return null}}}Qo.FACEBOOK_SIGN_IN_METHOD="facebook.com";Qo.PROVIDER_ID="facebook.com";/**
1328 * @license
1329 * Copyright 2020 Google LLC
1330 *
1331 * Licensed under the Apache License, Version 2.0 (the "License");
1332 * you may not use this file except in compliance with the License.
1333 * You may obtain a copy of the License at
1334 *
1335 *   http://www.apache.org/licenses/LICENSE-2.0
1336 *
1337 * Unless required by applicable law or agreed to in writing, software
1338 * distributed under the License is distributed on an "AS IS" BASIS,
1339 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1340 * See the License for the specific language governing permissions and
1341 * limitations under the License.
1342 */class Zo extends zh{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return kl._fromParams({providerId:Zo.PROVIDER_ID,signInMethod:Zo.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return Zo.credentialFromTaggedObject(e)}static credentialFromError(e){return Zo.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return Zo.credential(n,r)}catch{return null}}}Zo.GOOGLE_SIGN_IN_METHOD="google.com";Zo.PROVIDER_ID="google.com";/**
1343 * @license
1344 * Copyright 2020 Google LLC
1345 *
1346 * Licensed under the Apache License, Version 2.0 (the "License");
1347 * you may not use this file except in compliance with the License.
1348 * You may obtain a copy of the License at
1349 *
1350 *   http://www.apache.org/licenses/LICENSE-2.0
1351 *
1352 * Unless required by applicable law or agreed to in writing, software
1353 * distributed under the License is distributed on an "AS IS" BASIS,
1354 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1355 * See the License for the specific language governing permissions and
1356 * limitations under the License.
1357 */class Jo extends zh{constructor(){super("github.com")}static credential(e){return kl._fromParams({providerId:Jo.PROVIDER_ID,signInMethod:Jo.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Jo.credentialFromTaggedObject(e)}static credentialFromError(e){return Jo.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Jo.credential(e.oauthAccessToken)}catch{return null}}}Jo.GITHUB_SIGN_IN_METHOD="github.com";Jo.PROVIDER_ID="github.com";/**
1358 * @license
1359 * Copyright 2020 Google LLC
1360 *
1361 * Licensed under the Apache License, Version 2.0 (the "License");
1362 * you may not use this file except in compliance with the License.
1363 * You may obtain a copy of the License at
1364 *
1365 *   http://www.apache.org/licenses/LICENSE-2.0
1366 *
1367 * Unless required by applicable law or agreed to in writing, software
1368 * distributed under the License is distributed on an "AS IS" BASIS,
1369 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1370 * See the License for the specific language governing permissions and
1371 * limitations under the License.
1372 */class ea extends zh{constructor(){super("twitter.com")}static credential(e,n){return kl._fromParams({providerId:ea.PROVIDER_ID,signInMethod:ea.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return ea.credentialFromTaggedObject(e)}static credentialFromError(e){return ea.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return ea.credential(n,r)}catch{return null}}}ea.TWITTER_SIGN_IN_METHOD="twitter.com";ea.PROVIDER_ID="twitter.com";/**
1373 * @license
1374 * Copyright 2020 Google LLC
1375 *
1376 * Licensed under the Apache License, Version 2.0 (the "License");
1377 * you may not use this file except in compliance with the License.
1378 * You may obtain a copy of the License at
1379 *
1380 *   http://www.apache.org/licenses/LICENSE-2.0
1381 *
1382 * Unless required by applicable law or agreed to in writing, software
1383 * distributed under the License is distributed on an "AS IS" BASIS,
1384 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1385 * See the License for the specific language governing permissions and
1386 * limitations under the License.
1387 */class Ru{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,i=!1){const s=await Ki._fromIdTokenResponse(e,r,i),o=sC(r);return new Ru({user:s,providerId:o,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const i=sC(r);return new Ru({user:e,providerId:i,_tokenResponse:r,operationType:n})}}function sC(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/**
1388 * @license
1389 * Copyright 2020 Google LLC
1390 *
1391 * Licensed under the Apache License, Version 2.0 (the "License");
1392 * you may not use this file except in compliance with the License.
1393 * You may obtain a copy of the License at
1394 *
1395 *   http://www.apache.org/licenses/LICENSE-2.0
1396 *
1397 * Unless required by applicable law or agreed to in writing, software
1398 * distributed under the License is distributed on an "AS IS" BASIS,
1399 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1400 * See the License for the specific language governing permissions and
1401 * limitations under the License.
1402 */class Yg extends Ni{constructor(e,n,r,i){var s;super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,Yg.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,i){return new Yg(e,n,r,i)}}function bk(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?Yg._fromErrorAndOperation(t,s,e,r):s})}async function aW(t,e,n=!1){const r=await Cu(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return Ru._forOperation(t,"link",r)}/**
1403 * @license
1404 * Copyright 2019 Google LLC
1405 *
1406 * Licensed under the Apache License, Version 2.0 (the "License");
1407 * you may not use this file except in compliance with the License.
1408 * You may obtain a copy of the License at
1409 *
1410 *   http://www.apache.org/licenses/LICENSE-2.0
1411 *
1412 * Unless required by applicable law or agreed to in writing, software
1413 * distributed under the License is distributed on an "AS IS" BASIS,
1414 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1415 * See the License for the specific language governing permissions and
1416 * limitations under the License.
1417 */async function wk(t,e,n=!1){const{auth:r}=t;if(Ti(r.app))return Promise.reject(Sa(r));const i="reauthenticate";try{const s=await Cu(t,bk(r,i,e,t),n);lt(s.idToken,r,"internal-error");const o=_E(s.idToken);lt(o,r,"internal-error");const{sub:a}=o;return lt(t.uid===a,r,"user-mismatch"),Ru._forOperation(t,i,s)}catch(s){throw(s==null?void 0:s.code)==="auth/user-not-found"&&rs(r,"user-mismatch"),s}}/**
1418 * @license
1419 * Copyright 2020 Google LLC
1420 *
1421 * Licensed under the Apache License, Version 2.0 (the "License");
1422 * you may not use this file except in compliance with the License.
1423 * You may obtain a copy of the License at
1424 *
1425 *   http://www.apache.org/licenses/LICENSE-2.0
1426 *
1427 * Unless required by applicable law or agreed to in writing, software
1428 * distributed under the License is distributed on an "AS IS" BASIS,
1429 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1430 * See the License for the specific language governing permissions and
1431 * limitations under the License.
1432 */async function Ek(t,e,n=!1){if(Ti(t.app))return Promise.reject(Sa(t));const r="signIn",i=await bk(t,r,e),s=await Ru._fromIdTokenResponse(t,r,i);return n||await t._updateCurrentUser(s.user),s}async function lW(t,e){return Ek(td(t),e)}async function cW(t,e){return wk(cn(t),e)}/**
1433 * @license
1434 * Copyright 2020 Google LLC
1435 *
1436 * Licensed under the Apache License, Version 2.0 (the "License");
1437 * you may not use this file except in compliance with the License.
1438 * You may obtain a copy of the License at
1439 *
1440 *   http://www.apache.org/licenses/LICENSE-2.0
1441 *
1442 * Unless required by applicable law or agreed to in writing, software
1443 * distributed under the License is distributed on an "AS IS" BASIS,
1444 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1445 * See the License for the specific language governing permissions and
1446 * limitations under the License.
1447 */async function uW(t){const e=td(t);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}function dW(t,e,n){return Ti(t.app)?Promise.reject(Sa(t)):lW(cn(t),Xl.credential(e,n)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&uW(t),r})}function fW(t,e){return hW(cn(t),null,e)}async function hW(t,e,n){const{auth:r}=t,s={idToken:await t.getIdToken(),returnSecureToken:!0};n&&(s.password=n);const o=await Cu(t,J$(r,s));await t._updateTokensIfNecessary(o,!0)}function pW(t,e,n,r){return cn(t).onIdTokenChanged(e,n,r)}function mW(t,e,n){return cn(t).beforeAuthStateChanged(e,n)}function Sk(t,e,n,r){return cn(t).onAuthStateChanged(e,n,r)}function gW(t){return cn(t).signOut()}const Qg="__sak";/**
1448 * @license
1449 * Copyright 2019 Google LLC
1450 *
1451 * Licensed under the Apache License, Version 2.0 (the "License");
1452 * you may not use this file except in compliance with the License.
1453 * You may obtain a copy of the License at
1454 *
1455 *   http://www.apache.org/licenses/LICENSE-2.0
1456 *
1457 * Unless required by applicable law or agreed to in writing, software
1458 * distributed under the License is distributed on an "AS IS" BASIS,
1459 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1460 * See the License for the specific language governing permissions and
1461 * limitations under the License.
1462 */class Tk{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Qg,"1"),this.storage.removeItem(Qg),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1463 * @license
1464 * Copyright 2020 Google LLC
1465 *
1466 * Licensed under the Apache License, Version 2.0 (the "License");
1467 * you may not use this file except in compliance with the License.
1468 * You may obtain a copy of the License at
1469 *
1470 *   http://www.apache.org/licenses/LICENSE-2.0
1471 *
1472 * Unless required by applicable law or agreed to in writing, software
1473 * distributed under the License is distributed on an "AS IS" BASIS,
1474 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1475 * See the License for the specific language governing permissions and
1476 * limitations under the License.
1477 */const vW=1e3,yW=10;class Ak extends Tk{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=mk(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),i=this.localCache[n];r!==i&&e(n,i,r)}}
vendor: 1,262 bytes, line 1477
1477onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((o,a,l)=>{this.notifyListeners(o,l)});return}const r=e.key;n?this.detachListener():this.stopPolling();const i=()=>{const o=this.storage.getItem(r);!n&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);D$()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,yW):i()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},vW)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
1477ject.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}Ak.type="LOCAL";const _W=Ak;/**
1478 * @license
1479 * Copyright 2020 Google LLC
1480 *
1481 * Licensed under the Apache License, Version 2.0 (the "License");
1482 * you may not use this file except in compliance with the License.
1483 * You may obtain a copy of the License at
1484 *
1485 *   http://www.apache.org/licenses/LICENSE-2.0
1486 *
1487 * Unless required by applicable law or agreed to in writing, software
1488 * distributed under the License is distributed on an "AS IS" BASIS,
1489 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1490 * See the License for the specific language governing permissions and
1491 * limitations under the License.
1492 */class Mk extends Tk{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}Mk.type="SESSION";const Ck=Mk;/**
1493 * @license
1494 * Copyright 2019 Google LLC
1495 *
1496 * Licensed under the Apache License, Version 2.0 (the "License");
1497 * you may not use this file except in compliance with the License.
1498 * You may obtain a copy of the License at
1499 *
1500 *   http://www.apache.org/licenses/LICENSE-2.0
1501 *
1502 * Unless required by applicable law or agreed to in writing, software
1503 * distributed under the License is distributed on an "AS IS" BASIS,
1504 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1505 * See the License for the specific language governing permissions and
1506 * limitations under the License.
1507 */function xW(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
1508 * @license
1509 * Copyright 2019 Google LLC
1510 *
1511 * Licensed under the Apache License, Version 2.0 (the "License");
1512 * you may not use this file except in compliance with the License.
1513 * You may obtain a copy of the License at
1514 *
1515 *   http://www.apache.org/licenses/LICENSE-2.0
1516 *
1517 * Unless required by applicable law or agreed to in writing, software
1518 * distributed under the License is distributed on an "AS IS" BASIS,
1519 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1520 * See the License for the specific language governing permissions and
1521 * limitations under the License.
1522 */class dy{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(i=>i.isListeningto(e));if(n)return n;const r=new dy(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:i,data:s}=n.data,o=this.handlersMap[i];if(!(o!=null&&o.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(o).map(async c=>c(n.origin,s)),l=await xW(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:l})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}dy.receivers=[];/**
1523 * @license
1524 * Copyright 2020 Google LLC
1525 *
1526 * Licensed under the Apache License, Version 2.0 (the "License");
1527 * you may not use this file except in compliance with the License.
1528 * You may obtain a copy of the License at
1529 *
1530 *   http://www.apache.org/licenses/LICENSE-2.0
1531 *
1532 * Unless required by applicable law or agreed to in writing, software
1533 * distributed under the License is distributed on an "AS IS" BASIS,
1534 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1535 * See the License for the specific language governing permissions and
1536 * limitations under the License.
1537 */function EE(t="",e=10){let n="";for(let r=0;r<e;r++)n+=Math.floor(Math.random()*10);return t+n}/**
1538 * @license
1539 * Copyright 2019 Google LLC
1540 *
1541 * Licensed under the Apache License, Version 2.0 (the "License");
1542 * you may not use this file except in compliance with the License.
1543 * You may obtain a copy of the License at
1544 *
1545 *   http://www.apache.org/licenses/LICENSE-2.0
1546 *
1547 * Unless required by applicable law or agreed to in writing, software
1548 * distributed under the License is distributed on an "AS IS" BASIS,
1549 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1550 * See the License for the specific language governing permissions and
1551 * limitations under the License.
1552 */class bW{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,n,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((a,l)=>{const c=EE("",20);i.port1.start();const d=setTimeout(()=>{l(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(f){const u=f;if(u.data.eventId===c)switch(u.data.status){case"ack":clearTimeout(d),s=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(u.data.response);break;default:clearTimeout(d),clearTimeout(s),l(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:c,data:n},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
1553 * @license
1554 * Copyright 2020 Google LLC
1555 *
1556 * Licensed under the Apache License, Version 2.0 (the "License");
1557 * you may not use this file except in compliance with the License.
1558 * You may obtain a copy of the License at
1559 *
1560 *   http://www.apache.org/licenses/LICENSE-2.0
1561 *
1562 * Unless required by applicable law or agreed to in writing, software
1563 * distributed under the License is distributed on an "AS IS" BASIS,
1564 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1565 * See the License for the specific language governing permissions and
1566 * limitations under the License.
1567 */function As(){return window}function wW(t){As().location.href=t}/**
1568 * @license
1569 * Copyright 2020 Google LLC.
1570 *
1571 * Licensed under the Apache License, Version 2.0 (the "License");
1572 * you may not use this file except in compliance with the License.
1573 * You may obtain a copy of the License at
1574 *
1575 *   http://www.apache.org/licenses/LICENSE-2.0
1576 *
1577 * Unless required by applicable law or agreed to in writing, software
1578 * distributed under the License is distributed on an "AS IS" BASIS,
1579 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1580 * See the License for the specific language governing permissions and
1581 * limitations under the License.
1582 */function Rk(){return typeof As().WorkerGlobalScope<"u"&&typeof As().importScripts=="function"}async function EW(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function SW(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function TW(){return Rk()?self:null}/**
1583 * @license
1584 * Copyright 2019 Google LLC
1585 *
1586 * Licensed under the Apache License, Version 2.0 (the "License");
1587 * you may not use this file except in compliance with the License.
1588 * You may obtain a copy of the License at
1589 *
1590 *   http://www.apache.org/licenses/LICENSE-2.0
1591 *
1592 * Unless required by applicable law or agreed to in writing, software
1593 * distributed under the License is distributed on an "AS IS" BASIS,
1594 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1595 * See the License for the specific language governing permissions and
1596 * limitations under the License.
1597 */const Pk="firebaseLocalStorageDb",AW=1,Zg="firebaseLocalStorage",Ik="fbase_key";class Hh{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function fy(t,e){return t.transaction([Zg],e?"readwrite":"readonly").objectStore(Zg)}function MW(){const t=indexedDB.deleteDatabase(Pk);
1597return new Hh(t).toPromise()}function Eb(){const t=indexedDB.open(Pk,AW);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore(Zg,{keyPath:Ik})}catch(i){n(i)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains(Zg)?e(r):(r.close(),await MW(),e(await Eb()))})})}async function oC(t,e,n){const r=fy(t,!0).put({[Ik]:e,value:n});return new Hh(r).toPromise()}async function CW(t,e){const n=fy(t,!1).get(e),r=await new Hh(n).toPromise();return r===void 0?null:r.value}function aC(t,e){const n=fy(t,!0).delete(e);return new Hh(n).toPromise()}const RW=800,PW=3;class Nk{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Eb(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>PW)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Rk()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=dy._getInstance(TW()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)}
1597)),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var e,n;if(this.activeServiceWorker=await EW(),!this.activeServiceWorker)return;this.sender=new bW(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((n=r[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||SW()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Eb();return await oC(e,Qg,"1"),await aC(e,Qg),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>oC(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>CW(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>aC(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=fy(i,!1).getAll();return new Hh(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),n.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),n.push(i));return n}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),RW)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
vendor: 4,318 bytes, lines 1597-1646
1597ject.keys(this.listeners).length===0&&this.stopPolling()}}Nk.type="LOCAL";const IW=Nk;new Vh(3e4,6e4);/**
1598 * @license
1599 * Copyright 2021 Google LLC
1600 *
1601 * Licensed under the Apache License, Version 2.0 (the "License");
1602 * you may not use this file except in compliance with the License.
1603 * You may obtain a copy of the License at
1604 *
1605 *   http://www.apache.org/licenses/LICENSE-2.0
1606 *
1607 * Unless required by applicable law or agreed to in writing, software
1608 * distributed under the License is distributed on an "AS IS" BASIS,
1609 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1610 * See the License for the specific language governing permissions and
1611 * limitations under the License.
1612 */function NW(t,e){return e?oo(e):(lt(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/**
1613 * @license
1614 * Copyright 2019 Google LLC
1615 *
1616 * Licensed under the Apache License, Version 2.0 (the "License");
1617 * you may not use this file except in compliance with the License.
1618 * You may obtain a copy of the License at
1619 *
1620 *   http://www.apache.org/licenses/LICENSE-2.0
1621 *
1622 * Unless required by applicable law or agreed to in writing, software
1623 * distributed under the License is distributed on an "AS IS" BASIS,
1624 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1625 * See the License for the specific language governing permissions and
1626 * limitations under the License.
1627 */class SE extends bE{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return nu(e,this._buildIdpRequest())}_linkToIdToken(e,n){return nu(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return nu(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(n.idToken=e),n}}function OW(t){return Ek(t.auth,new SE(t),t.bypassAuthState)}function DW(t){const{auth:e,user:n}=t;return lt(n,e,"internal-error"),wk(n,new SE(t),t.bypassAuthState)}async function kW(t){const{auth:e,user:n}=t;return lt(n,e,"internal-error"),aW(n,new SE(t),t.bypassAuthState)}/**
1628 * @license
1629 * Copyright 2020 Google LLC
1630 *
1631 * Licensed under the Apache License, Version 2.0 (the "License");
1632 * you may not use this file except in compliance with the License.
1633 * You may obtain a copy of the License at
1634 *
1635 *   http://www.apache.org/licenses/LICENSE-2.0
1636 *
1637 * Unless required by applicable law or agreed to in writing, software
1638 * distributed under the License is distributed on an "AS IS" BASIS,
1639 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1640 * See the License for the specific language governing permissions and
1641 * limitations under the License.
1642 */class Ok{constructor(e,n,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:r,postBody:i,tenantId:s,error:o,type:a}=e;if(o){this.reject(o);return}const l={auth:this.auth,requestUri:n,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(l))}catch(c){this.reject(c)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return OW;case"linkViaPopup":case"linkViaRedirect":return kW;case"reauthViaPopup":case"reauthViaRedirect":return DW;default:rs(this.auth,"internal-error")}}resolve(e){xo(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){xo(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1643 * @license
1644 * Copyright 2020 Google LLC
1645 *
1646 * Licensed under the Apache License, Version 2.0 (the "License");
1647 * you may not use this file except in compliance with the License.
1648 * You may obtain a copy of the License at
1649 *
1650 *   http://www.apache.org/licenses/LICENSE-2.0
1651 *
1652 * Unless required by applicable law or agreed to in writing, software
1653 * distributed under the License is distributed on an "AS IS" BASIS,
1654 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1655 * See the License for the specific language governing permissions and
1656 * limitations under the License.
1657 */const LW=new Vh(2e3,1e4);class Hc extends Ok{constructor(e,n,r,i,s){super(e,n,i,s),this.provider=r,this.authWindow=null,this.pollId=null,Hc.currentPopupAction&&Hc.currentPopupAction.cancel(),Hc.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return lt(e,this.auth,"internal-error"),e}async onExecution(){xo(this.filter.length===1,"Popup operations only handle one event");const e=EE();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(Ts(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(Ts(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Hc.currentPopupAction=null}pollUserCancellation(){const e=()=>{var n,r;if(!((r=(n=this.authWindow)===null||n===void 0?void 0:n.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Ts(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,LW.get())};e()}}Hc.currentPopupAction=null;/**
1658 * @license
1659 * Copyright 2020 Google LLC
1660 *
1661 * Licensed under the Apache License, Version 2.0 (the "License");
1662 * you may not use this file except in compliance with the License.
1663 * You may obtain a copy of the License at
1664 *
1665 *   http://www.apache.org/licenses/LICENSE-2.0
1666 *
1667 * Unless required by applicable law or agreed to in writing, software
1668 * distributed under the License is distributed on an "AS IS" BASIS,
1669 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1670 * See the License for the specific language governing permissions and
1671 * limitations under the License.
1672 */const FW="pendingRedirect",$m=new Map;class UW extends Ok{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=$m.get(this.auth._key());if(!e){try{const r=await jW(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}$m.set(this.auth._key(),e)}return this.bypassAuthState||$m.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function jW(t,e){const n=zW(e),r=VW(t);if(!await r._isAvailable())return!1;const i=await r._get(n)==="true";return await r._remove(n),i}function BW(t,e){$m.set(t._key(),e)}function VW(t){return oo(t._redirectPersistence)}function zW(t){return Gm(FW,t.config.apiKey,t.name)}async function HW(t,e,n=!1){if(Ti(t.app))return Promise.reject(Sa(t));const r=td(t),i=NW(r,e),o=await new UW(r,i,n).execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/**
1673 * @license
1674 * Copyright 2020 Google LLC
1675 *
1676 * Licensed under the Apache License, Version 2.0 (the "License");
1677 * you may not use this file except in compliance with the License.
1678 * You may obtain a copy of the License at
1679 *
1680 *   http://www.apache.org/licenses/LICENSE-2.0
1681 *
1682 * Unless required by applicable law or agreed to in writing, softw
1682are
1683 * distributed under the License is distributed on an "AS IS" BASIS,
1684 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1685 * See the License for the specific language governing permissions and
1686 * limitations under the License.
1687 */const GW=10*60*1e3;class $W{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!WW(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var r;if(e.error&&!Dk(e)){const i=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";n.onError(Ts(this.auth,i))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=GW&&this.cachedEventUids.clear(),this.cachedEventUids.has(lC(e))}saveEventToCache(e){this.cachedEventUids.add(lC(e)),this.lastProcessedEventTime=Date.now()}}function lC(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function Dk({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function WW(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Dk(t);default:return!1}}/**
1688 * @license
1689 * Copyright 2020 Google LLC
1690 *
1691 * Licensed under the Apache License, Version 2.0 (the "License");
1692 * you may not use this file except in compliance with the License.
1693 * You may obtain a copy of the License at
1694 *
1695 *   http://www.apache.org/licenses/LICENSE-2.0
1696 *
1697 * Unless required by applicable law or agreed to in writing, software
1698 * distributed under the License is distributed on an "AS IS" BASIS,
1699 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1700 * See the License for the specific language governing permissions and
1701 * limitations under the License.
1702 */async function qW(t,e={}){return Co(t,"GET","/v1/projects",e)}/**
1703 * @license
1704 * Copyright 2020 Google LLC
1705 *
1706 * Licensed under the Apache License, Version 2.0 (the "License");
1707 * you may not use this file except in compliance with the License.
1708 * You may obtain a copy of the License at
1709 *
1710 *   http://www.apache.org/licenses/LICENSE-2.0
1711 *
1712 * Unless required by applicable law or agreed to in writing, software
1713 * distributed under the License is distributed on an "AS IS" BASIS,
1714 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1715 * See the License for the specific language governing permissions and
1716 * limitations under the License.
1717 */const KW=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,XW=/^https?/;async function YW(t){if(t.config.emulator)return;const{authorizedDomains:e}=await qW(t);for(const n of e)try{if(QW(n))return}catch{}rs(t,"unauthorized-domain")}function QW(t){const e=bb(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const o=new URL(t);return o.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&o.hostname===r}if(!XW.test(n))return!1;if(KW.test(t))return r===t;const i=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/**
1718 * @license
1719 * Copyright 2020 Google LLC.
1720 *
1721 * Licensed under the Apache License, Version 2.0 (the "License");
1722 * you may not use this file except in compliance with the License.
1723 * You may obtain a copy of the License at
1724 *
1725 *   http://www.apache.org/licenses/LICENSE-2.0
1726 *
1727 * Unless required by applicable law or agreed to in writing, softw
1727are
1728 * distributed under the License is distributed on an "AS IS" BASIS,
1729 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1730 * See the License for the specific language governing permissions and
1731 * limitations under the License.
1732 */const ZW=new Vh(3e4,6e4);function cC(){const t=As().___jsl;if(t!=null&&t.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n<t.CP.length;n++)t.CP[n]=null}}function JW(t){return new Promise((e,n)=>{var r,i,s;function o(){cC(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{cC(),n(Ts(t,"network-request-failed"))},timeout:ZW.get()})}if(!((i=(r=As().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=As().gapi)===null||s===void 0)&&s.load)o();else{const a=H$("iframefcb");return As()[a]=()=>{gapi.load?o():n(Ts(t,"network-request-failed"))},vk(`${z$()}?onload=${a}`).catch(l=>n(l))}}).catch(e=>{throw Wm=null,e})}let Wm=null;function eq(t){return Wm=Wm||JW(t),Wm}/**
1733 * @license
1734 * Copyright 2020 Google LLC.
1735 *
1736 * Licensed under the Apache License, Version 2.0 (the "License");
1737 * you may not use this file except in compliance with the License.
1738 * You may obtain a copy of the License at
1739 *
1740 *   http://www.apache.org/licenses/LICENSE-2.0
1741 *
1742 * Unless required by applicable law or agreed to in writing, software
1743 * distributed under the License is distributed on an "AS IS" BASIS,
1744 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1745 * See the License for the specific language governing permissions and
1746 * limitations under the License.
1747 */const tq=new Vh(5e3,15e3),nq="__/auth/iframe",rq="emulator/auth/iframe",iq={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},sq=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function oq(t){const e=t.config;lt(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?yE(e,rq):`https://${t.config.authDomain}/${nq}`,r={apiKey:e.apiKey,appName:t.name,v:ql},i=sq.get(t.config.apiHost);i&&(r.eid=i);const s=t._getFrameworks();return s.length&&(r.fw=s.join(",")),`${n}?${jh(r).slice(1)}`}async function aq(t){const e=await eq(t),n=As().gapi;return lt(n,t,"internal-error"),e.open({where:document.body,url:oq(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:iq,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=Ts(t,"network-request-failed"),a=As().setTimeout(()=>{s(o)},tq.get());function l(){As().clearTimeout(a),i(r)}r.ping(l).then(l,()=>{s(o)})}))}/**
1748 * @license
1749 * Copyright 2020 Google LLC.
1750 *
1751 * Licensed under the Apache License, Version 2.0 (the "License");
1752 * you may not use this file except in compliance with the License.
1753 * You may obtain a copy of the License at
1754 *
1755 *   http://www.apache.org/licenses/LICENSE-2.0
1756 *
1757 * Unless required by applicable law or agreed to in writing, software
1758 * distributed under the License is distributed on an "AS IS" BASIS,
1759 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1760 * See the License for the specific language governing permissions and
1761 * limitations under the License.
1762 */const lq={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},cq=500,uq=600,dq="_blank",fq="http://localhost";class uC{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function hq(t,e,n,r=cq,i=uq){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const l=Object.assign(Object.assign({},lq),{width:r.toString(),height:i.toString(),top:s,left:o}),c=xr().toLowerCase();n&&(a=uk(c)?dq:n),lk(c)&&(e=e||fq,l.scrollbars="yes");const d=Object.entries(l).reduce((u,[h,g])=>`${u}${h}=${g},`,"");if(O$(c)&&a!=="_self")return pq(e||"",a),new uC(null);const f=window.open(e||"",a,d);lt(f,t,"popup-blocked");try{f.focus()}catch{}return new uC(f)}function pq(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");
1762r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/**
1763 * @license
1764 * Copyright 2021 Google LLC
1765 *
1766 * Licensed under the Apache License, Version 2.0 (the "License");
1767 * you may not use this file except in compliance with the License.
1768 * You may obtain a copy of the License at
1769 *
1770 *   http://www.apache.org/licenses/LICENSE-2.0
1771 *
1772 * Unless required by applicable law or agreed to in writing, software
1773 * distributed under the License is distributed on an "AS IS" BASIS,
1774 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1775 * See the License for the specific language governing permissions and
1776 * limitations under the License.
1777 */const mq="__/auth/handler",gq="emulator/auth/handler",vq=encodeURIComponent("fac");async function dC(t,e,n,r,i,s){lt(t.config.authDomain,t,"auth-domain-config-required"),lt(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:ql,eventId:i};if(e instanceof xk){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",X7(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[d,f]of Object.entries({}))o[d]=f}if(e instanceof zh){const d=e.getScopes().filter(f=>f!=="");d.length>0&&(o.scopes=d.join(","))}t.tenantId&&(o.tid=t.tenantId);const a=o;for(const d of Object.keys(a))a[d]===void 0&&delete a[d];const l=await t._getAppCheckToken(),c=l?`#${vq}=${encodeURIComponent(l)}`:"";return`${yq(t)}?${jh(a).slice(1)}${c}`}function yq({config:t}){return t.emulator?yE(t,gq):`https://${t.authDomain}/${mq}`}/**
1778 * @license
1779 * Copyright 2020 Google LLC
1780 *
1781 * Licensed under the Apache License, Version 2.0 (the "License");
1782 * you may not use this file except in compliance with the License.
1783 * You may obtain a copy of the License at
1784 *
1785 *   http://www.apache.org/licenses/LICENSE-2.0
1786 *
1787 * Unless required by applicable law or agreed to in writing, software
1788 * distributed under the License is distributed on an "AS IS" BASIS,
1789 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1790 * See the License for the specific language governing permissions and
1791 * limitations under the License.
1792 */const K_="webStorageSupport";class _q{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Ck,this._completeRedirectFn=HW,this._overrideRedirectResult=BW}async _openPopup(e,n,r,i){var s;xo((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=await dC(e,n,r,bb(),i);return hq(e,o,EE())}async _openRedirect(e,n,r,i){await this._originValidation(e);const s=await dC(e,n,r,bb(),i);return wW(s),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:i,promise:s}=this.eventManagers[n];return i?Promise.resolve(i):(xo(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await aq(e),r=new $W(e);return n.register("authEvent",i=>(lt(i==null?void 0:i.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(K_,{type:K_},i=>{var s;const o=(s=i==null?void 0:i[0])===null||s===void 0?void 0:s[K_];o!==void 0&&n(!!o),rs(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=YW(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return mk()||ck()||xE()}}const xq=_q;var fC="@firebase/auth",hC="1.10.7";/**
1793 * @license
1794 * Copyright 2020 Google LLC
1795 *
1796 * Licensed under the Apache License, Version 2.0 (the "License");
1797 * you may not use this file except in compliance with the License.
1798 * You may obtain a copy of the License at
1799 *
1800 *   http://www.apache.org/licenses/LICENSE-2.0
1801 *
1802 * Unless required by applicable law or agreed to in writing, softw
1802are
1803 * distributed under the License is distributed on an "AS IS" BASIS,
1804 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1805 * See the License for the specific language governing permissions and
1806 * limitations under the License.
1807 */class bq{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(r=>{e((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){lt(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1808 * @license
1809 * Copyright 2020 Google LLC
1810 *
1811 * Licensed under the Apache License, Version 2.0 (the "License");
1812 * you may not use this file except in compliance with the License.
1813 * You may obtain a copy of the License at
1814 *
1815 *   http://www.apache.org/licenses/LICENSE-2.0
1816 *
1817 * Unless required by applicable law or agreed to in writing, software
1818 * distributed under the License is distributed on an "AS IS" BASIS,
1819 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1820 * See the License for the specific language governing permissions and
1821 * limitations under the License.
1822 */function wq(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function Eq(t){ns(new Ii("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;lt(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:o,authDomain:a,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:gk(t)},c=new j$(r,i,s,l);return X$(c,n),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),ns(new Ii("auth-internal",e=>{const n=td(e.getProvider("auth").getImmediate());return(r=>new bq(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),Kr(fC,hC,wq(t)),Kr(fC,hC,"esm2017")}/**
1823 * @license
1824 * Copyright 2021 Google LLC
1825 *
1826 * Licensed under the Apache License, Version 2.0 (the "License");
1827 * you may not use this file except in compliance with the License.
1828 * You may obtain a copy of the License at
1829 *
1830 *   http://www.apache.org/licenses/LICENSE-2.0
1831 *
1832 * Unless required by applicable law or agreed to in writing, software
1833 * distributed under the License is distributed on an "AS IS" BASIS,
1834 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1835 * See the License for the specific language governing permissions and
1836 * limitations under the License.
1837 */const Sq=5*60,Tq=$D("authIdTokenMaxAge")||Sq;let pC=null;const Aq=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>Tq)return;const i=n==null?void 0:n.token;pC!==i&&(pC=i,await fetch(t,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function Mq(t=ly()){const e=Ka(t,"auth");if(e.isInitialized())return e.getImmediate();const n=K$(t,{popupRedirectResolver:xq,persistence:[IW,_W,Ck]}),r=$D("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(r,location.origin);if(location.origin===s.origin){const o=Aq(s.toString());mW(n,o,()=>o(n.currentUser)),pW(n,a=>o(a))}}const i=zD("auth");return i&&Y$(n,`http://${i}`),n}function Cq(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}
vendor: 53,330 bytes, lines 1837-1863
1837B$({loadJS(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=i=>{const s=Ts("internal-error");s.customData=i,n(s)},r.type="text/javascript",r.charset="UTF-8",Cq().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});Eq("Browser");var mC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
1838Copyright The Closure Library Authors.
1839SPDX-License-Identifier: Apache-2.0
1840*/var Ta,kk;(function(){var t;/** @license
1841
1842 Copyright The Closure Library Authors.
1843 SPDX-License-Identifier: Apache-2.0
1844*/function e(M,E){function C(){}C.prototype=E.prototype,M.D=E.prototype,M.prototype=new C,M.prototype.constructor=M,M.C=function(T,A,R){for(var P=Array(arguments.length-2),D=2;D<arguments.length;D++)P[D-2]=arguments[D];return E.prototype[A].apply(T,P)}}function n(){this.blockSize=-1}function r(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}e(r,n),r.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function i(M,E,C){C||(C=0);var T=Array(16);if(typeof E=="string")for(var A=0;16>A;++A)T[A]=E.charCodeAt(C++)|E.charCodeAt(C++)<<8|E.charCodeAt(C++)<<16|E.charCodeAt(C++)<<24;else for(A=0;16>A;++A)T[A]=E[C++]|E[C++]<<8|E[C++]<<16|E[C++]<<24;E=M.g[0],C=M.g[1],A=M.g[2];var R=M.g[3],P=E+(R^C&(A^R))+T[0]+3614090360&4294967295;E=C+(P<<7&4294967295|P>>>25),P=R+(A^E&(C^A))+T[1]+3905402710&4294967295,R=E+(P<<12&4294967295|P>>>20),P=A+(C^R&(E^C))+T[2]+606105819&4294967295,A=R+(P<<17&4294967295|P>>>15),P=C+(E^A&(R^E))+T[3]+3250441966&4294967295,C=A+(P<<22&4294967295|P>>>10),P=E+(R^C&(A^R))+T[4]+4118548399&4294967295,E=C+(P<<7&4294967295|P>>>25),P=R+(A^E&(C^A))+T[5]+1200080426&4294967295,R=E+(P<<12&4294967295|P>>>20),P=A+(C^R&(E^C))+T[6]+2821735955&4294967295,A=R+(P<<17&4294967295|P>>>15),P=C+(E^A&(R^E))+T[7]+4249261313&4294967295,C=A+(P<<22&4294967295|P>>>10),P=E+(R^C&(A^R))+T[8]+1770035416&4294967295,E=C+(P<<7&4294967295|P>>>25),P=R+(A^E&(C^A))+T[9]+2336552879&4294967295,R=E+(P<<12&4294967295|P>>>20),P=A+(C^R&(E^C))+T[10]+4294925233&4294967295,A=R+(P<<17&4294967295|P>>>15),P=C+(E^A&(R^E))+T[11]+2304563134&4294967295,C=A+(P<<22&4294967295|P>>>10),P=E+(R^C&(A^R))+T[12]+1804603682&4294967295,E=C+(P<<7&4294967295|P>>>25),P=R+(A^E&(C^A))+T[13]+4254626195&4294967295,R=E+(P<<12&4294967295|P>>>20),P=A+(C^R&(E^C))+T[14]+2792965006&4294967295,A=R+(P<<17&4294967295|P>>>15),P=C+(E^A&(R^E))+T[15]+1236535329&4294967295,C=A+(P<<22&4294967295|P>>>10),P=E+(A^R&(C^A))+T[1]+4129170786&4294967295,E=C+(P<<5&4294967295|P>>>27),P=R+(C^A&(E^C))+T[6]+3225465664&4294967295,R=E+(P<<9&4294967295|P>>>23),P=A+(E^C&(R^E))+T[11]+643717713&4294967295,A=R+(P<<14&4294967295|P>>>18),P=C+(R^E&(A^R))+T[0]+3921069994&4294967295,C=A+(P<<20&4294967295|P>>>12),P=E+(A^R&(C^A))+T[5]+3593408605&4294967295,E=C+(P<<5&4294967295|P>>>27),P=R+(C^A&(E^C))+T[10]+38016083&4294967295,R=E+(P<<9&4294967295|P>>>23),P=A+(E^C&(R^E))+T[15]+3634488961&4294967295,A=R+(P<<14&4294967295|P>>>18),P=C+(R^E&(A^R))+T[4]+3889429448&4294967295,C=A+(P<<20&4294967295|P>>>12),P=E+(A^R&(C^A))+T[9]+568446438&4294967295,E=C+(P<<5&4294967295|P>>>27),P=R+(C^A&(E^C))+T[14]+3275163606&4294967295,R=E+(P<<9&4294967295|P>>>23),P=A+(E^C&(R^E))+T[3]+4107603335&4294967295,A=R+(P<<14&4294967295|P>>>18),P=C+(R^E&(A^R))+T[8]+1163531501&4294967295,C=A+(P<<20&4294967295|P>>>12),P=E+(A^R&(C^A))+T[13]+2850285829&4294967295,E=C+(P<<5&4294967295|P>>>27),P=R+(C^A&(E^C))+T[2]+4243563512&4294967295,R=E+(P<<9&4294967295|P>>>23),P=A+(E^C&(R^E))+T[7]+1735328473&4294967295,A=R+(P<<14&4294967295|P>>>18),P=C+(R^E&(A^R))+T[12]+2368359562&4294967295,C=A+(P<<20&4294967295|P>>>12),P=E+(C^A^R)+T[5]+4294588738&4294967295,E=C+(P<<4&4294967295|P>>>28),P=R+(E^C^A)+T[8]+2272392833&4294967295,R=E+(P<<11&4294967295|P>>>21),P=A+(R^E^C)+T[11]+1839030562&4294967295,A=R+(P<<16&4294967295|P>>>16),P=C+(A^R^E)+T[14]+4259657740&4294967295,C=A+(P<<23&4294967295|P>>>9),P=E+(C^A^R)+T[1]+2763975236&4294967295,E=C+(P<<4&4294967295|P>>>28),P=R+(E^C^A)+T[4]+1272893353&4294967295,R=E+(P<<11&4294967295|P>>>21),P=A+(R^E^C)+T[7]+4139469664&4294967295,A=R+(P<<16&4294967295|P>>>16),P=C+(A^R^E)+T[10]+3200236656&4294967295,C=A+(P<<23&4294967295|P>>>9),P=E+(C^A^R)+T[13]+681279174&4294967295,E=C+(P<<4&4294967295|P>>>28),P=R+(E^C^A)+T[0]+3936430074&4294967295,R=E+(P<<11&4294967295|P>>>21),P=A+(R^E^C)+T[3]+3572445317&4294967295,A=R+(P<<16&4294967295|P>>>16),P=C+(A^R^E)+T[6]+76029189&4294967295,C=A+(P<<23&4294967295|P>>>9),P=E+(C^A^R)+T[9]+3654602809&4294967295,E=C+(P<<4&4294967295|P>>>28),P=R+(E^C^A)+T[12]+3873151461&4294967295,R=E+(P<<11&4294967295|P>>>21),P=A+(R^E^C)+T[15]+530742520&4294967295,A=R+(P<<16&4294967295|P>>>16),P=C+(A^R^E)+T[2]+3299628645&4294967295,C=A+(P<<23&4294967295|P>>>9),P=E+(A^(C|~R))+T[0]+4096336452&4294967295,E=C+(P<<6&4294967295|P>>>26),P=R+(C^(E|~A))+T[7]+1126891415&4294967295,R=E+(P<<10&4294967295|P>>>22),P=A+(E^(R|~C))+T[14]+2878612391&4294967295,A=R+(P<<15&4294967295|P>>>17),P=C+(R^(A|~E))+T[5]+4237533241&4294967295,C=A+(P<<21&4294967295|P>>>11),P=E+(A^(C|~R))+T[12]+1700485571&4294967295,E=C+(P<<6&4294967295|P>>>26),P=R+(C^(E|~A))+T[3]+2399980690&4294967295,R=E+(P<<10&4294967295|P>>>22),P=A+(E^(R|~C))+T[10]+4293915773&4294967295,A=R+(P<<15&4294967295|P>>>17),P=C+(R^(A|~E))+T[1]+2240044497&4294967295,C=A+(P<<21&4294967295|P>>>11),P=E+(A^(C|~R))+T[8]+1873313359&4294967295,E=C+(P<<6&4294967295|P>>>26),P=R+(C^(E|~A))+T[15]+4264355552&4294967295,R=E+(P<<10&4294967295|P>>>22),P=A+(E^(R|~C))+T[6]+2734768916&4294967295,A=R+(P<<15&4294967295|P>>>17),P=C+(R^(A|~E))+T[13]+1309151649&4294967295,C=A+(P<<21&4294967295|P>>>11),P=E+(A^(C|~R))+T[4]+4149444226&4294967295,E=C+(P<<6&4294967295|P>>>26),P=R+(C^(E|~A))+T[11]+3174756917&4294967295,R=E+(P<<10&4294967295|P>>>22),P=A+(E^(R|~C))+T[2]+718787259&4294967295,A=R+(P<<15&4294967295|P>>>17),P=C+(R^(A|~E))+T[9]+3951481745&4294967295,M.g[0]=M.g[0]+E&4294967295,M.g[1]=M.g[1]+(A+(P<<21&4294967295|P>>>11))&4294967295,M.g[2]=M.g[2]+A&4294967295,M.g[3]=M.g[3]+R&4294967295}r.prototype.u=function(M,E){E===void 0&&(E=M.length);for(var C=E-this.blockSize,T=this.B,A=this.h,R=0;R<E;){if(A==0)for(;R<=C;)i(this,M,R),R+=this.blockSize;if(typeof M=="string"){for(;R<E;)if(T[A++]=M.charCodeAt(R++),A==this.blockSize){i(this,T),A=0;break}}else for(;R<E;)if(T[A++]=M[R++],A==this.blockSize){i(this,T),A=0;break}}this.h=A,this.o+=E},r.prototype.v=function(){var M=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);M[0]=128;for(var E=1;E<M.length-8;++E)M[E]=0;var C=8*this.o;for(E=M.length-8;E<M.length;++E)M[E]=C&255,C/=256;for(this.u(M),M=Array(16),E=C=0;4>E;++E)for(var T=0;32>T;T+=8)M[C++]=this.g[E]>>>T&255;return M};function s(M,E){var C=a;return Object.prototype.hasOwnProperty.call(C,M)?C[M]:C[M]=E(M)}function o(M,E){this.h=E;for(var C=[],T=!0,A=M.length-1;0<=A;A--){var R=M[A]|0;T&&R==E||(C[A]=R,T=!1)}this.g=C}var a={};function l(M){return-128<=M&&128>M?s(M,function(E){return new o([E|0],0>E?-1:0)}):new o([M|0],0>M?-1:0)}function c(M){if(isNaN(M)||!isFinite(M))return f;if(0>M)return m(c(-M));for(var E=[],C=1,T=0;M>=C;T++)E[T]=M/C|0,C*=4294967296;return new o(E,0)}function d(M,E){if(M.length==0)throw Error("number format error: empty string");if(E=E||10,2>E||36<E)throw Error("radix out of range: "+E);if(M.charAt(0)=="-")return m(d(M.substring(1),E));if(0<=M.indexOf("-"))throw Error('number format error: interior "-" character');for(var C=c(Math.pow(E,8)),T=f,A=0;A<M.length;A+=8){var R=Math.min(8,M.length-A),P=parseInt(M.substring(A,A+R),E);8>R?(R=c(Math.pow(E,R)),T=T.j(R).add(c(P))):(T=T.j(C),T=T.add(c(P)))}return T}var f=l(0),u=l(1),h=l(16777216);t=o.prototype,t.m=function(){if(v(this))return-m(this).m();for(var M=0,E=1,C=0;C<this.g.length;C++){var T=this.i(C);M+=(0<=T?T:4294967296+T)*E,E*=4294967296}return M},t.toString=function(M){if(M=M||10,2>M||36<M)throw Error("radix out of range: "+M);if(g(this))return"0";if(v(this))return"-"+m(this).toString(M);for(var E=c(Math.pow(M,6)),C=this,T="";;){var A=x(C,E).g;C=p(C,A.j(E));var R=((0<C.g.length?C.g[0]:C.h)>>>0).toString(M);if(C=A,g(C))return R+T;for(;6>R.length;)R="0"+R;T=R+T}},t.i=function(M){return 0>M?0:M<this.g.length?this.g[M]:this.h};function g(M){if(M.h!=0)return!1;for(var E=0;E<M.g.length;E++)if(M.g[E]!=0)return!1;return!0}function v(M){return M.h==-1}t.l=function(M){return M=p(this,M),v(M)?-1:g(M)?0:1};function m(M){for(var E=M.g.length,C=[],T=0;T<E;T++)C[T]=~M.g[T];return new o(C,~M.h).add(u)}t.abs=function(){return v(this)?m(this):this},t.add=function(M){for(var E=Math.max(this.g.length,M.g.length),C=[],T=0,A=0;A<=E;A++){var R=T+(this.i(A)&65535)+(M.i(A)&65535),P=(R>>>16)+(this.i(A)>>>16)+(M.i(A)>>>16);T=P>>>16,R&=65535,P&=65535,C[A]=P<<16|R}return new o(C,C[C.length-1]&-2147483648?-1:0)};function p(M,E){return M.add(m(E))}t.j=function(M){if(g(this)||g(M))return f;if(v(this))return v(M)?m(this).j(m(M)):m(m(this).j(M));if(v(M))return m(this.j(m(M)));if(0>this.l(h)&&0>M.l(h))return c(this.m()*M.m());for(var E=this.g.length+M.g.length,C=[],T=0;T<2*E;T++)C[T]=0;for(T=0;T<this.g.length;T++)for(var A=0;A<M.g.length;A++){var R=this.i(T)>>>16,P=this.i(T)&65535,D=M.i(A)>>>16,F=M.i(A)&65535;C[2*T+2*A]+=P*F,y(C,2*T+2*A),C[2*T+2*A+1]+=R*F,y(C,2*T+2*A+1),C[2*T+2*A+1]+=P*D,y(C,2*T+2*A+1),C[2*T+2*A+2]+=R*D,y(C,2*T+2*A+2)}for(T=0;T<E;T++)C[T]=C[2*T+1]<<16|C[2*T];for(T=E;T<2*E;T++)C[T]=0;return new o(C,0)};function y(M,E){for(;(M[E]&65535)!=M[E];)M[E+1]+=M[E]>>>16,M[E]&=65535,E++}function w(M,E){this.g=M,this.h=E}function x(M,E){if(g(E))throw Error("division by zero");if(g(M))return new w(f,f);if(v(M))return E=x(m(M),E),new w(m(E.g),m(E.h));if(v(E))return E=x(M,m(E)),new w(m(E.g),E.h);if(30<M.g.length){if(v(M)||v(E))throw Error("slowDivide_ only works with positive integers.");for(var C=u,T=E;0>=T.l(M);)C=S(C),T=S(T);var A=I(C,1),R=I(T,1);for(T=I(T,2),C=I(C,2);!g(T);){var P=R.add(T);0>=P.l(M)&&(A=A.add(C),R=P),T=I(T,1),C=I(C,1)}return E=p(M,A.j(E)),new w(A,E)}for(A=f;0<=M.l(E);){for(C=Math.max(1,Math.floor(M.m()/E.m())),T=Math.ceil(Math.log(C)/Math.LN2),T=48>=T?1:Math.pow(2,T-48),R=c(C),P=R.j(E);v(P)||0<P.l(M);)C-=T,R=c(C),P=R.j(E);g(R)&&(R=u),A=A.add(R),M=p(M,P)}return new w(A,M)}t.A=function(M){return x(this,M).h},t.and=function(M){for(var E=Math.max(this.g.length,M.g.length),C=[],T=0;T<E;T++)C[T]=this.i(T)&M.i(T);return new o(C,this.h&M.h)},t.or=function(M){for(var E=Math.max(this.g.length,M.g.length),C=[],T=0;T<E;T++)C[T]=this.i(T)|M.i(T);return new o(C,this.h|M.h)},t.xor=function(M){for(var E=Math.max(this.g.length,M.g.length),C=[],T=0;T<E;T++)C[T]=this.i(T)^M.i(T);return new o(C,this.h^M.h)};function S(M){for(var E=M.g.length+1,C=[],T=0;T<E;T++)C[T]=M.i(T)<<1|M.i(T-1)>>>31;return new o(C,M.h)}function I(M,E){var C=E>>5;E%=32;for(var T=M.g.length-C,A=[],R=0;R<T;R++)A[R]=0<E?M.i(R+C)>>>E|M.i(R+C+1)<<32-E:M.i(R+C);return new o(A,M.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,kk=r,o.prototype.add=o.prototype.add,o.prototype.multiply=o.prototype.j,o.prototype.modulo=o.prototype.A,o.prototype.compare=o.prototype.l,o.prototype.toNumber=o.prototype.m,o.prototype.toString=o.prototype.toString,o.prototype.getBits=o.prototype.i,o.fromNumber=c,o.fromString=d,Ta=o}).apply(typeof mC<"u"?mC:typeof self<"u"?self:typeof window<"u"?window:{});var zp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
1845Copyright The Closure Library Authors.
1846SPDX-License-Identifier: Apache-2.0
1847*/var Lk,ef,Fk,qm,Sb,Uk,jk,Bk;(function(){var t,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(b,N,L){return b==Array.prototype||b==Object.prototype||(b[N]=L.value),b};function n(b){b=[typeof globalThis=="object"&&globalThis,b,typeof window=="object"&&window,typeof self=="object"&&self,typeof zp=="object"&&zp];for(var N=0;N<b.length;++N){var L=b[N];if(L&&L.Math==Math)return L}throw Error("Cannot find global object")}var r=n(this);function i(b,N){if(N)e:{var L=r;b=b.split(".");for(var Y=0;Y<b.length-1;Y++){var ae=b[Y];if(!(ae in L))break e;L=L[ae]}b=b[b.length-1],Y=L[b],N=N(Y),N!=Y&&N!=null&&e(L,b,{configurable:!0,writable:!0,value:N})}}function s(b,N){b instanceof String&&(b+="");var L=0,Y=!1,ae={next:function(){if(!Y&&L<b.length){var ve=L++;return{value:N(ve,b[ve]),done:!1}}return Y=!0,{done:!0,value:void 0}}};return ae[Symbol.iterator]=function(){return ae},ae}i("Array.prototype.values",function(b){return b||function(){return s(this,function(N,L){return L})}});/** @license
1848
1849 Copyright The Closure Library Authors.
1850 SPDX-License-Identifier: Apache-2.0
1851*/var o=o||{},a=this||self;function l(b){var N=typeof b;return N=N!="object"?N:b?Array.isArray(b)?"array":N:"null",N=="array"||N=="object"&&typeof b.length=="number"}function c(b){var N=typeof b;return N=="object"&&b!=null||N=="function"}function d(b,N,L){return b.call.apply(b.bind,arguments)}function f(b,N,L){if(!b)throw Error();if(2<arguments.length){var Y=Array.prototype.slice.call(arguments,2);return function(){var ae=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(ae,Y),b.apply(N,ae)}}return function(){return b.apply(N,arguments)}}function u(b,N,L){return u=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?d:f,u.apply(null,arguments)}function h(b,N){var L=Array.prototype.slice.call(arguments,1);return function(){var Y=L.slice();return Y.push.apply(Y,arguments),b.apply(this,Y)}}function g(b,N){function L(){}L.prototype=N.prototype,b.aa=N.prototype,b.prototype=new L,b.prototype.constructor=b,b.Qb=function(Y,ae,ve){for(var Oe=Array(arguments.length-2),Zt=2;Zt<arguments.length;Zt++)Oe[Zt-2]=arguments[Zt];return N.prototype[ae].apply(Y,Oe)}}function v(b){const N=b.length;if(0<N){const L=Array(N);for(let Y=0;Y<N;Y++)L[Y]=b[Y];return L}return[]}function m(b,N){for(let L=1;L<arguments.length;L++){const Y=arguments[L];if(l(Y)){const ae=b.length||0,ve=Y.length||0;b.length=ae+ve;for(let Oe=0;Oe<ve;Oe++)b[ae+Oe]=Y[Oe]}else b.push(Y)}}class p{constructor(N,L){this.i=N,this.j=L,this.h=0,this.g=null}get(){let N;return 0<this.h?(this.h--,N=this.g,this.g=N.next,N.next=null):N=this.i(),N}}function y(b){return/^[\s\xa0]*$/.test(b)}function w(){var b=a.navigator;return b&&(b=b.userAgent)?b:""}function x(b){return x[" "](b),b}x[" "]=function(){};var S=w().indexOf("Gecko")!=-1&&!(w().toLowerCase().indexOf("webkit")!=-1&&w().indexOf("Edge")==-1)&&!(w().indexOf("Trident")!=-1||w().indexOf("MSIE")!=-1)&&w().indexOf("Edge")==-1;function I(b,N,L){for(const Y in b)N.call(L,b[Y],Y,b)}function M(b,N){for(const L in b)N.call(void 0,b[L],L,b)}function E(b){const N={};for(const L in b)N[L]=b[L];return N}const C="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function T(b,N){let L,Y;for(let ae=1;ae<arguments.length;ae++){Y=arguments[ae];for(L in Y)b[L]=Y[L];for(let ve=0;ve<C.length;ve++)L=C[ve],Object.prototype.hasOwnProperty.call(Y,L)&&(b[L]=Y[L])}}function A(b){var N=1;b=b.split(":");const L=[];for(;0<N&&b.length;)L.push(b.shift()),N--;return b.length&&L.push(b.join(":")),L}function R(b){a.setTimeout(()=>{throw b},0)}function P(){var b=B;let N=null;return b.g&&(N=b.g,b.g=b.g.next,b.g||(b.h=null),N.next=null),N}class D{constructor(){this.h=this.g=null}add(N,L){const Y=F.get();Y.set(N,L),this.h?this.h.next=Y:this.g=Y,this.h=Y}}var F=new p(()=>new V,b=>b.reset());class V{constructor(){this.next=this.g=this.h=null}set(N,L){this.h=N,this.g=L,this.next=null}reset(){this.next=this.g=this.h=null}}let H,$=!1,B=new D,G=()=>{const b=a.Promise.resolve(void 0);H=()=>{b.then(k)}};var k=()=>{for(var b;b=P();){try{b.h.call(b.g)}catch(L){R(L)}var N=F;N.j(b),100>N.h&&(N.h++,b.next=N.g,N.g=b)}$=!1};function z(){this.s=this.s,this.C=this.C}z.prototype.s=!1,z.prototype.ma=function(){this.s||(this.s=!0,this.N())},z.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function q(b,N){this.type=b,this.g=this.target=N,this.defaultPrevented=!1}q.prototype.h=function(){this.defaultPrevented=!0};var ne=function(){if(!a.addEventListener||!Object.defineProperty)return!1;var b=!1,N=Object.defineProperty({},"passive",{get:function(){b=!0}});try{const L=()=>{};a.addEventListener("test",L,N),a.removeEventListener("test",L,N)}catch{}return b}();function ee(b,N){if(q.call(this,b?b.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,b){var L=this.type=b.type,Y=b.changedTouches&&b.changedTouches.length?b.changedTouches[0]:null;if(this.target=b.target||b.srcElement,this.g=N,N=b.relatedTarget){if(S){e:{try{x(N.nodeName);var ae=!0;break e}catch{}ae=!1}ae||(N=null)}}else L=="mouseover"?N=b.fromElement:L=="mouseout"&&(N=b.toElement);this.relatedTarget=N,Y?(this.clientX=Y.clientX!==void 0?Y.clientX:Y.pageX,this.clientY=Y.clientY!==void 0?Y.clientY:Y.pageY,this.screenX=Y.screenX||0,this.screenY=Y.screenY||0):(this.clientX=b.clientX!==void 0?b.clientX:b.pageX,this.clientY=b.clientY!==void 0?b.clientY:b.pageY,this.screenX=b.screenX||0,this.screenY=b.screenY||0),this.button=b.button,this.key=b.key||"",this.ctrlKey=b.ctrlKey,this.altKey=b.altKey,this.shiftKey=b.shiftKey,this.metaKey=b.metaKey,this.pointerId=b.pointerId||0,this.pointerType=typeof b.pointerType=="string"?b.pointerType:j[b.pointerType]||"",this.state=b.state,this.i=b,b.defaultPrevented&&ee.aa.h.call(this)}}g(ee,q);var j={2:"touch",3:"pen",4:"mouse"};ee.prototype.h=function(){ee.aa.h.call(this);var b=this.i;b.preventDefault?b.preventDefault():b.returnValue=!1};var Q="closure_listenable_"+(1e6*Math.random()|0),Z=0;function re(b,N,L,Y,ae){this.listener=b,this.proxy=null,this.src=N,this.type=L,this.capture=!!Y,this.ha=ae,this.key=++Z,this.da=this.fa=!1}function se(b){b.da=!0,b.listener=null,b.proxy=null,b.src=null,b.ha=null}function ye(b){this.src=b,this.g={},this.h=0}ye.prototype.add=function(b,N,L,Y,ae){var ve=b.toString();b=this.g[ve],b||(b=this.g[ve]=[],this.h++);var Oe=Ie(b,N,Y,ae);return-1<Oe?(N=b[Oe],L||(N.fa=!1)):(N=new re(N,this.src,ve,!!Y,ae),N.fa=L,b.push(N)),N};function Ue(b,N){var L=N.type;if(L in b.g){var Y=b.g[L],ae=Array.prototype.indexOf.call(Y,N,void 0),ve;(ve=0<=ae)&&Array.prototype.splice.call(Y,ae,1),ve&&(se(N),b.g[L].length==0&&(delete b.g[L],b.h--))}}function Ie(b,N,L,Y){for(var ae=0;ae<b.length;++ae){var ve=b[ae];if(!ve.da&&ve.listener==N&&ve.capture==!!L&&ve.ha==Y)return ae}return-1}var je="closure_lm_"+(1e6*Math.random()|0),Ke={};function Xe(b,N,L,Y,ae){if(Array.isArray(N)){for(var ve=0;ve<N.length;ve++)Xe(b,N[ve],L,Y,ae);return null}return L=J(L),b&&b[Q]?b.K(N,L,c(Y)?!!Y.capture:!!Y,ae):dt(b,N,L,!1,Y,ae)}function dt(b,N,L,Y,ae,ve){if(!N)throw Error("Invalid event type");var Oe=c(ae)?!!ae.capture:!!ae,Zt=X(b);if(Zt||(b[je]=Zt=new ye(b)),L=Zt.add(N,L,Y,Oe,ve),L.proxy)return L;if(Y=K(),L.proxy=Y,Y.src=b,Y.listener=L,b.addEventListener)ne||(ae=Oe),ae===void 0&&(ae=!1),b.addEventListener(N.toString(),Y,ae);else if(b.attachEvent)b.attachEvent(Ae(N.toString()),Y);else if(b.addListener&&b.removeListener)b.addListener(Y);else throw Error("addEventListener and attachEvent are unavailable.");return L}function K(){function b(L){return N.call(b.src,b.listener,L)}const N=ce;return b}function de(b,N,L,Y,ae){if(Array.isArray(N))for(var ve=0;ve<N.length;ve++)de(b,N[ve],L,Y,ae);else Y=c(Y)?!!Y.capture:!!Y,L=J(L),b&&b[Q]?(b=b.i,N=String(N).toString(),N in b.g&&(ve=b.g[N],L=Ie(ve,L,Y,ae),-1<L&&(se(ve[L]),Array.prototype.splice.call(ve,L,1),ve.length==0&&(delete b.g[N],b.h--)))):b&&(b=X(b))&&(N=b.g[N.toString()],b=-1,N&&(b=Ie(N,L,Y,ae)),(L=-1<b?N[b]:null)&&_e(L))}function _e(b){if(typeof b!="number"&&b&&!b.da){var N=b.src;if(N&&N[Q])Ue(N.i,b);else{var L=b.type,Y=b.proxy;N.removeEventListener?N.removeEventListener(L,Y,b.capture):N.detachEvent?N.detachEvent(Ae(L),Y):N.addListener&&N.removeListener&&N.removeListener(Y),(L=X(N))?(Ue(L,b),L.h==0&&(L.src=null,N[je]=null)):se(b)}}}function Ae(b){return b in Ke?Ke[b]:Ke[b]="on"+b}function ce(b,N){if(b.da)b=!0;else{N=new ee(N,this);var L=b.listener,Y=b.ha||b.src;b.fa&&_e(b),b=L.call(Y,N)}return b}function X(b){return b=b[je],b instanceof ye?b:null}var U="__closure_events_fn_"+(1e9*Math.random()>>>0);function J(b){return typeof b=="function"?b:(b[U]||(b[U]=function(N){return b.handleEvent(N)}),b[U])}function he(){z.call(this),this.i=new ye(this),this.M=this,this.F=null}g(he,z),he.prototype[Q]=!0,he.prototype.removeEventListener=function(b,N,L,Y){de(this,b,N,L,Y)};function me(b,N){var L,Y=b.F;if(Y)for(L=[];Y;Y=Y.F)L.push(Y);if(b=b.M,Y=N.type||N,typeof N=="string")N=new q(N,b);else if(N instanceof q)N.target=N.target||b;else{var ae=N;N=new q(Y,b),T(N,ae)}if(ae=!0,L)for(var ve=L.length-1;0<=ve;ve--){var Oe=N.g=L[ve];ae=fe(Oe,Y,!0,N)&&ae}if(Oe=N.g=b,ae=fe(Oe,Y,!0,N)&&ae,ae=fe(Oe,Y,!1,N)&&ae,L)for(ve=0;ve<L.length;ve++)Oe=N.g=L[ve],ae=fe(Oe,Y,!1,N)&&ae}he.prototype.N=function(){if(he.aa.N.call(this),this.i){var b=this.i,N;for(N in b.g){for(var L=b.g[N],Y=0;Y<L.length;Y++)se(L[Y]);delete b.g[N],b.h--}}this.F=null},he.prototype.K=function(b,N,L,Y){return this.i.add(String(b),N,!1,L,Y)},he.prototype.L=function(b,N,L,Y){return this.i.add(String(b),N,!0,L,Y)};function fe(b,N,L,Y){if(N=b.i.g[String(N)],!N)return!0;N=N.concat();for(var ae=!0,ve=0;ve<N.length;++ve){var Oe=N[ve];if(Oe&&!Oe.da&&Oe.capture==L){var Zt=Oe.listener,Qn=Oe.ha||Oe.src;Oe.fa&&Ue(b.i,Oe),ae=Zt.call(Qn,Y)!==!1&&ae}}return ae&&!Y.defaultPrevented}function Ve(b,N,L){if(typeof b=="function")L&&(b=u(b,L));else if(b&&typeof b.handleEvent=="function")b=u(b.handleEvent,b);else throw Error("Invalid listener argument");return 2147483647<Number(N)?-1:a.setTimeout(b,N||0)}function Ee(b){b.g=Ve(()=>{b.g=null,b.i&&(b.i=!1,Ee(b))},b.l);const N=b.h;b.h=null,b.m.apply(null,N)}class qe extends z{constructor(N,L){super(),this.m=N,this.l=L,this.h=null,this.i=!1,this.g=null}j(N){this.h=arguments,this.g?this.i=!0:Ee(this)}N(){super.N(),this.g&&(a.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function st(b){z.call(this),this.h=b,this.g={}}g(st,z);var Ce=[];function Pe(b){I(b.g,function(N,L){this.g.hasOwnProperty(L)&&_e(N)},b),b.g={}}st.prototype.N=function(){st.aa.N.call(this),Pe(this)},st.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Ge=a.JSON.stringify,He=a.JSON.parse,ze=class{stringify(b){return a.JSON.stringify(b,void 0)}parse(b){return a.JSON.parse(b,void 0)}};function Ne(){}Ne.prototype.h=null;function te(b){return b.h||(b.h=b.i())}function xe(){}var Se={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function ke(){q.call(this,"d")}g(ke,q);function Me(){q.call(this,"c")}g(Me,q);var ge={},Qe=null;function at(){return Qe=Qe||new he}ge.La="serverreachability";function Kt(b){q.call(this,ge.La,b)}g(Kt,q);function Dt(b){const N=at();me(N,new Kt(N))}ge.STAT_EVENT="statevent";function mi(b,N){q.call(this,ge.STAT_EVENT,b),this.stat=N}g(mi,q);function en(b){const N=at();me(N,new mi(N,b))}ge.Ma="timingevent";function yd(b,N){q.call(this,ge.Ma,b),this.size=N}g(yd,q);function Gs(b,N){if(typeof b!="function")throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){b()},N)}function Qa(){this.g=!0}Qa.prototype.xa=function(){this.g=!1};function np(b,N,L,Y,ae,ve){b.info(function(){if(b.g)if(ve)for(var Oe="",Zt=ve.split("&"),Qn=0;Qn<Zt.length;Qn++){var Vt=Zt[Qn].split("=");if(1<Vt.length){var or=Vt[0];Vt=Vt[1];var ar=or.split("_");Oe=2<=ar.length&&ar[1]=="type"?Oe+(or+"="+Vt+"&"):Oe+(or+"=redacted&")}}else Oe=null;else Oe=ve;return"XMLHTTP REQ ("+Y+") [attempt "+ae+"]: "+N+`
1852`+L+`
1853`+Oe})}function rp(b,N,L,Y,ae,ve,Oe){b.info(function(){return"XMLHTTP RESP ("+Y+") [ attempt "+ae+"]: "+N+`
1854`+L+`
1855`+ve+" "+Oe})}function Ur(b,N,L,Y){b.info(function(){return"XMLHTTP TEXT ("+N+"): "+ip(b,L)+(Y?" "+Y:"")})}function _d(b,N){b.info(function(){return"TIMEOUT: "+N})}Qa.prototype.info=function(){};function ip(b,N){if(!b.g)return N;if(!N)return null;try{var L=JSON.parse(N);if(L){for(b=0;b<L.length;b++)if(Array.isArray(L[b])){var Y=L[b];if(!(2>Y.length)){var ae=Y[1];if(Array.isArray(ae)&&!(1>ae.length)){var ve=ae[0];if(ve!="noop"&&ve!="stop"&&ve!="close")for(var Oe=1;Oe<ae.length;Oe++)ae[Oe]=""}}}}return Ge(L)}catch{return N}}var Za={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},Ja={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"},tc;function $s(){}g($s,Ne),$s.prototype.g=function(){return new XMLHttpRequest},$s.prototype.i=function(){return{}},tc=new $s;function ki(b,N,L,Y){this.j=b,this.i=N,this.l=L,this.R=Y||1,this.U=new st(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new xd}function xd(){this.i=null,this.g="",this.h=!1}var sp={},bd={};function wd(b,N,L){b.L=1,b.v=Bt(yt(N)),b.m=L,b.P=!0,op(b,null)}function op(b,N){b.F=Date.now(),W(b),b.A=yt(b.v);var L=b.A,Y=b.R;Array.isArray(Y)||(Y=[String(Y)]),rT(L.i,"t",Y),b.C=0,L=b.j.J,b.h=new xd,b.g=bT(b.j,L?N:null,!b.m),0<b.O&&(b.M=new qe(u(b.Y,b,b.g),b.O)),N=b.U,L=b.g,Y=b.ca;var ae="readystatechange";Array.isArray(ae)||(ae&&(Ce[0]=ae.toString()),ae=Ce);for(var ve=0;ve<ae.length;ve++){var Oe=Xe(L,ae[ve],Y||N.handleEvent,!1,N.h||N);if(!Oe)break;N.g[Oe.key]=Oe}N=b.H?E(b.H):{},b.m?(b.u||(b.u="POST"),N["Content-Type"]="application/x-www-form-urlencoded",b.g.ea(b.A,b.u,b.m,N)):(b.u="GET",b.g.ea(b.A,b.u,null,N)),Dt(),np(b.i,b.u,b.A,b.l,b.R,b.m)}ki.prototype.ca=function(b){b=b.target;const N=this.M;N&&Ws(b)==3?N.j():this.Y(b)},ki.prototype.Y=function(b){try{if(b==this.g)e:{const ar=Ws(this.g);var N=this.g.Ba();const ic=this.g.Z();if(!(3>ar)&&(ar!=3||this.g&&(this.h.h||this.g.oa()||uT(this.g)))){this.J||ar!=4||N==7||(N==8||0>=ic?Dt(3):Dt(2)),pe(this);var L=this.g.Z();this.X=L;t:if(ap(this)){var Y=uT(this.g);b="";var ae=Y.length,ve=Ws(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){le(this),ue(this);var Oe="";break t}this.h.i=new a.TextDecoder}for(N=0;N<ae;N++)this.h.h=!0,b+=this.h.i.decode(Y[N],{stream:!(ve&&N==ae-1)});Y.length=0,this.h.g+=b,this.C=0,Oe=this.h.g}else Oe=this.g.oa();if(this.o=L==200,rp(this.i,this.u,this.A,this.l,this.R,ar,L),this.o){if(this.T&&!this.K){t:{if(this.g){var Zt,Qn=this.g;if((Zt=Qn.g?Qn.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!y(Zt)){var Vt=Zt;break t}}Vt=null}if(L=Vt)Ur(this.i,this.l,L,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,Le(this,L);else{this.o=!1,this.s=3,en(12),le(this),ue(this);break e}}if(this.P){L=!0;let Fi;for(;!this.J&&this.C<Oe.length;)if(Fi=Jy(this,Oe),Fi==bd){ar==4&&(this.s=4,en(14),L=!1),Ur(this.i,this.l,null,"[Incomplete Response]");break}else if(Fi==sp){this.s=4,en(15),Ur(this.i,this.l,Oe,"[Invalid Chunk]"),L=!1;break}else Ur(this.i,this.l,Fi,null),Le(this,Fi);if(ap(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),ar!=4||Oe.length!=0||this.h.h||(this.s=1,en(16),L=!1),this.o=this.o&&L,!L)Ur(this.i,this.l,Oe,"[Invalid Chunked Response]"),le(this),ue(this);else if(0<Oe.length&&!this.W){this.W=!0;var or=this.j;or.g==this&&or.ba&&!or.M&&(or.j.info("Great, no buffering proxy detected. Bytes received: "+Oe.length),r_(or),or.M=!0,en(11))}}else Ur(this.i,this.l,Oe,null),Le(this,Oe);ar==4&&le(this),this.o&&!this.J&&(ar==4?vT(this.j,this):(this.o=!1,W(this)))}else _j(this.g),L==400&&0<Oe.indexOf("Unknown SID")?(this.s=3,en(12)):(this.s=0,en(13)),le(this),ue(this)}}}catch{}finally{}};function ap(b){return b.g?b.u=="GET"&&b.L!=2&&b.j.Ca:!1}function Jy(b,N){var L=b.C,Y=N.indexOf(`
1856`,L);return Y==-1?bd:(L=Number(N.substring(L,Y)),isNaN(L)?sp:(Y+=1,Y+L>N.length?bd:(N=N.slice(Y,Y+L),b.C=Y+L,N)))}ki.prototype.cancel=function(){this.J=!0,le(this)};function W(b){b.S=Date.now()+b.I,ie(b,b.I)}function ie(b,N){if(b.B!=null)throw Error("WatchDog timer not null");b.B=Gs(u(b.ba,b),N)}function pe(b){b.B&&(a.clearTimeout(b.B),b.B=null)}ki.prototype.ba=function(){this.B=null;const b=Date.now();0<=b-this.S?(_d(this.i,this.A),this.L!=2&&(Dt(),en(17)),le(this),this.s=2,ue(this)):ie(this,this.S-b)};function ue(b){b.j.G==0||b.J||vT(b.j,b)}function le(b){pe(b);var N=b.M;N&&typeof N.ma=="function"&&N.ma(),b.M=null,Pe(b.U),b.g&&(N=b.g,b.g=null,N.abort(),N.ma())}function Le(b,N){try{var L=b.j;if(L.G!=0&&(L.g==b||ht(L.h,b))){if(!b.K&&ht(L.h,b)&&L.G==3){try{var Y=L.Da.g.parse(N)}catch{Y=null}if(Array.isArray(Y)&&Y.length==3){var ae=Y;if(ae[0]==0){e:if(!L.u){if(L.g)if(L.g.F+3e3<b.F)pp(L),fp(L);else break e;n_(L),en(18)}}else L.za=ae[1],0<L.za-L.T&&37500>ae[2]&&L.F&&L.v==0&&!L.C&&(L.C=Gs(u(L.Za,L),6e3));if(1>=et(L.h)&&L.ca){try{L.ca()}catch{}L.ca=void 0}}else el(L,11)}else if((b.K||L.g==b)&&pp(L),!y(N))for(ae=L.Da.g.parse(N),N=0;N<ae.length;N++){let Vt=ae[N];if(L.T=Vt[0],Vt=Vt[1],L.G==2)if(Vt[0]=="c"){L.K=Vt[1],L.ia=Vt[2];const or=Vt[3];or!=null&&(L.la=or,L.j.info("VER="+L.la));const ar=Vt[4];ar!=null&&(L.Aa=ar,L.j.info("SVER="+L.Aa));const ic=Vt[5];ic!=null&&typeof ic=="number"&&0<ic&&(Y=1.5*ic,L.L=Y,L.j.info("backChannelRequestTimeoutMs_="+Y)),Y=L;const Fi=b.g;if(Fi){const gp=Fi.g?Fi.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(gp){var ve=Y.h;ve.g||gp.indexOf("spdy")==-1&&gp.indexOf("quic")==-1&&gp.indexOf("h2")==-1||(ve.j=ve.l,ve.g=new Set,ve.h&&(vt(ve,ve.h),ve.h=null))}if(Y.D){const i_=Fi.g?Fi.g.getResponseHeader("X-HTTP-Session-Id"):null;i_&&(Y.ya=i_,jt(Y.I,Y.D,i_))}}L.G=3,L.l&&L.l.ua(),L.ba&&(L.R=Date.now()-b.F,L.j.info("Handshake RTT: "+L.R+"ms")),Y=L;var Oe=b;if(Y.qa=xT(Y,Y.J?Y.ia:null,Y.W),Oe.K){nt(Y.h,Oe);var Zt=Oe,Qn=Y.L;Qn&&(Zt.I=Qn),Zt.B&&(pe(Zt),W(Zt)),Y.g=Oe}else mT(Y);0<L.i.length&&hp(L)}else Vt[0]!="stop"&&Vt[0]!="close"||el(L,7);else L.G==3&&(Vt[0]=="stop"||Vt[0]=="close"?Vt[0]=="stop"?el(L,7):t_(L):Vt[0]!="noop"&&L.l&&L.l.ta(Vt),L.v=0)}}Dt(4)}catch{}}var $e=class{constructor(b,N){this.g=b,this.map=N}};function Fe(b){this.l=b||10,a.PerformanceNavigationTiming?(b=a.performance.getEntriesByType("navigation"),b=0<b.length&&(b[0].nextHopProtocol=="hq"||b[0].nextHopProtocol=="h2")):b=!!(a.chrome&&a.chrome.loadTimes&&a.chrome.loadTimes()&&a.chrome.loadTimes().wasFetchedViaSpdy),this.j=b?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function Ze(b){return b.h?!0:b.g?b.g.size>=b.j:!1}function et(b){return b.h?1:b.g?b.g.size:0}function ht(b,N){return b.h?b.h==N:b.g?b.g.has(N):!1}function vt(b,N){b.g?b.g.add(N):b.h=N}function nt(b,N){b.h&&b.h==N?b.h=null:b.g&&b.g.has(N)&&b.g.delete(N)}Fe.prototype.cancel=function(){if(this.i=Ht(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const b of this.g.values())b.cancel();this.g.clear()}};function Ht(b){if(b.h!=null)return b.i.concat(b.h.D);if(b.g!=null&&b.g.size!==0){let N=b.i;for(const L of b.g.values())N=N.concat(L.D);return N}return v(b.i)}function pn(b){if(b.V&&typeof b.V=="function")return b.V();if(typeof Map<"u"&&b instanceof Map||typeof Set<"u"&&b instanceof Set)return Array.from(b.values());if(typeof b=="string")return b.split("");if(l(b)){for(var N=[],L=b.length,Y=0;Y<L;Y++)N.push(b[Y]);return N}N=[],L=0;for(Y in b)N[L++]=b[Y];return N}function un(b){if(b.na&&typeof b.na=="function")return b.na();if(!b.V||typeof b.V!="function"){if(typeof Map<"u"&&b instanceof Map)return Array.from(b.keys());if(!(typeof Set<"u"&&b instanceof Set)){if(l(b)||typeof b=="string"){var N=[];b=b.length;for(var L=0;L<b;L++)N.push(L);return N}N=[],L=0;for(const Y in b)N[L++]=Y;return N}}}function Gt(b,N){if(b.forEach&&typeof b.forEach=="function")b.forEach(N,void 0);else if(l(b)||typeof b=="string")Array.prototype.forEach.call(b,N,void 0);else for(var L=un(b),Y=pn(b),ae=Y.length,ve=0;ve<ae;ve++)N.call(void 0,Y[ve],L&&L[ve],b)}var Ln=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function Je(b,N){if(b){b=b.split("&");for(var L=0;L<b.length;L++){var Y=b[L].indexOf("="),ae=null;if(0<=Y){var ve=b[L].substring(0,Y);ae=b[L].substring(Y+1)}else ve=b[L];N(ve,ae?decodeURIComponent(ae.replace(/\+/g," ")):"")}}}function Mn(b){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,b instanceof Mn){this.h=b.h,sr(this,b.j),this.o=b.o,this.g=b.g,wr(this,b.s),this.l=b.l;var N=b.i,L=new Ed;L.i=N.i,N.g&&(L.g=new Map(N.g),L.h=N.h),as(this,L),this.m=b.m}else b&&(N=String(b).match(Ln))?(this.h=!1,sr(this,N[1]||"",!0),this.o=mn(N[2]||""),this.g=mn(N[3]||"",!0),wr(this,N[4]),this.l=mn(N[5]||"",!0),as(this,N[6]||"",!0),this.m=mn(N[7]||"")):(this.h=!1,this.i=new Ed(null,this.h))}Mn.prototype.toString=function(){var b=[],N=this.j;N&&b.push(jr(N,Li,!0),":");var L=this.g;return(L||N=="file")&&(b.push("//"),(N=this.o)&&b.push(jr(N,Li,!0),"@"),b.push(encodeURIComponent(String(L)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),L=this.s,L!=null&&b.push(":",String(L))),(L=this.l)&&(this.g&&L.charAt(0)!="/"&&b.push("/"),b.push(jr(L,L.charAt(0)=="/"?lp:Io,!0))),(L=this.i.toString())&&b.push("?",L),(L=this.m)&&b.push("#",jr(L,dj)),b.join("")};function yt(b){return new Mn(b)}function sr(b,N,L){b.j=L?mn(N,!0):N,b.j&&(b.j=b.j.replace(/:$/,""))}function wr(b,N){if(N){if(N=Number(N),isNaN(N)||0>N)throw Error("Bad port number "+N);b.s=N}else b.s=null}function as(b,N,L){N instanceof Ed?(b.i=N,fj(b.i,b.h)):(L||(N=jr(N,uj)),b.i=new Ed(N,b.h))}function jt(b,N,L){b.i.set(N,L)}function Bt(b){return jt(b,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),b}function mn(b,N){return b?N?decodeURI(b.replace(/%25/g,"%2525")):decodeURIComponent(b):""}function jr(b,N,L){return typeof b=="string"?(b=encodeURI(b).replace(N,In),L&&(b=b.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),b):null}function In(b){return b=b.charCodeAt(0),"%"+(b>>4&15).toString(16)+(b&15).toString(16)}var Li=/[#\/\?@]/g,Io=/[#\?:]/g,lp=/[#\?]/g,uj=/[#\?@]/g,dj=/#/g;function Ed(b,N){this.h=this.g=null,this.i=b||null,this.j=!!N}function No(b){b.g||(b.g=new Map,b.h=0,b.i&&Je(b.i,function(N,L){b.add(decodeURIComponent(N.replace(/\+/g," ")),L)}))}t=Ed.prototype,t.add=function(b,N){No(this),this.i=null,b=nc(this,b);var L=this.g.get(b);return L||this.g.set(b,L=[]),L.push(N),this.h+=1,this};function tT(b,N){No(b),N=nc(b,N),b.g.has(N)&&(b.i=null,b.h-=b.g.get(N).length,b.g.delete(N))}function nT(b,N){return No(b),N=nc(b,N),b.g.has(N)}t.forEach=function(b,N){No(this),this.g.forEach(function(L,Y){L.forEach(function(ae){b.call(N,ae,Y,this)},this)},this)},t.na=function(){No(this);const b=Array.from(this.g.values()),N=Array.from(this.g.keys()),L=[];for(let Y=0;Y<N.length;Y++){const ae=b[Y];for(let ve=0;ve<ae.length;ve++)L.push(N[Y])}return L},t.V=function(b){No(this);let N=[];if(typeof b=="string")nT(this,b)&&(N=N.concat(this.g.get(nc(this,b))));else{b=Array.from(this.g.values());for(let L=0;L<b.length;L++)N=N.concat(b[L])}return N},t.set=function(b,N){return No(this),this.i=null,b=nc(this,b),nT(this,b)&&(this.h-=this.g.get(b).length),this.g.set(b,[N]),this.h+=1,this},t.get=function(b,N){return b?(b=this.V(b),0<b.length?String(b[0]):N):N};function rT(b,N,L){tT(b,N),0<L.length&&(b.i=null,b.g.set(nc(b,N),v(L)),b.h+=L.length)}t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const b=[],N=Array.from(this.g.keys());for(var L=0;L<N.length;L++){var Y=N[L];const ve=encodeURIComponent(String(Y)),Oe=this.V(Y);for(Y=0;Y<Oe.length;Y++){var ae=ve;Oe[Y]!==""&&(ae+="="+encodeURIComponent(String(Oe[Y]))),b.push(ae)}}return this.i=b.join("&")};function nc(b,N){return N=String(N),b.j&&(N=N.toLowerCase()),N}function fj(b,N){N&&!b.j&&(No(b),b.i=null,b.g.forEach(function(L,Y){var ae=Y.toLowerCase();Y!=ae&&(tT(this,Y),rT(this,ae,L))},b)),b.j=N}function hj(b,N){const L=new Qa;if(a.Image){const Y=new Image;Y.onload=h(Oo,L,"TestLoadImage: loaded",!0,N,Y),Y.onerror=h(Oo,L,"TestLoadImage: error",!1,N,Y),Y.onabort=h(Oo,L,"TestLoadImage: abort",!1,N,Y),Y.ontimeout=h(Oo,L,"TestLoadImage: timeout",!1,N,Y),a.setTimeout(function(){Y.ontimeout&&Y.ontimeout()},1e4),Y.src=b}else N(!1)}function pj(b,N){const L=new Qa,Y=new AbortController,ae=setTimeout(()=>{Y.abort(),Oo(L,"TestPingServer: timeout",!1,N)},1e4);fetch(b,{signal:Y.signal}).then(ve=>{clearTimeout(ae),ve.ok?Oo(L,"TestPingServer: ok",!0,N):Oo(L,"TestPingServer: server error",!1,N)}).catch(()=>{clearTimeout(ae),Oo(L,"TestPingServer: error",!1,N)})}function Oo(b,N,L,Y,ae){try{ae&&(ae.onload=null,ae.onerror=null,ae.onabort=null,ae.ontimeout=null),Y(L)}catch{}}function mj(){this.g=new ze}function gj(b,N,L){const Y=L||"";try{Gt(b,function(ae,ve){let Oe=ae;c(ae)&&(Oe=Ge(ae)),N.push(Y+ve+"="+encodeURIComponent(Oe))})}catch(ae){throw N.push(Y+"type="+encodeURIComponent("_badmap")),ae}}function cp(b){this.l=b.Ub||null,this.j=b.eb||!1}g(cp,Ne),cp.prototype.g=function(){return new up(this.l,this.j)},cp.prototype.i=function(b){return function(){return b}}({});function up(b,N){he.call(this),this.D=b,this.o=N,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}g(up,he),t=up.prototype,t.open=function(b,N){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=b,this.A=N,this.readyState=1,Td(this)},t.send=function(b){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const N={headers:this.u,method:this.B,credentials:this.m,cache:void 0};b&&(N.body=b),(this.D||a).fetch(new Request(this.A,N)).then(this.Sa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,Sd(this)),this.readyState=0},t.Sa=function(b){if(this.g&&(this.l=b,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=b.headers,this.readyState=2,Td(this)),this.g&&(this.readyState=3,Td(this),this.g)))if(this.responseType==="arraybuffer")b.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof a.ReadableStream<"u"&&"body"in b){if(this.j=b.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;iT(this)}else b.text().then(this.Ra.bind(this),this.ga.bind(this))};function iT(b){b.j.read().then(b.Pa.bind(b)).catch(b.ga.bind(b))}t.Pa=function(b){if(this.g){if(this.o&&b.value)this.response.push(b.value);else if(!this.o){var N=b.value?b.value:new Uint8Array(0);(N=this.v.decode(N,{stream:!b.done}))&&(this.response=this.responseText+=N)}b.done?Sd(this):Td(this),this.readyState==3&&iT(this)}},t.Ra=function(b){this.g&&(this.response=this.responseText=b,Sd(this))},t.Qa=function(b){this.g&&(this.response=b,Sd(this))},t.ga=function(){this.g&&Sd(this)};function Sd(b){b.readyState=4,b.l=null,b.j=null,b.v=null,Td(b)}t.setRequestHeader=function(b,N){this.u.append(b,N)},t.getResponseHeader=function(b){return this.h&&this.h.get(b.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const b=[],N=this.h.entries();for(var L=N.next();!L.done;)L=L.value,b.push(L[0]+": "+L[1]),L=N.next();return b.join(`\r
1857`)};function Td(b){b.onreadystatechange&&b.onreadystatechange.call(b)}Object.defineProperty(up.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(b){this.m=b?"include":"same-origin"}});function sT(b){let N="";return I(b,function(L,Y){N+=Y,N+=":",N+=L,N+=`\r
1858`}),N}function e_(b,N,L){e:{for(Y in L){var Y=!1;break e}Y=!0}Y||(L=sT(L),typeof b=="string"?L!=null&&encodeURIComponent(String(L)):jt(b,N,L))}function En(b){he.call(this),this.headers=new Map,this.o=b||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}g(En,he);var vj=/^https?$/i,yj=["POST","PUT"];t=En.prototype,t.Ha=function(b){this.J=b},t.ea=function(b,N,L,Y){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+b);N=N?N.toUpperCase():"GET",this.D=b,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():tc.g(),this.v=this.o?te(this.o):te(tc),this.g.onreadystatechange=u(this.Ea,this);try{this.B=!0,this.g.open(N,String(b),!0),this.B=!1}catch(ve){oT(this,ve);return}if(b=L||"",L=new Map(this.headers),Y)if(Object.getPrototypeOf(Y)===Object.prototype)for(var ae in Y)L.set(ae,Y[ae]);else if(typeof Y.keys=="function"&&typeof Y.get=="function")for(const ve of Y.keys())L.set(ve,Y.get(ve));else throw Error("Unknown input type for opt_headers: "+String(Y));Y=Array.from(L.keys()).find(ve=>ve.toLowerCase()=="content-type"),ae=a.FormData&&b instanceof a.FormData,!(0<=Array.prototype.indexOf.call(yj,N,void 0))||Y||ae||L.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[ve,Oe]of L)this.g.setRequestHeader(ve,Oe);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{cT(this),this.u=!0,this.g.send(b),this.u=!1}catch(ve){oT(this,ve)}};function oT(b,N){b.h=!1,b.g&&(b.j=!0,b.g.abort(),b.j=!1),b.l=N,b.m=5,aT(b),dp(b)}function aT(b){b.A||(b.A=!0,me(b,"complete"),me(b,"error"))}t.abort=function(b){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=b||7,me(this,"complete"),me(this,"abort"),dp(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),dp(this,!0)),En.aa.N.call(this)},t.Ea=function(){this.s||(this.B||this.u||this.j?lT(this):this.bb())},t.bb=function(){lT(this)};function lT(b){if(b.h&&typeof o<"u"&&(!b.v[1]||Ws(b)!=4||b.Z()!=2)){if(b.u&&Ws(b)==4)Ve(b.Ea,0,b);else if(me(b,"readystatechange"),Ws(b)==4){b.h=!1;try{const Oe=b.Z();e:switch(Oe){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var N=!0;break e;default:N=!1}var L;if(!(L=N)){var Y;if(Y=Oe===0){var ae=String(b.D).match(Ln)[1]||null;!ae&&a.self&&a.self.location&&(ae=a.self.location.protocol.slice(0,-1)),Y=!vj.test(ae?ae.toLowerCase():"")}L=Y}if(L)me(b,"complete"),me(b,"success");else{b.m=6;try{var ve=2<Ws(b)?b.g.statusText:""}catch{ve=""}b.l=ve+" ["+b.Z()+"]",aT(b)}}finally{dp(b)}}}}function dp(b,N){if(b.g){cT(b);const L=b.g,Y=b.v[0]?()=>{}:null;b.g=null,b.v=null,N||me(b,"ready");try{L.onreadystatechange=Y}catch{}}}function cT(b){b.I&&(a.clearTimeout(b.I),b.I=null)}t.isActive=function(){return!!this.g};function Ws(b){return b.g?b.g.readyState:0}t.Z=function(){try{return 2<Ws(this)?this.g.status:-1}catch{return-1}},t.oa=function(){try{return this.g?this.g.responseText:""}catch{return""}},t.Oa=function(b){if(this.g){var N=this.g.responseText;return b&&N.indexOf(b)==0&&(N=N.substring(b.length)),He(N)}};function uT(b){try{if(!b.g)return null;if("response"in b.g)return b.g.response;switch(b.H){case"":case"text":return b.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in b.g)return b.g.mozResponseArrayBuffer}return null}catch{return null}}function _j(b){const N={};b=(b.g&&2<=Ws(b)&&b.g.getAllResponseHeaders()||"").split(`\r
1859`);for(let Y=0;Y<b.length;Y++){if(y(b[Y]))continue;var L=A(b[Y]);const ae=L[0];if(L=L[1],typeof L!="string")continue;L=L.trim();const ve=N[ae]||[];N[ae]=ve,ve.push(L)}M(N,function(Y){return Y.join(", ")})}t.Ba=function(){return this.m},t.Ka=function(){return typeof this.l=="string"?this.l:String(this.l)};function Ad(b,N,L){return L&&L.internalChannelParams&&L.internalChannelParams[b]||N}function dT(b){this.Aa=0,this.i=[],this.j=new Qa,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=Ad("failFast",!1,b),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=Ad("baseRetryDelayMs",5e3,b),this.cb=Ad("retryDelaySeedMs",1e4,b),this.Wa=Ad("forwardChannelMaxRetries",2,b),this.wa=Ad("forwardChannelRequestTimeoutMs",2e4,b),this.pa=b&&b.xmlHttpFactory||void 0,this.Xa=b&&b.Tb||void 0,this.Ca=b&&b.useFetchStreams||!1,this.L=void 0,this.J=b&&b.supportsCrossDomainXhr||!1,this.K="",this.h=new Fe(b&&b.concurrentRequestLimit),this.Da=new mj,this.P=b&&b.fastHandshake||!1,this.O=b&&b.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=b&&b.Rb||!1,b&&b.xa&&this.j.xa(),b&&b.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&b&&b.detectBufferingProxy||!1,this.ja=void 0,b&&b.longPollingTimeout&&0<b.longPollingTimeout&&(this.ja=b.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}t=dT.prototype,t.la=8,t.G=1,t.connect=function(b,N,L,Y){en(0),this.W=b,this.H=N||{},L&&Y!==void 0&&(this.H.OSID=L,this.H.OAID=Y),this.F=this.X,this.I=xT(this,null,this.W),hp(this)};function t_(b){if(fT(b),b.G==3){var N=b.U++,L=yt(b.I);if(jt(L,"SID",b.K),jt(L,"RID",N),jt(L,"TYPE","terminate"),Md(b,L),N=new ki(b,b.j,N),N.L=2,N.v=Bt(yt(L)),L=!1,a.navigator&&a.navigator.sendBeacon)try{L=a.navigator.sendBeacon(N.v.toString(),"")}catch{}!L&&a.Image&&(new Image().src=N.v,L=!0),L||(N.g=bT(N.j,null),N.g.ea(N.v)),N.F=Date.now(),W(N)}_T(b)}function fp(b){b.g&&(r_(b),b.g.cancel(),b.g=null)}function fT(b){fp(b),b.u&&(a.clearTimeout(b.u),b.u=null),pp(b),b.h.cancel(),b.s&&(typeof b.s=="number"&&a.clearTimeout(b.s),b.s=null)}function hp(b){if(!Ze(b.h)&&!b.s){b.s=!0;var N=b.Ga;H||G(),$||(H(),$=!0),B.add(N,b),b.B=0}}function xj(b,N){return et(b.h)>=b.h.j-(b.s?1:0)?!1:b.s?(b.i=N.D.concat(b.i),!0):b.G==1||b.G==2||b.B>=(b.Va?0:b.Wa)?!1:(b.s=Gs(u(b.Ga,b,N),yT(b,b.B)),b.B++,!0)}t.Ga=function(b){if(this.s)if(this.s=null,this.G==1){if(!b){this.U=Math.floor(1e5*Math.random()),b=this.U++;const ae=new ki(this,this.j,b);let ve=this.o;if(this.S&&(ve?(ve=E(ve),T(ve,this.S)):ve=this.S),this.m!==null||this.O||(ae.H=ve,ve=null),this.P)e:{for(var N=0,L=0;L<this.i.length;L++){t:{var Y=this.i[L];if("__data__"in Y.map&&(Y=Y.map.__data__,typeof Y=="string")){Y=Y.length;break t}Y=void 0}if(Y===void 0)break;if(N+=Y,4096<N){N=L;break e}if(N===4096||L===this.i.length-1){N=L+1;break e}}N=1e3}else N=1e3;N=pT(this,ae,N),L=yt(this.I),jt(L,"RID",b),jt(L,"CVER",22),this.D&&jt(L,"X-HTTP-Session-Id",this.D),Md(this,L),ve&&(this.O?N="headers="+encodeURIComponent(String(sT(ve)))+"&"+N:this.m&&e_(L,this.m,ve)),vt(this.h,ae),this.Ua&&jt(L,"TYPE","init"),this.P?(jt(L,"$req",N),jt(L,"SID","null"),ae.T=!0,wd(ae,L,null)):wd(ae,L,N),this.G=2}}else this.G==3&&(b?hT(this,b):this.i.length==0||Ze(this.h)||hT(this))};function hT(b,N){var L;N?L=N.l:L=b.U++;const Y=yt(b.I);jt(Y,"SID",b.K),jt(Y,"RID",L),jt(Y,"AID",b.T),Md(b,Y),b.m&&b.o&&e_(Y,b.m,b.o),L=new ki(b,b.j,L,b.B+1),b.m===null&&(L.H=b.o),N&&(b.i=N.D.concat(b.i)),N=pT(b,L,1e3),L.I=Math.round(.5*b.wa)+Math.round(.5*b.wa*Math.random()),vt(b.h,L),wd(L,Y,N)}function Md(b,N){b.H&&I(b.H,function(L,Y){jt(N,Y,L)}),b.l&&Gt({},function(L,Y){jt(N,Y,L)})}function pT(b,N,L){L=Math.min(b.i.length,L);var Y=b.l?u(b.l.Na,b.l,b):null;e:{var ae=b.i;let ve=-1;for(;;){const Oe=["count="+L];ve==-1?0<L?(ve=ae[0].g,Oe.push("ofs="+ve)):ve=0:Oe.push("ofs="+ve);let Zt=!0;for(let Qn=0;Qn<L;Qn++){let Vt=ae[Qn].g;const or=ae[Qn].map;if(Vt-=ve,0>Vt)ve=Math.max(0,ae[Qn].g-100),Zt=!1;else try{gj(or,Oe,"req"+Vt+"_")}catch{Y&&Y(or)}}if(Zt){Y=Oe.join("&");break e}}}return b=b.i.splice(0,L),N.D=b,Y}function mT(b){if(!b.g&&!b.u){b.Y=1;var N=b.Fa;H||G(),$||(H(),$=!0),B.add(N,b),b.v=0}}function n_(b){return b.g||b.u||3<=b.v?!1:(b.Y++,b.u=Gs(u(b.Fa,b),yT(b,b.v)),b.v++,!0)}t.Fa=function(){if(this.u=null,gT(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var b=2*this.R;this.j.info("BP detection timer enabled: "+b),this.A=Gs(u(this.ab,this),b)}},t.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,en(10),fp(this),gT(this))};function r_(b){b.A!=null&&(a.clearTimeout(b.A),b.A=null)}function gT(b){b.g=new ki(b,b.j,"rpc",b.Y),b.m===null&&(b.g.H=b.o),b.g.O=0;var N=yt(b.qa);jt(N,"RID","rpc"),jt(N,"SID",b.K),jt(N,"AID",b.T),jt(N,"CI",b.F?"0":"1"),!b.F&&b.ja&&jt(N,"TO",b.ja),jt(N,"TYPE","xmlhttp"),Md(b,N),b.m&&b.o&&e_(N,b.m,b.o),b.L&&(b.g.I=b.L);var L=b.g;b=b.ia,L.L=1,L.v=Bt(yt(N)),L.m=null,L.P=!0,op(L,b)}t.Za=function(){this.C!=null&&(this.C=null,fp(this),n_(this),en(19))};function pp(b){b.C!=null&&(a.clearTimeout(b.C),b.C=null)}function vT(b,N){var L=null;if(b.g==N){pp(b),r_(b),b.g=null;var Y=2}else if(ht(b.h,N))L=N.D,nt(b.h,N),Y=1;else return;if(b.G!=0){if(N.o)if(Y==1){L=N.m?N.m.length:0,N=Date.now()-N.F;var ae=b.B;Y=at(),me(Y,new yd(Y,L)),hp(b)}else mT(b);else if(ae=N.s,ae==3||ae==0&&0<N.X||!(Y==1&&xj(b,N)||Y==2&&n_(b)))switch(L&&0<L.length&&(N=b.h,N.i=N.i.concat(L)),ae){case 1:el(b,5);break;case 4:el(b,10);break;case 3:el(b,6);break;default:el(b,2)}}}function yT(b,N){let L=b.Ta+Math.floor(Math.random()*b.cb);return b.isActive()||(L*=2),L*N}function el(b,N){if(b.j.info("Error code "+N),N==2){var L=u(b.fb,b),Y=b.Xa;const ae=!Y;Y=new Mn(Y||"//www.google.com/images/cleardot.gif"),a.location&&a.location.protocol=="http"||sr(Y,"https"),Bt(Y),ae?hj(Y.toString(),L):pj(Y.toString(),L)}else en(2);b.G=0,b.l&&b.l.sa(N),_T(b),fT(b)}t.fb=function(b){b?(this.j.info("Successfully pinged google.com"),en(2)):(this.j.info("Failed to ping google.com"),en(1))};function _T(b){if(b.G=0,b.ka=[],b.l){const N=Ht(b.h);(N.length!=0||b.i.length!=0)&&(m(b.ka,N),m(b.ka,b.i),b.h.i.length=0,v(b.i),b.i.length=0),b.l.ra()}}function xT(b,N,L){var Y=L instanceof Mn?yt(L):new Mn(L);if(Y.g!="")N&&(Y.g=N+"."+Y.g),wr(Y,Y.s);else{var ae=a.location;Y=ae.protocol,N=N?N+"."+ae.hostname:ae.hostname,ae=+ae.port;var ve=new Mn(null);Y&&sr(ve,Y),N&&(ve.g=N),ae&&wr(ve,ae),L&&(ve.l=L),Y=ve}return L=b.D,N=b.ya,L&&N&&jt(Y,L,N),jt(Y,"VER",b.la),Md(b,Y),Y}function bT(b,N,L){if(N&&!b.J)throw Error("Can't create secondary domain capable XhrIo object.");return N=b.Ca&&!b.pa?new En(new cp({eb:L})):new En(b.pa),N.Ha(b.J),N}t.isActive=function(){return!!this.l&&this.l.isActive(this)};function wT(){}t=wT.prototype,t.ua=function(){},t.ta=function(){},t.sa=function(){},t.ra=function(){},t.isActive=function(){return!0},t.Na=function(){};function mp(){}mp.prototype.g=function(b,N){return new Zr(b,N)};function Zr(b,N){he.call(this),this.g=new dT(N),this.l=b,this.h=N&&N.messageUrlParams||null,b=N&&N.messageHeaders||null,N&&N.clientProtocolHeaderRequired&&(b?b["X-Client-Protocol"]="webchannel":b={"X-Client-Protocol":"webchannel"}),this.g.o=b,b=N&&N.initMessageHeaders||null,N&&N.messageContentType&&(b?b["X-WebChannel-Content-Type"]=N.messageContentType:b={"X-WebChannel-Content-Type":N.messageContentType}),N&&N.va&&(b?b["X-WebChannel-Client-Profile"]=N.va:b={"X-WebChannel-Client-Profile":N.va}),this.g.S=b,(b=N&&N.Sb)&&!y(b)&&(this.g.m=b),this.v=N&&N.supportsCrossDomainXhr||!1,this.u=N&&N.sendRawJson||!1,(N=N&&N.httpSessionIdParam)&&!y(N)&&(this.g.D=N,b=this.h,b!==null&&N in b&&(b=this.h,N in b&&delete b[N])),this.j=new rc(this)}g(Zr,he),Zr.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},Zr.prototype.close=function(){t_(this.g)},Zr.prototype.o=function(b){var N=this.g;if(typeof b=="string"){var L={};L.__data__=b,b=L}else this.u&&(L={},L.__data__=Ge(b),b=L);N.i.push(new $e(N.Ya++,b)),N.G==3&&hp(N)},Zr.prototype.N=function(){this.g.l=null,delete this.j,t_(this.g),delete this.g,Zr.aa.N.call(this)};function ET(b){ke.call(this),b.__headers__&&(this.headers=b.__headers__,this.statusCode=b.__status__,delete b.__headers__,delete b.__status__);var N=b.__sm__;if(N){e:{for(const L in N){b=L;break e}b=void 0}(this.i=b)&&(b=this.i,N=N!==null&&b in N?N[b]:void 0),this.data=N}else this.data=b}g(ET,ke);function ST(){Me.call(this),this.status=1}g(ST,Me);function rc(b){this.g=b}g(rc,wT),rc.prototype.ua=function(){me(this.g,"a")},rc.prototype.ta=function(b){me(this.g,new ET(b))},rc.prototype.sa=function(b){me(this.g,new ST)},rc.prototype.ra=function(){me(this.g,"b")},mp.prototype.createWebChannel=mp.prototype.g,Zr.prototype.send=Zr.prototype.o,Zr.prototype.open=Zr.prototype.m,Zr.prototype.close=Zr.prototype.close,Bk=function(){return new mp},jk=function(){return at()},Uk=ge,Sb={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},Za.NO_ERROR=0,Za.TIMEOUT=8,Za.HTTP_ERROR=6,qm=Za,Ja.COMPLETE="complete",Fk=Ja,xe.EventType=Se,Se.OPEN="a",Se.CLOSE="b",Se.ERROR="c",Se.MESSAGE="d",he.prototype.listen=he.prototype.K,ef=xe,En.prototype.listenOnce=En.prototype.L,En.prototype.getLastError=En.prototype.Ka,En.prototype.getLastErrorCode=En.prototype.Ba,En.prototype.getStatus=En.prototype.Z,En.prototype.getResponseJson=En.prototype.Oa,En.prototype.getResponseText=En.prototype.oa,En.prototype.send=En.prototype.ea,En.prototype.setWithCredentials=En.prototype.Ha,Lk=En}).apply(typeof zp<"u"?zp:typeof self<"u"?self:typeof window<"u"?window:{});const gC="@firebase/firestore",vC="4.7.17";/**
1860 * @license
1861 * Copyright 2017 Google LLC
1862 *
1863 * Licensed under the Apache License, Version 2.0 (the "License");
1864 * you may not use this file except in compliance with the License.
1865 * You may obtain a copy of the License at
1866 *
1867 *   http://www.apache.org/licenses/LICENSE-2.0
1868 *
1869 * Unless required by applicable law or agreed to in writing, software
1870 * distributed under the License is distributed on an "AS IS" BASIS,
1871 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1872 * See the License for the specific language governing permissions and
1873 * limitations under the License.
1874 */class mr{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}mr.UNAUTHENTICATED=new mr(null),mr.GOOGLE_CREDENTIALS=new mr("google-credentials-uid"),mr.FIRST_PARTY=new mr("first-party-uid"),mr.MOCK_USER=new mr("mock-user");/**
1875 * @license
1876 * Copyright 2017 Google LLC
1877 *
1878 * Licensed under the Apache License, Version 2.0 (the "License");
1879 * you may not use this file except in compliance with the License.
1880 * You may obtain a copy of the License at
1881 *
1882 *   http://www.apache.org/licenses/LICENSE-2.0
1883 *
1884 * Unless required by applicable law or agreed to in writing, software
1885 * distributed under the License is distributed on an "AS IS" BASIS,
1886 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1887 * See the License for the specific language governing permissions and
1888 * limitations under the License.
1889 */let nd="11.9.0";/**
1890 * @license
1891 * Copyright 2017 Google LLC
1892 *
1893 * Licensed under the Apache License, Version 2.0 (the "License");
1894 * you may not use this file except in compliance with the License.
1895 * You may obtain a copy of the License at
1896 *
1897 *   http://www.apache.org/licenses/LICENSE-2.0
1898 *
1899 * Unless required by applicable law or agreed to in writing, software
1900 * distributed under the License is distributed on an "AS IS" BASIS,
1901 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1902 * See the License for the specific language governing permissions and
1903 * limitations under the License.
1904 */const Ll=new ay("@firebase/firestore");function Ac(){return Ll.logLevel}function We(t,...e){if(Ll.logLevel<=Nt.DEBUG){const n=e.map(TE);Ll.debug(`Firestore (${nd}): ${t}`,...n)}}function bo(t,...e){if(Ll.logLevel<=Nt.ERROR){const n=e.map(TE);Ll.error(`Firestore (${nd}): ${t}`,...n)}}function Pu(t,...e){if(Ll.logLevel<=Nt.WARN){const n=e.map(TE);Ll.warn(`Firestore (${nd}): ${t}`,...n)}}function TE(t){if(typeof t=="string")return t;try{/**
1905* @license
1906* Copyright 2020 Google LLC
1907*
1908* Licensed under the Apache License, Version 2.0 (the "License");
1909* you may not use this file except in compliance with the License.
1910* You may obtain a copy of the License at
1911*
1912*   http://www.apache.org/licenses/LICENSE-2.0
1913*
1914* Unless required by applicable law or agreed to in writing, software
1915* distributed under the License is distributed on an "AS IS" BASIS,
1916* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1917* See the License for the specific language governing permissions and
1918* limitations under the License.
1919*/return function(n){return JSON.stringify(n)}(t)}catch{return t}}/**
1920 * @license
1921 * Copyright 2017 Google LLC
1922 *
1923 * Licensed under the Apache License, Version 2.0 (the "License");
1924 * you may not use this file except in compliance with the License.
1925 * You may obtain a copy of the License at
1926 *
1927 *   http://www.apache.org/licenses/LICENSE-2.0
1928 *
1929 * Unless required by applicable law or agreed to in writing, software
1930 * distributed under the License is distributed on an "AS IS" BASIS,
1931 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1932 * See the License for the specific language governing permissions and
1933 * limitations under the License.
1934 */function ct(t,e,n){let r="Unexpected state";typeof e=="string"?r=e:n=e,Vk(t,r,n)}function Vk(t,e,n){let r=`FIRESTORE (${nd}) INTERNAL ASSERTION FAILED: ${e} (ID: ${t.toString(16)})`;if(n!==void 0)try{r+=" CONTEXT: "+JSON.stringify(n)}catch{r+=" CONTEXT: "+n}throw bo(r),new Error(r)}function Wt(t,e,n,r){let i="Unexpected state";typeof n=="string"?i=n:r=n,t||Vk(e,i,r)}function mt(t,e){return t}/**
1935 * @license
1936 * Copyright 2017 Google LLC
1937 *
1938 * Licensed under the Apache License, Version 2.0 (the "License");
1939 * you may not use this file except in compliance with the License.
1940 * You may obtain a copy of the License at
1941 *
1942 *   http://www.apache.org/licenses/LICENSE-2.0
1943 *
1944 * Unless required by applicable law or agreed to in writing, software
1945 * distributed under the License is distributed on an "AS IS" BASIS,
1946 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1947 * See the License for the specific language governing permissions and
1948 * limitations under the License.
1949 */const Te={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class it extends Ni{constructor(e,n){super(e,n),this.code=e,this.message=n,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/**
1950 * @license
1951 * Copyright 2017 Google LLC
1952 *
1953 * Licensed under the Apache License, Version 2.0 (the "License");
1954 * you may not use this file except in compliance with the License.
1955 * You may obtain a copy of the License at
1956 *
1957 *   http://www.apache.org/licenses/LICENSE-2.0
1958 *
1959 * Unless required by applicable law or agreed to in writing, software
1960 * distributed under the License is distributed on an "AS IS" BASIS,
1961 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1962 * See the License for the specific language governing permissions and
1963 * limitations under the License.
1964 */class co{constructor(){this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}}/**
1965 * @license
1966 * Copyright 2017 Google LLC
1967 *
1968 * Licensed under the Apache License, Version 2.0 (the "License");
1969 * you may not use this file except in compliance with the License.
1970 * You may obtain a copy of the License at
1971 *
1972 *   http://www.apache.org/licenses/LICENSE-2.0
1973 *
1974 * Unless required by applicable law or agreed to in writing, software
1975 * distributed under the License is distributed on an "AS IS" BASIS,
1976 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1977 * See the License for the specific language governing permissions and
1978 * limitations under the License.
1979 */class zk{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class Rq{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable(()=>n(mr.UNAUTHENTICATED))}shutdown(){}}class Pq{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class Iq{constructor(e){this.t=e,this.currentUser=mr.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){Wt(this.o===void 0,42304);let r=this.i;const i=l=>this.i!==r?(r=this.i,n(l)):Promise.resolve();let s=new co;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new co,e.enqueueRetryable(()=>i(this.currentUser))};const o=()=>{const l=s;e.enqueueRetryable(async()=>{await l.promise,await i(this.currentUser)})},a=l=>{We("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=l,this.o&&(this.auth.addAuthTokenListener(this.o),o())};this.t.onInit(l=>a(l)),setTimeout(()=>{if(!this.auth){const l=this.t.getImmediate({optional:!0});l?a(l):(We("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new co)}},0),o()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==e?(We("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(Wt(typeof r.accessToken=="string",31837,{l:r}),new zk(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return Wt(e===null||typeof e=="string",2055,{h:e}),new mr(e)}}class Nq{constructor(e,n,r){this.P=e,this.T=n,this.I=r,this.type="FirstParty",this.user=mr.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set("X-Goog-AuthUser",this.P);const e=this.R();return e&&this.A.set("Authorization",e),this.T&&this.A.set("X-Goog-Iam-Authorization-Token",this.T),this.A}}class Oq{constructor(e,n,r){this.P=e,this.T=n,this.I=r}getToken(){return Promise.resolve(new Nq(this.P,this.T,this.I))}start(e,n){e.enqueueRetryable(()=>n(mr.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class yC{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class Dq{constructor(e,n){this.V=n,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,Ti(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,n){Wt(this.o===void 0,3512);const r=s=>{s.error!=null&&We("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${s.error.message}`);const o=s.token!==this.m;return this.m=s.token,We("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?n(s.token):Promise.resolve()};this.o=s=>{e.enqueueRetryable(()=>r(s))};const i=s=>{We("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=s,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(s=>i(s)),setTimeout(()=>{if(!this.appCheck){const s=this.V.getImmediate({optional:!0});s?i(s):We("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new yC(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(n=>n?(Wt(typeof n.token=="string",44558,{tokenResult:n}),this.m=n.token,new yC(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}/**
1980 * @license
1981 * Copyright 2020 Google LLC
1982 *
1983 * Licensed under the Apache License, Version 2.0 (the "License");
1984 * you may not use this file except in compliance with the License.
1985 * You may obtain a copy of the License at
1986 *
1987 *   http://www.apache.org/licenses/LICENSE-2.0
1988 *
1989 * Unless required by applicable law or agreed to in writing, software
1990 * distributed under the License is distributed on an "AS IS" BASIS,
1991 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1992 * See the License for the specific language governing permissions and
1993 * limitations under the License.
1994 */function kq(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let r=0;r<t;r++)n[r]=Math.floor(256*Math.random());return n}/**
1995 * @license
1996 * Copyright 2023 Google LLC
1997 *
1998 * Licensed under the Apache License, Version 2.0 (the "License");
1999 * you may not use this file except in compliance with the License.
2000 * You may obtain a copy of the License at
2001 *
2002 *   http://www.apache.org/licenses/LICENSE-2.0
2003 *
2004 * Unless required by applicable law or agreed to in writing, software
2005 * distributed under the License is distributed on an "AS IS" BASIS,
2006 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2007 * See the License for the specific language governing permissions and
2008 * limitations under the License.
2009 */function Hk(){return new TextEncoder}/**
2010 * @license
2011 * Copyright 2017 Google LLC
2012 *
2013 * Licensed under the Apache License, Version 2.0 (the "License");
2014 * you may not use this file except in compliance with the License.
2015 * You may obtain a copy of the License at
2016 *
2017 *   http://www.apache.org/licenses/LICENSE-2.0
2018 *
2019 * Unless required by applicable law or agreed to in writing, software
2020 * distributed under the License is distributed on an "AS IS" BASIS,
2021 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2022 * See the License for the specific language governing permissions and
2023 * limitations under the License.
2024 */class Gk{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=62*Math.floor(4.129032258064516);let r="";for(;r.length<20;){const i=kq(40);for(let s=0;s<i.length;++s)r.length<20&&i[s]<n&&(r+=e.charAt(i[s]%62))}return r}}function At(t,e){return t<e?-1:t>e?1:0}function Tb(t,e){let n=0;for(;n<t.length&&n<e.length;){const r=t.codePointAt(n),i=e.codePointAt(n);if(r!==i){if(r<128&&i<128)return At(r,i);{const s=Hk(),o=Lq(s.encode(_C(t,n)),s.encode(_C(e,n)));return o!==0?o:At(r,i)}}n+=r>65535?2:1}return At(t.length,e.length)}function _C(t,e){return t.codePointAt(e)>65535?t.substring(e,e+2):t.substring(e,e+1)}function Lq(t,e){for(let n=0;n<t.length&&n<e.length;++n)if(t[n]!==e[n])return At(t[n],e[n]);return At(t.length,e.length)}function Iu(t,e,n){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}/**
2025 * @license
2026 * Copyright 2017 Google LLC
2027 *
2028 * Licensed under the Apache License, Version 2.0 (the "License");
2029 * you may not use this file except in compliance with the License.
2030 * You may obtain a copy of the License at
2031 *
2032 *   http://www.apache.org/licenses/LICENSE-2.0
2033 *
2034 * Unless required by applicable law or agreed to in writing, software
2035 * distributed under the License is distributed on an "AS IS" BASIS,
2036 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2037 * See the License for the specific language governing permissions and
2038 * limitations under the License.
2039 */const xC=-62135596800,bC=1e6;class zn{static now(){return zn.fromMillis(Date.now())}static fromDate(e){return zn.fromMillis(e.getTime())}static fromMillis(e){const n=Math.floor(e/1e3),r=Math.floor((e-1e3*n)*bC);return new zn(n,r)}constructor(e,n){if(this.seconds=e,this.nanoseconds=n,n<0)throw new it(Te.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new it(Te.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(e<xC)throw new it(Te.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new it(Te.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/bC}_compareTo(e){return this.seconds===e.seconds?At(this.nanoseconds,e.nanoseconds):At(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const e=this.seconds-xC;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}
vendor: 8,517 bytes, lines 2039-2118
2039}/**
2040 * @license
2041 * Copyright 2017 Google LLC
2042 *
2043 * Licensed under the Apache License, Version 2.0 (the "License");
2044 * you may not use this file except in compliance with the License.
2045 * You may obtain a copy of the License at
2046 *
2047 *   http://www.apache.org/licenses/LICENSE-2.0
2048 *
2049 * Unless required by applicable law or agreed to in writing, software
2050 * distributed under the License is distributed on an "AS IS" BASIS,
2051 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2052 * See the License for the specific language governing permissions and
2053 * limitations under the License.
2054 */class gt{static fromTimestamp(e){return new gt(e)}static min(){return new gt(new zn(0,0))}static max(){return new gt(new zn(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}/**
2055 * @license
2056 * Copyright 2017 Google LLC
2057 *
2058 * Licensed under the Apache License, Version 2.0 (the "License");
2059 * you may not use this file except in compliance with the License.
2060 * You may obtain a copy of the License at
2061 *
2062 *   http://www.apache.org/licenses/LICENSE-2.0
2063 *
2064 * Unless required by applicable law or agreed to in writing, software
2065 * distributed under the License is distributed on an "AS IS" BASIS,
2066 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2067 * See the License for the specific language governing permissions and
2068 * limitations under the License.
2069 */const wC="__name__";class hs{constructor(e,n,r){n===void 0?n=0:n>e.length&&ct(637,{offset:n,range:e.length}),r===void 0?r=e.length-n:r>e.length-n&&ct(1746,{length:r,range:e.length-n}),this.segments=e,this.offset=n,this.len=r}get length(){return this.len}isEqual(e){return hs.comparator(this,e)===0}child(e){const n=this.segments.slice(this.offset,this.limit());return e instanceof hs?e.forEach(r=>{n.push(r)}):n.push(e),this.construct(n)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length<this.length)return!1;for(let n=0;n<this.length;n++)if(this.get(n)!==e.get(n))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let n=0;n<this.length;n++)if(this.get(n)!==e.get(n))return!1;return!0}forEach(e){for(let n=this.offset,r=this.limit();n<r;n++)e(this.segments[n])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,n){const r=Math.min(e.length,n.length);for(let i=0;i<r;i++){const s=hs.compareSegments(e.get(i),n.get(i));if(s!==0)return s}return At(e.length,n.length)}static compareSegments(e,n){const r=hs.isNumericId(e),i=hs.isNumericId(n);return r&&!i?-1:!r&&i?1:r&&i?hs.extractNumericId(e).compare(hs.extractNumericId(n)):Tb(e,n)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return Ta.fromString(e.substring(4,e.length-2))}}class fn extends hs{construct(e,n,r){return new fn(e,n,r)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const n=[];for(const r of e){if(r.indexOf("//")>=0)throw new it(Te.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);n.push(...r.split("/").filter(i=>i.length>0))}return new fn(n)}static emptyPath(){return new fn([])}}const Fq=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class er extends hs{construct(e,n,r){return new er(e,n,r)}static isValidIdentifier(e){return Fq.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),er.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===wC}static keyField(){return new er([wC])}static fromServerFormat(e){const n=[];let r="",i=0;const s=()=>{if(r.length===0)throw new it(Te.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(r),r=""};let o=!1;for(;i<e.length;){const a=e[i];if(a==="\\"){if(i+1===e.length)throw new it(Te.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const l=e[i+1];if(l!=="\\"&&l!=="."&&l!=="`")throw new it(Te.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);r+=l,i+=2}else a==="`"?(o=!o,i++):a!=="."||o?(r+=a,i++):(s(),i++)}if(s(),o)throw new it(Te.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new er(n)}static emptyPath(){return new er([])}}/**
2070 * @license
2071 * Copyright 2017 Google LLC
2072 *
2073 * Licensed under the Apache License, Version 2.0 (the "License");
2074 * you may not use this file except in compliance with the License.
2075 * You may obtain a copy of the License at
2076 *
2077 *   http://www.apache.org/licenses/LICENSE-2.0
2078 *
2079 * Unless required by applicable law or agreed to in writing, software
2080 * distributed under the License is distributed on an "AS IS" BASIS,
2081 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2082 * See the License for the specific language governing permissions and
2083 * limitations under the License.
2084 */class ot{constructor(e){this.path=e}static fromPath(e){return new ot(fn.fromString(e))}static fromName(e){return new ot(fn.fromString(e).popFirst(5))}static empty(){return new ot(fn.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&fn.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,n){return fn.comparator(e.path,n.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new ot(new fn(e.slice()))}}/**
2085 * @license
2086 * Copyright 2021 Google LLC
2087 *
2088 * Licensed under the Apache License, Version 2.0 (the "License");
2089 * you may not use this file except in compliance with the License.
2090 * You may obtain a copy of the License at
2091 *
2092 *   http://www.apache.org/licenses/LICENSE-2.0
2093 *
2094 * Unless required by applicable law or agreed to in writing, software
2095 * distributed under the License is distributed on an "AS IS" BASIS,
2096 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2097 * See the License for the specific language governing permissions and
2098 * limitations under the License.
2099 */const fh=-1;function Uq(t,e){const n=t.toTimestamp().seconds,r=t.toTimestamp().nanoseconds+1,i=gt.fromTimestamp(r===1e9?new zn(n+1,0):new zn(n,r));return new ka(i,ot.empty(),e)}function jq(t){return new ka(t.readTime,t.key,fh)}class ka{constructor(e,n,r){this.readTime=e,this.documentKey=n,this.largestBatchId=r}static min(){return new ka(gt.min(),ot.empty(),fh)}static max(){return new ka(gt.max(),ot.empty(),fh)}}function Bq(t,e){let n=t.readTime.compareTo(e.readTime);return n!==0?n:(n=ot.comparator(t.documentKey,e.documentKey),n!==0?n:At(t.largestBatchId,e.largestBatchId))}/**
2100 * @license
2101 * Copyright 2020 Google LLC
2102 *
2103 * Licensed under the Apache License, Version 2.0 (the "License");
2104 * you may not use this file except in compliance with the License.
2105 * You may obtain a copy of the License at
2106 *
2107 *   http://www.apache.org/licenses/LICENSE-2.0
2108 *
2109 * Unless required by applicable law or agreed to in writing, software
2110 * distributed under the License is distributed on an "AS IS" BASIS,
2111 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2112 * See the License for the specific language governing permissions and
2113 * limitations under the License.
2114 */const Vq="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class zq{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}/**
2115 * @license
2116 * Copyright 2017 Google LLC
2117 *
2118 * Licensed under the Apache License, Version 2.0 (the "License");
2119 * you may not use this file except in compliance with the License.
2120 * You may obtain a copy of the License at
2121 *
2122 *   http://www.apache.org/licenses/LICENSE-2.0
2123 *
2124 * Unless required by applicable law or agreed to in writing, software
2125 * distributed under the License is distributed on an "AS IS" BASIS,
2126 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2127 * See the License for the specific language governing permissions and
2128 * limitations under the License.
2129 */async function rd(t){if(t.code!==Te.FAILED_PRECONDITION||t.message!==Vq)throw t;We("LocalStore","Unexpectedly lost primary lease")}/**
2130 * @license
2131 * Copyright 2017 Google LLC
2132 *
2133 * Licensed under the Apache License, Version 2.0 (the "License");
2134 * you may not use this file except in compliance with the License.
2135 * You may obtain a copy of the License at
2136 *
2137 *   http://www.apache.org/licenses/LICENSE-2.0
2138 *
2139 * Unless required by applicable law or agreed to in writing, software
2140 * distributed under the License is distributed on an "AS IS" BASIS,
2141 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2142 * See the License for the specific language governing permissions and
2143 * limitations under the License.
2144 */class be{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)},n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)})}catch(e){return this.next(void 0,e)}next(e,n){return this.callbackAttached&&ct(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new be((r,i)=>{this.nextCallback=s=>{this.wrapSuccess(e,s).next(r,i)},this.catchCallback=s=>{this.wrapFailure(n,s).next(r,i)}})}toPromise(){return new Promise((e,n)=>{this.next(e,n)})}wrapUserFunction(e){try{const n=e();return n instanceof be?n:be.resolve(n)}catch(n){return be.reject(n)}}wrapSuccess(e,n){return e?this.wrapUserFunction(()=>e(n)):be.resolve(n)}wrapFailure(e,n){return e?this.wrapUserFunction(()=>e(n)):be.reject(n)}static resolve(e){return new be((n,r)=>{n(e)})}static reject(e){return new be((n,r)=>{r(e)})}static waitFor(e){return new be((n,r)=>{let i=0,s=0,o=!1;e.forEach(a=>{++i,a.next(()=>{++s,o&&s===i&&n()},l=>r(l))}),o=!0,s===i&&n()})}static or(e){let n=be.resolve(!1);for(const r of e)n=n.next(i=>i?be.resolve(i):r());return n}static forEach(e,n){const r=[];return e.forEach((i,s)=>{r.push(n.call(this,i,s))}),this.waitFor(r)}static mapArray(e,n){return new be((r,i)=>{const s=e.length,o=new Array(s);let a=0;for(let l=0;l<s;l++){const c=l;n(e[c]).next(d=>{o[c]=d,++a,a===s&&r(o)},d=>i(d))}})}static doWhile(e,n){return new be((r,i)=>{const s=()=>{e()===!0?n().next(()=>{s()},i):r()};s()})}}function Hq(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}function id(t){return t.name==="IndexedDbTransactionError"}/**
2145 * @license
2146 * Copyright 2018 Google LLC
2147 *
2148 * Licensed under the Apache License, Version 2.0 (the "License");
2149 * you may not use this file except in compliance with the License.
2150 * You may obtain a copy of the License at
2151 *
2152 *   http://www.apache.org/licenses/LICENSE-2.0
2153 *
2154 * Unless required by applicable law or agreed to in writing, software
2155 * distributed under the License is distributed on an "AS IS" BASIS,
2156 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2157 * See the License for the specific language governing permissions and
2158 * limitations under the License.
2159 */class hy{constructor(e,n){this.previousValue=e,n&&(n.sequenceNumberHandler=r=>this.ue(r),this.ce=r=>n.writeSequenceNumber(r))}ue(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ce&&this.ce(e),e}}hy.le=-1;/**
2160 * @license
2161 * Copyright 2017 Google LLC
2162 *
2163 * Licensed under the Apache License, Version 2.0 (the "License");
2164 * you may not use this file except in compliance with the License.
2165 * You may obtain a copy of the License at
2166 *
2167 *   http://www.apache.org/licenses/LICENSE-2.0
2168 *
2169 * Unless required by applicable law or agreed to in writing, softw
vendor: 7,495 bytes, lines 2169-2219
2169are
2170 * distributed under the License is distributed on an "AS IS" BASIS,
2171 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2172 * See the License for the specific language governing permissions and
2173 * limitations under the License.
2174 */const AE=-1;function py(t){return t==null}function Jg(t){return t===0&&1/t==-1/0}function Gq(t){return typeof t=="number"&&Number.isInteger(t)&&!Jg(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}/**
2175 * @license
2176 * Copyright 2017 Google LLC
2177 *
2178 * Licensed under the Apache License, Version 2.0 (the "License");
2179 * you may not use this file except in compliance with the License.
2180 * You may obtain a copy of the License at
2181 *
2182 *   http://www.apache.org/licenses/LICENSE-2.0
2183 *
2184 * Unless required by applicable law or agreed to in writing, software
2185 * distributed under the License is distributed on an "AS IS" BASIS,
2186 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2187 * See the License for the specific language governing permissions and
2188 * limitations under the License.
2189 */const $k="�";function $q(t){let e="";for(let n=0;n<t.length;n++)e.length>0&&(e=EC(e)),e=Wq(t.get(n),e);return EC(e)}function Wq(t,e){let n=e;const r=t.length;for(let i=0;i<r;i++){const s=t.charAt(i);switch(s){case"\0":n+="��";break;case $k:n+="��";break;default:n+=s}}return n}function EC(t){return t+$k+"�"}/**
2190 * @license
2191 * Copyright 2017 Google LLC
2192 *
2193 * Licensed under the Apache License, Version 2.0 (the "License");
2194 * you may not use this file except in compliance with the License.
2195 * You may obtain a copy of the License at
2196 *
2197 *   http://www.apache.org/licenses/LICENSE-2.0
2198 *
2199 * Unless required by applicable law or agreed to in writing, software
2200 * distributed under the License is distributed on an "AS IS" BASIS,
2201 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2202 * See the License for the specific language governing permissions and
2203 * limitations under the License.
2204 */function SC(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Xa(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function qq(t,e){const n=[];for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.push(e(t[r],r,t));return n}function Wk(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}/**
2205 * @license
2206 * Copyright 2017 Google LLC
2207 *
2208 * Licensed under the Apache License, Version 2.0 (the "License");
2209 * you may not use this file except in compliance with the License.
2210 * You may obtain a copy of the License at
2211 *
2212 *   http://www.apache.org/licenses/LICENSE-2.0
2213 *
2214 * Unless required by applicable law or agreed to in writing, software
2215 * distributed under the License is distributed on an "AS IS" BASIS,
2216 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2217 * See the License for the specific language governing permissions and
2218 * limitations under the License.
2219 */class wn{constructor(e,n){this.comparator=e,this.root=n||Jn.EMPTY}insert(e,n){return new wn(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,Jn.BLACK,null,null))}remove(e){return new wn(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Jn.BLACK,null,null))}get(e){let n=this.root;for(;!n.isEmpty();){const r=this.comparator(e,n.key);if(r===0)return n.value;r<0?n=n.left:r>0&&(n=n.right)}return null}indexOf(e){let n=0,r=this.root;for(;!r.isEmpty();){const i=this.comparator(e,r.key);if(i===0)return n+r.left.size;i<0?r=r.left:(n+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((n,r)=>(e(n,r),!1))}toString(){const e=[];return this.inorderTraversal((n,r)=>(e.push(`${n}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new Hp(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new Hp(this.root,e,this.comparator,!1)}getReverseIterator(){return new Hp(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new Hp(this.root,e,this.comparator,!0)}}class Hp{constructor(e,n,r,i){this.isReverse=i,this.nodeStack=[];let s=1;for(;!e.isEmpty();)if(s=n?r(e.key,n):1,n&&i&&(s*=-1),s<0)e=this.isReverse?e.left:e.right;else{if(s===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const 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}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Jn{constructor(e,n,r,i,s){this.key=e,this.value=n,this.color=r??Jn.RED,this.left=i??Jn.EMPTY,this.right=s??Jn.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,n,r,i,s){return new Jn(e??this.key,n??this.value,r??this.color,i??this.left,s??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,r){let i=this;const s=r(e,i.key);return i=s<0?i.copy(null,null,null,i.left.insert(e,n,r),null):s===0?i.copy(null,n,null,null,null):i.copy(null,null,null,null,i.right.insert(e,n,r)),i.fixUp()}removeMin(){if(this.left.isEmpty())return Jn.EMPTY;let 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()}remove(e,n){let r,i=this;if(n(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),n(e,i.key)===0){if(i.right.isEmpty())return Jn.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.fixUp()}isRed(){return this.color}fixUp(){let 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}moveRedLeft(){let 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}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,Jn.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Jn.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const 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)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw ct(43730,{key:this.key,value:this.value});
2219if(this.right.isRed())throw ct(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw ct(27949);return e+(this.isRed()?0:1)}}Jn.EMPTY=null,Jn.RED=!0,Jn.BLACK=!1;Jn.EMPTY=new class{constructor(){this.size=0}get key(){throw ct(57766)}get value(){throw ct(16141)}get color(){throw ct(16727)}get left(){throw ct(29726)}get right(){throw ct(36894)}copy(e,n,r,i,s){return this}insert(e,n,r){return new Jn(e,n)}remove(e,n){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/**
2220 * @license
2221 * Copyright 2017 Google LLC
2222 *
2223 * Licensed under the Apache License, Version 2.0 (the "License");
2224 * you may not use this file except in compliance with the License.
2225 * You may obtain a copy of the License at
2226 *
2227 *   http://www.apache.org/licenses/LICENSE-2.0
2228 *
2229 * Unless required by applicable law or agreed to in writing, software
2230 * distributed under the License is distributed on an "AS IS" BASIS,
2231 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2232 * See the License for the specific language governing permissions and
2233 * limitations under the License.
2234 */class Hn{constructor(e){this.comparator=e,this.data=new wn(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((n,r)=>(e(n),!1))}forEachInRange(e,n){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const i=r.getNext();if(this.comparator(i.key,e[1])>=0)return;n(i.key)}}forEachWhile(e,n){let r;for(r=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null}getIterator(){return new TC(this.data.getIterator())}getIteratorFrom(e){return new TC(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let n=this;return n.size<e.size&&(n=e,e=this),e.forEach(r=>{n=n.add(r)}),n}isEqual(e){if(!(e instanceof Hn)||this.size!==e.size)return!1;const n=this.data.getIterator(),r=e.data.getIterator();for(;n.hasNext();){const i=n.getNext().key,s=r.getNext().key;if(this.comparator(i,s)!==0)return!1}return!0}toArray(){const e=[];return this.forEach(n=>{e.push(n)}),e}toString(){const e=[];return this.forEach(n=>e.push(n)),"SortedSet("+e.toString()+")"}copy(e){const n=new Hn(this.comparator);return n.data=e,n}}class TC{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/**
2235 * @license
2236 * Copyright 2020 Google LLC
2237 *
2238 * Licensed under the Apache License, Version 2.0 (the "License");
2239 * you may not use this file except in compliance with the License.
2240 * You may obtain a copy of the License at
2241 *
2242 *   http://www.apache.org/licenses/LICENSE-2.0
2243 *
2244 * Unless required by applicable law or agreed to in writing, software
2245 * distributed under the License is distributed on an "AS IS" BASIS,
2246 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2247 * See the License for the specific language governing permissions and
2248 * limitations under the License.
2249 */class li{constructor(e){this.fields=e,e.sort(er.comparator)}static empty(){return new li([])}unionWith(e){let n=new Hn(er.comparator);for(const r of this.fields)n=n.add(r);for(const r of e)n=n.add(r);return new li(n.toArray())}covers(e){for(const n of this.fields)if(n.isPrefixOf(e))return!0;return!1}isEqual(e){return Iu(this.fields,e.fields,(n,r)=>n.isEqual(r))}}/**
2250 * @license
2251 * Copyright 2023 Google LLC
2252 *
2253 * Licensed under the Apache License, Version 2.0 (the "License");
2254 * you may not use this file except in compliance with the License.
2255 * You may obtain a copy of the License at
2256 *
2257 *   http://www.apache.org/licenses/LICENSE-2.0
2258 *
2259 * Unless required by applicable law or agreed to in writing, softw
2259are
2260 * distributed under the License is distributed on an "AS IS" BASIS,
2261 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2262 * See the License for the specific language governing permissions and
2263 * limitations under the License.
2264 */class qk extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/**
2265 * @license
2266 * Copyright 2020 Google LLC
2267 *
2268 * Licensed under the Apache License, Version 2.0 (the "License");
2269 * you may not use this file except in compliance with the License.
2270 * You may obtain a copy of the License at
2271 *
2272 *   http://www.apache.org/licenses/LICENSE-2.0
2273 *
2274 * Unless required by applicable law or agreed to in writing, software
2275 * distributed under the License is distributed on an "AS IS" BASIS,
2276 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2277 * See the License for the specific language governing permissions and
2278 * limitations under the License.
2279 */class ir{constructor(e){this.binaryString=e}static fromBase64String(e){const n=function(i){try{return atob(i)}catch(s){throw typeof DOMException<"u"&&s instanceof DOMException?new qk("Invalid base64 string: "+s):s}}(e);return new ir(n)}static fromUint8Array(e){const n=function(i){let s="";for(let o=0;o<i.length;++o)s+=String.fromCharCode(i[o]);return s}(e);return new ir(n)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return function(n){return btoa(n)}(this.binaryString)}toUint8Array(){return function(n){const r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return r}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return At(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}ir.EMPTY_BYTE_STRING=new ir("");const Kq=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function La(t){if(Wt(!!t,39018),typeof t=="string"){let e=0;const n=Kq.exec(t);if(Wt(!!n,46558,{timestamp:t}),n[1]){let i=n[1];i=(i+"000000000").substr(0,9),e=Number(i)}const r=new Date(t);return{seconds:Math.floor(r.getTime()/1e3),nanos:e}}return{seconds:Cn(t.seconds),nanos:Cn(t.nanos)}}function Cn(t){return typeof t=="number"?t:typeof t=="string"?Number(t):0}function Fa(t){return typeof t=="string"?ir.fromBase64String(t):ir.fromUint8Array(t)}/**
2280 * @license
2281 * Copyright 2020 Google LLC
2282 *
2283 * Licensed under the Apache License, Version 2.0 (the "License");
2284 * you may not use this file except in compliance with the License.
2285 * You may obtain a copy of the License at
2286 *
2287 *   http://www.apache.org/licenses/LICENSE-2.0
2288 *
2289 * Unless required by applicable law or agreed to in writing, software
2290 * distributed under the License is distributed on an "AS IS" BASIS,
2291 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2292 * See the License for the specific language governing permissions and
2293 * limitations under the License.
2294 */const Kk="server_timestamp",Xk="__type__",Yk="__previous_value__",Qk="__local_write_time__";function ME(t){var e,n;return((n=(((e=t==null?void 0:t.mapValue)===null||e===void 0?void 0:e.fields)||{})[Xk])===null||n===void 0?void 0:n.stringValue)===Kk}function my(t){const e=t.mapValue.fields[Yk];return ME(e)?my(e):e}function hh(t){const e=La(t.mapValue.fields[Qk].timestampValue);return new zn(e.seconds,e.nanos)}/**
2295 * @license
2296 * Copyright 2017 Google LLC
2297 *
2298 * Licensed under the Apache License, Version 2.0 (the "License");
2299 * you may not use this file except in compliance with the License.
2300 * You may obtain a copy of the License at
2301 *
2302 *   http://www.apache.org/licenses/LICENSE-2.0
2303 *
2304 * Unless required by applicable law or agreed to in writing, software
2305 * distributed under the License is distributed on an "AS IS" BASIS,
2306 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2307 * See the License for the specific language governing permissions and
2308 * limitations under the License.
2309 */class Xq{constructor(e,n,r,i,s,o,a,l,c,d){this.databaseId=e,this.appId=n,this.persistenceKey=r,this.host=i,this.ssl=s,this.forceLongPolling=o,this.autoDetectLongPolling=a,this.longPollingOptions=l,this.useFetchStreams=c,this.isUsingEmulator=d}}const ev="(default)";class ph{constructor(e,n){this.projectId=e,this.database=n||ev}static empty(){return new ph("","")}get isDefaultDatabase(){return this.database===ev}isEqual(e){return e instanceof ph&&e.projectId===this.projectId&&e.database===this.database}}/**
2310 * @license
2311 * Copyright 2020 Google LLC
2312 *
2313 * Licensed under the Apache License, Version 2.0 (the "License");
2314 * you may not use this file except in compliance with the License.
2315 * You may obtain a copy of the License at
2316 *
2317 *   http://www.apache.org/licenses/LICENSE-2.0
2318 *
2319 * Unless required by applicable law or agreed to in writing, software
2320 * distributed under the License is distributed on an "AS IS" BASIS,
2321 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2322 * See the License for the specific language governing permissions and
2323 * limitations under the License.
2324 */const Zk="__type__",Jk="__max__",Gp={mapValue:{fields:{__type__:{stringValue:Jk}}}},eL="__vector__",tv="value";function Ua(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?ME(t)?4:Qq(t)?9007199254740991:Yq(t)?10:11:ct(28295,{value:t})}function Os(t,e){if(t===e)return!0;const n=Ua(t);if(n!==Ua(e))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return hh(t).isEqual(hh(e));case 3:return function(i,s){if(typeof i.timestampValue=="string"&&typeof s.timestampValue=="string"&&i.timestampValue.length===s.timestampValue.length)return i.timestampValue===s.timestampValue;const o=La(i.timestampValue),a=La(s.timestampValue);return o.seconds===a.seconds&&o.nanos===a.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(i,s){return Fa(i.bytesValue).isEqual(Fa(s.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(i,s){return Cn(i.geoPointValue.latitude)===Cn(s.geoPointValue.latitude)&&Cn(i.geoPointValue.longitude)===Cn(s.geoPointValue.longitude)}(t,e);case 2:return function(i,s){if("integerValue"in i&&"integerValue"in s)return Cn(i.integerValue)===Cn(s.integerValue);if("doubleValue"in i&&"doubleValue"in s){const o=Cn(i.doubleValue),a=Cn(s.doubleValue);return o===a?Jg(o)===Jg(a):isNaN(o)&&isNaN(a)}return!1}(t,e);case 9:return Iu(t.arrayValue.values||[],e.arrayValue.values||[],Os);case 10:case 11:return function(i,s){const o=i.mapValue.fields||{},a=s.mapValue.fields||{};if(SC(o)!==SC(a))return!1;for(const l in o)if(o.hasOwnProperty(l)&&(a[l]===void 0||!Os(o[l],a[l])))return!1;return!0}(t,e);default:return ct(52216,{left:t})}}function mh(t,e){return(t.values||[]).find(n=>Os(n,e))!==void 0}function Nu(t,e){if(t===e)return 0;const n=Ua(t),r=Ua(e);if(n!==r)return At(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return At(t.booleanValue,e.booleanValue);case 2:return function(s,o){const a=Cn(s.integerValue||s.doubleValue),l=Cn(o.integerValue||o.doubleValue);return a<l?-1:a>l?1:a===l?0:isNaN(a)?isNaN(l)?0:-1:1}(t,e);case 3:return AC(t.timestampValue,e.timestampValue);case 4:return AC(hh(t),hh(e));case 5:return Tb(t.stringValue,e.stringValue);case 6:return function(s,o){const a=Fa(s),l=Fa(o);return a.compareTo(l)}(t.bytesValue,e.bytesValue);case 7:return function(s,o){const a=s.split("/"),l=o.split("/");for(let c=0;c<a.length&&c<l.length;c++){const d=At(a[c],l[c]);if(d!==0)return d}return At(a.length,l.length)}(t.referenceValue,e.referenceValue);case 8:return function(s,o){const a=At(Cn(s.latitude),Cn(o.latitude));return a!==0?a:At(Cn(s.longitude),Cn(o.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return MC(t.arrayValue,e.arrayValue);case 10:return function(s,o){var a,l,c,d;const f=s.fields||{},u=o.fields||{},h=(a=f[tv])===null||a===void 0?void 0:a.arrayValue,g=(l=u[tv])===null||l===void 0?void 0:l.arrayValue,v=At(((c=h==null?void 0:h.values)===null||c===void 0?void 0:c.length)||0,((d=g==null?void 0:g.values)===null||d===void 0?void 0:d.length)||0);return v!==0?v:MC(h,g)}(t.mapValue,e.mapValue);case 11:return function(s,o){if(s===Gp.mapValue&&o===Gp.mapValue)return 0;if(s===Gp.mapValue)return 1;if(o===Gp.mapValue)return-1;const a=s.fields||{},l=Object.keys(a),c=o.fields||{},d=Object.keys(c);l.sort(),d.sort();for(let f=0;f<l.length&&f<d.length;++f){const u=Tb(l[f],d[f]);if(u!==0)return u;const h=Nu(a[l[f]],c[d[f]]);if(h!==0)return h}return At(l.length,d.length)}(t.mapValue,e.mapValue);default:throw ct(23264,{Pe:n})}}function AC(t,e){if(typeof t=="string"&&typeof e=="string"&&t.length===e.length)return At(t,e);const n=La(t),r=La(e),i=At(n.seconds,r.seconds);return i!==0?i:At(n.nanos,r.nanos)}function MC(t,e){const n=t.values||[],r=e.values||[];for(let i=0;i<n.length&&i<r.length;++i){const s=Nu(n[i],r[i]);if(s)return s}return At(n.length,r.length)}function Ou(t){return Ab(t)}function Ab(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(n){const r=La(n);return`time(${r.seconds},${r.nanos})`}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?function(n){return Fa(n).toBase64()}(t.bytesValue):"referenceValue"in t?function(n){return ot.fromName(n).toString()}(t.referenceValue):"geoPointValue"in t?function(n){return`geo(${n.latitude},${n.longitude})`}(t.geoPointValue):"arrayValue"in t?function(n){let r="[",i=!0;for(const s of n.values||[])i?i=!1:r+=",",r+=Ab(s);return r+"]"}(t.arrayValue):"mapValue"in t?function(n){const r=Object.keys(n.fields||{}).sort();let i="{",s=!0;for(const o of r)s?s=!1:i+=",",i+=`${o}:${Ab(n.fields[o])}`;return i+"}"}(t.mapValue):ct(61005,{value:t})}function Km(t){switch(Ua(t)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const e=my(t);return e?16+Km(e):16;case 5:return 2*t.stringValue.length;case 6:return Fa(t.bytesValue).approximateByteSize();case 7:return t.referenceValue.length;case 9:return function(r){return(r.values||[]).reduce((i,s)=>i+Km(s),0)}(t.arrayValue);case 10:case 11:return function(r){let i=0;return Xa(r.fields,(s,o)=>{i+=s.length+Km(o)}),i}(t.mapValue);default:throw ct(13486,{value:t})}}function Mb(t){return!!t&&"integerValue"in t}function CE(t){return!!t&&"arrayValue"in t}function CC(t){return!!t&&"nullValue"in t}function RC(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function Xm(t){return!!t&&"mapValue"in t}function Yq(t){var e,n;return((n=(((e=t==null?void 0:t.mapValue)===null||e===void 0?void 0:e.fields)||{})[Zk])===null||n===void 0?void 0:n.stringValue)===eL}function Pf(t){if(t.geoPointValue)return{geoPointValue:Object.assign({},t.geoPointValue)};if(t.timestampValue&&typeof t.timestampValue=="object")return{timestampValue:Object.assign({},t.timestampValue)};if(t.mapValue){const e={mapValue:{fields:{}}};return Xa(t.mapValue.fields,(n,r)=>e.mapValue.fields[n]=Pf(r)),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Pf(t.arrayValue.values[n]);return e}return Object.assign({},t)}function Qq(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue===Jk}/**
2325 * @license
2326 * Copyright 2017 Google LLC
2327 *
2328 * Licensed under the Apache License, Version 2.0 (the "License");
2329 * you may not use this file except in compliance with the License.
2330 * You may obtain a copy of the License at
2331 *
2332 *   http://www.apache.org/licenses/LICENSE-2.0
2333 *
2334 * Unless required by applicable law or agreed to in writing, software
2335 * distributed under the License is distributed on an "AS IS" BASIS,
2336 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2337 * See the License for the specific language governing permissions and
2338 * limitations under the License.
2339 */class Hr{constructor(e){this.value=e}static empty(){return new Hr({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let n=this.value;for(let r=0;r<e.length-1;++r)if(n=(n.mapValue.fields||{})[e.get(r)],!Xm(n))return null;return n=(n.mapValue.fields||{})[e.lastSegment()],n||null}}set(e,n){this.getFieldsMap(e.popLast())[e.lastSegment()]=Pf(n)}setAll(e){let n=er.emptyPath(),r={},i=[];e.forEach((o,a)=>{if(!n.isImmediateParentOf(a)){const l=this.getFieldsMap(n);this.applyChanges(l,r,i),r={},i=[],n=a.popLast()}o?r[a.lastSegment()]=Pf(o):i.push(a.lastSegment())});const s=this.getFieldsMap(n);this.applyChanges(s,r,i)}delete(e){const n=this.field(e.popLast());Xm(n)&&n.mapValue.fields&&delete n.mapValue.fields[e.lastSegment()]}isEqual(e){return Os(this.value,e.value)}getFieldsMap(e){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let r=0;r<e.length;++r){let i=n.mapValue.fields[e.get(r)];Xm(i)&&i.mapValue.fields||(i={mapValue:{fields:{}}},n.mapValue.fields[e.get(r)]=i),n=i}return n.mapValue.fields}applyChanges(e,n,r){Xa(n,(i,s)=>e[i]=s);for(const i of r)delete e[i]}clone(){return new Hr(Pf(this.value))}}function tL(t){const e=[];return Xa(t.fields,(n,r)=>{const i=new er([n]);if(Xm(r)){const s=tL(r.mapValue).fields;
vendor: 4,180 bytes, lines 2339-2379
2339if(s.length===0)e.push(i);else for(const o of s)e.push(i.child(o))}else e.push(i)}),new li(e)}/**
2340 * @license
2341 * Copyright 2017 Google LLC
2342 *
2343 * Licensed under the Apache License, Version 2.0 (the "License");
2344 * you may not use this file except in compliance with the License.
2345 * You may obtain a copy of the License at
2346 *
2347 *   http://www.apache.org/licenses/LICENSE-2.0
2348 *
2349 * Unless required by applicable law or agreed to in writing, software
2350 * distributed under the License is distributed on an "AS IS" BASIS,
2351 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2352 * See the License for the specific language governing permissions and
2353 * limitations under the License.
2354 */class vr{constructor(e,n,r,i,s,o,a){this.key=e,this.documentType=n,this.version=r,this.readTime=i,this.createTime=s,this.data=o,this.documentState=a}static newInvalidDocument(e){return new vr(e,0,gt.min(),gt.min(),gt.min(),Hr.empty(),0)}static newFoundDocument(e,n,r,i){return new vr(e,1,n,gt.min(),r,i,0)}static newNoDocument(e,n){return new vr(e,2,n,gt.min(),gt.min(),Hr.empty(),0)}static newUnknownDocument(e,n){return new vr(e,3,n,gt.min(),gt.min(),Hr.empty(),2)}convertToFoundDocument(e,n){return!this.createTime.isEqual(gt.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=n,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=Hr.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=Hr.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=gt.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof vr&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new vr(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}/**
2355 * @license
2356 * Copyright 2022 Google LLC
2357 *
2358 * Licensed under the Apache License, Version 2.0 (the "License");
2359 * you may not use this file except in compliance with the License.
2360 * You may obtain a copy of the License at
2361 *
2362 *   http://www.apache.org/licenses/LICENSE-2.0
2363 *
2364 * Unless required by applicable law or agreed to in writing, software
2365 * distributed under the License is distributed on an "AS IS" BASIS,
2366 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2367 * See the License for the specific language governing permissions and
2368 * limitations under the License.
2369 */class nv{constructor(e,n){this.position=e,this.inclusive=n}}function PC(t,e,n){let r=0;for(let i=0;i<t.position.length;i++){const s=e[i],o=t.position[i];if(s.field.isKeyField()?r=ot.comparator(ot.fromName(o.referenceValue),n.key):r=Nu(o,n.data.field(s.field)),s.dir==="desc"&&(r*=-1),r!==0)break}return r}function IC(t,e){if(t===null)return e===null;if(e===null||t.inclusive!==e.inclusive||t.position.length!==e.position.length)return!1;for(let n=0;n<t.position.length;n++)if(!Os(t.position[n],e.position[n]))return!1;return!0}/**
2370 * @license
2371 * Copyright 2022 Google LLC
2372 *
2373 * Licensed under the Apache License, Version 2.0 (the "License");
2374 * you may not use this file except in compliance with the License.
2375 * You may obtain a copy of the License at
2376 *
2377 *   http://www.apache.org/licenses/LICENSE-2.0
2378 *
2379 * Unless required by applicable law or agreed to in writing, softw
2379are
2380 * distributed under the License is distributed on an "AS IS" BASIS,
2381 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2382 * See the License for the specific language governing permissions and
2383 * limitations under the License.
2384 */class rv{constructor(e,n="asc"){this.field=e,this.dir=n}}function Zq(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}/**
2385 * @license
2386 * Copyright 2022 Google LLC
2387 *
2388 * Licensed under the Apache License, Version 2.0 (the "License");
2389 * you may not use this file except in compliance with the License.
2390 * You may obtain a copy of the License at
2391 *
2392 *   http://www.apache.org/licenses/LICENSE-2.0
2393 *
2394 * Unless required by applicable law or agreed to in writing, software
2395 * distributed under the License is distributed on an "AS IS" BASIS,
2396 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2397 * See the License for the specific language governing permissions and
2398 * limitations under the License.
2399 */class nL{}class jn extends nL{constructor(e,n,r){super(),this.field=e,this.op=n,this.value=r}static create(e,n,r){return e.isKeyField()?n==="in"||n==="not-in"?this.createKeyFieldInFilter(e,n,r):new eK(e,n,r):n==="array-contains"?new rK(e,r):n==="in"?new iK(e,r):n==="not-in"?new sK(e,r):n==="array-contains-any"?new oK(e,r):new jn(e,n,r)}static createKeyFieldInFilter(e,n,r){return n==="in"?new tK(e,r):new nK(e,r)}matches(e){const n=e.data.field(this.field);return this.op==="!="?n!==null&&n.nullValue===void 0&&this.matchesComparison(Nu(n,this.value)):n!==null&&Ua(this.value)===Ua(n)&&this.matchesComparison(Nu(n,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return ct(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class Ds extends nL{constructor(e,n){super(),this.filters=e,this.op=n,this.Te=null}static create(e,n){return new Ds(e,n)}matches(e){return rL(this)?this.filters.find(n=>!n.matches(e))===void 0:this.filters.find(n=>n.matches(e))!==void 0}getFlattenedFilters(){return this.Te!==null||(this.Te=this.filters.reduce((e,n)=>e.concat(n.getFlattenedFilters()),[])),this.Te}getFilters(){return Object.assign([],this.filters)}}function rL(t){return t.op==="and"}function iL(t){return Jq(t)&&rL(t)}function Jq(t){for(const e of t.filters)if(e instanceof Ds)return!1;return!0}function Cb(t){if(t instanceof jn)return t.field.canonicalString()+t.op.toString()+Ou(t.value);if(iL(t))return t.filters.map(e=>Cb(e)).join(",");{const e=t.filters.map(n=>Cb(n)).join(",");return`${t.op}(${e})`}}function sL(t,e){return t instanceof jn?function(r,i){return i instanceof jn&&r.op===i.op&&r.field.isEqual(i.field)&&Os(r.value,i.value)}(t,e):t instanceof Ds?function(r,i){return i instanceof Ds&&r.op===i.op&&r.filters.length===i.filters.length?r.filters.reduce((s,o,a)=>s&&sL(o,i.filters[a]),!0):!1}(t,e):void ct(19439)}function oL(t){return t instanceof jn?function(n){return`${n.field.canonicalString()} ${n.op} ${Ou(n.value)}`}(t):t instanceof Ds?function(n){return n.op.toString()+" {"+n.getFilters().map(oL).join(" ,")+"}"}(t):"Filter"}class eK extends jn{constructor(e,n,r){super(e,n,r),this.key=ot.fromName(r.referenceValue)}matches(e){const n=ot.comparator(e.key,this.key);return this.matchesComparison(n)}}class tK extends jn{constructor(e,n){super(e,"in",n),this.keys=aL("in",n)}matches(e){return this.keys.some(n=>n.isEqual(e.key))}}class nK extends jn{constructor(e,n){super(e,"not-in",n),this.keys=aL("not-in",n)}matches(e){return!this.keys.some(n=>n.isEqual(e.key))}}function aL(t,e){var n;return(((n=e.arrayValue)===null||n===void 0?void 0:n.values)||[]).map(r=>ot.fromName(r.referenceValue))}class rK extends jn{constructor(e,n){super(e,"array-contains",n)}matches(e){const n=e.data.field(this.field);return CE(n)&&mh(n.arrayValue,this.value)}}class iK extends jn{constructor(e,n){super(e,"in",n)}matches(e){const n=e.data.field(this.field);return n!==null&&mh(this.value.arrayValue,n)}}class sK extends jn{constructor(e,n){super(e,"not-in",n)}matches(e){if(mh(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=e.data.field(this.field);return n!==null&&n.nullValue===void 0&&!mh(this.value.arrayValue,n)}}class oK extends jn{constructor(e,n){super(e,"array-contains-any",n)}matches(e){const n=e.data.field(this.field);
2399return!(!CE(n)||!n.arrayValue.values)&&n.arrayValue.values.some(r=>mh(this.value.arrayValue,r))}}/**
2400 * @license
2401 * Copyright 2019 Google LLC
2402 *
2403 * Licensed under the Apache License, Version 2.0 (the "License");
2404 * you may not use this file except in compliance with the License.
2405 * You may obtain a copy of the License at
2406 *
2407 *   http://www.apache.org/licenses/LICENSE-2.0
2408 *
2409 * Unless required by applicable law or agreed to in writing, software
2410 * distributed under the License is distributed on an "AS IS" BASIS,
2411 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2412 * See the License for the specific language governing permissions and
2413 * limitations under the License.
2414 */class aK{constructor(e,n=null,r=[],i=[],s=null,o=null,a=null){this.path=e,this.collectionGroup=n,this.orderBy=r,this.filters=i,this.limit=s,this.startAt=o,this.endAt=a,this.Ie=null}}function NC(t,e=null,n=[],r=[],i=null,s=null,o=null){return new aK(t,e,n,r,i,s,o)}function RE(t){const e=mt(t);if(e.Ie===null){let n=e.path.canonicalString();e.collectionGroup!==null&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map(r=>Cb(r)).join(","),n+="|ob:",n+=e.orderBy.map(r=>function(s){return s.field.canonicalString()+s.dir}(r)).join(","),py(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=e.startAt.inclusive?"b:":"a:",n+=e.startAt.position.map(r=>Ou(r)).join(",")),e.endAt&&(n+="|ub:",n+=e.endAt.inclusive?"a:":"b:",n+=e.endAt.position.map(r=>Ou(r)).join(",")),e.Ie=n}return e.Ie}function PE(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n<t.orderBy.length;n++)if(!Zq(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(let n=0;n<t.filters.length;n++)if(!sL(t.filters[n],e.filters[n]))return!1;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!IC(t.startAt,e.startAt)&&IC(t.endAt,e.endAt)}function Rb(t){return ot.isDocumentKey(t.path)&&t.collectionGroup===null&&t.filters.length===0}/**
2415 * @license
2416 * Copyright 2017 Google LLC
2417 *
2418 * Licensed under the Apache License, Version 2.0 (the "License");
2419 * you may not use this file except in compliance with the License.
2420 * You may obtain a copy of the License at
2421 *
2422 *   http://www.apache.org/licenses/LICENSE-2.0
2423 *
2424 * Unless required by applicable law or agreed to in writing, software
2425 * distributed under the License is distributed on an "AS IS" BASIS,
2426 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2427 * See the License for the specific language governing permissions and
2428 * limitations under the License.
2429 */class gy{constructor(e,n=null,r=[],i=[],s=null,o="F",a=null,l=null){this.path=e,this.collectionGroup=n,this.explicitOrderBy=r,this.filters=i,this.limit=s,this.limitType=o,this.startAt=a,this.endAt=l,this.Ee=null,this.de=null,this.Ae=null,this.startAt,this.endAt}}function lK(t,e,n,r,i,s,o,a){return new gy(t,e,n,r,i,s,o,a)}function vy(t){return new gy(t)}function OC(t){return t.filters.length===0&&t.limit===null&&t.startAt==null&&t.endAt==null&&(t.explicitOrderBy.length===0||t.explicitOrderBy.length===1&&t.explicitOrderBy[0].field.isKeyField())}function cK(t){return t.collectionGroup!==null}function If(t){const e=mt(t);if(e.Ee===null){e.Ee=[];const n=new Set;for(const s of e.explicitOrderBy)e.Ee.push(s),n.add(s.field.canonicalString());const r=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let a=new Hn(er.comparator);return o.filters.forEach(l=>{l.getFlattenedFilters().forEach(c=>{c.isInequality()&&(a=a.add(c.field))})}),a})(e).forEach(s=>{n.has(s.canonicalString())||s.isKeyField()||e.Ee.push(new rv(s,r))}),n.has(er.keyField().canonicalString())||e.Ee.push(new rv(er.keyField(),r))}return e.Ee}function Ms(t){const e=mt(t);return e.de||(e.de=lL(e,If(t))),e.de}function uK(t){const e=mt(t);return e.Ae||(e.Ae=lL(e,t.explicitOrderBy)),e.Ae}function lL(t,e){if(t.limitType==="F")return NC(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(i=>{const s=i.dir==="desc"?"asc":"desc";return new rv(i.field,s)});const n=t.endAt?new nv(t.endAt.position,t.endAt.inclusive):null,r=t.startAt?new nv(t.startAt.position,t.startAt.inclusive):null;return NC(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}}function Pb(t,e,n){return new gy(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function yy(t,e){return PE(Ms(t),Ms(e))&&t.limitType===e.limitType}function cL(t){return`${RE(Ms(t))}|lt:${t.limitType}`}function Mc(t){return`Query(target=${function(n){let r=n.path.canonicalString();return n.collectionGroup!==null&&(r+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(r+=`, filters: [${n.filters.map(i=>oL(i)).join(", ")}]`),py(n.limit)||(r+=", limit: "+n.limit),n.orderBy.length>0&&(r+=`, orderBy: [${n.orderBy.map(i=>function(o){return`${o.field.canonicalString()} (${o.dir})`}(i)).join(", ")}]`),n.startAt&&(r+=", startAt: ",r+=n.startAt.inclusive?"b:":"a:",r+=n.startAt.position.map(i=>Ou(i)).join(",")),n.endAt&&(r+=", endAt: ",r+=n.endAt.inclusive?"a:":"b:",r+=n.endAt.position.map(i=>Ou(i)).join(",")),`Target(${r})`}(Ms(t))}; limitType=${t.limitType})`}function _y(t,e){return e.isFoundDocument()&&function(r,i){const s=i.key.path;return r.collectionGroup!==null?i.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(s):ot.isDocumentKey(r.path)?r.path.isEqual(s):r.path.isImmediateParentOf(s)}(t,e)&&function(r,i){for(const s of If(r))if(!s.field.isKeyField()&&i.data.field(s.field)===null)return!1;return!0}(t,e)&&function(r,i){for(const s of r.filters)if(!s.matches(i))return!1;return!0}(t,e)&&function(r,i){return!(r.startAt&&!function(o,a,l){const c=PC(o,a,l);return o.inclusive?c<=0:c<0}(r.startAt,If(r),i)||r.endAt&&!function(o,a,l){const c=PC(o,a,l);return o.inclusive?c>=0:c>0}(r.endAt,If(r),i))}(t,e)}function dK(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function uL(t){return(e,n)=>{let r=!1;for(const i of If(t)){const s=fK(i,e,n);if(s!==0)return s;r=r||i.field.isKeyField()}return 0}}function fK(t,e,n){const r=t.field.isKeyField()?ot.comparator(e.key,n.key):function(s,o,a){const l=o.data.field(s),c=a.data.field(s);return l!==null&&c!==null?Nu(l,c):ct(42886)}
2429(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return ct(19790,{direction:t.dir})}}/**
2430 * @license
2431 * Copyright 2017 Google LLC
2432 *
2433 * Licensed under the Apache License, Version 2.0 (the "License");
2434 * you may not use this file except in compliance with the License.
2435 * You may obtain a copy of the License at
2436 *
2437 *   http://www.apache.org/licenses/LICENSE-2.0
2438 *
2439 * Unless required by applicable law or agreed to in writing, software
2440 * distributed under the License is distributed on an "AS IS" BASIS,
2441 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2442 * See the License for the specific language governing permissions and
2443 * limitations under the License.
2444 */class Yl{constructor(e,n){this.mapKeyFn=e,this.equalsFn=n,this.inner={},this.innerSize=0}get(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r!==void 0){for(const[i,s]of r)if(this.equalsFn(i,e))return s}}has(e){return this.get(e)!==void 0}set(e,n){const r=this.mapKeyFn(e),i=this.inner[r];if(i===void 0)return this.inner[r]=[[e,n]],void this.innerSize++;for(let s=0;s<i.length;s++)if(this.equalsFn(i[s][0],e))return void(i[s]=[e,n]);i.push([e,n]),this.innerSize++}delete(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r===void 0)return!1;for(let i=0;i<r.length;i++)if(this.equalsFn(r[i][0],e))return r.length===1?delete this.inner[n]:r.splice(i,1),this.innerSize--,!0;return!1}forEach(e){Xa(this.inner,(n,r)=>{for(const[i,s]of r)e(i,s)})}isEmpty(){return Wk(this.inner)}size(){return this.innerSize}}/**
2445 * @license
2446 * Copyright 2017 Google LLC
2447 *
2448 * Licensed under the Apache License, Version 2.0 (the "License");
2449 * you may not use this file except in compliance with the License.
2450 * You may obtain a copy of the License at
2451 *
2452 *   http://www.apache.org/licenses/LICENSE-2.0
2453 *
2454 * Unless required by applicable law or agreed to in writing, software
2455 * distributed under the License is distributed on an "AS IS" BASIS,
2456 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2457 * See the License for the specific language governing permissions and
2458 * limitations under the License.
2459 */const hK=new wn(ot.comparator);function wo(){return hK}const dL=new wn(ot.comparator);function tf(...t){let e=dL;for(const n of t)e=e.insert(n.key,n);return e}function fL(t){let e=dL;return t.forEach((n,r)=>e=e.insert(n,r.overlayedDocument)),e}function gl(){return Nf()}function hL(){return Nf()}function Nf(){return new Yl(t=>t.toString(),(t,e)=>t.isEqual(e))}const pK=new wn(ot.comparator),mK=new Hn(ot.comparator);function Ot(...t){let e=mK;for(const n of t)e=e.add(n);return e}const gK=new Hn(At);function vK(){return gK}/**
2460 * @license
2461 * Copyright 2020 Google LLC
2462 *
2463 * Licensed under the Apache License, Version 2.0 (the "License");
2464 * you may not use this file except in compliance with the License.
2465 * You may obtain a copy of the License at
2466 *
2467 *   http://www.apache.org/licenses/LICENSE-2.0
2468 *
2469 * Unless required by applicable law or agreed to in writing, software
2470 * distributed under the License is distributed on an "AS IS" BASIS,
2471 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2472 * See the License for the specific language governing permissions and
2473 * limitations under the License.
2474 */function IE(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Jg(e)?"-0":e}}function pL(t){return{integerValue:""+t}}function yK(t,e){return Gq(e)?pL(e):IE(t,e)}/**
2475 * @license
2476 * Copyright 2018 Google LLC
2477 *
2478 * Licensed under the Apache License, Version 2.0 (the "License");
2479 * you may not use this file except in compliance with the License.
2480 * You may obtain a copy of the License at
2481 *
2482 *   http://www.apache.org/licenses/LICENSE-2.0
2483 *
2484 * Unless required by applicable law or agreed to in writing, software
2485 * distributed under the License is distributed on an "AS IS" BASIS,
2486 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2487 * See the License for the specific language governing permissions and
2488 * limitations under the License.
2489 */class xy{constructor(){this._=void 0}}function _K(t,e,n){return t instanceof gh?function(i,s){const o={fields:{[Xk]:{stringValue:Kk},[Qk]:{timestampValue:{seconds:i.seconds,nanos:i.nanoseconds}}}};return s&&ME(s)&&(s=my(s)),s&&(o.fields[Yk]=s),{mapValue:o}}(n,e):t instanceof vh?gL(t,e):t instanceof yh?vL(t,e):function(i,s){const o=mL(i,s),a=DC(o)+DC(i.Re);return Mb(o)&&Mb(i.Re)?pL(a):IE(i.serializer,a)}(t,e)}function xK(t,e,n){return t instanceof vh?gL(t,e):t instanceof yh?vL(t,e):n}function mL(t,e){return t instanceof iv?function(r){return Mb(r)||function(s){return!!s&&"doubleValue"in s}(r)}(e)?e:{integerValue:0}:null}class gh extends xy{}class vh extends xy{constructor(e){super(),this.elements=e}}function gL(t,e){const n=yL(e);for(const r of t.elements)n.some(i=>Os(i,r))||n.push(r);return{arrayValue:{values:n}}}class yh extends xy{constructor(e){super(),this.elements=e}}function vL(t,e){let n=yL(e);for(const r of t.elements)n=n.filter(i=>!Os(i,r));return{arrayValue:{values:n}}}
2489class iv extends xy{constructor(e,n){super(),this.serializer=e,this.Re=n}}function DC(t){return Cn(t.integerValue||t.doubleValue)}function yL(t){return CE(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}/**
2490 * @license
2491 * Copyright 2017 Google LLC
2492 *
2493 * Licensed under the Apache License, Version 2.0 (the "License");
2494 * you may not use this file except in compliance with the License.
2495 * You may obtain a copy of the License at
2496 *
2497 *   http://www.apache.org/licenses/LICENSE-2.0
2498 *
2499 * Unless required by applicable law or agreed to in writing, software
2500 * distributed under the License is distributed on an "AS IS" BASIS,
2501 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2502 * See the License for the specific language governing permissions and
2503 * limitations under the License.
2504 */class bK{constructor(e,n){this.field=e,this.transform=n}}function wK(t,e){return t.field.isEqual(e.field)&&function(r,i){return r instanceof vh&&i instanceof vh||r instanceof yh&&i instanceof yh?Iu(r.elements,i.elements,Os):r instanceof iv&&i instanceof iv?Os(r.Re,i.Re):r instanceof gh&&i instanceof gh}(t.transform,e.transform)}class EK{constructor(e,n){this.version=e,this.transformResults=n}}class Rr{constructor(e,n){this.updateTime=e,this.exists=n}static none(){return new Rr}static exists(e){return new Rr(void 0,e)}static updateTime(e){return new Rr(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Ym(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}class by{}function _L(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new wy(t.key,Rr.none()):new Gh(t.key,t.data,Rr.none());{const n=t.data,r=Hr.empty();let i=new Hn(er.comparator);for(let s of e.fields)if(!i.has(s)){let o=n.field(s);o===null&&s.length>1&&(s=s.popLast(),o=n.field(s)),o===null?r.delete(s):r.set(s,o),i=i.add(s)}return new Ya(t.key,r,new li(i.toArray()),Rr.none())}}function SK(t,e,n){t instanceof Gh?function(i,s,o){const a=i.value.clone(),l=LC(i.fieldTransforms,s,o.transformResults);a.setAll(l),s.convertToFoundDocument(o.version,a).setHasCommittedMutations()}(t,e,n):t instanceof Ya?function(i,s,o){if(!Ym(i.precondition,s))return void s.convertToUnknownDocument(o.version);const a=LC(i.fieldTransforms,s,o.transformResults),l=s.data;l.setAll(xL(i)),l.setAll(a),s.convertToFoundDocument(o.version,l).setHasCommittedMutations()}(t,e,n):function(i,s,o){s.convertToNoDocument(o.version).setHasCommittedMutations()}(0,e,n)}function Of(t,e,n,r){return t instanceof Gh?function(s,o,a,l){if(!Ym(s.precondition,o))return a;const c=s.value.clone(),d=FC(s.fieldTransforms,l,o);return c.setAll(d),o.convertToFoundDocument(o.version,c).setHasLocalMutations(),null}(t,e,n,r):t instanceof Ya?function(s,o,a,l){if(!Ym(s.precondition,o))return a;const c=FC(s.fieldTransforms,l,o),d=o.data;return d.setAll(xL(s)),d.setAll(c),o.convertToFoundDocument(o.version,d).setHasLocalMutations(),a===null?null:a.unionWith(s.fieldMask.fields).unionWith(s.fieldTransforms.map(f=>f.field))}(t,e,n,r):function(s,o,a){return Ym(s.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):a}(t,e,n)}function TK(t,e){let n=null;for(const r of t.fieldTransforms){const i=e.data.field(r.field),s=mL(r.transform,i||null);s!=null&&(n===null&&(n=Hr.empty()),n.set(r.field,s))}return n||null}function kC(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(r,i){return r===void 0&&i===void 0||!(!r||!i)&&Iu(r,i,(s,o)=>wK(s,o))}(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class Gh extends by{constructor(e,n,r,i=[]){super(),this.key=e,this.value=n,this.precondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class Ya extends by{constructor(e,n,r,i,s=[]){super(),this.key=e,this.data=n,this.fieldMask=r,this.prec
2504ondition=i,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function xL(t){const e=new Map;return t.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=t.data.field(n);e.set(n,r)}}),e}function LC(t,e,n){const r=new Map;Wt(t.length===n.length,32656,{Ve:n.length,me:t.length});for(let i=0;i<n.length;i++){const s=t[i],o=s.transform,a=e.data.field(s.field);r.set(s.field,xK(o,a,n[i]))}return r}function FC(t,e,n){const r=new Map;for(const i of t){const s=i.transform,o=n.data.field(i.field);r.set(i.field,_K(s,o,e))}return r}class wy extends by{constructor(e,n){super(),this.key=e,this.precondition=n,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class AK extends by{constructor(e,n){super(),this.key=e,this.precondition=n,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}/**
2505 * @license
2506 * Copyright 2017 Google LLC
2507 *
2508 * Licensed under the Apache License, Version 2.0 (the "License");
2509 * you may not use this file except in compliance with the License.
2510 * You may obtain a copy of the License at
2511 *
2512 *   http://www.apache.org/licenses/LICENSE-2.0
2513 *
2514 * Unless required by applicable law or agreed to in writing, software
2515 * distributed under the License is distributed on an "AS IS" BASIS,
2516 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2517 * See the License for the specific language governing permissions and
2518 * limitations under the License.
2519 */class MK{constructor(e,n,r,i){this.batchId=e,this.localWriteTime=n,this.baseMutations=r,this.mutations=i}applyToRemoteDocument(e,n){const r=n.mutationResults;for(let i=0;i<this.mutations.length;i++){const s=this.mutations[i];s.key.isEqual(e.key)&&SK(s,e,r[i])}}applyToLocalView(e,n){for(const r of this.baseMutations)r.key.isEqual(e.key)&&(n=Of(r,e,n,this.localWriteTime));for(const r of this.mutations)r.key.isEqual(e.key)&&(n=Of(r,e,n,this.localWriteTime));return n}applyToLocalDocumentSet(e,n){const r=hL();return this.mutations.forEach(i=>{const s=e.get(i.key),o=s.overlayedDocument;let a=this.applyToLocalView(o,s.mutatedFields);a=n.has(i.key)?null:a;const l=_L(o,a);l!==null&&r.set(i.key,l),o.isValidDocument()||o.convertToNoDocument(gt.min())}),r}keys(){return this.mutations.reduce((e,n)=>e.add(n.key),Ot())}isEqual(e){return this.batchId===e.batchId&&Iu(this.mutations,e.mutations,(n,r)=>kC(n,r))&&Iu(this.baseMutations,e.baseMutations,(n,r)=>kC(n,r))}}class NE{constructor(e,n,r,i){this.batch=e,this.commitVersion=n,this.mutationResults=r,this.docVersions=i}static from(e,n,r){Wt(e.mutations.length===r.length,58842,{fe:e.mutations.length,ge:r.length});let i=function(){return pK}();const s=e.mutations;for(let o=0;o<s.length;o++)i=i.insert(s[o].key,r[o].version);return new NE(e,n,r,i)}}/**
2520 * @license
2521 * Copyright 2022 Google LLC
2522 *
2523 * Licensed under the Apache License, Version 2.0 (the "License");
2524 * you may not use this file except in compliance with the License.
2525 * You may obtain a copy of the License at
2526 *
2527 *   http://www.apache.org/licenses/LICENSE-2.0
2528 *
2529 * Unless required by applicable law or agreed to in writing, software
2530 * distributed under the License is distributed on an "AS IS" BASIS,
2531 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2532 * See the License for the specific language governing permissions and
2533 * limitations under the License.
2534 */let CK=class{constructor(e,n){this.largestBatchId=e,this.mutation=n}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{
2535      largestBatchId: ${this.largestBatchId},
2536      mutation: ${this.mutation.toString()}
2537    }`}};/**
2538 * @license
2539 * Copyright 2023 Google LLC
2540 *
2541 * Licensed under the Apache License, Version 2.0 (the "License");
2542 * you may not use this file except in compliance with the License.
2543 * You may obtain a copy of the License at
2544 *
2545 *   http://www.apache.org/licenses/LICENSE-2.0
2546 *
2547 * Unless required by applicable law or agreed to in writing, software
2548 * distributed under the License is distributed on an "AS IS" BASIS,
2549 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2550 * See the License for the specific language governing permissions and
2551 * limitations under the License.
2552 */class RK{constructor(e,n,r){this.alias=e,this.aggregateType=n,this.fieldPath=r}}/**
2553 * @license
2554 * Copyright 2017 Google LLC
2555 *
2556 * Licensed under the Apache License, Version 2.0 (the "License");
2557 * you may not use this file except in compliance with the License.
2558 * You may obtain a copy of the License at
2559 *
2560 *   http://www.apache.org/licenses/LICENSE-2.0
2561 *
2562 * Unless required by applicable law or agreed to in writing, software
2563 * distributed under the License is distributed on an "AS IS" BASIS,
2564 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2565 * See the License for the specific language governing permissions and
2566 * limitations under the License.
2567 */class PK{constructor(e,n){this.count=e,this.unchangedNames=n}}/**
2568 * @license
2569 * Copyright 2017 Google LLC
2570 *
2571 * Licensed under the Apache License, Version 2.0 (the "License");
2572 * you may not use this file except in compliance with the License.
2573 * You may obtain a copy of the License at
2574 *
2575 *   http://www.apache.org/licenses/LICENSE-2.0
2576 *
2577 * Unless required by applicable law or agreed to in writing, software
2578 * distributed under the License is distributed on an "AS IS" BASIS,
2579 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2580 * See the License for the specific language governing permissions and
2581 * limitations under the License.
2582 */var On,Lt;function IK(t){switch(t){case Te.OK:return ct(64938);case Te.CANCELLED:case Te.UNKNOWN:case Te.DEADLINE_EXCEEDED:case Te.RESOURCE_EXHAUSTED:case Te.INTERNAL:case Te.UNAVAILABLE:case Te.UNAUTHENTICATED:return!1;case Te.INVALID_ARGUMENT:case Te.NOT_FOUND:case Te.ALREADY_EXISTS:case Te.PERMISSION_DENIED:case Te.FAILED_PRECONDITION:case Te.ABORTED:case Te.OUT_OF_RANGE:case Te.UNIMPLEMENTED:case Te.DATA_LOSS:return!0;default:return ct(15467,{code:t})}}function bL(t){if(t===void 0)return bo("GRPC error has no .code"),Te.UNKNOWN;switch(t){case On.OK:return Te.OK;case On.CANCELLED:return Te.CANCELLED;case On.UNKNOWN:return Te.UNKNOWN;case On.DEADLINE_EXCEEDED:return Te.DEADLINE_EXCEEDED;case On.RESOURCE_EXHAUSTED:return Te.RESOURCE_EXHAUSTED;case On.INTERNAL:return Te.INTERNAL;case On.UNAVAILABLE:return Te.UNAVAILABLE;case On.UNAUTHENTICATED:return Te.UNAUTHENTICATED;case On.INVALID_ARGUMENT:return Te.INVALID_ARGUMENT;case On.NOT_FOUND:return Te.NOT_FOUND;case On.ALREADY_EXISTS:return Te.ALREADY_EXISTS;case On.PERMISSION_DENIED:return Te.PERMISSION_DENIED;case On.FAILED_PRECONDITION:return Te.FAILED_PRECONDITION;case On.ABORTED:return Te.ABORTED;case On.OUT_OF_RANGE:return Te.OUT_OF_RANGE;case On.UNIMPLEMENTED:return Te.UNIMPLEMENTED;case On.DATA_LOSS:return Te.DATA_LOSS;default:return ct(39323,{code:t})}}(Lt=On||(On={}))[Lt.OK=0]="OK",Lt[Lt.CANCELLED=1]="CANCELLED",Lt[Lt.UNKNOWN=2]="UNKNOWN",Lt[Lt.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Lt[Lt.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Lt[Lt.NOT_FOUND=5]="NOT_FOUND",Lt[Lt.ALREADY_EXISTS=6]="ALREADY_EXISTS",Lt[Lt.PERMISSION_DENIED=7]="PERMISSION_DENIED",Lt[Lt.UNAUTHENTICATED=16]="UNAUTHENTICATED",Lt[Lt.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Lt[Lt.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Lt[Lt.ABORTED=10]="ABORTED",Lt[Lt.OUT_OF_RANGE=11]="OUT_OF_RANGE",Lt[Lt.UNIMPLEMENTED=12]="UNIMPLEMENTED",Lt[Lt.INTERNAL=13]="INTERNAL",Lt[Lt.UNAVAILABLE=14]="UNAVAILABLE",Lt[Lt.DATA_LOSS=15]="DATA_LOSS";/**
2583 * @license
2584 * Copyright 2022 Google LLC
2585 *
2586 * Licensed under the Apache License, Version 2.0 (the "License");
2587 * you may not use this file except in compliance with the License.
2588 * You may obtain a copy of the License at
2589 *
2590 *   http://www.apache.org/licenses/LICENSE-2.0
2591 *
2592 * Unless required by applicable law or agreed to in writing, software
2593 * distributed under the License is distributed on an "AS IS" BASIS,
2594 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2595 * See the License for the specific language governing permissions and
2596 * limitations under the License.
2597 */const NK=new Ta([4294967295,4294967295],0);function UC(t){const e=Hk().encode(t),n=new kk;return n.update(e),new Uint8Array(n.digest())}function jC(t){const e=new DataView(t.buffer),n=e.getUint32(0,!0),r=e.getUint32(4,!0),i=e.getUint32(8,!0),s=e.getUint32(12,!0);
vendor: 9,908 bytes, lines 2597-2627
2597return[new Ta([n,r],0),new Ta([i,s],0)]}class OE{constructor(e,n,r){if(this.bitmap=e,this.padding=n,this.hashCount=r,n<0||n>=8)throw new nf(`Invalid padding: ${n}`);if(r<0)throw new nf(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new nf(`Invalid hash count: ${r}`);if(e.length===0&&n!==0)throw new nf(`Invalid padding when bitmap length is 0: ${n}`);this.pe=8*e.length-n,this.ye=Ta.fromNumber(this.pe)}we(e,n,r){let i=e.add(n.multiply(Ta.fromNumber(r)));return i.compare(NK)===1&&(i=new Ta([i.getBits(0),i.getBits(1)],0)),i.modulo(this.ye).toNumber()}be(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(this.pe===0)return!1;const n=UC(e),[r,i]=jC(n);for(let s=0;s<this.hashCount;s++){const o=this.we(r,i,s);if(!this.be(o))return!1}return!0}static create(e,n,r){const i=e%8==0?0:8-e%8,s=new Uint8Array(Math.ceil(e/8)),o=new OE(s,i,n);return r.forEach(a=>o.insert(a)),o}insert(e){if(this.pe===0)return;const n=UC(e),[r,i]=jC(n);for(let s=0;s<this.hashCount;s++){const o=this.we(r,i,s);this.Se(o)}}Se(e){const n=Math.floor(e/8),r=e%8;this.bitmap[n]|=1<<r}}class nf extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}/**
2598 * @license
2599 * Copyright 2017 Google LLC
2600 *
2601 * Licensed under the Apache License, Version 2.0 (the "License");
2602 * you may not use this file except in compliance with the License.
2603 * You may obtain a copy of the License at
2604 *
2605 *   http://www.apache.org/licenses/LICENSE-2.0
2606 *
2607 * Unless required by applicable law or agreed to in writing, software
2608 * distributed under the License is distributed on an "AS IS" BASIS,
2609 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2610 * See the License for the specific language governing permissions and
2611 * limitations under the License.
2612 */class Ey{constructor(e,n,r,i,s){this.snapshotVersion=e,this.targetChanges=n,this.targetMismatches=r,this.documentUpdates=i,this.resolvedLimboDocuments=s}static createSynthesizedRemoteEventForCurrentChange(e,n,r){const i=new Map;return i.set(e,$h.createSynthesizedTargetChangeForCurrentChange(e,n,r)),new Ey(gt.min(),i,new wn(At),wo(),Ot())}}class $h{constructor(e,n,r,i,s){this.resumeToken=e,this.current=n,this.addedDocuments=r,this.modifiedDocuments=i,this.removedDocuments=s}static createSynthesizedTargetChangeForCurrentChange(e,n,r){return new $h(r,n,Ot(),Ot(),Ot())}}/**
2613 * @license
2614 * Copyright 2017 Google LLC
2615 *
2616 * Licensed under the Apache License, Version 2.0 (the "License");
2617 * you may not use this file except in compliance with the License.
2618 * You may obtain a copy of the License at
2619 *
2620 *   http://www.apache.org/licenses/LICENSE-2.0
2621 *
2622 * Unless required by applicable law or agreed to in writing, software
2623 * distributed under the License is distributed on an "AS IS" BASIS,
2624 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2625 * See the License for the specific language governing permissions and
2626 * limitations under the License.
2627 */class Qm{constructor(e,n,r,i){this.De=e,this.removedTargetIds=n,this.key=r,this.ve=i}}class wL{constructor(e,n){this.targetId=e,this.Ce=n}}class EL{constructor(e,n,r=ir.EMPTY_BYTE_STRING,i=null){this.state=e,this.targetIds=n,this.resumeToken=r,this.cause=i}}class BC{constructor(){this.Fe=0,this.Me=VC(),this.xe=ir.EMPTY_BYTE_STRING,this.Oe=!1,this.Ne=!0}get current(){return this.Oe}get resumeToken(){return this.xe}get Be(){return this.Fe!==0}get Le(){return this.Ne}ke(e){e.approximateByteSize()>0&&(this.Ne=!0,this.xe=e)}qe(){let e=Ot(),n=Ot(),r=Ot();return this.Me.forEach((i,s)=>{switch(s){case 0:e=e.add(i);break;case 2:n=n.add(i);break;case 1:r=r.add(i);break;default:ct(38017,{changeType:s})}}),new $h(this.xe,this.Oe,e,n,r)}Qe(){this.Ne=!1,this.Me=VC()}$e(e,n){this.Ne=!0,this.Me=this.Me.insert(e,n)}Ue(e){this.Ne=!0,this.Me=this.Me.remove(e)}Ke(){this.Fe+=1}We(){this.Fe-=1,Wt(this.Fe>=0,3241,{Fe:this.Fe})}Ge(){this.Ne=!0,this.Oe=!0}}class OK{constructor(e){this.ze=e,this.je=new Map,this.He=wo(),this.Je=$p(),this.Ye=$p(),this.Ze=new wn(At)}Xe(e){for(const n of e.De)e.ve&&e.ve.isFoundDocument()?this.et(n,e.ve):this.tt(n,e.key,e.ve);for(const n of e.removedTargetIds)this.tt(n,e.key,e.ve)}nt(e){this.forEachTarget(e,n=>{const r=this.rt(n);switch(e.state){case 0:this.it(n)&&r.ke(e.resumeToken);break;case 1:r.We(),r.Be||r.Qe(),r.ke(e.resumeToken);break;case 2:r.We(),r.Be||this.removeTarget(n);break;case 3:this.it(n)&&(r.Ge(),r.ke(e.resumeToken));break;case 4:this.it(n)&&(this.st(n),r.ke(e.resumeToken));break;default:ct(56790,{state:e.state})}})}forEachTarget(e,n){e.targetIds.length>0?e.targetIds.forEach(n):this.je.forEach((r,i)=>{this.it(i)&&n(i)})}ot(e){const n=e.targetId,r=e.Ce.count,i=this._t(n);if(i){const s=i.target;if(Rb(s))if(r===0){const o=new ot(s.path);this.tt(n,o,vr.newNoDocument(o,gt.min()))}else Wt(r===1,20013,{expectedCount:r});else{const o=this.ut(n);if(o!==r){const a=this.ct(e),l=a?this.lt(a,e,o):1;if(l!==0){this.st(n);const c=l===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ze=this.Ze.insert(n,c)}}}}}ct(e){const n=e.Ce.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:r="",padding:i=0},hashCount:s=0}=n;let o,a;try{o=Fa(r).toUint8Array()}catch(l){if(l instanceof qk)return Pu("Decoding the base64 bloom filter in existence filter failed ("+l.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw l}try{a=new OE(o,i,s)}catch(l){return Pu(l instanceof nf?"BloomFilter error: ":"Applying bloom filter failed: ",l),null}return a.pe===0?null:a}lt(e,n,r){return n.Ce.count===r-this.Tt(e,n.targetId)?0:2}Tt(e,n){const r=this.ze.getRemoteKeysForTarget(n);let i=0;return r.forEach(s=>{const o=this.ze.Pt(),a=`projects/${o.projectId}/databases/${o.database}/documents/${s.path.canonicalString()}`;e.mightContain(a)||(this.tt(n,s,null),i++)}),i}It(e){const n=new Map;this.je.forEach((s,o)=>{const a=this._t(o);if(a){if(s.current&&Rb(a.target)){const l=new ot(a.target.path);this.Et(l).has(o)||this.dt(o,l)||this.tt(o,l,vr.newNoDocument(l,e))}s.Le&&(n.set(o,s.qe()),s.Qe())}});let r=Ot();this.Ye.forEach((s,o)=>{let a=!0;o.forEachWhile(l=>{const c=this._t(l);return!c||c.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)}),a&&(r=r.add(s))}),this.He.forEach((s,o)=>o.setReadTime(e));const i=new Ey(e,n,this.Ze,this.He,r);return this.He=wo(),this.Je=$p(),this.Ye=$p(),this.Ze=new wn(At),i}et(e,n){if(!this.it(e))return;const r=this.dt(e,n.key)?2:0;this.rt(e).$e(n.key,r),this.He=this.He.insert(n.key,n),this.Je=this.Je.insert(n.key,this.Et(n.key).add(e)),this.Ye=this.Ye.insert(n.key,this.At(n.key).add(e))}tt(e,n,r){if(!this.it(e))return;const i=this.rt(e);this.dt(e,n)?i.$e(n,1):i.Ue(n),this.Ye=this.Ye.insert(n,this.At(n).delete(e)),this.Ye=this.Ye.insert(n,this.At(n).add(e)),r&&(this.He=this.He.insert(n,r))}removeTarget(e){this.je.delete(e)}ut(e){const n=this.rt(e).qe();return this.ze.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size}Ke(e){this.rt(e).Ke()}rt(e){let n=this.je.get(e);return n||(n=new BC,this.je.set(e,n)),n}At(e){let n=this.Ye.get(e);return n||(n=new Hn(At),this.Ye=this.Ye.insert(e,n)),n}Et(e){let n=this.Je.get(e);return n||(n=new Hn(At),this.Je=this.Je.insert(e,n)),n}it(e){const n=this._t(e)!==null;return n||We("WatchChangeAggregator","Detected inactive target",e),n}_t(e){const n=this.je.get(e);return n&&n.Be?null:this.ze.Rt(e)}st(e){this.je.set(e,new BC),this.ze.getRemoteKeysForTarget(e).forEach(n=>{this.tt(e,n,null)})}dt(e,n){return this.ze.getRemoteKeysForTarget(e).has(n)}}function $p(){return new wn(ot.comparator)}function VC(){return new wn(ot.comparator)}const DK={asc:"ASCENDING",desc:"DESCENDING"},kK={"<":"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"},LK={and:"AND",or:"OR"};class FK{constructor(e,n){this.databaseId=e,this.useProto3Json=n}}function Ib(t,e){return t.useProto3Json||py(e)?e:{value:e}}function sv(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function SL(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function UK(t,e){return sv(t,e.toTimestamp())}function Cs(t){return Wt(!!t,49232),gt.fromTimestamp(function(n){const r=La(n);return new zn(r.seconds,r.nanos)}(t))}function DE(t,e){return Nb(t,e).canonicalString()}function Nb(t,e){const n=function(i){return new fn(["projects",i.projectId,"databases",i.database])}(t).child("documents");return e===void 0?n:n.child(e)}function TL(t){const e=fn.fromString(t);return Wt(IL(e),10190,{key:e.toString()}),e}function Ob(t,e){return DE(t.databaseId,e.path)}function X_(t,e){const n=TL(e);if(n.get(1)!==t.databaseId.projectId)throw new it(Te.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 it(Te.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new ot(ML(n))}function AL(t,e){return DE(t.databaseId,e)}function jK(t){const e=TL(t);return e.length===4?fn.emptyPath():ML(e)}function Db(t){return new fn(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function ML(t){return Wt(t.length>4&&t.get(4)==="documents",29091,{key:t.toString()}),t.popFirst(5)}function zC(t,e,n){return{name:Ob(t,e),fields:n.value.mapValue.fields}}function BK(t,e){let n;if("targetChange"in e){e.targetChange;const r=function(c){return c==="NO_CHANGE"?0:c==="ADD"?1:c==="REMOVE"?2:c==="CURRENT"?3:c==="RESET"?4:ct(39313,{state:c})}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],s=function(c,d){return c.useProto3Json?(Wt(d===void 0||typeof d=="str
2627ing",58123),ir.fromBase64String(d||"")):(Wt(d===void 0||d instanceof Buffer||d instanceof Uint8Array,16193),ir.fromUint8Array(d||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&function(c){const d=c.code===void 0?Te.UNKNOWN:bL(c.code);return new it(d,c.message||"")}(o);n=new EL(r,i,s,a||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const i=X_(t,r.document.name),s=Cs(r.document.updateTime),o=r.document.createTime?Cs(r.document.createTime):gt.min(),a=new Hr({mapValue:{fields:r.document.fields}}),l=vr.newFoundDocument(i,s,o,a),c=r.targetIds||[],d=r.removedTargetIds||[];n=new Qm(c,d,l.key,l)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const i=X_(t,r.document),s=r.readTime?Cs(r.readTime):gt.min(),o=vr.newNoDocument(i,s),a=r.removedTargetIds||[];n=new Qm([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const i=X_(t,r.document),s=r.removedTargetIds||[];n=new Qm([],s,i,null)}else{if(!("filter"in e))return ct(11601,{Vt:e});{e.filter;const r=e.filter;r.targetId;const{count:i=0,unchangedNames:s}=r,o=new PK(i,s),a=r.targetId;n=new wL(a,o)}}return n}function VK(t,e){let n;if(e instanceof Gh)n={update:zC(t,e.key,e.value)};else if(e instanceof wy)n={delete:Ob(t,e.key)};else if(e instanceof Ya)n={update:zC(t,e.key,e.data),updateMask:YK(e.fieldMask)};else{if(!(e instanceof AK))return ct(16599,{ft:e.type});n={verify:Ob(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map(r=>function(s,o){const a=o.transform;if(a instanceof gh)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof vh)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof yh)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof iv)return{fieldPath:o.field.canonicalString(),increment:a.Re};throw ct(20930,{transform:o.transform})}(0,r))),e.precondition.isNone||(n.currentDocument=function(i,s){return s.updateTime!==void 0?{updateTime:UK(i,s.updateTime)}:s.exists!==void 0?{exists:s.exists}:ct(27497)}(t,e.precondition)),n}function zK(t,e){return t&&t.length>0?(Wt(e!==void 0,14353),t.map(n=>function(i,s){let o=i.updateTime?Cs(i.updateTime):Cs(s);return o.isEqual(gt.min())&&(o=Cs(s)),new EK(o,i.transformResults||[])}(n,e))):[]}function HK(t,e){return{documents:[AL(t,e.path)]}}function CL(t,e){const n={structuredQuery:{}},r=e.path;let i;e.collectionGroup!==null?(i=r,n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(i=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=AL(t,i);const s=function(c){if(c.length!==0)return PL(Ds.create(c,"and"))}(e.filters);s&&(n.structuredQuery.where=s);const o=function(c){if(c.length!==0)return c.map(d=>function(u){return{field:ta(u.field),direction:qK(u.dir)}}(d))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);const a=Ib(t,e.limit);return a!==null&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=function(c){return{before:c.inclusive,values:c.position}}(e.startAt)),e.endAt&&(n.structuredQuery.endAt=function(c){return{before:!c.inclusive,values:c.position}}(e.endAt)),{gt:n,parent:i}}function GK(t,e,n,r){const{gt:i,parent:s}=CL(t,e),o={},a=[];let l=0;return n.forEach(c=>{const d="aggregate_"+l++;o[d]=c.alias,c.aggregateType==="count"?a.push({alias:d,count:{}}):c.aggregateType==="avg"?a.push({alias:d,avg:{field:ta(c.fieldPath)}}):c.aggregateType==="sum"&&a.push({alias:d,sum:{field:ta(c.fieldPath)}})}),{request:{structuredAggregationQuery:{aggregations:a,structuredQuery:i.structuredQuery},parent:i.parent},yt:o,parent:s}}function $K(t){let e=jK(t.parent);const n=t.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){Wt(r===1,65062);const d=n.from[0];d.allDescendants?i=d.collectionId:e=e.child(d.collectionId)}let s=[];n.where&&(s=function(f){const u=RL(f);return u instanceof Ds&&iL(u)?u.getFilters():[u]}(n.where));let o=[];n.orderBy&&(o=function(f){return f.map(u=>function(g){return new rv(Cc(g.field),function(m){switch(m){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(g.direction))}(u))}(n.orderBy));let a=null;n.limit&&(a=function(f){let u;return u=typeof f=="object"?f.value:f,py(u)?null:u}(n.limit));let l=null;n.startAt&&(l=function(f){const u=!!f.before,h=f.values||[];return new nv(h,u)}(n.startAt));let c=null;return n.endAt&&(c=function(f){const u=!f.before,h=f.values||[];return new nv(h,u)}(n.endAt)),lK(e,i,o,s,a,"F",l,c)}function WK(t,e){const n=function(i){switch(i){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return ct(28987,{purpose:i})}}(e.purpose);return n==null?null:{"goog-listen-tags":n}}function RL(t){return t.unaryFilter!==void 0?function(n){switch(n.unaryFilter.op){case"IS_NAN":const r=Cc(n.unaryFilter.field);return jn.create(r,"==",{doubleValue:NaN});case"IS_NULL":const i=Cc(n.unaryFilter.field);return jn.create(i,"==",{nullValue:"NULL_VALUE"});
2627case"IS_NOT_NAN":const s=Cc(n.unaryFilter.field);return jn.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=Cc(n.unaryFilter.field);return jn.create(o,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return ct(61313);default:return ct(60726)}}(t):t.fieldFilter!==void 0?function(n){return jn.create(Cc(n.fieldFilter.field),function(i){switch(i){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":return ct(58110);default:return ct(50506)}}(n.fieldFilter.op),n.fieldFilter.value)}(t):t.compositeFilter!==void 0?function(n){return Ds.create(n.compositeFilter.filters.map(r=>RL(r)),function(i){switch(i){case"AND":return"and";case"OR":return"or";default:return ct(1026)}}(n.compositeFilter.op))}(t):ct(30097,{filter:t})}function qK(t){return DK[t]}function KK(t){return kK[t]}function XK(t){return LK[t]}function ta(t){return{fieldPath:t.canonicalString()}}function Cc(t){return er.fromServerFormat(t.fieldPath)}function PL(t){return t instanceof jn?function(n){if(n.op==="=="){if(RC(n.value))return{unaryFilter:{field:ta(n.field),op:"IS_NAN"}};if(CC(n.value))return{unaryFilter:{field:ta(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(RC(n.value))return{unaryFilter:{field:ta(n.field),op:"IS_NOT_NAN"}};if(CC(n.value))return{unaryFilter:{field:ta(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:ta(n.field),op:KK(n.op),value:n.value}}}(t):t instanceof Ds?function(n){const r=n.getFilters().map(i=>PL(i));return r.length===1?r[0]:{compositeFilter:{op:XK(n.op),filters:r}}}(t):ct(54877,{filter:t})}function YK(t){const e=[];return t.fields.forEach(n=>e.push(n.canonicalString())),{fieldPaths:e}}function IL(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}/**
2628 * @license
2629 * Copyright 2017 Google LLC
2630 *
2631 * Licensed under the Apache License, Version 2.0 (the "License");
2632 * you may not use this file except in compliance with the License.
2633 * You may obtain a copy of the License at
2634 *
2635 *   http://www.apache.org/licenses/LICENSE-2.0
2636 *
2637 * Unless required by applicable law or agreed to in writing, software
2638 * distributed under the License is distributed on an "AS IS" BASIS,
2639 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2640 * See the License for the specific language governing permissions and
2641 * limitations under the License.
2642 */class da{constructor(e,n,r,i,s=gt.min(),o=gt.min(),a=ir.EMPTY_BYTE_STRING,l=null){this.target=e,this.targetId=n,this.purpose=r,this.sequenceNumber=i,this.snapshotVersion=s,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a,this.expectedCount=l}withSequenceNumber(e){return new da(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,n){return new da(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new da(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new da(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/**
2643 * @license
2644 * Copyright 2017 Google LLC
2645 *
2646 * Licensed under the Apache License, Version 2.0 (the "License");
2647 * you may not use this file except in compliance with the License.
2648 * You may obtain a copy of the License at
2649 *
2650 *   http://www.apache.org/licenses/LICENSE-2.0
2651 *
2652 * Unless required by applicable law or agreed to in writing, software
2653 * distributed under the License is distributed on an "AS IS" BASIS,
2654 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2655 * See the License for the specific language governing permissions and
2656 * limitations under the License.
2657 */class QK{constructor(e){this.wt=e}}function ZK(t){const e=$K({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?Pb(e,e.limit,"L"):e}/**
2658 * @license
2659 * Copyright 2019 Google LLC
2660 *
2661 * Licensed under the Apache License, Version 2.0 (the "License");
2662 * you may not use this file except in compliance with the License.
2663 * You may obtain a copy of the License at
2664 *
2665 *   http://www.apache.org/licenses/LICENSE-2.0
2666 *
2667 * Unless required by applicable law or agreed to in writing, software
2668 * distributed under the License is distributed on an "AS IS" BASIS,
2669 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2670 * See the License for the specific language governing permissions and
2671 * limitations under the License.
2672 */class JK{constructor(){this.Cn=new eX}addToCollectionParentIndex(e,n){return this.Cn.add(n),be.resolve()}getCollectionParents(e,n){return be.resolve(this.Cn.getEntries(n))}addFieldIndex(e,n){return be.resolve()}deleteFieldIndex(e,n){return be.resolve()}deleteAllFieldIndexes(e){return be.resolve()}createTargetIndexes(e,n){return be.resolve()}getDocumentsMatchingTarget(e,n){return be.resolve(null)}getIndexType(e,n){return be.resolve(0)}getFieldIndexes(e,n){return be.resolve([])}getNextCollectionGroupToUpdate(e){return be.resolve(null)}getMinOffset(e,n){return be.resolve(ka.min())}getMinOffsetFromCollectionGroup(e,n){return be.resolve(ka.min())}updateCollectionGroup(e,n,r){return be.resolve()}updateIndexEntries(e,n){return be.resolve()}}class eX{constructor(){this.index={}}add(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n]||new Hn(fn.comparator),s=!i.has(r);return this.index[n]=i.add(r),s}has(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n];return i&&i.has(r)}getEntries(e){return(this.index[e]||new Hn(fn.comparator)).toArray()}}/**
2673 * @license
2674 * Copyright 2018 Google LLC
2675 *
2676 * Licensed under the Apache License, Version 2.0 (the "License");
2677 * you may not use this file except in compliance with the License.
2678 * You may obtain a copy of the License at
2679 *
2680 *   http://www.apache.org/licenses/LICENSE-2.0
2681 *
2682 * Unless required by applicable law or agreed to in writing, software
2683 * distributed under the License is distributed on an "AS IS" BASIS,
2684 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2685 * See the License for the specific language governing permissions and
2686 * limitations under the License.
2687 */const HC={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},NL=41943040;class Vr{static withCacheSize(e){return new Vr(e,Vr.DEFAULT_COLLECTION_PERCENTILE,Vr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,n,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=n,this.maximumSequenceNumbersToCollect=r}}/**
2688 * @license
2689 * Copyright 2017 Google LLC
2690 *
2691 * Licensed under the Apache License, Version 2.0 (the "License");
2692 * you may not use this file except in compliance with the License.
2693 * You may obtain a copy of the License at
2694 *
2695 *   http://www.apache.org/licenses/LICENSE-2.0
2696 *
2697 * Unless required by applicable law or agreed to in writing, software
2698 * distributed under the License is distributed on an "AS IS" BASIS,
2699 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2700 * See the License for the specific language governing permissions and
2701 * limitations under the License.
2702 */Vr.DEFAULT_COLLECTION_PERCENTILE=10,Vr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Vr.DEFAULT=new Vr(NL,Vr.DEFAULT_COLLECTION_PERCENTILE,Vr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Vr.DISABLED=new Vr(-1,0,0);/**
2703 * @license
2704 * Copyright 2017 Google LLC
2705 *
2706 * Licensed under the Apache License, Version 2.0 (the "License");
2707 * you may not use this file except in compliance with the License.
2708 * You may obtain a copy of the License at
2709 *
2710 *   http://www.apache.org/licenses/LICENSE-2.0
2711 *
2712 * Unless required by applicable law or agreed to in writing, software
2713 * distributed under the License is distributed on an "AS IS" BASIS,
2714 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2715 * See the License for the specific language governing permissions and
2716 * limitations under the License.
2717 */class Du{constructor(e){this.ur=e}next(){return this.ur+=2,this.ur}static cr(){return new Du(0)}static lr(){return new Du(-1)}}/**
2718 * @license
2719 * Copyright 2020 Google LLC
2720 *
2721 * Licensed under the Apache License, Version 2.0 (the "License");
2722 * you may not use this file except in compliance with the License.
2723 * You may obtain a copy of the License at
2724 *
2725 *   http://www.apache.org/licenses/LICENSE-2.0
2726 *
2727 * Unless required by applicable law or agreed to in writing, software
2728 * distributed under the License is distributed on an "AS IS" BASIS,
2729 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2730 * See the License for the specific language governing permissions and
2731 * limitations under the License.
2732 */const GC="LruGarbageCollector",tX=1048576;function $C([t,e],[n,r]){const i=At(t,n);return i===0?At(e,r):i}class nX{constructor(e){this.Er=e,this.buffer=new Hn($C),this.dr=0}Ar(){return++this.dr}Rr(e){const n=[e,this.Ar()];if(this.buffer.size<this.Er)this.buffer=this.buffer.add(n);else{const r=this.buffer.last();$C(n,r)<0&&(this.buffer=this.buffer.delete(r).add(n))}}get maxValue(){return this.buffer.last()[0]}}class rX{constructor(e,n,r){this.garbageCollector=e,this.asyncQueue=n,this.localStore=r,this.Vr=null}start(){this.garbageCollector.params.cacheSizeCollectionThreshold!==-1&&this.mr(6e4)}stop(){this.Vr&&(this.Vr.cancel(),this.Vr=null)}get started(){return this.Vr!==null}mr(e){We(GC,`Garbage collection scheduled in ${e}ms`),this.Vr=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,async()=>{this.Vr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(n){id(n)?We(GC,"Ignoring IndexedDB error during garbage collection: ",n):await rd(n)}await this.mr(3e5)})}}class iX{constructor(e,n){this.gr=e,this.params=n}calculateTargetCount(e,n){return this.gr.pr(e).next(r=>Math.floor(n/100*r))}nthSequenceNumber(e,n){if(n===0)return be.resolve(hy.le);const r=new nX(n);return this.gr.forEachTarget(e,i=>r.Rr(i.sequenceNumber)).next(()=>this.gr.yr(e,i=>r.Rr(i))).next(()=>r.maxValue)}removeTargets(e,n,r){return this.gr.removeTargets(e,n,r)}removeOrphanedDocuments(e,n){return this.gr.removeOrphanedDocuments(e,n)}collect(e,n){return this.params.cacheSizeCollectionThreshold===-1?(We("LruGarbageCollector","Garbage collection skipped; disabled"),be.resolve(HC)):this.getCacheSize(e).next(r=>r<this.params.cacheSizeCollectionThreshold?(We("LruGarbageCollector",`Garbage collection skipped; Cache size ${r} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),HC):this.wr(e,n))}getCacheSize(e){return this.gr.getCacheSize(e)}wr(e,n){let r,i,s,o,a,l,c;const d=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(f=>(f>this.params.maximumSequenceNumbersToCollect?(We("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${f}`),i=this.params.maximumSequenceNumbersToCollect):i=f,o=Date.now(),this.nthSequenceNumber(e,i))).next(f=>(r=f,a=Date.now(),this.removeTargets(e,r,n))).next(f=>(s=f,l=Date.now(),this.removeOrphanedDocuments(e,r))).next(f=>(c=Date.now(),Ac()<=Nt.DEBUG&&We("LruGarbageCollector",`LRU Garbage Collection
2733	Counted targets in ${o-d}ms
2734	Determined least recently used ${i} in `+(a-o)+`ms
2735	Removed ${s} targets in `+(l-a)+`ms
2736	Removed ${f} documents in `+(c-l)+`ms
2737Total Duration: ${c-d}ms`),be.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:s,documentsRemoved:f})))}}function sX(t,e){return new iX(t,e)}/**
2738 * @license
2739 * Copyright 2017 Google LLC
2740 *
2741 * Licensed under the Apache License, Version 2.0 (the "License");
2742 * you may not use this file except in compliance with the License.
2743 * You may obtain a copy of the License at
2744 *
2745 *   http://www.apache.org/licenses/LICENSE-2.0
2746 *
2747 * Unless required by applicable law or agreed to in writing, software
2748 * distributed under the License is distributed on an "AS IS" BASIS,
2749 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2750 * See the License for the specific language governing permissions and
2751 * limitations under the License.
2752 */class oX{constructor(){this.changes=new Yl(e=>e.toString(),(e,n)=>e.isEqual(n)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,n){this.assertNotApplied(),this.changes.set(e,vr.newInvalidDocument(e).setReadTime(n))}getEntry(e,n){this.assertNotApplied();const r=this.changes.get(n);return r!==void 0?be.resolve(r):this.getFromCache(e,n)}getEntries(e,n){return this.getAllFromCache(e,n)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}
vendor: 9,262 bytes, lines 2752-2831
2752assertNotApplied(){}}/**
2753 * @license
2754 * Copyright 2017 Google LLC
2755 *
2756 * Licensed under the Apache License, Version 2.0 (the "License");
2757 * you may not use this file except in compliance with the License.
2758 * You may obtain a copy of the License at
2759 *
2760 *   http://www.apache.org/licenses/LICENSE-2.0
2761 *
2762 * Unless required by applicable law or agreed to in writing, software
2763 * distributed under the License is distributed on an "AS IS" BASIS,
2764 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2765 * See the License for the specific language governing permissions and
2766 * limitations under the License.
2767 *//**
2768 * @license
2769 * Copyright 2022 Google LLC
2770 *
2771 * Licensed under the Apache License, Version 2.0 (the "License");
2772 * you may not use this file except in compliance with the License.
2773 * You may obtain a copy of the License at
2774 *
2775 *   http://www.apache.org/licenses/LICENSE-2.0
2776 *
2777 * Unless required by applicable law or agreed to in writing, software
2778 * distributed under the License is distributed on an "AS IS" BASIS,
2779 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2780 * See the License for the specific language governing permissions and
2781 * limitations under the License.
2782 */class aX{constructor(e,n){this.overlayedDocument=e,this.mutatedFields=n}}/**
2783 * @license
2784 * Copyright 2017 Google LLC
2785 *
2786 * Licensed under the Apache License, Version 2.0 (the "License");
2787 * you may not use this file except in compliance with the License.
2788 * You may obtain a copy of the License at
2789 *
2790 *   http://www.apache.org/licenses/LICENSE-2.0
2791 *
2792 * Unless required by applicable law or agreed to in writing, software
2793 * distributed under the License is distributed on an "AS IS" BASIS,
2794 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2795 * See the License for the specific language governing permissions and
2796 * limitations under the License.
2797 */class lX{constructor(e,n,r,i){this.remoteDocumentCache=e,this.mutationQueue=n,this.documentOverlayCache=r,this.indexManager=i}getDocument(e,n){let r=null;return this.documentOverlayCache.getOverlay(e,n).next(i=>(r=i,this.remoteDocumentCache.getEntry(e,n))).next(i=>(r!==null&&Of(r.mutation,i,li.empty(),zn.now()),i))}getDocuments(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.getLocalViewOfDocuments(e,r,Ot()).next(()=>r))}getLocalViewOfDocuments(e,n,r=Ot()){const i=gl();return this.populateOverlays(e,i,n).next(()=>this.computeViews(e,n,i,r).next(s=>{let o=tf();return s.forEach((a,l)=>{o=o.insert(a,l.overlayedDocument)}),o}))}getOverlayedDocuments(e,n){const r=gl();return this.populateOverlays(e,r,n).next(()=>this.computeViews(e,n,r,Ot()))}populateOverlays(e,n,r){const i=[];return r.forEach(s=>{n.has(s)||i.push(s)}),this.documentOverlayCache.getOverlays(e,i).next(s=>{s.forEach((o,a)=>{n.set(o,a)})})}computeViews(e,n,r,i){let s=wo();const o=Nf(),a=function(){return Nf()}();return n.forEach((l,c)=>{const d=r.get(c.key);i.has(c.key)&&(d===void 0||d.mutation instanceof Ya)?s=s.insert(c.key,c):d!==void 0?(o.set(c.key,d.mutation.getFieldMask()),Of(d.mutation,c,d.mutation.getFieldMask(),zn.now())):o.set(c.key,li.empty())}),this.recalculateAndSaveOverlays(e,s).next(l=>(l.forEach((c,d)=>o.set(c,d)),n.forEach((c,d)=>{var f;return a.set(c,new aX(d,(f=o.get(c))!==null&&f!==void 0?f:null))}),a))}recalculateAndSaveOverlays(e,n){const r=Nf();let i=new wn((o,a)=>o-a),s=Ot();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,n).next(o=>{for(const a of o)a.keys().forEach(l=>{const c=n.get(l);if(c===null)return;let d=r.get(l)||li.empty();d=a.applyToLocalView(c,d),r.set(l,d);const f=(i.get(a.batchId)||Ot()).add(l);i=i.insert(a.batchId,f)})}).next(()=>{const o=[],a=i.getReverseIterator();for(;a.hasNext();){const l=a.getNext(),c=l.key,d=l.value,f=hL();d.forEach(u=>{if(!s.has(u)){const h=_L(n.get(u),r.get(u));h!==null&&f.set(u,h),s=s.add(u)}}),o.push(this.documentOverlayCache.saveOverlays(e,c,f))}return be.waitFor(o)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,n,r,i){return function(o){return ot.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0}(n)?this.getDocumentsMatchingDocumentQuery(e,n.path):cK(n)?this.getDocumentsMatchingCollectionGroupQuery(e,n,r,i):this.getDocumentsMatchingCollectionQuery(e,n,r,i)}getNextDocuments(e,n,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,n,r,i).next(s=>{const o=i-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,n,r.largestBatchId,i-s.size):be.resolve(gl());let a=fh,l=s;return o.next(c=>be.forEach(c,(d,f)=>(a<f.largestBatchId&&(a=f.largestBatchId),s.get(d)?be.resolve():this.remoteDocumentCache.getEntry(e,d).next(u=>{l=l.insert(d,u)}))).next(()=>this.populateOverlays(e,c,s)).next(()=>this.computeViews(e,l,c,Ot())).next(d=>({batchId:a,changes:fL(d)})))})}getDocumentsMatchingDocumentQuery(e,n){return this.getDocument(e,new ot(n)).next(r=>{let i=tf();return r.isFoundDocument()&&(i=i.insert(r.key,r)),i})}getDocumentsMatchingCollectionGroupQuery(e,n,r,i){const s=n.collectionGroup;let o=tf();return this.indexManager.getCollectionParents(e,s).next(a=>be.forEach(a,l=>{const c=function(f,u){return new gy(u,null,f.explicitOrderBy.slice(),f.filters.slice(),f.limit,f.limitType,f.startAt,f.endAt)}(n,l.child(s));return this.getDocumentsMatchingCollectionQuery(e,c,r,i).next(d=>{d.forEach((f,u)=>{o=o.insert(f,u)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(e,n,r,i){let s;return this.documentOverlayCache.getOverlaysForCollection(e,n.path,r.largestBatchId).next(o=>(s=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,n,r,s,i))).next(o=>{s.forEach((l,c)=>{const d=c.getKey();o.get(d)===null&&(o=o.insert(d,vr.newInvalidDocument(d)))});let a=tf();return o.forEach((l,c)=>{const d=s.get(l);d!==void 0&&Of(d.mutation,c,li.empty(),zn.now()),_y(n,c)&&(a=a.insert(l,c))}),a})}}/**
2798 * @license
2799 * Copyright 2020 Google LLC
2800 *
2801 * Licensed under the Apache License, Version 2.0 (the "License");
2802 * you may not use this file except in compliance with the License.
2803 * You may obtain a copy of the License at
2804 *
2805 *   http://www.apache.org/licenses/LICENSE-2.0
2806 *
2807 * Unless required by applicable law or agreed to in writing, software
2808 * distributed under the License is distributed on an "AS IS" BASIS,
2809 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2810 * See the License for the specific language governing permissions and
2811 * limitations under the License.
2812 */class cX{constructor(e){this.serializer=e,this.kr=new Map,this.qr=new Map}getBundleMetadata(e,n){return be.resolve(this.kr.get(n))}saveBundleMetadata(e,n){return this.kr.set(n.id,function(i){return{id:i.id,version:i.version,createTime:Cs(i.createTime)}}(n)),be.resolve()}getNamedQuery(e,n){return be.resolve(this.qr.get(n))}saveNamedQuery(e,n){return this.qr.set(n.name,function(i){return{name:i.name,query:ZK(i.bundledQuery),readTime:Cs(i.readTime)}}(n)),be.resolve()}}/**
2813 * @license
2814 * Copyright 2022 Google LLC
2815 *
2816 * Licensed under the Apache License, Version 2.0 (the "License");
2817 * you may not use this file except in compliance with the License.
2818 * You may obtain a copy of the License at
2819 *
2820 *   http://www.apache.org/licenses/LICENSE-2.0
2821 *
2822 * Unless required by applicable law or agreed to in writing, software
2823 * distributed under the License is distributed on an "AS IS" BASIS,
2824 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2825 * See the License for the specific language governing permissions and
2826 * limitations under the License.
2827 */class uX{constructor(){this.overlays=new wn(ot.comparator),this.Qr=new Map}getOverlay(e,n){return be.resolve(this.overlays.get(n))}getOverlays(e,n){const r=gl();return be.forEach(n,i=>this.getOverlay(e,i).next(s=>{s!==null&&r.set(i,s)})).next(()=>r)}saveOverlays(e,n,r){return r.forEach((i,s)=>{this.St(e,n,s)}),be.resolve()}removeOverlaysForBatchId(e,n,r){const i=this.Qr.get(r);return i!==void 0&&(i.forEach(s=>this.overlays=this.overlays.remove(s)),this.Qr.delete(r)),be.resolve()}getOverlaysForCollection(e,n,r){const i=gl(),s=n.length+1,o=new ot(n.child("")),a=this.overlays.getIteratorFrom(o);for(;a.hasNext();){const l=a.getNext().value,c=l.getKey();if(!n.isPrefixOf(c.path))break;c.path.length===s&&l.largestBatchId>r&&i.set(l.getKey(),l)}return be.resolve(i)}getOverlaysForCollectionGroup(e,n,r,i){let s=new wn((c,d)=>c-d);const o=this.overlays.getIterator();for(;o.hasNext();){const c=o.getNext().value;if(c.getKey().getCollectionGroup()===n&&c.largestBatchId>r){let d=s.get(c.largestBatchId);d===null&&(d=gl(),s=s.insert(c.largestBatchId,d)),d.set(c.getKey(),c)}}const a=gl(),l=s.getIterator();for(;l.hasNext()&&(l.getNext().value.forEach((c,d)=>a.set(c,d)),!(a.size()>=i)););return be.resolve(a)}St(e,n,r){const i=this.overlays.get(r.key);if(i!==null){const o=this.Qr.get(i.largestBatchId).delete(r.key);this.Qr.set(i.largestBatchId,o)}this.overlays=this.overlays.insert(r.key,new CK(n,r));let s=this.Qr.get(n);s===void 0&&(s=Ot(),this.Qr.set(n,s)),this.Qr.set(n,s.add(r.key))}}/**
2828 * @license
2829 * Copyright 2024 Google LLC
2830 *
2831 * Licensed under the Apache License, Version 2.0 (the "License");
2832 * you may not use this file except in compliance with the License.
2833 * You may obtain a copy of the License at
2834 *
2835 *   http://www.apache.org/licenses/LICENSE-2.0
2836 *
2837 * Unless required by applicable law or agreed to in writing, software
2838 * distributed under the License is distributed on an "AS IS" BASIS,
2839 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2840 * See the License for the specific language governing permissions and
2841 * limitations under the License.
2842 */class dX{constructor(){this.sessionToken=ir.EMPTY_BYTE_STRING}getSessionToken(e){return be.resolve(this.sessionToken)}setSessionToken(e,n){return this.sessionToken=n,be.resolve()}}/**
2843 * @license
2844 * Copyright 2017 Google LLC
2845 *
2846 * Licensed under the Apache License, Version 2.0 (the "License");
2847 * you may not use this file except in compliance with the License.
2848 * You may obtain a copy of the License at
2849 *
2850 *   http://www.apache.org/licenses/LICENSE-2.0
2851 *
2852 * Unless required by applicable law or agreed to in writing, software
2853 * distributed under the License is distributed on an "AS IS" BASIS,
2854 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2855 * See the License for the specific language governing permissions and
2856 * limitations under the License.
2857 */class kE{constructor(){this.$r=new Hn(qn.Ur),this.Kr=new Hn(qn.Wr)}isEmpty(){return this.$r.isEmpty()}addReference(e,n){const r=new qn(e,n);this.$r=this.$r.add(r),this.Kr=this.Kr.add(r)}Gr(e,n){e.forEach(r=>this.addReference(r,n))}removeReference(e,n){this.zr(new qn(e,n))}jr(e,n){e.forEach(r=>this.removeReference(r,n))}Hr(e){const n=new ot(new fn([])),r=new qn(n,e),i=new qn(n,e+1),s=[];return this.Kr.forEachInRange([r,i],o=>{this.zr(o),s.push(o.key)}),s}Jr(){this.$r.forEach(e=>this.zr(e))}zr(e){this.$r=this.$r.delete(e),this.Kr=this.Kr.delete(e)}Yr(e){const n=new ot(new fn([])),r=new qn(n,e),i=new qn(n,e+1);let s=Ot();return this.Kr.forEachInRange([r,i],o=>{s=s.add(o.key)}),s}containsKey(e){const n=new qn(e,0),r=this.$r.firstAfterOrEqual(n);return r!==null&&e.isEqual(r.key)}}class qn{constructor(e,n){this.key=e,this.Zr=n}static Ur(e,n){return ot.comparator(e.key,n.key)||At(e.Zr,n.Zr)}static Wr(e,n){return At(e.Zr,n.Zr)||ot.comparator(e.key,n.key)}}/**
2858 * @license
2859 * Copyright 2017 Google LLC
2860 *
2861 * Licensed under the Apache License, Version 2.0 (the "License");
2862 * you may not use this file except in compliance with the License.
2863 * You may obtain a copy of the License at
2864 *
2865 *   http://www.apache.org/licenses/LICENSE-2.0
2866 *
2867 * Unless required by applicable law or agreed to in writing, software
2868 * distributed under the License is distributed on an "AS IS" BASIS,
2869 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2870 * See the License for the specific language governing permissions and
2871 * limitations under the License.
2872 */class fX{constructor(e,n){this.indexManager=e,this.referenceDelegate=n,this.mutationQueue=[],this.nr=1,this.Xr=new Hn(qn.Ur)}checkEmpty(e){return be.resolve(this.mutationQueue.length===0)}addMutationBatch(e,n,r,i){const s=this.nr;this.nr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new MK(s,n,r,i);this.mutationQueue.push(o);for(const a of i)this.Xr=this.Xr.add(new qn(a.key,s)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return be.resolve(o)}lookupMutationBatch(e,n){return be.resolve(this.ei(n))}getNextMutationBatchAfterBatchId(e,n){const r=n+1,i=this.ti(r),s=i<0?0:i;return be.resolve(this.mutationQueue.length>s?this.mutationQueue[s]:null)}getHighestUnacknowledgedBatchId(){return be.resolve(this.mutationQueue.length===0?AE:this.nr-1)}getAllMutationBatches(e){return be.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,n){const r=new qn(n,0),i=new qn(n,Number.POSITIVE_INFINITY),s=[];return this.Xr.forEachInRange([r,i],o=>{const a=this.ei(o.Zr);s.push(a)}),be.resolve(s)}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new Hn(At);return n.forEach(i=>{const s=new qn(i,0),o=new qn(i,Number.POSITIVE_INFINITY);this.Xr.forEachInRange([s,o],a=>{r=r.add(a.Zr)})}),be.resolve(this.ni(r))}getAllMutationBatchesAffectingQuery(e,n){const r=n.path,i=r.length+1;let s=r;ot.isDocumentKey(s)||(s=s.child(""));const o=new qn(new ot(s),0);let a=new Hn(At);return this.Xr.forEachWhile(l=>{const c=l.key.path;return!!r.isPrefixOf(c)&&(c.length===i&&(a=a.add(l.Zr)),!0)},o),be.resolve(this.ni(a))}ni(e){const n=[];return e.forEach(r=>{const i=this.ei(r);i!==null&&n.push(i)}),n}removeMutationBatch(e,n){Wt(this.ri(n.batchId,"removed")===0,55003),this.mutation
2872Queue.shift();let r=this.Xr;return be.forEach(n.mutations,i=>{const s=new qn(i.key,n.batchId);return r=r.delete(s),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.Xr=r})}sr(e){}containsKey(e,n){const r=new qn(n,0),i=this.Xr.firstAfterOrEqual(r);return be.resolve(n.isEqual(i&&i.key))}performConsistencyCheck(e){return this.mutationQueue.length,be.resolve()}ri(e,n){return this.ti(e)}ti(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}ei(e){const n=this.ti(e);return n<0||n>=this.mutationQueue.length?null:this.mutationQueue[n]}}/**
2873 * @license
2874 * Copyright 2017 Google LLC
2875 *
2876 * Licensed under the Apache License, Version 2.0 (the "License");
2877 * you may not use this file except in compliance with the License.
2878 * You may obtain a copy of the License at
2879 *
2880 *   http://www.apache.org/licenses/LICENSE-2.0
2881 *
2882 * Unless required by applicable law or agreed to in writing, software
2883 * distributed under the License is distributed on an "AS IS" BASIS,
2884 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2885 * See the License for the specific language governing permissions and
2886 * limitations under the License.
2887 */class hX{constructor(e){this.ii=e,this.docs=function(){return new wn(ot.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,n){const r=n.key,i=this.docs.get(r),s=i?i.size:0,o=this.ii(n);return this.docs=this.docs.insert(r,{document:n.mutableCopy(),size:o}),this.size+=o-s,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)}getEntry(e,n){const r=this.docs.get(n);return be.resolve(r?r.document.mutableCopy():vr.newInvalidDocument(n))}getEntries(e,n){let r=wo();return n.forEach(i=>{const s=this.docs.get(i);r=r.insert(i,s?s.document.mutableCopy():vr.newInvalidDocument(i))}),be.resolve(r)}getDocumentsMatchingQuery(e,n,r,i){let s=wo();const o=n.path,a=new ot(o.child("__id-9223372036854775808__")),l=this.docs.getIteratorFrom(a);for(;l.hasNext();){const{key:c,value:{document:d}}=l.getNext();if(!o.isPrefixOf(c.path))break;c.path.length>o.length+1||Bq(jq(d),r)<=0||(i.has(d.key)||_y(n,d))&&(s=s.insert(d.key,d.mutableCopy()))}return be.resolve(s)}getAllFromCollectionGroup(e,n,r,i){ct(9500)}si(e,n){return be.forEach(this.docs,r=>n(r))}newChangeBuffer(e){return new pX(this)}getSize(e){return be.resolve(this.size)}}class pX extends oX{constructor(e){super(),this.Br=e}applyChanges(e){const n=[];
vendor: 9,093 bytes, lines 2887-2951
2887return this.changes.forEach((r,i)=>{i.isValidDocument()?n.push(this.Br.addEntry(e,i)):this.Br.removeEntry(r)}),be.waitFor(n)}getFromCache(e,n){return this.Br.getEntry(e,n)}getAllFromCache(e,n){return this.Br.getEntries(e,n)}}/**
2888 * @license
2889 * Copyright 2017 Google LLC
2890 *
2891 * Licensed under the Apache License, Version 2.0 (the "License");
2892 * you may not use this file except in compliance with the License.
2893 * You may obtain a copy of the License at
2894 *
2895 *   http://www.apache.org/licenses/LICENSE-2.0
2896 *
2897 * Unless required by applicable law or agreed to in writing, software
2898 * distributed under the License is distributed on an "AS IS" BASIS,
2899 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2900 * See the License for the specific language governing permissions and
2901 * limitations under the License.
2902 */class mX{constructor(e){this.persistence=e,this.oi=new Yl(n=>RE(n),PE),this.lastRemoteSnapshotVersion=gt.min(),this.highestTargetId=0,this._i=0,this.ai=new kE,this.targetCount=0,this.ui=Du.cr()}forEachTarget(e,n){return this.oi.forEach((r,i)=>n(i)),be.resolve()}getLastRemoteSnapshotVersion(e){return be.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return be.resolve(this._i)}allocateTargetId(e){return this.highestTargetId=this.ui.next(),be.resolve(this.highestTargetId)}setTargetsMetadata(e,n,r){return r&&(this.lastRemoteSnapshotVersion=r),n>this._i&&(this._i=n),be.resolve()}Tr(e){this.oi.set(e.target,e);const n=e.targetId;n>this.highestTargetId&&(this.ui=new Du(n),this.highestTargetId=n),e.sequenceNumber>this._i&&(this._i=e.sequenceNumber)}addTargetData(e,n){return this.Tr(n),this.targetCount+=1,be.resolve()}updateTargetData(e,n){return this.Tr(n),be.resolve()}removeTargetData(e,n){return this.oi.delete(n.target),this.ai.Hr(n.targetId),this.targetCount-=1,be.resolve()}removeTargets(e,n,r){let i=0;const s=[];return this.oi.forEach((o,a)=>{a.sequenceNumber<=n&&r.get(a.targetId)===null&&(this.oi.delete(o),s.push(this.removeMatchingKeysForTargetId(e,a.targetId)),i++)}),be.waitFor(s).next(()=>i)}getTargetCount(e){return be.resolve(this.targetCount)}getTargetData(e,n){const r=this.oi.get(n)||null;return be.resolve(r)}addMatchingKeys(e,n,r){return this.ai.Gr(n,r),be.resolve()}removeMatchingKeys(e,n,r){this.ai.jr(n,r);const i=this.persistence.referenceDelegate,s=[];return i&&n.forEach(o=>{s.push(i.markPotentiallyOrphaned(e,o))}),be.waitFor(s)}removeMatchingKeysForTargetId(e,n){return this.ai.Hr(n),be.resolve()}getMatchingKeysForTargetId(e,n){const r=this.ai.Yr(n);return be.resolve(r)}containsKey(e,n){return be.resolve(this.ai.containsKey(n))}}/**
2903 * @license
2904 * Copyright 2017 Google LLC
2905 *
2906 * Licensed under the Apache License, Version 2.0 (the "License");
2907 * you may not use this file except in compliance with the License.
2908 * You may obtain a copy of the License at
2909 *
2910 *   http://www.apache.org/licenses/LICENSE-2.0
2911 *
2912 * Unless required by applicable law or agreed to in writing, software
2913 * distributed under the License is distributed on an "AS IS" BASIS,
2914 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2915 * See the License for the specific language governing permissions and
2916 * limitations under the License.
2917 */class OL{constructor(e,n){this.ci={},this.overlays={},this.li=new hy(0),this.hi=!1,this.hi=!0,this.Pi=new dX,this.referenceDelegate=e(this),this.Ti=new mX(this),this.indexManager=new JK,this.remoteDocumentCache=function(i){return new hX(i)}(r=>this.referenceDelegate.Ii(r)),this.serializer=new QK(n),this.Ei=new cX(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.hi=!1,Promise.resolve()}get started(){return this.hi}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let n=this.overlays[e.toKey()];return n||(n=new uX,this.overlays[e.toKey()]=n),n}getMutationQueue(e,n){let r=this.ci[e.toKey()];return r||(r=new fX(n,this.referenceDelegate),this.ci[e.toKey()]=r),r}getGlobalsCache(){return this.Pi}getTargetCache(){return this.Ti}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ei}runTransaction(e,n,r){We("MemoryPersistence","Starting transaction:",e);const i=new gX(this.li.next());return this.referenceDelegate.di(),r(i).next(s=>this.referenceDelegate.Ai(i).next(()=>s)).toPromise().then(s=>(i.raiseOnCommittedEvent(),s))}Ri(e,n){return be.or(Object.values(this.ci).map(r=>()=>r.containsKey(e,n)))}}class gX extends zq{constructor(e){super(),this.currentSequenceNumber=e}}class LE{constructor(e){this.persistence=e,this.Vi=new kE,this.mi=null}static fi(e){return new LE(e)}get gi(){if(this.mi)return this.mi;throw ct(60996)}addReference(e,n,r){return this.Vi.addReference(r,n),this.gi.delete(r.toString()),be.resolve()}removeReference(e,n,r){return this.Vi.removeReference(r,n),this.gi.add(r.toString()),be.resolve()}markPotentiallyOrphaned(e,n){return this.gi.add(n.toString()),be.resolve()}removeTarget(e,n){this.Vi.Hr(n.targetId).forEach(i=>this.gi.add(i.toString()));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,n.targetId).next(i=>{i.forEach(s=>this.gi.add(s.toString()))}).next(()=>r.removeTargetData(e,n))}di(){this.mi=new Set}Ai(e){const n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return be.forEach(this.gi,r=>{const i=ot.fromPath(r);return this.pi(e,i).next(s=>{s||n.removeEntry(i,gt.min())})}).next(()=>(this.mi=null,n.apply(e)))}updateLimboDocument(e,n){return this.pi(e,n).next(r=>{r?this.gi.delete(n.toString()):this.gi.add(n.toString())})}Ii(e){return 0}pi(e,n){return be.or([()=>be.resolve(this.Vi.containsKey(n)),()=>this.persistence.getTargetCache().containsKey(e,n),()=>this.persistence.Ri(e,n)])}}class ov{constructor(e,n){this.persistence=e,this.yi=new Yl(r=>$q(r.path),(r,i)=>r.isEqual(i)),this.garbageCollector=sX(this,n)}static fi(e,n){return new ov(e,n)}di(){}Ai(e){return be.resolve()}forEachTarget(e,n){return this.persistence.getTargetCache().forEachTarget(e,n)}pr(e){const n=this.br(e);return this.persistence.getTargetCache().getTargetCount(e).next(r=>n.next(i=>r+i))}br(e){let n=0;return this.yr(e,r=>{n++}).next(()=>n)}yr(e,n){return be.forEach(this.yi,(r,i)=>this.Dr(e,r,i).next(s=>s?be.resolve():n(i)))}removeTargets(e,n,r){return this.persistence.getTargetCache().removeTargets(e,n,r)}removeOrphanedDocuments(e,n){let r=0;const i=this.persistence.getRemoteDocumentCache(),s=i.newChangeBuffer();return i.si(e,o=>this.Dr(e,o,n).next(a=>{a||(r++,s.removeEntry(o,gt.min()))})).next(()=>s.apply(e)).next(()=>r)}markPotentiallyOrphaned(e,n){return this.yi.set(n,e.currentSequenceNumber),be.resolve()}removeTarget(e,n){const r=n.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,n,r){return this.yi.set(r,e.currentSequenceNumber),be.resolve()}removeReference(e,n,r){return this.yi.set(r,e.currentSequenceNumber),be.resolve()}updateLimboDocument(e,n){return this.yi.set(n,e.currentSequenceNumber),be.resolve()}Ii(e){let n=e.key.toString().length;return e.isFoundDocument()&&(n+=Km(e.data.value)),n}Dr(e,n,r){return be.or([()=>this.persistence.Ri(e,n),()=>this.persistence.getTargetCache().containsKey(e,n),()=>{const i=this.yi.get(n);return be.resolve(i!==void 0&&i>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}/**
2918 * @license
2919 * Copyright 2017 Google LLC
2920 *
2921 * Licensed under the Apache License, Version 2.0 (the "License");
2922 * you may not use this file except in compliance with the License.
2923 * You may obtain a copy of the License at
2924 *
2925 *   http://www.apache.org/licenses/LICENSE-2.0
2926 *
2927 * Unless required by applicable law or agreed to in writing, software
2928 * distributed under the License is distributed on an "AS IS" BASIS,
2929 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2930 * See the License for the specific language governing permissions and
2931 * limitations under the License.
2932 */class FE{constructor(e,n,r,i){this.targetId=e,this.fromCache=n,this.ds=r,this.As=i}static Rs(e,n){let r=Ot(),i=Ot();for(const s of n.docChanges)switch(s.type){case 0:r=r.add(s.doc.key);break;case 1:i=i.add(s.doc.key)}return new FE(e,n.fromCache,r,i)}}/**
2933 * @license
2934 * Copyright 2023 Google LLC
2935 *
2936 * Licensed under the Apache License, Version 2.0 (the "License");
2937 * you may not use this file except in compliance with the License.
2938 * You may obtain a copy of the License at
2939 *
2940 *   http://www.apache.org/licenses/LICENSE-2.0
2941 *
2942 * Unless required by applicable law or agreed to in writing, software
2943 * distributed under the License is distributed on an "AS IS" BASIS,
2944 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2945 * See the License for the specific language governing permissions and
2946 * limitations under the License.
2947 */class vX{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}/**
2948 * @license
2949 * Copyright 2019 Google LLC
2950 *
2951 * Licensed under the Apache License, Version 2.0 (the "License");
2952 * you may not use this file except in compliance with the License.
2953 * You may obtain a copy of the License at
2954 *
2955 *   http://www.apache.org/licenses/LICENSE-2.0
2956 *
2957 * Unless required by applicable law or agreed to in writing, software
2958 * distributed under the License is distributed on an "AS IS" BASIS,
2959 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2960 * See the License for the specific language governing permissions and
2961 * limitations under the License.
2962 */class yX{constructor(){this.Vs=!1,this.fs=!1,this.gs=100,this.ps=function(){return $7()?8:Hq(xr())>0?6:4}()}initialize(e,n){this.ys=e,this.indexManager=n,this.Vs=!0}getDocumentsMatchingQuery(e,n,r,i){const s={result:null};return this.ws(e,n).next(o=>{s.result=o}).next(()=>{if(!s.result)return this.bs(e,n,i,r).next(o=>{s.result=o})}).next(()=>{if(s.result)return;const o=new vX;return this.Ss(e,n,o).next(a=>{if(s.result=a,this.fs)return this.Ds(e,n,o,a.size)})}).next(()=>s.result)}Ds(e,n,r,i){return r.documentReadCount<this.gs?(Ac()<=Nt.DEBUG&&We("QueryEngine","SDK will not create cache indexes for query:",Mc(n),"since it only creates cache indexes for collection contains","more than or equal to",this.gs,"documents"),be.resolve()):(Ac()<=Nt.DEBUG&&We("QueryEngine","Query:",Mc(n),"scans",r.documentReadCount,"local documents and returns",i,"documents as results."),r.documentReadCount>this.ps*i?(Ac()<=Nt.DEBUG&&We("QueryEngine","The SDK decides to create cache indexes for query:",Mc(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Ms(n))):be.resolve())}ws(e,n){if(OC(n))return be.resolve(null);let r=Ms(n);return this.indexManager.getIndexType(e,r).next(i=>i===0?null:(n.limit!==null&&i===1&&(n=Pb(n,null,"F"),r=Ms(n)),this.indexManager.getDocumentsMatchingTarget(e,r).next(s=>{const o=Ot(...s);return this.ys.getDocuments(e,o).next(a=>this.indexManager.getMinOffset(e,r).next(l=>{const c=this.vs(n,a);return this.Cs(n,c,o,l.readTime)?this.ws(e,Pb(n,null,"F")):this.Fs(e,c,n,l)}))})))}bs(e,n,r,i){return OC(n)||i.isEqual(gt.min())?be.resolve(null):this.ys.getDocuments(e,r).next(s=>{const o=this.vs(n,s);return this.Cs(n,o,r,i)?be.resolve(null):(Ac()<=Nt.DEBUG&&We("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),Mc(n)),this.Fs(e,o,n,Uq(i,fh)).next(a=>a))})}vs(e,n){let r=new Hn(uL(e));return n.forEach((i,s)=>{_y(e,s)&&(r=r.add(s))}),r}Cs(e,n,r,i){if(e.limit===null)return!1;if(r.size!==n.size)return!0;const s=e.limitType==="F"?n.last():n.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(i)>0)}Ss(e,n,r){return Ac()<=Nt.DEBUG&&We("QueryEngine","Using full collection scan to execute query:",Mc(n)),this.ys.getDocumentsMatchingQuery(e,n,ka.min(),r)}Fs(e,n,r,i){return this.ys.getDocumentsMatchingQuery(e,r,i).next(s=>(n.forEach(o=>{s=s.insert(o.key,o)}),s))}}/**
2963 * @license
2964 * Copyright 2020 Google LLC
2965 *
2966 * Licensed under the Apache License, Version 2.0 (the "License");
2967 * you may not use this file except in compliance with the License.
2968 * You may obtain a copy of the License at
2969 *
2970 *   http://www.apache.org/licenses/LICENSE-2.0
2971 *
2972 * Unless required by applicable law or agreed to in writing, software
2973 * distributed under the License is distributed on an "AS IS" BASIS,
2974 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2975 * See the License for the specific language governing permissions and
2976 * limitations under the License.
2977 */const UE="LocalStore",_X=3e8;class xX{constructor(e,n,r,i){this.persistence=e,this.Ms=n,this.serializer=i,this.xs=new wn(At),this.Os=new Yl(s=>RE(s),PE),this.Ns=new Map,this.Bs=e.getRemoteDocumentCache(),this.Ti=e.getTargetCache(),this.Ei=e.getBundleCache(),this.Ls(r)}Ls(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new lX(this.Bs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Bs.setIndexManager(this.indexManager),this.Ms.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",n=>e.collect(n,this.xs))}}function bX(t,e,n,r){return new xX(t,e,n,r)}async function DL(t,e){const n=mt(t);return await n.persistence.runTransaction("Handle user change","readonly",r=>{let i;
2977return n.mutationQueue.getAllMutationBatches(r).next(s=>(i=s,n.Ls(e),n.mutationQueue.getAllMutationBatches(r))).next(s=>{const o=[],a=[];let l=Ot();for(const c of i){o.push(c.batchId);for(const d of c.mutations)l=l.add(d.key)}for(const c of s){a.push(c.batchId);for(const d of c.mutations)l=l.add(d.key)}return n.localDocuments.getDocuments(r,l).next(c=>({ks:c,removedBatchIds:o,addedBatchIds:a}))})})}function wX(t,e){const n=mt(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{const i=e.batch.keys(),s=n.Bs.newChangeBuffer({trackRemovals:!0});return function(a,l,c,d){const f=c.batch,u=f.keys();let h=be.resolve();return u.forEach(g=>{h=h.next(()=>d.getEntry(l,g)).next(v=>{const m=c.docVersions.get(g);Wt(m!==null,48541),v.version.compareTo(m)<0&&(f.applyToRemoteDocument(v,c),v.isValidDocument()&&(v.setReadTime(c.commitVersion),d.addEntry(v)))})}),h.next(()=>a.mutationQueue.removeMutationBatch(l,f))}(n,r,e,s).next(()=>s.apply(r)).next(()=>n.mutationQueue.performConsistencyCheck(r)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(r,i,e.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(a){let l=Ot();for(let c=0;c<a.mutationResults.length;++c)a.mutationResults[c].transformResults.length>0&&(l=l.add(a.batch.mutations[c].key));return l}(e))).next(()=>n.localDocuments.getDocuments(r,i))})}function kL(t){const e=mt(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",n=>e.Ti.getLastRemoteSnapshotVersion(n))}function EX(t,e){const n=mt(t),r=e.snapshotVersion;let i=n.xs;return n.persistence.runTransaction("Apply remote event","readwrite-primary",s=>{const o=n.Bs.newChangeBuffer({trackRemovals:!0});i=n.xs;const a=[];
vendor: 4,409 bytes, lines 2977-2981
2977e.targetChanges.forEach((d,f)=>{const u=i.get(f);if(!u)return;a.push(n.Ti.removeMatchingKeys(s,d.removedDocuments,f).next(()=>n.Ti.addMatchingKeys(s,d.addedDocuments,f)));let h=u.withSequenceNumber(s.currentSequenceNumber);e.targetMismatches.get(f)!==null?h=h.withResumeToken(ir.EMPTY_BYTE_STRING,gt.min()).withLastLimboFreeSnapshotVersion(gt.min()):d.resumeToken.approximateByteSize()>0&&(h=h.withResumeToken(d.resumeToken,r)),i=i.insert(f,h),function(v,m,p){return v.resumeToken.approximateByteSize()===0||m.snapshotVersion.toMicroseconds()-v.snapshotVersion.toMicroseconds()>=_X?!0:p.addedDocuments.size+p.modifiedDocuments.size+p.removedDocuments.size>0}(u,h,d)&&a.push(n.Ti.updateTargetData(s,h))});let l=wo(),c=Ot();if(e.documentUpdates.forEach(d=>{e.resolvedLimboDocuments.has(d)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(s,d))}),a.push(SX(s,o,e.documentUpdates).next(d=>{l=d.qs,c=d.Qs})),!r.isEqual(gt.min())){const d=n.Ti.getLastRemoteSnapshotVersion(s).next(f=>n.Ti.setTargetsMetadata(s,s.currentSequenceNumber,r));a.push(d)}return be.waitFor(a).next(()=>o.apply(s)).next(()=>n.localDocuments.getLocalViewOfDocuments(s,l,c)).next(()=>l)}).then(s=>(n.xs=i,s))}function SX(t,e,n){let r=Ot(),i=Ot();return n.forEach(s=>r=r.add(s)),e.getEntries(t,r).next(s=>{let o=wo();return n.forEach((a,l)=>{const c=s.get(a);l.isFoundDocument()!==c.isFoundDocument()&&(i=i.add(a)),l.isNoDocument()&&l.version.isEqual(gt.min())?(e.removeEntry(a,l.readTime),o=o.insert(a,l)):!c.isValidDocument()||l.version.compareTo(c.version)>0||l.version.compareTo(c.version)===0&&c.hasPendingWrites?(e.addEntry(l),o=o.insert(a,l)):We(UE,"Ignoring outdated watch update for ",a,". Current version:",c.version," Watch version:",l.version)}),{qs:o,Qs:i}})}function TX(t,e){const n=mt(t);return n.persistence.runTransaction("Get next mutation batch","readonly",r=>(e===void 0&&(e=AE),n.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function AX(t,e){const n=mt(t);return n.persistence.runTransaction("Allocate target","readwrite",r=>{let i;return n.Ti.getTargetData(r,e).next(s=>s?(i=s,be.resolve(i)):n.Ti.allocateTargetId(r).next(o=>(i=new da(e,o,"TargetPurposeListen",r.currentSequenceNumber),n.Ti.addTargetData(r,i).next(()=>i))))}).then(r=>{const i=n.xs.get(r.targetId);return(i===null||r.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(n.xs=n.xs.insert(r.targetId,r),n.Os.set(e,r.targetId)),r})}async function kb(t,e,n){const r=mt(t),i=r.xs.get(e),s=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",s,o=>r.persistence.referenceDelegate.removeTarget(o,i))}catch(o){if(!id(o))throw o;We(UE,`Failed to update sequence numbers for target ${e}: ${o}`)}r.xs=r.xs.remove(e),r.Os.delete(i.target)}function WC(t,e,n){const r=mt(t);let i=gt.min(),s=Ot();return r.persistence.runTransaction("Execute query","readwrite",o=>function(l,c,d){const f=mt(l),u=f.Os.get(d);return u!==void 0?be.resolve(f.xs.get(u)):f.Ti.getTargetData(c,d)}(r,o,Ms(e)).next(a=>{if(a)return i=a.lastLimboFreeSnapshotVersion,r.Ti.getMatchingKeysForTargetId(o,a.targetId).next(l=>{s=l})}).next(()=>r.Ms.getDocumentsMatchingQuery(o,e,n?i:gt.min(),n?s:Ot())).next(a=>(MX(r,dK(e),a),{documents:a,$s:s})))}function MX(t,e,n){let r=t.Ns.get(e)||gt.min();n.forEach((i,s)=>{s.readTime.compareTo(r)>0&&(r=s.readTime)}),t.Ns.set(e,r)}class qC{constructor(){this.activeTargetIds=vK()}js(e){this.activeTargetIds=this.activeTargetIds.add(e)}Hs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}zs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class CX{constructor(){this.xo=new qC,this.Oo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,n,r){}addLocalQueryTarget(e,n=!0){return n&&this.xo.js(e),this.Oo[e]||"not-current"}updateQueryState(e,n,r){this.Oo[e]=n}removeLocalQueryTarget(e){this.xo.Hs(e)}isLocalQueryTarget(e){return this.xo.activeTargetIds.has(e)}clearQueryState(e){delete this.Oo[e]}getAllActiveQueryTargets(){return this.xo.activeTargetIds}isActiveQueryTarget(e){return this.xo.activeTargetIds.has(e)}start(){return this.xo=new qC,Promise.resolve()}handleUserChange(e,n,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/**
2978 * @license
2979 * Copyright 2019 Google LLC
2980 *
2981 * Licensed under the Apache License, Version 2.0 (the "License");
2982 * you may not use this file except in compliance with the License.
2983 * You may obtain a copy of the License at
2984 *
2985 *   http://www.apache.org/licenses/LICENSE-2.0
2986 *
2987 * Unless required by applicable law or agreed to in writing, software
2988 * distributed under the License is distributed on an "AS IS" BASIS,
2989 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2990 * See the License for the specific language governing permissions and
2991 * limitations under the License.
2992 */class RX{No(e){}shutdown(){}}/**
2993 * @license
2994 * Copyright 2019 Google LLC
2995 *
2996 * Licensed under the Apache License, Version 2.0 (the "License");
2997 * you may not use this file except in compliance with the License.
2998 * You may obtain a copy of the License at
2999 *
3000 *   http://www.apache.org/licenses/LICENSE-2.0
3001 *
3002 * Unless required by applicable law or agreed to in writing, software
3003 * distributed under the License is distributed on an "AS IS" BASIS,
3004 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3005 * See the License for the specific language governing permissions and
3006 * limitations under the License.
3007 */const KC="ConnectivityMonitor";class XC{constructor(){this.Bo=()=>this.Lo(),this.ko=()=>this.qo(),this.Qo=[],this.$o()}No(e){this.Qo.push(e)}shutdown(){window.removeEventListener("online",this.Bo),window.removeEventListener("offline",this.ko)}$o(){window.addEventListener("online",this.Bo),window.addEventListener("offline",this.ko)}Lo(){We(KC,"Network connectivity changed: AVAILABLE");for(const e of this.Qo)e(0)}qo(){We(KC,"Network connectivity changed: UNAVAILABLE");for(const e of this.Qo)e(1)}static C(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/**
3008 * @license
3009 * Copyright 2023 Google LLC
3010 *
3011 * Licensed under the Apache License, Version 2.0 (the "License");
3012 * you may not use this file except in compliance with the License.
3013 * You may obtain a copy of the License at
3014 *
3015 *   http://www.apache.org/licenses/LICENSE-2.0
3016 *
3017 * Unless required by applicable law or agreed to in writing, software
3018 * distributed under the License is distributed on an "AS IS" BASIS,
3019 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3020 * See the License for the specific language governing permissions and
3021 * limitations under the License.
3022 */let Wp=null;function Lb(){return Wp===null?Wp=function(){return 268435456+Math.round(2147483648*Math.random())}():Wp++,"0x"+Wp.toString(16)}/**
3023 * @license
3024 * Copyright 2020 Google LLC
3025 *
3026 * Licensed under the Apache License, Version 2.0 (the "License");
3027 * you may not use this file except in compliance with the License.
3028 * You may obtain a copy of the License at
3029 *
3030 *   http://www.apache.org/licenses/LICENSE-2.0
3031 *
3032 * Unless required by applicable law or agreed to in writing, software
3033 * distributed under the License is distributed on an "AS IS" BASIS,
3034 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3035 * See the License for the specific language governing permissions and
3036 * limitations under the License.
3037 */const Y_="RestConnection",PX={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class IX{get Uo(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const n=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.Ko=n+"://"+e.host,this.Wo=`projects/${r}/databases/${i}`,this.Go=this.databaseId.database===ev?`project_id=${r}`:`project_id=${r}&database_id=${i}`}zo(e,n,r,i,s){const o=Lb(),a=this.jo(e,n.toUriEncodedString());We(Y_,`Sending RPC '${e}' ${o}:`,a,r);const l={"google-cloud-resource-prefix":this.Wo,"x-goog-request-params":this.Go};this.Ho(l,i,s);const{host:c}=new URL(a),d=$l(c);return this.Jo(e,a,l,r,d).then(f=>(We(Y_,`Received RPC '${e}' ${o}: `,f),f),f=>{throw Pu(Y_,`RPC '${e}' ${o} failed with error: `,f,"url: ",a,"request:",r),f})}Yo(e,n,r,i,s,o){return this.zo(e,n,r,i,s)}Ho(e,n,r){e["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+nd}(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),n&&n.headers.forEac
3037h((i,s)=>e[s]=i),r&&r.headers.forEach((i,s)=>e[s]=i)}jo(e,n){const r=PX[e];return`${this.Ko}/v1/${n}:${r}`}terminate(){}}/**
3038 * @license
3039 * Copyright 2017 Google LLC
3040 *
3041 * Licensed under the Apache License, Version 2.0 (the "License");
3042 * you may not use this file except in compliance with the License.
3043 * You may obtain a copy of the License at
3044 *
3045 *   http://www.apache.org/licenses/LICENSE-2.0
3046 *
3047 * Unless required by applicable law or agreed to in writing, software
3048 * distributed under the License is distributed on an "AS IS" BASIS,
3049 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3050 * See the License for the specific language governing permissions and
3051 * limitations under the License.
3052 */class NX{constructor(e){this.Zo=e.Zo,this.Xo=e.Xo}e_(e){this.t_=e}n_(e){this.r_=e}i_(e){this.s_=e}onMessage(e){this.o_=e}close(){this.Xo()}send(e){this.Zo(e)}__(){this.t_()}a_(){this.r_()}u_(e){this.s_(e)}c_(e){this.o_(e)}}/**
3053 * @license
3054 * Copyright 2017 Google LLC
3055 *
3056 * Licensed under the Apache License, Version 2.0 (the "License");
3057 * you may not use this file except in compliance with the License.
3058 * You may obtain a copy of the License at
3059 *
3060 *   http://www.apache.org/licenses/LICENSE-2.0
3061 *
3062 * Unless required by applicable law or agreed to in writing, software
3063 * distributed under the License is distributed on an "AS IS" BASIS,
3064 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3065 * See the License for the specific language governing permissions and
3066 * limitations under the License.
3067 */const dr="WebChannelConnection";class OX extends IX{constructor(e){super(e),this.l_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Jo(e,n,r,i,s){const o=Lb();return new Promise((a,l)=>{const c=new Lk;c.setWithCredentials(!0),c.listenOnce(Fk.COMPLETE,()=>{try{switch(c.getLastErrorCode()){case qm.NO_ERROR:const f=c.getResponseJson();We(dr,`XHR for RPC '${e}' ${o} received:`,JSON.stringify(f)),a(f);break;case qm.TIMEOUT:We(dr,`RPC '${e}' ${o} timed out`),l(new it(Te.DEADLINE_EXCEEDED,"Request time out"));break;case qm.HTTP_ERROR:const u=c.getStatus();if(We(dr,`RPC '${e}' ${o} failed with status:`,u,"response text:",c.getResponseText()),u>0){let h=c.getResponseJson();Array.isArray(h)&&(h=h[0]);const g=h==null?void 0:h.error;if(g&&g.status&&g.message){const v=function(p){const y=p.toLowerCase().replace(/_/g,"-");return Object.values(Te).indexOf(y)>=0?y:Te.UNKNOWN}(g.status);l(new it(v,g.message))}else l(new it(Te.UNKNOWN,"Server responded with status "+c.getStatus()))}else l(new it(Te.UNAVAILABLE,"Connection failed."));break;default:ct(9055,{h_:e,streamId:o,P_:c.getLastErrorCode(),T_:c.getLastError()})}}finally{We(dr,`RPC '${e}' ${o} completed.`)}});const d=JSON.stringify(i);We(dr,`RPC '${e}' ${o} sending request:`,i),c.send(n,"POST",d,r,15)})}I_(e,n,r){const i=Lb(),s=[this.Ko,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=Bk(),a=jk(),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},c=this.longPollingOptions.timeoutSeconds;c!==void 0&&(l.longPollingTimeout=Math.round(1e3*c)),this.useFetchStreams&&(l.useFetchStreams=!0),this.Ho(l.initMessageHeaders,n,r),l.encodeInitMessageHeaders=!0;const d=s.join("");We(dr,`Creating RPC '${e}' stream ${i}: ${d}`,l);const f=o.createWebChannel(d,l);this.E_(f);let u=!1,h=!1;const g=new NX({Zo:m=>{h?We(dr,`Not sending because RPC '${e}' stream ${i} is closed:`,m):(u||(We(dr,`Opening RPC '${e}' stream ${i} transport.`),f.open(),u=!0),We(dr,`RPC '${e}' stream ${i} sending:`,m),f.send(m))},Xo:()=>f.close()}),v=(m,p,y)=>{m.listen(p,w=>{try{y(w)}catch(x){setTimeout(()=>{throw x},0)}})};return v(f,ef.EventType.OPEN,()=>{h||(We(dr,`RPC '${e}' stream ${i} transport opened.`),g.__())}),v(f,ef.EventType.CLOSE,()=>
vendor: 10,626 bytes, lines 3067-3132
3067{h||(h=!0,We(dr,`RPC '${e}' stream ${i} transport closed`),g.u_(),this.d_(f))}),v(f,ef.EventType.ERROR,m=>{h||(h=!0,Pu(dr,`RPC '${e}' stream ${i} transport errored. Name:`,m.name,"Message:",m.message),g.u_(new it(Te.UNAVAILABLE,"The operation could not be completed")))}),v(f,ef.EventType.MESSAGE,m=>{var p;if(!h){const y=m.data[0];Wt(!!y,16349);const w=y,x=(w==null?void 0:w.error)||((p=w[0])===null||p===void 0?void 0:p.error);if(x){We(dr,`RPC '${e}' stream ${i} received error:`,x);const S=x.status;let I=function(C){const T=On[C];if(T!==void 0)return bL(T)}(S),M=x.message;I===void 0&&(I=Te.INTERNAL,M="Unknown error status: "+S+" with message "+x.message),h=!0,g.u_(new it(I,M)),f.close()}else We(dr,`RPC '${e}' stream ${i} received:`,y),g.c_(y)}}),v(a,Uk.STAT_EVENT,m=>{m.stat===Sb.PROXY?We(dr,`RPC '${e}' stream ${i} detected buffering proxy`):m.stat===Sb.NOPROXY&&We(dr,`RPC '${e}' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{g.a_()},0),g}terminate(){this.l_.forEach(e=>e.close()),this.l_=[]}E_(e){this.l_.push(e)}d_(e){this.l_=this.l_.filter(n=>n===e)}}function Q_(){return typeof document<"u"?document:null}/**
3068 * @license
3069 * Copyright 2020 Google LLC
3070 *
3071 * Licensed under the Apache License, Version 2.0 (the "License");
3072 * you may not use this file except in compliance with the License.
3073 * You may obtain a copy of the License at
3074 *
3075 *   http://www.apache.org/licenses/LICENSE-2.0
3076 *
3077 * Unless required by applicable law or agreed to in writing, software
3078 * distributed under the License is distributed on an "AS IS" BASIS,
3079 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3080 * See the License for the specific language governing permissions and
3081 * limitations under the License.
3082 */function Sy(t){return new FK(t,!0)}/**
3083 * @license
3084 * Copyright 2017 Google LLC
3085 *
3086 * Licensed under the Apache License, Version 2.0 (the "License");
3087 * you may not use this file except in compliance with the License.
3088 * You may obtain a copy of the License at
3089 *
3090 *   http://www.apache.org/licenses/LICENSE-2.0
3091 *
3092 * Unless required by applicable law or agreed to in writing, software
3093 * distributed under the License is distributed on an "AS IS" BASIS,
3094 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3095 * See the License for the specific language governing permissions and
3096 * limitations under the License.
3097 */class LL{constructor(e,n,r=1e3,i=1.5,s=6e4){this.xi=e,this.timerId=n,this.A_=r,this.R_=i,this.V_=s,this.m_=0,this.f_=null,this.g_=Date.now(),this.reset()}reset(){this.m_=0}p_(){this.m_=this.V_}y_(e){this.cancel();const n=Math.floor(this.m_+this.w_()),r=Math.max(0,Date.now()-this.g_),i=Math.max(0,n-r);i>0&&We("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.m_} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.f_=this.xi.enqueueAfterDelay(this.timerId,i,()=>(this.g_=Date.now(),e())),this.m_*=this.R_,this.m_<this.A_&&(this.m_=this.A_),this.m_>this.V_&&(this.m_=this.V_)}b_(){this.f_!==null&&(this.f_.skipDelay(),this.f_=null)}cancel(){this.f_!==null&&(this.f_.cancel(),this.f_=null)}w_(){return(Math.random()-.5)*this.m_}}/**
3098 * @license
3099 * Copyright 2017 Google LLC
3100 *
3101 * Licensed under the Apache License, Version 2.0 (the "License");
3102 * you may not use this file except in compliance with the License.
3103 * You may obtain a copy of the License at
3104 *
3105 *   http://www.apache.org/licenses/LICENSE-2.0
3106 *
3107 * Unless required by applicable law or agreed to in writing, software
3108 * distributed under the License is distributed on an "AS IS" BASIS,
3109 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3110 * See the License for the specific language governing permissions and
3111 * limitations under the License.
3112 */const YC="PersistentStream";class FL{constructor(e,n,r,i,s,o,a,l){this.xi=e,this.S_=r,this.D_=i,this.connection=s,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=l,this.state=0,this.v_=0,this.C_=null,this.F_=null,this.stream=null,this.M_=0,this.x_=new LL(e,n)}O_(){return this.state===1||this.state===5||this.N_()}N_(){return this.state===2||this.state===3}start(){this.M_=0,this.state!==4?this.auth():this.B_()}async stop(){this.O_()&&await this.close(0)}L_(){this.state=0,this.x_.reset()}k_(){this.N_()&&this.C_===null&&(this.C_=this.xi.enqueueAfterDelay(this.S_,6e4,()=>this.q_()))}Q_(e){this.U_(),this.stream.send(e)}async q_(){if(this.N_())return this.close(0)}U_(){this.C_&&(this.C_.cancel(),this.C_=null)}K_(){this.F_&&(this.F_.cancel(),this.F_=null)}async close(e,n){this.U_(),this.K_(),this.x_.cancel(),this.v_++,e!==4?this.x_.reset():n&&n.code===Te.RESOURCE_EXHAUSTED?(bo(n.toString()),bo("Using maximum backoff delay to prevent overloading the backend."),this.x_.p_()):n&&n.code===Te.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.W_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.i_(n)}W_(){}auth(){this.state=1;const e=this.G_(this.v_),n=this.v_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,i])=>{this.v_===n&&this.z_(r,i)},r=>{e(()=>{const i=new it(Te.UNKNOWN,"Fetching auth token failed: "+r.message);return this.j_(i)})})}z_(e,n){const r=this.G_(this.v_);this.stream=this.H_(e,n),this.stream.e_(()=>{r(()=>this.listener.e_())}),this.stream.n_(()=>{r(()=>(this.state=2,this.F_=this.xi.enqueueAfterDelay(this.D_,1e4,()=>(this.N_()&&(this.state=3),Promise.resolve())),this.listener.n_()))}),this.stream.i_(i=>{r(()=>this.j_(i))}),this.stream.onMessage(i=>{r(()=>++this.M_==1?this.J_(i):this.onNext(i))})}B_(){this.state=5,this.x_.y_(async()=>{this.state=0,this.start()})}j_(e){return We(YC,`close with error: ${e}`),this.stream=null,this.close(4,e)}G_(e){return n=>{this.xi.enqueueAndForget(()=>this.v_===e?n():(We(YC,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class DX extends FL{constructor(e,n,r,i,s,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s}H_(e,n){return this.connection.I_("Listen",e,n)}J_(e){return this.onNext(e)}onNext(e){this.x_.reset();const n=BK(this.serializer,e),r=function(s){if(!("targetChange"in s))return gt.min();const o=s.targetChange;return o.targetIds&&o.targetIds.length?gt.min():o.readTime?Cs(o.readTime):gt.min()}(e);return this.listener.Y_(n,r)}Z_(e){const n={};n.database=Db(this.serializer),n.addTarget=function(s,o){let a;const l=o.target;if(a=Rb(l)?{documents:HK(s,l)}:{query:CL(s,l).gt},a.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){a.resumeToken=SL(s,o.resumeToken);const c=Ib(s,o.expectedCount);c!==null&&(a.expectedCount=c)}else if(o.snapshotVersion.compareTo(gt.min())>0){a.readTime=sv(s,o.snapshotVersion.toTimestamp());const c=Ib(s,o.expectedCount);c!==null&&(a.expectedCount=c)}return a}(this.serializer,e);const r=WK(this.serializer,e);r&&(n.labels=r),this.Q_(n)}X_(e){const n={};n.database=Db(this.serializer),n.removeTarget=e,this.Q_(n)}}class kX extends FL{constructor(e,n,r,i,s,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s}get ea(){return this.M_>0}start(){this.lastStreamToken=void 0,super.start()}W_(){this.ea&&this.ta([])}H_(e,n){return this.connection.I_("Write",e,n)}J_(e){return Wt(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,Wt(!e.writeResults||e.writeResults.length===0,55816),this.listener.na()}onNext(e){Wt(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.x_.reset();const n=zK(e.writeResults,e.commitTime),r=Cs(e.commitTime);return this.listener.ra(r,n)}ia(){const e={};e.database=Db(this.serializer),this.Q_(e)}ta(e){const n={streamToken:this.lastStreamToken,writes:e.map(r=>VK(this.serializer,r))};this.Q_(n)}}/**
3113 * @license
3114 * Copyright 2017 Google LLC
3115 *
3116 * Licensed under the Apache License, Version 2.0 (the "License");
3117 * you may not use this file except in compliance with the License.
3118 * You may obtain a copy of the License at
3119 *
3120 *   http://www.apache.org/licenses/LICENSE-2.0
3121 *
3122 * Unless required by applicable law or agreed to in writing, software
3123 * distributed under the License is distributed on an "AS IS" BASIS,
3124 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3125 * See the License for the specific language governing permissions and
3126 * limitations under the License.
3127 */class LX{}class FX extends LX{constructor(e,n,r,i){super(),this.authCredentials=e,this.appCheckCredentials=n,this.connection=r,this.serializer=i,this.sa=!1}oa(){if(this.sa)throw new it(Te.FAILED_PRECONDITION,"The client has already been terminated.")}zo(e,n,r,i){return this.oa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,o])=>this.connection.zo(e,Nb(n,r),i,s,o)).catch(s=>{throw s.name==="FirebaseError"?(s.code===Te.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new it(Te.UNKNOWN,s.toString())})}Yo(e,n,r,i,s){return this.oa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,a])=>this.connection.Yo(e,Nb(n,r),i,o,a,s)).catch(o=>{throw o.name==="FirebaseError"?(o.code===Te.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new it(Te.UNKNOWN,o.toString())})}terminate(){this.sa=!0,this.connection.terminate()}}class UX{constructor(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this._a=0,this.aa=null,this.ua=!0}ca(){this._a===0&&(this.la("Unknown"),this.aa=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.aa=null,this.ha("Backend didn't respond within 10 seconds."),this.la("Offline"),Promise.resolve())))}Pa(e){this.state==="Online"?this.la("Unknown"):(this._a++,this._a>=1&&(this.Ta(),this.ha(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.la("Offline")))}set(e){this.Ta(),this._a=0,e==="Online"&&(this.ua=!1),this.la(e)}la(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}ha(e){const n=`Could not reach Cloud Firestore backend. ${e}
3128This 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.ua?(bo(n),this.ua=!1):We("OnlineStateTracker",n)}Ta(){this.aa!==null&&(this.aa.cancel(),this.aa=null)}}/**
3129 * @license
3130 * Copyright 2017 Google LLC
3131 *
3132 * Licensed under the Apache License, Version 2.0 (the "License");
3133 * you may not use this file except in compliance with the License.
3134 * You may obtain a copy of the License at
3135 *
3136 *   http://www.apache.org/licenses/LICENSE-2.0
3137 *
3138 * Unless required by applicable law or agreed to in writing, software
3139 * distributed under the License is distributed on an "AS IS" BASIS,
3140 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3141 * See the License for the specific language governing permissions and
3142 * limitations under the License.
3143 */const Fl="RemoteStore";class jX{constructor(e,n,r,i,s){this.localStore=e,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.Ia=[],this.Ea=new Map,this.da=new Set,this.Aa=[],this.Ra=s,this.Ra.No(o=>{r.enqueueAndForget(async()=>{Ql(this)&&(We(Fl,"Restarting streams for network reachability change."),await async function(l){const c=mt(l);c.da.add(4),await Wh(c),c.Va.set("Unknown"),c.da.delete(4),await Ty(c)}(this))})}),this.Va=new UX(r,i)}}async function Ty(t){if(Ql(t))for(const e of t.Aa)await e(!0)}async function Wh(t){for(const e of t.Aa)await e(!1)}function UL(t,e){const n=mt(t);n.Ea.has(e.targetId)||(n.Ea.set(e.targetId,e),zE(n)?VE(n):sd(n).N_()&&BE(n,e))}function jE(t,e){const n=mt(t),r=sd(n);n.Ea.delete(e),r.N_()&&jL(n,e),n.Ea.size===0&&(r.N_()?r.k_():Ql(n)&&n.Va.set("Unknown"))}function BE(t,e){if(t.ma.Ke(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(gt.min())>0){const n=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(n)}sd(t).Z_(e)}function jL(t,e){t.ma.Ke(e),sd(t).X_(e)}function VE(t){t.ma=new OK({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),Rt:e=>t.Ea.get(e)||null,Pt:()=>t.datastore.serializer.databaseId}),sd(t).start(),t.Va.ca()}function zE(t){return Ql(t)&&!sd(t).O_()&&t.Ea.size>0}function Ql(t){return mt(t).da.size===0}function BL(t){t.ma=void 0}async function BX(t){t.Va.set("Online")}async function VX(t){t.Ea.forEach((e,n)=>{BE(t,e)})}async function zX(t,e){BL(t),zE(t)?(t.Va.Pa(e),VE(t)):t.Va.set("Unknown")}async function HX(t,e,n){if(t.Va.set("Online"),e instanceof EL&&e.state===2&&e.cause)try{await async function(i,s){const o=s.cause;for(const a of s.targetIds)i.Ea.has(a)&&(await i.remoteSyncer.rejectListen(a,o),i.Ea.delete(a),i.ma.removeTarget(a))}(t,e)}catch(r){We(Fl,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),await av(t,r)}else if(e instanceof Qm?t.ma.Xe(e):e instanceof wL?t.ma.ot(e):t.ma.nt(e),!n.isEqual(gt.min()))try{const r=await kL(t.localStore);n.compareTo(r)>=0&&await function(s,o){const a=s.ma.It(o);
3143return a.targetChanges.forEach((l,c)=>{if(l.resumeToken.approximateByteSize()>0){const d=s.Ea.get(c);d&&s.Ea.set(c,d.withResumeToken(l.resumeToken,o))}}),a.targetMismatches.forEach((l,c)=>{const d=s.Ea.get(l);if(!d)return;s.Ea.set(l,d.withResumeToken(ir.EMPTY_BYTE_STRING,d.snapshotVersion)),jL(s,l);const f=new da(d.target,l,c,d.sequenceNumber);BE(s,f)}),s.remoteSyncer.applyRemoteEvent(a)}(t,n)}catch(r){We(Fl,"Failed to raise snapshot:",r),await av(t,r)}}async function av(t,e,n){if(!id(e))throw e;t.da.add(1),await Wh(t),t.Va.set("Offline"),n||(n=()=>kL(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{We(Fl,"Retrying IndexedDB access"),await n(),t.da.delete(1),await Ty(t)})}function VL(t,e){return e().catch(n=>av(t,n,e))}async function Ay(t){const e=mt(t),n=ja(e);let r=e.Ia.length>0?e.Ia[e.Ia.length-1].batchId:AE;for(;GX(e);)try{const i=await TX(e.localStore,r);if(i===null){e.Ia.length===0&&n.k_();break}r=i.batchId,$X(e,i)}catch(i){await av(e,i)}zL(e)&&HL(e)}function GX(t){return Ql(t)&&t.Ia.length<10}function $X(t,e){t.Ia.push(e);const n=ja(t);n.N_()&&n.ea&&n.ta(e.mutations)}function zL(t){return Ql(t)&&!ja(t).O_()&&t.Ia.length>0}function HL(t){ja(t).start()}async function WX(t){ja(t).ia()}async function qX(t){const e=ja(t);for(const n of t.Ia)e.ta(n.mutations)}async function KX(t,e,n){const r=t.Ia.shift(),i=NE.from(r,e,n);await VL(t,()=>t.remoteSyncer.applySuccessfulWrite(i)),await Ay(t)}async function XX(t,e){e&&ja(t).ea&&await async function(r,i){if(function(o){return IK(o)&&o!==Te.ABORTED}(i.code)){const s=r.Ia.shift();ja(r).L_(),await VL(r,()=>r.remoteSyncer.rejectFailedWrite(s.batchId,i)),await Ay(r)}}(t,e),zL(t)&&HL(t)}async function QC(t,e){const n=mt(t);n.asyncQueue.verifyOperationInProgress(),We(Fl,"RemoteStore received new credentials");const r=Ql(n);n.da.add(3),await Wh(n),r&&n.Va.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.da.delete(3),await Ty(n)}async function YX(t,e){const n=mt(t);e?(n.da.delete(2),await Ty(n)):e||(n.da.add(2),await Wh(n),n.Va.set("Unknown"))}function sd(t){return t.fa||(t.fa=function(n,r,i){const s=mt(n);return s.oa(),new DX(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(t.datastore,t.asyncQueue,{e_:BX.bind(null,t),n_:VX.bind(null,t),i_:zX.bind(null,t),Y_:HX.bind(null,t)}),t.Aa.push(async e=>{e?(t.fa.L_(),zE(t)?VE(t):t.Va.set("Unknown")):(await t.fa.stop(),BL(t))})),t.fa}function ja(t){return t.ga||(t.ga=function(n,r,i){const s=mt(n);return s.oa(),new kX(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(t.datastore,t.asyncQueue,{e_:()=>Promise.resolve(),n_:WX.bind(null,t),i_:XX.bind(null,t),na:qX.bind(null,t),ra:KX.bind(null,t)}),t.Aa.push(async e=>{e?(t.ga.L_(),await Ay(t)):(await t.ga.stop(),t.Ia.length>0&&(We(Fl,`Stopping write stream with ${t.Ia.length} pending writes`),t.Ia=[]))})),t.ga}/**
3144 * @license
3145 * Copyright 2017 Google LLC
3146 *
3147 * Licensed under the Apache License, Version 2.0 (the "License");
3148 * you may not use this file except in compliance with the License.
3149 * You may obtain a copy of the License at
3150 *
3151 *   http://www.apache.org/licenses/LICENSE-2.0
3152 *
3153 * Unless required by applicable law or agreed to in writing, software
3154 * distributed under the License is distributed on an "AS IS" BASIS,
3155 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3156 * See the License for the specific language governing permissions and
3157 * limitations under the License.
3158 */class HE{constructor(e,n,r,i,s){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=i,this.removalCallback=s,this.deferred=new co,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(o=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,i,s){const o=Date.now()+r,a=new HE(e,n,o,i,s);return a.start(r),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new it(Te.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function GE(t,e){if(bo("AsyncQueue",`${e}: ${t}`),id(t))return new it(Te.UNAVAILABLE,`${e}: ${t}`);throw t}/**
3159 * @license
3160 * Copyright 2017 Google LLC
3161 *
3162 * Licensed under the Apache License, Version 2.0 (the "License");
3163 * you may not use this file except in compliance with the License.
3164 * You may obtain a copy of the License at
3165 *
3166 *   http://www.apache.org/licenses/LICENSE-2.0
3167 *
3168 * Unless required by applicable law or agreed to in writing, software
3169 * distributed under the License is distributed on an "AS IS" BASIS,
3170 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3171 * See the License for the specific language governing permissions and
3172 * limitations under the License.
3173 */class ru{static emptySet(e){return new ru(e.comparator)}constructor(e){this.comparator=e?(n,r)=>e(n,r)||ot.comparator(n.key,r.key):(n,r)=>ot.comparator(n.key,r.key),this.keyedMap=tf(),this.sortedSet=new wn(this.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const n=this.keyedMap.get(e);return n?this.sortedSet.indexOf(n):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((n,r)=>(e(n),!1))}add(e){const n=this.delete(e.key);return n.copy(n.keyedMap.insert(e.key,e),n.sortedSet.insert(e,null))}delete(e){const n=this.get(e);return n?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(n)):this}isEqual(e){if(!(e instanceof ru)||this.size!==e.size)return!1;const n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;n.hasNext();){const i=n.getNext().key,s=r.getNext().key;if(!i.isEqual(s))return!1}return!0}toString(){const e=[];return this.forEach(n=>{e.push(n.toString())}),e.length===0?"DocumentSet ()":`DocumentSet (
3174  `+e.join(`  
3175`)+`
3176)`}copy(e,n){const r=new ru;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r}}/**
3177 * @license
3178 * Copyright 2017 Google LLC
3179 *
3180 * Licensed under the Apache License, Version 2.0 (the "License");
3181 * you may not use this file except in compliance with the License.
3182 * You may obtain a copy of the License at
3183 *
3184 *   http://www.apache.org/licenses/LICENSE-2.0
3185 *
3186 * Unless required by applicable law or agreed to in writing, software
3187 * distributed under the License is distributed on an "AS IS" BASIS,
3188 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3189 * See the License for the specific language governing permissions and
3190 * limitations under the License.
3191 */class ZC{constructor(){this.pa=new wn(ot.comparator)}track(e){const n=e.doc.key,r=this.pa.get(n);r?e.type!==0&&r.type===3?this.pa=this.pa.insert(n,e):e.type===3&&r.type!==1?this.pa=this.pa.insert(n,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.pa=this.pa.insert(n,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.pa=this.pa.insert(n,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.pa=this.pa.remove(n):e.type===1&&r.type===2?this.pa=this.pa.insert(n,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.pa=this.pa.insert(n,{type:2,doc:e.doc}):ct(63341,{Vt:e,ya:r}):this.pa=this.pa.insert(n,e)}wa(){const e=[];return this.pa.inorderTraversal((n,r)=>{e.push(r)}),e}}class ku{constructor(e,n,r,i,s,o,a,l,c){this.query=e,this.docs=n,this.oldDocs=r,this.docChanges=i,this.mutatedKeys=s,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=l,this.hasCachedResults=c}static fromInitialDocuments(e,n,r,i,s){const o=[];return n.forEach(a=>{o.push({type:0,doc:a})}),new ku(e,n,ru.emptySet(n),o,r,i,!0,!1,s)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&yy(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const n=this.docChanges,r=e.docChanges;if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(n[i].type!==r[i].type||!n[i].doc.isEqual(r[i].doc))return!1;return!0}}/**
3192 * @license
3193 * Copyright 2017 Google LLC
3194 *
3195 * Licensed under the Apache License, Version 2.0 (the "License");
3196 * you may not use this file except in compliance with the License.
3197 * You may obtain a copy of the License at
3198 *
3199 *   http://www.apache.org/licenses/LICENSE-2.0
3200 *
3201 * Unless required by applicable law or agreed to in writing, softw
3201are
3202 * distributed under the License is distributed on an "AS IS" BASIS,
3203 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3204 * See the License for the specific language governing permissions and
3205 * limitations under the License.
3206 */class QX{constructor(){this.ba=void 0,this.Sa=[]}Da(){return this.Sa.some(e=>e.va())}}class ZX{constructor(){this.queries=JC(),this.onlineState="Unknown",this.Ca=new Set}terminate(){(function(n,r){const i=mt(n),s=i.queries;i.queries=JC(),s.forEach((o,a)=>{for(const l of a.Sa)l.onError(r)})})(this,new it(Te.ABORTED,"Firestore shutting down"))}}function JC(){return new Yl(t=>cL(t),yy)}async function GL(t,e){const n=mt(t);let r=3;const i=e.query;let s=n.queries.get(i);s?!s.Da()&&e.va()&&(r=2):(s=new QX,r=e.va()?0:1);try{switch(r){case 0:s.ba=await n.onListen(i,!0);break;case 1:s.ba=await n.onListen(i,!1);break;case 2:await n.onFirstRemoteStoreListen(i)}}catch(o){const a=GE(o,`Initialization of query '${Mc(e.query)}' failed`);return void e.onError(a)}n.queries.set(i,s),s.Sa.push(e),e.Fa(n.onlineState),s.ba&&e.Ma(s.ba)&&$E(n)}async function $L(t,e){const n=mt(t),r=e.query;let i=3;const s=n.queries.get(r);if(s){const o=s.Sa.indexOf(e);o>=0&&(s.Sa.splice(o,1),s.Sa.length===0?i=e.va()?0:1:!s.Da()&&e.va()&&(i=2))}switch(i){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function JX(t,e){const n=mt(t);let r=!1;for(const i of e){const s=i.query,o=n.queries.get(s);if(o){for(const a of o.Sa)a.Ma(i)&&(r=!0);o.ba=i}}r&&$E(n)}function eY(t,e,n){const r=mt(t),i=r.queries.get(e);if(i)for(const s of i.Sa)s.onError(n);r.queries.delete(e)}function $E(t){t.Ca.forEach(e=>{e.next()})}var Fb,eR;(eR=Fb||(Fb={})).xa="default",eR.Cache="cache";class WL{constructor(e,n,r){this.query=e,this.Oa=n,this.Na=!1,this.Ba=null,this.onlineState="Unknown",this.options=r||{}}Ma(e){if(!this.options.includeMetadataChanges){const r=[];for(const i of e.docChanges)i.type!==3&&r.push(i);e=new ku(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let n=!1;return this.Na?this.La(e)&&(this.Oa.next(e),n=!0):this.ka(e,this.onlineState)&&(this.qa(e),n=!0),this.Ba=e,n}onError(e){this.Oa.error(e)}Fa(e){this.onlineState=e;let n=!1;return this.Ba&&!this.Na&&this.ka(this.Ba,e)&&(this.qa(this.Ba),n=!0),n}ka(e,n){if(!e.fromCache||!this.va())return!0;const r=n!=="Offline";return(!this.options.Qa||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||n==="Offline")}La(e){if(e.docChanges.length>0)return!0;const n=this.Ba&&this.Ba.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}qa(e){e=ku.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Na=!0,this.Oa.next(e)}va(){return this.options.source!==Fb.Cache}}/**
3207 * @license
3208 * Copyright 2017 Google LLC
3209 *
3210 * Licensed under the Apache License, Version 2.0 (the "License");
3211 * you may not use this file except in compliance with the License.
3212 * You may obtain a copy of the License at
3213 *
3214 *   http://www.apache.org/licenses/LICENSE-2.0
3215 *
3216 * Unless required by applicable law or agreed to in writing, software
3217 * distributed under the License is distributed on an "AS IS" BASIS,
3218 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3219 * See the License for the specific language governing permissions and
3220 * limitations under the License.
3221 */class qL{constructor(e){this.key=e}}class KL{constructor(e){this.key=e}}class tY{constructor(e,n){this.query=e,this.Ha=n,this.Ja=null,this.hasCachedResults=!1,this.current=!1,this.Ya=Ot(),this.mutatedKeys=Ot(),this.Za=uL(e),this.Xa=new ru(this.Za)}get eu(){return this.Ha}tu(e,n){const r=n?n.nu:new ZC,i=n?n.Xa:this.Xa;let s=n?n.mutatedKeys:this.mutatedKeys,o=i,a=!1;const l=this.query.limitType==="F"&&i.size===this.query.limit?i.last():null,c=this.query.limitType==="L"&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((d,f)=>{const u=i.get(d),h=_y(this.query,f)?f:null,g=!!u&&this.mutatedKeys.has(u.key),v=!!h&&(h.hasLocalMutations||this.mutatedKeys.has(h.key)&&h.hasCommittedMutations);let m=!1;u&&h?u.data.isEqual(h.data)?g!==v&&(r.track({type:3,doc:h}),m=!0):this.ru(u,h)||(r.track({type:2,doc:h}),m=!0,(l&&this.Za(h,l)>0||c&&this.Za(h,c)<0)&&(a=!0)):!u&&h?(r.track({type:0,doc:h}),m=!0):u&&!h&&(r.track({type:1,doc:u}
3221),m=!0,(l||c)&&(a=!0)),m&&(h?(o=o.add(h),s=v?s.add(d):s.delete(d)):(o=o.delete(d),s=s.delete(d)))}),this.query.limit!==null)for(;o.size>this.query.limit;){const d=this.query.limitType==="F"?o.last():o.first();o=o.delete(d.key),s=s.delete(d.key),r.track({type:1,doc:d})}return{Xa:o,nu:r,Cs:a,mutatedKeys:s}}ru(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(e,n,r,i){const s=this.Xa;this.Xa=e.Xa,this.mutatedKeys=e.mutatedKeys;const o=e.nu.wa();o.sort((d,f)=>function(h,g){const v=m=>{switch(m){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return ct(20277,{Vt:m})}};return v(h)-v(g)}(d.type,f.type)||this.Za(d.doc,f.doc)),this.iu(r),i=i!=null&&i;const a=n&&!i?this.su():[],l=this.Ya.size===0&&this.current&&!i?1:0,c=l!==this.Ja;return this.Ja=l,o.length!==0||c?{snapshot:new ku(this.query,e.Xa,s,o,e.mutatedKeys,l===0,c,!1,!!r&&r.resumeToken.approximateByteSize()>0),ou:a}:{ou:a}}Fa(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({Xa:this.Xa,nu:new ZC,mutatedKeys:this.mutatedKeys,Cs:!1},!1)):{ou:[]}}_u(e){return!this.Ha.has(e)&&!!this.Xa.has(e)&&!this.Xa.get(e).hasLocalMutations}iu(e){e&&(e.addedDocuments.forEach(n=>this.Ha=this.Ha.add(n)),e.modifiedDocuments.forEach(n=>{}),e.removedDocuments.forEach(n=>this.Ha=this.Ha.delete(n)),this.current=e.current)}su(){if(!this.current)return[];const e=this.Ya;this.Ya=Ot(),this.Xa.forEach(r=>{this._u(r.key)&&(this.Ya=this.Ya.add(r.key))});const n=[];return e.forEach(r=>{this.Ya.has(r)||n.push(new KL(r))}),this.Ya.forEach(r=>{e.has(r)||n.push(new qL(r))}),n}au(e){this.Ha=e.$s,this.Ya=Ot();const n=this.tu(e.documents);return this.applyChanges(n,!0)}uu(){return ku.fromInitialDocuments(this.query,this.Xa,this.mutatedKeys,this.Ja===0,this.hasCachedResults)}}const WE="SyncEngine";class nY{constructor(e,n,r){this.query=e,this.targetId=n,this.view=r}}class rY{constructor(e){this.key=e,this.cu=!1}}class iY{constructor(e,n,r,i,s,o){this.localStore=e,this.remoteStore=n,this.eventManager=r,this.sharedClientState=i,this.currentUser=s,this.maxConcurrentLimboResolutions=o,this.lu={},this.hu=new Yl(a=>cL(a),yy),this.Pu=new Map,this.Tu=new Set,this.Iu=new wn(ot.comparator),this.Eu=new Map,this.du=new kE,this.Au={},this.Ru=new Map,this.Vu=Du.lr(),this.onlineState="Unknown",this.mu=void 0}get isPrimaryClient(){return this.mu===!0}}async function sY(t,e,n=!0){const r=e3(t);let i;const s=r.hu.get(e);return s?(r.sharedClientState.addLocalQueryTarget(s.targetId),i=s.view.uu()):i=await XL(r,e,n,!0),i}async function oY(t,e){const n=e3(t);await XL(n,e,!0,!1)}async function XL(t,e,n,r){const i=await AX(t.localStore,Ms(e)),s=i.targetId,o=t.sharedClientState.addLocalQueryTarget(s,n);let a;return r&&(a=await aY(t,e,s,o==="current",i.resumeToken)),t.isPrimaryClient&&n&&UL(t.remoteStore,i),a}async function aY(t,e,n,r,i){t.fu=(f,u,h)=>async function(v,m,p,y){let w=m.view.tu(p);w.Cs&&(w=await WC(v.localStore,m.query,!1).then(({documents:M})=>m.view.tu(M,w)));const x=y&&y.targetChanges.get(m.targetId),S=y&&y.targetMismatches.get(m.targetId)!=null,I=m.view.applyChanges(w,v.isPrimaryClient,x,S);return nR(v,m.targetId,I.ou),I.snapshot}(t,f,u,h);const s=await WC(t.localStore,e,!0),o=new tY(e,s.$s),a=o.tu(s.documents),l=$h.createSynthesizedTargetChangeForCurrentChange(n,r&&t.onlineState!=="Offline",i),c=o.applyChanges(a,t.isPrimaryClient,l);nR(t,n,c.ou);const d=new nY(e,n,o);return t.hu.set(e,d),t.Pu.has(n)?t.Pu.get(n).push(e):t.Pu.set(n,[e]),c.snapshot}async function lY(t,e,n){const r=mt(t),i=r.hu.get(e),s=r.Pu.get(i.targetId);if(s.length>1)return r.Pu.set(i.targetId,s.filter(o=>!yy(o,e))),void r.hu.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedCl
3221ientState.isActiveQueryTarget(i.targetId)||await kb(r.localStore,i.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(i.targetId),n&&jE(r.remoteStore,i.targetId),Ub(r,i.targetId)}).catch(rd)):(Ub(r,i.targetId),await kb(r.localStore,i.targetId,!0))}async function cY(t,e){const n=mt(t),r=n.hu.get(e),i=n.Pu.get(r.targetId);n.isPrimaryClient&&i.length===1&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),jE(n.remoteStore,r.targetId))}async function uY(t,e,n){const r=vY(t);try{const i=await function(o,a){const l=mt(o),c=zn.now(),d=a.reduce((h,g)=>h.add(g.key),Ot());let f,u;return l.persistence.runTransaction("Locally write mutations","readwrite",h=>{let g=wo(),v=Ot();return l.Bs.getEntries(h,d).next(m=>{g=m,g.forEach((p,y)=>{y.isValidDocument()||(v=v.add(p))})}).next(()=>l.localDocuments.getOverlayedDocuments(h,g)).next(m=>{f=m;const p=[];for(const y of a){const w=TK(y,f.get(y.key).overlayedDocument);w!=null&&p.push(new Ya(y.key,w,tL(w.value.mapValue),Rr.exists(!0)))}return l.mutationQueue.addMutationBatch(h,c,p,a)}).next(m=>{u=m;const p=m.applyToLocalDocumentSet(f,v);return l.documentOverlayCache.saveOverlays(h,m.batchId,p)})}).then(()=>({batchId:u.batchId,changes:fL(f)}))}(r.localStore,e);r.sharedClientState.addPendingMutation(i.batchId),function(o,a,l){let c=o.Au[o.currentUser.toKey()];c||(c=new wn(At)),c=c.insert(a,l),o.Au[o.currentUser.toKey()]=c}(r,i.batchId,n),await qh(r,i.changes),await Ay(r.remoteStore)}catch(i){const s=GE(i,"Failed to persist write");n.reject(s)}}async function YL(t,e){const n=mt(t);try{const r=await EX(n.localStore,e);
3221e.targetChanges.forEach((i,s)=>{const o=n.Eu.get(s);o&&(Wt(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1,22616),i.addedDocuments.size>0?o.cu=!0:i.modifiedDocuments.size>0?Wt(o.cu,14607):i.removedDocuments.size>0&&(Wt(o.cu,42227),o.cu=!1))}),await qh(n,r,e)}catch(r){await rd(r)}}function tR(t,e,n){const r=mt(t);if(r.isPrimaryClient&&n===0||!r.isPrimaryClient&&n===1){const i=[];r.hu.forEach((s,o)=>{const a=o.view.Fa(e);a.snapshot&&i.push(a.snapshot)}),function(o,a){const l=mt(o);l.onlineState=a;let c=!1;l.queries.forEach((d,f)=>{for(const u of f.Sa)u.Fa(a)&&(c=!0)}),c&&$E(l)}(r.eventManager,e),i.length&&r.lu.Y_(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function dY(t,e,n){const r=mt(t);r.sharedClientState.updateQueryState(e,"rejected",n);const i=r.Eu.get(e),s=i&&i.key;if(s){let o=new wn(ot.comparator);o=o.insert(s,vr.newNoDocument(s,gt.min()));const a=Ot().add(s),l=new Ey(gt.min(),new Map,new wn(At),o,a);await YL(r,l),r.Iu=r.Iu.remove(s),r.Eu.delete(e),qE(r)}else await kb(r.localStore,e,!1).then(()=>Ub(r,e,n)).catch(rd)}async function fY(t,e){const n=mt(t),r=e.batch.batchId;try{const i=await wX(n.localStore,e);ZL(n,r,null),QL(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await qh(n,i)}catch(i){await rd(i)}}async function hY(t,e,n){const r=mt(t);try{const i=await function(o,a){const l=mt(o);return l.persistence.runTransaction("Reject batch","readwrite-primary",c=>{let d;return l.mutationQueue.lookupMutationBatch(c,a).next(f=>(Wt(f!==null,37113),d=f.keys(),l.mutationQueue.removeMutationBatch(c,f))).next(()=>l.mutationQueue.performConsistencyCheck(c)).next(()=>l.documentOverlayCache.removeOverlaysForBatchId(c,d,a)).next(()=>l.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(c,d)).next(()=>l.localDocuments.getDocuments(c,d))})}(r.localStore,e);ZL(r,e,n),QL(r,e),r.sharedClientState.updateMutationState(e,"rejected",n),await qh(r,i)}catch(i){await rd(i)}}function QL(t,e){(t.Ru.get(e)||[]).forEach(n=>{n.resolve()}),t.Ru.delete(e)}function ZL(t,e,n){const r=mt(t);let i=r.Au[r.currentUser.toKey()];if(i){const s=i.get(e);s&&(n?s.reject(n):s.resolve(),i=i.remove(e)),r.Au[r.currentUser.toKey()]=i}}
3221function Ub(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const r of t.Pu.get(e))t.hu.delete(r),n&&t.lu.gu(r,n);t.Pu.delete(e),t.isPrimaryClient&&t.du.Hr(e).forEach(r=>{t.du.containsKey(r)||JL(t,r)})}function JL(t,e){t.Tu.delete(e.path.canonicalString());const n=t.Iu.get(e);n!==null&&(jE(t.remoteStore,n),t.Iu=t.Iu.remove(e),t.Eu.delete(n),qE(t))}function nR(t,e,n){for(const r of n)r instanceof qL?(t.du.addReference(r.key,e),pY(t,r)):r instanceof KL?(We(WE,"Document no longer in limbo: "+r.key),t.du.removeReference(r.key,e),t.du.containsKey(r.key)||JL(t,r.key)):ct(19791,{pu:r})}function pY(t,e){const n=e.key,r=n.path.canonicalString();t.Iu.get(n)||t.Tu.has(r)||(We(WE,"New document in limbo: "+n),t.Tu.add(r),qE(t))}function qE(t){for(;t.Tu.size>0&&t.Iu.size<t.maxConcurrentLimboResolutions;){const e=t.Tu.values().next().value;t.Tu.delete(e);const n=new ot(fn.fromString(e)),r=t.Vu.next();t.Eu.set(r,new rY(n)),t.Iu=t.Iu.insert(n,r),UL(t.remoteStore,new da(Ms(vy(n.path)),r,"TargetPurposeLimboResolution",hy.le))}}async function qh(t,e,n){const r=mt(t),i=[],s=[],o=[];r.hu.isEmpty()||(r.hu.forEach((a,l)=>{o.push(r.fu(l,e,n).then(c=>{var d;if((c||n)&&r.isPrimaryClient){const f=c?!c.fromCache:(d=n==null?void 0:n.targetChanges.get(l.targetId))===null||d===void 0?void 0:d.current;
3221r.sharedClientState.updateQueryState(l.targetId,f?"current":"not-current")}if(c){i.push(c);const f=FE.Rs(l.targetId,c);s.push(f)}}))}),await Promise.all(o),r.lu.Y_(i),await async function(l,c){const d=mt(l);try{await d.persistence.runTransaction("notifyLocalViewChanges","readwrite",f=>be.forEach(c,u=>be.forEach(u.ds,h=>d.persistence.referenceDelegate.addReference(f,u.targetId,h)).next(()=>be.forEach(u.As,h=>d.persistence.referenceDelegate.removeReference(f,u.targetId,h)))))}catch(f){if(!id(f))throw f;We(UE,"Failed to update sequence numbers: "+f)}for(const f of c){const u=f.targetId;if(!f.fromCache){const h=d.xs.get(u),g=h.snapshotVersion,v=h.withLastLimboFreeSnapshotVersion(g);d.xs=d.xs.insert(u,v)}}}(r.localStore,s))}async function mY(t,e){const n=mt(t);if(!n.currentUser.isEqual(e)){We(WE,"User change. New user:",e.toKey());const r=await DL(n.localStore,e);n.currentUser=e,function(s,o){s.Ru.forEach(a=>{a.forEach(l=>{l.reject(new it(Te.CANCELLED,o))})}),s.Ru.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await qh(n,r.ks)}}function gY(t,e){const n=mt(t),r=n.Eu.get(e);if(r&&r.cu)return Ot().add(r.key);{let i=Ot();const s=n.Pu.get(e);if(!s)return i;for(const o of s){const a=n.hu.get(o);i=i.unionWith(a.view.eu)}return i}}function e3(t){const e=mt(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=YL.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=gY.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=dY.bind(null,e),e.lu.Y_=JX.bind(null,e.eventManager),e.lu.gu=eY.bind(null,e.eventManager),e}function vY(t){const e=mt(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=fY.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=hY.bind(null,e),e}class lv{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=Sy(e.databaseInfo.databaseId),this.sharedClientState=this.bu(e),this.persistence=this.Su(e),await this.persistence.start(),this.localStore=this.Du(e),this.gcScheduler=this.vu(e,this.localStore),this.indexBackfillerScheduler=this.Cu(e,this.localStore)}vu(e,n){return null}Cu(e,n){return null}Du(e){return bX(this.persistence,new yX,e.initialUser,this.serializer)}Su(e){return new OL(LE.fi,this.serializer)}bu(e){return new CX}async terminate(){var e,n;(e=this.gcScheduler)===null||e===void 0||e.stop(),(n=this.indexBackfillerScheduler)===null||n===void 0||n.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}lv.provider={build:()=>new lv};class yY extends lv{constructor(e){super(),this.cacheSizeBytes=e}vu(e,n){Wt(this.persistence.referenceDelegate instanceof ov,46915);const r=this.persistence.referenceDelegate.garbageCollector;return new rX(r,e.asyncQueue,n)}Su(e){const n=this.cacheSizeBytes!==void 0?Vr.withCacheSize(this.cacheSizeBytes):Vr.DEFAULT;return new OL(r=>ov.fi(r,n),this.serializer)}}class jb{async initialize(e,n){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>tR(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=mY.bind(null,this.syncEngine),await YX(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new ZX}()}createDatastore(e){const n=Sy(e.databaseInfo.databaseId),r=function(s){return new OX(s)}(e.databaseInfo);return function(s,o,a,l){return new FX(s,o,a,l)}(e.authCredentials,e.appCheckCredentials,r,n)}createRemoteStore(e){return function(r,i,s,o,a){return new jX(r,i,s,o,a)}(this.localStore,this.datastore,e.asyncQueue,n=>tR(this.syncEngine,n,0),function(){return XC.C()?new XC:new RX}())}createSyncEngine(e,n){return function(i,s,o,a,l,c,d){const f=new iY(i,s,o,a,l,c);return d&&(f.mu=!0),f}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,n)}async terminate(){var e,n;await async function(i){const s=mt(i);We(Fl,"RemoteStore shutting down."),s.da.add(5),await Wh(s),s.Ra.shutdown(),s.Va.set("Unknown")}(this.remoteStore),(e=this.datastore)===null||e===void 0||e.terminate(),(n=this.eventManager)===null||n===void 0||n.terminate()}}jb.provider={build:()=>new jb};/**
3222 * @license
3223 * Copyright 2020 Google LLC
3224 *
3225 * Licensed under the Apache License, Version 2.0 (the "License");
3226 * you may not use this file except in compliance with the License.
3227 * You may obtain a copy of the License at
3228 *
3229 *   http://www.apache.org/licenses/LICENSE-2.0
3230 *
3231 * Unless required by applicable law or agreed to in writing, software
3232 * distributed under the License is distributed on an "AS IS" BASIS,
3233 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3234 * See the License for the specific language governing permissions and
3235 * limitations under the License.
3236 *//**
3237 * @license
3238 * Copyright 2017 Google LLC
3239 *
3240 * Licensed under the Apache License, Version 2.0 (the "License");
3241 * you may not use this file except in compliance with the License.
3242 * You may obtain a copy of the License at
3243 *
3244 *   http://www.apache.org/licenses/LICENSE-2.0
3245 *
3246 * Unless required by applicable law or agreed to in writing, software
3247 * distributed under the License is distributed on an "AS IS" BASIS,
3248 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3249 * See the License for the specific language governing permissions and
3250 * limitations under the License.
3251 */class t3{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Mu(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Mu(this.observer.error,e):bo("Uncaught Error in snapshot listener:",e.toString()))}xu(){this.muted=!0}Mu(e,n){setTimeout(()=>{this.muted||e(n)},0)}}/**
3252 * @license
3253 * Copyright 2017 Google LLC
3254 *
3255 * Licensed under the Apache License, Version 2.0 (the "License");
3256 * you may not use this file except in compliance with the License.
3257 * You may obtain a copy of the License at
3258 *
3259 *   http://www.apache.org/licenses/LICENSE-2.0
3260 *
3261 * Unless required by applicable law or agreed to in writing, software
3262 * distributed under the License is distributed on an "AS IS" BASIS,
3263 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3264 * See the License for the specific language governing permissions and
3265 * limitations under the License.
3266 */const Ba="FirestoreClient";class _Y{constructor(e,n,r,i,s){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=i,this.user=mr.UNAUTHENTICATED,this.clientId=Gk.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=s,this.authCredentials.start(r,async o=>{We(Ba,"Received user=",o.uid),await this.authCredentialListener(o),this.user=o}),this.appCheckCredentials.start(r,o=>(We(Ba,"Received new app check token=",o),this.appCheckCredentialListener(o,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new co;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){const r=GE(n,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}async function Z_(t,e){t.asyncQueue.verifyOperationInProgress(),We(Ba,"Initializing OfflineComponentProvider");const n=t.configuration;await e.initialize(n);let r=n.initialUser;t.setCredentialChangeListener(async i=>{r.isEqual(i)||(await DL(e.localStore,i),r=i)}),e.persistence.setDatabaseDeletedListener(()=>t.terminate()),t._offlineComponents=e}async function rR(t,e){t.asyncQueue.verifyOperationInProgress();const n=await xY(t);We(Ba,"Initializing OnlineComponentProvider"),await e.initialize(n,t.configuration),t.setCredentialChangeListener(r=>QC(e.remoteStore,r)),t.setAppCheckTokenChangeListener((r,i)=>QC(e.remoteStore,i)),t._onlineComponents=e}async function xY(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){We(Ba,"Using user provided OfflineComponentProvider");try{await Z_(t,t._uninitializedComponentsProvider._offline)}catch(e){const n=e;if(!function(i){return i.name==="FirebaseError"?i.code===Te.FAILED_PRECONDITION||i.code===Te.UNIMPLEMENT
3266ED:!(typeof DOMException<"u"&&i instanceof DOMException)||i.code===22||i.code===20||i.code===11}(n))throw n;Pu("Error using user provided cache. Falling back to memory cache: "+n),await Z_(t,new lv)}}else We(Ba,"Using default OfflineComponentProvider"),await Z_(t,new yY(void 0));return t._offlineComponents}async function KE(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(We(Ba,"Using user provided OnlineComponentProvider"),await rR(t,t._uninitializedComponentsProvider._online)):(We(Ba,"Using default OnlineComponentProvider"),await rR(t,new jb))),t._onlineComponents}function bY(t){return KE(t).then(e=>e.syncEngine)}function wY(t){return KE(t).then(e=>e.datastore)}async function Bb(t){const e=await KE(t),n=e.eventManager;return n.onListen=sY.bind(null,e.syncEngine),n.onUnlisten=lY.bind(null,e.syncEngine),n.onFirstRemoteStoreListen=oY.bind(null,e.syncEngine),n.onLastRemoteStoreUnlisten=cY.bind(null,e.syncEngine),n}function EY(t,e,n={}){const r=new co;return t.asyncQueue.enqueueAndForget(async()=>function(s,o,a,l,c){const d=new t3({next:u=>{d.xu(),o.enqueueAndForget(()=>$L(s,f));const h=u.docs.has(a);!h&&u.fromCache?c.reject(new it(Te.UNAVAILABLE,"Failed to get document because the client is offline.")):h&&u.fromCache&&l&&l.source==="server"?c.reject(new it(Te.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.)')):c.resolve(u)},error:u=>c.reject(u)}),f=new WL(vy(a.path),d,{includeMetadataChanges:!0,Qa:!0});return GL(s,f)}(await Bb(t),t.asyncQueue,e,n,r)),r.promise}function SY(t,e,n){const r=new co;return t.asyncQueue.enqueueAndForget(async()=>{try{const i=await wY(t);r.resolve(async function(o,a,l){var c;const d=mt(o),{request:f,yt:u,parent:h}=GK(d.serializer,uK(a),l);d.connection.Uo||delete f.parent;const g=(await d.Yo("RunAggregationQuery",d.serializer.databaseId,h,f,1)).filter(m=>!!m.result);Wt(g.length===1,64727);const v=(c=g[0].result)===null||c===void 0?void 0:c.aggregateFields;return Object.keys(v).reduce((m,p)=>(m[u[p]]=v[p],m),{})}(i,e,n))}catch(i){r.reject(i)}}),r.promise}/**
3267 * @license
3268 * Copyright 2023 Google LLC
3269 *
3270 * Licensed under the Apache License, Version 2.0 (the "License");
3271 * you may not use this file except in compliance with the License.
3272 * You may obtain a copy of the License at
3273 *
3274 *   http://www.apache.org/licenses/LICENSE-2.0
3275 *
3276 * Unless required by applicable law or agreed to in writing, software
3277 * distributed under the License is distributed on an "AS IS" BASIS,
3278 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3279 * See the License for the specific language governing permissions and
3280 * limitations under the License.
3281 */function n3(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}/**
3282 * @license
3283 * Copyright 2020 Google LLC
3284 *
3285 * Licensed under the Apache License, Version 2.0 (the "License");
3286 * you may not use this file except in compliance with the License.
3287 * You may obtain a copy of the License at
3288 *
3289 *   http://www.apache.org/licenses/LICENSE-2.0
3290 *
3291 * Unless required by applicable law or agreed to in writing, software
3292 * distributed under the License is distributed on an "AS IS" BASIS,
3293 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3294 * See the License for the specific language governing permissions and
3295 * limitations under the License.
3296 */const iR=new Map;/**
3297 * @license
3298 * Copyright 2017 Google LLC
3299 *
3300 * Licensed under the Apache License, Version 2.0 (the "License");
3301 * you may not use this file except in compliance with the License.
3302 * You may obtain a copy of the License at
3303 *
3304 *   http://www.apache.org/licenses/LICENSE-2.0
3305 *
3306 * Unless required by applicable law or agreed to in writing, software
3307 * distributed under the License is distributed on an "AS IS" BASIS,
3308 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3309 * See the License for the specific language governing permissions and
3310 * limitations under the License.
3311 */function r3(t,e,n){if(!n)throw new it(Te.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function TY(t,e,n,r){if(e===!0&&r===!0)throw new it(Te.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function sR(t){if(!ot.isDocumentKey(t))throw new it(Te.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function oR(t){if(ot.isDocumentKey(t))throw new it(Te.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function XE(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";{const e=function(r){return r.constructor?r.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":ct(12329,{type:typeof t})}function Xr(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new it(Te.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=XE(t);throw new it(Te.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}/**
3312 * @license
3313 * Copyright 2020 Google LLC
3314 *
3315 * Licensed under the Apache License, Version 2.0 (the "License");
3316 * you may not use this file except in compliance with the License.
3317 * You may obtain a copy of the License at
3318 *
3319 *   http://www.apache.org/licenses/LICENSE-2.0
3320 *
3321 * Unless required by applicable law or agreed to in writing, software
3322 * distributed under the License is distributed on an "AS IS" BASIS,
3323 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3324 * See the License for the specific language governing permissions and
3325 * limitations under the License.
3326 */const i3="firestore.googleapis.com",aR=!0;class lR{constructor(e){var n,r;if(e.host===void 0){if(e.ssl!==void 0)throw new it(Te.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=i3,this.ssl=aR}else this.host=e.host,this.ssl=(n=e.ssl)!==null&&n!==void 0?n:aR;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=NL;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<tX)throw new it(Te.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}TY("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=n3((r=e.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),function(s){if(s.timeoutSeconds!==void 0){if(isNaN(s.timeoutSeconds))throw new it(Te.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (must not be NaN)`);if(s.timeoutSeconds<5)throw new it(Te.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (minimum allowed value is 5)`);if(s.timeoutSeconds>30)throw new it(Te.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(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&&function(r,i){return r.timeoutSeconds===i.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class My{constructor(e,n,r,i){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new lR({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new it(Te.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new it(Te.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 lR(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new Rq;switch(r.type){case"firstParty":return new Oq(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new it(Te.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const r=iR.get(n);r&&(We("ComponentProvider","Removing Datastore"),iR.delete(n),r.terminate())}(this),Promise.resolve()}}function AY(t,e,n,r={}){var i;t=Xr(t,My);const s=$l(e),o=t._getSettings(),a=Object.assign(Object.assign({},o),{emulatorOptions:t._getEmulatorOptions()}),l=`${e}:${n}`;s&&(dE(`https://${l}`),fE("Firestore",!0)),o.host!==i3&&o.host!==l&&Pu("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const c=Object.assign(Object.assign({},o),{host:l,ssl:s,emulatorOptions:r});if(!Da(c,a)&&(t._setSettings(c),r.mockUserToken)){let d,f;if(typeof r.mockUserToken=="string")d=r.mockUserToken,f=mr.MOCK_USER;else{d=WD(r.mockUserToken,(i=t._app)===null||i===void 0?void 0:i.options.projectId);const u=r.mockUserToken.sub||r.mockUserToken.user_id;if(!u)throw new it(Te.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");f=new mr(u)}t._authCredentials=new Pq(new zk(d,f))}}/**
3327 * @license
3328 * Copyright 2020 Google LLC
3329 *
3330 * Licensed under the Apache License, Version 2.0 (the "License");
3331 * you may not use this file except in compliance with the License.
3332 * You may obtain a copy of the License at
3333 *
3334 *   http://www.apache.org/licenses/LICENSE-2.0
3335 *
3336 * Unless required by applicable law or agreed to in writing, software
3337 * distributed under the License is distributed on an "AS IS" BASIS,
3338 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3339 * See the License for the specific language governing permissions and
3340 * limitations under the License.
3341 */class Cy{constructor(e,n,r){this.converter=n,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new Cy(this.firestore,e,this._query)}}class Pr{constructor(e,n,r){this.converter=n,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Aa(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Pr(this.firestore,e,this._key)}}class Aa extends Cy{constructor(e,n,r){super(e,n,vy(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new Pr(this.firestore,null,new ot(e))}withConverter(e){return new Aa(this.firestore,e,this._path)}}function Vn(t,e,...n){if(t=cn(t),r3("collection","path",e),t instanceof My){const r=fn.fromString(e,...n);return oR(r),new Aa(t,null,r)}{if(!(t instanceof Pr||t instanceof Aa))throw new it(Te.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(fn.fromString(e,...n));return oR(r),new Aa(t.firestore,null,r)}}function _n(t,e,...n){if(t=cn(t),arguments.length===1&&(e=Gk.newId()),r3("doc","path",e),t instanceof My){const r=fn.fromString(e,...n);return sR(r),new Pr(t,null,new ot(r))}{if(!(t instanceof Pr||t instanceof Aa))throw new it(Te.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(fn.fromString(e,...n));return sR(r),new Pr(t.firestore,t instanceof Aa?t.converter:null,new ot(r))}}/**
3342 * @license
3343 * Copyright 2020 Google LLC
3344 *
3345 * Licensed under the Apache License, Version 2.0 (the "License");
3346 * you may not use this file except in compliance with the License.
3347 * You may obtain a copy of the License at
3348 *
3349 *   http://www.apache.org/licenses/LICENSE-2.0
3350 *
3351 * Unless required by applicable law or agreed to in writing, software
3352 * distributed under the License is distributed on an "AS IS" BASIS,
3353 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3354 * See the License for the specific language governing permissions and
3355 * limitations under the License.
3356 */const cR="AsyncQueue";class uR{constructor(e=Promise.resolve()){this.Ju=[],this.Yu=!1,this.Zu=[],this.Xu=null,this.ec=!1,this.tc=!1,this.nc=[],this.x_=new LL(this,"async_queue_retry"),this.rc=()=>{const r=Q_();r&&We(cR,"Visibility state changed to "+r.visibilityState),this.x_.b_()},this.sc=e;const n=Q_();n&&typeof n.addEventListener=="function"&&n.addEventListener("visibilitychange",this.rc)}get isShuttingDown(){return this.Yu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.oc(),this._c(e)}enterRestrictedMode(e){if(!this.Yu){this.Yu=!0,this.tc=e||!1;const n=Q_();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.rc)}}enqueue(e){if(this.oc(),this.Yu)return new Promise(()=>{});const n=new co;return this._c(()=>this.Yu&&this.tc?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Ju.push(e),this.ac()))}async ac(){if(this.Ju.length!==0){try{await this.Ju[0](),this.Ju.shift(),this.x_.reset()}catch(e){if(!id(e))throw e;We(cR,"Operation failed with retryable error: "+e)}this.Ju.length>0&&this.x_.y_(()=>this.ac())}}_c(e){const n=this.sc.then(()=>(this.ec=!0,e().catch(r=>{throw this.Xu=r,this.ec=!1,bo("INTERNAL UNHANDLED ERROR: ",dR(r)),r}).then(r=>(this.ec=!1,r))));return this.sc=n,n}enqueueAfterDelay(e,n,r){this.oc(),this.nc.indexOf(e)>-1&&(n=0);const i=HE.createAndSchedule(this,e,n,r,s=>this.uc(s));return this.Zu.push(i),i}oc(){this.Xu&&ct(47125,{cc:dR(this.Xu)})}verifyOperationInProgress(){}async lc(){let e;do e=this.sc,await e;while(e!==this.sc)}hc(e){for(const n of this.Zu)if(n.timerId===e)return!0;return!1}Pc(e){return this.lc().then(()=>{this.Zu.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this.Zu)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.lc()})}Tc(e){this.nc.push(e)}uc(e){const n=this.Zu.indexOf(e);this.Zu.splice(n,1)}}function dR(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+`
3357`+t.stack),e}/**
3358 * @license
3359 * Copyright 2017 Google LLC
3360 *
3361 * Licensed under the Apache License, Version 2.0 (the "License");
3362 * you may not use this file except in compliance with the License.
3363 * You may obtain a copy of the License at
3364 *
3365 *   http://www.apache.org/licenses/LICENSE-2.0
3366 *
3367 * Unless required by applicable law or agreed to in writing, software
3368 * distributed under the License is distributed on an "AS IS" BASIS,
3369 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3370 * See the License for the specific language governing permissions and
3371 * limitations under the License.
3372 */function fR(t){return function(n,r){if(typeof n!="object"||n===null)return!1;const i=n;for(const s of r)if(s in i&&typeof i[s]=="function")return!0;return!1}(t,["next","error","complete"])}class ks extends My{constructor(e,n,r,i){super(e,n,r,i),this.type="firestore",this._queue=new uR,this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new uR(e),this._firestoreClient=void 0,await e}}}function MY(t,e){const n=typeof t=="object"?t:ly(),r=typeof t=="string"?t:ev,i=Ka(n,"firestore").getImmediate({identifier:r});if(!i._initialized){const s=HD("firestore");s&&AY(i,...s)}return i}function Kh(t){if(t._terminated)throw new it(Te.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||CY(t),t._firestoreClient}function CY(t){var e,n,r;const i=t._freezeSettings(),s=function(a,l,c,d){return new Xq(a,l,c,d.host,d.ssl,d.experimentalForceLongPolling,d.experimentalAutoDetectLongPolling,n3(d.experimentalLongPollingOptions),d.useFetchStreams,d.isUsingEmulator)}(t._databaseId,((e=t._app)===null||e===void 0?void 0:e.options.appId)||"",t._persistenceKey,i);t._componentsProvider||!((n=i.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((r=i.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(t._componentsProvider={_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider}),t._firestoreClient=new _Y(t._authCredentials,t._appCheckCredentials,t._queue,s,t._componentsProvider&&function(a){const l=a==null?void 0:a._online.build();return{_offline:a==null?void 0:a._offline.build(l),_online:l}}(t._componentsProvider))}/**
3373 * @license
3374 * Copyright 2020 Google LLC
3375 *
3376 * Licensed under the Apache License, Version 2.0 (the "License");
3377 * you may not use this file except in compliance with the License.
3378 * You may obtain a copy of the License at
3379 *
3380 *   http://www.apache.org/licenses/LICENSE-2.0
3381 *
3382 * Unless required by applicable law or agreed to in writing, software
3383 * distributed under the License is distributed on an "AS IS" BASIS,
3384 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3385 * See the License for the specific language governing permissions and
3386 * limitations under the License.
3387 *//**
3388 * @license
3389 * Copyright 2022 Google LLC
3390 *
3391 * Licensed under the Apache License, Version 2.0 (the "License");
3392 * you may not use this file except in compliance with the License.
3393 * You may obtain a copy of the License at
3394 *
3395 *   http://www.apache.org/licenses/LICENSE-2.0
3396 *
3397 * Unless required by applicable law or agreed to in writing, software
3398 * distributed under the License is distributed on an "AS IS" BASIS,
3399 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3400 * See the License for the specific language governing permissions and
3401 * limitations under the License.
3402 */class RY{constructor(e="count",n){this._internalFieldPath=n,this.type="AggregateField",this.aggregateType=e}}class PY{constructor(e,n,r){this._userDataWriter=n,this._data=r,this.type="AggregateQuerySnapshot",this.query=e}data(){return this._userDataWriter.convertObjectMap(this._data)}}/**
3403 * @license
3404 * Copyright 2020 Google LLC
3405 *
3406 * Licensed under the Apache License, Version 2.0 (the "License");
3407 * you may not use this file except in compliance with the License.
3408 * You may obtain a copy of the License at
3409 *
3410 *   http://www.apache.org/licenses/LICENSE-2.0
3411 *
3412 * Unless required by applicable law or agreed to in writing, software
3413 * distributed under the License is distributed on an "AS IS" BASIS,
3414 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3415 * See the License for the specific language governing permissions and
3416 * limitations under the License.
3417 */class Lu{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Lu(ir.fromBase64String(e))}catch(n){throw new it(Te.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(e){return new Lu(ir.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}/**
3418 * @license
3419 * Copyright 2020 Google LLC
3420 *
3421 * Licensed under the Apache License, Version 2.0 (the "License");
3422 * you may not use this file except in compliance with the License.
3423 * You may obtain a copy of the License at
3424 *
3425 *   http://www.apache.org/licenses/LICENSE-2.0
3426 *
3427 * Unless required by applicable law or agreed to in writing, software
3428 * distributed under the License is distributed on an "AS IS" BASIS,
3429 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3430 * See the License for the specific language governing permissions and
3431 * limitations under the License.
3432 */class Xh{constructor(...e){for(let n=0;n<e.length;++n)if(e[n].length===0)throw new it(Te.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new er(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}/**
3433 * @license
3434 * Copyright 2020 Google LLC
3435 *
3436 * Licensed under the Apache License, Version 2.0 (the "License");
3437 * you may not use this file except in compliance with the License.
3438 * You may obtain a copy of the License at
3439 *
3440 *   http://www.apache.org/licenses/LICENSE-2.0
3441 *
3442 * Unless required by applicable law or agreed to in writing, software
3443 * distributed under the License is distributed on an "AS IS" BASIS,
3444 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3445 * See the License for the specific language governing permissions and
3446 * limitations under the License.
3447 */class Ry{constructor(e){this._methodName=e}}/**
3448 * @license
3449 * Copyright 2017 Google LLC
3450 *
3451 * Licensed under the Apache License, Version 2.0 (the "License");
3452 * you may not use this file except in compliance with the License.
3453 * You may obtain a copy of the License at
3454 *
3455 *   http://www.apache.org/licenses/LICENSE-2.0
3456 *
3457 * Unless required by applicable law or agreed to in writing, software
3458 * distributed under the License is distributed on an "AS IS" BASIS,
3459 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3460 * See the License for the specific language governing permissions and
3461 * limitations under the License.
3462 */class YE{constructor(e,n){if(!isFinite(e)||e<-90||e>90)throw new it(Te.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new it(Te.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return At(this._lat,e._lat)||At(this._long,e._long)}}/**
3463 * @license
3464 * Copyright 2024 Google LLC
3465 *
3466 * Licensed under the Apache License, Version 2.0 (the "License");
3467 * you may not use this file except in compliance with the License.
3468 * You may obtain a copy of the License at
3469 *
3470 *   http://www.apache.org/licenses/LICENSE-2.0
3471 *
3472 * Unless required by applicable law or agreed to in writing, software
3473 * distributed under the License is distributed on an "AS IS" BASIS,
3474 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3475 * See the License for the specific language governing permissions and
3476 * limitations under the License.
3477 */class QE{constructor(e){this._values=(e||[]).map(n=>n)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(r,i){if(r.length!==i.length)return!1;for(let s=0;s<r.length;++s)if(r[s]!==i[s])return!1;return!0}(this._values,e._values)}}/**
3478 * @license
3479 * Copyright 2017 Google LLC
3480 *
3481 * Licensed under the Apache License, Version 2.0 (the "License");
3482 * you may not use this file except in compliance with the License.
3483 * You may obtain a copy of the License at
3484 *
3485 *   http://www.apache.org/licenses/LICENSE-2.0
3486 *
3487 * Unless required by applicable law or agreed to in writing, software
3488 * distributed under the License is distributed on an "AS IS" BASIS,
3489 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3490 * See the License for the specific language governing permissions and
3491 * limitations under the License.
3492 */const IY=/^__.*__$/;class NY{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return this.fieldMask!==null?new Ya(e,this.data,this.fieldMask,n,this.fieldTransforms):new Gh(e,this.data,n,this.fieldTransforms)}}class s3{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return new Ya(e,this.data,this.fieldMask,n,this.fieldTransforms)}}function o3(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw ct(40011,{Ic:t})}}class ZE{constructor(e,n,r,i,s,o){this.settings=e,this.databaseId=n,this.serializer=r,this.ignoreUndefinedProperties=i,s===void 0&&this.Ec(),this.fieldTransforms=s||[],this.fieldMask=o||[]}get path(){return this.settings.path}get Ic(){return this.settings.Ic}dc(e){return new ZE(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Ac(e){var n;const r=(n=this.path)===null||n===void 0?void 0:n.child(e),i=this.dc({path:r,Rc:!1});return i.Vc(e),i}mc(e){var n;const r=(n=this.path)===null||n===void 0?void 0:n.child(e),i=this.dc({path:r,Rc:!1});return i.Ec(),i}fc(e){return this.dc({path:void 0,Rc:!0})}gc(e){return cv(e,this.settings.methodName,this.settings.yc||!1,this.path,this.settings.wc)}contains(e){return this.fieldMask.find(n=>e.isPrefixOf(n))!==void 0||this.fieldTransforms.find(n=>e.isPrefixOf(n.field))!==void 0}Ec(){if(this.path)for(let e=0;e<this.path.length;e++)this.Vc(this.path.get(e))}Vc(e){if(e.length===0)throw this.gc("Document fields must not be empty");if(o3(this.Ic)&&IY.test(e))throw this.gc('Document fields cannot begin and end with "__"')}}class OY{constructor(e,n,r){this.databaseId=e,this.ignoreUndefinedProperties=n,this.serializer=r||Sy(e)}bc(e,n,r,i=!1){return new ZE({Ic:e,methodName:n,wc:r,path:er.emptyPath(),Rc:!1,yc:i},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function Py(t){const e=t._freezeSettings(),n=Sy(t._databaseId);return new OY(t._databaseId,!!e.ignoreUndefinedProperties,n)}function JE(t,e,n,r,i,s={}){const o=t.bc(s.merge||s.mergeFields?2:0,e,n,i);tS("Data must be an object, but it was:",o,r);const a=c3(r,o);let l,c;if(s.merge)l=new li(o.fieldMask),c=o.fieldTransforms;else if(s.mergeFields){const d=[];for(const f of s.mergeFields){const u=Vb(e,f,n);if(!o.contains(u))throw new it(Te.INVALID_ARGUMENT,`Field '${u}' is specified in your field mask but missing from your input data.`);d3(d,u)||d.push(u)}l=new li(d),c=o.fieldTransforms.filter(f=>l.covers(f.field))}else l=null,c=o.fieldTransforms;return new NY(new Hr(a),l,c)}class Yh extends Ry{_toFieldTransform(e){if(e.Ic!==2)throw e.Ic===1?e.gc(`${this._methodName}() can only appear at the top level of your update data`):e.gc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof Yh}}class eS extends Ry{_toFieldTransform(e){return new bK(e.path,new gh)}isEqual(e){return e instanceof eS}}function a3(t,e,n,r){const i=t.bc(1,e,n);tS("Data must be an object, but it was:",i,r);const s=[],o=Hr.empty();Xa(r,(l,c)=>{const d=nS(e,l,n);c=cn(c);const f=i.mc(d);if(c instanceof Yh)s.push(d);else{const u=Iy(c,f);u!=null&&(s.push(d),o.set(d,u))}});const a=new li(s);return new s3(o,a,i.fieldTransforms)}function l3(t,e,n,r,i,s){const o=t.bc(1,e,n),a=[Vb(e,r,n)],l=[i];if(s.length%2!=0)throw new it(Te.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let u=0;u<s.length;u+=2)a.push(Vb(e,s[u])),l.push(s[u+1]);const c=[],d=Hr.empty();for(let u=a.length-1;u>=0;--u)if(!d3(c,a[u])){const h=a[u];let g=l[u];g=cn(g);const v=o.mc(h);if(g instanceof Yh)c.push(h);else{const m=Iy(g,v);m!=null&&(c.push(h),d.set(h,m))}}const f=new li(c);return new s3(d,f,o.fieldTransforms)}function Iy(t,e){if(u3(t=cn(t)))return tS("Unsupported field value:",e,t),c3(t,e);if(t instanceof Ry)return function(r,i){if(!o3(i.Ic))throw i.gc(`${r._methodName}
3492() can only be used with update() and set()`);if(!i.path)throw i.gc(`${r._methodName}() is not currently supported inside arrays`);const s=r._toFieldTransform(i);s&&i.fieldTransforms.push(s)}(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.Rc&&e.Ic!==4)throw e.gc("Nested arrays are not supported");return function(r,i){const s=[];let o=0;for(const a of r){let l=Iy(a,i.fc(o));l==null&&(l={nullValue:"NULL_VALUE"}),s.push(l),o++}return{arrayValue:{values:s}}}(t,e)}return function(r,i){if((r=cn(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return yK(i.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const s=zn.fromDate(r);return{timestampValue:sv(i.serializer,s)}}if(r instanceof zn){const s=new zn(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:sv(i.serializer,s)}}if(r instanceof YE)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof Lu)return{bytesValue:SL(i.serializer,r._byteString)};if(r instanceof Pr){const s=i.databaseId,o=r.firestore._databaseId;if(!o.isEqual(s))throw i.gc(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${s.projectId}/${s.database}`);return{referenceValue:DE(r.firestore._databaseId||i.databaseId,r._key.path)}}if(r instanceof QE)return function(o,a){return{mapValue:{fields:{[Zk]:{stringValue:eL},[tv]:{arrayValue:{values:o.toArray().map(c=>{if(typeof c!="number")throw a.gc("VectorValues must only contain numeric values.");return IE(a.serializer,c)})}}}}}}(r,i);throw i.gc(`Unsupported field value: ${XE(r)}`)}(t,e)}function c3(t,e){const n={};return Wk(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Xa(t,(r,i)=>{const s=Iy(i,e.Ac(r));s!=null&&(n[r]=s)}),{mapValue:{fields:n}}}function u3(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof zn||t instanceof YE||t instanceof Lu||t instanceof Pr||t instanceof Ry||t instanceof QE)}function tS(t,e,n){if(!u3(n)||!function(i){return typeof i=="object"&&i!==null&&(Object.getPrototypeOf(i)===Object.prototype||Object.getPrototypeOf(i)===null)}(n)){const r=XE(n);throw r==="an object"?e.gc(t+" a custom object"):e.gc(t+" "+r)}}function Vb(t,e,n){if((e=cn(e))instanceof Xh)return e._internalPath;if(typeof e=="string")return nS(t,e);throw cv("Field path arguments must be of type string or ",t,!1,void 0,n)}const DY=new RegExp("[~\\*/\\[\\]]");function nS(t,e,n){if(e.search(DY)>=0)throw cv(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new Xh(...e.split("."))._internalPath}catch{throw cv(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function cv(t,e,n,r,i){const s=r&&!r.isEmpty(),o=i!==void 0;let a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let l="";return(s||o)&&(l+=" (found",s&&(l+=` in field ${r}`),o&&(l+=` in document ${i}`),l+=")"),new it(Te.INVALID_ARGUMENT,a+t+l)}function d3(t,e){return t.some(n=>n.isEqual(e))}/**
3493 * @license
3494 * Copyright 2020 Google LLC
3495 *
3496 * Licensed under the Apache License, Version 2.0 (the "License");
3497 * you may not use this file except in compliance with the License.
3498 * You may obtain a copy of the License at
3499 *
3500 *   http://www.apache.org/licenses/LICENSE-2.0
3501 *
3502 * Unless required by applicable law or agreed to in writing, software
3503 * distributed under the License is distributed on an "AS IS" BASIS,
3504 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3505 * See the License for the specific language governing permissions and
3506 * limitations under the License.
3507 */class f3{constructor(e,n,r,i,s){this._firestore=e,this._userDataWriter=n,this._key=r,this._document=i,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new Pr(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new kY(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const n=this._document.data.field(h3("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}}class kY extends f3{data(){return super.data()}}function h3(t,e){return typeof e=="string"?nS(t,e):e instanceof Xh?e._internalPath:e._delegate._internalPath}/**
3508 * @license
3509 * Copyright 2020 Google LLC
3510 *
3511 * Licensed under the Apache License, Version 2.0 (the "License");
3512 * you may not use this file except in compliance with the License.
3513 * You may obtain a copy of the License at
3514 *
3515 *   http://www.apache.org/licenses/LICENSE-2.0
3516 *
3517 * Unless required by applicable law or agreed to in writing, software
3518 * distributed under the License is distributed on an "AS IS" BASIS,
3519 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3520 * See the License for the specific language governing permissions and
3521 * limitations under the License.
3522 */function LY(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new it(Te.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class FY{convertValue(e,n="none"){switch(Ua(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Cn(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(Fa(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 11:return this.convertObject(e.mapValue,n);case 10:return this.convertVectorValue(e.mapValue);default:throw ct(62114,{value:e})}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){const r={};return Xa(e,(i,s)=>{r[i]=this.convertValue(s,n)}),r}convertVectorValue(e){var n,r,i;const s=(i=(r=(n=e.fields)===null||n===void 0?void 0:n[tv].arrayValue)===null||r===void 0?void 0:r.values)===null||i===void 0?void 0:i.map(o=>Cn(o.doubleValue));return new QE(s)}convertGeoPoint(e){return new YE(Cn(e.latitude),Cn(e.longitude))}convertArray(e,n){return(e.values||[]).map(r=>this.convertValue(r,n))}convertServerTimestamp(e,n){switch(n){case"previous":const r=my(e);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(hh(e));default:return null}}convertTimestamp(e){const n=La(e);return new zn(n.seconds,n.nanos)}convertDocumentKey(e,n){const r=fn.fromString(e);Wt(IL(r),9688,{name:e});const i=new ph(r.get(1),r.get(3)),s=new ot(r.popFirst(5));return i.isEqual(n)||bo(`Document ${s} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),s}}/**
3523 * @license
3524 * Copyright 2020 Google LLC
3525 *
3526 * Licensed under the Apache License, Version 2.0 (the "License");
3527 * you may not use this file except in compliance with the License.
3528 * You may obtain a copy of the License at
3529 *
3530 *   http://www.apache.org/licenses/LICENSE-2.0
3531 *
3532 * Unless required by applicable law or agreed to in writing, software
3533 * distributed under the License is distributed on an "AS IS" BASIS,
3534 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3535 * See the License for the specific language governing permissions and
3536 * limitations under the License.
3537 */function rS(t,e,n){let r;return r=t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e,r}function UY(){return new RY("count")}/**
3538 * @license
3539 * Copyright 2020 Google LLC
3540 *
3541 * Licensed under the Apache License, Version 2.0 (the "License");
3542 * you may not use this file except in compliance with the License.
3543 * You may obtain a copy of the License at
3544 *
3545 *   http://www.apache.org/licenses/LICENSE-2.0
3546 *
3547 * Unless required by applicable law or agreed to in writing, software
3548 * distributed under the License is distributed on an "AS IS" BASIS,
3549 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3550 * See the License for the specific language governing permissions and
3551 * limitations under the License.
3552 */class rf{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class p3 extends f3{constructor(e,n,r,i,s,o){super(e,n,r,i,o),this._firestore=e,this._firestoreImpl=e,this.metadata=s}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const n=new Zm(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,n={}){if(this._document){const r=this._document.data.field(h3("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}}class Zm extends p3{data(e={}){return super.data(e)}}class jY{constructor(e,n,r,i){this._firestore=e,this._userDataWriter=n,this._snapshot=i,this.metadata=new rf(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){const e=[];return this.forEach(n=>e.push(n)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,n){this._snapshot.docs.forEach(r=>{e.call(n,new Zm(this._firestore,this._userDataWriter,r.key,r,new rf(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}
3552docChanges(e={}){const n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new it(Te.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(i,s){if(i._snapshot.oldDocs.isEmpty()){let o=0;return i._snapshot.docChanges.map(a=>{const l=new Zm(i._firestore,i._userDataWriter,a.doc.key,a.doc,new rf(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);return a.doc,{type:"added",doc:l,oldIndex:-1,newIndex:o++}})}{let o=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(a=>s||a.type!==3).map(a=>{const l=new Zm(i._firestore,i._userDataWriter,a.doc.key,a.doc,new rf(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);let c=-1,d=-1;return a.type!==0&&(c=o.indexOf(a.doc.key),o=o.delete(a.doc.key)),a.type!==1&&(o=o.add(a.doc),d=o.indexOf(a.doc.key)),{type:BY(a.type),doc:l,oldIndex:c,newIndex:d}})}}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}}function BY(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return ct(61501,{type:t})}}/**
3553 * @license
3554 * Copyright 2020 Google LLC
3555 *
3556 * Licensed under the Apache License, Version 2.0 (the "License");
3557 * you may not use this file except in compliance with the License.
3558 * You may obtain a copy of the License at
3559 *
3560 *   http://www.apache.org/licenses/LICENSE-2.0
3561 *
3562 * Unless required by applicable law or agreed to in writing, software
3563 * distributed under the License is distributed on an "AS IS" BASIS,
3564 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3565 * See the License for the specific language governing permissions and
3566 * limitations under the License.
3567 */function m3(t){t=Xr(t,Pr);const e=Xr(t.firestore,ks);return EY(Kh(e),t._key).then(n=>g3(e,t,n))}class iS extends FY{constructor(e){super(),this.firestore=e}convertBytes(e){return new Lu(e)}convertReference(e){const n=this.convertDocumentKey(e,this.firestore._databaseId);return new Pr(this.firestore,null,n)}}function VY(t,e,n){t=Xr(t,Pr);const r=Xr(t.firestore,ks),i=rS(t.converter,e,n);return Qh(r,[JE(Py(r),"setDoc",t._key,i,t.converter!==null,n).toMutation(t._key,Rr.none())])}function Eo(t,e,n,...r){t=Xr(t,Pr);const i=Xr(t.firestore,ks),s=Py(i);let o;return o=typeof(e=cn(e))=="string"||e instanceof Xh?l3(s,"updateDoc",t._key,e,n,r):a3(s,"updateDoc",t._key,e),Qh(i,[o.toMutation(t._key,Rr.exists(!0))])}function od(t){return Qh(Xr(t.firestore,ks),[new wy(t._key,Rr.none())])}function Fu(t,e){const n=Xr(t.firestore,ks),r=_n(t),i=rS(t.converter,e);return Qh(n,[JE(Py(t.firestore),"addDoc",r._key,i,t.converter!==null,{}).toMutation(r._key,Rr.exists(!1))]).then(()=>r)}function Oi(t,...e){var n,r,i;t=cn(t);let s={includeMetadataChanges:!1,source:"default"},o=0;typeof e[o]!="object"||fR(e[o])||(s=e[o],o++);const a={includeMetadataChanges:s.includeMetadataChanges,source:s.source};if(fR(e[o])){const f=e[o];e[o]=(n=f.next)===null||n===void 0?void 0:n.bind(f),e[o+1]=(r=f.error)===null||r===void 0?void 0:r.bind(f),e[o+2]=(i=f.complete)===null||i===void 0?void 0:i.bind(f)}let l,c,d;if(t instanceof Pr)c=Xr(t.firestore,ks),d=vy(t._key.path),l={next:f=>{e[o]&&e[o](g3(c,t,f))},error:e[o+1],complete:e[o+2]};else{const f=Xr(t,Cy);c=Xr(f.firestore,ks),d=f._query;const u=new iS(c);l={next:h=>{e[o]&&e[o](new jY(c,u,f,h))},error:e[o+1],complete:e[o+2]},LY(t._query)}return function(u,h,g,v){const m=new t3(v),p=new WL(h,m,g);return u.asyncQueue.enqueueAndForget(async()=>GL(await Bb(u),p)),()=>{m.xu(),u.asyncQueue.enqueueAndForget(async()=>$L(await Bb(u),p))}}(Kh(c),d,a,l)}function Qh(t,e){return function(r,i){const s=new co;return r.asyncQueue.enqueueAndForget(async()=>uY(await bY(r),i,s)),s.promise}(Kh(t),e)}function g3(t,e,n){const r=n.docs.get(e._key),i=new iS(t);return new p3(t,i,e._key,r,new rf(n.hasPendingWrites,n.fromCache),e.converter)}/**
3568 * @license
3569 * Copyright 2022 Google LLC
3570 *
3571 * Licensed under the Apache License, Version 2.0 (the "License");
3572 * you may not use this file except in compliance with the License.
3573 * You may obtain a copy of the License at
3574 *
3575 *   http://www.apache.org/licenses/LICENSE-2.0
3576 *
3577 * Unless required by applicable law or agreed to in writing, software
3578 * distributed under the License is distributed on an "AS IS" BASIS,
3579 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3580 * See the License for the specific language governing permissions and
3581 * limitations under the License.
3582 */function qp(t){return zY(t,{count:UY()})}function zY(t,e){const n=Xr(t.firestore,ks),r=Kh(n),i=qq(e,(s,o)=>new RK(o,s.aggregateType,s._internalFieldPath));return SY(r,t._query,i).then(s=>function(a,l,c){const d=new iS(a);return new PY(l,d,c)}(n,t,s))}/**
3583 * @license
3584 * Copyright 2020 Google LLC
3585 *
3586 * Licensed under the Apache License, Version 2.0 (the "License");
3587 * you may not use this file except in compliance with the License.
3588 * You may obtain a copy of the License at
3589 *
3590 *   http://www.apache.org/licenses/LICENSE-2.0
3591 *
3592 * Unless required by applicable law or agreed to in writing, software
3593 * distributed under the License is distributed on an "AS IS" BASIS,
3594 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3595 * See the License for the specific language governing permissions and
3596 * limitations under the License.
3597 */class HY{constructor(e,n){this._firestore=e,this._commitHandler=n,this._mutations=[],this._committed=!1,this._dataReader=Py(e)}set(e,n,r){this._verifyNotCommitted();const i=J_(e,this._firestore),s=rS(i.converter,n,r),o=JE(this._dataReader,"WriteBatch.set",i._key,s,i.converter!==null,r);return this._mutations.push(o.toMutation(i._key,Rr.none())),this}update(e,n,r,...i){this._verifyNotCommitted();const s=J_(e,this._firestore);let o;return o=typeof(n=cn(n))=="string"||n instanceof Xh?l3(this._dataReader,"WriteBatch.update",s._key,n,r,i):a3(this._dataReader,"WriteBatch.update",s._key,n),this._mutations.push(o.toMutation(s._key,Rr.exists(!0))),this}delete(e){this._verifyNotCommitted();const n=J_(e,this._firestore);return this._mutations=this._mutations.concat(new wy(n._key,Rr.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new it(Te.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function J_(t,e){if((t=cn(t)).firestore!==e)throw new it(Te.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}/**
3598 * @license
3599 * Copyright 2020 Google LLC
3600 *
3601 * Licensed under the Apache License, Version 2.0 (the "License");
3602 * you may not use this file except in compliance with the License.
3603 * You may obtain a copy of the License at
3604 *
3605 *   http://www.apache.org/licenses/LICENSE-2.0
3606 *
3607 * Unless required by applicable law or agreed to in writing, software
3608 * distributed under the License is distributed on an "AS IS" BASIS,
3609 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3610 * See the License for the specific language governing permissions and
3611 * limitations under the License.
3612 */function GY(){return new Yh("deleteField")}function hR(){return new eS("serverTimestamp")}/**
3613 * @license
3614 * Copyright 2020 Google LLC
3615 *
3616 * Licensed under the Apache License, Version 2.0 (the "License");
3617 * you may not use this file except in compliance with the License.
3618 * You may obtain a copy of the License at
3619 *
3620 *   http://www.apache.org/licenses/LICENSE-2.0
3621 *
3622 * Unless required by applicable law or agreed to in writing, software
3623 * distributed under the License is distributed on an "AS IS" BASIS,
3624 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3625 * See the License for the specific language governing permissions and
3626 * limitations under the License.
3627 */function $Y(t){return Kh(t=Xr(t,ks)),new HY(t,e=>Qh(t,e))}(function(e,n=!0){(function(i){nd=i})(ql),ns(new Ii("firestore",(r,{instanceIdentifier:i,options:s})=>{const o=r.getProvider("app").getImmediate(),a=new ks(new Iq(r.getProvider("auth-internal")),new Dq(o,r.getProvider("app-check-internal")),function(c,d){if(!Object.prototype.hasOwnProperty.apply(c.options,["projectId"]))throw new it(Te.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new ph(c.options.projectId,d)}(o,i),o);return s=Object.assign({useFetchStreams:n},s),a._setSettings(s),a},"PUBLIC").setMultipleInstances(!0)),Kr(gC,vC,e),Kr(gC,vC,"esm2017")})();/**
3628 * @license
3629 * Copyright 2017 Google LLC
3630 *
3631 * Licensed under the Apache License, Version 2.0 (the "License");
3632 * you may not use this file except in compliance with the License.
3633 * You may obtain a copy of the License at
3634 *
3635 *   http://www.apache.org/licenses/LICENSE-2.0
3636 *
3637 * Unless required by applicable law or agreed to in writing, software
3638 * distributed under the License is distributed on an "AS IS" BASIS,
3639 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3640 * See the License for the specific language governing permissions and
3641 * limitations under the License.
3642 */const v3="firebasestorage.googleapis.com",WY="storageBucket",qY=2*60*1e3,KY=10*60*1e3;/**
3643 * @license
3644 * Copyright 2017 Google LLC
3645 *
3646 * Licensed under the Apache License, Version 2.0 (the "License");
3647 * you may not use this file except in compliance with the License.
3648 * You may obtain a copy of the License at
3649 *
3650 *   http://www.apache.org/licenses/LICENSE-2.0
3651 *
3652 * Unless required by applicable law or agreed to in writing, software
3653 * distributed under the License is distributed on an "AS IS" BASIS,
3654 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3655 * See the License for the specific language governing permissions and
3656 * limitations under the License.
3657 */class Hs extends Ni{constructor(e,n,r=0){super(e0(e),`Firebase Storage: ${n} (${e0(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,Hs.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return e0(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
3658${this.customData.serverResponse}`:this.message=this._baseMessage}}var Ls;(function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVALID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(Ls||(Ls={}));function e0(t){return"storage/"+t}function XY(){const t="An unknown error occurred, please check the error payload for server response.";return new Hs(Ls.UNKNOWN,t)}function YY(){return new Hs(Ls.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function QY(){return new Hs(Ls.CANCELED,"User canceled the upload/download.")}function ZY(t){return new Hs(Ls.INVALID_URL,"Invalid URL '"+t+"'.")}function JY(t){return new Hs(Ls.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function pR(t){return new Hs(Ls.INVALID_ARGUMENT,t)}function y3(){return new Hs(Ls.APP_DELETED,"The Firebase app was deleted.")}function eQ(t){return new Hs(Ls.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}/**
3659 * @license
3660 * Copyright 2017 Google LLC
3661 *
3662 * Licensed under the Apache License, Version 2.0 (the "License");
3663 * you may not use this file except in compliance with the License.
3664 * You may obtain a copy of the License at
3665 *
3666 *   http://www.apache.org/licenses/LICENSE-2.0
3667 *
3668 * Unless required by applicable law or agreed to in writing, software
3669 * distributed under the License is distributed on an "AS IS" BASIS,
3670 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3671 * See the License for the specific language governing permissions and
3672 * limitations under the License.
3673 */class Xi{constructor(e,n){this.bucket=e,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,n){let r;try{r=Xi.makeFromUrl(e,n)}catch{return new Xi(e,"")}if(r.path==="")return r;throw JY(e)}static makeFromUrl(e,n){let r=null;const i="([A-Za-z0-9.\\-_]+)";function s(x){x.path.charAt(x.path.length-1)==="/"&&(x.path_=x.path_.slice(0,-1))}const o="(/(.*))?$",a=new RegExp("^gs://"+i+o,"i"),l={bucket:1,path:3};function c(x){x.path_=decodeURIComponent(x.path)}const d="v[A-Za-z0-9_]+",f=n.replace(/[.]/g,"\\."),u="(/([^?#]*).*)?$",h=new RegExp(`^https?://${f}/${d}/b/${i}/o${u}`,"i"),g={bucket:1,path:3},v=n===v3?"(?:storage.googleapis.com|storage.cloud.google.com)":n,m="([^?#]*)",p=new RegExp(`^https?://${v}/${i}/${m}`,"i"),w=[{regex:a,indices:l,postModify:s},{regex:h,indices:g,postModify:c},{regex:p,indices:{bucket:1,path:2},postModify:c}];for(let x=0;x<w.length;x++){const S=w[x],I=S.regex.exec(e);if(I){const M=I[S.indices.bucket];let E=I[S.indices.path];E||(E=""),r=new Xi(M,E),S.postModify(r);break}}if(r==null)throw ZY(e);return r}}class tQ{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}/**
3674 * @license
3675 * Copyright 2017 Google LLC
3676 *
3677 * Licensed under the Apache License, Version 2.0 (the "License");
3678 * you may not use this file except in compliance with the License.
3679 * You may obtain a copy of the License at
3680 *
3681 *   http://www.apache.org/licenses/LICENSE-2.0
3682 *
3683 * Unless required by applicable law or agreed to in writing, software
3684 * distributed under the License is distributed on an "AS IS" BASIS,
3685 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3686 * See the License for the specific language governing permissions and
3687 * limitations under the License.
3688 */function nQ(t,e,n){let r=1,i=null,s=null,o=!1,a=0;function l(){return a===2}let c=!1;function d(...m){c||(c=!0,e.apply(null,m))}function f(m){i=setTimeout(()=>{i=null,t(h,l())},m)}function u(){s&&clearTimeout(s)}function h(m,...p){if(c){u();return}if(m){u(),d.call(null,m,...p);return}if(l()||o){u(),d.call(null,m,...p);return}r<64&&(r*=2);let w;a===1?(a=2,w=0):w=(r+Math.random())*1e3,f(w)}let g=!1;function v(m){g||(g=!0,u(),!c&&(i!==null?(m||(a=2),clearTimeout(i),f(0)):m||(a=1)))}return f(0),s=setTimeout(()=>{o=!0,v(!0)},n),v}function rQ(t){t(!1)}/**
3689 * @license
3690 * Copyright 2017 Google LLC
3691 *
3692 * Licensed under the Apache License, Version 2.0 (the "License");
3693 * you may not use this file except in compliance with the License.
3694 * You may obtain a copy of the License at
3695 *
3696 *   http://www.apache.org/licenses/LICENSE-2.0
3697 *
3698 * Unless required by applicable law or agreed to in writing, software
3699 * distributed under the License is distributed on an "AS IS" BASIS,
3700 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3701 * See the License for the specific language governing permissions and
3702 * limitations under the License.
3703 */function iQ(t){return t!==void 0}function mR(t,e,n,r){if(r<e)throw pR(`Invalid value for '${t}'. Expected ${e} or greater.`);if(r>n)throw pR(`Invalid value for '${t}'. Expected ${n} or less.`)}function sQ(t){const e=encodeURIComponent;let n="?";for(const r in t)if(t.hasOwnProperty(r)){const i=e(r)+"="+e(t[r]);n=n+i+"&"}return n=n.slice(0,-1),n}var uv;(function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"})(uv||(uv={}));/**
3704 * @license
3705 * Copyright 2022 Google LLC
3706 *
3707 * Licensed under the Apache License, Version 2.0 (the "License");
3708 * you may not use this file except in compliance with the License.
3709 * You may obtain a copy of the License at
3710 *
3711 *   http://www.apache.org/licenses/LICENSE-2.0
3712 *
3713 * Unless required by applicable law or agreed to in writing, software
3714 * distributed under the License is distributed on an "AS IS" BASIS,
3715 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3716 * See the License for the specific language governing permissions and
3717 * limitations under the License.
3718 */function oQ(t,e){const n=t>=500&&t<600,i=[408,429].indexOf(t)!==-1,s=e.indexOf(t)!==-1;return n||i||s}/**
3719 * @license
3720 * Copyright 2017 Google LLC
3721 *
3722 * Licensed under the Apache License, Version 2.0 (the "License");
3723 * you may not use this file except in compliance with the License.
3724 * You may obtain a copy of the License at
3725 *
3726 *   http://www.apache.org/licenses/LICENSE-2.0
3727 *
3728 * Unless required by applicable law or agreed to in writing, software
3729 * distributed under the License is distributed on an "AS IS" BASIS,
3730 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3731 * See the License for the specific language governing permissions and
3732 * limitations under the License.
3733 */class aQ{constructor(e,n,r,i,s,o,a,l,c,d,f,u=!0,h=!1){this.url_=e,this.method_=n,this.headers_=r,this.body_=i,this.successCodes_=s,this.additionalRetryCodes_=o,this.callback_=a,this.errorCallback_=l,this.timeout_=c,this.progressCallback_=d,this.connectionFactory_=f,this.retry=u,this.isUsingEmulator=h,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((g,v)=>{this.resolve_=g,this.reject_=v,this.start_()})}start_(){const e=(r,i)=>{if(i){r(!1,new Kp(!1,null,!0));return}const s=this.connectionFactory_();this.pendingConnection_=s;const o=a=>{const l=a.loaded,c=a.lengthComputable?a.total:-1;this.progressCallback_!==null&&this.progressCallback_(l,c)};this.progressCallback_!==null&&s.addUploadProgressListener(o),s.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&s.removeUploadProgressListener(o),this.pendingConnection_=null;const a=s.getErrorCode()===uv.NO_ERROR,l=s.getStatus();if(!a||oQ(l,this.additionalRetryCodes_)&&this.retry){const d=s.getErrorCode()===uv.ABORT;r(!1,new Kp(!1,null,d));return}const c=this.successCodes_.indexOf(l)!==-1;r(!0,new Kp(c,s))})},n=(r,i)=>{const s=this.resolve_,o=this.reject_,a=i.connection;if(i.wasSuccessCode)try{const l=this.callback_(a,a.getResponse());iQ(l)?s(l):s()}catch(l){o(l)}else if(a!==null){const l=XY();l.serverResponse=a.getErrorText(),this.errorCallback_?o(this.errorCallback_(a,l)):o(l)}else if(i.canceled){const l=this.appDelete_?y3():QY();o(l)}else{const l=YY();o(l)}};
3733this.canceled_?n(!1,new Kp(!1,null,!0)):this.backoffId_=nQ(e,n,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&rQ(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class Kp{constructor(e,n,r){this.wasSuccessCode=e,this.connection=n,this.canceled=!!r}}function lQ(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function cQ(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function uQ(t,e){e&&(t["X-Firebase-GMPID"]=e)}function dQ(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function fQ(t,e,n,r,i,s,o=!0,a=!1){const l=sQ(t.urlParams),c=t.url+l,d=Object.assign({},t.headers);return uQ(d,e),lQ(d,n),cQ(d,s),dQ(d,r),new aQ(c,t.method,d,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,i,o,a)}/**
3734 * @license
3735 * Copyright 2017 Google LLC
3736 *
3737 * Licensed under the Apache License, Version 2.0 (the "License");
3738 * you may not use this file except in compliance with the License.
3739 * You may obtain a copy of the License at
3740 *
3741 *   http://www.apache.org/licenses/LICENSE-2.0
3742 *
3743 * Unless required by applicable law or agreed to in writing, software
3744 * distributed under the License is distributed on an "AS IS" BASIS,
3745 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3746 * See the License for the specific language governing permissions and
3747 * limitations under the License.
3748 */function hQ(t){if(t.length===0)return null;const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function pQ(t){const e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}/**
3749 * @license
3750 * Copyright 2019 Google LLC
3751 *
3752 * Licensed under the Apache License, Version 2.0 (the "License");
3753 * you may not use this file except in compliance with the License.
3754 * You may obtain a copy of the License at
3755 *
3756 *   http://www.apache.org/licenses/LICENSE-2.0
3757 *
3758 * Unless required by applicable law or agreed to in writing, software
3759 * distributed under the License is distributed on an "AS IS" BASIS,
3760 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3761 * See the License for the specific language governing permissions and
3762 * limitations under the License.
3763 */class dv{constructor(e,n){this._service=e,n instanceof Xi?this._location=n:this._location=Xi.makeFromUrl(n,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,n){return new dv(e,n)}get root(){const e=new Xi(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return pQ(this._location.path)}get storage(){return this._service}get parent(){const e=hQ(this._location.path);if(e===null)return null;const n=new Xi(this._location.bucket,e);return new dv(this._service,n)}_throwIfRoot(e){if(this._location.path==="")throw eQ(e)}}function gR(t,e){const n=e==null?void 0:e[WY];return n==null?null:Xi.makeFromBucketSpec(n,t)}function mQ(t,e,n,r={}){t.host=`${e}:${n}`;const i=$l(e);i&&(dE(`https://${t.host}/b`),fE("Storage",!0)),t._isUsingEmulator=!0,t._protocol=i?"https":"http";const{mockUserToken:s}=r;s&&(t._overrideAuthToken=typeof s=="string"?s:WD(s,t.app.options.projectId))}class gQ{constructor(e,n,r,i,s,o=!1){this.app=e,this._authProvider=n,this._appCheckProvider=r,this._url=i,this._firebaseVersion=s,this._isUsingEmulator=o,this._bucket=null,this._host=v3,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=qY,this._maxUploadRetryTime=KY,this._requests=new Set,i!=null?this._bucket=Xi.makeFromBucketSpec(i,this._host):this._bucket=gR(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=Xi.makeFromBucketSpec(this._url,e):this._bucket=gR(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){mR("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){mR("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const n=await e.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){if(Ti(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=this._appCheckProvider.getImmediate({optional:!0});
3763return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new dv(this,e)}_makeRequest(e,n,r,i,s=!0){if(this._deleted)return new tQ(y3());{const o=fQ(e,this._appId,r,i,n,this._firebaseVersion,s,this._isUsingEmulator);return this._requests.add(o),o.getPromise().then(()=>this._requests.delete(o),()=>this._requests.delete(o)),o}}async makeRequestWithTokens(e,n){const[r,i]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,n,r,i).getPromise()}}const vR="@firebase/storage",yR="0.13.13";/**
3764 * @license
3765 * Copyright 2020 Google LLC
3766 *
3767 * Licensed under the Apache License, Version 2.0 (the "License");
3768 * you may not use this file except in compliance with the License.
3769 * You may obtain a copy of the License at
3770 *
3771 *   http://www.apache.org/licenses/LICENSE-2.0
3772 *
3773 * Unless required by applicable law or agreed to in writing, software
3774 * distributed under the License is distributed on an "AS IS" BASIS,
3775 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3776 * See the License for the specific language governing permissions and
3777 * limitations under the License.
3778 */const _3="storage";function vQ(t=ly(),e){t=cn(t);const r=Ka(t,_3).getImmediate({identifier:e}),i=HD("storage");return i&&yQ(r,...i),r}function yQ(t,e,n,r={}){mQ(t,e,n,r)}function _Q(t,{instanceIdentifier:e}){const n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal"),i=t.getProvider("app-check-internal");return new gQ(n,r,i,e,ql)}function xQ(){ns(new Ii(_3,_Q,"PUBLIC").setMultipleInstances(!0)),Kr(vR,yR,""),Kr(vR,yR,"esm2017")}xQ();const x3="@firebase/installations",sS="0.6.17";/**
3779 * @license
3780 * Copyright 2019 Google LLC
3781 *
3782 * Licensed under the Apache License, Version 2.0 (the "License");
3783 * you may not use this file except in compliance with the License.
3784 * You may obtain a copy of the License at
3785 *
3786 *   http://www.apache.org/licenses/LICENSE-2.0
3787 *
3788 * Unless required by applicable law or agreed to in writing, software
3789 * distributed under the License is distributed on an "AS IS" BASIS,
3790 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3791 * See the License for the specific language governing permissions and
3792 * limitations under the License.
3793 */const b3=1e4,w3=`w:${sS}`,E3="FIS_v2",bQ="https://firebaseinstallations.googleapis.com/v1",wQ=60*60*1e3,EQ="installations",SQ="Installations";/**
3794 * @license
3795 * Copyright 2019 Google LLC
3796 *
3797 * Licensed under the Apache License, Version 2.0 (the "License");
3798 * you may not use this file except in compliance with the License.
3799 * You may obtain a copy of the License at
3800 *
3801 *   http://www.apache.org/licenses/LICENSE-2.0
3802 *
3803 * Unless required by applicable law or agreed to in writing, software
3804 * distributed under the License is distributed on an "AS IS" BASIS,
3805 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3806 * See the License for the specific language governing permissions and
3807 * limitations under the License.
3808 */const TQ={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."},Ul=new Wl(EQ,SQ,TQ);function S3(t){return t instanceof Ni&&t.code.includes("request-failed")}/**
3809 * @license
3810 * Copyright 2019 Google LLC
3811 *
3812 * Licensed under the Apache License, Version 2.0 (the "License");
3813 * you may not use this file except in compliance with the License.
3814 * You may obtain a copy of the License at
3815 *
3816 *   http://www.apache.org/licenses/LICENSE-2.0
3817 *
3818 * Unless required by applicable law or agreed to in writing, software
3819 * distributed under the License is distributed on an "AS IS" BASIS,
3820 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3821 * See the License for the specific language governing permissions and
3822 * limitations under the License.
3823 */function T3({projectId:t}){return`${bQ}/projects/${t}/installations`}
3823function A3(t){return{token:t.token,requestStatus:2,expiresIn:MQ(t.expiresIn),creationTime:Date.now()}}async function M3(t,e){const r=(await e.json()).error;return Ul.create("request-failed",{requestName:t,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})}function C3({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function AQ(t,{refreshToken:e}){const n=C3(t);return n.append("Authorization",CQ(e)),n}async function R3(t){const e=await t();return e.status>=500&&e.status<600?t():e}function MQ(t){return Number(t.replace("s","000"))}function CQ(t){return`${E3} ${t}`}/**
3824 * @license
3825 * Copyright 2019 Google LLC
3826 *
3827 * Licensed under the Apache License, Version 2.0 (the "License");
3828 * you may not use this file except in compliance with the License.
3829 * You may obtain a copy of the License at
3830 *
3831 *   http://www.apache.org/licenses/LICENSE-2.0
3832 *
3833 * Unless required by applicable law or agreed to in writing, software
3834 * distributed under the License is distributed on an "AS IS" BASIS,
3835 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3836 * See the License for the specific language governing permissions and
3837 * limitations under the License.
3838 */async function RQ({appConfig:t,heartbeatServiceProvider:e},{fid:n}){const r=T3(t),i=C3(t),s=e.getImmediate({optional:!0});if(s){const c=await s.getHeartbeatsHeader();c&&i.append("x-firebase-client",c)}const o={fid:n,authVersion:E3,appId:t.appId,sdkVersion:w3},a={method:"POST",headers:i,body:JSON.stringify(o)},l=await R3(()=>fetch(r,a));if(l.ok){const c=await l.json();return{fid:c.fid||n,registrationStatus:2,refreshToken:c.refreshToken,authToken:A3(c.authToken)}}else throw await M3("Create Installation",l)}/**
3839 * @license
3840 * Copyright 2019 Google LLC
3841 *
3842 * Licensed under the Apache License, Version 2.0 (the "License");
3843 * you may not use this file except in compliance with the License.
3844 * You may obtain a copy of the License at
3845 *
3846 *   http://www.apache.org/licenses/LICENSE-2.0
3847 *
3848 * Unless required by applicable law or agreed to in writing, software
3849 * distributed under the License is distributed on an "AS IS" BASIS,
3850 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3851 * See the License for the specific language governing permissions and
3852 * limitations under the License.
3853 */function P3(t){return new Promise(e=>{setTimeout(e,t)})}/**
3854 * @license
3855 * Copyright 2019 Google LLC
3856 *
3857 * Licensed under the Apache License, Version 2.0 (the "License");
3858 * you may not use this file except in compliance with the License.
3859 * You may obtain a copy of the License at
3860 *
3861 *   http://www.apache.org/licenses/LICENSE-2.0
3862 *
3863 * Unless required by applicable law or agreed to in writing, software
3864 * distributed under the License is distributed on an "AS IS" BASIS,
3865 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3866 * See the License for the specific language governing permissions and
3867 * limitations under the License.
3868 */function PQ(t){return btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")}/**
3869 * @license
3870 * Copyright 2019 Google LLC
3871 *
3872 * Licensed under the Apache License, Version 2.0 (the "License");
3873 * you may not use this file except in compliance with the License.
3874 * You may obtain a copy of the License at
3875 *
3876 *   http://www.apache.org/licenses/LICENSE-2.0
3877 *
3878 * Unless required by applicable law or agreed to in writing, software
3879 * distributed under the License is distributed on an "AS IS" BASIS,
3880 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3881 * See the License for the specific language governing permissions and
3882 * limitations under the License.
3883 */const IQ=/^[cdef][\w-]{21}$/,zb="";function NQ(){try{const t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;const n=OQ(t);return IQ.test(n)?n:zb}catch{return zb}}function OQ(t){return PQ(t).substr(0,22)}/**
3884 * @license
3885 * Copyright 2019 Google LLC
3886 *
3887 * Licensed under the Apache License, Version 2.0 (the "License");
3888 * you may not use this file except in compliance with the License.
3889 * You may obtain a copy of the License at
3890 *
3891 *   http://www.apache.org/licenses/LICENSE-2.0
3892 *
3893 * Unless required by applicable law or agreed to in writing, softw
3893are
3894 * distributed under the License is distributed on an "AS IS" BASIS,
3895 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3896 * See the License for the specific language governing permissions and
3897 * limitations under the License.
3898 */function Ny(t){return`${t.appName}!${t.appId}`}/**
3899 * @license
3900 * Copyright 2019 Google LLC
3901 *
3902 * Licensed under the Apache License, Version 2.0 (the "License");
3903 * you may not use this file except in compliance with the License.
3904 * You may obtain a copy of the License at
3905 *
3906 *   http://www.apache.org/licenses/LICENSE-2.0
3907 *
3908 * Unless required by applicable law or agreed to in writing, software
3909 * distributed under the License is distributed on an "AS IS" BASIS,
3910 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3911 * See the License for the specific language governing permissions and
3912 * limitations under the License.
3913 */const I3=new Map;function N3(t,e){const n=Ny(t);O3(n,e),DQ(n,e)}function O3(t,e){const n=I3.get(t);if(n)for(const r of n)r(e)}function DQ(t,e){const n=kQ();n&&n.postMessage({key:t,fid:e}),LQ()}let vl=null;function kQ(){return!vl&&"BroadcastChannel"in self&&(vl=new BroadcastChannel("[Firebase] FID Change"),vl.onmessage=t=>{O3(t.data.key,t.data.fid)}),vl}function LQ(){I3.size===0&&vl&&(vl.close(),vl=null)}/**
3914 * @license
3915 * Copyright 2019 Google LLC
3916 *
3917 * Licensed under the Apache License, Version 2.0 (the "License");
3918 * you may not use this file except in compliance with the License.
3919 * You may obtain a copy of the License at
3920 *
3921 *   http://www.apache.org/licenses/LICENSE-2.0
3922 *
3923 * Unless required by applicable law or agreed to in writing, software
3924 * distributed under the License is distributed on an "AS IS" BASIS,
3925 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3926 * See the License for the specific language governing permissions and
3927 * limitations under the License.
3928 */const FQ="firebase-installations-database",UQ=1,jl="firebase-installations-store";let t0=null;function oS(){return t0||(t0=YD(FQ,UQ,{upgrade:(t,e)=>{switch(e){case 0:t.createObjectStore(jl)}}})),t0}async function fv(t,e){const n=Ny(t),i=(await oS()).transaction(jl,"readwrite"),s=i.objectStore(jl),o=await s.get(n);return await s.put(e,n),await i.done,(!o||o.fid!==e.fid)&&N3(t,e.fid),e}async function D3(t){const e=Ny(t),r=(await oS()).transaction(jl,"readwrite");await r.objectStore(jl).delete(e),await r.done}async function Oy(t,e){const n=Ny(t),i=(await oS()).transaction(jl,"readwrite"),s=i.objectStore(jl),o=await s.get(n),a=e(o);return a===void 0?await s.delete(n):await s.put(a,n),await i.done,a&&(!o||o.fid!==a.fid)&&N3(t,a.fid),a}/**
3929 * @license
3930 * Copyright 2019 Google LLC
3931 *
3932 * Licensed under the Apache License, Version 2.0 (the "License");
3933 * you may not use this file except in compliance with the License.
3934 * You may obtain a copy of the License at
3935 *
3936 *   http://www.apache.org/licenses/LICENSE-2.0
3937 *
3938 * Unless required by applicable law or agreed to in writing, software
3939 * distributed under the License is distributed on an "AS IS" BASIS,
3940 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3941 * See the License for the specific language governing permissions and
3942 * limitations under the License.
3943 */async function aS(t){let e;const n=await Oy(t.appConfig,r=>{const i=jQ(r),s=BQ(t,i);return e=s.registrationPromise,s.installationEntry});return n.fid===zb?{installationEntry:await e}:{installationEntry:n,registrationPromise:e}}function jQ(t){const e=t||{fid:NQ(),registrationStatus:0};return k3(e)}function BQ(t,e){if(e.registrationStatus===0){if(!navigator.onLine){const i=Promise.reject(Ul.create("app-offline"));return{installationEntry:e,registrationPromise:i}}const n={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},r=VQ(t,n);return{installationEntry:n,registrationPromise:r}}else return e.registrationStatus===1?{installationEntry:e,registrationPromise:zQ(t)}:{installationEntry:e}}async function VQ(t,e){try{const n=await RQ(t,e);return fv(t.appConfig,n)}catch(n){throw S3(n)&&n.customData.serverCode===409?await D3(t.appConfig):await fv(t.appConfig,{fid:e.fid,registrationStatus:0}),n}}async function zQ(t){let e=await _R(t.appConfig);for(;e.registrationStatus===1;)await P3(100),e=await _R(t.appConfig);if(e.registrationStatus===0){const{installationEntry:n,registrationPromise:r}=await aS(t);return r||n}return e}function _R(t){return Oy(t,e=>{if(!e)throw Ul.create("installation-not-found");return k3(e)})}function k3(t){return HQ(t)?{fid:t.fid,registrationStatus:0}:t}function HQ(t){return t.registrationStatus===1&&t.registrationTime+b3<Date.now()}/**
3944 * @license
3945 * Copyright 2019 Google LLC
3946 *
3947 * Licensed under the Apache License, Version 2.0 (the "License");
3948 * you may not use this file except in compliance with the License.
3949 * You may obtain a copy of the License at
3950 *
3951 *   http://www.apache.org/licenses/LICENSE-2.0
3952 *
3953 * Unless required by applicable law or agreed to in writing, software
3954 * distributed under the License is distributed on an "AS IS" BASIS,
3955 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3956 * See the License for the specific language governing permissions and
3957 * limitations under the License.
3958 */async function GQ({appConfig:t,heartbeatServiceProvider:e},n){const r=$Q(t,n),i=AQ(t,n),s=e.getImmediate({optional:!0});if(s){const c=await s.getHeartbeatsHeader();c&&i.append("x-firebase-client",c)}const o={installation:{sdkVersion:w3,appId:t.appId}},a={method:"POST",headers:i,body:JSON.stringify(o)},l=await R3(()=>fetch(r,a));if(l.ok){const c=await l.json();return A3(c)}else throw await M3("Generate Auth Token",l)}function $Q(t,{fid:e}){return`${T3(t)}/${e}/authTokens:generate`}/**
3959 * @license
3960 * Copyright 2019 Google LLC
3961 *
3962 * Licensed under the Apache License, Version 2.0 (the "License");
3963 * you may not use this file except in compliance with the License.
3964 * You may obtain a copy of the License at
3965 *
3966 *   http://www.apache.org/licenses/LICENSE-2.0
3967 *
3968 * Unless required by applicable law or agreed to in writing, software
3969 * distributed under the License is distributed on an "AS IS" BASIS,
3970 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3971 * See the License for the specific language governing permissions and
3972 * limitations under the License.
3973 */async function lS(t,e=!1){let n;const r=await Oy(t.appConfig,s=>{if(!L3(s))throw Ul.create("not-registered");const o=s.authToken;if(!e&&KQ(o))return s;if(o.requestStatus===1)return n=WQ(t,e),s;{if(!navigator.onLine)throw Ul.create("app-offline");const a=YQ(s);return n=qQ(t,a),a}});return n?await n:r.authToken}async function WQ(t,e){let n=await xR(t.appConfig);for(;n.authToken.requestStatus===1;)await P3(100),n=await xR(t.appConfig);const r=n.authToken;return r.requestStatus===0?lS(t,e):r}function xR(t){return Oy(t,e=>{if(!L3(e))throw Ul.create("not-registered");const n=e.authToken;return QQ(n)?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}async function qQ(t,e){try{const n=await GQ(t,e),r=Object.assign(Object.assign({},e),{authToken:n});return await fv(t.appConfig,r),n}catch(n){if(S3(n)&&(n.customData.serverCode===401||n.customData.serverCode===404))await D3(t.appConfig);else{const r=Object.assign(Object.assign({},e),{authToken:{requestStatus:0}});await fv(t.appConfig,r)}throw n}}function L3(t){return t!==void 0&&t.registrationStatus===2}function KQ(t){return t.requestStatus===2&&!XQ(t)}function XQ(t){const e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+wQ}function YQ(t){const e={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},t),{authToken:e})}function QQ(t){return t.requestStatus===1&&t.requestTime+b3<Date.now()}/**
3974 * @license
3975 * Copyright 2019 Google LLC
3976 *
3977 * Licensed under the Apache License, Version 2.0 (the "License");
3978 * you may not use this file except in compliance with the License.
3979 * You may obtain a copy of the License at
3980 *
3981 *   http://www.apache.org/licenses/LICENSE-2.0
3982 *
3983 * Unless required by applicable law or agreed to in writing, software
3984 * distributed under the License is distributed on an "AS IS" BASIS,
3985 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3986 * See the License for the specific language governing permissions and
3987 * limitations under the License.
3988 */async function ZQ(t){const e=t,{installationEntry:n,registrationPromise:r}=await aS(e);return r?r.catch(console.error):lS(e).catch(console.error),n.fid}/**
3989 * @license
3990 * Copyright 2019 Google LLC
3991 *
3992 * Licensed under the Apache License, Version 2.0 (the "License");
3993 * you may not use this file except in compliance with the License.
3994 * You may obtain a copy of the License at
3995 *
3996 *   http://www.apache.org/licenses/LICENSE-2.0
3997 *
3998 * Unless required by applicable law or agreed to in writing, software
3999 * distributed under the License is distributed on an "AS IS" BASIS,
4000 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4001 * See the License for the specific language governing permissions and
4002 * limitations under the License.
4003 */async function JQ(t,e=!1){const n=t;return await eZ(n),(await lS(n,e)).token}async function eZ(t){const{registrationPromise:e}=await aS(t);e&&await e}/**
4004 * @license
4005 * Copyright 2019 Google LLC
4006 *
4007 * Licensed under the Apache License, Version 2.0 (the "License");
4008 * you may not use this file except in compliance with the License.
4009 * You may obtain a copy of the License at
4010 *
4011 *   http://www.apache.org/licenses/LICENSE-2.0
4012 *
4013 * Unless required by applicable law or agreed to in writing, software
4014 * distributed under the License is distributed on an "AS IS" BASIS,
4015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4016 * See the License for the specific language governing permissions and
4017 * limitations under the License.
4018 */function tZ(t){if(!t||!t.options)throw n0("App Configuration");if(!t.name)throw n0("App Name");const e=["projectId","apiKey","appId"];for(const n of e)if(!t.options[n])throw n0(n);return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}function n0(t){return Ul.create("missing-app-config-values",{valueName:t})}/**
4019 * @license
4020 * Copyright 2020 Google LLC
4021 *
4022 * Licensed under the Apache License, Version 2.0 (the "License");
4023 * you may not use this file except in compliance with the License.
4024 * You may obtain a copy of the License at
4025 *
4026 *   http://www.apache.org/licenses/LICENSE-2.0
4027 *
4028 * Unless required by applicable law or agreed to in writing, software
4029 * distributed under the License is distributed on an "AS IS" BASIS,
4030 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4031 * See the License for the specific language governing permissions and
4032 * limitations under the License.
4033 */const F3="installations",nZ="installations-internal",rZ=t=>{const e=t.getProvider("app").getImmediate(),n=tZ(e),r=Ka(e,"heartbeat");return{app:e,appConfig:n,heartbeatServiceProvider:r,_delete:()=>Promise.resolve()}},iZ=t=>{const e=t.getProvider("app").getImmediate(),n=Ka(e,F3).getImmediate();return{getId:()=>ZQ(n),getToken:i=>JQ(n,i)}};function sZ(){ns(new Ii(F3,rZ,"PUBLIC")),ns(new Ii(nZ,iZ,"PRIVATE"))}sZ();Kr(x3,sS);Kr(x3,sS,"esm2017");/**
4034 * @license
4035 * Copyright 2019 Google LLC
4036 *
4037 * Licensed under the Apache License, Version 2.0 (the "License");
4038 * you may not use this file except in compliance with the License.
4039 * You may obtain a copy of the License at
4040 *
4041 *   http://www.apache.org/licenses/LICENSE-2.0
4042 *
4043 * Unless required by applicable law or agreed to in writing, software
4044 * distributed under the License is distributed on an "AS IS" BASIS,
4045 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4046 * See the License for the specific language governing permissions and
4047 * limitations under the License.
4048 */const hv="analytics",oZ="firebase_id",aZ="origin",lZ=60*1e3,cZ="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig",cS="https://www.googletagmanager.com/gtag/js";/**
4049 * @license
4050 * Copyright 2019 Google LLC
4051 *
4052 * Licensed under the Apache License, Version 2.0 (the "License");
4053 * you may not use this file except in compliance with the License.
4054 * You may obtain a copy of the License at
4055 *
4056 *   http://www.apache.org/licenses/LICENSE-2.0
4057 *
4058 * Unless required by applicable law or agreed to in writing, software
4059 * distributed under the License is distributed on an "AS IS" BASIS,
4060 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4061 * See the License for the specific language governing permissions and
4062 * limitations under the License.
4063 */const Yr=new ay("@firebase/analytics");/**
4064 * @license
4065 * Copyright 2019 Google LLC
4066 *
4067 * Licensed under the Apache License, Version 2.0 (the "License");
4068 * you may not use this file except in compliance with the License.
4069 * You may obtain a copy of the License at
4070 *
4071 *   http://www.apache.org/licenses/LICENSE-2.0
4072 *
4073 * Unless required by applicable law or agreed to in writing, software
4074 * distributed under the License is distributed on an "AS IS" BASIS,
4075 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4076 * See the License for the specific language governing permissions and
4077 * limitations under the License.
4078 */const uZ={"already-exists":"A Firebase Analytics instance with the appId {$id}  already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-initialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}
4078","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',"no-client-id":'The "client_id" field is empty.',"invalid-gtag-resource":"Trusted Types detected an invalid gtag resource: {$gtagURL}."},di=new Wl("analytics","Analytics",uZ);/**
4079 * @license
4080 * Copyright 2019 Google LLC
4081 *
4082 * Licensed under the Apache License, Version 2.0 (the "License");
4083 * you may not use this file except in compliance with the License.
4084 * You may obtain a copy of the License at
4085 *
4086 *   http://www.apache.org/licenses/LICENSE-2.0
4087 *
4088 * Unless required by applicable law or agreed to in writing, software
4089 * distributed under the License is distributed on an "AS IS" BASIS,
4090 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4091 * See the License for the specific language governing permissions and
4092 * limitations under the License.
4093 */function dZ(t){if(!t.startsWith(cS)){const e=di.create("invalid-gtag-resource",{gtagURL:t});return Yr.warn(e.message),""}return t}function U3(t){return Promise.all(t.map(e=>e.catch(n=>n)))}function fZ(t,e){let n;return window.trustedTypes&&(n=window.trustedTypes.createPolicy(t,e)),n}function hZ(t,e){const n=fZ("firebase-js-sdk-policy",{createScriptURL:dZ}),r=document.createElement("script"),i=`${cS}?l=${t}&id=${e}`;r.src=n?n==null?void 0:n.createScriptURL(i):i,r.async=!0,document.head.appendChild(r)}function pZ(t){let e=[];return Array.isArray(window[t])?e=window[t]:window[t]=e,e}async function mZ(t,e,n,r,i,s){const o=r[i];try{if(o)await e[o];else{const l=(await U3(n)).find(c=>c.measurementId===i);l&&await e[l.appId]}}catch(a){Yr.error(a)}t("config",i,s)}async function gZ(t,e,n,r,i){try{let s=[];if(i&&i.send_to){let o=i.send_to;Array.isArray(o)||(o=[o]);const a=await U3(n);for(const l of o){const c=a.find(f=>f.measurementId===l),d=c&&e[c.appId];if(d)s.push(d);else{s=[];break}}}s.length===0&&(s=Object.values(e)),await Promise.all(s),t("event",r,i||{})}catch(s){Yr.error(s)}}function vZ(t,e,n,r){async function i(s,...o){try{if(s==="event"){const[a,l]=o;await gZ(t,e,n,a,l)}else if(s==="config"){const[a,l]=o;await mZ(t,e,n,r,a,l)}else if(s==="consent"){const[a,l]=o;t("consent",a,l)}else if(s==="get"){const[a,l,c]=o;t("get",a,l,c)}else if(s==="set"){const[a]=o;t("set",a)}else t(s,...o)}catch(a){Yr.error(a)}}return i}function yZ(t,e,n,r,i){let s=function(...o){window[r].push(arguments)};return window[i]&&typeof window[i]=="function"&&(s=window[i]),window[i]=vZ(s,t,e,n),{gtagCore:s,wrappedGtag:window[i]}}function _Z(t){const e=window.document.getElementsByTagName("script");for(const n of Object.values(e))if(n.src&&n.src.includes(cS)&&n.src.includes(t))return n;return null}/**
4094 * @license
4095 * Copyright 2020 Google LLC
4096 *
4097 * Licensed under the Apache License, Version 2.0 (the "License");
4098 * you may not use this file except in compliance with the License.
4099 * You may obtain a copy of the License at
4100 *
4101 *   http://www.apache.org/licenses/LICENSE-2.0
4102 *
4103 * Unless required by applicable law or agreed to in writing, software
4104 * distributed under the License is distributed on an "AS IS" BASIS,
4105 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4106 * See the License for the specific language governing permissions and
4107 * limitations under the License.
4108 */const xZ=30,bZ=1e3;class wZ{constructor(e={},n=bZ){this.throttleMetadata=e,this.intervalMillis=n}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,n){this.throttleMetadata[e]=n}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}}const j3=new wZ;function EZ(t){return new Headers({Accept:"application/json","x-goog-api-key":t})}async function SZ(t){var e;const{appId:n,apiKey:r}=t,i={method:"GET",headers:EZ(r)},s=cZ.replace("{app-id}",n),o=await fetch(s,i);if(o.status!==200&&o.status!==304){let a="";try{const l=await o.json();!((e=l.error)===null||e===void 0)&&e.message&&(a=l.error.message)}catch{}throw di.create("config-fetch-failed",{httpStatus:o.status,responseMessage:a})}return o.json()}async function TZ(t,e=j3,n){const{appId:r,apiKey:i,measurementId:s}=t.options;if(!r)throw di.create("no-app-id");
4108if(!i){if(s)return{measurementId:s,appId:r};throw di.create("no-api-key")}const o=e.getThrottleMetadata(r)||{backoffCount:0,throttleEndTimeMillis:Date.now()},a=new CZ;return setTimeout(async()=>{a.abort()},lZ),B3({appId:r,apiKey:i,measurementId:s},o,a,e)}async function B3(t,{throttleEndTimeMillis:e,backoffCount:n},r,i=j3){var s;const{appId:o,measurementId:a}=t;try{await AZ(r,e)}catch(l){if(a)return Yr.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${l==null?void 0:l.message}]`),{appId:o,measurementId:a};throw l}try{const l=await SZ(t);return i.deleteThrottleMetadata(o),l}catch(l){const c=l;if(!MZ(c)){if(i.deleteThrottleMetadata(o),a)return Yr.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${c==null?void 0:c.message}]`),{appId:o,measurementId:a};throw l}const d=Number((s=c==null?void 0:c.customData)===null||s===void 0?void 0:s.httpStatus)===503?BM(n,i.intervalMillis,xZ):BM(n,i.intervalMillis),f={throttleEndTimeMillis:Date.now()+d,backoffCount:n+1};return i.setThrottleMetadata(o,f),Yr.debug(`Calling attemptFetch again in ${d} millis`),B3(t,f,r,i)}}function AZ(t,e){return new Promise((n,r)=>{const i=Math.max(e-Date.now(),0),s=setTimeout(n,i);t.addEventListener(()=>{clearTimeout(s),r(di.create("fetch-throttle",{throttleEndTimeMillis:e}))})})}function MZ(t){if(!(t instanceof Ni)||!t.customData)return!1;const e=Number(t.customData.httpStatus);return e===429||e===500||e===503||e===504}class CZ{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}}async function RZ(t,e,n,r,i){if(i&&i.global){t("event",n,r);return}else{const s=await e,o=Object.assign(Object.assign({},r),{send_to:s});t("event",n,o)}}/**
4109 * @license
4110 * Copyright 2020 Google LLC
4111 *
4112 * Licensed under the Apache License, Version 2.0 (the "License");
4113 * you may not use this file except in compliance with the License.
4114 * You may obtain a copy of the License at
4115 *
4116 *   http://www.apache.org/licenses/LICENSE-2.0
4117 *
4118 * Unless required by applicable law or agreed to in writing, software
4119 * distributed under the License is distributed on an "AS IS" BASIS,
4120 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4121 * See the License for the specific language governing permissions and
4122 * limitations under the License.
4123 */async function PZ(){if(pE())try{await mE()}catch(t){return Yr.warn(di.create("indexeddb-unavailable",{errorInfo:t==null?void 0:t.toString()}).message),!1}else return Yr.warn(di.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;return!0}async function IZ(t,e,n,r,i,s,o){var a;const l=TZ(t);l.then(h=>{n[h.measurementId]=h.appId,t.options.measurementId&&h.measurementId!==t.options.measurementId&&Yr.warn(`The measurement ID in the local Firebase config (${t.options.measurementId}) does not match the measurement ID fetched from the server (${h.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)}).catch(h=>Yr.error(h)),e.push(l);const c=PZ().then(h=>{if(h)return r.getId()}),[d,f]=await Promise.all([l,c]);_Z(s)||hZ(s,d.measurementId),i("js",new Date);const u=(a=o==null?void 0:o.config)!==null&&a!==void 0?a:{};return u[aZ]="firebase",u.update=!0,f!=null&&(u[oZ]=f),i("config",d.measurementId,u),d.measurementId}/**
4124 * @license
4125 * Copyright 2019 Google LLC
4126 *
4127 * Licensed under the Apache License, Version 2.0 (the "License");
4128 * you may not use this file except in compliance with the License.
4129 * You may obtain a copy of the License at
4130 *
4131 *   http://www.apache.org/licenses/LICENSE-2.0
4132 *
4133 * Unless required by applicable law or agreed to in writing, software
4134 * distributed under the License is distributed on an "AS IS" BASIS,
4135 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4136 * See the License for the specific language governing permissions and
4137 * limitations under the License.
4138 */class NZ{constructor(e){this.app=e}_delete(){return delete Df[this.app.options.appId],Promise.resolve()}}let Df={},bR=[];const wR={};let r0="dataLayer",OZ="gtag",ER,V3,SR=!1;function DZ(){const t=[];if(hE()&&t.push("This is a browser extension environment."),qD()||t.push("Cookies are not available."),t.length>0){const e=t.map((r,i)=>`(${i+1}) ${r}`).join(" "),n=di.create("invalid-analytics-context",{errorInfo:e});Yr.warn(n.message)}}function kZ(t,e,n){DZ();const r=t.options.appId;if(!r)throw di.create("no-app-id");if(!t.options.apiKey)if(t.options.measurementId)Yr.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${t.options.measurementId} provided in the "measurementId" field in the local Firebase config.`);else throw di.create("no-api-key");if(Df[r]!=null)throw di.create("already-exists",{id:r});if(!SR){pZ(r0);const{wrappedGtag:s,gtagCore:o}=yZ(Df,bR,wR,r0,OZ);V3=s,ER=o,SR=!0}
4138return Df[r]=IZ(t,bR,wR,e,ER,r0,n),new NZ(t)}function LZ(t=ly()){t=cn(t);const e=Ka(t,hv);return e.isInitialized()?e.getImmediate():FZ(t)}function FZ(t,e={}){const n=Ka(t,hv);if(n.isInitialized()){const i=n.getImmediate();if(Da(e,n.getOptions()))return i;throw di.create("already-initialized")}return n.initialize({options:e})}async function UZ(){if(hE()||!qD()||!pE())return!1;try{return await mE()}catch{return!1}}function Dy(t,e,n,r){t=cn(t),RZ(V3,Df[t.app.options.appId],e,n,r).catch(i=>Yr.error(i))}const TR="@firebase/analytics",AR="0.10.16";function jZ(){ns(new Ii(hv,(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("installations-internal").getImmediate();return kZ(r,i,n)},"PUBLIC")),ns(new Ii("analytics-internal",t,"PRIVATE")),Kr(TR,AR),Kr(TR,AR,"esm2017");function t(e){try{const n=e.getProvider(hv).getImmediate();return{logEvent:(r,i,s)=>Dy(n,r,i,s)}}catch(n){throw di.create("interop-component-reg-failed",{reason:n})}}}jZ();const z3={apiKey:"AIzaSyB1JDuB7Q7TIwwbm10Ee1oOimY12zcNYLs",authDomain:"phimecengineering.firebaseapp.com",projectId:"phimecengineering",storageBucket:"phimecengineering.firebasestorage.app",messagingSenderId:"200624392838",appId:"1:200624392838:web:fb30e1d8151c9ea4579f07",measurementId:"G-19FD5JMWVH"},ky=QD(z3),sf=Mq(ky),Et=MY(ky);vQ(ky);let MR=null;const uS=UZ().then(t=>(t&&z3.measurementId&&(MR=LZ(ky)),MR)).catch(()=>null),Uu=[{code:"en",name:"English",flag:"🇺🇸"},{code:"tr",name:"Türkçe",flag:"🇹🇷"},{code:"ar",name:"العربية",flag:"🇸🇦"}],BZ={en:!0,tr:!0,ar:!0};function H3(t){const e=Uu.filter(n=>(t==null?void 0:t[n.code])!==!1);return e.length>0?[...e]:[Uu[0]]}function Xp(t){return Uu.filter(e=>(t==null?void 0:t[e.code])!==!1).length}const G3="phimec-enabled-languages",VZ=()=>{try{const t=localStorage.getItem(G3);return t?JSON.parse(t):void 0}catch{return}},CR=t=>{const e=VZ();if(e)return H3(e);const n=(t||"en").split("-")[0];return[Uu.find(i=>i.code===n)??Uu[0]]},$3=O.createContext(void 0),ss=()=>{const t=O.useContext($3);if(!t)throw new Error("useLanguage must be used within a LanguageProvider");return t},zZ=({children:t})=>{const{i18n:e,t:n}=OD(),[r,i]=O.useState(()=>CR(e.language)),s=a=>{e.changeLanguage(a),localStorage.setItem("phimec-language",a),document.documentElement.lang=a,document.documentElement.dir=a==="ar"?"rtl":"ltr"},o=a=>{r.some(l=>l.code===a)&&s(a)};return O.useEffect(()=>{const a=_n(Et,"settings","main"),l=Oi(a,c=>{const d=c.exists()?c.data().enabledLanguages:void 0,f=H3(d);localStorage.setItem(G3,JSON.stringify(d??{})),i(f);const u=(e.language||"en").split("-")[0],h=f.map(g=>g.code);h.some(g=>g===u)||s(h[0])},()=>{i(CR(e.language))});return()=>l()},[]),_.jsx($3.Provider,{value:{language:e.language,changeLanguage:o,t:n,languageOptions:r},children:t})};function i0(t,e=80){return t.length>e?t.slice(0,e):t}async function HZ(t){const e=await uS;e&&Dy(e,"page_view",{page_path:t,page_title:document.title||"",page_location:window.location.href})}async function RR(t){const e=await uS;e&&Dy(e,"ui_interaction",{action:t.action,element:i0(t.element),text:i0(t.text||""),path:i0(t.path)})}async function xt(t,e){const n=await uS;n&&Dy(n,t,e)}const W3=O.createContext(void 0),Zh=()=>{const t=O.useContext(W3);if(!t)throw new Error("useAuth must be used within an AuthProvider");return t},GZ=({children:t})=>{const[e,n]=O.useState(null),[r,i]=O.useState(!0);O.useEffect(()=>Sk(sf,c=>{var d;n(c),i(!1),xt("auth_state_changed",{is_logged_in:!!c,provider_count:((d=c==null?void 0:c.providerData)==null?void 0:d.length)??0})}),[]);const s=async(l,c)=>{const d=await dW(sf,l,c);xt("admin_login_success",{email_domain:l.includes("@")?l.split("@")[1]:"unknown",uid:d.user.uid})},o=async()=>{await gW(sf),xt("admin_logout")},a=async(l,c)=>{const d=sf.currentUser;if(!(d!=null&&d.email))throw new Error("Oturum veya e-posta bulunamadı.");const f=Xl.credential(d.email,l);await cW(d,f),await fW(d,c),xt("admin_password_change_success")};return _.jsx(W3.Provider,{value:{user:e,loading:r,login:s,logout:o,changePassword:a},children:t})},dS=ny("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),rt=O.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},s)=>{const o=r?Ol:"button";return _.jsx(o,{className:Mt(dS({variant:e,size:n,className:t})),ref:s,...i})});rt.displayName="Button";var $Z=O.createContext(void 0);function fS(t){const e=O.useContext($Z);return t||e||"ltr"}var s0=0;function q3(){O.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??PR()),document.body.insertAdjacentElement("beforeend",t[1]??PR()),s0++,()=>{s0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e
vendor: 5,897 bytes, line 4138
4138=>e.remove()),s0--}},[])}function PR(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var o0="focusScope.autoFocusOnMount",a0="focusScope.autoFocusOnUnmount",IR={bubbles:!1,cancelable:!0},WZ="FocusScope",hS=O.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,l]=O.useState(null),c=Or(i),d=Or(s),f=O.useRef(null),u=hn(e,v=>l(v)),h=O.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;O.useEffect(()=>{if(r){let v=function(w){if(h.paused||!a)return;const x=w.target;a.contains(x)?f.current=x:$o(f.current,{select:!0})},m=function(w){if(h.paused||!a)return;const x=w.relatedTarget;x!==null&&(a.contains(x)||$o(f.current,{select:!0}))},p=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&$o(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",m);const y=new MutationObserver(p);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",m),y.disconnect()}}},[r,a,h.paused]),O.useEffect(()=>{if(a){OR.add(h);const v=document.activeElement;if(!a.contains(v)){const p=new CustomEvent(o0,IR);a.addEventListener(o0,c),a.dispatchEvent(p),p.defaultPrevented||(qZ(ZZ(K3(a)),{select:!0}),document.activeElement===v&&$o(a))}return()=>{a.removeEventListener(o0,c),setTimeout(()=>{const p=new CustomEvent(a0,IR);a.addEventListener(a0,d),a.dispatchEvent(p),p.defaultPrevented||$o(v??document.body,{select:!0}),a.removeEventListener(a0,d),OR.remove(h)},0)}}},[a,c,d,h]);const g=O.useCallback(v=>{if(!n&&!r||h.paused)return;const m=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,p=document.activeElement;if(m&&p){const y=v.currentTarget,[w,x]=KZ(y);w&&x?!v.shiftKey&&p===x?(v.preventDefault(),n&&$o(w,{select:!0})):v.shiftKey&&p===w&&(v.preventDefault(),n&&$o(x,{select:!0})):p===y&&v.preventDefault()}},[n,r,h.paused]);return _.jsx(kt.div,{tabIndex:-1,...o,ref:u,onKeyDown:g})});hS.displayName=WZ;function qZ(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if($o(r,{select:e}),document.activeElement!==n)return}function KZ(t){const e=K3(t),n=NR(e,t),r=NR(e.reverse(),t);return[n,r]}function K3(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function NR(t,e){for(const n of t)if(!XZ(n,{upTo:e}))return n}function XZ(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function YZ(t){return t instanceof HTMLInputElement&&"select"in t}function $o(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&YZ(t)&&e&&t.select()}}var OR=QZ();function QZ(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=DR(t,e),t.unshift(e)},remove(e){var n;t=DR(t,e),(n=t[0])==null||n.resume()}}}function DR(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function ZZ(t){return t.filter(e=>e.tagName!=="A")}function JZ(t,e=[]){let n=[];function r(s,o){const a=O.createContext(o),l=n.length;n=[...n,o];function c(f){const{scope:u,children:h,...g}=f,v=(u==null?void 0:u[t][l])||a,m=O.useMemo(()=>g,Object.values(g));return _.jsx(v.Provider,{value:m,children:h})}function d(f,u){const h=(u==null?void 0:u[t][l])||a,g=O.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,d]}const i=()=>{const s=n.map(o=>O.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return O.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,eJ(i,...e)]}function eJ(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(s)[`__scope${c}`];return{...a,...f}},{});return O.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var l0="rovingFocusGroup.onEntryFocus",tJ={bubbles:!1,cancelable:!0},Ly="RovingFocusGroup",[Hb,X3,nJ]=rE(Ly),[rJ,Fy]=JZ(Ly,[nJ]),[iJ,sJ]=rJ(Ly),Y3=O.forwardRef((t,e)=>_.jsx(Hb.Provider,{scope:t.__scopeRovingFocusGroup,children:_.jsx(Hb.Slot,{scope:t.__scopeRovingFocusGroup,children:_.jsx(oJ,{...t,ref:e})})}));Y3.displayName=Ly;var oJ=O.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...f}=t,u=O.useRef(null),h=hn(e,u),g=fS(s),[v=null,m]=Zu({prop:o,defaultProp:a,onChange:l}),[p,y]=O.useState(!1),w=Or(c),x=X3(n),S=O.useRef(!1),[I,M]=O.useState(0);return O.useEffect(()=>{const E=u.current;if(E)return E.addEventListener(l0,w),()=>E.removeEventListener(l0,w)},[w]),_.jsx(iJ,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:v,onItemFocus:O.useCallback(E=>m(E),[m]),onItemShiftTab:O.useCallback(()=>y(!0),[]),onFocusableItemAdd:O.useCallback(()=>M(E=>E+1),[]),onFocusableItemRemove:O.useCallback(()=>M(E=>E-1),[]),children:_.jsx(kt.div,{tabIndex:p||I===0?-1:0,"data-orientation":r,...f,ref:h,style:{outline:"none",...t.style},onMouseDown:tt(t.onMouseDown,()=>{S.current=!0}),onFocus:tt(t.onFocus,E=>{const C=!S.current;if(E.target===E.currentTarget&&C&&!p){const T=new CustomEvent(l0,tJ);if(E.currentTarget.dispatchEvent(T),!T.defaultPrevented){const A=x().filter(V=>V.focusable),R=A.find(V=>V.active),P=A.find(V=>
vendor: 3,900 bytes, line 4138
4138V.id===v),F=[R,P,...A].filter(Boolean).map(V=>V.ref.current);J3(F,d)}}S.current=!1}),onBlur:tt(t.onBlur,()=>y(!1))})})}),Q3="RovingFocusGroupItem",Z3=O.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,...o}=t,a=Al(),l=s||a,c=sJ(Q3,n),d=c.currentTabStopId===l,f=X3(n),{onFocusableItemAdd:u,onFocusableItemRemove:h}=c;return O.useEffect(()=>{if(r)return u(),()=>h()},[r,u,h]),_.jsx(Hb.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:_.jsx(kt.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...o,ref:e,onMouseDown:tt(t.onMouseDown,g=>{r?c.onItemFocus(l):g.preventDefault()}),onFocus:tt(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:tt(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){c.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const v=cJ(g,c.orientation,c.dir);if(v!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let p=f().filter(y=>y.focusable).map(y=>y.ref.current);if(v==="last")p.reverse();else if(v==="prev"||v==="next"){v==="prev"&&p.reverse();const y=p.indexOf(g.currentTarget);p=c.loop?uJ(p,y+1):p.slice(y+1)}setTimeout(()=>J3(p))}})})})});Z3.displayName=Q3;var aJ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lJ(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function cJ(t,e,n){const r=lJ(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return aJ[r]}function J3(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function uJ(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var eF=Y3,tF=Z3,dJ=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},cc=new WeakMap,Yp=new WeakMap,Qp={},c0=0,nF=function(t){return t&&(t.host||nF(t.parentNode))},fJ=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=nF(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},hJ=function(t,e,n,r){var i=fJ(e,Array.isArray(t)?t:[t]);Qp[n]||(Qp[n]=new WeakMap);var s=Qp[n],o=[],a=new Set,l=new Set(i),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};i.forEach(c);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(u){if(a.has(u))d(u);else try{var h=u.getAttribute(r),g=h!==null&&h!=="false",v=(cc.get(u)||0)+1,m=(s.get(u)||0)+1;cc.set(u,v),s.set(u,m),o.push(u),v===1&&g&&Yp.set(u,!0),m===1&&u.setAttribute(n,"true"),g||u.setAttribute(r,"true")}catch(p){console.error("aria-hidden: cannot operate on ",u,p)}})};return d(e),a.clear(),c0++,function(){o.forEach(function(f){var u=cc.get(f)-1,h=s.get(f)-1;cc.set(f,u),s.set(f,h),u||(Yp.has(f)||f.removeAttribute(r),Yp.delete(f)),h||f.removeAttribute(n)}),c0--,c0||(cc=new WeakMap,cc=new WeakMap,Yp=new WeakMap,Qp={})}},rF=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=dJ(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),hJ(r,i,n,"aria-hidden")):function(){return null}},Jm="right-scroll-bar-position",eg="width-before-scroll-bar",pJ="with-scroll-bars-hidden",mJ="--removed-body-scroll-bar-size";function u0(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function gJ(t,e){var n=O.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var vJ=typeof window<"u"?O.useLayoutEffect:O.useEffect,kR=new WeakMap;function yJ(t,e){var n=gJ(null,function(r){return t.forEach(function(i){return u0(i,r)})});return vJ(function(){var r=kR.get(n);if(r){var i=new Set(r),s=new Set(t),o=n.current;
vendor: 4,155 bytes, lines 4138-4153
4138i.forEach(function(a){s.has(a)||u0(a,null)}),s.forEach(function(a){i.has(a)||u0(a,o)})}kR.set(n,t)},[t]),n}function _J(t){return t}function xJ(t,e){e===void 0&&(e=_J);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var o=e(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var l=function(){var d=o;o=[],d.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){o.push(d),c()},filter:function(d){return o=o.filter(d),n}}}};return i}function bJ(t){t===void 0&&(t={});var e=xJ(null);return e.options=_s({async:!0,ssr:!1},t),e}var iF=function(t){var e=t.sideCar,n=Bh(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return O.createElement(r,_s({},n))};iF.isSideCarExport=!0;function wJ(t,e){return t.useMedium(e),iF}var sF=bJ(),d0=function(){},Uy=O.forwardRef(function(t,e){var n=O.useRef(null),r=O.useState({onScrollCapture:d0,onWheelCapture:d0,onTouchMoveCapture:d0}),i=r[0],s=r[1],o=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,f=t.shards,u=t.sideCar,h=t.noIsolation,g=t.inert,v=t.allowPinchZoom,m=t.as,p=m===void 0?"div":m,y=t.gapMode,w=Bh(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=u,S=yJ([n,e]),I=_s(_s({},w),i);return O.createElement(O.Fragment,null,d&&O.createElement(x,{sideCar:sF,removeScrollBar:c,shards:f,noIsolation:h,inert:g,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:y}),o?O.cloneElement(O.Children.only(a),_s(_s({},I),{ref:S})):O.createElement(p,_s({},I,{className:l,ref:S}),a))});Uy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Uy.classNames={fullWidth:eg,zeroRight:Jm};var EJ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function SJ(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=EJ();return e&&t.setAttribute("nonce",e),t}function TJ(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function AJ(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var MJ=function(){var t=0,e=null;return{add:function(n){t==0&&(e=SJ())&&(TJ(e,n),AJ(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},CJ=function(){var t=MJ();return function(e,n){O.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},oF=function(){var t=CJ(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},RJ={left:0,top:0,right:0,gap:0},f0=function(t){return parseInt(t||"",10)||0},PJ=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[f0(n),f0(r),f0(i)]},IJ=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return RJ;var e=PJ(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},NJ=oF(),iu="data-scroll-locked",OJ=function(t,e,n,r){var i=t.left,s=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),`
4139  .`.concat(pJ,` {
4140   overflow: hidden `).concat(r,`;
4141   padding-right: `).concat(a,"px ").concat(r,`;
4142  }
4143  body[`).concat(iu,`] {
4144    overflow: hidden `).concat(r,`;
4145    overscroll-behavior: contain;
4146    `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
4147    padding-left: `.concat(i,`px;
4148    padding-top: `).concat(s,`px;
4149    padding-right: `).concat(o,`px;
4150    margin-left:0;
4151    margin-top:0;
4152    margin-right: `).concat(a,"px ").concat(r,`;
4153    `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";
4153")].filter(Boolean).join(""),`
4154  }
4155  
4156  .`).concat(Jm,` {
4157    right: `).concat(a,"px ").concat(r,`;
4158  }
4159  
4160  .`).concat(eg,` {
4161    margin-right: `).concat(a,"px ").concat(r,`;
4162  }
4163  
4164  .`).concat(Jm," .").concat(Jm,` {
4165    right: 0 `).concat(r,`;
4166  }
4167  
4168  .`).concat(eg," .").concat(eg,` {
4169    margin-right: 0 `).concat(r,`;
4170  }
4171  
4172  body[`).concat(iu,`] {
4173    `).concat(mJ,": ").concat(a,`px;
4174  }
4175`)},LR=function(){var t=parseInt(document.body.getAttribute(iu)||"0",10);return isFinite(t)?t:0},DJ=function(){O.useEffect(function(){return document.body.setAttribute(iu,(LR()+1).toString()),function(){var t=LR()-1;t<=0?document.body.removeAttribute(iu):document.body.setAttribute(iu,t.toString())}},[])},kJ=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;DJ();var s=O.useMemo(function(){return IJ(i)},[i]);return O.createElement(NJ,{styles:OJ(s,!e,i,n?"":"!important")})},Gb=!1;if(typeof window<"u")try{var Zp=Object.defineProperty({},"passive",{get:function(){return Gb=!0,!0}});window.addEventListener("test",Zp,Zp),window.removeEventListener("test",Zp,Zp)}catch{Gb=!1}var uc=Gb?{passive:!1}:!1,LJ=function(t){return t.tagName==="TEXTAREA"},aF=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!LJ(t)&&n[e]==="visible")},FJ=function(t){return aF(t,"overflowY")},UJ=function(t){return aF(t,"overflowX")},FR=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=lF(t,r);if(i){var s=cF(t,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jJ=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},BJ=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},lF=function(t,e){return t==="v"?FJ(e):UJ(e)},cF=function(t,e){return t==="v"?jJ(e):BJ(e)},VJ=function(t,e){return t==="h"&&e==="rtl"?-1:1},zJ=function(t,e,n,r,i){var s=VJ(t,window.getComputedStyle(e).direction),o=s*r,a=n.target,l=e.contains(a),c=!1,d=o>0,f=0,u=0;do{var h=cF(t,a),g=h[0],v=h[1],m=h[2],p=v-m-s*g;(g||p)&&lF(t,a)&&(f+=p,u+=g),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&(Math.abs(f)<1||!i)||!d&&(Math.abs(u)<1||!i))&&(c=!0),c},Jp=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},UR=function(t){return[t.deltaX,t.deltaY]},jR=function(t){return t&&"current"in t?t.current:t},HJ=function(t,e){return t[0]===e[0]&&t[1]===e[1]},GJ=function(t){return`
4176  .block-interactivity-`.concat(t,` {pointer-events: none;}
4177  .allow-interactivity-`).concat(t,` {pointer-events: all;}
4178`)},$J=0,dc=[];function WJ(t){var e=O.useRef([]),n=O.useRef([0,0]),r=O.useRef(),i=O.useState($J++)[0],s=O.useState(oF)[0],o=O.useRef(t);O.useEffect(function(){o.current=t},[t]),O.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var v=f$([t.lockRef.current],(t.shards||[]).map(jR),!0).filter(Boolean);return v.forEach(function(m){return m.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=O.useCallback(function(v,m){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var p=Jp(v),y=n.current,w="deltaX"in v?v.deltaX:y[0]-p[0],x="deltaY"in v?v.deltaY:y[1]-p[1],S,I=v.target,M=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in v&&M==="h"&&I.type==="range")return!1;var E=FR(M,I);if(!E)return!0;if(E?S=M:(S=M==="v"?"h":"v",E=FR(M,I)),!E)return!1;if(!r.current&&"changedTouches"in v&&(w||x)&&(r.current=S),!S)return!0;var C=r.current||S;return zJ(C,m,v,C==="h"?w:x,!0)},[]),l=O.useCallback(function(v){var m=v;if(!(!dc.length||dc[dc.length-1]!==s)){var p="deltaY"in m?UR(m):Jp(m),y=e.current.filter(function(S){return S.name===m.type&&(S.target===m.target||m.target===S.shadowParent)&&HJ(S.delta,p)})[0];if(y&&y.should){m.cancelable&&m.preventDefault();return}
vendor: 16,828 bytes, line 4178
4178if(!y){var w=(o.current.shards||[]).map(jR).filter(Boolean).filter(function(S){return S.contains(m.target)}),x=w.length>0?a(m,w[0]):!o.current.noIsolation;x&&m.cancelable&&m.preventDefault()}}},[]),c=O.useCallback(function(v,m,p,y){var w={name:v,delta:m,target:p,should:y,shadowParent:qJ(p)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(x){return x!==w})},1)},[]),d=O.useCallback(function(v){n.current=Jp(v),r.current=void 0},[]),f=O.useCallback(function(v){c(v.type,UR(v),v.target,a(v,t.lockRef.current))},[]),u=O.useCallback(function(v){c(v.type,Jp(v),v.target,a(v,t.lockRef.current))},[]);O.useEffect(function(){return dc.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:u}),document.addEventListener("wheel",l,uc),document.addEventListener("touchmove",l,uc),document.addEventListener("touchstart",d,uc),function(){dc=dc.filter(function(v){return v!==s}),document.removeEventListener("wheel",l,uc),document.removeEventListener("touchmove",l,uc),document.removeEventListener("touchstart",d,uc)}},[]);var h=t.removeScrollBar,g=t.inert;return O.createElement(O.Fragment,null,g?O.createElement(s,{styles:GJ(i)}):null,h?O.createElement(kJ,{gapMode:t.gapMode}):null)}function qJ(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const KJ=wJ(sF,WJ);var pS=O.forwardRef(function(t,e){return O.createElement(Uy,_s({},t,{ref:e,sideCar:KJ}))});pS.classNames=Uy.classNames;var $b=["Enter"," "],XJ=["ArrowDown","PageUp","Home"],uF=["ArrowUp","PageDown","End"],YJ=[...XJ,...uF],QJ={ltr:[...$b,"ArrowRight"],rtl:[...$b,"ArrowLeft"]},ZJ={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Jh="Menu",[_h,JJ,eee]=rE(Jh),[Zl,dF]=qa(Jh,[eee,Xv,Fy]),jy=Xv(),fF=Fy(),[tee,Jl]=Zl(Jh),[nee,ep]=Zl(Jh),hF=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=t,a=jy(e),[l,c]=O.useState(null),d=O.useRef(!1),f=Or(s),u=fS(i);return O.useEffect(()=>{const h=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),_.jsx(jz,{...a,children:_.jsx(tee,{scope:e,open:n,onOpenChange:f,content:l,onContentChange:c,children:_.jsx(nee,{scope:e,onClose:O.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:u,modal:o,children:r})})})};hF.displayName=Jh;var ree="MenuAnchor",mS=O.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=jy(n);return _.jsx(NO,{...i,...r,ref:e})});mS.displayName=ree;var gS="MenuPortal",[iee,pF]=Zl(gS,{forceMount:void 0}),mF=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,s=Jl(gS,e);return _.jsx(iee,{scope:e,forceMount:n,children:_.jsx(is,{present:n||s.open,children:_.jsx(Yv,{asChild:!0,container:i,children:r})})})};mF.displayName=gS;var Ci="MenuContent",[see,vS]=Zl(Ci),gF=O.forwardRef((t,e)=>{const n=pF(Ci,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Jl(Ci,t.__scopeMenu),o=ep(Ci,t.__scopeMenu);return _.jsx(_h.Provider,{scope:t.__scopeMenu,children:_.jsx(is,{present:r||s.open,children:_.jsx(_h.Slot,{scope:t.__scopeMenu,children:o.modal?_.jsx(oee,{...i,ref:e}):_.jsx(aee,{...i,ref:e})})})})}),oee=O.forwardRef((t,e)=>{const n=Jl(Ci,t.__scopeMenu),r=O.useRef(null),i=hn(e,r);return O.useEffect(()=>{const s=r.current;if(s)return rF(s)},[]),_.jsx(yS,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:tt(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),aee=O.forwardRef((t,e)=>{const n=Jl(Ci,t.__scopeMenu);return _.jsx(yS,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),yS=O.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:u,onDismiss:h,disableOutsideScroll:g,...v}=t,m=Jl(Ci,n),p=ep(Ci,n),y=jy(n),w=fF(n),x=JJ(n),[S,I]=O.useState(null),M=O.useRef(null),E=hn(e,M,m.onContentChange),C=O.useRef(0),T=O.useRef(""),A=O.useRef(0),R=O.useRef(null),P=O.useRef("right"),D=O.useRef(0),F=g?pS:O.Fragment,V=g?{as:Ol,allowPinchZoom:!0}:void 0,H=B=>{var Q,Z;const G=T.current+B,k=x().filter(re=>!re.disabled),z=document.activeElement,q=(Q=k.find(re=>re.ref.current===z))==null?void 0:Q.textValue,ne=k.map(re=>re.textValue),ee=_ee(ne,G,q),j=(Z=k.find(re=>re.textValue===ee))==null?void 0:Z.ref.current;(function re(se){T.current=se,window.clearTimeout(C.current),se!==""&&(C.current=window.setTimeout(()=>re(""),1e3))})(G),j&&setTimeout(()=>j.focus())};O.useEffect(()=>()=>window.clearTimeout(C.current),[]),q3();const $=O.useCallback(B=>{var k,z;return P.current===((k=R.current)==null?void 0:k.side)&&bee(B,(z=R.current)==null?void 0:z.area)},[]);return _.jsx(see,{scope:n,searchRef:T,onItemEnter:O.useCallback(B=>{$(B)&&B.preventDefault()},[$]),onItemLeave:O.useCallback(B=>{var G;$(B)||((G=M.current)==null||G.focus(),I(null))},[$]),onTriggerLeave:O.useCallback(B=>{$(B)&&B.preventDefault()},[$]),pointerGraceTimerRef:A,onPointerGraceIntentChange:O.useCallback(B=>{R.current=B},[]),children:_.jsx(F,{...V,children:_.jsx(hS,{asChild:!0,trapped:i,onMountAutoFocus:tt(s,B=>{var G;B.preventDefault(),(G=M.current)==null||G.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:_.jsx(Dh,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:u,onDismiss:h,children:_.jsx(eF,{asChild:!0,...w,dir:p.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:I,onEntryFocus:tt(l,B=>{p.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:_.jsx(OO,{role:"menu","aria-orientation":"vertical","data-state":NF(m.open),"data-radix-menu-content":"",dir:p.dir,...y,...v,ref:E,style:{outline:"none",...v.style},onKeyDown:tt(v.onKeyDown,B=>{const k=B.target.closest("[data-radix-menu-content]")===B.currentTarget,z=B.ctrlKey||B.altKey||B.metaKey,q=B.key.length===1;k&&(B.key==="Tab"&&B.preventDefault(),!z&&q&&H(B.key));const ne=M.current;if(B.target!==ne||!YJ.includes(B.key))return;B.preventDefault();const j=x().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);uF.includes(B.key)&&j.reverse(),vee(j)}),onBlur:tt(t.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(C.current),T.current="")}),onPointerMove:tt(t.onPointerMove,xh(B=>{const G=B.target,k=D.current!==B.clientX;if(B.currentTarget.contains(G)&&k){const z=B.clientX>D.current?"right":"left";P.current=z,D.current=B.clientX}}))})})})})})})});gF.displayName=Ci;var lee="MenuGroup",_S=O.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return _.jsx(kt.div,{role:"group",...r,ref:e})});_S.displayName=lee;var cee="MenuLabel",vF=O.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return _.jsx(kt.div,{...r,ref:e})});vF.displayName=cee;var pv="MenuItem",BR="menu.itemSelect",By=O.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,s=O.useRef(null),o=ep(pv,t.__scopeMenu),a=vS(pv,t.__scopeMenu),l=hn(e,s),c=O.useRef(!1),d=()=>{const f=s.current;if(!n&&f){const u=new CustomEvent(BR,{bubbles:!0,cancelable:!0});f.addEventListener(BR,h=>r==null?void 0:r(h),{once:!0}),Ww(f,u),u.defaultPrevented?c.current=!1:o.onClose()}};return _.jsx(yF,{...i,ref:l,disabled:n,onClick:tt(t.onClick,d),onPointerDown:f=>{var u;(u=t.onPointerDown)==null||u.call(t,f),c.current=!0},onPointerUp:tt(t.onPointerUp,f=>{var u;c.current||(u=f.currentTarget)==null||u.click()}),onKeyDown:tt(t.onKeyDown,f=>{const u=a.searchRef.current!=="";n||u&&f.key===" "||$b.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});By.displayName=pv;var yF=O.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=t,o=vS(pv,n),a=fF(n),l=O.useRef(null),c=hn(e,l),[d,f]=O.useState(!1),[u,h]=O.useState("");return O.useEffect(()=>{const g=l.current;g&&h((g.textContent??"").trim())},[s.children]),_.jsx(_h.ItemSlot,{scope:n,disabled:r,textValue:i??u,children:_.jsx(tF,{asChild:!0,...a,focusable:!r,children:_.jsx(kt.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:tt(t.onPointerMove,xh(g=>{r?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:tt(t.onPointerLeave,xh(g=>o.onItemLeave(g))),onFocus:tt(t.onFocus,()=>f(!0)),onBlur:tt(t.onBlur,()=>f(!1))})})})}),uee="MenuCheckboxItem",_F=O.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return _.jsx(SF,{scope:t.__scopeMenu,checked:n,children:_.jsx(By,{role:"menuitemcheckbox","aria-checked":mv(n)?"mixed":n,...i,ref:e,"data-state":bS(n),onSelect:tt(i.onSelect,()=>r==null?void 0:r(mv(n)?!0:!n),{checkForDefaultPrevented:!1})})})});_F.displayName=uee;var xF="MenuRadioGroup",[dee,fee]=Zl(xF,{value:void 0,onValueChange:()=>{}}),bF=O.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,s=Or(r);return _.jsx(dee,{scope:t.__scopeMenu,value:n,onValueChange:s,children:_.jsx(_S,{...i,ref:e})})});bF.displayName=xF;var wF="MenuRadioItem",EF=O.forwardRef((t,e)=>{const{value:n,...r}=t,i=fee(wF,t.__scopeMenu),s=n===i.value;return _.jsx(SF,{scope:t.__scopeMenu,checked:s,children:_.jsx(By,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":bS(s),onSelect:tt(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});EF.displayName=wF;var xS="MenuItemIndicator",[SF,hee]=Zl(xS,{checked:!1}),TF=O.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,s=hee(xS,n);return _.jsx(is,{present:r||mv(s.checked)||s.checked===!0,children:_.jsx(kt.span,{...i,ref:e,"data-state":bS(s.checked)})})});TF.displayName=xS;var pee="MenuSeparator",AF=O.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return _.jsx(kt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});AF.displayName=pee;var mee="MenuArrow",MF=O.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=jy(n);return _.jsx(DO,{...i,...r,ref:e})});MF.displayName=mee;var gee="MenuSub",[Ege,CF]=Zl(gee),of="MenuSubTrigger",RF=O.forwardRef((t,e)=>{const n=Jl(of,t.__scopeMenu),r=ep(of,t.__scopeMenu),i=CF(of,t.__scopeMenu),s=vS(of,t.__scopeMenu),o=O.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:t.__scopeMenu},d=O.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return O.useEffect(()=>d,[d]),O.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),_.jsx(mS,{asChild:!0,...c,children:_.jsx(yF,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":NF(n.open),...t,ref:$v(e,i.onTriggerChange),onClick:f=>{var u;(u=t.onClick)==null||u.call(t,f),!(t.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:tt(t.onPointerMove,xh(f=>{s.onItemEnter(f),!f.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:tt(t.onPointerLeave,xh(f=>{var h,g;d();const u=(h=n.content)==null?void 0:h.getBoundingClientRect();if(u){const v=(g=n.content)==null?void 0:g.dataset.side,m=v==="right",p=m?-5:5,y=u[m?"left":"right"],w=u[m?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+p,y:f.clientY},{x:y,y:u.top},{x:w,y:u.top},{x:w,y:u.bottom},{x:y,y:u.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:tt(t.onKeyDown,f=>{var h;const u=s.searchRef.current!=="";t.disabled||u&&f.key===" "||QJ[r.dir].includes(f.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),f.preventDefault())})})})});RF.displayName=of;var PF="MenuSubContent",IF=O.forwardRef((t,e)=>{const n=pF(Ci,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Jl(Ci,t.__scopeMenu),o=ep(Ci,t.__scopeMenu),a=CF(PF,t.__scopeMenu),l=O.useRef(null),c=hn(e,l);return _.jsx(_h.Provider,{scope:t.__scopeMenu,children:_.jsx(is,{present:r||s.open,children:_.jsx(_h.Slot,{scope:t.__scopeMenu,children:_.jsx(yS,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:c,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;o.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:tt(t.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:tt(t.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:tt(t.onKeyDown,d=>{var h;const f=d.currentTarget.contains(d.target),u=ZJ[o.dir].includes(d.key);f&&u&&(s.onOpenChange(!1),(h=a.trigger)==null||h.focus(),d.preventDefault())})})})})})});IF.displayName=PF;function NF(t){return t?"open":"closed"}function mv(t){return t==="indeterminate"}function bS(t){return mv(t)?"indeterminate":t?"checked":"unchecked"}function vee(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function yee(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function _ee(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=yee(t,Math.max(s,0));i.length===1&&(o=o.filter(c=>c!==n));const l=o.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function xee(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s].x,l=e[s].y,c=e[o].x,d=e[o].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(i=!i)}return i}function bee(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return xee(n,e)}function xh(t){return e=>e.pointerType==="mouse"?t(e):void 0}var wee=hF,Eee=mS,See=mF,Tee=gF,Aee=_S,Mee=vF,Cee=By,Ree=_F,Pee=bF,Iee=EF,Nee=TF,Oee=AF,Dee=MF,kee=RF,Lee=IF,wS="DropdownMenu",[Fee,Sge]=qa(wS,[dF]),Fr=dF(),[Uee,OF]=Fee(wS),DF=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=t,l=Fr(e),c=O.useRef(null),[d=!1,f]=Zu({prop:i,defaultProp:s,onChange:o});return _.jsx(Uee,{scope:e,triggerId:Al(),triggerRef:c,contentId:Al(),open:d,onOpenChange:f,onOpenToggle:O.useCallback(()=>f(u=>!u),[f]),modal:a,children:_.jsx(wee,{...l,open:d,onOpenChange:f,dir:r,modal:a,children:n})})};DF.displayName=wS;var kF="DropdownMenuTrigger",LF=O.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,s=OF(kF,n),o=Fr(n);return _.jsx(Eee,{asChild:!0,...o,children:_.jsx(kt.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:$v(e,s.triggerRef),onPointerDown:tt(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:tt(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});LF.displayName=kF;var jee="DropdownMenuPortal",FF=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Fr(e);return _.jsx(See,{...r,...n})};FF.displayName=jee;var UF="DropdownMenuContent",jF=O.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=OF(UF,n),s=Fr(n),o=O.useRef(!1);return _.jsx(Tee,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:e,onCloseAutoFocus:tt(t.onCloseAutoFocus,a=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:tt(t.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!i.modal||d)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});jF.displayName=UF;var Bee="DropdownMenuGroup",Vee=O.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Fr(n);return _.jsx(Aee,{...i,...r,ref:e})});Vee.displayName=Bee;var zee="DropdownMenuLabel",BF=O.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Fr(n);return _.jsx(Mee,{...i,...r,ref:e})});BF.displayName=zee;var Hee="DropdownMenuItem",VF=O.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}
4178=t,i=Fr(n);return _.jsx(Cee,{...i,...r,ref:e})});VF.displayName=Hee;var Gee="DropdownMenuCheckboxItem",zF=O.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Fr(n);return _.jsx(Ree,{...i,...r,ref:e})});zF.displayName=Gee;var $ee="DropdownMenuRadioGroup",Wee=O.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Fr(n);return _.jsx(Pee,{...i,...r,ref:e})});Wee.displayName=$ee;var qee="DropdownMenuRadioItem",HF=O.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Fr(n);return _.jsx(Iee,{...i,...r,ref:e})});HF.displayName=qee;var Kee="DropdownMenuItemIndicator",GF=O.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Fr(n);return _.jsx(Nee,{...i,...r,ref:e})});GF.displayName=Kee;var Xee="DropdownMenuSeparator",$F=O.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Fr(n);return _.jsx(Oee,{...i,...r,ref:e})});$F.displayName=Xee;var Yee="DropdownMenuArrow",Qee=O.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Fr(n);return _.jsx(Dee,{...i,...r,ref:e})});Qee.displayName=Yee;var Zee="DropdownMenuSubTrigger",WF=O.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Fr(n);return _.jsx(kee,{...i,...r,ref:e})});WF.displayName=Zee;var Jee="DropdownMenuSubContent",qF=O.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Fr(n);return _.jsx(Lee,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});qF.displayName=Jee;var ete=DF,tte=LF,nte=FF,KF=jF,XF=BF,YF=VF,QF=zF,ZF=HF,JF=GF,eU=$F,tU=WF,nU=qF;const af=ete,lf=tte,rte=O.forwardRef(({className:t,inset:e,children:n,...r},i)=>_.jsxs(tU,{ref:i,className:Mt("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...r,children:[n,_.jsx(w8,{className:"ml-auto h-4 w-4"})]}));rte.displayName=tU.displayName;const ite=O.forwardRef(({className:t,...e},n)=>_.jsx(nU,{ref:n,className:Mt("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));ite.displayName=nU.displayName;const Gc=O.forwardRef(({className:t,sideOffset:e=4,...n},r)=>_.jsx(nte,{children:_.jsx(KF,{ref:r,sideOffset:e,className:Mt("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));Gc.displayName=KF.displayName;const yi=O.forwardRef(({className:t,inset:e,...n},r)=>_.jsx(YF,{ref:r,className:Mt("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));yi.displayName=YF.displayName;const ste=O.forwardRef(({className:t,children:e,checked:n,...r},i)=>_.jsxs(QF,{ref:i,className:Mt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(JF,{children:_.jsx(b8,{className:"h-4 w-4"})})}),e]}));ste.displayName=QF.displayName;const ote=O.forwardRef(({className:t,children:e,...n},r)=>_.jsxs(ZF,{ref:r,className:Mt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(JF,{children:_.jsx(E8,{className:"h-2 w-2 fill-current"})})}),e]}));ote.displayName=ZF.displayName;const ate=O.forwardRef(({className:t,inset:e,...n},r)=>_.jsx(XF,{ref:r,className:Mt("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));ate.displayName=XF.displayName;const lte=O.forwardRef(({className:t,...e},n)=>_.jsx(eU,{ref:n,className:Mt("-mx-1 my-1 h-px bg-muted",t),...e}));lte.displayName=eU.displayName;const cte=()=>{var h,g,v,m;const[t,e]=O.useState(!1),n=Vs(),{t:r,changeLanguage:i,language:s,languageOptions:o}=ss(),a=(s||"en").split("-")[0],{theme:l,setTheme:c}=RD(),d=[{name:r("nav.home"),href:"/"},{name:r("nav.services"),href:"/services"},{name:r("nav.projects"),href:"/projects"},{name:r("nav.blog"),href:"/blog"},{name:r("nav.contact"),href:"/contact"}],u={light:Af,dark:Tf,system:Sf}[l];return _.jsxs("nav",{className:"bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 border-b border-border sticky top-0 z-50",children:[_.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:_.jsxs("div",{className:"flex justify-between h-16",children:[_.jsx("div",{className:"flex items-center",children:_.jsx(kn,{to:"/",className:"flex-shrink-0 flex items-center",children:_.jsx("img",{src:"/logo.png",alt:"Phimec logo",className:"h-auto w-24 rounded-lg object-cover"})})}),_.jsx("div",{className:"hidden md:flex items-center space-x-8",children:d.map(p=>_.jsx(kn,{to:p.href,className:`px-3 py-2 rounded-md text-sm font-medium transition-colors ${n.pathname===p.href?"text-primary bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:p.name},p.name))}),_.jsxs("div",{className:"hidden md:flex items-center space-x-2",children:[o.length>1&&_.jsxs(af,{children:[_.jsx(lf,{asChild:!0,children:_.jsxs(rt,{variant:"ghost",size:"sm",children:[_.jsx(Vg,{className:"h-4 w-4 mr-1"}),((h=o.find(p=>p.code===a))==null?void 0:h.flag)??((g=o[0])==null?void 0:g.flag)]})}),_.jsx(Gc,{align:"end",className:"bg-popover border border-border",children:o.map(p=>_.jsxs(yi,{onClick:()=>i(p.code),className:"cursor-pointer hover:bg-accent",children:[_.jsx("span",{className:"mr-2",children:p.flag}),p.name]},p.code))})]}),_.jsxs(af,{children:[_.jsx(lf,{asChild:!0,children:_.jsx(rt,{variant:"ghost",size:"sm",children:_.jsx(u,{className:"h-4 w-4"})})}),_.jsxs(Gc,{align:"end",className:"bg-popover border border-border",children:[_.jsxs(yi,{onClick:()=>c("light"),className:"cursor-pointer hover:bg-accent",children:[_.jsx(Af,{className:"mr-2 h-4 w-4"}),"Light"]}),_.jsxs(yi,{onClick:()=>c("dark"),className:"cursor-pointer hover:bg-accent",children:[_.jsx(Tf,{className:"mr-2 h-4 w-4"}),"Dark"]}
4178),_.jsxs(yi,{onClick:()=>c("system"),className:"cursor-pointer hover:bg-accent",children:[_.jsx(Sf,{className:"mr-2 h-4 w-4"}),"System"]})]})]})]}),_.jsx("div",{className:"md:hidden flex items-center",children:_.jsx(rt,{variant:"ghost",size:"sm",onClick:()=>e(!t),children:t?_.jsx(Gl,{className:"h-6 w-6"}):_.jsx(yD,{className:"h-6 w-6"})})})]})}),t&&_.jsx("div",{className:"md:hidden border-t border-border",children:_.jsxs("div",{className:"px-2 pt-2 pb-3 space-y-1 bg-background",children:[d.map(p=>_.jsx(kn,{to:p.href,className:`block px-3 py-2 rounded-md text-base font-medium transition-colors ${n.pathname===p.href?"text-primary bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-accent"}`,onClick:()=>e(!1),children:p.name},p.name)),_.jsxs("div",{className:"flex items-center space-x-2 px-3 py-2",children:[o.length>1&&_.jsxs(af,{children:[_.jsx(lf,{asChild:!0,children:_.jsxs(rt,{variant:"ghost",size:"sm",children:[_.jsx(Vg,{className:"h-4 w-4 mr-1"}),((v=o.find(p=>p.code===a))==null?void 0:v.flag)??((m=o[0])==null?void 0:m.flag)]})}),_.jsx(Gc,{className:"bg-popover border border-border",children:o.map(p=>_.jsxs(yi,{onClick:()=>i(p.code),className:"cursor-pointer hover:bg-accent",children:[_.jsx("span",{className:"mr-2",children:p.flag}),p.name]},p.code))})]}),_.jsxs(af,{children:[_.jsx(lf,{asChild:!0,children:_.jsx(rt,{variant:"ghost",size:"sm",children:_.jsx(u,{className:"h-4 w-4"})})}),_.jsxs(Gc,{className:"bg-popover border border-border",children:[_.jsxs(yi,{onClick:()=>c("light"),className:"cursor-pointer hover:bg-accent",children:[_.jsx(Af,{className:"mr-2 h-4 w-4"}),"Light"]}),_.jsxs(yi,{onClick:()=>c("dark"),className:"cursor-pointer hover:bg-accent",children:[_.jsx(Tf,{className:"mr-2 h-4 w-4"}),"Dark"]}),_.jsxs(yi,{onClick:()=>c("system"),className:"cursor-pointer hover:bg-accent",children:[_.jsx(Sf,{className:"mr-2 h-4 w-4"}),"System"]})]})]})]})]})})]})},ute=()=>{const{t}=ss(),e=new Date().getFullYear(),[n,r]=O.useState([]);O.useEffect(()=>{(async()=>{const o=_n(Et,"settings","main"),a=await m3(o);a.exists()&&a.data().socialLinks&&r(a.data().socialLinks)})()},[]);const i={Linkedin:_.jsx(P8,{className:"h-5 w-5"}),Youtube:_.jsx(F8,{className:"h-5 w-5"}),Instagram:_.jsx(M8,{className:"h-5 w-5"}),Facebook:_.jsx(A8,{className:"h-5 w-5"}),Twitter:_.jsx(k8,{className:"h-5 w-5"}),Globe:_.jsx(Vg,{className:"h-5 w-5"})};return _.jsx("footer",{className:"relative bg-background border-t border-border py-10 px-4 sm:px-6 lg:px-8",children:_.jsxs("div",{className:"max-w-7xl mx-auto",children:[_.jsxs("div",{className:"flex flex-col gap-10 md:flex-row md:items-start md:justify-between text-left",children:[_.jsxs("div",{className:"max-w-lg",children:[_.jsx("div",{className:"flex items-center mb-4",children:_.jsx("img",{src:"/logo.png",alt:"Phimec logo",className:"h-auto w-24 rounded-lg object-cover"})}),_.jsx("p",{className:"text-muted-foreground mb-4",children:t("footer.description")}),_.jsx("div",{className:"flex flex-wrap gap-4",children:n.filter(s=>s.url).map((s,o)=>{const a=s.icon||s.platform;return _.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-primary transition-colors",children:i[a]||s.platform},s.platform+o)})})]}),_.jsxs("div",{className:"shrink-0 md:min-w-[12rem]",children:[_.jsx("h3",{className:"text-foreground font-semibold mb-4",children:"Quick Links"}),_.jsxs("ul",{className:"space-y-2",children:[_.jsx("li",{children:_.jsx(kn,{to:"/services",className:"text-muted-foreground hover:text-primary transition-colors",children:t("nav.services")})}),_.jsx("li",{children:_.jsx(kn,{to:"/projects",className:"text-muted-foreground hover:text-primary transition-colors",children:t("nav.projects")})}),_.jsx("li",{children:_.jsx(kn,{to:"/blog",className:"text-muted-foreground hover:text-primary transition-colors",children:t("nav.blog")})}),_.jsx("li",{children:_.jsx(kn,{to:"/contact",className:"text-muted-foreground hover:text-primary transition-colors",children:t("nav.contact")})})]})]})]}),_.jsx("div",{className:"border-t border-border mt-10 pt-8 text-center",children:_.jsx("p",{className:"text-muted-foreground text-sm mx-auto mb-2",style:{maxWidth:320},children:t("footer.rights",{year:e})})})]})})},ad=()=>{const{t}=ss();return _.jsx("div",{className:"min-h-screen flex items-center justify-center",children:_.jsxs("div",{className:"text-center",children:[_.jsx(I8,{className:"h-8 w-8 animate-spin text-primary mx-auto mb-4"}),_.jsx("p",{className:"text-muted-foreground",children:t("common.loading")})]})})},dte=()=>{const t=Vs(),{logout:e}=Zh(),[n,r]=O.useState(!1),i=async()=>{try{await e(),Rt({title:"Çıkış Yapıldı",description:"Başarıyla çıkış yaptınız."})}catch{Rt({title:"Hata",description:"Çıkış yapılamadı.",variant:"destructive"})}},s=[{path:"/admin/dashboard",label:"Dashboard",icon:_.jsx(vD,{size:20})},{path:"/admin/services",label:"Services",icon:_.jsx(Bg,{size:20})},{path:"/admin/projects",label:"Projects",icon:_.jsx(ah,{size:20})},{path:"/admin/blog",label:"Blog",icon:_.jsx(oh,{size:20})},{path:"/admin/contacts",label:"Contacts",icon:_.jsx(Mu,{size:20})},{path:"/admin/email-subscriptions",label:"Email Subscriptions",icon:_.jsx(ry,{size:20})},{path:"/admin/users",label:"Users",icon:_.jsx(Mu,{size:20})},{path:"/admin/settings",label:"Settings",icon:_.jsx(cE,{size:20})}];return _.jsxs(_.Fragment,{children:[_.jsx("button",{onClick:()=>r(!n),className:"md:hidden fixed top-4 left-4 z-50 p-2 bg-background border border-border rounded-md shadow-md","aria-label":"Toggle sidebar",children:n?_.
4178jsx(Gl,{size:24}):_.jsx(yD,{size:24})}),_.jsx("aside",{className:`fixed inset-y-0 left-0 w-64 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 border-r border-border shadow-md transform transition-transform duration-300 ease-in-out z-40
4179        ${n?"translate-x-0":"-translate-x-full md:translate-x-0"}`,children:_.jsxs("div",{className:"h-full flex flex-col",children:[_.jsx("div",{className:"p-6 border-b border-border",children:_.jsxs(kn,{to:"/admin/dashboard",className:"flex flex-col items-center space-y-2",children:[_.jsx("img",{src:"/logo.png",alt:"Logo",className:"h-auto w-24 rounded-lg object-cover"}),_.jsx("span",{className:"text-xl font-bold text-primary",children:"Admin Panel"})]})}),_.jsx("nav",{className:"flex-grow p-4 overflow-y-auto",children:_.jsx("ul",{className:"space-y-1",children:s.map(o=>_.jsx("li",{children:_.jsxs(kn,{to:o.path,className:`flex items-center px-4 py-3 rounded-md transition-colors text-sm font-medium ${t.pathname===o.path?"text-primary bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-accent"}`,onClick:()=>r(!1),children:[_.jsx("span",{className:"mr-3",children:o.icon}),_.jsx("span",{children:o.label})]})},o.path))})}),_.jsx("div",{className:"p-4 border-t border-border",children:_.jsxs("button",{onClick:i,className:"flex items-center w-full px-4 py-3 rounded-md text-muted-foreground hover:text-destructive hover:bg-accent transition-colors text-sm font-medium",children:[_.jsx(aE,{size:20,className:"mr-3"}),_.jsx("span",{children:"Logout"})]})})]})}),n&&_.jsx("div",{className:"fixed inset-0 bg-black/40 z-30 md:hidden",onClick:()=>r(!1)})]})},fte={light:Af,dark:Tf,system:Sf},hte=()=>{var h,g;const{theme:t,setTheme:e}=RD(),{language:n,changeLanguage:r,languageOptions:i}=ss(),s=(n||"en").split("-")[0],{logout:o}=Zh(),[a,l]=O.useState(!1),c=O.useRef(null),d=Oh(),f=fte[t],u=async()=>{try{await o(),Rt({title:"Çıkış Yapıldı",description:"Başarıyla çıkış yaptınız."}),d("/admin")}catch{Rt({title:"Hata",description:"Çıkış yapılamadı.",variant:"destructive"})}};return _.jsx("header",{className:"bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 border-b border-border fixed top-0 left-0 md:left-64 right-0 z-30",children:_.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 flex items-center justify-between",children:[_.jsx("h1",{className:"text-xl font-semibold text-foreground text-center select-none",children:_.jsx("span",{className:"hidden md:inline",children:"Admin Panel"})}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(kn,{to:"/",className:"p-2 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent transition-colors","aria-label":"Home",title:"Ana Sayfa",children:_.jsx(vD,{size:20})}),_.jsxs(af,{children:[_.jsx(lf,{asChild:!0,children:_.jsx(rt,{variant:"ghost",size:"sm",children:_.jsx(f,{className:"h-4 w-4"})})}),_.jsxs(Gc,{align:"end",className:"bg-popover border border-border",children:[_.jsxs(yi,{onClick:()=>e("light"),className:"cursor-pointer hover:bg-accent",children:[_.jsx(Af,{className:"mr-2 h-4 w-4"}),"Light"]}),_.jsxs(yi,{onClick:()=>e("dark"),className:"cursor-pointer hover:bg-accent",children:[_.jsx(Tf,{className:"mr-2 h-4 w-4"}),"Dark"]}),_.jsxs(yi,{onClick:()=>e("system"),className:"cursor-pointer hover:bg-accent",children:[_.jsx(Sf,{className:"mr-2 h-4 w-4"}),"System"]})]})]}),i.length>1&&_.jsxs("div",{className:"relative",children:[_.jsx("button",{type:"button",onClick:()=>l(v=>!v),className:"p-2 rounded-md text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-800","aria-label":"Change language",title:((h=i.find(v=>v.code===s))==null?void 0:h.name)??((g=i[0])==null?void 0:g.name),children:_.jsx(Vg,{size:20})}),a&&_.jsx("div",{ref:c,className:"absolute right-0 mt-2 bg-white dark:bg-zinc-900 rounded-md shadow-lg py-1 z-10 w-auto min-w-max",children:i.map(v=>_.jsxs("button",{type:"button",onClick:()=>{r(v.code),l(!1)},className:`block px-4 py-2 text-sm w-full text-center ${s===v.code?"text-primary":"text-zinc-700 dark:text-zinc-300"} hover:bg-zinc-100 dark:hover:bg-zinc-800`,children:[v.flag," ",v.name]},v.code))})]}),_.jsx("button",{onClick:u,className:"p-2 rounded-md text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-800","aria-label":"Logout",title:"Çıkış Yap",children:_.jsx(aE,{size:20})})]})]})})},pte=({children:t})=>_.jsxs("div",{className:"flex min-h-screen bg-background text-foreground",children:[_.jsx(dte,{}),_.jsxs("div",{className:"flex-1 flex flex-col min-h-screen md:ml-64",children:[_.jsx(hte,{}),_.jsx("main",{className:"flex-1 pt-16 px-2 sm:px-4 md:px-6 transition-all",children:t})]})]}),mte=({children:t})=>{const[e,n]=O.useState(null),[r,i]=O.useState(!0);return O.useEffect(()=>{const s=Sk(sf,o=>{n(o),i(!1)});return()=>s()},[]),r?_.jsx(ad,{}):e?_.jsx(_.Fragment,{children:t}):_.jsx(zw,{to:"/login",replace:!0})},gte=()=>{const t=Vs();return O.useEffect(()=>{HZ(`${t.pathname}${t.search}`)},[t.pathname,t.search]),O.useEffect(()=>{const e=r=>{const i=r.target;if(!i)return;
4179const s=i.closest('a,button,[role="button"],[data-analytics],input[type="button"],input[type="submit"]');if(!s)return;const o=(s.textContent||"").trim().replace(/\s+/g," "),a=s.getAttribute("data-analytics")||s.tagName.toLowerCase();RR({action:"click",element:a,text:o,path:`${t.pathname}${t.search}`})},n=r=>{const i=r.target;if(!i)return;const s=i.getAttribute("name")||i.getAttribute("id")||"form";RR({action:"submit",element:s,path:`${t.pathname}${t.search}`})};return document.addEventListener("click",e),document.addEventListener("submit",n,!0),()=>{document.removeEventListener("click",e),document.removeEventListener("submit",n,!0)}},[t.pathname,t.search]),null},on=O.forwardRef(({className:t,...e},n)=>_.jsx("div",{ref:n,className:Mt("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));on.displayName="Card";const wi=O.forwardRef(({className:t,...e},n)=>_.jsx("div",{ref:n,className:Mt("flex flex-col space-y-1.5 p-6",t),...e}));wi.displayName="CardHeader";const Ei=O.forwardRef(({className:t,...e},n)=>_.jsx("h3",{ref:n,className:Mt("text-2xl font-semibold leading-none tracking-tight",t),...e}));Ei.displayName="CardTitle";const vte=O.forwardRef(({className:t,...e},n)=>_.jsx("p",{ref:n,className:Mt("text-sm text-muted-foreground",t),...e}));vte.displayName="CardDescription";const an=O.forwardRef(({className:t,...e},n)=>_.jsx("div",{ref:n,className:Mt("p-6 pt-0",t),...e}));an.displayName="CardContent";const yte=O.forwardRef(({className:t,...e},n)=>_.jsx("div",{ref:n,className:Mt("flex items-center p-6 pt-0",t),...e}));yte.displayName="CardFooter";/**
4180 * @license
4181 * Copyright 2010-2026 Three.js Authors
4182 * SPDX-License-Identifier: MIT
4183 */const ES="183",su={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},$c={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},_te=0,VR=1,xte=2,tg=1,bte=2,cf=3,Va=0,Qr=1,no=2,uo=0,ou=1,zR=2,HR=3,GR=4,wte=5,dl=100,Ete=101,Ste=102,Tte=103,Ate=104,Mte=200,Cte=201,Rte=202,Pte=203,Wb=204,qb=205,Ite=206,Nte=207,Ote=208,Dte=209,kte=210,Lte=211,Fte=212,Ute=213,jte=214,Kb=0,Xb=1,Yb=2,ju=3,Qb=4,Zb=5,Jb=6,e1=7,rU=0,Bte=1,Vte=2,Rs=0,iU=1,sU=2,oU=3,aU=4,lU=5,cU=6,uU=7,dU=300,Bl=301,Bu=302,h0=303,p0=304,Vy=306,t1=1e3,ao=1001,n1=1002,tr=1003,zte=1004,em=1005,yr=1006,m0=1007,yl=1008,si=1009,fU=1010,hU=1011,bh=1012,SS=1013,Fs=1014,bs=1015,So=1016,TS=1017,AS=1018,wh=1020,pU=35902,mU=35899,gU=1021,vU=1022,Yi=1023,To=1026,_l=1027,yU=1028,MS=1029,Vu=1030,CS=1031,RS=1033,ng=33776,rg=33777,ig=33778,sg=33779,r1=35840,i1=35841,s1=35842,o1=35843,a1=36196,l1=37492,c1=37496,u1=37488,d1=37489,f1=37490,h1=37491,p1=37808,m1=37809,g1=37810,v1=37811,y1=37812,_1=37813,x1=37814,b1=37815,w1=37816,E1=37817,S1=37818,T1=37819,A1=37820,M1=37821,C1=36492,R1=36494,P1=36495,I1=36283,N1=36284,O1=36285,D1=36286,Hte=3200,_U=0,Gte=1,na="",_i="srgb",zu="srgb-linear",gv="linear",Xt="srgb",fc=7680,$R=519,$te=512,Wte=513,qte=514,PS=515,Kte=516,Xte=517,IS=518,Yte=519,WR=35044,qR="300 es",ws=2e3,Eh=2001;function Qte(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function vv(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Zte(){const t=vv("canvas");return t.style.display="block",t}const KR={};function XR(...t){const e="THREE."+t.shift();console.log(e,...t)}function xU(t){const e=t[0];if(typeof e=="string"&&e.startsWith("TSL:")){const n=t[1];n&&n.isStackTrace?t[0]+=" "+n.getLocation():t[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return t}function ut(...t){t=xU(t);const e="THREE."+t.shift();{const n=t[0];n&&n.isStackTrace?console.warn(n.getError(e)):console.warn(e,...t)}}function zt(...t){t=xU(t);const e="THREE."+t.shift();{const n=t[0];n&&n.isStackTrace?console.error(n.getError(e)):console.error(e,...t)}}function yv(...t){const e=t.join(" ");e in KR||(KR[e]=!0,ut(...t))}function Jte(t,e,n){return new Promise(function(r,i){function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:i();break;case t.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:r()}}setTimeout(s,n)})}const ene={[Kb]:Xb,[Yb]:Jb,[Qb]:e1,[ju]:Zb,[Xb]:Kb,[Jb]:Yb,[e1]:Qb,[Zb]:ju};class ec{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){const r=this._listeners;return r===void 0?!1:r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){const r=this._listeners;if(r===void 0)return;const i=r[e];if(i!==void 0){const s=i.indexOf(n);s!==-1&&i.splice(s,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const r=n[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let s=0,o=i.length;s<o;s++)i[s].call(this,e);e.target=null}}}const fr=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","5
41835","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let YR=1234567;const kf=Math.PI/180,Sh=180/Math.PI;function ld(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(fr[t&255]+fr[t>>8&255]+fr[t>>16&255]+fr[t>>24&255]+"-"+fr[e&255]+fr[e>>8&255]+"-"+fr[e>>16&15|64]+fr[e>>24&255]+"-"+fr[n&63|128]+fr[n>>8&255]+"-"+fr[n>>16&255]+fr[n>>24&255]+fr[r&255]+fr[r>>8&255]+fr[r>>16&255]+fr[r>>24&255]).toLowerCase()}function Ct(t,e,n){return Math.max(e,Math.min(n,t))}function NS(t,e){return(t%e+e)%e}function tne(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function nne(t,e,n){return t!==e?(n-t)/(e-t):0}function Lf(t,e,n){return(1-n)*t+n*e}function rne(t,e,n,r){return Lf(t,e,1-Math.exp(-n*r))}function ine(t,e=1){return e-Math.abs(NS(t,e*2)-e)}function sne(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function one(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function ane(t,e){return t+Math.floor(Math.random()*(e-t+1))}function lne(t,e){return t+Math.random()*(e-t)}function cne(t){return t*(.5-Math.random())}function une(t){t!==void 0&&(YR=t);let e=YR+=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 dne(t){return t*kf}function fne(t){return t*Sh}function hne(t){return(t&t-1)===0&&t!==0}function pne(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function mne(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function gne(t,e,n,r,i){const s=Math.cos,o=Math.sin,a=s(n/2),l=o(n/2),c=s((e+r)/2),d=o((e+r)/2),f=s((e-r)/2),u=o((e-r)/2),h=s((r-e)/2),g=o((r-e)/2);switch(i){case"XYX":t.set(a*d,l*f,l*u,a*c);break;case"YZY":t.set(l*u,a*d,l*f,a*c);break;case"ZXZ":t.set(l*f,l*u,a*d,a*c);break;case"XZX":t.set(a*d,l*g,l*h,a*c);break;case"YXY":t.set(l*h,a*d,l*g,a*c);break;case"ZYZ":t.set(l*g,l*h,a*d,a*c);break;default:ut("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Rc(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 Er(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 vne={DEG2RAD:kf,RAD2DEG:Sh,generateUUID:ld,clamp:Ct,euclideanModulo:NS,mapLinear:tne,inverseLerp:nne,lerp:Lf,damp:rne,pingpong:ine,smoothstep:sne,smootherstep:one,randInt:ane,randFloat:lne,randFloatSpread:cne,seededRandom:une,degToRad:dne,radToDeg:fne,isPowerOfTwo:hne,ceilPowerOfTwo:pne,floorPowerOfTwo:mne,setQuaternionFromProperEuler:gne,normalize:Er,denormalize:Rc};class _t{constructor(e=0,n=0){_t.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}
vendor: 37,994 bytes, line 4183
4183sub(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,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Ct(this.x,e.x,n.x),this.y=Ct(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=Ct(this.x,e,n),this.y=Ct(this.y,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Ct(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=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 r=this.dot(e)/n;return Math.acos(Ct(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,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 r=Math.cos(n),i=Math.sin(n),s=this.x-e.x,o=this.y-e.y;return this.x=s*r-o*i+e.x,this.y=s*i+o*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class za{constructor(e=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=r,this._w=i}static slerpFlat(e,n,r,i,s,o,a){let l=r[i+0],c=r[i+1],d=r[i+2],f=r[i+3],u=s[o+0],h=s[o+1],g=s[o+2],v=s[o+3];if(f!==v||l!==u||c!==h||d!==g){let m=l*u+c*h+d*g+f*v;m<0&&(u=-u,h=-h,g=-g,v=-v,m=-m);let p=1-a;if(m<.9995){const y=Math.acos(m),w=Math.sin(y);p=Math.sin(p*y)/w,a=Math.sin(a*y)/w,l=l*p+u*a,c=c*p+h*a,d=d*p+g*a,f=f*p+v*a}else{l=l*p+u*a,c=c*p+h*a,d=d*p+g*a,f=f*p+v*a;const y=1/Math.sqrt(l*l+c*c+d*d+f*f);l*=y,c*=y,d*=y,f*=y}}e[n]=l,e[n+1]=c,e[n+2]=d,e[n+3]=f}static multiplyQuaternionsFlat(e,n,r,i,s,o){const a=r[i],l=r[i+1],c=r[i+2],d=r[i+3],f=s[o],u=s[o+1],h=s[o+2],g=s[o+3];return e[n]=a*g+d*f+l*h-c*u,e[n+1]=l*g+d*u+c*f-a*h,e[n+2]=c*g+d*h+a*u-l*f,e[n+3]=d*g-a*f-l*u-c*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const r=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(r/2),d=a(i/2),f=a(s/2),u=l(r/2),h=l(i/2),g=l(s/2);switch(o){case"XYZ":this._x=u*d*f+c*h*g,this._y=c*h*f-u*d*g,this._z=c*d*g+u*h*f,this._w=c*d*f-u*h*g;break;case"YXZ":this._x=u*d*f+c*h*g,this._y=c*h*f-u*d*g,this._z=c*d*g-u*h*f,this._w=c*d*f+u*h*g;break;case"ZXY":this._x=u*d*f-c*h*g,this._y=c*h*f+u*d*g,this._z=c*d*g+u*h*f,this._w=c*d*f-u*h*g;break;case"ZYX":this._x=u*d*f-c*h*g,this._y=c*h*f+u*d*g,this._z=c*d*g-u*h*f,this._w=c*d*f+u*h*g;break;case"YZX":this._x=u*d*f+c*h*g,this._y=c*h*f+u*d*g,this._z=c*d*g-u*h*f,this._w=c*d*f-u*h*g;break;case"XZY":this._x=u*d*f-c*h*g,this._y=c*h*f-u*d*g,this._z=c*d*g+u*h*f,this._w=c*d*f+u*h*g;break;default:ut("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],s=n[8],o=n[1],a=n[5],l=n[9],c=n[2],d=n[6],f=n[10],u=r+a+f;if(u>0){const h=.5/Math.sqrt(u+1);this._w=.25/h,this._x=(d-l)*h,this._y=(s-c)*h,this._z=(o-i)*h}else if(r>a&&r>f){const h=2*Math.sqrt(1+r-a-f);this._w=(d-l)/h,this._x=.25*h,this._y=(i+o)/h,this._z=(s+c)/h}else if(a>f){const h=2*Math.sqrt(1+a-r-f);this._w=(s-c)/h,this._x=(i+o)/h,this._y=.25*h,this._z=(l+d)/h}else{const h=2*Math.sqrt(1+f-r-a);this._w=(o-i)/h,this._x=(s+c)/h,this._y=(l+d)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return r<1e-8?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*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=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ct(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,s=e._z,o=e._w,a=n._x,l=n._y,c=n._z,d=n._w;return this._x=r*d+o*a+i*c-s*l,this._y=i*d+o*l+s*a-r*c,this._z=s*d+o*c+r*l-i*a,this._w=o*d-r*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,n){let r=e._x,i=e._y,s=e._z,o=e._w,a=this.dot(e);a<0&&(r=-r,i=-i,s=-s,o=-o,a=-a);let l=1-n;if(a<.9995){const c=Math.acos(a),d=Math.sin(c);l=Math.sin(l*c)/d,n=Math.sin(n*c)/d,this._x=this._x*l+r*n,this._y=this._y*l+i*n,this._z=this._z*l+s*n,this._w=this._w*l+o*n,this._onChangeCallback()}else this._x=this._x*l+r*n,this._y=this._y*l+i*n,this._z=this._z*l+s*n,this._w=this._w*l+o*n,this.normalize();return this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),s=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(n),s*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class oe{constructor(e=0,n=0,r=0){oe.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,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(QR.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(QR.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*n+s[3]*r+s[6]*i,this.y=s[1]*n+s[4]*r+s[7]*i,this.z=s[2]*n+s[5]*r+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,s=e.elements,o=1/(s[3]*n+s[7]*r+s[11]*i+s[15]);return this.x=(s[0]*n+s[4]*r+s[8]*i+s[12])*o,this.y=(s[1]*n+s[5]*r+s[9]*i+s[13])*o,this.z=(s[2]*n+s[6]*r+s[10]*i+s[14])*o,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*i-a*r),d=2*(a*n-s*i),f=2*(s*r-o*n);return this.x=n+l*c+o*f-a*d,this.y=r+l*d+a*c-s*f,this.z=i+l*f+s*d-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*n+s[4]*r+s[8]*i,this.y=s[1]*n+s[5]*r+s[9]*i,this.z=s[2]*n+s[6]*r+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Ct(this.x,e.x,n.x),this.y=Ct(this.y,e.y,n.y),this.z=Ct(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=Ct(this.x,e,n),this.y=Ct(this.y,e,n),this.z=Ct(this.z,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Ct(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=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,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,s=e.z,o=n.x,a=n.y,l=n.z;return this.x=i*l-s*a,this.y=s*o-r*l,this.z=r*a-i*o,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return g0.copy(this).projectOnVector(e),this.sub(g0)}reflect(e){return this.sub(g0.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 r=this.dot(e)/n;return Math.acos(Ct(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,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(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(e),this.y=n,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const g0=new oe,QR=new za;class wt{constructor(e,n,r,i,s,o,a,l,c){wt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,s,o,a,l,c)}set(e,n,r,i,s,o,a,l,c){const d=this.elements;return d[0]=e,d[1]=i,d[2]=a,d[3]=n,d[4]=s,d[5]=l,d[6]=r,d[7]=o,d[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.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 r=e.elements,i=n.elements,s=this.elements,o=r[0],a=r[3],l=r[6],c=r[1],d=r[4],f=r[7],u=r[2],h=r[5],g=r[8],v=i[0],m=i[3],p=i[6],y=i[1],w=i[4],x=i[7],S=i[2],I=i[5],M=i[8];return s[0]=o*v+a*y+l*S,s[3]=o*m+a*w+l*I,s[6]=o*p+a*x+l*M,s[1]=c*v+d*y+f*S,s[4]=c*m+d*w+f*I,s[7]=c*p+d*x+f*M,s[2]=u*v+h*y+g*S,s[5]=u*m+h*w+g*I,s[8]=u*p+h*x+g*M,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],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8];return n*o*d-n*a*c-r*s*d+r*a*l+i*s*c-i*o*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=d*o-a*c,u=a*l-d*s,h=c*s-o*l,g=n*f+r*u+i*h;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/g;return e[0]=f*v,e[1]=(i*c-d*r)*v,e[2]=(a*r-i*o)*v,e[3]=u*v,e[4]=(d*n-i*l)*v,e[5]=(i*s-a*n)*v,e[6]=h*v,e[7]=(r*l-c*n)*v,e[8]=(o*n-r*s)*v,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,r,i,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(r*l,r*c,-r*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+n,0,0,1),this}scale(e,n){return this.premultiply(v0.makeScale(e,n)),this}rotate(e){return this.premultiply(v0.makeRotation(-e)),this}translate(e,n){return this.premultiply(v0.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),r=Math.sin(e);return this.set(n,-r,0,r,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,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const v0=new wt,ZR=new wt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),JR=new wt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function yne(){const t={enabled:!0,workingColorSpace:zu,spaces:{},convert:function(i,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===Xt&&(i.r=fo(i.r),i.g=fo(i.g),i.b=fo(i.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(i.applyMatrix3(this.spaces[s].toXYZ),i.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===Xt&&(i.r=au(i.r),i.g=au(i.g),i.b=au(i.b))),i},workingToColorSpace:function(i,s){return this.convert(i,this.workingColorSpace,s)},colorSpaceToWorking:function(i,s){return this.convert(i,s,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===na?gv:this.spaces[i].transfer},getToneMappingMode:function(i){return this.spaces[i].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(i,s=this.workingColorSpace){return i.fromArray(this.spaces[s].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,s,o){return i.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,s){return yv("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(i,s)},toWorkingColorSpace:function(i,s){return yv("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(i,s)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return t.define({[zu]:{primaries:e,whitePoint:r,transfer:gv,toXYZ:ZR,fromXYZ:JR,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:_i},outputColorSpaceConfig:{drawingBufferColorSpace:_i}},[_i]:{primaries:e,whitePoint:r,transfer:Xt,toXYZ:ZR,fromXYZ:JR,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:_i}}}),t}const Ft=yne();function fo(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function au(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let hc;class _ne{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let r;if(e instanceof HTMLCanvasElement)r=e;else{hc===void 0&&(hc=vv("canvas")),hc.width=e.width,hc.height=e.height;const i=hc.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),r=hc}return r.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=vv("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=fo(s[o]/255)*255;return r.putImageData(i,0,0),n}else if(e.data){const n=e.data.slice(0);for(let r=0;r<n.length;r++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[r]=Math.floor(fo(n[r]/255)*255):n[r]=fo(n[r]);return{data:n,width:e.width,height:e.height}}else return ut("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let xne=0;class OS{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:xne++}),this.uuid=ld(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const n=this.data;return typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement?e.set(n.videoWidth,n.videoHeight,0):typeof VideoFrame<"u"&&n instanceof VideoFrame?e.set(n.displayHeight,n.displayWidth,0):n!==null?e.set(n.width,n.height,n.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const r={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o<a;o++)i[o].isDataTexture?s.push(y0(i[o].image)):s.push(y0(i[o]))}else s=y0(i);r.url=s}return n||(e.images[this.uuid]=r),r}}function y0(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?_ne.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(ut("Texture: Unable to serialize Texture."),{})}let bne=0;const _0=new oe;class Ir extends ec{constructor(e=Ir.DEFAULT_IMAGE,n=Ir.DEFAULT_MAPPING,r=ao,i=ao,s=yr,o=yl,a=Yi,l=si,c=Ir.DEFAULT_ANISOTROPY,d=na){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:bne++}),this.uuid=ld(),this.name="",this.source=new OS(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new _t(0,0),this.repeat=new _t(1,1),this.center=new _t(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new wt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=d,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(_0).x}get height(){return this.source.getSize(_0).y}get depth(){return this.source.getSize(_0).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const r=e[n];if(r===void 0){ut(`Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){ut(`Texture.setValues(): property '${n}' does not exist.`);continue}i&&r&&i.isVector2&&r.isVector2||i&&r&&i.isVector3&&r.isVector3||i&&r&&i.isMatrix3&&r.isMatrix3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const r={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==dU)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case t1:e.x=e.x-Math.floor(e.x);break;case ao:e.x=e.x<0?0:1;break;case n1: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 t1:e.y=e.y-Math.floor(e.y);break;case ao:e.y=e.y<0?0:1;break;case n1:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Ir.DEFAULT_IMAGE=null;Ir.DEFAULT_MAPPING=dU;Ir.DEFAULT_ANISOTROPY=1;class An{constructor(e=0,n=0,r=0,i=1){An.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i+o[12]*s,this.y=o[1]*n+o[5]*r+o[9]*i+o[13]*s,this.z=o[2]*n+o[6]*r+o[10]*i+o[14]*s,this.w=o[3]*n+o[7]*r+o[11]*i+o[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);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,r,i,s;const l=e.elements,c=l[0],d=l[4],f=l[8],u=l[1],h=l[5],g=l[9],v=l[2],m=l[6],p=l[10];if(Math.abs(d-u)<.01&&Math.abs(f-v)<.01&&Math.abs(g-m)<.01){if(Math.abs(d+u)<.1&&Math.abs(f+v)<.1&&Math.abs(g+m)<.1&&Math.abs(c+h+p-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const w=(c+1)/2,x=(h+1)/2,S=(p+1)/2,I=(d+u)/4,M=(f+v)/4,E=(g+m)/4;return w>x&&w>S?w<.01?(r=0,i=.707106781,s=.707106781):(r=Math.sqrt(w),i=I/r,s=M/r):x>S?x<.01?(r=.707106781,i=0,s=.707106781):(i=Math.sqrt(x),r=I/i,s=E/i):S<.01?(r=.707106781,i=.707106781,s=0):(s=Math.sqrt(S),r=M/s,i=E/s),this.set(r,i,s,n),this}let y=Math.sqrt((m-g)*(m-g)+(f-v)*(f-v)+(u-d)*(u-d));return Math.abs(y)<.001&&(y=1),this.x=(m-g)/y,this.y=(f-v)/y,this.z=(u-d)/y,this.w=Math.acos((c+h+p-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Ct(this.x,e.x,n.x),this.y=Ct(this.y,e.y,n.y),this.z=Ct(this.z,e.z,n.z),this.w=Ct(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=Ct(this.x,e,n),this.y=Ct(this.y,e,n),this.z=Ct(this.z,e,n),this.w=Ct(this.w,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Ct(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=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,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,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 wne extends ec{constructor(e=1,n=1,r={}){super(),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:yr,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},r),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=r.depth,this.scissor=new An(0,0,e,n),this.scissorTest=!1,this.viewport=new An(0,0,e,n),this.textures=[];const i={width:e,height:n,depth:r.depth},s=new Ir(i),o=r.count;for(let a=0;a<o;a++)this.textures[a]=s.clone(),this.textures[a].isRenderTargetTexture=!0,this.textures[a].renderTarget=this;this._setTextureOptions(r),this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.resolveDepthBuffer=r.resolveDepthBuffer,this.resolveStencilBuffer=r.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=r.depthTexture,this.samples=r.samples,this.multiview=r.multiview}_setTextureOptions(e={}){const n={minFilter:yr,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(n.mapping=e.mapping),e.wrapS!==void 0&&(n.wrapS=e.wrapS),e.wrapT!==void 0&&(n.wrapT=e.wrapT),e.wrapR!==void 0&&(n.wrapR=e.wrapR),e.magFilter!==void 0&&(n.magFilter=e.magFilter),e.minFilter!==void 0&&(n.minFilter=e.minFilter),e.format!==void 0&&(n.format=e.format),e.type!==void 0&&(n.type=e.type),e.anisotropy!==void 0&&(n.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(n.colorSpace=e.colorSpace),e.flipY!==void 0&&(n.flipY=e.flipY),e.generateMipmaps!==void 0&&(n.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(n.internalFormat=e.internalFormat);for(let r=0;r<this.textures.length;r++)this.textures[r].setValues(n)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,n,r=1){if(this.width!==e||this.height!==n||this.depth!==r){this.width=e,this.height=n,this.depth=r;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=e,this.textures[i].image.height=n,this.textures[i].image.depth=r,this.textures[i].isData3DTexture!==!0&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);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.textures.length=0;for(let n=0,r=e.textures.length;n<r;n++){this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0,this.textures[n].renderTarget=this;const i=Object.assign({},e.textures[n].image);this.textures[n].source=new OS(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ps extends wne{constructor(e=1,n=1,r={}){super(e,n,r),this.isWebGLRenderTarget=!0}}class bU extends Ir{constructor(e=null,n=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=tr,this.minFilter=tr,this.wrapR=ao,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Ene extends Ir{constructor(e=null,n=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=tr,this.minFilter=tr,this.wrapR=ao,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class xn{constructor(e,n,r,i,s,o,a,l,c,d,f,u,h,g,v,m){xn.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,r,i,s,o,a,l,c,d,f,u,h,g,v,m)}set(e,n,r,i,s,o,a,l,c,d,f,u,h,g,v,m){const p=this.elements;return p[0]=e,p[4]=n,p[8]=r,p[12]=i,p[1]=s,p[5]=o,p[9]=a,p[13]=l,p[2]=c,p[6]=d,p[10]=f,p[14]=u,p[3]=h,p[7]=g,p[11]=v,p[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new xn().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[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,r){return this.determinant()===0?(e.set(1,0,0),n.set(0,1,0),r.set(0,0,1),this):(e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this)}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const n=this.elements,r=e.elements,i=1/pc.setFromMatrixColumn(e,0).length(),s=1/pc.setFromMatrixColumn(e,1).length(),o=1/pc.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*s,n[5]=r[5]*s,n[6]=r[6]*s,n[7]=0,n[8]=r[8]*o,n[9]=r[9]*o,n[10]=r[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,s=e.z,o=Math.cos(r),a=Math.sin(r),l=Math.cos(i),c=Math.sin(i),d=Math.cos(s),f=Math.sin(s);if(e.order==="XYZ"){const u=o*d,h=o*f,g=a*d,v=a*f;n[0]=l*d,n[4]=-l*f,n[8]=c,n[1]=h+g*c,n[5]=u-v*c,n[9]=-a*l,n[2]=v-u*c,n[6]=g+h*c,n[10]=o*l}else if(e.order==="YXZ"){const u=l*d,h=l*f,g=c*d,v=c*f;n[0]=u+v*a,n[4]=g*a-h,n[8]=o*c,n[1]=o*f,n[5]=o*d,n[9]=-a,n[2]=h*a-g,n[6]=v+u*a,n[10]=o*l}else if(e.order==="ZXY"){const u=l*d,h=l*f,g=c*d,v=c*f;n[0]=u-v*a,n[4]=-o*f,n[8]=g+h*a,n[1]=h+g*a,n[5]=o*d,n[9]=v-u*a,n[2]=-o*c,n[6]=a,n[10]=o*l}else if(e.order==="ZYX"){const u=o*d,h=o*f,g=a*d,v=a*f;n[0]=l*d,n[4]=g*c-h,n[8]=u*c+v,n[1]=l*f,n[5]=v*c+u,n[9]=h*c-g,n[2]=-c,n[6]=a*l,n[10]=o*l}else if(e.order==="YZX"){const u=o*l,h=o*c,g=a*l,v=a*c;
vendor: 4,926 bytes, line 4183
4183n[0]=l*d,n[4]=v-u*f,n[8]=g*f+h,n[1]=f,n[5]=o*d,n[9]=-a*d,n[2]=-c*d,n[6]=h*f+g,n[10]=u-v*f}else if(e.order==="XZY"){const u=o*l,h=o*c,g=a*l,v=a*c;n[0]=l*d,n[4]=-f,n[8]=c*d,n[1]=u*f+v,n[5]=o*d,n[9]=h*f-g,n[2]=g*f-h,n[6]=a*d,n[10]=v*f+u}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(Sne,e,Tne)}lookAt(e,n,r){const i=this.elements;return Jr.subVectors(e,n),Jr.lengthSq()===0&&(Jr.z=1),Jr.normalize(),Uo.crossVectors(r,Jr),Uo.lengthSq()===0&&(Math.abs(r.z)===1?Jr.x+=1e-4:Jr.z+=1e-4,Jr.normalize(),Uo.crossVectors(r,Jr)),Uo.normalize(),tm.crossVectors(Jr,Uo),i[0]=Uo.x,i[4]=tm.x,i[8]=Jr.x,i[1]=Uo.y,i[5]=tm.y,i[9]=Jr.y,i[2]=Uo.z,i[6]=tm.z,i[10]=Jr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,s=this.elements,o=r[0],a=r[4],l=r[8],c=r[12],d=r[1],f=r[5],u=r[9],h=r[13],g=r[2],v=r[6],m=r[10],p=r[14],y=r[3],w=r[7],x=r[11],S=r[15],I=i[0],M=i[4],E=i[8],C=i[12],T=i[1],A=i[5],R=i[9],P=i[13],D=i[2],F=i[6],V=i[10],H=i[14],$=i[3],B=i[7],G=i[11],k=i[15];return s[0]=o*I+a*T+l*D+c*$,s[4]=o*M+a*A+l*F+c*B,s[8]=o*E+a*R+l*V+c*G,s[12]=o*C+a*P+l*H+c*k,s[1]=d*I+f*T+u*D+h*$,s[5]=d*M+f*A+u*F+h*B,s[9]=d*E+f*R+u*V+h*G,s[13]=d*C+f*P+u*H+h*k,s[2]=g*I+v*T+m*D+p*$,s[6]=g*M+v*A+m*F+p*B,s[10]=g*E+v*R+m*V+p*G,s[14]=g*C+v*P+m*H+p*k,s[3]=y*I+w*T+x*D+S*$,s[7]=y*M+w*A+x*F+S*B,s[11]=y*E+w*R+x*V+S*G,s[15]=y*C+w*P+x*H+S*k,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],r=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],d=e[2],f=e[6],u=e[10],h=e[14],g=e[3],v=e[7],m=e[11],p=e[15],y=l*h-c*u,w=a*h-c*f,x=a*u-l*f,S=o*h-c*d,I=o*u-l*d,M=o*f-a*d;return n*(v*y-m*w+p*x)-r*(g*y-m*S+p*I)+i*(g*w-v*S+p*M)-s*(g*x-v*I+m*M)}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,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=e[9],u=e[10],h=e[11],g=e[12],v=e[13],m=e[14],p=e[15],y=n*a-r*o,w=n*l-i*o,x=n*c-s*o,S=r*l-i*a,I=r*c-s*a,M=i*c-s*l,E=d*v-f*g,C=d*m-u*g,T=d*p-h*g,A=f*m-u*v,R=f*p-h*v,P=u*p-h*m,D=y*P-w*R+x*A+S*T-I*C+M*E;if(D===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const F=1/D;return e[0]=(a*P-l*R+c*A)*F,e[1]=(i*R-r*P-s*A)*F,e[2]=(v*M-m*I+p*S)*F,e[3]=(u*I-f*M-h*S)*F,e[4]=(l*T-o*P-c*C)*F,e[5]=(n*P-i*T+s*C)*F,e[6]=(m*x-g*M-p*w)*F,e[7]=(d*M-u*x+h*w)*F,e[8]=(o*R-a*T+c*E)*F,e[9]=(r*T-n*R-s*E)*F,e[10]=(g*I-v*x+p*y)*F,e[11]=(f*x-d*I-h*y)*F,e[12]=(a*C-o*A-l*E)*F,e[13]=(n*A-r*C+i*E)*F,e[14]=(v*w-g*S-m*y)*F,e[15]=(d*S-f*w+u*y)*F,this}scale(e){const n=this.elements,r=e.x,i=e.y,s=e.z;return n[0]*=r,n[4]*=i,n[8]*=s,n[1]*=r,n[5]*=i,n[9]*=s,n[2]*=r,n[6]*=i,n[10]*=s,n[3]*=r,n[7]*=i,n[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),s=1-r,o=e.x,a=e.y,l=e.z,c=s*o,d=s*a;return this.set(c*o+r,c*a-i*l,c*l+i*a,0,c*a+i*l,d*a+r,d*l-i*o,0,c*l-i*a,d*l+i*o,s*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,s,o){return this.set(1,r,s,0,e,1,o,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,s=n._x,o=n._y,a=n._z,l=n._w,c=s+s,d=o+o,f=a+a,u=s*c,h=s*d,g=s*f,v=o*d,m=o*f,p=a*f,y=l*c,w=l*d,x=l*f,S=r.x,I=r.y,M=r.z;return i[0]=(1-(v+p))*S,i[1]=(h+x)*S,i[2]=(g-w)*S,i[3]=0,i[4]=(h-x)*I,i[5]=(1-(u+p))*I,i[6]=(m+y)*I,i[7]=0,i[8]=(g+w)*M,i[9]=(m-y)*M,i[10]=(1-(u+v))*M,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;e.x=i[12],e.y=i[13],e.z=i[14];const s=this.determinant();if(s===0)return r.set(1,1,1),n.identity(),this;let o=pc.set(i[0],i[1],i[2]).length();const a=pc.set(i[4],i[5],i[6]).length(),l=pc.set(i[8],i[9],i[10]).length();s<0&&(o=-o),ji.copy(this);const c=1/o,d=1/a,f=1/l;return ji.elements[0]*=c,ji.elements[1]*=c,ji.elements[2]*=c,ji.elements[4]*=d,ji.elements[5]*=d,ji.elements[6]*=d,ji.elements[8]*=f,
vendor: 14,536 bytes, line 4183
4183ji.elements[9]*=f,ji.elements[10]*=f,n.setFromRotationMatrix(ji),r.x=o,r.y=a,r.z=l,this}makePerspective(e,n,r,i,s,o,a=ws,l=!1){const c=this.elements,d=2*s/(n-e),f=2*s/(r-i),u=(n+e)/(n-e),h=(r+i)/(r-i);let g,v;if(l)g=s/(o-s),v=o*s/(o-s);else if(a===ws)g=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===Eh)g=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=d,c[4]=0,c[8]=u,c[12]=0,c[1]=0,c[5]=f,c[9]=h,c[13]=0,c[2]=0,c[6]=0,c[10]=g,c[14]=v,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,n,r,i,s,o,a=ws,l=!1){const c=this.elements,d=2/(n-e),f=2/(r-i),u=-(n+e)/(n-e),h=-(r+i)/(r-i);let g,v;if(l)g=1/(o-s),v=o/(o-s);else if(a===ws)g=-2/(o-s),v=-(o+s)/(o-s);else if(a===Eh)g=-1/(o-s),v=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=d,c[4]=0,c[8]=0,c[12]=u,c[1]=0,c[5]=f,c[9]=0,c[13]=h,c[2]=0,c[6]=0,c[10]=g,c[14]=v,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const pc=new oe,ji=new xn,Sne=new oe(0,0,0),Tne=new oe(1,1,1),Uo=new oe,tm=new oe,Jr=new oe,eP=new xn,tP=new za;class Us{constructor(e=0,n=0,r=0,i=Us.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],d=i[9],f=i[2],u=i[6],h=i[10];switch(n){case"XYZ":this._y=Math.asin(Ct(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-d,h),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(u,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ct(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ct(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-f,h),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ct(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(u,h),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ct(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,c),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-Ct(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(u,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-d,h),this._y=0);break;default:ut("Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return eP.makeRotationFromQuaternion(e),this.setFromRotationMatrix(eP,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return tP.setFromEuler(this),this.setFromQuaternion(tP,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}}Us.DEFAULT_ORDER="XYZ";class wU{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let Ane=0;const nP=new oe,mc=new za,Ks=new xn,nm=new oe,jd=new oe,Mne=new oe,Cne=new za,rP=new oe(1,0,0),iP=new oe(0,1,0),sP=new oe(0,0,1),oP={type:"added"},Rne={type:"removed"},gc={type:"childadded",child:null},x0={type:"childremoved",child:null};class Yn extends ec{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Ane++}),this.uuid=ld(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Yn.DEFAULT_UP.clone();const e=new oe,n=new Us,r=new za,i=new oe(1,1,1);function s(){r.setFromEuler(n,!1)}function o(){n.setFromQuaternion(r,void 0,!1)}n._onChange(s),r._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new xn},normalMatrix:{value:new wt}}),this.matrix=new xn,this.matrixWorld=new xn,this.matrixAutoUpdate=Yn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Yn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new wU,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return mc.setFromAxisAngle(e,n),this.quaternion.multiply(mc),this}rotateOnWorldAxis(e,n){return mc.setFromAxisAngle(e,n),this.quaternion.premultiply(mc),this}rotateX(e){return this.rotateOnAxis(rP,e)}rotateY(e){return this.rotateOnAxis(iP,e)}rotateZ(e){return this.rotateOnAxis(sP,e)}translateOnAxis(e,n){return nP.copy(e).applyQuaternion(this.quaternion),this.position.add(nP.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(rP,e)}translateY(e){return this.translateOnAxis(iP,e)}translateZ(e){return this.translateOnAxis(sP,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ks.copy(this.matrixWorld).invert())}lookAt(e,n,r){e.isVector3?nm.copy(e):nm.set(e,n,r);const i=this.parent;this.updateWorldMatrix(!0,!1),jd.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ks.lookAt(jd,nm,this.up):Ks.lookAt(nm,jd,this.up),this.quaternion.setFromRotationMatrix(Ks),i&&(Ks.extractRotation(i.matrixWorld),mc.setFromRotationMatrix(Ks),this.quaternion.premultiply(mc.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(zt("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(oP),gc.child=e,this.dispatchEvent(gc),gc.child=null):zt("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}const n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(Rne),x0.child=e,this.dispatchEvent(x0),x0.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Ks.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Ks.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ks),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(oP),gc.child=e,this.dispatchEvent(gc),gc.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let r=0,i=this.children.length;r<i;r++){const o=this.children[r].getObjectByProperty(e,n);if(o!==void 0)return o}}getObjectsByProperty(e,n,r=[]){this[e]===n&&r.push(this);const i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].getObjectsByProperty(e,n,r);return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(jd,e,Mne),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(jd,Cne,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 r=0,i=n.length;r<i;r++)n[r].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const n=this.children;for(let r=0,i=n.length;r<i;r++)n[r].traverseVisible(e)}traverseAncestors(e){const n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const n=e.x,r=e.y,i=e.z,s=this.matrix.elements;s[12]+=n-s[0]*n-s[4]*r-s[8]*i,s[13]+=r-s[1]*n-s[5]*r-s[9]*i,s[14]+=i-s[2]*n-s[6]*r-s[10]*i}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const n=this.children;for(let r=0,i=n.length;r<i;r++)n[r].updateMatrixWorld(e)}updateWorldMatrix(e,n){const r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),n===!0){const i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].updateWorldMatrix(!1,!0)}}toJSON(e){const n=e===void 0||typeof e=="string",r={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),this.static!==!1&&(i.static=this.static),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.pivot!==null&&(i.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(i.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(i.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(a=>({...a,boundingBox:a.boundingBox?a.boundingBox.toJSON():void 0,boundingSphere:a.boundingSphere?a.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(a=>({...a})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,d=l.length;c<d;c++){const f=l[c];s(e.shapes,f)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let l=0,c=this.material.length;l<c;l++)a.push(s(e.materials,this.material[l]));i.material=a}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];i.animations.push(s(e.animations,l))}}if(n){const a=o(e.geometries),l=o(e.materials),c=o(e.textures),d=o(e.images),f=o(e.shapes),u=o(e.skeletons),h=o(e.animations),g=
vendor: 8,117 bytes, line 4183
4183o(e.nodes);a.length>0&&(r.geometries=a),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),d.length>0&&(r.images=d),f.length>0&&(r.shapes=f),u.length>0&&(r.skeletons=u),h.length>0&&(r.animations=h),g.length>0&&(r.nodes=g)}return r.object=i,r;function o(a){const l=[];for(const c in a){const d=a[c];delete d.metadata,l.push(d)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),e.pivot!==null&&(this.pivot=e.pivot.clone()),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r<e.children.length;r++){const i=e.children[r];this.add(i.clone())}return this}}Yn.DEFAULT_UP=new oe(0,1,0);Yn.DEFAULT_MATRIX_AUTO_UPDATE=!0;Yn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class uf extends Yn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Pne={type:"move"};class b0{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new uf,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 uf,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new oe,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new oe),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new uf,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new oe,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new oe),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 r of e.hand.values())this._getHandJoint(n,r)}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,r){let i=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const v of e.hand.values()){const m=n.getJointPose(v,r),p=this._getHandJoint(c,v);m!==null&&(p.matrix.fromArray(m.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=m.radius),p.visible=m!==null}const d=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],u=d.position.distanceTo(f.position),h=.02,g=.005;c.inputState.pinching&&u>h+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&u<=h-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=n.getPose(e.gripSpace,r),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Pne)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new uf;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}const EU={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},jo={h:0,s:0,l:0},rm={h:0,s:0,l:0};function w0(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}class Pt{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=_i){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ft.colorSpaceToWorking(this,n),this}setRGB(e,n,r,i=Ft.workingColorSpace){return this.r=e,this.g=n,this.b=r,Ft.colorSpaceToWorking(this,i),this}
vendor: 4,315 bytes, line 4183
4183setHSL(e,n,r,i=Ft.workingColorSpace){if(e=NS(e,1),n=Ct(n,0,1),r=Ct(r,0,1),n===0)this.r=this.g=this.b=r;else{const s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;this.r=w0(o,s,e+1/3),this.g=w0(o,s,e),this.b=w0(o,s,e-1/3)}return Ft.colorSpaceToWorking(this,i),this}setStyle(e,n=_i){function r(s){s!==void 0&&parseFloat(s)<1&&ut("Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,n);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,n);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,n);break;default:ut("Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,n);if(o===6)return this.setHex(parseInt(s,16),n);ut("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=_i){const r=EU[e.toLowerCase()];return r!==void 0?this.setHex(r,n):ut("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=fo(e.r),this.g=fo(e.g),this.b=fo(e.b),this}copyLinearToSRGB(e){return this.r=au(e.r),this.g=au(e.g),this.b=au(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=_i){return Ft.workingToColorSpace(hr.copy(this),e),Math.round(Ct(hr.r*255,0,255))*65536+Math.round(Ct(hr.g*255,0,255))*256+Math.round(Ct(hr.b*255,0,255))}getHexString(e=_i){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Ft.workingColorSpace){Ft.workingToColorSpace(hr.copy(this),n);const r=hr.r,i=hr.g,s=hr.b,o=Math.max(r,i,s),a=Math.min(r,i,s);let l,c;const d=(a+o)/2;if(a===o)l=0,c=0;else{const f=o-a;switch(c=d<=.5?f/(o+a):f/(2-o-a),o){case r:l=(i-s)/f+(i<s?6:0);break;case i:l=(s-r)/f+2;break;case s:l=(r-i)/f+4;break}l/=6}return e.h=l,e.s=c,e.l=d,e}getRGB(e,n=Ft.workingColorSpace){return Ft.workingToColorSpace(hr.copy(this),n),e.r=hr.r,e.g=hr.g,e.b=hr.b,e}getStyle(e=_i){Ft.workingToColorSpace(hr.copy(this),e);const n=hr.r,r=hr.g,i=hr.b;return e!==_i?`color(${e} ${n.toFixed(3)} ${r.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(n*255)},${Math.round(r*255)},${Math.round(i*255)})`}offsetHSL(e,n,r){return this.getHSL(jo),this.setHSL(jo.h+e,jo.s+n,jo.l+r)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this}lerpColors(e,n,r){return this.r=e.r+(n.r-e.r)*r,this.g=e.g+(n.g-e.g)*r,this.b=e.b+(n.b-e.b)*r,this}lerpHSL(e,n){this.getHSL(jo),e.getHSL(rm);const r=Lf(jo.h,rm.h,n),i=Lf(jo.s,rm.s,n),s=Lf(jo.l,rm.l,n);return this.setHSL(r,i,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const n=this.r,r=this.g,i=this.b,s=e.elements;return this.r=s[0]*n+s[3]*r+s[6]*i,this.g=s[1]*n+s[4]*r+s[7]*i,this.b=s[2]*n+s[5]*r+s[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,n=0){return this.r=e[n],this.g=e[n+1],this.b=e[n+2],this}toArray(e=[],n=0){return e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e}fromBufferAttribute(e,n){return this.r=e.getX(n),this.g=e.getY(n),this.b=e.getZ(n),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}
vendor: 4,374 bytes, line 4183
4183const hr=new Pt;Pt.NAMES=EU;class Ine extends Yn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Us,this.environmentIntensity=1,this.environmentRotation=new Us,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}const Bi=new oe,Xs=new oe,E0=new oe,Ys=new oe,vc=new oe,yc=new oe,aP=new oe,S0=new oe,T0=new oe,A0=new oe,M0=new An,C0=new An,R0=new An;class qi{constructor(e=new oe,n=new oe,r=new oe){this.a=e,this.b=n,this.c=r}static getNormal(e,n,r,i){i.subVectors(r,n),Bi.subVectors(e,n),i.cross(Bi);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,n,r,i,s){Bi.subVectors(i,n),Xs.subVectors(r,n),E0.subVectors(e,n);const o=Bi.dot(Bi),a=Bi.dot(Xs),l=Bi.dot(E0),c=Xs.dot(Xs),d=Xs.dot(E0),f=o*c-a*a;if(f===0)return s.set(0,0,0),null;const u=1/f,h=(c*l-a*d)*u,g=(o*d-a*l)*u;return s.set(1-h-g,g,h)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,Ys)===null?!1:Ys.x>=0&&Ys.y>=0&&Ys.x+Ys.y<=1}static getInterpolation(e,n,r,i,s,o,a,l){return this.getBarycoord(e,n,r,i,Ys)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Ys.x),l.addScaledVector(o,Ys.y),l.addScaledVector(a,Ys.z),l)}static getInterpolatedAttribute(e,n,r,i,s,o){return M0.setScalar(0),C0.setScalar(0),R0.setScalar(0),M0.fromBufferAttribute(e,n),C0.fromBufferAttribute(e,r),R0.fromBufferAttribute(e,i),o.setScalar(0),o.addScaledVector(M0,s.x),o.addScaledVector(C0,s.y),o.addScaledVector(R0,s.z),o}static isFrontFacing(e,n,r,i){return Bi.subVectors(r,n),Xs.subVectors(e,n),Bi.cross(Xs).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Bi.subVectors(this.c,this.b),Xs.subVectors(this.a,this.b),Bi.cross(Xs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return qi.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,r,i,s){return qi.getInterpolation(e,this.a,this.b,this.c,n,r,i,s)}containsPoint(e){return qi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,s=this.c;let o,a;vc.subVectors(i,r),yc.subVectors(s,r),S0.subVectors(e,r);const l=vc.dot(S0),c=yc.dot(S0);if(l<=0&&c<=0)return n.copy(r);T0.subVectors(e,i);const d=vc.dot(T0),f=yc.dot(T0);if(d>=0&&f<=d)return n.copy(i);const u=l*f-d*c;if(u<=0&&l>=0&&d<=0)return o=l/(l-d),n.copy(r).addScaledVector(vc,o);A0.subVectors(e,s);const h=vc.dot(A0),g=yc.dot(A0);if(g>=0&&h<=g)return n.copy(s);const v=h*c-l*g;if(v<=0&&c>
vendor: 5,471 bytes, line 4183
4183=0&&g<=0)return a=c/(c-g),n.copy(r).addScaledVector(yc,a);const m=d*g-h*f;if(m<=0&&f-d>=0&&h-g>=0)return aP.subVectors(s,i),a=(f-d)/(f-d+(h-g)),n.copy(i).addScaledVector(aP,a);const p=1/(m+v+u);return o=v*p,a=u*p,n.copy(r).addScaledVector(vc,o).addScaledVector(yc,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class cd{constructor(e=new oe(1/0,1/0,1/0),n=new oe(-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,r=e.length;n<r;n+=3)this.expandByPoint(Vi.fromArray(e,n));return this}setFromBufferAttribute(e){this.makeEmpty();for(let n=0,r=e.count;n<r;n++)this.expandByPoint(Vi.fromBufferAttribute(e,n));return this}setFromPoints(e){this.makeEmpty();for(let n=0,r=e.length;n<r;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const r=Vi.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}setFromObject(e,n=!1){return this.makeEmpty(),this.expandByObject(e,n)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,n=!1){e.updateWorldMatrix(!1,!1);const r=e.geometry;if(r!==void 0){const s=r.getAttribute("position");if(n===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)e.isMesh===!0?e.getVertexPosition(o,Vi):Vi.fromBufferAttribute(s,o),Vi.applyMatrix4(e.matrixWorld),this.expandByPoint(Vi);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),im.copy(e.boundingBox)):(r.boundingBox===null&&r.computeBoundingBox(),im.copy(r.boundingBox)),im.applyMatrix4(e.matrixWorld),this.union(im)}const i=e.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],n);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Vi),Vi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Bd),sm.subVectors(this.max,Bd),_c.subVectors(e.a,Bd),xc.subVectors(e.b,Bd),bc.subVectors(e.c,Bd),Bo.subVectors(xc,_c),Vo.subVectors(bc,xc),tl.subVectors(_c,bc);let n=[0,-Bo.z,Bo.y,0,-Vo.z,Vo.y,0,-tl.z,tl.y,Bo.z,0,-Bo.x,Vo.z,0,-Vo.x,tl.z,0,-tl.x,-Bo.y,Bo.x,0,-Vo.y,Vo.x,0,-tl.y,tl.x,0];return!P0(n,_c,xc,bc,sm)||(n=[1,0,0,0,1,0,0,0,1],!P0(n,_c,xc,bc,sm))?!1:(om.crossVectors(Bo,Vo),n=[om.x,om.y,om.z],P0(n,_c,xc,bc,sm))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Vi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Vi).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:(Qs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Qs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Qs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Qs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Qs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Qs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Qs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Qs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Qs),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Qs=[new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe],Vi=new oe,im=new cd,_c=new oe,xc=new oe,bc=new oe,Bo=new oe,Vo=new oe,tl=new oe,Bd=new oe,sm=new oe,om=new oe,nl=new oe;function P0(t,e,n,r,i){for(let s=0,o=t.length-3;s<=o;s+=3){nl.fromArray(t,s);const a=i.x*Math.abs(nl.x)+i.y*Math.abs(nl.y)+i.z*Math.abs(nl.z),l=e.dot
vendor: 4,020 bytes, line 4183
4183(nl),c=n.dot(nl),d=r.dot(nl);if(Math.max(-Math.max(l,c,d),Math.min(l,c,d))>a)return!1}return!0}const Nn=new oe,am=new _t;let Nne=0;class Is{constructor(e,n,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Nne++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r,this.usage=WR,this.updateRanges=[],this.gpuType=bs,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=n.array[r+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let n=0,r=this.count;n<r;n++)am.fromBufferAttribute(this,n),am.applyMatrix3(e),this.setXY(n,am.x,am.y);else if(this.itemSize===3)for(let n=0,r=this.count;n<r;n++)Nn.fromBufferAttribute(this,n),Nn.applyMatrix3(e),this.setXYZ(n,Nn.x,Nn.y,Nn.z);return this}applyMatrix4(e){for(let n=0,r=this.count;n<r;n++)Nn.fromBufferAttribute(this,n),Nn.applyMatrix4(e),this.setXYZ(n,Nn.x,Nn.y,Nn.z);return this}applyNormalMatrix(e){for(let n=0,r=this.count;n<r;n++)Nn.fromBufferAttribute(this,n),Nn.applyNormalMatrix(e),this.setXYZ(n,Nn.x,Nn.y,Nn.z);return this}transformDirection(e){for(let n=0,r=this.count;n<r;n++)Nn.fromBufferAttribute(this,n),Nn.transformDirection(e),this.setXYZ(n,Nn.x,Nn.y,Nn.z);return this}set(e,n=0){return this.array.set(e,n),this}getComponent(e,n){let r=this.array[e*this.itemSize+n];return this.normalized&&(r=Rc(r,this.array)),r}setComponent(e,n,r){return this.normalized&&(r=Er(r,this.array)),this.array[e*this.itemSize+n]=r,this}getX(e){let n=this.array[e*this.itemSize];return this.normalized&&(n=Rc(n,this.array)),n}setX(e,n){return this.normalized&&(n=Er(n,this.array)),this.array[e*this.itemSize]=n,this}getY(e){let n=this.array[e*this.itemSize+1];return this.normalized&&(n=Rc(n,this.array)),n}setY(e,n){return this.normalized&&(n=Er(n,this.array)),this.array[e*this.itemSize+1]=n,this}getZ(e){let n=this.array[e*this.itemSize+2];return this.normalized&&(n=Rc(n,this.array)),n}setZ(e,n){return this.normalized&&(n=Er(n,this.array)),this.array[e*this.itemSize+2]=n,this}getW(e){let n=this.array[e*this.itemSize+3];return this.normalized&&(n=Rc(n,this.array)),n}setW(e,n){return this.normalized&&(n=Er(n,this.array)),this.array[e*this.itemSize+3]=n,this}setXY(e,n,r){return e*=this.itemSize,this.normalized&&(n=Er(n,this.array),r=Er(r,this.array)),this.array[e+0]=n,this.array[e+1]=r,this}setXYZ(e,n,r,i){return e*=this.itemSize,this.normalized&&(n=Er(n,this.array),r=Er(r,this.array),i=Er(i,this.array)),this.array[e+0]=n,this.array[e+1]=r,this.array[e+2]=i,this}setXYZW(e,n,r,i,s){return e*=this.itemSize,this.normalized&&(n=Er(n,this.array),r=Er(r,this.array),i=Er(i,this.array),s=Er(s,this.array)),this.array[e+0]=n,this.array[e+1]=r,this.array[e+2]=i,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==WR&&(e.usage=this.usage),e}}class SU extends Is{constructor(e,n,r){super(new Uint16Array(e),n,r)}}class TU extends Is{constructor(e,n,r){super(new Uint32Array(e),n,r)}}class Nr extends Is{constructor(e,n,r){super(new Float32Array(e),n,r)}}const One=new cd,Vd=new oe,I0=new oe;class zy{constructor(e=new oe,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}
vendor: 30,129 bytes, line 4183
4183setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):One.setFromPoints(e).getCenter(r);let i=0;for(let s=0,o=e.length;s<o;s++)i=Math.max(i,r.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const n=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=n*n}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,n){const r=this.center.distanceToSquared(e);return n.copy(e),r>this.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;Vd.subVectors(e,this.center);const n=Vd.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(Vd,i/r),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(I0.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Vd.copy(e.center).add(I0)),this.expandByPoint(Vd.copy(e.center).sub(I0))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let Dne=0;const gi=new xn,N0=new Yn,wc=new oe,ei=new cd,zd=new cd,Wn=new oe;class Di extends ec{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Dne++}),this.uuid=ld(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Qte(e)?TU:SU)(e,1):this.index=e,this}setIndirect(e,n=0){return this.indirect=e,this.indirectOffset=n,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,n){return this.attributes[e]=n,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,n,r=0){this.groups.push({start:e,count:n,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(e,n){this.drawRange.start=e,this.drawRange.count=n}applyMatrix4(e){const n=this.attributes.position;n!==void 0&&(n.applyMatrix4(e),n.needsUpdate=!0);const r=this.attributes.normal;if(r!==void 0){const s=new wt().getNormalMatrix(e);r.applyNormalMatrix(s),r.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return gi.makeRotationFromQuaternion(e),this.applyMatrix4(gi),this}rotateX(e){return gi.makeRotationX(e),this.applyMatrix4(gi),this}rotateY(e){return gi.makeRotationY(e),this.applyMatrix4(gi),this}rotateZ(e){return gi.makeRotationZ(e),this.applyMatrix4(gi),this}translate(e,n,r){return gi.makeTranslation(e,n,r),this.applyMatrix4(gi),this}scale(e,n,r){return gi.makeScale(e,n,r),this.applyMatrix4(gi),this}lookAt(e){return N0.lookAt(e),N0.updateMatrix(),this.applyMatrix4(N0.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(wc).negate(),this.translate(wc.x,wc.y,wc.z),this}setFromPoints(e){const n=this.getAttribute("position");if(n===void 0){const r=[];for(let i=0,s=e.length;i<s;i++){const o=e[i];r.push(o.x,o.y,o.z||0)}this.setAttribute("position",new Nr(r,3))}else{const r=Math.min(e.length,n.count);for(let i=0;i<r;i++){const s=e[i];n.setXYZ(i,s.x,s.y,s.z||0)}e.length>n.count&&ut("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new cd);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){zt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new oe(-1/0,-1/0,-1/0),new oe(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let r=0,i=n.length;r<i;r++){const s=n[r];ei.setFromBufferAttribute(s),this.morphTargetsRelative?(Wn.addVectors(this.boundingBox.min,ei.min),this.boundingBox.expandByPoint(Wn),Wn.addVectors(this.boundingBox.max,ei.max),this.boundingBox.expandByPoint(Wn)):(this.boundingBox.expandByPoint(ei.min),this.boundingBox.expandByPoint(ei.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&zt('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new zy);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){zt("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new oe,1/0);return}if(e){const r=this.boundingSphere.center;if(ei.setFromBufferAttribute(e),n)for(let s=0,o=n.length;s<o;s++){const a=n[s];zd.setFromBufferAttribute(a),this.morphTargetsRelative?(Wn.addVectors(ei.min,zd.min),ei.expandByPoint(Wn),Wn.addVectors(ei.max,zd.max),ei.expandByPoint(Wn)):(ei.expandByPoint(zd.min),ei.expandByPoint(zd.max))}ei.getCenter(r);let i=0;for(let s=0,o=e.count;s<o;s++)Wn.fromBufferAttribute(e,s),i=Math.max(i,r.distanceToSquared(Wn));if(n)for(let s=0,o=n.length;s<o;s++){const a=n[s],l=this.morphTargetsRelative;for(let c=0,d=a.count;c<d;c++)Wn.fromBufferAttribute(a,c),l&&(wc.fromBufferAttribute(e,c),Wn.add(wc)),i=Math.max(i,r.distanceToSquared(Wn))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&zt('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,n=this.attributes;if(e===null||n.position===void 0||n.normal===void 0||n.uv===void 0){zt("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const r=n.position,i=n.normal,s=n.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Is(new Float32Array(4*r.count),4));const o=this.getAttribute("tangent"),a=[],l=[];for(let E=0;E<r.count;E++)a[E]=new oe,l[E]=new oe;const c=new oe,d=new oe,f=new oe,u=new _t,h=new _t,g=new _t,v=new oe,m=new oe;function p(E,C,T){c.fromBufferAttribute(r,E),d.fromBufferAttribute(r,C),f.fromBufferAttribute(r,T),u.fromBufferAttribute(s,E),h.fromBufferAttribute(s,C),g.fromBufferAttribute(s,T),d.sub(c),f.sub(c),h.sub(u),g.sub(u);const A=1/(h.x*g.y-g.x*h.y);isFinite(A)&&(v.copy(d).multiplyScalar(g.y).addScaledVector(f,-h.y).multiplyScalar(A),m.copy(f).multiplyScalar(h.x).addScaledVector(d,-g.x).multiplyScalar(A),a[E].add(v),a[C].add(v),a[T].add(v),l[E].add(m),l[C].add(m),l[T].add(m))}let y=this.groups;y.length===0&&(y=[{start:0,count:e.count}]);for(let E=0,C=y.length;E<C;++E){const T=y[E],A=T.start,R=T.count;for(let P=A,D=A+R;P<D;P+=3)p(e.getX(P+0),e.getX(P+1),e.getX(P+2))}const w=new oe,x=new oe,S=new oe,I=new oe;function M(E){S.fromBufferAttribute(i,E),I.copy(S);const C=a[E];w.copy(C),w.sub(S.multiplyScalar(S.dot(C))).normalize(),x.crossVectors(I,C);const A=x.dot(l[E])<0?-1:1;o.setXYZW(E,w.x,w.y,w.z,A)}for(let E=0,C=y.length;E<C;++E){const T=y[E],A=T.start,R=T.count;for(let P=A,D=A+R;P<D;P+=3)M(e.getX(P+0)),M(e.getX(P+1)),M(e.getX(P+2))}}computeVertexNormals(){const e=this.index,n=this.getAttribute("position");if(n!==void 0){let r=this.getAttribute("normal");if(r===void 0)r=new Is(new Float32Array(n.count*3),3),this.setAttribute("normal",r);else for(let u=0,h=r.count;u<h;u++)r.setXYZ(u,0,0,0);const i=new oe,s=new oe,o=new oe,a=new oe,l=new oe,c=new oe,d=new oe,f=new oe;if(e)for(let u=0,h=e.count;u<h;u+=3){const g=e.getX(u+0),v=e.getX(u+1),m=e.getX(u+2);i.fromBufferAttribute(n,g),s.fromBufferAttribute(n,v),o.fromBufferAttribute(n,m),d.subVectors(o,s),f.subVectors(i,s),d.cross(f),a.fromBufferAttribute(r,g),l.fromBufferAttribute(r,v),c.fromBufferAttribute(r,m),a.add(d),l.add(d),c.add(d),r.setXYZ(g,a.x,a.y,a.z),r.setXYZ(v,l.x,l.y,l.z),r.setXYZ(m,c.x,c.y,c.z)}else for(let u=0,h=n.count;u<h;u+=3)i.fromBufferAttribute(n,u+0),s.fromBufferAttribute(n,u+1),o.fromBufferAttribute(n,u+2),d.subVectors(o,s),f.subVectors(i,s),d.cross(f),r.setXYZ(u+0,d.x,d.y,d.z),r.setXYZ(u+1,d.x,d.y,d.z),r.setXYZ(u+2,d.x,d.y,d.z);this.normalizeNormals(),r.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let n=0,r=e.count;n<r;n++)Wn.fromBufferAttribute(e,n),Wn.normalize(),e.setXYZ(n,Wn.x,Wn.y,Wn.z)}toNonIndexed(){function e(a,l){const c=a.array,d=a.itemSize,f=a.normalized,u=new c.constructor(l.length*d);let h=0,g=0;for(let v=0,m=l.length;v<m;v++){a.isInterleavedBufferAttribute?h=l[v]*a.data.stride+a.offset:h=l[v]*d;for(let p=0;p<d;p++)u[g++]=c[h++]}return new Is(u,d,f)}if(this.index===null)return ut("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new Di,r=this.index.array,i=this.attributes;for(const a in i){const l=i[a],c=e(l,r);n.setAttribute(a,c)}const s=this.morphAttributes;for(const a in s){const l=[],c=s[a];for(let d=0,f=c.length;d<f;d++){const u=c[d],h=e(u,r);l.push(h)}n.morphAttributes[a]=l}n.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,l=o.length;a<l;a++){const c=o[a];n.addGroup(c.start,c.count,c.materialIndex)}return n}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],d=[];for(let f=0,u=c.length;f<u;f++){const h=c[f];d.push(h.toJSON(e.data))}d.length>0&&(i[l]=d,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere=a.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone());const i=e.attributes;for(const c in i){const d=i[c];this.setAttribute(c,d.clone(n))}const s=e.morphAttributes;for(const c in s){const d=[],f=s[c];for(let u=0,h=f.length;u<h;u++)d.push(f[u].clone(n));this.morphAttributes[c]=d}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let c=0,d=o.length;c<d;c++){const f=o[c];this.addGroup(f.start,f.count,f.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}let kne=0;class ud extends ec{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:kne++}),this.uuid=ld(),this.name="",this.type="Material",this.blending=ou,this.side=Va,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Wb,this.blendDst=qb,this.blendEquation=dl,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Pt(0,0,0),this.blendAlpha=0,this.depthFunc=ju,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=$R,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=fc,this.stencilZFail=fc,this.stencilZPass=fc,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){ut(`Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){ut(`Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(r.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(r.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(r.dispersion=this.dispersion),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==ou&&(r.blending=this.blending),this.side!==Va&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==Wb&&(r.blendSrc=this.blendSrc),this.blendDst!==qb&&(r.blendDst=this.blendDst),this.blendEquation!==dl&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==ju&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==$R&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==fc&&(r.stencilFail=this.stencilFail),this.stencilZFail!==fc&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==fc&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.allowOverride===!1&&(r.allowOverride=!1),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(n){const s=i(e.textures),o=i(e.images);s.length>0&&(r.textures=s),o.length>0&&(r.images=o)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let s=0;s!==i;++s)r[s]=n[s].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}const Zs=new oe,O0=new oe,lm=new oe,zo=new oe,D0=new oe,cm=new oe,k0=new oe;class DS{constructor(e=new oe,n=new oe(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,Zs)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Zs.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Zs.copy(this.origin).addScaledVector(this.direction,n),Zs.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){O0.copy(e).add(n).multiplyScalar(.5),lm.copy(n).sub(e).normalize(),zo.copy(this.origin).sub(O0);const s=e.distanceTo(n)*.5,o=-this.direction.dot(lm),a=zo.dot(this.direction),l=-zo.dot(lm),c=zo.lengthSq(),d=Math.abs(1-o*o);let f,u,h,g;if(d>0)if(f=o*l-a,u=o*a-l,g=s*d,f>=0)if(u>=-g)if(u<=g){const v=1/d;f*=v,u*=v,h=f*(f+o*u+2*a)+u*(o*f+u+2*l)+c}else u=s,f=Math.max(0,-(o*u+a)),h=-f*f+u*(u+2*l)+c;else u=-s,f=Math.max(0,-(o*u+a)),h=-f*f+u*(u+2*l)+c;else u<=-g?(f=Math.max(0,-(-o*s+a)),u=f>0?-s:Math.min(Math.max(-s,-l),s),h=-f*f+u*(u+2*l)+c):u<=g?(f=0,u=Math.min(Math.max(-s,-l),s),h=u*(u+2*l)+c):(f=Math.max(0,-(o*s+a)),u=f>0?s:Math.min(Math.max(-s,-l),s),h=-f*f+u*(u+2*l)+c);else u=o>0?-s:s,f=Math.max(0,-(o*u+a)),h=-f*f+u*(u+2*l)+c;return r&&r.copy(this.origin).addScaledVector(this.direction,f),i&&i.copy(O0).addScaledVector(lm,u),h}intersectSphere(e,n){Zs.subVectors(e.center,this.origin);const r=Zs.dot(this.direction),i=Zs.dot(Zs)-r*r,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),a=r-o,l=r+o;return l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(e){return e.radius<0?!1: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 r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,s,o,a,l;const c=1/this.direction.x,d=1/this.direction.y,f=1/this.direction.z,u=this.origin;return c>=0?(r=(e.min.x-u.x)*c,i=(e.max.x-u.x)*c):(r=(e.max.x-u.x)*c,i=(e.min.x-u.x)*c),d>=0?(s=(e.min.y-u.y)*d,o=(e.max.y-u.y)*d):(s=(e.max.y-u.y)*d,o=(e.min.y-u.y)*d),r>o||s>i||((s>r||isNaN(r))&&(r=s),(o<i||isNaN(i))&&(i=o),f>=0?(a=(e.min.z-u.z)*f,l=(e.max.z-u.z)*f):(a=(e.max.z-u.z)*f,l=(e.min.z-u.z)*f),r>l||a>i)||((a>r||r!==r)&&(r=a),(l<i||i!==i)&&(i=l),i<0)?null:this.at(r>=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,Zs)!==null}intersectTriangle(e,n,r,i,s){D0.subVectors(n,e),cm.subVectors(r,e),k0.crossVectors(D0,cm);let o=this.direction.dot(k0),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;zo.subVectors(this.origin,e);const l=a*this.direction.dot(cm.crossVectors(zo,cm));if(l<0)return null;const c=a*this.direction.dot(D0.cross(zo));if(c<0||l+c>o)return null;const d=-a*zo.dot(k0);return d<0?null:this.at(d/o,s)}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 AU extends ud{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Pt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Us,this.combine=rU,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const lP=new xn,rl=new DS,um=new zy,cP=new oe,dm=new oe,fm=new oe,hm=new oe,L0=new oe,pm=new oe,uP=new oe,mm=new oe;class js extends Yn{constructor(e=new Di,n=new AU){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){const a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(e,n){const r=this.geometry,i=r.attributes.position,s=r.morphAttributes.position,o=r.morphTargetsRelative;n.fromBufferAttribute(i,e);const a=this.morphTargetInfluences;if(s&&a){pm.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const d=a[l],f=s[l];d!==0&&(L0.fromBufferAttribute(f,e),o?pm.addScaledVector(L0,d):pm.addScaledVector(L0.sub(n),d))}n.add(pm)}return n}raycast(e,n){const r=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(r.boundingSphere===null&&r.computeBoundingSphere(),um.copy(r.boun
vendor: 4,310 bytes, line 4183
4183dingSphere),um.applyMatrix4(s),rl.copy(e.ray).recast(e.near),!(um.containsPoint(rl.origin)===!1&&(rl.intersectSphere(um,cP)===null||rl.origin.distanceToSquared(cP)>(e.far-e.near)**2))&&(lP.copy(s).invert(),rl.copy(e.ray).applyMatrix4(lP),!(r.boundingBox!==null&&rl.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,rl)))}_computeIntersections(e,n,r){let i;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,d=s.attributes.uv1,f=s.attributes.normal,u=s.groups,h=s.drawRange;if(a!==null)if(Array.isArray(o))for(let g=0,v=u.length;g<v;g++){const m=u[g],p=o[m.materialIndex],y=Math.max(m.start,h.start),w=Math.min(a.count,Math.min(m.start+m.count,h.start+h.count));for(let x=y,S=w;x<S;x+=3){const I=a.getX(x),M=a.getX(x+1),E=a.getX(x+2);i=gm(this,p,e,r,c,d,f,I,M,E),i&&(i.faceIndex=Math.floor(x/3),i.face.materialIndex=m.materialIndex,n.push(i))}}else{const g=Math.max(0,h.start),v=Math.min(a.count,h.start+h.count);for(let m=g,p=v;m<p;m+=3){const y=a.getX(m),w=a.getX(m+1),x=a.getX(m+2);i=gm(this,o,e,r,c,d,f,y,w,x),i&&(i.faceIndex=Math.floor(m/3),n.push(i))}}else if(l!==void 0)if(Array.isArray(o))for(let g=0,v=u.length;g<v;g++){const m=u[g],p=o[m.materialIndex],y=Math.max(m.start,h.start),w=Math.min(l.count,Math.min(m.start+m.count,h.start+h.count));for(let x=y,S=w;x<S;x+=3){const I=x,M=x+1,E=x+2;i=gm(this,p,e,r,c,d,f,I,M,E),i&&(i.faceIndex=Math.floor(x/3),i.face.materialIndex=m.materialIndex,n.push(i))}}else{const g=Math.max(0,h.start),v=Math.min(l.count,h.start+h.count);for(let m=g,p=v;m<p;m+=3){const y=m,w=m+1,x=m+2;i=gm(this,o,e,r,c,d,f,y,w,x),i&&(i.faceIndex=Math.floor(m/3),n.push(i))}}}}function Lne(t,e,n,r,i,s,o,a){let l;if(e.side===Qr?l=r.intersectTriangle(o,s,i,!0,a):l=r.intersectTriangle(i,s,o,e.side===Va,a),l===null)return null;mm.copy(a),mm.applyMatrix4(t.matrixWorld);const c=n.ray.origin.distanceTo(mm);return c<n.near||c>n.far?null:{distance:c,point:mm.clone(),object:t}}function gm(t,e,n,r,i,s,o,a,l,c){t.getVertexPosition(a,dm),t.getVertexPosition(l,fm),t.getVertexPosition(c,hm);const d=Lne(t,e,n,r,dm,fm,hm,uP);if(d){const f=new oe;qi.getBarycoord(uP,dm,fm,hm,f),i&&(d.uv=qi.getInterpolatedAttribute(i,a,l,c,f,new _t)),s&&(d.uv1=qi.getInterpolatedAttribute(s,a,l,c,f,new _t)),o&&(d.normal=qi.getInterpolatedAttribute(o,a,l,c,f,new oe),d.normal.dot(r.direction)>0&&d.normal.multiplyScalar(-1));const u={a,b:l,c,normal:new oe,materialIndex:0};qi.getNormal(dm,fm,hm,u.normal),d.face=u,d.barycoord=f}return d}class Fne extends Ir{constructor(e=null,n=1,r=1,i,s,o,a,l,c=tr,d=tr,f,u){super(null,o,a,l,c,d,i,s,f,u),this.isDataTexture=!0,this.image={data:e,width:n,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const F0=new oe,Une=new oe,jne=new wt;class Ko{constructor(e=new oe(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,r,i){return this.normal.set(e,n,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,r){const i=F0.subVectors(r,n).cross(Une.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const r=e.delta(F0),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:n.copy(e.start).addScaledVector(r,s)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<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 r=n||jne.getNormalMatrix(e),i=this.coplanarPoint(F0).applyMatrix4(e),s=this.normal.applyM
vendor: 16,398 bytes, lines 4183-4187
4183atrix3(r).normalize();return this.constant=-i.dot(s),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 il=new zy,Bne=new _t(.5,.5),vm=new oe;class kS{constructor(e=new Ko,n=new Ko,r=new Ko,i=new Ko,s=new Ko,o=new Ko){this.planes=[e,n,r,i,s,o]}set(e,n,r,i,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(r),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,n=ws,r=!1){const i=this.planes,s=e.elements,o=s[0],a=s[1],l=s[2],c=s[3],d=s[4],f=s[5],u=s[6],h=s[7],g=s[8],v=s[9],m=s[10],p=s[11],y=s[12],w=s[13],x=s[14],S=s[15];if(i[0].setComponents(c-o,h-d,p-g,S-y).normalize(),i[1].setComponents(c+o,h+d,p+g,S+y).normalize(),i[2].setComponents(c+a,h+f,p+v,S+w).normalize(),i[3].setComponents(c-a,h-f,p-v,S-w).normalize(),r)i[4].setComponents(l,u,m,x).normalize(),i[5].setComponents(c-l,h-u,p-m,S-x).normalize();else if(i[4].setComponents(c-l,h-u,p-m,S-x).normalize(),n===ws)i[5].setComponents(c+l,h+u,p+m,S+x).normalize();else if(n===Eh)i[5].setComponents(l,u,m,x).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(),il.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),il.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(il)}intersectsSprite(e){il.center.set(0,0,0);const n=Bne.distanceTo(e.center);return il.radius=.7071067811865476+n,il.applyMatrix4(e.matrixWorld),this.intersectsSphere(il)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(r)<i)return!1;return!0}intersectsBox(e){const n=this.planes;for(let r=0;r<6;r++){const i=n[r];if(vm.x=i.normal.x>0?e.max.x:e.min.x,vm.y=i.normal.y>0?e.max.y:e.min.y,vm.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(vm)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class MU extends ud{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Pt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const _v=new oe,xv=new oe,dP=new xn,Hd=new DS,ym=new zy,U0=new oe,fP=new oe;class Vne extends Yn{constructor(e=new Di,n=new MU){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[0];for(let i=1,s=n.count;i<s;i++)_v.fromBufferAttribute(n,i-1),xv.fromBufferAttribute(n,i),r[i]=r[i-1],r[i]+=_v.distanceTo(xv);e.setAttribute("lineDistance",new Nr(r,1))}else ut("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,n){const r=this.geometry,i=this.matrixWorld,s=e.params.Line.threshold,o=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),ym.copy(r.boundingSphere),ym.applyMatrix4(i),ym.radius+=s,e.ray.intersectsSphere(ym)===!1)return;dP.copy(i).invert(),Hd.copy(e.ray).applyMatrix4(dP);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=this.isLineSegments?2:1,d=r.index,u=r.attributes.position;if(d!==null){const h=Math.max(0,o.start),g=Math.min(d.count,o.start+o.count);for(let v=h,m=g-1;v<m;v+=c){const p=d.getX(v),y=d.getX(v+1),w=_m(this,e,Hd,l,p,y,v);w&&n.push(w)}if(this.isLineLoop){const v=d.getX(g-1),m=d.getX(h),p=_m(this,e,Hd,l,v,m,g-1);p&&n.push(p)}}else{const h=Math.max(0,o.start),g=Math.min(u.count,o.start+o.count);for(let v=h,m=g-1;v<m;v+=c){const p=_m(this,e,Hd,l,v,v+1,v);p&&n.push(p)}if(this.isLineLoop){const v=_m(this,e,Hd,l,g-1,h,g-1);v&&n.push(v)}}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){const a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}function _m(t,e,n,r,i,s,o){const a=t.geometry.attributes.position;if(_v.fromBufferAttribute(a,i),xv.fromBufferAttribute(a,s),n.distanceSqToSegment(_v,xv,U0,fP)>r)return;U0.applyMatrix4(t.matrixWorld);const c=e.ray.origin.distanceTo(U0);if(!(c<e.near||c>e.far))return{distance:c,point:fP.clone().applyMatrix4(t.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:t}}const hP=new oe,pP=new oe;class zne extends Vne{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[];for(let i=0,s=n.count;i<s;i+=2)hP.fromBufferAttribute(n,i),pP.fromBufferAttribute(n,i+1),r[i]=i===0?0:r[i-1],r[i+1]=r[i]+hP.distanceTo(pP);e.setAttribute("lineDistance",new Nr(r,1))}else ut("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class CU extends Ir{constructor(e=[],n=Bl,r,i,s,o,a,l,c,d){super(e,n,r,i,s,o,a,l,c,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Th extends Ir{constructor(e,n,r=Fs,i,s,o,a=tr,l=tr,c,d=To,f=1){if(d!==To&&d!==_l)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const u={width:e,height:n,depth:f};super(u,i,s,o,a,l,d,r,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new OS(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class Hne extends Th{constructor(e,n=Fs,r=Bl,i,s,o=tr,a=tr,l,c=To){const d={width:e,height:e,depth:1},f=[d,d,d,d,d,d];super(e,e,n,r,i,s,o,a,l,c),this.image=f,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class RU extends Ir{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class tp extends Di{constructor(e=1,n=1,r=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:s,depthSegments:o};const a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],d=[],f=[];let u=0,h=0;g("z","y","x",-1,-1,r,n,e,o,s,0),g("z","y","x",1,-1,r,n,-e,o,s,1),g("x","z","y",1,1,e,r,n,i,o,2),g("x","z","y",1,-1,e,r,-n,i,o,3),g("x","y","z",1,-1,e,n,r,i,s,4),g("x","y","z",-1,-1,e,n,-r,i,s,5),this.setIndex(l),this.setAttribute("position",new Nr(c,3)),this.setAttribute("normal",new Nr(d,3)),this.setAttribute("uv",new Nr(f,2));function g(v,m,p,y,w,x,S,I,M,E,C){const T=x/M,A=S/E,R=x/2,P=S/2,D=I/2,F=M+1,V=E+1;let H=0,$=0;const B=new oe;for(let G=0;G<V;G++){const k=G*A-P;for(let z=0;z<F;z++){const q=z*T-R;B[v]=q*y,B[m]=k*w,B[p]=D,c.push(B.x,B.y,B.z),B[v]=0,B[m]=0,B[p]=I>0?1:-1,d.push(B.x,B.y,B.z),f.push(z/M),f.push(1-G/E),H+=1}}for(let G=0;G<E;G++)for(let k=0;k<M;k++){const z=u+k+F*G,q=u+k+F*(G+1),ne=u+(k+1)+F*(G+1),ee=u+(k+1)+F*G;l.push(z,q,ee),l.push(q,ne,ee),$+=6}a.addGroup(h,$,C),h+=$,u+=H}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new tp(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class Hy extends Di{constructor(e=1,n=1,r=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:n,widthSegments:r,heightSegments:i};const s=e/2,o=n/2,a=Math.floor(r),l=Math.floor(i),c=a+1,d=l+1,f=e/a,u=n/l,h=[],g=[],v=[],m=[];for(let p=0;p<d;p++){const y=p*u-o;for(let w=0;w<c;w++){const x=w*f-s;g.push(x,-y,0),v.push(0,0,1),m.push(w/a),m.push(1-p/l)}}for(let p=0;p<l;p++)for(let y=0;y<a;y++){const w=y+c*p,x=y+c*(p+1),S=y+1+c*(p+1),I=y+1+c*p;h.push(w,x,I),h.push(x,S,I)}this.setIndex(h),this.setAttribute("position",new Nr(g,3)),this.setAttribute("normal",new Nr(v,3)),this.setAttribute("uv",new Nr(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Hy(e.width,e.height,e.widthSegments,e.heightSegments)}}function Hu(t){const e={};for(const n in t){e[n]={};for(const r in t[n]){const i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(ut("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][r]=null):e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}}return e}function Sr(t){const e={};for(let n=0;n<t.length;n++){const r=Hu(t[n]);for(const i in r)e[i]=r[i]}return e}function Gne(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}function PU(t){const e=t.getRenderTarget();return e===null?t.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Ft.workingColorSpace}const $ne={clone:Hu,merge:Sr};var Wne=`void main() {
4184	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4185}`,qne=`void main() {
4186	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
4187}`;class Bs extends ud{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Wne,this.fragmentShader=qne,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Hu(e.uniforms),this.uniformsGroups=Gne(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const i in this.uniforms){const o=this.uniforms[i].value;o&&o.isTexture?n.uniforms[i]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?n.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?n.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?n.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?n.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?n.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?n.uniforms[i]={type:"m4",value:o.toArray()}:n.uniforms[i]={value:o}}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 r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class Kne extends Bs{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class Xne extends ud{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Pt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_U,this.normalScale=new _t(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Us,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Yne extends ud{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Hte,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 Qne extends ud{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}}class IU extends Yn{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new Pt(e),this.intensity=n}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,n}}class Zne extends IU{constructor(e,n,r){super(e,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Yn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Pt(n)}copy(e,n){return super.copy(e,n),this.groundColor.copy(e.groundColor),this}toJSON(e){const n=super.toJSON(e);return n.object.groundColor=this.groundColor.getHex(),n}}const j0=new xn,mP=new oe,gP=new oe;class Jne{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new _t(512,512),this.mapType=si,this.map=null,this.mapPass=null,this.matrix=new xn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new kS,this._frameExtents=new _t(1,1),this._viewportCount=1,this._viewports=[new An(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,r=this.matrix;mP.setFromMatrixPosition(e.matrixWorld),n.position.copy(mP),gP.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(gP),n.updateMatrixWorld(),j0.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(j0,n.c
vendor: 4,743 bytes, line 4187
4187oordinateSystem,n.reversedDepth),n.coordinateSystem===Eh||n.reversedDepth?r.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(j0)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this.biasNode=e.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}const xm=new oe,bm=new za,cs=new oe;class NU extends Yn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new xn,this.projectionMatrix=new xn,this.projectionMatrixInverse=new xn,this.coordinateSystem=ws,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}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.matrixWorld.decompose(xm,bm,cs),cs.x===1&&cs.y===1&&cs.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(xm,bm,cs.set(1,1,1)).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorld.decompose(xm,bm,cs),cs.x===1&&cs.y===1&&cs.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(xm,bm,cs.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const Ho=new oe,vP=new _t,yP=new _t;class Si extends NU{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=Sh*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(kf*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Sh*2*Math.atan(Math.tan(kf*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,r){Ho.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Ho.x,Ho.y).multiplyScalar(-e/Ho.z),Ho.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(Ho.x,Ho.y).multiplyScalar(-e/Ho.z)}getViewSize(e,n){return this.getViewBounds(e,vP,yP),n.subVectors(yP,vP)}setViewOffset(e,n,r,i,s,o){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(kf*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,s=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,n-=o.offsetY*r/c,i*=o.width/l,r*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,n,n-r,e,this.far,this.coordinateSystem,this.reversedDepth),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}}class LS extends NU{constructor(e=-1,n=1,r=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="Orthogra
4187phicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,r,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=r-e,o=r+e,a=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=d*this.view.offsetY,l=a-d*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem,this.reversedDepth),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}}class ere extends Jne{constructor(){super(new LS(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class tre extends IU{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Yn.DEFAULT_UP),this.updateMatrix(),this.target=new Yn,this.shadow=new ere}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);return n.object.shadow=this.shadow.toJSON(),n.object.target=this.target.uuid,n}}const Ec=-90,Sc=1;class nre extends Yn{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Si(Ec,Sc,e,n);i.layers=this.layers,this.add(i);const s=new Si(Ec,Sc,e,n);s.layers=this.layers,this.add(s);const o=new Si(Ec,Sc,e,n);o.layers=this.layers,this.add(o);const a=new Si(Ec,Sc,e,n);a.layers=this.layers,this.add(a);const l=new Si(Ec,Sc,e,n);l.layers=this.layers,this.add(l);const c=new Si(Ec,Sc,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,s,o,a,l]=n;for(const c of n)this.remove(c);if(e===ws)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Eh)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,d]=this.children,f=e.getRenderTarget(),u=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),g=e.xr.enabled;e.xr.enabled=!1;const v=r.texture.generateMipmaps;r.texture.generateMipmaps=!1;let m=!1;e.isWebGLRenderer===!0?m=e.state.buffers.depth.getReversed():m=e.reversedDepthBuffer,e.setRenderTarget(r,0,i),m&&e.autoClear===!1&&e.clearDepth(),e.render(n,s),e.setRenderTarget(r,1,i),m&&e.autoClear===!1&&e.clearDepth(),e.render(n,o),e.setRenderTarget(r,2,i),m&&e.autoClear===!1&&e.clearDepth(),e.render(n,a),e.setRenderTarget(r,3,i),m&&e.autoClear===!1&&e.clearDepth(),e.render(n,l),e.setRenderTarget(r,4,i),m&&e.autoClear===!1&&e.clearDepth(),e.render(n,c),r.texture.generateMipmaps=v,e.setRenderTarget(r,5,i),m&&e.autoClear===!1&&e.clearDepth(),e.render(n,d),e.setRenderTarget(f,u,h),e.xr.enabled=g,r.texture.needsPMREMUpdate=!0}}class rre extends Si{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class _P{constructor(e=1,n=0,r=0){this.radius=e,this.phi=n,this.theta=r}set(e,n,r){return this.radius=e,this.phi=n,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Ct(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,r){return this.radius=Math.sqrt(e*e+n*n+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(Ct(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class ire extends zne{constructor(e=10,n=10,r=4473924,i=8947848){r=new Pt(r),i=new Pt(i);const s=n/2,o=e/n,a=e/2,l=[],c=[];for(let u=0,h=0,g=-a;u<=n;u++,g+=o){l.push(-a,0,g,a,0,g),l.push(g,0,-a,g,0,a);const v=u===s?r:i;v.toArray(c,h),h+=3,v.toArray(c,h),h+=3,v.toArray(c,h),h+=3,v.toArray(c,h),h+=3}const d=new Di;d.setAttribute("position",new Nr(l,3)),d.setAttribute("color",new 
vendor: 7,563 bytes, lines 4187-4250
4187Nr(c,3));const f=new MU({vertexColors:!0,toneMapped:!1});super(d,f),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class sre extends ec{constructor(e,n=null){super(),this.object=e,this.domElement=n,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){ut("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function xP(t,e,n,r){const i=ore(r);switch(n){case gU:return t*e;case yU:return t*e/i.components*i.byteLength;case MS:return t*e/i.components*i.byteLength;case Vu:return t*e*2/i.components*i.byteLength;case CS:return t*e*2/i.components*i.byteLength;case vU:return t*e*3/i.components*i.byteLength;case Yi:return t*e*4/i.components*i.byteLength;case RS:return t*e*4/i.components*i.byteLength;case ng:case rg:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case ig:case sg:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case i1:case o1:return Math.max(t,16)*Math.max(e,8)/4;case r1:case s1:return Math.max(t,8)*Math.max(e,8)/2;case a1:case l1:case u1:case d1:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case c1:case f1:case h1:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case p1:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case m1:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case g1:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case v1:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case y1:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case _1:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case x1:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case b1:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case w1:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case E1:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case S1:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case T1:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case A1:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case M1:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case C1:case R1:case P1:return Math.ceil(t/4)*Math.ceil(e/4)*16;case I1:case N1:return Math.ceil(t/4)*Math.ceil(e/4)*8;case O1:case D1:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function ore(t){switch(t){case si:case fU:return{byteLength:1,components:1};case bh:case hU:case So:return{byteLength:2,components:1};case TS:case AS:return{byteLength:2,components:4};case Fs:case SS:case bs:return{byteLength:4,components:1};case pU:case mU:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${t}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:ES}}));typeof window<"u"&&(window.__THREE__?ut("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=ES);/**
4188 * @license
4189 * Copyright 2010-2026 Three.js Authors
4190 * SPDX-License-Identifier: MIT
4191 */function OU(){let t=null,e=!1,n=null,r=null;function i(s,o){n(s,o),r=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(s){n=s},setContext:function(s){t=s}}}function are(t){const e=new WeakMap;function n(a,l){const c=a.array,d=a.usage,f=c.byteLength,u=t.createBuffer();t.bindBuffer(l,u),t.bufferData(l,c,d),a.onUploadCallback();let h;if(c instanceof Float32Array)h=t.FLOAT;else if(typeof Float16Array<"u"&&c instanceof Float16Array)h=t.HALF_FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?h=t.HALF_FLOAT:h=t.UNSIGNED_SHORT;else if(c instanceof Int16Array)h=t.SHORT;else if(c instanceof Uint32Array)h=t.UNSIGNED_INT;else if(c instanceof Int32Array)h=t.INT;else if(c instanceof Int8Array)h=t.BYTE;else if(c instanceof Uint8Array)h=t.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)h=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:u,type:h,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:f}}function r(a,l,c){const d=l.array,f=l.updateRanges;if(t.bindBuffer(c,a),f.length===0)t.bufferSubData(c,0,d);else{f.sort((h,g)=>h.start-g.start);let u=0;for(let h=1;h<f.length;h++){const g=f[u],v=f[h];v.start<=g.start+g.count+1?g.count=Math.max(g.count,v.start+v.count-g.start):(++u,f[u]=v)}f.length=u+1;for(let h=0,g=f.length;h<g;h++){const v=f[h];t.bufferSubData(c,v.start*d.BYTES_PER_ELEMENT,d,v.start,v.count)}l.clearUpdateRanges()}l.onUploadCallback()}function i(a){return a.isInterleavedBufferAttribute&&(a=a.data),e.get(a)}function s(a){a.isInterleavedBufferAttribute&&(a=a.data);const l=e.get(a);l&&(t.deleteBuffer(l.buffer),e.delete(a))}function o(a,l){if(a.isInterleavedBufferAttribute&&(a=a.data),a.isGLBufferAttribute){const d=e.get(a);(!d||d.version<a.version)&&e.set(a,{buffer:a.buffer,type:a.type,bytesPerElement:a.elementSize,version:a.version});return}const c=e.get(a);if(c===void 0)e.set(a,n(a,l));else if(c.version<a.version){if(c.size!==a.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");r(c.buffer,a,l),c.version=a.version}}return{get:i,remove:s,update:o}}var lre=`#ifdef USE_ALPHAHASH
4192	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
4193#endif`,cre=`#ifdef USE_ALPHAHASH
4194	const float ALPHA_HASH_SCALE = 0.05;
4195	float hash2D( vec2 value ) {
4196		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
4197	}
4198	float hash3D( vec3 value ) {
4199		return hash2D( vec2( hash2D( value.xy ), value.z ) );
4200	}
4201	float getAlphaHashThreshold( vec3 position ) {
4202		float maxDeriv = max(
4203			length( dFdx( position.xyz ) ),
4204			length( dFdy( position.xyz ) )
4205		);
4206		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
4207		vec2 pixScales = vec2(
4208			exp2( floor( log2( pixScale ) ) ),
4209			exp2( ceil( log2( pixScale ) ) )
4210		);
4211		vec2 alpha = vec2(
4212			hash3D( floor( pixScales.x * position.xyz ) ),
4213			hash3D( floor( pixScales.y * position.xyz ) )
4214		);
4215		float lerpFactor = fract( log2( pixScale ) );
4216		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
4217		float a = min( lerpFactor, 1.0 - lerpFactor );
4218		vec3 cases = vec3(
4219			x * x / ( 2.0 * a * ( 1.0 - a ) ),
4220			( x - 0.5 * a ) / ( 1.0 - a ),
4221			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
4222		);
4223		float threshold = ( x < ( 1.0 - a ) )
4224			? ( ( x < a ) ? cases.x : cases.y )
4225			: cases.z;
4226		return clamp( threshold , 1.0e-6, 1.0 );
4227	}
4228#endif`,ure=`#ifdef USE_ALPHAMAP
4229	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
4230#endif`,dre=`#ifdef USE_ALPHAMAP
4231	uniform sampler2D alphaMap;
4232#endif`,fre=`#ifdef USE_ALPHATEST
4233	#ifdef ALPHA_TO_COVERAGE
4234	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
4235	if ( diffuseColor.a == 0.0 ) discard;
4236	#else
4237	if ( diffuseColor.a < alphaTest ) discard;
4238	#endif
4239#endif`,hre=`#ifdef USE_ALPHATEST
4240	uniform float alphaTest;
4241#endif`,pre=`#ifdef USE_AOMAP
4242	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
4243	reflectedLight.indirectDiffuse *= ambientOcclusion;
4244	#if defined( USE_CLEARCOAT ) 
4245		clearcoatSpecularIndirect *= ambientOcclusion;
4246	#endif
4247	#if defined( USE_SHEEN ) 
4248		sheenSpecularIndirect *= ambientOcclusion;
4249	#endif
4250	#if defined( USE_ENVMAP ) && defined( STANDARD )
4251		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
4252		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
4253	#endif
4254#endif`,mre=`#ifdef USE_AOMAP
4255	uniform sampler2D aoMap;
4256	uniform float aoMapIntensity;
4257#endif`,gre=`#ifdef USE_BATCHING
4258	#if ! defined( GL_ANGLE_multi_draw )
4259	#define gl_DrawID _gl_DrawID
4260	uniform int _gl_DrawID;
4261	#endif
4262	uniform highp sampler2D batchingTexture;
4263	uniform highp usampler2D batchingIdTexture;
4264	mat4 getBatchingMatrix( const in float i ) {
4265		int size = textureSize( batchingTexture, 0 ).x;
4266		int j = int( i ) * 4;
4267		int x = j % size;
4268		int y = j / size;
4269		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
4270		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
4271		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
4272		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
4273		return mat4( v1, v2, v3, v4 );
4274	}
4275	float getIndirectIndex( const in int i ) {
4276		int size = textureSize( batchingIdTexture, 0 ).x;
4277		int x = i % size;
4278		int y = i / size;
4279		return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
4280	}
4281#endif
4282#ifdef USE_BATCHING_COLOR
4283	uniform sampler2D batchingColorTexture;
4284	vec4 getBatchingColor( const in float i ) {
4285		int size = textureSize( batchingColorTexture, 0 ).x;
4286		int j = int( i );
4287		int x = j % size;
4288		int y = j / size;
4289		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 );
4290	}
4291#endif`,vre=`#ifdef USE_BATCHING
4292	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
4293#endif`,yre=`vec3 transformed = vec3( position );
4294#ifdef USE_ALPHAHASH
4295	vPosition = vec3( position );
4296#endif`,_re=`vec3 objectNormal = vec3( normal );
4297#ifdef USE_TANGENT
4298	vec3 objectTangent = vec3( tangent.xyz );
4299#endif`,xre=`float G_BlinnPhong_Implicit( ) {
4300	return 0.25;
4301}
4302float D_BlinnPhong( const in float shininess, const in float dotNH ) {
4303	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
4304}
4305vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
4306	vec3 halfDir = normalize( lightDir + viewDir );
4307	float dotNH = saturate( dot( normal, halfDir ) );
4308	float dotVH = saturate( dot( viewDir, halfDir ) );
4309	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
4310	float G = G_BlinnPhong_Implicit( );
4311	float D = D_BlinnPhong( shininess, dotNH );
4312	return F * ( G * D );
4313} // validated`,bre=`#ifdef USE_IRIDESCENCE
4314	const mat3 XYZ_TO_REC709 = mat3(
4315		 3.2404542, -0.9692660,  0.0556434,
4316		-1.5371385,  1.8760108, -0.2040259,
4317		-0.4985314,  0.0415560,  1.0572252
4318	);
4319	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
4320		vec3 sqrtF0 = sqrt( fresnel0 );
4321		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
4322	}
4323	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
4324		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
4325	}
4326	float IorToFresnel0( float transmittedIor, float incidentIor ) {
4327		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
4328	}
4329	vec3 evalSensitivity( float OPD, vec3 shift ) {
4330		float phase = 2.0 * PI * OPD * 1.0e-9;
4331		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
4332		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
4333		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
4334		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
4335		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
4336		xyz /= 1.0685e-7;
4337		vec3 rgb = XYZ_TO_REC709 * xyz;
4338		return rgb;
4339	}
4340	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
4341		vec3 I;
4342		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
4343		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
4344		float cosTheta2Sq = 1.0 - sinTheta2Sq;
4345		if ( cosTheta2Sq < 0.0 ) {
4346			return vec3( 1.0 );
4347		}
4348		float cosTheta2 = sqrt( cosTheta2Sq );
4349		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
4350		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
4351		float T121 = 1.0 - R12;
4352		float phi12 = 0.0;
4353		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
4354		float phi21 = PI - phi12;
4355		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
4356		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
4357		vec3 phi23 = vec3( 0.0 );
4358		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
4359		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
4360		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
4361		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
4362		vec3 phi = vec3( phi21 ) + phi23;
4363		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
4364		vec3 r123 = sqrt( R123 );
4365		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
4366		vec3 C0 = R12 + Rs;
4367		I = C0;
4368		vec3 Cm = Rs - T121;
4369		for ( int m = 1; m <= 2; ++ m ) {
4370			Cm *= r123;
4371			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
4372			I += Cm * Sm;
4373		}
4374		return max( I, vec3( 0.0 ) );
4375	}
4376#endif`,wre=`#ifdef USE_BUMPMAP
4377	uniform sampler2D bumpMap;
4378	uniform float bumpScale;
4379	vec2 dHdxy_fwd() {
4380		vec2 dSTdx = dFdx( vBumpMapUv );
4381		vec2 dSTdy = dFdy( vBumpMapUv );
4382		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
4383		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
4384		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
4385		return vec2( dBx, dBy );
4386	}
4387	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
4388		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
4389		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
4390		vec3 vN = surf_norm;
4391		vec3 R1 = cross( vSigmaY, vN );
4392		vec3 R2 = cross( vN, vSigmaX );
4393		float fDet = dot( vSigmaX, R1 ) * faceDirection;
4394		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
4395		return normalize( abs( fDet ) * surf_norm - vGrad );
4396	}
4397#endif`,Ere=`#if NUM_CLIPPING_PLANES > 0
4398	vec4 plane;
4399	#ifdef ALPHA_TO_COVERAGE
4400		float distanceToPlane, distanceGradient;
4401		float clipOpacity = 1.0;
4402		#pragma unroll_loop_start
4403		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
4404			plane = clippingPlanes[ i ];
4405			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
4406			distanceGradient = fwidth( distanceToPlane ) / 2.0;
4407			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
4408			if ( clipOpacity == 0.0 ) discard;
4409		}
4410		#pragma unroll_loop_end
4411		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
4412			float unionClipOpacity = 1.0;
4413			#pragma unroll_loop_start
4414			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
4415				plane = clippingPlanes[ i ];
4416				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
4417				distanceGradient = fwidth( distanceToPlane ) / 2.0;
4418				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
4419			}
4420			#pragma unroll_loop_end
4421			clipOpacity *= 1.0 - unionClipOpacity;
4422		#endif
4423		diffuseColor.a *= clipOpacity;
4424		if ( diffuseColor.a == 0.0 ) discard;
4425	#else
4426		#pragma unroll_loop_start
4427		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
4428			plane = clippingPlanes[ i ];
4429			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
4430		}
4431		#pragma unroll_loop_end
4432		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
4433			bool clipped = true;
4434			#pragma unroll_loop_start
4435			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
4436				plane = clippingPlanes[ i ];
4437				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
4438			}
4439			#pragma unroll_loop_end
4440			if ( clipped ) discard;
4441		#endif
4442	#endif
4443#endif`,Sre=`#if NUM_CLIPPING_PLANES > 0
4444	varying vec3 vClipPosition;
4445	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
4446#endif`,Tre=`#if NUM_CLIPPING_PLANES > 0
4447	varying vec3 vClipPosition;
4448#endif`,Are=`#if NUM_CLIPPING_PLANES > 0
4449	vClipPosition = - mvPosition.xyz;
4450#endif`,Mre=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
4451	diffuseColor *= vColor;
4452#endif`,Cre=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
4453	varying vec4 vColor;
4454#endif`,Rre=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
4455	varying vec4 vColor;
4456#endif`,Pre=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
4457	vColor = vec4( 1.0 );
4458#endif
4459#ifdef USE_COLOR_ALPHA
4460	vColor *= color;
4461#elif defined( USE_COLOR )
4462	vColor.rgb *= color;
4463#endif
4464#ifdef USE_INSTANCING_COLOR
4465	vColor.rgb *= instanceColor.rgb;
4466#endif
4467#ifdef USE_BATCHING_COLOR
4468	vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );
4469#endif`,Ire=`#define PI 3.141592653589793
4470#define PI2 6.283185307179586
4471#define PI_HALF 1.5707963267948966
4472#define RECIPROCAL_PI 0.3183098861837907
4473#define RECIPROCAL_PI2 0.15915494309189535
4474#define EPSILON 1e-6
4475#ifndef saturate
4476#define saturate( a ) clamp( a, 0.0, 1.0 )
4477#endif
4478#define whiteComplement( a ) ( 1.0 - saturate( a ) )
4479float pow2( const in float x ) { return x*x; }
4480vec3 pow2( const in vec3 x ) { return x*x; }
4481float pow3( const in float x ) { return x*x*x; }
4482float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
4483float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
4484float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
4485highp float rand( const in vec2 uv ) {
4486	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
4487	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
4488	return fract( sin( sn ) * c );
4489}
4490#ifdef HIGH_PRECISION
4491	float precisionSafeLength( vec3 v ) { return length( v ); }
4492#else
4493	float precisionSafeLength( vec3 v ) {
4494		float maxComponent = max3( abs( v ) );
4495		return length( v / maxComponent ) * maxComponent;
4496	}
4497#endif
4498struct IncidentLight {
4499	vec3 color;
4500	vec3 direction;
4501	bool visible;
4502};
4503struct ReflectedLight {
4504	vec3 directDiffuse;
4505	vec3 directSpecular;
4506	vec3 indirectDiffuse;
4507	vec3 indirectSpecular;
4508};
4509#ifdef USE_ALPHAHASH
4510	varying vec3 vPosition;
4511#endif
4512vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
4513	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
4514}
4515vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
4516	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
4517}
4518bool isPerspectiveMatrix( mat4 m ) {
4519	return m[ 2 ][ 3 ] == - 1.0;
4520}
4521vec2 equirectUv( in vec3 dir ) {
4522	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
4523	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
4524	return vec2( u, v );
4525}
4526vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
4527	return RECIPROCAL_PI * diffuseColor;
4528}
4529vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
4530	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
4531	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
4532}
4533float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
4534	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
4535	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
4536} // validated`,Nre=`#ifdef ENVMAP_TYPE_CUBE_UV
4537	#define cubeUV_minMipLevel 4.0
4538	#define cubeUV_minTileSize 16.0
4539	float getFace( vec3 direction ) {
4540		vec3 absDirection = abs( direction );
4541		float face = - 1.0;
4542		if ( absDirection.x > absDirection.z ) {
4543			if ( absDirection.x > absDirection.y )
4544				face = direction.x > 0.0 ? 0.0 : 3.0;
4545			else
4546				face = direction.y > 0.0 ? 1.0 : 4.0;
4547		} else {
4548			if ( absDirection.z > absDirection.y )
4549				face = direction.z > 0.0 ? 2.0 : 5.0;
4550			else
4551				face = direction.y > 0.0 ? 1.0 : 4.0;
4552		}
4553		return face;
4554	}
4555	vec2 getUV( vec3 direction, float face ) {
4556		vec2 uv;
4557		if ( face == 0.0 ) {
4558			uv = vec2( direction.z, direction.y ) / abs( direction.x );
4559		} else if ( face == 1.0 ) {
4560			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
4561		} else if ( face == 2.0 ) {
4562			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
4563		} else if ( face == 3.0 ) {
4564			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
4565		} else if ( face == 4.0 ) {
4566			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
4567		} else {
4568			uv = vec2( direction.x, direction.y ) / abs( direction.z );
4569		}
4570		return 0.5 * ( uv + 1.0 );
4571	}
4572	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
4573		float face = getFace( direction );
4574		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
4575		mipInt = max( mipInt, cubeUV_minMipLevel );
4576		float faceSize = exp2( mipInt );
4577		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
4578		if ( face > 2.0 ) {
4579			uv.y += faceSize;
4580			face -= 3.0;
4581		}
4582		uv.x += face * faceSize;
4583		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
4584		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
4585		uv.x *= CUBEUV_TEXEL_WIDTH;
4586		uv.y *= CUBEUV_TEXEL_HEIGHT;
4587		#ifdef texture2DGradEXT
4588			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
4589		#else
4590			return texture2D( envMap, uv ).rgb;
4591		#endif
4592	}
4593	#define cubeUV_r0 1.0
4594	#define cubeUV_m0 - 2.0
4595	#define cubeUV_r1 0.8
4596	#define cubeUV_m1 - 1.0
4597	#define cubeUV_r4 0.4
4598	#define cubeUV_m4 2.0
4599	#define cubeUV_r5 0.305
4600	#define cubeUV_m5 3.0
4601	#define cubeUV_r6 0.21
4602	#define cubeUV_m6 4.0
4603	float roughnessToMip( float roughness ) {
4604		float mip = 0.0;
4605		if ( roughness >= cubeUV_r1 ) {
4606			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
4607		} else if ( roughness >= cubeUV_r4 ) {
4608			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
4609		} else if ( roughness >= cubeUV_r5 ) {
4610			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
4611		} else if ( roughness >= cubeUV_r6 ) {
4612			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
4613		} else {
4614			mip = - 2.0 * log2( 1.16 * roughness );		}
4615		return mip;
4616	}
4617	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
4618		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
4619		float mipF = fract( mip );
4620		float mipInt = floor( mip );
4621		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
4622		if ( mipF == 0.0 ) {
4623			return vec4( color0, 1.0 );
4624		} else {
4625			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
4626			return vec4( mix( color0, color1, mipF ), 1.0 );
4627		}
4628	}
4629#endif`,Ore=`vec3 transformedNormal = objectNormal;
4630#ifdef USE_TANGENT
4631	vec3 transformedTangent = objectTangent;
4632#endif
4633#ifdef USE_BATCHING
4634	mat3 bm = mat3( batchingMatrix );
4635	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
4636	transformedNormal = bm * transformedNormal;
4637	#ifdef USE_TANGENT
4638		transformedTangent = bm * transformedTangent;
4639	#endif
4640#endif
4641#ifdef USE_INSTANCING
4642	mat3 im = mat3( instanceMatrix );
4643	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
4644	transformedNormal = im * transformedNormal;
4645	#ifdef USE_TANGENT
4646		transformedTangent = im * transformedTangent;
4647	#endif
4648#endif
4649transformedNormal = normalMatrix * transformedNormal;
4650#ifdef FLIP_SIDED
4651	transformedNormal = - transformedNormal;
4652#endif
4653#ifdef USE_TANGENT
4654	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
4655	#ifdef FLIP_SIDED
4656		transformedTangent = - transformedTangent;
4657	#endif
4658#endif`,Dre=`#ifdef USE_DISPLACEMENTMAP
4659	uniform sampler2D displacementMap;
4660	uniform float displacementScale;
4661	uniform float displacementBias;
4662#endif`,kre=`#ifdef USE_DISPLACEMENTMAP
4663	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
4663placementBias );
4664#endif`,Lre=`#ifdef USE_EMISSIVEMAP
4665	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
4666	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
4667		emissiveColor = sRGBTransferEOTF( emissiveColor );
4668	#endif
4669	totalEmissiveRadiance *= emissiveColor.rgb;
4670#endif`,Fre=`#ifdef USE_EMISSIVEMAP
4671	uniform sampler2D emissiveMap;
4672#endif`,Ure="gl_FragColor = linearToOutputTexel( gl_FragColor );",jre=`vec4 LinearTransferOETF( in vec4 value ) {
4673	return value;
4674}
4675vec4 sRGBTransferEOTF( in vec4 value ) {
4676	return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
4677}
4678vec4 sRGBTransferOETF( in vec4 value ) {
4679	return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
4680}`,Bre=`#ifdef USE_ENVMAP
4681	#ifdef ENV_WORLDPOS
4682		vec3 cameraToFrag;
4683		if ( isOrthographic ) {
4684			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
4685		} else {
4686			cameraToFrag = normalize( vWorldPosition - cameraPosition );
4687		}
4688		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
4689		#ifdef ENVMAP_MODE_REFLECTION
4690			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
4691		#else
4692			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
4693		#endif
4694	#else
4695		vec3 reflectVec = vReflect;
4696	#endif
4697	#ifdef ENVMAP_TYPE_CUBE
4698		vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
4699		#ifdef ENVMAP_BLENDING_MULTIPLY
4700			outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
4701		#elif defined( ENVMAP_BLENDING_MIX )
4702			outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
4703		#elif defined( ENVMAP_BLENDING_ADD )
4704			outgoingLight += envColor.xyz * specularStrength * reflectivity;
4705		#endif
4706	#endif
4707#endif`,Vre=`#ifdef USE_ENVMAP
4708	uniform float envMapIntensity;
4709	uniform float flipEnvMap;
4710	uniform mat3 envMapRotation;
4711	#ifdef ENVMAP_TYPE_CUBE
4712		uniform samplerCube envMap;
4713	#else
4714		uniform sampler2D envMap;
4715	#endif
4716#endif`,zre=`#ifdef USE_ENVMAP
4717	uniform float reflectivity;
4718	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
4719		#define ENV_WORLDPOS
4720	#endif
4721	#ifdef ENV_WORLDPOS
4722		varying vec3 vWorldPosition;
4723		uniform float refractionRatio;
4724	#else
4725		varying vec3 vReflect;
4726	#endif
4727#endif`,Hre=`#ifdef USE_ENVMAP
4728	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
4729		#define ENV_WORLDPOS
4730	#endif
4731	#ifdef ENV_WORLDPOS
4732		
4733		varying vec3 vWorldPosition;
4734	#else
4735		varying vec3 vReflect;
4736		uniform float refractionRatio;
4737	#endif
4738#endif`,Gre=`#ifdef USE_ENVMAP
4739	#ifdef ENV_WORLDPOS
4740		vWorldPosition = worldPosition.xyz;
4741	#else
4742		vec3 cameraToVertex;
4743		if ( isOrthographic ) {
4744			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
4745		} else {
4746			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
4747		}
4748		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
4749		#ifdef ENVMAP_MODE_REFLECTION
4750			vReflect = reflect( cameraToVertex, worldNormal );
4751		#else
4752			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
4753		#endif
4754	#endif
4755#endif`,$re=`#ifdef USE_FOG
4756	vFogDepth = - mvPosition.z;
4757#endif`,Wre=`#ifdef USE_FOG
4758	varying float vFogDepth;
4759#endif`,qre=`#ifdef USE_FOG
4760	#ifdef FOG_EXP2
4761		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
4762	#else
4763		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
4764	#endif
4765	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
4766#endif`,Kre=`#ifdef USE_FOG
4767	uniform vec3 fogColor;
4768	varying float vFogDepth;
4769	#ifdef FOG_EXP2
4770		uniform float fogDensity;
4771	#else
4772		uniform float fogNear;
4773		uniform float fogFar;
4774	#endif
4775#endif`,Xre=`#ifdef USE_GRADIENTMAP
4776	uniform sampler2D gradientMap;
4777#endif
4778vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
4779	float dotNL = dot( normal, lightDirection );
4780	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
4781	#ifdef USE_GRADIENTMAP
4782		return vec3( texture2D( gradientMap, coord ).r );
4783	#else
4784		vec2 fw = fwidth( coord ) * 0.5;
4785		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
4786	#endif
4787}`,Yre=`#ifdef USE_LIGHTMAP
4788	uniform sampler2D lightMap;
4789	uniform float lightMapIntensity;
4790#endif`,Qre=`LambertMaterial material;
4791material.diffuseColor = diffuseColor.rgb;
4792material.specularStrength = specularStrength;`,Zre=`varying vec3 vViewPosition;
4793struct LambertMaterial {
4794	vec3 diffuseColor;
4795	float specularStrength;
4796};
4797void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
4798	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
4799	vec3 irradiance = dotNL * directLight.color;
4800	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
4801}
4802void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
4803	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
4804}
4805#define RE_Direct				RE_Direct_Lambert
4806#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,Jre=`uniform bool receiveShadow;
4807uniform vec3 ambientLightColor;
4808#if defined( USE_LIGHT_PROBES )
4809	uniform vec3 lightProbe[ 9 ];
4810#endif
4811vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
4812	float x = normal.x, y = normal.y, z = normal.z;
4813	vec3 result = shCoefficients[ 0 ] * 0.886227;
4814	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
4815	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
4816	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
4817	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
4818	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
4819	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
4820	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
4821	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
4822	return result;
4823}
4824vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
4825	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
4826	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
4827	return irradiance;
4828}
4829vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
4830	vec3 irradiance = ambientLightColor;
4831	return irradiance;
4832}
4833float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
4834	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
4835	if ( cutoffDistance > 0.0 ) {
4836		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
4837	}
4838	return distanceFalloff;
4839}
4840float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
4841	return smoothstep( coneCosine, penumbraCosine, angleCosine );
4842}
4843#if NUM_DIR_LIGHTS > 0
4844	struct DirectionalLight {
4845		vec3 direction;
4846		vec3 color;
4847	};
4848	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
4849	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
4850		light.color = directionalLight.color;
4851		light.direction = directionalLight.direction;
4852		light.visible = true;
4853	}
4854#endif
4855#if NUM_POINT_LIGHTS > 0
4856	struct PointLight {
4857		vec3 position;
4858		vec3 color;
4859		float distance;
4860		float decay;
4861	};
4862	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
4863	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
4864		vec3 lVector = pointLight.position - geometryPosition;
4865		light.direction = normalize( lVector );
4866		float lightDistance = length( lVector );
4867		light.color = pointLight.color;
4868		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
4869		light.visible = ( light.color != vec3( 0.0 ) );
4870	}
4871#endif
4872#if NUM_SPOT_LIGHTS > 0
4873	struct SpotLight {
4874		vec3 position;
4875		vec3 direction;
4876		vec3 color;
4877		float distance;
4878		float decay;
4879		float coneCos;
4880		float penumbraCos;
4881	};
4882	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
4883	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
4884		vec3 lVector = spotLight.position - geometryPosition;
4885		light.direction = normalize( lVector );
4886		float angleCos = dot( light.direction, spotLight.direction );
4887		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
4888		if ( spotAttenuation > 0.0 ) {
4889			float lightDistance = length( lVector );
4890			light.color = spotLight.color * spotAttenuation;
4891			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
4892			light.visible = ( light.color != vec3( 0.0 ) );
4893		} else {
4894			light.color = vec3( 0.0 );
4895			light.visible = false;
4896		}
4897	}
4898#endif
4899#if NUM_RECT_AREA_LIGHTS > 0
4900	struct RectAreaLight {
4901		vec3 color;
4902		vec3 position;
4903		vec3 halfWidth;
4904		vec3 halfHeight;
4905	};
4906	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
4907	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
4908#endif
4909#if NUM_HEMI_LIGHTS > 0
4910	struct HemisphereLight {
4911		vec3 direction;
4912		vec3 skyColor;
4913		vec3 groundColor;
4914	};
4915	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
4916	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
4917		float dotNL = dot( normal, hemiLight.direction );
4918		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
4919		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
4920		return irradiance;
4921	}
4922#endif`,eie=`#ifdef USE_ENVMAP
4923	vec3 getIBLIrradiance( const in vec3 normal ) {
4924		#ifdef ENVMAP_TYPE_CUBE_UV
4925			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
4926			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
4927			return PI * envMapColor.rgb * envMapIntensity;
4928		#else
4929			return vec3( 0.0 );
4930		#endif
4931	}
4932	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
4933		#ifdef ENVMAP_TYPE_CUBE_UV
4934			vec3 reflectVec = reflect( - viewDir, normal );
4935			reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );
4936			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
4937			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
4938			return envMapColor.rgb * envMapIntensity;
4939		#else
4940			return vec3( 0.0 );
4941		#endif
4942	}
4943	#ifdef USE_ANISOTROPY
4944		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
4945			#ifdef ENVMAP_TYPE_CUBE_UV
4946				vec3 bentNormal = cross( bitangent, viewDir );
4947				bentNormal = normalize( cross( bentNormal, bitangent ) );
4948				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
4949				return getIBLRadiance( viewDir, bentNormal, roughness );
4950			#else
4951				return vec3( 0.0 );
4952			#endif
4953		}
4954	#endif
4955#endif`,tie=`ToonMaterial material;
4956material.diffuseColor = diffuseColor.rgb;`,nie=`varying vec3 vViewPosition;
4957struct ToonMaterial {
4958	vec3 diffuseColor;
4959};
4960void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
4961	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
4962	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
4963}
4964void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
4965	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
4966}
4967#define RE_Direct				RE_Direct_Toon
4968#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,rie=`BlinnPhongMaterial material;
4969material.diffuseColor = diffuseColor.rgb;
4970material.specularColor = specular;
4971material.specularShininess = shininess;
4972material.specularStrength = specularStrength;
4972`,iie=`varying vec3 vViewPosition;
4973struct BlinnPhongMaterial {
4974	vec3 diffuseColor;
4975	vec3 specularColor;
4976	float specularShininess;
4977	float specularStrength;
4978};
4979void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
4980	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
4981	vec3 irradiance = dotNL * directLight.color;
4982	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
4983	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
4984}
4985void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
4986	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
4987}
4988#define RE_Direct				RE_Direct_BlinnPhong
4989#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,sie=`PhysicalMaterial material;
4990material.diffuseColor = diffuseColor.rgb;
4991material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );
4992material.metalness = metalnessFactor;
4993vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
4994float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
4995material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
4996material.roughness = min( material.roughness, 1.0 );
4997#ifdef IOR
4998	material.ior = ior;
4999	#ifdef USE_SPECULAR
5000		float specularIntensityFactor = specularIntensity;
5001		vec3 specularColorFactor = specularColor;
5002		#ifdef USE_SPECULAR_COLORMAP
5003			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
5004		#endif
5005		#ifdef USE_SPECULAR_INTENSITYMAP
5006			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
5007		#endif
5008		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
5009	#else
5010		float specularIntensityFactor = 1.0;
5011		vec3 specularColorFactor = vec3( 1.0 );
5012		material.specularF90 = 1.0;
5013	#endif
5014	material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;
5015	material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
5016#else
5017	material.specularColor = vec3( 0.04 );
5018	material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
5019	material.specularF90 = 1.0;
5020#endif
5021#ifdef USE_CLEARCOAT
5022	material.clearcoat = clearcoat;
5023	material.clearcoatRoughness = clearcoatRoughness;
5024	material.clearcoatF0 = vec3( 0.04 );
5025	material.clearcoatF90 = 1.0;
5026	#ifdef USE_CLEARCOATMAP
5027		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
5028	#endif
5029	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
5030		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
5031	#endif
5032	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
5033	material.clearcoatRoughness += geometryRoughness;
5034	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
5035#endif
5036#ifdef USE_DISPERSION
5037	material.dispersion = dispersion;
5038#endif
5039#ifdef USE_IRIDESCENCE
5040	material.iridescence = iridescence;
5041	material.iridescenceIOR = iridescenceIOR;
5042	#ifdef USE_IRIDESCENCEMAP
5043		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
5044	#endif
5045	#ifdef USE_IRIDESCENCE_THICKNESSMAP
5046		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
5047	#else
5048		material.iridescenceThickness = iridescenceThicknessMaximum;
5049	#endif
5050#endif
5051#ifdef USE_SHEEN
5052	material.sheenColor = sheenColor;
5053	#ifdef USE_SHEEN_COLORMAP
5054		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
5055	#endif
5056	material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );
5057	#ifdef USE_SHEEN_ROUGHNESSMAP
5058		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
5059	#endif
5060#endif
5061#ifdef USE_ANISOTROPY
5062	#ifdef USE_ANISOTROPYMAP
5063		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
5064		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
5065		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
5066	#else
5067		vec2 anisotropyV = anisotropyVector;
5068	#endif
5069	material.anisotropy = length( anisotropyV );
5070	if( material.anisotropy == 0.0 ) {
5071		anisotropyV = vec2( 1.0, 0.0 );
5072	} else {
5073		anisotropyV /= material.anisotropy;
5074		material.anisotropy = saturate( material.anisotropy );
5075	}
5076	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
5077	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
5078	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
5079#endif`,oie
vendor: 9,654 bytes, lines 5079-5310
5079=`uniform sampler2D dfgLUT;
5080struct PhysicalMaterial {
5081	vec3 diffuseColor;
5082	vec3 diffuseContribution;
5083	vec3 specularColor;
5084	vec3 specularColorBlended;
5085	float roughness;
5086	float metalness;
5087	float specularF90;
5088	float dispersion;
5089	#ifdef USE_CLEARCOAT
5090		float clearcoat;
5091		float clearcoatRoughness;
5092		vec3 clearcoatF0;
5093		float clearcoatF90;
5094	#endif
5095	#ifdef USE_IRIDESCENCE
5096		float iridescence;
5097		float iridescenceIOR;
5098		float iridescenceThickness;
5099		vec3 iridescenceFresnel;
5100		vec3 iridescenceF0;
5101		vec3 iridescenceFresnelDielectric;
5102		vec3 iridescenceFresnelMetallic;
5103	#endif
5104	#ifdef USE_SHEEN
5105		vec3 sheenColor;
5106		float sheenRoughness;
5107	#endif
5108	#ifdef IOR
5109		float ior;
5110	#endif
5111	#ifdef USE_TRANSMISSION
5112		float transmission;
5113		float transmissionAlpha;
5114		float thickness;
5115		float attenuationDistance;
5116		vec3 attenuationColor;
5117	#endif
5118	#ifdef USE_ANISOTROPY
5119		float anisotropy;
5120		float alphaT;
5121		vec3 anisotropyT;
5122		vec3 anisotropyB;
5123	#endif
5124};
5125vec3 clearcoatSpecularDirect = vec3( 0.0 );
5126vec3 clearcoatSpecularIndirect = vec3( 0.0 );
5127vec3 sheenSpecularDirect = vec3( 0.0 );
5128vec3 sheenSpecularIndirect = vec3(0.0 );
5129vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
5130    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
5131    float x2 = x * x;
5132    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
5133    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
5134}
5135float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
5136	float a2 = pow2( alpha );
5137	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
5138	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
5139	return 0.5 / max( gv + gl, EPSILON );
5140}
5141float D_GGX( const in float alpha, const in float dotNH ) {
5142	float a2 = pow2( alpha );
5143	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
5144	return RECIPROCAL_PI * a2 / pow2( denom );
5145}
5146#ifdef USE_ANISOTROPY
5147	float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
5148		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
5149		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
5150		float v = 0.5 / ( gv + gl );
5151		return v;
5152	}
5153	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
5154		float a2 = alphaT * alphaB;
5155		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
5156		highp float v2 = dot( v, v );
5157		float w2 = a2 / v2;
5158		return RECIPROCAL_PI * a2 * pow2 ( w2 );
5159	}
5160#endif
5161#ifdef USE_CLEARCOAT
5162	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
5163		vec3 f0 = material.clearcoatF0;
5164		float f90 = material.clearcoatF90;
5165		float roughness = material.clearcoatRoughness;
5166		float alpha = pow2( roughness );
5167		vec3 halfDir = normalize( lightDir + viewDir );
5168		float dotNL = saturate( dot( normal, lightDir ) );
5169		float dotNV = saturate( dot( normal, viewDir ) );
5170		float dotNH = saturate( dot( normal, halfDir ) );
5171		float dotVH = saturate( dot( viewDir, halfDir ) );
5172		vec3 F = F_Schlick( f0, f90, dotVH );
5173		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
5174		float D = D_GGX( alpha, dotNH );
5175		return F * ( V * D );
5176	}
5177#endif
5178vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
5179	vec3 f0 = material.specularColorBlended;
5180	float f90 = material.specularF90;
5181	float roughness = material.roughness;
5182	float alpha = pow2( roughness );
5183	vec3 halfDir = normalize( lightDir + viewDir );
5184	float dotNL = saturate( dot( normal, lightDir ) );
5185	float dotNV = saturate( dot( normal, viewDir ) );
5186	float dotNH = saturate( dot( normal, halfDir ) );
5187	float dotVH = saturate( dot( viewDir, halfDir ) );
5188	vec3 F = F_Schlick( f0, f90, dotVH );
5189	#ifdef USE_IRIDESCENCE
5190		F = mix( F, material.iridescenceFresnel, material.iridescence );
5191	#endif
5192	#ifdef USE_ANISOTROPY
5193		float dotTL = dot( material.anisotropyT, lightDir );
5194		float dotTV = dot( material.anisotropyT, viewDir );
5195		float dotTH = dot( material.anisotropyT, halfDir );
5196		float dotBL = dot( material.anisotropyB, lightDir );
5197		float dotBV = dot( material.anisotropyB, viewDir );
5198		float dotBH = dot( material.anisotropyB, halfDir );
5199		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
5200		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
5201	#else
5202		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
5203		float D = D_GGX( alpha, dotNH );
5204	#endif
5205	return F * ( V * D );
5206}
5207vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
5208	const float LUT_SIZE = 64.0;
5209	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
5210	const float LUT_BIAS = 0.5 / LUT_SIZE;
5211	float dotNV = saturate( dot( N, V ) );
5212	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
5213	uv = uv * LUT_SCALE + LUT_BIAS;
5214	return uv;
5215}
5216float LTC_ClippedSphereFormFactor( const in vec3 f ) {
5217	float l = length( f );
5218	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
5219}
5220vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
5221	float x = dot( v1, v2 );
5222	float y = abs( x );
5223	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
5224	float b = 3.4175940 + ( 4.1616724 + y ) * y;
5225	float v = a / b;
5226	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
5227	return cross( v1, v2 ) * theta_sintheta;
5228}
5229vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
5230	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
5231	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
5232	vec3 lightNormal = cross( v1, v2 );
5233	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
5234	vec3 T1, T2;
5235	T1 = normalize( V - N * dot( V, N ) );
5236	T2 = - cross( N, T1 );
5237	mat3 mat = mInv * transpose( mat3( T1, T2, N ) );
5238	vec3 coords[ 4 ];
5239	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
5240	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
5241	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
5242	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
5243	coords[ 0 ] = normalize( coords[ 0 ] );
5244	coords[ 1 ] = normalize( coords[ 1 ] );
5245	coords[ 2 ] = normalize( coords[ 2 ] );
5246	coords[ 3 ] = normalize( coords[ 3 ] );
5247	vec3 vectorFormFactor = vec3( 0.0 );
5248	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
5249	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
5250	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
5251	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
5252	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
5253	return vec3( result );
5254}
5255#if defined( USE_SHEEN )
5256float D_Charlie( float roughness, float dotNH ) {
5257	float alpha = pow2( roughness );
5258	float invAlpha = 1.0 / alpha;
5259	float cos2h = dotNH * dotNH;
5260	float sin2h = max( 1.0 - cos2h, 0.0078125 );
5261	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
5262}
5263float V_Neubelt( float dotNV, float dotNL ) {
5264	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
5265}
5266vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
5267	vec3 halfDir = normalize( lightDir + viewDir );
5268	float dotNL = saturate( dot( normal, lightDir ) );
5269	float dotNV = saturate( dot( normal, viewDir ) );
5270	float dotNH = saturate( dot( normal, halfDir ) );
5271	float D = D_Charlie( sheenRoughness, dotNH );
5272	float V = V_Neubelt( dotNV, dotNL );
5273	return sheenColor * ( D * V );
5274}
5275#endif
5276float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
5277	float dotNV = saturate( dot( normal, viewDir ) );
5278	float r2 = roughness * roughness;
5279	float rInv = 1.0 / ( roughness + 0.1 );
5280	float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;
5281	float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;
5282	float DG = exp( a * dotNV + b );
5283	return saturate( DG );
5284}
5285vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
5286	float dotNV = saturate( dot( normal, viewDir ) );
5287	vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
5288	return specularColor * fab.x + specularF90 * fab.y;
5289}
5290#ifdef USE_IRIDESCENCE
5291void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
5292#else
5293void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
5294#endif
5295	float dotNV = saturate( dot( normal, viewDir ) );
5296	vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
5297	#ifdef USE_IRIDESCENCE
5298		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
5299	#else
5300		vec3 Fr = specularColor;
5301	#endif
5302	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
5303	float Ess = fab.x + fab.y;
5304	float Ems = 1.0 - Ess;
5305	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
5306	singleScatter += FssEss;
5307	multiScatter += Fms * Ems;
5308}
5309vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
5310	vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
vendor: 8,354 bytes, lines 5311-5440
5311	float dotNL = saturate( dot( normal, lightDir ) );
5312	float dotNV = saturate( dot( normal, viewDir ) );
5313	vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;
5314	vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;
5315	vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;
5316	vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;
5317	float Ess_V = dfgV.x + dfgV.y;
5318	float Ess_L = dfgL.x + dfgL.y;
5319	float Ems_V = 1.0 - Ess_V;
5320	float Ems_L = 1.0 - Ess_L;
5321	vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;
5322	vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );
5323	float compensationFactor = Ems_V * Ems_L;
5324	vec3 multiScatter = Fms * compensationFactor;
5325	return singleScatter + multiScatter;
5326}
5327#if NUM_RECT_AREA_LIGHTS > 0
5328	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
5329		vec3 normal = geometryNormal;
5330		vec3 viewDir = geometryViewDir;
5331		vec3 position = geometryPosition;
5332		vec3 lightPos = rectAreaLight.position;
5333		vec3 halfWidth = rectAreaLight.halfWidth;
5334		vec3 halfHeight = rectAreaLight.halfHeight;
5335		vec3 lightColor = rectAreaLight.color;
5336		float roughness = material.roughness;
5337		vec3 rectCoords[ 4 ];
5338		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
5339		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
5340		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
5341		vec2 uv = LTC_Uv( normal, viewDir, roughness );
5342		vec4 t1 = texture2D( ltc_1, uv );
5343		vec4 t2 = texture2D( ltc_2, uv );
5344		mat3 mInv = mat3(
5345			vec3( t1.x, 0, t1.y ),
5346			vec3(    0, 1,    0 ),
5347			vec3( t1.z, 0, t1.w )
5348		);
5349		vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );
5350		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
5351		reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
5352		#ifdef USE_CLEARCOAT
5353			vec3 Ncc = geometryClearcoatNormal;
5354			vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );
5355			vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );
5356			vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );
5357			mat3 mInvClearcoat = mat3(
5358				vec3( t1Clearcoat.x, 0, t1Clearcoat.y ),
5359				vec3(             0, 1,             0 ),
5360				vec3( t1Clearcoat.z, 0, t1Clearcoat.w )
5361			);
5362			vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;
5363			clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );
5364		#endif
5365	}
5366#endif
5367void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
5368	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
5369	vec3 irradiance = dotNL * directLight.color;
5370	#ifdef USE_CLEARCOAT
5371		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
5372		vec3 ccIrradiance = dotNLcc * directLight.color;
5373		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
5374	#endif
5375	#ifdef USE_SHEEN
5376 
5377 		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
5378 
5379 		float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
5380 		float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );
5381 
5382 		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );
5383 
5384 		irradiance *= sheenEnergyComp;
5385 
5386 	#endif
5387	reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );
5388	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );
5389}
5390void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
5391	vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );
5392	#ifdef USE_SHEEN
5393		float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
5394		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
5395		diffuse *= sheenEnergyComp;
5396	#endif
5397	reflectedLight.indirectDiffuse += diffuse;
5398}
5399void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
5400	#ifdef USE_CLEARCOAT
5401		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
5402	#endif
5403	#ifdef USE_SHEEN
5404		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;
5405 	#endif
5406	vec3 singleScatteringDielectric = vec3( 0.0 );
5407	vec3 multiScatteringDielectric = vec3( 0.0 );
5408	vec3 singleScatteringMetallic = vec3( 0.0 );
5409	vec3 multiScatteringMetallic = vec3( 0.0 );
5410	#ifdef USE_IRIDESCENCE
5411		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
5412		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
5413	#else
5414		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
5415		computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
5416	#endif
5417	vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );
5418	vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );
5419	vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;
5420	vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );
5421	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
5422	vec3 indirectSpecular = radiance * singleScattering;
5423	indirectSpecular += multiScattering * cosineWeightedIrradiance;
5424	vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;
5425	#ifdef USE_SHEEN
5426		float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
5427		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
5428		indirectSpecular *= sheenEnergyComp;
5429		indirectDiffuse *= sheenEnergyComp;
5430	#endif
5431	reflectedLight.indirectSpecular += indirectSpecular;
5432	reflectedLight.indirectDiffuse += indirectDiffuse;
5433}
5434#define RE_Direct				RE_Direct_Physical
5435#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
5436#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
5437#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
5438float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
5439	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
5440}`,
5440aie=`
5441vec3 geometryPosition = - vViewPosition;
5442vec3 geometryNormal = normal;
5443vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
5444vec3 geometryClearcoatNormal = vec3( 0.0 );
5445#ifdef USE_CLEARCOAT
5446	geometryClearcoatNormal = clearcoatNormal;
5447#endif
5448#ifdef USE_IRIDESCENCE
5449	float dotNVi = saturate( dot( normal, geometryViewDir ) );
5450	if ( material.iridescenceThickness == 0.0 ) {
5451		material.iridescence = 0.0;
5452	} else {
5453		material.iridescence = saturate( material.iridescence );
5454	}
5455	if ( material.iridescence > 0.0 ) {
5456		material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
5457		material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );
5458		material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );
5459		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
5460	}
5461#endif
5462IncidentLight directLight;
5463#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
5464	PointLight pointLight;
5465	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
5466	PointLightShadow pointLightShadow;
5467	#endif
5468	#pragma unroll_loop_start
5469	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
5470		pointLight = pointLights[ i ];
5471		getPointLightInfo( pointLight, geometryPosition, directLight );
5472		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
5473		pointLightShadow = pointLightShadows[ i ];
5474		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
5475		#endif
5476		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
5477	}
5478	#pragma unroll_loop_end
5479#endif
5480#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
5481	SpotLight spotLight;
5482	vec4 spotColor;
5483	vec3 spotLightCoord;
5484	bool inSpotLightMap;
5485	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
5486	SpotLightShadow spotLightShadow;
5487	#endif
5488	#pragma unroll_loop_start
5489	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
5490		spotLight = spotLights[ i ];
5491		getSpotLightInfo( spotLight, geometryPosition, directLight );
5492		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
5493		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
5494		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
5495		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
5496		#else
5497		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
5498		#endif
5499		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
5500			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
5501			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
5502			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
5503			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
5504		#endif
5505		#undef SPOT_LIGHT_MAP_INDEX
5506		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
5507		spotLightShadow = spotLightShadows[ i ];
5508		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
5509		#endif
5510		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
5511	}
5512	#pragma unroll_loop_end
5513#endif
5514#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
5515	DirectionalLight directionalLight;
5516	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
5517	DirectionalLightShadow directionalLightShadow;
5518	#endif
5519	#pragma unroll_loop_start
5520	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
5521		directionalLight = directionalLights[ i ];
5522		getDirectionalLightInfo( directionalLight, directLight );
5523		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
5524		directionalLightShadow = directionalLightShadows[ i ];
5525		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
5526		#endif
5527		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
5528	}
5529	#pragma unroll_loop_end
5530#endif
5531#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
5532	RectAreaLight rectAreaLight;
5533	#pragma unroll_loop_start
5534	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
5535		rectAreaLight = rectAreaLights[ i ];
5536		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
5537	}
5538	#pragma unroll_loop_end
5539#endif
5540#if defined( RE_IndirectDiffuse )
5541	vec3 iblIrradiance = vec3( 0.0 );
5542	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
5543	#if defined( USE_LIGHT_PROBES )
5544		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
5545	#endif
5546	#if ( NUM_HEMI_LIGHTS > 0 )
5547		#pragma unroll_loop_start
5548		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
5549			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
5550		}
5551		#pragma unroll_loop_end
5552	#endif
5553#endif
5554#if defined( RE_IndirectSpecular )
5555	vec3 radiance = vec3( 0.0 );
5556	vec3 clearcoatRadiance = vec3( 0.0 );
5557#endif`,lie=`#if defined( RE_IndirectDiffuse )
5558	#ifdef USE_LIGHTMAP
5559		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
5560		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
5561		irradiance += lightMapIrradiance;
5562	#endif
5563	#if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV )
5564		#if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG )
5565			iblIrradiance += getIBLIrradiance( geometryNormal );
5566		#endif
5567	#endif
5568#endif
5569#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
5570	#ifdef USE_ANISOTROPY
5571		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
5572	#else
5573		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
5574	#endif
5575	#ifdef USE_CLEARCOAT
5576		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
5577	#endif
5578#endif`,cie=`#if defined( RE_IndirectDiffuse )
5579	#if defined( LAMBERT ) || defined( PHONG )
5580		irradiance += iblIrradiance;
5581	#endif
5582	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
5583#endif
5584#if defined( RE_IndirectSpecular )
5585	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
5586#endif`,uie=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
5587	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
5588#endif`,die=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
5589	uniform float logDepthBufFC;
5590	varying float vFragDepth;
5591	varying float vIsPerspective;
5592#endif`,fie=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
5593	varying float vFragDepth;
5594	varying float vIsPerspective;
5595#endif`,hie=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
5596	vFragDepth = 1.0 + gl_Position.w;
5597	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
5598#endif`,pie=`#ifdef USE_MAP
5599	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
5600	#ifdef DECODE_VIDEO_TEXTURE
5601		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
5602	#endif
5603	diffuseColor *= sampledDiffuseColor;
5604#endif`,mie=`#ifdef USE_MAP
5605	uniform sampler2D map;
5606#endif`,gie=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
5607	#if defined( USE_POINTS_UV )
5608		vec2 uv = vUv;
5609	#else
5610		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
5611	#endif
5612#endif
5613#ifdef USE_MAP
5614	diffuseColor *= texture2D( map, uv );
5615#endif
5616#ifdef USE_ALPHAMAP
5617	diffuseColor.a *= texture2D( alphaMap, uv ).g;
5618#endif`,vie=`#if defined( USE_POINTS_UV )
5619	varying vec2 vUv;
5620#else
5621	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
5622		uniform mat3 uvTransform;
5623	#endif
5624#endif
5625#ifdef USE_MAP
5626	uniform sampler2D map;
5627#endif
5628#ifdef USE_ALPHAMAP
5629	uniform sampler2D alphaMap;
5630#endif`,yie=`float metalnessFactor = metalness;
5631#ifdef USE_METALNESSMAP
5632	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
5633	metalnessFactor *= texelMetalness.b;
5634#endif`,_ie=`#ifdef USE_METALNESSMAP
5635	uniform sampler2D metalnessMap;
5636#endif`,xie=`#ifdef USE_INSTANCING_MORPH
5637	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
5638	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
5639	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
5640		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
5641	}
5642#endif`,bie=`#if defined( USE_MORPHCOLORS )
5643	vColor *= morphTargetBaseInfluence;
5644	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
5645		#if defined( USE_COLOR_ALPHA )
5646			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
5647		#elif defined( USE_COLOR )
5648			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
5649		#endif
5650	}
5651#endif`,wie=`#ifdef USE_MORPHNORMALS
5652	objectNormal *= morphTargetBaseInfluence;
5653	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
5654		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
5655	}
5656#endif`,Eie=`#ifdef USE_MORPHTARGETS
5657	#ifndef USE_INSTANCING_MORPH
5658		uniform float morphTargetBaseInfluence;
5659		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
5660	#endif
5661	uniform sampler2DArray morphTargetsTexture;
5662	uniform ivec2 morphTargetsTextureSize;
5663	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
5664		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
5665		int y = texelIndex / morphTargetsTextureSize.x;
5666		int x = texelIndex - y * morphTargetsTextureSize.x;
5667		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
5668		return texelFetch( morphTargetsTexture, morphUV, 0 );
5669	}
5670#endif`,Sie=`#ifdef USE_MORPHTARGETS
5671	transformed *= morphTargetBaseInfluence;
5672	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
5673		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
5674	}
5675#endif`,Tie=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
5676#ifdef FLAT_SHADED
5677	vec3 fdx = dFdx( vViewPosition );
5678	vec3 fdy = dFdy( vViewPosition );
5679	vec3 normal = normalize( cross( fdx, fdy ) );
5680#else
5681	vec3 normal = normalize( vNormal );
5682	#ifdef DOUBLE_SIDED
5683		normal *= faceDirection;
5684	#endif
5685#endif
5686#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
5687	#ifdef USE_TANGENT
5688		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
5689	#else
5690		mat3 tbn = getTangentFrame( - vViewPosition, normal,
5691		#if defined( USE_NORMALMAP )
5692			vNormalMapUv
5693		#elif defined( USE_CLEARCOAT_NORMALMAP )
5694			vClearcoatNormalMapUv
5695		#else
5696			vUv
5697		#endif
5698		);
5699	#endif
5700	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
5701		tbn[0] *= faceDirection;
5702		tbn[1] *= faceDirection;
5703	#endif
5704#endif
5705#ifdef USE_CLEARCOAT_NORMALMAP
5706	#ifdef USE_TANGENT
5707		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
5708	#else
5709		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
5710	#endif
5711	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
5712		tbn2[0] *= faceDirection;
5713		tbn2[1] *= faceDirection;
5714	#endif
5715#endif
5716vec3 nonPerturbedNormal = normal;`,Aie=`#ifdef USE_NORMALMAP_OBJECTSPACE
5717	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
5718	#ifdef FLIP_SIDED
5719		normal = - normal;
5720	#endif
5721	#ifdef DOUBLE_SIDED
5722		normal = normal * faceDirection;
5723	#endif
5724	normal = normalize( normalMatrix * normal );
5725#elif defined( USE_NORMALMAP_TANGENTSPACE )
5726	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
5727	mapN.xy *= normalScale;
5728	normal = normalize( tbn * mapN );
5729#elif defined( USE_BUMPMAP )
5730	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
5731#endif`,Mie=`#ifndef FLAT_SHADED
5732	varying vec3 vNormal;
5733	#ifdef USE_TANGENT
5734		varying vec3 vTangent;
5735		varying vec3 vBitangent;
5736	#endif
5737#endif`,Cie=`#ifndef FLAT_SHADED
5738	varying vec3 vNormal;
5739	#ifdef USE_TANGENT
5740		varying vec3 vTangent;
5741		varying vec3 vBitangent;
5742	#endif
5743#endif`,Rie=`#ifndef FLAT_SHADED
5744	vNormal = normalize( transformedNormal );
5745	#ifdef USE_TANGENT
5746		vTangent = normalize( transformedTangent );
5747		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
5748	#endif
5749#endif`,Pie=`#ifdef USE_NORMALMAP
5750	uniform sampler2D normalMap;
5751	uniform vec2 normalScale;
5752#endif
5753#ifdef USE_NORMALMAP_OBJECTSPACE
5754	uniform mat3 normalMatrix;
5755#endif
5756#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
5757	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
5758		vec3 q0 = dFdx( eye_pos.xyz );
5759		vec3 q1 = dFdy( eye_pos.xyz );
5760		vec2 st0 = dFdx( uv.st );
5761		vec2 st1 = dFdy( uv.st );
5762		vec3 N = surf_norm;
5763		vec3 q1perp = cross( q1, N );
5764		vec3 q0perp = cross( N, q0 );
5765		vec3 T = q1perp * st0.x + q0perp * st1.x;
5766		vec3 B = q1perp * st0.y + q0perp * st1.y;
5767		float det = max( dot( T, T ), dot( B, B ) );
5768		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
5769		return mat3( T * scale, B * scale, N );
5770	}
5771#endif`,Iie=`#ifdef USE_CLEARCOAT
5772	vec3 clearcoatNormal = nonPerturbedNormal;
5773#endif`,Nie=`#ifdef USE_CLEARCOAT_NORMALMAP
5774	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
5775	clearcoatMapN.xy *= clearcoatNormalScale;
5776	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
5777#endif`,Oie=`#ifdef USE_CLEARCOATMAP
5778	uniform sampler2D clearcoatMap;
5779#endif
5780#ifdef USE_CLEARCOAT_NORMALMAP
5781	uniform sampler2D clearcoatNormalMap;
5782	uniform vec2 clearcoatNormalScale;
5783#endif
5784#ifdef USE_CLEARCOAT_ROUGHNESSMAP
5785	uniform sampler2D clearcoatRoughnessMap;
5786#endif`,Die=`#ifdef USE_IRIDESCENCEMAP
5787	uniform sampler2D iridescenceMap;
5788#endif
5789#ifdef USE_IRIDESCENCE_THICKNESSMAP
5790	uniform sampler2D iridescenceThicknessMap;
5791#endif`,kie=`#ifdef OPAQUE
5792diffuseColor.a = 1.0;
5793#endif
5794#ifdef USE_TRANSMISSION
5795diffuseColor.a *= material.transmissionAlpha;
5796#endif
5797gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Lie=`vec3 packNormalToRGB( const in vec3 normal ) {
5798	return normalize( normal ) * 0.5 + 0.5;
5799}
5800vec3 unpackRGBToNormal( const in vec3 rgb ) {
5801	return 2.0 * rgb.xyz - 1.0;
5802}
5803const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
5804const float Inv255 = 1. / 255.;
5805const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
5806const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
5807const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
5808const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
5809vec4 packDepthToRGBA( const in float v ) {
5810	if( v <= 0.0 )
5811		return vec4( 0., 0., 0., 0. );
5812	if( v >= 1.0 )
5813		return vec4( 1., 1., 1., 1. );
5814	float vuf;
5815	float af = modf( v * PackFactors.a, vuf );
5816	float bf = modf( vuf * ShiftRight8, vuf );
5817	float gf = modf( vuf * ShiftRight8, vuf );
5818	return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
5819}
5820vec3 packDepthToRGB( const in float v ) {
5821	if( v <= 0.0 )
5822		return vec3( 0., 0., 0. );
5823	if( v >= 1.0 )
5824		return vec3( 1., 1., 1. );
5825	float vuf;
5826	float bf = modf( v * PackFactors.b, vuf );
5827	float gf = modf( vuf * ShiftRight8, vuf );
5828	return vec3( vuf * Inv255, gf * PackUpscale, bf );
5829}
5830vec2 packDepthToRG( const in float v ) {
5831	if( v <= 0.0 )
5832		return vec2( 0., 0. );
5833	if( v >= 1.0 )
5834		return vec2( 1., 1. );
5835	float vuf;
5836	float gf = modf( v * 256., vuf );
5837	return vec2( vuf * Inv255, gf );
5838}
5839float unpackRGBAToDepth( const in vec4 v ) {
5840	return dot( v, UnpackFactors4 );
5841}
5842float unpackRGBToDepth( const in vec3 v ) {
5843	return dot( v, UnpackFactors3 );
5844}
5845float unpackRGToDepth( const in vec2 v ) {
5846	return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
5847}
5848vec4 pack2HalfToRGBA( const in vec2 v ) {
5849	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
5850	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
5851}
5852vec2 unpackRGBATo2Half( const in vec4 v ) {
5853	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
5854}
5855float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
5856	return ( viewZ + near ) / ( near - far );
5857}
5858float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
5859	#ifdef USE_REVERSED_DEPTH_BUFFER
5860	
5861		return depth * ( far - near ) - far;
5862	#else
5863		return depth * ( near - far ) - near;
5864	#endif
5865}
5866float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
5867	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
5868}
5869float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
5870	
5871	#ifdef USE_REVERSED_DEPTH_BUFFER
5872		return ( near * far ) / ( ( near - far ) * depth - near );
5873	#else
5874		return ( near * far ) / ( ( far - near ) * depth - far );
5875	#endif
5876}`,Fie=`#ifdef PREMULTIPLIED_ALPHA
5877	gl_FragColor.rgb *= gl_FragColor.a;
5878#endif`,Uie=`vec4 mvPosition = vec4( transformed, 1.0 );
5879#ifdef USE_BATCHING
5880	mvPosition = batchingMatrix * mvPosition;
5881#endif
5882#ifdef USE_INSTANCING
5883	mvPosition = instanceMatrix * mvPosition;
5884#endif
5885mvPosition = modelViewMatrix * mvPosition;
5886gl_Position = projectionMatrix * mvPosition;`,jie=`#ifdef DITHERING
5887	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
5888#endif`,Bie=`#ifdef DITHERING
5889	vec3 dithering( vec3 color ) {
5890		float grid_position = rand( gl_FragCoord.xy );
5891		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
5892		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
5893		return color + dither_shift_RGB;
5894	}
5895#endif`,Vie=`float roughnessFactor = roughness;
5896#ifdef USE_ROUGHNESSMAP
5897	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
5898	roughnessFactor *= texelRoughness.g;
5899#endif`,zie=`#ifdef USE_ROUGHNESSMAP
5900	uniform sampler2D roughnessMap;
5901#endif`,Hie=`#if NUM_SPOT_LIGHT_COORDS > 0
5902	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
5903#endif
5904#if NUM_SPOT_LIGHT_MAPS > 0
5905	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
5906#endif
5907#ifdef USE_SHADOWMAP
5908	#if NUM_DIR_LIGHT_SHADOWS > 0
5909		#if defined( SHADOWMAP_TYPE_PCF )
5910			uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
5911		#else
5912			uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
5913		#endif
5914		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
5915		struct DirectionalLightShadow {
5916			float shadowIntensity;
5917			float shadowBias;
5918			float shadowNormalBias;
5919			float shadowRadius;
5920			vec2 shadowMapSize;
5921		};
5922		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
5923	#endif
5924	#if NUM_SPOT_LIGHT_SHADOWS > 0
5925		#if defined( SHADOWMAP_TYPE_PCF )
5926			uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
5927		#else
5928			uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
5929		#endif
5930		struct SpotLightShadow {
5931			float shadowIntensity;
5932			float shadowBias;
5933			float shadowNormalBias;
5934			float shadowRadius;
5935			vec2 shadowMapSize;
5936		};
5937		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
5938	#endif
5939	#if NUM_POINT_LIGHT_SHADOWS > 0
5940		#if defined( SHADOWMAP_TYPE_PCF )
5941			uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
5942		#elif defined( SHADOWMAP_TYPE_BASIC )
5943			uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
5944		#endif
5945		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
5946		struct PointLightShadow {
5947			float shadowIntensity;
5948			float shadowBias;
5949			float shadowNormalBias;
5950			float shadowRadius;
5951			vec2 shadowMapSize;
5952			float shadowCameraNear;
5953			float shadowCameraFar;
5954		};
5955		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
5956	#endif
5957	#if defined( SHADOWMAP_TYPE_PCF )
5958		float interleavedGradientNoise( vec2 position ) {
5959			return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );
5960		}
5961		vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {
5962			const float goldenAngle = 2.399963229728653;
5963			float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );
5964			float theta = float( sampleIndex ) * goldenAngle + phi;
5965			return vec2( cos( theta ), sin( theta ) ) * r;
5966		}
5967	#endif
5968	#if defined( SHADOWMAP_TYPE_PCF )
5969		float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
5970			float shadow = 1.0;
5971			shadowCoord.xyz /= shadowCoord.w;
5972			shadowCoord.z += shadowBias;
5973			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
5974			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
5975			if ( frustumTest ) {
5976				vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
5977				float radius = shadowRadius * texelSize.x;
5978				float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
5979				shadow = (
5980					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +
5981					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +
5982					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +
5983					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +
5984					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )
5985				) * 0.2;
5986			}
5987			return mix( 1.0, shadow, shadowIntensity );
5988		}
5989	#elif defined( SHADOWMAP_TYPE_VSM )
5990		float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
5991			float shadow = 1.0;
5992			shadowCoord.xyz /= shadowCoord.w;
5993			#ifdef USE_REVERSED_DEPTH_BUFFER
5994				shadowCoord.z -= shadowBias;
5995			#else
5996				shadowCoord.z += shadowBias;
5997			#endif
5998			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
5999			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
6000			if ( frustumTest ) {
6001				vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;
6002				float mean = distribution.x;
6003				float variance = distribution.y * distribution.y;
6004				#ifdef USE_REVERSED_DEPTH_BUFFER
6005					float hard_shadow = step( mean, shadowCoord.z );
6006				#else
6007					float hard_shadow = step( shadowCoord.z, mean );
6008				#endif
6009				
6010				if ( hard_shadow == 1.0 ) {
6011					shadow = 1.0;
6012				} else {
6013					variance = max( variance, 0.0000001 );
6014					float d = shadowCoord.z - mean;
6015					float p_max = variance / ( variance + d * d );
6016					p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );
6017					shadow = max( hard_shadow, p_max );
6018				}
6019			}
6020			return mix( 1.0, shadow, shadowIntensity );
6021		}
6022	#else
6023		float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
6024			float shadow = 1.0;
6025			shadowCoord.xyz /= shadowCoord.w;
6026			#ifdef USE_REVERSED_DEPTH_BUFFER
6027				shadowCoord.z -= shadowBias;
6028			#else
6029				shadowCoord.z += shadowBias;
6030			#endif
6031			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
6032			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
6033			if ( frustumTest ) {
6034				float depth = texture2D( shadowMap, shadowCoord.xy ).r;
6035				#ifdef USE_REVERSED_DEPTH_BUFFER
6036					shadow = step( depth, shadowCoord.z );
6037				#else
6038					shadow = step( shadowCoord.z, depth );
6039				#endif
6040			}
6041			return mix( 1.0, shadow, shadowIntensity );
6042		}
6043	#endif
6044	#if NUM_POINT_LIGHT_SHADOWS > 0
6045	#if defined( SHADOWMAP_TYPE_PCF )
6046	float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
6047		float shadow = 1.0;
6048		vec3 lightToPosition = shadowCoord.xyz;
6049		vec3 bd3D = normalize( lightToPosition );
6050		vec3 absVec = abs( lightToPosition );
6051		float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
6052		if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
6053			#ifdef USE_REVERSED_DEPTH_BUFFER
6054				float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
6055				dp -= shadowBias;
6056			#else
6057				float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
6058				dp += shadowBias;
6059			#endif
6060			float texelSize = shadowRadius / shadowMapSize.x;
6061			vec3 absDir = abs( bd3D );
6062			vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );
6063			tangent = normalize( cross( bd3D, tangent ) );
6064			vec3 bitangent = cross( bd3D, tangent );
6065			float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
6066			vec2 sample0 = vogelDiskSample( 0, 5, phi );
6067			vec2 sample1 = vogelDiskSample( 1, 5, phi );
6068			vec2 sample2 = vogelDiskSample( 2, 5, phi );
6069			vec2 sample3 = vogelDiskSample( 3, 5, phi );
6070			vec2 sample4 = vogelDiskSample( 4, 5, phi );
6071			shadow = (
6072				texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) +
6073				texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) +
6074				texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) +
6075				texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) +
6076				texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) )
6077			) * 0.2;
6078		}
6079		return mix( 1.0, shadow, shadowIntensity );
6080	}
6081	#elif defined( SHADOWMAP_TYPE_BASIC )
6082	float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
6083		float shadow = 1.0;
6084		vec3 lightToPosition = shadowCoord.xyz;
6085		vec3 absVec = abs( lightToPosition );
6086		float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
6087		if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
6088			float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
6089			dp += shadowBias;
6090			vec3 bd3D = normalize( lightToPosition );
6091			float depth = textureCube( shadowMap, bd3D ).r;
6092			#ifdef USE_REVERSED_DEPTH_BUFFER
6093				depth = 1.0 - depth;
6094			#endif
6095			shadow = step( dp, depth );
6096		}
6097		return mix( 1.0, shadow, shadowIntensity );
6098	}
6099	#endif
6100	#endif
6101#endif`,Gie=`#if NUM_SPOT_LIGHT_COORDS > 0
6102	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
6103	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
6104#endif
6105#ifdef USE_SHADOWMAP
6106	#if NUM_DIR_LIGHT_SHADOWS > 0
6107		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
6108		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
6109		struct DirectionalLightShadow {
6110			float shadowIntensity;
6111			float shadowBias;
6112			float shadowNormalBias;
6113			float shadowRadius;
6114			vec2 shadowMapSize;
6115		};
6116		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
6117	#endif
6118	#if NUM_SPOT_LIGHT_SHADOWS > 0
6119		struct SpotLightShadow {
6120			float shadowIntensity;
6121			float shadowBias;
6122			float shadowNormalBias;
6123			float shadowRadius;
6124			vec2 shadowMapSize;
6125		};
6126		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
6127	#endif
6128	#if NUM_POINT_LIGHT_SHADOWS > 0
6129		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
6130		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
6131		struct PointLightShadow {
6132			float shadowIntensity;
6133			float shadowBias;
6134			float shadowNormalBias;
6135			float shadowRadius;
6136			vec2 shadowMapSize;
6137			float shadowCameraNear;
6138			float shadowCameraFar;
6139		};
6140		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
6141	#endif
6142#endif`,$ie=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
6143	vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
6144	vec4 shadowWorldPosition;
6145#endif
6146#if defined( USE_SHADOWMAP )
6147	#if NUM_DIR_LIGHT_SHADOWS > 0
6148		#pragma unroll_loop_start
6149		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
6150			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
6151			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
6152		}
6153		#pragma unroll_loop_end
6154	#endif
6155	#if NUM_POINT_LIGHT_SHADOWS > 0
6156		#pragma unroll_loop_start
6157		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
6158			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
6159			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
6160		}
6161		#pragma unroll_loop_end
6162	#endif
6163#endif
6164#if NUM_SPOT_LIGHT_COORDS > 0
6165	#pragma unroll_loop_start
6166	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
6167		shadowWorldPosition = worldPosition;
6168		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
6169			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
6170		#endif
6171		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
6172	}
6173	#pragma unroll_loop_end
6174#endif`,Wie=`float getShadowMask() {
6175	float shadow = 1.0;
6176	#ifdef USE_SHADOWMAP
6177	#if NUM_DIR_LIGHT_SHADOWS > 0
6178	DirectionalLightShadow directionalLight;
6179	#pragma unroll_loop_start
6180	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
6181		directionalLight = directionalLightShadows[ i ];
6182		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
6183	}
6184	#pragma unroll_loop_end
6185	#endif
6186	#if NUM_SPOT_LIGHT_SHADOWS > 0
6187	SpotLightShadow spotLight;
6188	#pragma unroll_loop_start
6189	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
6190		spotLight = spotLightShadows[ i ];
6191		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
6192	}
6193	#pragma unroll_loop_end
6194	#endif
6195	#if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
6196	PointLightShadow pointLight;
6197	#pragma unroll_loop_start
6198	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
6199		pointLight = pointLightShadows[ i ];
6200		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
6201	}
6202	#pragma unroll_loop_end
6203	#endif
6204	#endif
6205	return shadow;
6206}`,qie=`#ifdef USE_SKINNING
6207	mat4 boneMatX = getBoneMatrix( skinIndex.x );
6208	mat4 boneMatY = getBoneMatrix( skinIndex.y );
6209	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
6210	mat4 boneMatW = getBoneMatrix( skinIndex.w );
6211#endif`,Kie=`#ifdef USE_SKINNING
6212	uniform mat4 bindMatrix;
6213	uniform mat4 bindMatrixInverse;
6214	uniform highp sampler2D boneTexture;
6215	mat4 getBoneMatrix( const in float i ) {
6216		int size = textureSize( boneTexture, 0 ).x;
6217		int j = int( i ) * 4;
6218		int x = j % size;
6219		int y = j / size;
6220		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
6221		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
6222		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
6223		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
6224		return mat4( v1, v2, v3, v4 );
6225	}
6226#endif`,Xie=`#ifdef USE_SKINNING
6227	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
6228	vec4 skinned = vec4( 0.0 );
6229	skinned += boneMatX * skinVertex * skinWeight.x;
6230	skinned += boneMatY * skinVertex * skinWeight.y;
6231	skinned += boneMatZ * skinVertex * skinWeight.z;
6232	skinned += boneMatW * skinVertex * skinWeight.w;
6233	transformed = ( bindMatrixInverse * skinned ).xyz;
6234#endif`,Yie=`#ifdef USE_SKINNING
6235	mat4 skinMatrix = mat4( 0.0 );
6236	skinMatrix += skinWeight.x * boneMatX;
6237	skinMatrix += skinWeight.y * boneMatY;
6238	skinMatrix += skinWeight.z * boneMatZ;
6239	skinMatrix += skinWeight.w * boneMatW;
6240	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
6241	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
6242	#ifdef USE_TANGENT
6243		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
6244	#endif
6245#endif`,Qie=`float specularStrength;
6246#ifdef USE_SPECULARMAP
6247	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
6248	specularStrength = texelSpecular.r;
6249#else
6250	specularStrength = 1.0;
6251#endif`,Zie=`#ifdef USE_SPECULARMAP
6252	uniform sampler2D specularMap;
6253#endif`,Jie=`#if defined( TONE_MAPPING )
6254	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
6255#endif`,ese=`#ifndef saturate
6256#define saturate( a ) clamp( a, 0.0, 1.0 )
6257#endif
6258uniform float toneMappingExposure;
6259vec3 LinearToneMapping( vec3 color ) {
6260	return saturate( toneMappingExposure * color );
6261}
6262vec3 ReinhardToneMapping( vec3 color ) {
6263	color *= toneMappingExposure;
6264	return saturate( color / ( vec3( 1.0 ) + color ) );
6265}
6266vec3 CineonToneMapping( vec3 color ) {
6267	color *= toneMappingExposure;
6268	color = max( vec3( 0.0 ), color - 0.004 );
6269	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
6270}
6271vec3 RRTAndODTFit( vec3 v ) {
6272	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
6273	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
6274	return a / b;
6275}
6276vec3 ACESFilmicToneMapping( vec3 color ) {
6277	const mat3 ACESInputMat = mat3(
6278		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
6279		vec3( 0.04823, 0.01566, 0.83777 )
6280	);
6281	const mat3 ACESOutputMat = mat3(
6282		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
6283		vec3( -0.07367, -0.00605,  1.07602 )
6284	);
6285	color *= toneMappingExposure / 0.6;
6286	color = ACESInputMat * color;
6287	color = RRTAndODTFit( color );
6288	color = ACESOutputMat * color;
6289	return saturate( color );
6290}
6291const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
6292	vec3( 1.6605, - 0.1246, - 0.0182 ),
6293	vec3( - 0.5876, 1.1329, - 0.1006 ),
6294	vec3( - 0.0728, - 0.0083, 1.1187 )
6295);
6296const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
6297	vec3( 0.6274, 0.0691, 0.0164 ),
6298	vec3( 0.3293, 0.9195, 0.0880 ),
6299	vec3( 0.0433, 0.0113, 0.8956 )
6300);
6301vec3 agxDefaultContrastApprox( vec3 x ) {
6302	vec3 x2 = x * x;
6303	vec3 x4 = x2 * x2;
6304	return + 15.5 * x4 * x2
6305		- 40.14 * x4 * x
6306		+ 31.96 * x4
6307		- 6.868 * x2 * x
6308		+ 0.4298 * x2
6309		+ 0.1191 * x
6310		- 0.00232;
6311}
6312vec3 AgXToneMapping( vec3 color ) {
6313	const mat3 AgXInsetMatrix = mat3(
6314		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
6315		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
6316		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
6317	);
6318	const mat3 AgXOutsetMatrix = mat3(
6319		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
6320		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
6321		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
6322	);
6323	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
6324	color *= toneMappingExposure;
6325	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
6326	color = AgXInsetMatrix * color;
6327	color = max( color, 1e-10 );	color = log2( color );
6328	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
6329	color = clamp( color, 0.0, 1.0 );
6330	color = agxDefaultContrastApprox( color );
6331	color = AgXOutsetMatrix * color;
6332	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
6333	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
6334	color = clamp( color, 0.0, 1.0 );
6335	return color;
6336}
6337vec3 NeutralToneMapping( vec3 color ) {
6338	const float StartCompression = 0.8 - 0.04;
6339	const float Desaturation = 0.15;
6340	color *= toneMappingExposure;
6341	float x = min( color.r, min( color.g, color.b ) );
6342	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
6343	color -= offset;
6344	float peak = max( color.r, max( color.g, color.b ) );
6345	if ( peak < StartCompression ) return color;
6346	float d = 1. - StartCompression;
6347	float newPeak = 1. - d * d / ( peak + d - StartCompression );
6348	color *= newPeak / peak;
6349	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
6350	return mix( color, vec3( newPeak ), g );
6351}
6352vec3 CustomToneMapping( vec3 color ) { return color; }`,tse=`#ifdef USE_TRANSMISSION
6353	material.transmission = transmission;
6354	material.transmissionAlpha = 1.0;
6355	material.thickness = thickness;
6356	material.attenuationDistance = attenuationDistance;
6357	material.attenuationColor = attenuationColor;
6358	#ifdef USE_TRANSMISSIONMAP
6359		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
6360	#endif
6361	#ifdef USE_THICKNESSMAP
6362		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
6363	#endif
6364	vec3 pos = vWorldPosition;
6365	vec3 v = normalize( cameraPosition - pos );
6366	vec3 n = inverseTransformDirection( normal, viewMatrix );
6367	vec4 transmitted = getIBLVolumeRefraction(
6368		n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90,
6369		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
6370		material.attenuationColor, material.attenuationDistance );
6371	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
6372	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
6373#endif`,nse=`#ifdef USE_TRANSMISSION
6374	uniform float transmission;
6375	uniform float thickness;
6376	uniform float attenuationDistance;
6377	uniform vec3 attenuationColor;
6378	#ifdef USE_TRANSMISSIONMAP
6379		uniform sampler2D transmissionMap;
6380	#endif
6381	#ifdef USE_THICKNESSMAP
6382		uniform sampler2D thicknessMap;
6383	#endif
6384	uniform vec2 transmissionSamplerSize;
6385	uniform sampler2D transmissionSamplerMap;
6386	uniform mat4 modelMatrix;
6387	uniform mat4 projectionMatrix;
6388	varying vec3 vWorldPosition;
6389	float w0( float a ) {
6390		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
6391	}
6392	float w1( float a ) {
6393		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
6394	}
6395	float w2( float a ){
6396		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
6397	}
6398	float w3( float a ) {
6399		return ( 1.0 / 6.0 ) * ( a * a * a );
6400	}
6401	float g0( float a ) {
6402		return w0( a ) + w1( a );
6403	}
6404	float g1( float a ) {
6405		return w2( a ) + w3( a );
6406	}
6407	float h0( float a ) {
6408		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
6409	}
6410	float h1( float a ) {
6411		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
6412	}
6413	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
6414		uv = uv * texelSize.zw + 0.5;
6415		vec2 iuv = floor( uv );
6416		vec2 fuv = fract( uv );
6417		float g0x = g0( fuv.x );
6418		float g1x = g1( fuv.x );
6419		float h0x = h0( fuv.x );
6420		float h1x = h1( fuv.x );
6421		float h0y = h0( fuv.y );
6422		float h1y = h1( fuv.y );
6423		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
6424		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
6425		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
6426		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
6427		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
6428			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
6429	}
6430	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
6431		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
6432		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
6433		vec2 fLodSizeInv = 1.0 / fLodSize;
6434		vec2 cLodSizeInv = 1.0 / cLodSize;
6435		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
6436		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
6437		return mix( fSample, cSample, fract( lod ) );
6438	}
6439	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
6440		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
6441		vec3 modelScale;
6442		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
6443		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
6444		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
6445		return normalize( refractionVector ) * thickness * modelScale;
6446	}
6447	float applyIorToRoughness( const in float roughness, const in float ior ) {
6448		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
6449	}
6450	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
6451		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
6452		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
6453	}
6454	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
6455		if ( isinf( attenuationDistance ) ) {
6456			return vec3( 1.0 );
6457		} else {
6458			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
6459			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
6460		}
6461	}
6462	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
6463		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
6464		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
6465		const in vec3 attenuationColor, const in float attenuationDistance ) {
6466		vec4 transmittedLight;
6467		vec3 transmittance;
6468		#ifdef USE_DISPERSION
6469			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
6470			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
6471			for ( int i = 0; i < 3; i ++ ) {
6472				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
6473				vec3 refractedRayExit = position + transmissionRay;
6474				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
6475				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
6476				refractionCoords += 1.0;
6477				refractionCoords /= 2.0;
6478				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
6479				transmittedLight[ i ] = transmissionSample[ i ];
6480				transmittedLight.a += transmissionSample.a;
6481				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
6482			}
6483			transmittedLight.a /= 3.0;
6484		#else
6485			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
6486			vec3 refractedRayExit = position + transmissionRay;
6487			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
6488			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
6489			refractionCoords += 1.0;
6490			refractionCoords /= 2.0;
6491			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
6492			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
6493		#endif
6494		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
6495		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
6496		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
6497		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
6498	}
6499#endif`,rse=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
6500	varying vec2 vUv;
6501#endif
6502#ifdef USE_MAP
6503	varying vec2 vMapUv;
6504#endif
6505#ifdef USE_ALPHAMAP
6506	varying vec2 vAlphaMapUv;
6507#endif
6508#ifdef USE_LIGHTMAP
6509	varying vec2 vLightMapUv;
6510#endif
6511#ifdef USE_AOMAP
6512	varying vec2 vAoMapUv;
6513#endif
6514#ifdef USE_BUMPMAP
6515	varying vec2 vBumpMapUv;
6516#endif
6517#ifdef USE_NORMALMAP
6518	varying vec2 vNormalMapUv;
6519#endif
6520#ifdef USE_EMISSIVEMAP
6521	varying vec2 vEmissiveMapUv;
6522#endif
6523#ifdef USE_METALNESSMAP
6524	varying vec2 vMetalnessMapUv;
6525#endif
6526#ifdef USE_ROUGHNESSMAP
6527	varying vec2 vRoughnessMapUv;
6528#endif
6529#ifdef USE_ANISOTROPYMAP
6530	varying vec2 vAnisotropyMapUv;
6531#endif
6532#ifdef USE_CLEARCOATMAP
6533	varying vec2 vClearcoatMapUv;
6534#endif
6535#ifdef USE_CLEARCOAT_NORMALMAP
6536	varying vec2 vClearcoatNormalMapUv;
6537#endif
6538#ifdef USE_CLEARCOAT_ROUGHNESSMAP
6539	varying vec2 vClearcoatRoughnessMapUv;
6540#endif
6541#ifdef USE_IRIDESCENCEMAP
6542	varying vec2 vIridescenceMapUv;
6543#endif
6544#ifdef USE_IRIDESCENCE_THICKNESSMAP
6545	varying vec2 vIridescenceThicknessMapUv;
6546#endif
6547#ifdef USE_SHEEN_COLORMAP
6548	varying vec2 vSheenColorMapUv;
6549#endif
6550#ifdef USE_SHEEN_ROUGHNESSMAP
6551	varying vec2 vSheenRoughnessMapUv;
6552#endif
6553#ifdef USE_SPECULARMAP
6554	varying vec2 vSpecularMapUv;
6555#endif
6556#ifdef USE_SPECULAR_COLORMAP
6557	varying vec2 vSpecularColorMapUv;
6558#endif
6559#ifdef USE_SPECULAR_INTENSITYMAP
6560	varying vec2 vSpecularIntensityMapUv;
6561#endif
6562#ifdef USE_TRANSMISSIONMAP
6563	uniform mat3 transmissionMapTransform;
6564	varying vec2 vTransmissionMapUv;
6565#endif
6566#ifdef USE_THICKNESSMAP
6567	uniform mat3 thicknessMapTransform;
6568	varying vec2 vThicknessMapUv;
6569#endif`,ise=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
6570	varying vec2 vUv;
6571#endif
6572#ifdef USE_MAP
6573	uniform mat3 mapTransform;
6574	varying vec2 vMapUv;
6575#endif
6576#ifdef USE_ALPHAMAP
6577	uniform mat3 alphaMapTransform;
6578	varying vec2 vAlphaMapUv;
6579#endif
6580#ifdef USE_LIGHTMAP
6581	uniform mat3 lightMapTransform;
6582	varying vec2 vLightMapUv;
6583#endif
6584#ifdef USE_AOMAP
6585	uniform mat3 aoMapTransform;
6586	varying vec2 vAoMapUv;
6587#endif
6588#ifdef USE_BUMPMAP
6589	uniform mat3 bumpMapTransform;
6590	varying vec2 vBumpMapUv;
6591#endif
6592#ifdef USE_NORMALMAP
6593	uniform mat3 normalMapTransform;
6594	varying vec2 vNormalMapUv;
6595#endif
6596#ifdef USE_DISPLACEMENTMAP
6597	uniform mat3 displacementMapTransform;
6598	varying vec2 vDisplacementMapUv;
6599#endif
6600#ifdef USE_EMISSIVEMAP
6601	uniform mat3 emissiveMapTransform;
6602	varying vec2 vEmissiveMapUv;
6603#endif
6604#ifdef USE_METALNESSMAP
6605	uniform mat3 metalnessMapTransform;
6606	varying vec2 vMetalnessMapUv;
6607#endif
6608#ifdef USE_ROUGHNESSMAP
6609	uniform mat3 roughnessMapTransform;
6610	varying vec2 vRoughnessMapUv;
6611#endif
6612#ifdef USE_ANISOTROPYMAP
6613	uniform mat3 anisotropyMapTransform;
6614	varying vec2 vAnisotropyMapUv;
6615#endif
6616#ifdef USE_CLEARCOATMAP
6617	uniform mat3 clearcoatMapTransform;
6618	varying vec2 vClearcoatMapUv;
6619#endif
6620#ifdef USE_CLEARCOAT_NORMALMAP
6621	uniform mat3 clearcoatNormalMapTransform;
6622	varying vec2 vClearcoatNormalMapUv;
6623#endif
6624#ifdef USE_CLEARCOAT_ROUGHNESSMAP
6625	uniform mat3 clearcoatRoughnessMapTransform;
6626	varying vec2 vClearcoatRoughnessMapUv;
6627#endif
6628#ifdef USE_SHEEN_COLORMAP
6629	uniform mat3 sheenColorMapTransform;
6630	varying vec2 vSheenColorMapUv;
6631#endif
6632#ifdef USE_SHEEN_ROUGHNESSMAP
6633	uniform mat3 sheenRoughnessMapTransform;
6634	varying vec2 vSheenRoughnessMapUv;
6635#endif
6636#ifdef USE_IRIDESCENCEMAP
6637	uniform mat3 iridescenceMapTransform;
6638	varying vec2 vIridescenceMapUv;
6639#endif
6640#ifdef USE_IRIDESCENCE_THICKNESSMAP
6641	uniform mat3 iridescenceThicknessMapTransform;
6642	varying vec2 vIridescenceThicknessMapUv;
6643#endif
6644#ifdef USE_SPECULARMAP
6645	uniform mat3 specularMapTransform;
6646	varying vec2 vSpecularMapUv;
6647#endif
6648#ifdef USE_SPECULAR_COLORMAP
6649	uniform mat3 specularColorMapTransform;
6650	varying vec2 vSpecularColorMapUv;
6651#endif
6652#ifdef USE_SPECULAR_INTENSITYMAP
6653	uniform mat3 specularIntensityMapTransform;
6654	varying vec2 vSpecularIntensityMapUv;
6655#endif
6656#ifdef USE_TRANSMISSIONMAP
6657	uniform mat3 transmissionMapTransform;
6658	varying vec2 vTransmissionMapUv;
6659#endif
6660#ifdef USE_THICKNESSMAP
6661	uniform mat3 thicknessMapTransform;
6662	varying vec2 vThicknessMapUv;
6663#endif`,sse=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
6664	vUv = vec3( uv, 1 ).xy;
6665#endif
6666#ifdef USE_MAP
6667	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
6668#endif
6669#ifdef USE_ALPHAMAP
6670	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
6671#endif
6672#ifdef USE_LIGHTMAP
6673	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
6674#endif
6675#ifdef USE_AOMAP
6676	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
6677#endif
6678#ifdef USE_BUMPMAP
6679	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
6680#endif
6681#ifdef USE_NORMALMAP
6682	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
6683#endif
6684#ifdef USE_DISPLACEMENTMAP
6685	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
6686#endif
6687#ifdef USE_EMISSIVEMAP
6688	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
6689#endif
6690#ifdef USE_METALNESSMAP
6691	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
6692#endif
6693#ifdef USE_ROUGHNESSMAP
6694	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
6695#endif
6696#ifdef USE_ANISOTROPYMAP
6697	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
6698#endif
6699#ifdef USE_CLEARCOATMAP
6700	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
6701#endif
6702#ifdef USE_CLEARCOAT_NORMALMAP
6703	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
6704#endif
6705#ifdef USE_CLEARCOAT_ROUGHNESSMAP
6706	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
6707#endif
6708#ifdef USE_IRIDESCENCEMAP
6709	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
6710#endif
6711#ifdef USE_IRIDESCENCE_THICKNESSMAP
6712	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
6713#endif
6714#ifdef USE_SHEEN_COLORMAP
6715	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
6716#endif
6717#ifdef USE_SHEEN_ROUGHNESSMAP
6718	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
6719#endif
6720#ifdef USE_SPECULARMAP
6721	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
6722#endif
6723#ifdef USE_SPECULAR_COLORMAP
6724	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
6725#endif
6726#ifdef USE_SPECULAR_INTENSITYMAP
6727	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
6728#endif
6729#ifdef USE_TRANSMISSIONMAP
6730	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
6731#endif
6732#ifdef USE_THICKNESSMAP
6733	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
6734#endif`,ose=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
6735	vec4 worldPosition = vec4( transformed, 1.0 );
6736	#ifdef USE_BATCHING
6737		worldPosition = batchingMatrix * worldPosition;
6738	#endif
6739	#ifdef USE_INSTANCING
6740		worldPosition = instanceMatrix * worldPosition;
6741	#endif
6742	worldPosition = modelMatrix * worldPosition;
6743#endif`;const ase=`varying vec2 vUv;
6744uniform mat3 uvTransform;
6745void main() {
6746	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
6747	gl_Position = vec4( position.xy, 1.0, 1.0 );
6748}`,lse=`uniform sampler2D t2D;
6749uniform float backgroundIntensity;
6750varying vec2 vUv;
6751void main() {
6752	vec4 texColor = texture2D( t2D, vUv );
6753	#ifdef DECODE_VIDEO_TEXTURE
6754		texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
6755	#endif
6756	texColor.rgb *= backgroundIntensity;
6757	gl_FragColor = texColor;
6758	#include <tonemapping_fragment>
6759	#include <colorspace_fragment>
6760}`,cse=`varying vec3 vWorldDirection;
6761#include <common>
6762void main() {
6763	vWorldDirection = transformDirection( position, modelMatrix );
6764	#include <begin_vertex>
6765	#include <project_vertex>
6766	gl_Position.z = gl_Position.w;
6767}`,use=`#ifdef ENVMAP_TYPE_CUBE
6768	uniform samplerCube envMap;
6769#elif defined( ENVMAP_TYPE_CUBE_UV )
6770	uniform sampler2D envMap;
6771#endif
6772uniform float flipEnvMap;
6773uniform float backgroundBlurriness;
6774uniform float backgroundIntensity;
6775uniform mat3 backgroundRotation;
6776varying vec3 vWorldDirection;
6777#include <cube_uv_reflection_fragment>
6778void main() {
6779	#ifdef ENVMAP_TYPE_CUBE
6780		vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
6781	#elif defined( ENVMAP_TYPE_CUBE_UV )
6782		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
6783	#else
6784		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
6785	#endif
6786	texColor.rgb *= backgroundIntensity;
6787	gl_FragColor = texColor;
6788	#include <tonemapping_fragment>
6789	#include <colorspace_fragment>
6790}`,dse=`varying vec3 vWorldDirection;
6791#include <common>
6792void main() {
6793	vWorldDirection = transformDirection( position, modelMatrix );
6794	#include <begin_vertex>
6795	#include <project_vertex>
6796	gl_Position.z = gl_Position.w;
6797}`,fse=`uniform samplerCube tCube;
6798uniform float tFlip;
6799uniform float opacity;
6800varying vec3 vWorldDirection;
6801void main() {
6802	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
6803	gl_FragColor = texColor;
6804	gl_FragColor.a *= opacity;
6805	#include <tonemapping_fragment>
6806	#include <colorspace_fragment>
6807}`,hse=`#include <common>
6808#include <batching_pars_vertex>
6809#include <uv_pars_vertex>
6810#include <displacementmap_pars_vertex>
6811#include <morphtarget_pars_vertex>
6812#include <skinning_pars_vertex>
6813#include <logdepthbuf_pars_vertex>
6814#include <clipping_planes_pars_vertex>
6815varying vec2 vHighPrecisionZW;
6816void main() {
6817	#include <uv_vertex>
6818	#include <batching_vertex>
6819	#include <skinbase_vertex>
6820	#include <morphinstance_vertex>
6821	#ifdef USE_DISPLACEMENTMAP
6822		#include <beginnormal_vertex>
6823		#include <morphnormal_vertex>
6824		#include <skinnormal_vertex>
6825	#endif
6826	#include <begin_vertex>
6827	#include <morphtarget_vertex>
6828	#include <skinning_vertex>
6829	#include <displacementmap_vertex>
6830	#include <project_vertex>
6831	#include <logdepthbuf_vertex>
6832	#include <clipping_planes_vertex>
6833	vHighPrecisionZW = gl_Position.zw;
6834}`,pse=`#if DEPTH_PACKING == 3200
6835	uniform float opacity;
6836#endif
6837#include <common>
6838#include <packing>
6839#include <uv_pars_fragment>
6840#include <map_pars_fragment>
6841#include <alphamap_pars_fragment>
6842#include <alphatest_pars_fragment>
6843#include <alphahash_pars_fragment>
6844#include <logdepthbuf_pars_fragment>
6845#include <clipping_planes_pars_fragment>
6846varying vec2 vHighPrecisionZW;
6847void main() {
6848	vec4 diffuseColor = vec4( 1.0 );
6849	#include <clipping_planes_fragment>
6850	#if DEPTH_PACKING == 3200
6851		diffuseColor.a = opacity;
6852	#endif
6853	#include <map_fragment>
6854	#include <alphamap_fragment>
6855	#include <alphatest_fragment>
6856	#include <alphahash_fragment>
6857	#include <logdepthbuf_fragment>
6858	#ifdef USE_REVERSED_DEPTH_BUFFER
6859		float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
6860	#else
6861		float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
6862	#endif
6863	#if DEPTH_PACKING == 3200
6864		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
6865	#elif DEPTH_PACKING == 3201
6866		gl_FragColor = packDepthToRGBA( fragCoordZ );
6867	#elif DEPTH_PACKING == 3202
6868		gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
6869	#elif DEPTH_PACKING == 3203
6870		gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
6871	#endif
6872}`,mse=`#define DISTANCE
6873varying vec3 vWorldPosition;
6874#include <common>
6875#include <batching_pars_vertex>
6876#include <uv_pars_vertex>
6877#include <displacementmap_pars_vertex>
6878#include <morphtarget_pars_vertex>
6879#include <skinning_pars_vertex>
6880#include <clipping_planes_pars_vertex>
6881void main() {
6882	#include <uv_vertex>
6883	#include <batching_vertex>
6884	#include <skinbase_vertex>
6885	#include <morphinstance_vertex>
6886	#ifdef USE_DISPLACEMENTMAP
6887		#include <beginnormal_vertex>
6888		#include <morphnormal_vertex>
6889		#include <skinnormal_vertex>
6890	#endif
6891	#include <begin_vertex>
6892	#include <morphtarget_vertex>
6893	#include <skinning_vertex>
6894	#include <displacementmap_vertex>
6895	#include <project_vertex>
6896	#include <worldpos_vertex>
6897	#include <clipping_planes_vertex>
6898	vWorldPosition = worldPosition.xyz;
6899}`,gse=`#define DISTANCE
6900uniform vec3 referencePosition;
6901uniform float nearDistance;
6902uniform float farDistance;
6903varying vec3 vWorldPosition;
6904#include <common>
6905#include <uv_pars_fragment>
6906#include <map_pars_fragment>
6907#include <alphamap_pars_fragment>
6908#include <alphatest_pars_fragment>
6909#include <alphahash_pars_fragment>
6910#include <clipping_planes_pars_fragment>
6911void main () {
6912	vec4 diffuseColor = vec4( 1.0 );
6913	#include <clipping_planes_fragment>
6914	#include <map_fragment>
6915	#include <alphamap_fragment>
6916	#include <alphatest_fragment>
6917	#include <alphahash_fragment>
6918	float dist = length( vWorldPosition - referencePosition );
6919	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
6920	dist = saturate( dist );
6921	gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );
6922}`,vse=`varying vec3 vWorldDirection;
6923#include <common>
6924void main() {
6925	vWorldDirection = transformDirection( position, modelMatrix );
6926	#include <begin_vertex>
6927	#include <project_vertex>
6928}
6928`,yse=`uniform sampler2D tEquirect;
6929varying vec3 vWorldDirection;
6930#include <common>
6931void main() {
6932	vec3 direction = normalize( vWorldDirection );
6933	vec2 sampleUV = equirectUv( direction );
6934	gl_FragColor = texture2D( tEquirect, sampleUV );
6935	#include <tonemapping_fragment>
6936	#include <colorspace_fragment>
6937}`,_se=`uniform float scale;
6938attribute float lineDistance;
6939varying float vLineDistance;
6940#include <common>
6941#include <uv_pars_vertex>
6942#include <color_pars_vertex>
6943#include <fog_pars_vertex>
6944#include <morphtarget_pars_vertex>
6945#include <logdepthbuf_pars_vertex>
6946#include <clipping_planes_pars_vertex>
6947void main() {
6948	vLineDistance = scale * lineDistance;
6949	#include <uv_vertex>
6950	#include <color_vertex>
6951	#include <morphinstance_vertex>
6952	#include <morphcolor_vertex>
6953	#include <begin_vertex>
6954	#include <morphtarget_vertex>
6955	#include <project_vertex>
6956	#include <logdepthbuf_vertex>
6957	#include <clipping_planes_vertex>
6958	#include <fog_vertex>
6959}`,xse=`uniform vec3 diffuse;
6960uniform float opacity;
6961uniform float dashSize;
6962uniform float totalSize;
6963varying float vLineDistance;
6964#include <common>
6965#include <color_pars_fragment>
6966#include <uv_pars_fragment>
6967#include <map_pars_fragment>
6968#include <fog_pars_fragment>
6969#include <logdepthbuf_pars_fragment>
6970#include <clipping_planes_pars_fragment>
6971void main() {
6972	vec4 diffuseColor = vec4( diffuse, opacity );
6973	#include <clipping_planes_fragment>
6974	if ( mod( vLineDistance, totalSize ) > dashSize ) {
6975		discard;
6976	}
6977	vec3 outgoingLight = vec3( 0.0 );
6978	#include <logdepthbuf_fragment>
6979	#include <map_fragment>
6980	#include <color_fragment>
6981	outgoingLight = diffuseColor.rgb;
6982	#include <opaque_fragment>
6983	#include <tonemapping_fragment>
6984	#include <colorspace_fragment>
6985	#include <fog_fragment>
6986	#include <premultiplied_alpha_fragment>
6987}`,bse=`#include <common>
6988#include <batching_pars_vertex>
6989#include <uv_pars_vertex>
6990#include <envmap_pars_vertex>
6991#include <color_pars_vertex>
6992#include <fog_pars_vertex>
6993#include <morphtarget_pars_vertex>
6994#include <skinning_pars_vertex>
6995#include <logdepthbuf_pars_vertex>
6996#include <clipping_planes_pars_vertex>
6997void main() {
6998	#include <uv_vertex>
6999	#include <color_vertex>
7000	#include <morphinstance_vertex>
7001	#include <morphcolor_vertex>
7002	#include <batching_vertex>
7003	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
7004		#include <beginnormal_vertex>
7005		#include <morphnormal_vertex>
7006		#include <skinbase_vertex>
7007		#include <skinnormal_vertex>
7008		#include <defaultnormal_vertex>
7009	#endif
7010	#include <begin_vertex>
7011	#include <morphtarget_vertex>
7012	#include <skinning_vertex>
7013	#include <project_vertex>
7014	#include <logdepthbuf_vertex>
7015	#include <clipping_planes_vertex>
7016	#include <worldpos_vertex>
7017	#include <envmap_vertex>
7018	#include <fog_vertex>
7019}`,wse=`uniform vec3 diffuse;
7020uniform float opacity;
7021#ifndef FLAT_SHADED
7022	varying vec3 vNormal;
7023#endif
7024#include <common>
7025#include <dithering_pars_fragment>
7026#include <color_pars_fragment>
7027#include <uv_pars_fragment>
7028#include <map_pars_fragment>
7029#include <alphamap_pars_fragment>
7030#include <alphatest_pars_fragment>
7031#include <alphahash_pars_fragment>
7032#include <aomap_pars_fragment>
7033#include <lightmap_pars_fragment>
7034#include <envmap_common_pars_fragment>
7035#include <envmap_pars_fragment>
7036#include <fog_pars_fragment>
7037#include <specularmap_pars_fragment>
7038#include <logdepthbuf_pars_fragment>
7039#include <clipping_planes_pars_fragment>
7040void main() {
7041	vec4 diffuseColor = vec4( diffuse, opacity );
7042	#include <clipping_planes_fragment>
7043	#include <logdepthbuf_fragment>
7044	#include <map_fragment>
7045	#include <color_fragment>
7046	#include <alphamap_fragment>
7047	#include <alphatest_fragment>
7048	#include <alphahash_fragment>
7049	#include <specularmap_fragment>
7050	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
7051	#ifdef USE_LIGHTMAP
7052		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
7053		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
7054	#else
7055		reflectedLight.indirectDiffuse += vec3( 1.0 );
7056	#endif
7057	#include <aomap_fragment>
7058	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
7059	vec3 outgoingLight = reflectedLight.indirectDiffuse;
7060	#include <envmap_fragment>
7061	#include <opaque_fragment>
7062	#include <tonemapping_fragment>
7063	#include <colorspace_fragment>
7064	#include <fog_fragment>
7065	#include <premultiplied_alpha_fragment>
7066	#include <dithering_fragment>
7067}`,Ese=`#define LAMBERT
7068varying vec3 vViewPosition;
7069#include <common>
7070#include <batching_pars_vertex>
7071#include <uv_pars_vertex>
7072#include <displacementmap_pars_vertex>
7073#include <envmap_pars_vertex>
7074#include <color_pars_vertex>
7075#include <fog_pars_vertex>
7076#include <normal_pars_vertex>
7077#include <morphtarget_pars_vertex>
7078#include <skinning_pars_vertex>
7079#include <shadowmap_pars_vertex>
7080#include <logdepthbuf_pars_vertex>
7081#include <clipping_planes_pars_vertex>
7082void main() {
7083	#include <uv_vertex>
7084	#include <color_vertex>
7085	#include <morphinstance_vertex>
7086	#include <morphcolor_vertex>
7087	#include <batching_vertex>
7088	#include <beginnormal_vertex>
7089	#include <morphnormal_vertex>
7090	#include <skinbase_vertex>
7091	#include <skinnormal_vertex>
7092	#include <defaultnormal_vertex>
7093	#include <normal_vertex>
7094	#include <begin_vertex>
7095	#include <morphtarget_vertex>
7096	#include <skinning_vertex>
7097	#include <displacementmap_vertex>
7098	#include <project_vertex>
7099	#include <logdepthbuf_vertex>
7100	#include <clipping_planes_vertex>
7101	vViewPosition = - mvPosition.xyz;
7102	#include <worldpos_vertex>
7103	#include <envmap_vertex>
7104	#include <shadowmap_vertex>
7105	#include <fog_vertex>
7106}`,Sse=`#define LAMBERT
7107uniform vec3 diffuse;
7108uniform vec3 emissive;
7109uniform float opacity;
7110#include <common>
7111#include <dithering_pars_fragment>
7112#include <color_pars_fragment>
7113#include <uv_pars_fragment>
7114#include <map_pars_fragment>
7115#include <alphamap_pars_fragment>
7116#include <alphatest_pars_fragment>
7117#include <alphahash_pars_fragment>
7118#include <aomap_pars_fragment>
7119#include <lightmap_pars_fragment>
7120#include <emissivemap_pars_fragment>
7121#include <cube_uv_reflection_fragment>
7122#include <envmap_common_pars_fragment>
7123#include <envmap_pars_fragment>
7124#include <envmap_physical_pars_fragment>
7125#include <fog_pars_fragment>
7126#include <bsdfs>
7127#include <lights_pars_begin>
7128#include <normal_pars_fragment>
7129#include <lights_lambert_pars_fragment>
7130#include <shadowmap_pars_fragment>
7131#include <bumpmap_pars_fragment>
7132#include <normalmap_pars_fragment>
7133#include <specularmap_pars_fragment>
7134#include <logdepthbuf_pars_fragment>
7135#include <clipping_planes_pars_fragment>
7136void main() {
7137	vec4 diffuseColor = vec4( diffuse, opacity );
7138	#include <clipping_planes_fragment>
7139	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
7140	vec3 totalEmissiveRadiance = emissive;
7141	#include <logdepthbuf_fragment>
7142	#include <map_fragment>
7143	#include <color_fragment>
7144	#include <alphamap_fragment>
7145	#include <alphatest_fragment>
7146	#include <alphahash_fragment>
7147	#include <specularmap_fragment>
7148	#include <normal_fragment_begin>
7149	#include <normal_fragment_maps>
7150	#include <emissivemap_fragment>
7151	#include <lights_lambert_fragment>
7152	#include <lights_fragment_begin>
7153	#include <lights_fragment_maps>
7154	#include <lights_fragment_end>
7155	#include <aomap_fragment>
7156	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
7157	#include <envmap_fragment>
7158	#include <opaque_fragment>
7159	#include <tonemapping_fragment>
7160	#include <colorspace_fragment>
7161	#include <fog_fragment>
7162	#include <premultiplied_alpha_fragment>
7163	#include <dithering_fragment>
7164}`,Tse=`#define MATCAP
7165varying vec3 vViewPosition;
7166#include <common>
7167#include <batching_pars_vertex>
7168#include <uv_pars_vertex>
7169#include <color_pars_vertex>
7170#include <displacementmap_pars_vertex>
7171#include <fog_pars_vertex>
7172#include <normal_pars_vertex>
7173#include <morphtarget_pars_vertex>
7174#include <skinning_pars_vertex>
7175#include <logdepthbuf_pars_vertex>
7176#include <clipping_planes_pars_vertex>
7177void main() {
7178	#include <uv_vertex>
7179	#include <color_vertex>
7180	#include <morphinstance_vertex>
7181	#include <morphcolor_vertex>
7182	#include <batching_vertex>
7183	#include <beginnormal_vertex>
7184	#include <morphnormal_vertex>
7185	#include <skinbase_vertex>
7186	#include <skinnormal_vertex>
7187	#include <defaultnormal_vertex>
7188	#include <normal_vertex>
7189	#include <begin_vertex>
7190	#include <morphtarget_vertex>
7191	#include <skinning_vertex>
7192	#include <displacementmap_vertex>
7193	#include <project_vertex>
7194	#include <logdepthbuf_vertex>
7195	#include <clipping_planes_vertex>
7196	#include <fog_vertex>
7197	vViewPosition = - mvPosition.xyz;
7198}`,Ase=`#define MATCAP
7199uniform vec3 diffuse;
7200uniform float opacity;
7201uniform sampler2D matcap;
7202varying vec3 vViewPosition;
7203#include <common>
7204#include <dithering_pars_fragment>
7205#include <color_pars_fragment>
7206#include <uv_pars_fragment>
7207#include <map_pars_fragment>
7208#include <alphamap_pars_fragment>
7209#include <alphatest_pars_fragment>
7210#include <alphahash_pars_fragment>
7211#include <fog_pars_fragment>
7212#include <normal_pars_fragment>
7213#include <bumpmap_pars_fragment>
7214#include <normalmap_pars_fragment>
7215#include <logdepthbuf_pars_fragment>
7216#include <clipping_planes_pars_fragment>
7217void main() {
7218	vec4 diffuseColor = vec4( diffuse, opacity );
7219	#include <clipping_planes_fragment>
7220	#include <logdepthbuf_fragment>
7221	#include <map_fragment>
7222	#include <color_fragment>
7223	#include <alphamap_fragment>
7224	#include <alphatest_fragment>
7225	#include <alphahash_fragment>
7226	#include <normal_fragment_begin>
7227	#include <normal_fragment_maps>
7228	vec3 viewDir = normalize( vViewPosition );
7229	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
7230	vec3 y = cross( viewDir, x );
7231	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
7232	#ifdef USE_MATCAP
7233		vec4 matcapColor = texture2D( matcap, uv );
7234	#else
7235		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
7236	#endif
7237	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
7238	#include <opaque_fragment>
7239	#include <tonemapping_fragment>
7240	#include <colorspace_fragment>
7241	#include <fog_fragment>
7242	#include <premultiplied_alpha_fragment>
7243	#include <dithering_fragment>
7244}`,Mse=`#define NORMAL
7245#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
7246	varying vec3 vViewPosition;
7247#endif
7248#include <common>
7249#include <batching_pars_vertex>
7250#include <uv_pars_vertex>
7251#include <displacementmap_pars_vertex>
7252#include <normal_pars_vertex>
7253#include <morphtarget_pars_vertex>
7254#include <skinning_pars_vertex>
7255#include <logdepthbuf_pars_vertex>
7256#include <clipping_planes_pars_vertex>
7257void main() {
7258	#include <uv_vertex>
7259	#include <batching_vertex>
7260	#include <beginnormal_vertex>
7261	#include <morphinstance_vertex>
7262	#include <morphnormal_vertex>
7263	#include <skinbase_vertex>
7264	#include <skinnormal_vertex>
7265	#include <defaultnormal_vertex>
7266	#include <normal_vertex>
7267	#include <begin_vertex>
7268	#include <morphtarget_vertex>
7269	#include <skinning_vertex>
7270	#include <displacementmap_vertex>
7271	#include <project_vertex>
7272	#include <logdepthbuf_vertex>
7273	#include <clipping_planes_vertex>
7274#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
7275	vViewPosition = - mvPosition.xyz;
7276#endif
7277}`,Cse=`#define NORMAL
7278uniform float opacity;
7279#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
7280	varying vec3 vViewPosition;
7281#endif
7282#include <uv_pars_fragment>
7283#include <normal_pars_fragment>
7284#include <bumpmap_pars_fragment>
7285#include <normalmap_pars_fragment>
7286#include <logdepthbuf_pars_fragment>
7287#include <clipping_planes_pars_fragment>
7288void main() {
7289	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
7290	#include <clipping_planes_fragment>
7291	#include <logdepthbuf_fragment>
7292	#include <normal_fragment_begin>
7293	#include <normal_fragment_maps>
7294	gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );
7295	#ifdef OPAQUE
7296		gl_FragColor.a = 1.0;
7297	#endif
7298}`,Rse=`#define PHONG
7299varying vec3 vViewPosition;
7300#include <common>
7301#include <batching_pars_vertex>
7302#include <uv_pars_vertex>
7303#include <displacementmap_pars_vertex>
7304#include <envmap_pars_vertex>
7305#include <color_pars_vertex>
7306#include <fog_pars_vertex>
7307#include <normal_pars_vertex>
7308#include <morphtarget_pars_vertex>
7309#include <skinning_pars_vertex>
7310#include <shadowmap_pars_vertex>
7311#include <logdepthbuf_pars_vertex>
7312#include <clipping_planes_pars_vertex>
7313void main() {
7314	#include <uv_vertex>
7315	#include <color_vertex>
7316	#include <morphcolor_vertex>
7317	#include <batching_vertex>
7318	#include <beginnormal_vertex>
7319	#include <morphinstance_vertex>
7320	#include <morphnormal_vertex>
7321	#include <skinbase_vertex>
7322	#include <skinnormal_vertex>
7323	#include <defaultnormal_vertex>
7324	#include <normal_vertex>
7325	#include <begin_vertex>
7326	#include <morphtarget_vertex>
7327	#include <skinning_vertex>
7328	#include <displacementmap_vertex>
7329	#include <project_vertex>
7330	#include <logdepthbuf_vertex>
7331	#include <clipping_planes_vertex>
7332	vViewPosition = - mvPosition.xyz;
7333	#include <worldpos_vertex>
7334	#include <envmap_vertex>
7335	#include <shadowmap_vertex>
7336	#include <fog_vertex>
7337}`,Pse=`#define PHONG
7338uniform vec3 diffuse;
7339uniform vec3 emissive;
7340uniform vec3 specular;
7341uniform float shininess;
7342uniform float opacity;
7343#include <common>
7344#include <dithering_pars_fragment>
7345#include <color_pars_fragment>
7346#include <uv_pars_fragment>
7347#include <map_pars_fragment>
7348#include <alphamap_pars_fragment>
7349#include <alphatest_pars_fragment>
7350#include <alphahash_pars_fragment>
7351#include <aomap_pars_fragment>
7352#include <lightmap_pars_fragment>
7353#include <emissivemap_pars_fragment>
7354#include <cube_uv_reflection_fragment>
7355#include <envmap_common_pars_fragment>
7356#include <envmap_pars_fragment>
7357#include <envmap_physical_pars_fragment>
7358#include <fog_pars_fragment>
7359#include <bsdfs>
7360#include <lights_pars_begin>
7361#include <normal_pars_fragment>
7362#include <lights_phong_pars_fragment>
7363#include <shadowmap_pars_fragment>
7364#include <bumpmap_pars_fragment>
7365#include <normalmap_pars_fragment>
7366#include <specularmap_pars_fragment>
7367#include <logdepthbuf_pars_fragment>
7368#include <clipping_planes_pars_fragment>
7369void main() {
7370	vec4 diffuseColor = vec4( diffuse, opacity );
7371	#include <clipping_planes_fragment>
7372	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
7373	vec3 totalEmissiveRadiance = emissive;
7374	#include <logdepthbuf_fragment>
7375	#include <map_fragment>
7376	#include <color_fragment>
7377	#include <alphamap_fragment>
7378	#include <alphatest_fragment>
7379	#include <alphahash_fragment>
7380	#include <specularmap_fragment>
7381	#include <normal_fragment_begin>
7382	#include <normal_fragment_maps>
7383	#include <emissivemap_fragment>
7384	#include <lights_phong_fragment>
7385	#include <lights_fragment_begin>
7386	#include <lights_fragment_maps>
7387	#include <lights_fragment_end>
7388	#include <aomap_fragment>
7389	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
7390	#include <envmap_fragment>
7391	#include <opaque_fragment>
7392	#include <tonemapping_fragment>
7393	#include <colorspace_fragment>
7394	#include <fog_fragment>
7395	#include <premultiplied_alpha_fragment>
7396	#include <dithering_fragment>
7397}`,Ise=`#define STANDARD
7398varying vec3 vViewPosition;
7399#ifdef USE_TRANSMISSION
7400	varying vec3 vWorldPosition;
7401#endif
7402#include <common>
7403#include <batching_pars_vertex>
7404#include <uv_pars_vertex>
7405#include <displacementmap_pars_vertex>
7406#include <color_pars_vertex>
7407#include <fog_pars_vertex>
7408#include <normal_pars_vertex>
7409#include <morphtarget_pars_vertex>
7410#include <skinning_pars_vertex>
7411#include <shadowmap_pars_vertex>
7412#include <logdepthbuf_pars_vertex>
7413#include <clipping_planes_pars_vertex>
7414void main() {
7415	#include <uv_vertex>
7416	#include <color_vertex>
7417	#include <morphinstance_vertex>
7418	#include <morphcolor_vertex>
7419	#include <batching_vertex>
7420	#include <beginnormal_vertex>
7421	#include <morphnormal_vertex>
7422	#include <skinbase_vertex>
7423	#include <skinnormal_vertex>
7424	#include <defaultnormal_vertex>
7425	#include <normal_vertex>
7426	#include <begin_vertex>
7427	#include <morphtarget_vertex>
7428	#include <skinning_vertex>
7429	#include <displacementmap_vertex>
7430	#include <project_vertex>
7431	#include <logdepthbuf_vertex>
7432	#include <clipping_planes_vertex>
7433	vViewPosition = - mvPosition.xyz;
7434	#include <worldpos_vertex>
7435	#include <shadowmap_vertex>
7436	#include <fog_vertex>
7437#ifdef USE_TRANSMISSION
7438	vWorldPosition = worldPosition.xyz;
7439#endif
7440}`,Nse=`#define STANDARD
7441#ifdef PHYSICAL
7442	#define IOR
7443	#define USE_SPECULAR
7444#endif
7445uniform vec3 diffuse;
7446uniform vec3 emissive;
7447uniform float roughness;
7448uniform float metalness;
7449uniform float opacity;
7450#ifdef IOR
7451	uniform float ior;
7452#endif
7453#ifdef USE_SPECULAR
7454	uniform float specularIntensity;
7455	uniform vec3 specularColor;
7456	#ifdef USE_SPECULAR_COLORMAP
7457		uniform sampler2D specularColorMap;
7458	#endif
7459	#ifdef USE_SPECULAR_INTENSITYMAP
7460		uniform sampler2D specularIntensityMap;
7461	#endif
7462#endif
7463#ifdef USE_CLEARCOAT
7464	uniform float clearcoat;
7465	uniform float clearcoatRoughness;
7466#endif
7467#ifdef USE_DISPERSION
7468	uniform float dispersion;
7469#endif
7470#ifdef USE_IRIDESCENCE
7471	uniform float iridescence;
7472	uniform float iridescenceIOR;
7473	uniform float iridescenceThicknessMinimum;
7474	uniform float iridescenceThicknessMaximum;
7475#endif
7476#ifdef USE_SHEEN
7477	uniform vec3 sheenColor;
7478	uniform float sheenRoughness;
7479	#ifdef USE_SHEEN_COLORMAP
7480		uniform sampler2D sheenColorMap;
7481	#endif
7482	#ifdef USE_SHEEN_ROUGHNESSMAP
7483		uniform sampler2D sheenRoughnessMap;
7484	#endif
7485#endif
7486#ifdef USE_ANISOTROPY
7487	uniform vec2 anisotropyVector;
7488	#ifdef USE_ANISOTROPYMAP
7489		uniform sampler2D anisotropyMap;
7490	#endif
7491#endif
7492varying vec3 vViewPosition;
7493#include <common>
7494#include <dithering_pars_fragment>
7495#include <color_pars_fragment>
7496#include <uv_pars_fragment>
7497#include <map_pars_fragment>
7498#include <alphamap_pars_fragment>
7499#include <alphatest_pars_fragment>
7500#include <alphahash_pars_fragment>
7501#include <aomap_pars_fragment>
7502#include <lightmap_pars_fragment>
7503#include <emissivemap_pars_fragment>
7504#include <iridescence_fragment>
7505#include <cube_uv_reflection_fragment>
7506#include <envmap_common_pars_fragment>
7507#include <envmap_physical_pars_fragment>
7508#include <fog_pars_fragment>
7509#include <lights_pars_begin>
7510#include <normal_pars_fragment>
7511#include <lights_physical_pars_fragment>
7512#include <transmission_pars_fragment>
7513#include <shadowmap_pars_fragment>
7514#include <bumpmap_pars_fragment>
7515#include <normalmap_pars_fragment>
7516#include <clearcoat_pars_fragment>
7517#include <iridescence_pars_fragment>
7518#include <roughnessmap_pars_fragment>
7519#include <metalnessmap_pars_fragment>
7520#include <logdepthbuf_pars_fragment>
7521#include <clipping_planes_pars_fragment>
7522void main() {
7523	vec4 diffuseColor = vec4( diffuse, opacity );
7524	#include <clipping_planes_fragment>
7525	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
7526	vec3 totalEmissiveRadiance = emissive;
7527	#include <logdepthbuf_fragment>
7528	#include <map_fragment>
7529	#include <color_fragment>
7530	#include <alphamap_fragment>
7531	#include <alphatest_fragment>
7532	#include <alphahash_fragment>
7533	#include <roughnessmap_fragment>
7534	#include <metalnessmap_fragment>
7535	#include <normal_fragment_begin>
7536	#include <normal_fragment_maps>
7537	#include <clearcoat_normal_fragment_begin>
7538	#include <clearcoat_normal_fragment_maps>
7539	#include <emissivemap_fragment>
7540	#include <lights_physical_fragment>
7541	#include <lights_fragment_begin>
7542	#include <lights_fragment_maps>
7543	#include <lights_fragment_end>
7544	#include <aomap_fragment>
7545	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
7546	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
7547	#include <transmission_fragment>
7548	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
7549	#ifdef USE_SHEEN
7550 
7551		outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;
7552 
7553 	#endif
7554	#ifdef USE_CLEARCOAT
7555		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
7556		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
7557		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
7558	#endif
7559	#include <opaque_fragment>
7560	#include <tonemapping_fragment>
7561	#include <colorspace_fragment>
7562	#include <fog_fragment>
7563	#include <premultiplied_alpha_fragment>
7564	#include <dithering_fragment>
7565}`,Ose=`#define TOON
7566varying vec3 vViewPosition;
7567#include <common>
7568#include <batching_pars_vertex>
7569#include <uv_pars_vertex>
7570#include <displacementmap_pars_vertex>
7571#include <color_pars_vertex>
7572#include <fog_pars_vertex>
7573#include <normal_pars_vertex>
7574#include <morphtarget_pars_vertex>
7575#include <skinning_pars_vertex>
7576#include <shadowmap_pars_vertex>
7577#include <logdepthbuf_pars_vertex>
7578#include <clipping_planes_pars_vertex>
7579void main() {
7580	#include <uv_vertex>
7581	#include <color_vertex>
7582	#include <morphinstance_vertex>
7583	#include <morphcolor_vertex>
7584	#include <batching_vertex>
7585	#include <beginnormal_vertex>
7586	#include <morphnormal_vertex>
7587	#include <skinbase_vertex>
7588	#include <skinnormal_vertex>
7589	#include <defaultnormal_vertex>
7590	#include <normal_vertex>
7591	#include <begin_vertex>
7592	#include <morphtarget_vertex>
7593	#include <skinning_vertex>
7594	#include <displacementmap_vertex>
7595	#include <project_vertex>
7596	#include <logdepthbuf_vertex>
7597	#include <clipping_planes_vertex>
7598	vViewPosition = - mvPosition.xyz;
7599	#include <worldpos_vertex>
7600	#include <shadowmap_vertex>
7601	#include <fog_vertex>
7602}`,Dse=`#define TOON
7603uniform vec3 diffuse;
7604uniform vec3 emissive;
7605uniform float opacity;
7606#include <common>
7607#include <dithering_pars_fragment>
7608#include <color_pars_fragment>
7609#include <uv_pars_fragment>
7610#include <map_pars_fragment>
7611#include <alphamap_pars_fragment>
7612#include <alphatest_pars_fragment>
7613#include <alphahash_pars_fragment>
7614#include <aomap_pars_fragment>
7615#include <lightmap_pars_fragment>
7616#include <emissivemap_pars_fragment>
7617#include <gradientmap_pars_fragment>
7618#include <fog_pars_fragment>
7619#include <bsdfs>
7620#include <lights_pars_begin>
7621#include <normal_pars_fragment>
7622#include <lights_toon_pars_fragment>
7623#include <shadowmap_pars_fragment>
7624#include <bumpmap_pars_fragment>
7625#include <normalmap_pars_fragment>
7626#include <logdepthbuf_pars_fragment>
7627#include <clipping_planes_pars_fragment>
7628void main() {
7629	vec4 diffuseColor = vec4( diffuse, opacity );
7630	#include <clipping_planes_fragment>
7631	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
7632	vec3 totalEmissiveRadiance = emissive;
7633	#include <logdepthbuf_fragment>
7634	#include <map_fragment>
7635	#include <color_fragment>
7636	#include <alphamap_fragment>
7637	#include <alphatest_fragment>
7638	#include <alphahash_fragment>
7639	#include <normal_fragment_begin>
7640	#include <normal_fragment_maps>
7641	#include <emissivemap_fragment>
7642	#include <lights_toon_fragment>
7643	#include <lights_fragment_begin>
7644	#include <lights_fragment_maps>
7645	#include <lights_fragment_end>
7646	#include <aomap_fragment>
7647	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
7648	#include <opaque_fragment>
7649	#include <tonemapping_fragment>
7650	#include <colorspace_fragment>
7651	#include <fog_fragment>
7652	#include <premultiplied_alpha_fragment>
7653	#include <dithering_fragment>
7654}`,kse=`uniform float size;
7655uniform float scale;
7656#include <common>
7657#include <color_pars_vertex>
7658#include <fog_pars_vertex>
7659#include <morphtarget_pars_vertex>
7660#include <logdepthbuf_pars_vertex>
7661#include <clipping_planes_pars_vertex>
7662#ifdef USE_POINTS_UV
7663	varying vec2 vUv;
7664	uniform mat3 uvTransform;
7665#endif
7666void main() {
7667	#ifdef USE_POINTS_UV
7668		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
7669	#endif
7670	#include <color_vertex>
7671	#include <morphinstance_vertex>
7672	#include <morphcolor_vertex>
7673	#include <begin_vertex>
7674	#include <morphtarget_vertex>
7675	#include <project_vertex>
7676	gl_PointSize = size;
7677	#ifdef USE_SIZEATTENUATION
7678		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
7679		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
7680	#endif
7681	#include <logdepthbuf_vertex>
7682	#include <clipping_planes_vertex>
7683	#include <worldpos_vertex>
7684	#include <fog_vertex>
7685}`,Lse=`uniform vec3 diffuse;
7686uniform float opacity;
7687#include <common>
7688#include <color_pars_fragment>
7689#include <map_particle_pars_fragment>
7690#include <alphatest_pars_fragment>
7691#include <alphahash_pars_fragment>
7692#include <fog_pars_fragment>
7693#include <logdepthbuf_pars_fragment>
7694#include <clipping_planes_pars_fragment>
7695void main() {
7696	vec4 diffuseColor = vec4( diffuse, opacity );
7697	#include <clipping_planes_fragment>
7698	vec3 outgoingLight = vec3( 0.0 );
7699	#include <logdepthbuf_fragment>
7700	#include <map_particle_fragment>
7701	#include <color_fragment>
7702	#include <alphatest_fragment>
7703	#include <alphahash_fragment>
7704	outgoingLight = diffuseColor.rgb;
7705	#include <opaque_fragment>
7706	#include <tonemapping_fragment>
7707	#include <colorspace_fragment>
7708	#include <fog_fragment>
7709	#include <premultiplied_alpha_fragment>
7710}`,Fse=`#include <common>
7711#include <batching_pars_vertex>
7712#include <fog_pars_vertex>
7713#include <morphtarget_pars_vertex>
7714#include <skinning_pars_vertex>
7715#include <logdepthbuf_pars_vertex>
7716#include <shadowmap_pars_vertex>
7717void main() {
7718	#include <batching_vertex>
7719	#include <beginnormal_vertex>
7720	#include <morphinstance_vertex>
7721	#include <morphnormal_vertex>
7722	#include <skinbase_vertex>
7723	#include <skinnormal_vertex>
7724	#include <defaultnormal_vertex>
7725	#include <begin_vertex>
7726	#include <morphtarget_vertex>
7727	#include <skinning_vertex>
7728	#include <project_vertex>
7729	#include <logdepthbuf_vertex>
7730	#include <worldpos_vertex>
7731	#include <shadowmap_vertex>
7732	#include <fog_vertex>
7733}`,Use=`uniform vec3 color;
7734uniform float opacity;
7735#include <common>
7736#include <fog_pars_fragment>
7737#include <bsdfs>
7738#include <lights_pars_begin>
7739#include <logdepthbuf_pars_fragment>
7740#include <shadowmap_pars_fragment>
7741#include <shadowmask_pars_fragment>
7742void main() {
7743	#include <logdepthbuf_fragment>
7744	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
7745	#include <tonemapping_fragment>
7746	#include <colorspace_fragment>
7747	#include <fog_fragment>
7748	#include <premultiplied_alpha_fragment>
7749}`,jse=`uniform float rotation;
7750uniform vec2 center;
7751#include <common>
7752#include <uv_pars_vertex>
7753#include <fog_pars_vertex>
7754#include <logdepthbuf_pars_vertex>
7755#include <clipping_planes_pars_vertex>
7756void main() {
7757	#include <uv_vertex>
7758	vec4 mvPosition = modelViewMatrix[ 3 ];
7759	vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
7760	#ifndef USE_SIZEATTENUATION
7761		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
7762		if ( isPerspective ) scale *= - mvPosition.z;
7763	#endif
7764	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
7765	vec2 rotatedPosition;
7766	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
7767	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
7768	mvPosition.xy += rotatedPosition;
7769	gl_Position = projectionMatrix * mvPosition;
7770	#include <logdepthbuf_vertex>
7771	#include <clipping_planes_vertex>
7772	#include <fog_vertex>
7773}`,Bse=`uniform vec3 diffuse;
7774uniform float opacity;
7775#include <common>
7776#include <uv_pars_fragment>
7777#include <map_pars_fragment>
7778#include <alphamap_pars_fragment>
7779#include <alphatest_pars_fragment>
7780#include <alphahash_pars_fragment>
7781#include <fog_pars_fragment>
7782#include <logdepthbuf_pars_fragment>
7783#include <clipping_planes_pars_fragment>
7784void main() {
7785	vec4 diffuseColor = vec4( diffuse, opacity );
7786	#include <clipping_planes_fragment>
7787	vec3 outgoingLight = vec3( 0.0 );
7788	#include <logdepthbuf_fragment>
7789	#include <map_fragment>
7790	#include <alphamap_fragment>
7791	#include <alphatest_fragment>
7792	#include <alphahash_fragment>
7793	outgoingLight = diffuseColor.rgb;
7794	#include <opaque_fragment>
7795	#include <tonemapping_fragment>
7796	#include <colorspace_fragment>
7797	#include <fog_fragment>
7798}`,Tt={alphahash_fragment:lre,alphahash_pars_fragment:cre,alphamap_fragment:ure,alphamap_pars_fragment:dre,alphatest_fragment:fre,alphatest_pars_fragment:hre,aomap_fragment:pre,aomap_pars_fragment:mre,batching_pars_vertex:gre,batching_vertex:vre,begin_vertex:yre,beginnormal_vertex:_re,bsdfs:xre,iridescence_fragment:bre,bumpmap_pars_fragment:wre,clipping_planes_fragment:Ere,clipping_planes_pars_fragment:Sre,clipping_planes_pars_vertex:Tre,clipping_planes_vertex:Are,color_fragment:Mre,color_pars_fragment:Cre,color_pars_vertex:Rre,color_vertex:Pre,common:Ire,cube_uv_reflection_fragment:Nre,defaultnormal_vertex:Ore,displacementmap_pars_vertex:Dre,displacementmap_vertex:kre,emissivemap_fragment:Lre,emissivemap_pars_fragment:Fre,colorspace_fragment:Ure,colorspace_pars_fragment:jre,envmap_fragment:Bre,envmap_common_pars_fragment:Vre,envmap_pars_fragment:zre,envmap_pars_vertex:Hre,envmap_physical_pars_fragment:eie,envmap_vertex:Gre,fog_vertex:$re,fog_pars_vertex:Wre,fog_fragment:qre,fog_pars_fragment:Kre,gradientmap_pars_fragment:Xre,lightmap_pars_fragment:Yre,lights_lambert_fragment:Qre,lights_lambert_pars_fragment:Zre,lights_pars_begin:Jre,lights_toon_fragment:tie,lights_toon_pars_fragment:nie,lights_phong_fragment:rie,lights_phong_pars_fragment:iie,lights_physical_fragment:sie,lights_physical_pars_fragment:oie,lights_fragment_begin:aie,lights_fragment_maps:lie,lights_fragment_end:cie,logdepthbuf_fragment:uie,logdepthbuf_pars_fragment:die,logdepthbuf_pars_vertex:fie,logdepthbuf_vertex:hie,map_fragment:pie,map_pars_fragment:mie,map_particle_fragment:gie,map_particle_pars_fragment:vie,metalnessmap_fragment:yie,metalnessmap_pars_fragment:_ie,morphinstance_vertex:xie,morphcolor_vertex:bie,morphnormal_vertex:wie,morphtarget_pars_vertex:Eie,morphtarget_vertex:Sie,normal_fragment_begin:Tie,n
vendor: 5,719 bytes, line 7798
7798ormal_fragment_maps:Aie,normal_pars_fragment:Mie,normal_pars_vertex:Cie,normal_vertex:Rie,normalmap_pars_fragment:Pie,clearcoat_normal_fragment_begin:Iie,clearcoat_normal_fragment_maps:Nie,clearcoat_pars_fragment:Oie,iridescence_pars_fragment:Die,opaque_fragment:kie,packing:Lie,premultiplied_alpha_fragment:Fie,project_vertex:Uie,dithering_fragment:jie,dithering_pars_fragment:Bie,roughnessmap_fragment:Vie,roughnessmap_pars_fragment:zie,shadowmap_pars_fragment:Hie,shadowmap_pars_vertex:Gie,shadowmap_vertex:$ie,shadowmask_pars_fragment:Wie,skinbase_vertex:qie,skinning_pars_vertex:Kie,skinning_vertex:Xie,skinnormal_vertex:Yie,specularmap_fragment:Qie,specularmap_pars_fragment:Zie,tonemapping_fragment:Jie,tonemapping_pars_fragment:ese,transmission_fragment:tse,transmission_pars_fragment:nse,uv_pars_fragment:rse,uv_pars_vertex:ise,uv_vertex:sse,worldpos_vertex:ose,background_vert:ase,background_frag:lse,backgroundCube_vert:cse,backgroundCube_frag:use,cube_vert:dse,cube_frag:fse,depth_vert:hse,depth_frag:pse,distance_vert:mse,distance_frag:gse,equirect_vert:vse,equirect_frag:yse,linedashed_vert:_se,linedashed_frag:xse,meshbasic_vert:bse,meshbasic_frag:wse,meshlambert_vert:Ese,meshlambert_frag:Sse,meshmatcap_vert:Tse,meshmatcap_frag:Ase,meshnormal_vert:Mse,meshnormal_frag:Cse,meshphong_vert:Rse,meshphong_frag:Pse,meshphysical_vert:Ise,meshphysical_frag:Nse,meshtoon_vert:Ose,meshtoon_frag:Dse,points_vert:kse,points_frag:Lse,shadow_vert:Fse,shadow_frag:Use,sprite_vert:jse,sprite_frag:Bse},Be={common:{diffuse:{value:new Pt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new wt},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new wt}},envmap:{envMap:{value:null},envMapRotation:{value:new wt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new wt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new wt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new wt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new wt},normalScale:{value:new _t(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new wt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new wt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new wt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new wt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Pt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Pt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0},uvTransform:{value:new wt}},sprite:{diffuse:{value:new Pt(16777215)},opacity:{value:1},center:{value:new _t(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new wt},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0}}},vs={basic:{uniforms:Sr([Be.common,Be.specularmap,Be.envmap,Be.aomap,Be.lightmap,Be.fog]),vertexShader:Tt.meshbasic_vert,fragmentShader:Tt.meshbasic_frag},lambert:{uniforms:Sr([Be.common,Be.specularmap,Be.envmap,Be.aomap,Be.lightmap,Be.emissivemap,Be.bumpmap,Be.normalmap,Be.displacementmap,Be.fog,Be.lights,{emissive:{value:new Pt(0)},envMapIntensity:{value:1}}]),vertexShader:Tt.meshlambert_vert,fragmentShader:Tt.meshlambert_frag},phong:{uniforms:Sr([Be.common,Be.specularmap,Be.envmap,Be.aomap,Be.lightmap,Be.emissivemap,Be.bumpmap,Be.normalmap,Be.displacementmap,Be.fog,Be.lights,{emissive:{value:new Pt(0)},specular:{value:new Pt(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:Tt.meshphong_vert,fragmentShader:Tt.meshphong_frag},standard:{uniforms:Sr([Be.common,Be.envmap,Be.aomap,Be.lightmap,Be.emissivemap,Be.bumpmap,Be.normalmap,Be.displacementmap,Be.roughnessmap,Be.metalnessmap,Be.fog,Be.lights,{emissive:{value:new Pt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Tt.meshphysical_vert,fragmentShader:Tt.meshphysical_frag},toon:{uniforms:Sr([Be.common,Be.aomap,Be.lightmap,Be.emissivemap,Be.bumpmap,Be.normalmap,Be.displacementmap,Be.gradientmap,Be.fog,Be.lights,{emissive:{value:new Pt(0)}}]),vertexShader:Tt.meshtoon_vert,fragmentShader:Tt.meshtoon_frag},matcap:{uniforms:Sr([Be.common,Be.bumpmap,Be.normalmap,Be.displacementmap,Be.fog,{matc
vendor: 5,277 bytes, line 7798
7798ap:{value:null}}]),vertexShader:Tt.meshmatcap_vert,fragmentShader:Tt.meshmatcap_frag},points:{uniforms:Sr([Be.points,Be.fog]),vertexShader:Tt.points_vert,fragmentShader:Tt.points_frag},dashed:{uniforms:Sr([Be.common,Be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Tt.linedashed_vert,fragmentShader:Tt.linedashed_frag},depth:{uniforms:Sr([Be.common,Be.displacementmap]),vertexShader:Tt.depth_vert,fragmentShader:Tt.depth_frag},normal:{uniforms:Sr([Be.common,Be.bumpmap,Be.normalmap,Be.displacementmap,{opacity:{value:1}}]),vertexShader:Tt.meshnormal_vert,fragmentShader:Tt.meshnormal_frag},sprite:{uniforms:Sr([Be.sprite,Be.fog]),vertexShader:Tt.sprite_vert,fragmentShader:Tt.sprite_frag},background:{uniforms:{uvTransform:{value:new wt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Tt.background_vert,fragmentShader:Tt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new wt}},vertexShader:Tt.backgroundCube_vert,fragmentShader:Tt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Tt.cube_vert,fragmentShader:Tt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Tt.equirect_vert,fragmentShader:Tt.equirect_frag},distance:{uniforms:Sr([Be.common,Be.displacementmap,{referencePosition:{value:new oe},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Tt.distance_vert,fragmentShader:Tt.distance_frag},shadow:{uniforms:Sr([Be.lights,Be.fog,{color:{value:new Pt(0)},opacity:{value:1}}]),vertexShader:Tt.shadow_vert,fragmentShader:Tt.shadow_frag}};vs.physical={uniforms:Sr([vs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new wt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new wt},clearcoatNormalScale:{value:new _t(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new wt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new wt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new wt},sheen:{value:0},sheenColor:{value:new Pt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new wt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new wt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new wt},transmissionSamplerSize:{value:new _t},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new wt},attenuationDistance:{value:0},attenuationColor:{value:new Pt(0)},specularColor:{value:new Pt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new wt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new wt},anisotropyVector:{value:new _t},anisotropyMap:{value:null},anisotropyMapTransform:{value:new wt}}]),vertexShader:Tt.meshphysical_vert,fragmentShader:Tt.meshphysical_frag};const wm={r:0,b:0,g:0},sl=new Us,Vse=new xn;function zse(t,e,n,r,i,s){const o=new Pt(0);let a=i===!0?0:1,l,c,d=null,f=0,u=null;function h(y){let w=y.isScene===!0?y.background:null;if(w&&w.isTexture){const x=y.backgroundBlurriness>0;w=e.get(w,x)}return w}function g(y){let w=!1;const x=h(y);x===null?m(o,a):x&&x.isColor&&(m(x,1),w=!0);const S=t.xr.getEnvironmentBlendMode();S==="additive"?n.buffers.color.setClear(0,0,0,1,s):S==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,s),(t.autoClear||w)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function v(y,w){const x=h(w);x&&(x.isCubeTexture||x.mapping===Vy)?(c===void 0&&(c=new js(new tp(1,1,1),new Bs({name:"BackgroundCubeMaterial",uniforms:Hu(vs.backgroundCube.uniforms),vertexShader:vs.backgroundCube.vertexShader,fragmentShader:vs.backgroundCube.fragmentShader,side:Qr,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(S,I,M){this.matrixWorld.copyPosition(M.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(c)),sl.copy(w.backgroundRotation),sl.x*=-1,sl.y*=-1,sl.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(sl.y*=-1,sl.z*=-1),c.material.uniforms.envMap.value=x,c.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=w.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(Vse.makeRotationFromEuler(sl)),c.material.toneMapped=Ft.getTransfer(x.colorSpace)!==Xt,(d!==x||f!==x.version||u!==t.toneMapping)&&(c.material.needsUpdate=!0,d=x,f=x.version,u=t.toneMapping),c.layers.enableAll(),y.unshift(c,c.geometry,c.material,0,0,null)):x&&x.isTexture&&(l===void 0&&(l=new js(new Hy(2,2),new Bs({name:"Backgroun
7798dMaterial",uniforms:Hu(vs.background.uniforms),vertexShader:vs.background.vertexShader,fragmentShader:vs.background.fragmentShader,side:Va,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=x,l.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,l.material.toneMapped=Ft.getTransfer(x.colorSpace)!==Xt,x.matrixAutoUpdate===!0&&x.updateMatrix(),l.material.uniforms.uvTransform.value.copy(x.matrix),(d!==x||f!==x.version||u!==t.toneMapping)&&(l.material.needsUpdate=!0,d=x,f=x.version,u=t.toneMapping),l.layers.enableAll(),y.unshift(l,l.geometry,l.material,0,0,null))}function m(y,w){y.getRGB(wm,PU(t)),n.buffers.color.setClear(wm.r,wm.g,wm.b,w,s)}function p(){c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return o},setClearColor:function(y,w=1){o.set(y),a=w,m(o,a)},getClearAlpha:function(){return a},setClearAlpha:function(y){a=y,m(o,a)},render:g,addToRenderList:v,dispose:p}}function Hse(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),r={},i=u(null);let s=i,o=!1;function a(A,R,P,D,F){let V=!1;const H=f(A,D,P,R);s!==H&&(s=H,c(s.object)),V=h(A,D,P,F),V&&g(A,D,P,F),F!==null&&e.update(F,t.ELEMENT_ARRAY_BUFFER),(V||o)&&(o=!1,x(A,R,P,D),F!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(F).buffer))}function l(){return t.createVertexArray()}function c(A){return t.bindVertexArray(A)}function d(A){return t.deleteVertexArray(A)}function f(A,R,P,D){const F=D.wireframe===!0;let V=r[R.id];V===void 0&&(V={},r[R.id]=V);const H=A.isInstancedMesh===!0?A.id:0;let $=V[H];$===void 0&&($={},V[H]=$);let B=$[P.id];B===void 0&&(B={},$[P.id]=B);let G=B[F];return G===void 0&&(G=u(l()),B[F]=G),G}function u(A){const R=[],P=[],D=[];for(let F=0;F<n;F++)R[F]=0,P[F]=0,D[F]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:R,enabledAttributes:P,attributeDivisors:D,object:A,attributes:{},index:null}}function h(A,R,P,D){const F=s.attributes,V=R.attributes;let H=0;const $=P.getAttributes();for(const B in $)if($[B].location>=0){const k=F[B];let z=V[B];if(z===void 0&&(B==="instanceMatrix"&&A.instanceMatrix&&(z=A.instanceMatrix),B==="instanceColor"&&A.instanceColor&&(z=A.instanceColor)),k===void 0||k.attribute!==z||z&&k.data!==z.data)return!0;H++}return s.attributesNum!==H||s.index!==D}function g(A,R,P,D){const F={},V=R.attributes;let H=0;const $=P.getAttributes();for(const B in $)if($[B].location>=0){let k=V[B];k===void 0&&(B==="instanceMatrix"&&A.instanceMatrix&&(k=A.instanceMatrix),B==="instanceColor"&&A.instanceColor&&(k=A.instanceColor));const z={};z.attribute=k,k&&k.data&&(z.data=k.data),F[B]=z,H++}s.attributes=F,s.attributesNum=H,s.index=D}function v(){const A=s.newAttributes;for(let R=0,P=A.length;R<P;R++)A[R]=0}function m(A){p(A,0)}function p(A,R){const P=s.newAttributes,D=s.enabledAttributes,F=s.attributeDivisors;P[A]=1,D[A]===0&&(t.enableVertexAttribArray(A),D[A]=1),F[A]!==R&&(t.vertexAttribDivisor(A,R),F[A]=R)}function y(){const A=s.newAttributes,R=s.enabledAttributes;for(let P=0,D=R.length;P<D;P++)R[P]!==A[P]&&(t.disableVertexAttribArray(P),R[P]=0)}function w(A,R,P,D,F,V,H){H===!0?t.vertexAttribIPointer(A,R,P,F,V):t.vertexAttribPointer(A,R,P,D,F,V)}function x(A,R,P,D){v();const F=D.attributes,V=P.getAttributes(),H=R.defaultAttributeValues;for(const $ in V){const B=V[$];if(B.location>=0){let G=F[$];if(G===void 0&&($==="instanceMatrix"&&A.instanceMatrix&&(G=A.instanceMatrix),$==="instanceColor"&&A.instanceColor&&(G=A.instanceColor)),G!==void 0){const k=G.normalized,z=G.itemSize,q=e.get(G);if(q===void 0)continue;const ne=q.buffer,ee=q.type,j=q.bytesPerElement,Q=ee===t.INT||ee===t.UNSIGNED_INT||G.gpuType===SS;if(G.isInterleavedBufferAttribute){const Z=G.data,re=Z.stride,se=G.offset;if(Z.isInstancedInterleavedBuffer){for(let ye=0;ye<B.locationSize;ye++)p(B.location+ye,Z.meshPerAttribute);A.isInstancedMesh!==!0&&D._maxInstanceCount===void 0&&(D._maxInstanceCount=Z.meshPerAttribute*Z.count)}
vendor: 2,370 bytes, line 7798
7798else for(let ye=0;ye<B.locationSize;ye++)m(B.location+ye);t.bindBuffer(t.ARRAY_BUFFER,ne);for(let ye=0;ye<B.locationSize;ye++)w(B.location+ye,z/B.locationSize,ee,k,re*j,(se+z/B.locationSize*ye)*j,Q)}else{if(G.isInstancedBufferAttribute){for(let Z=0;Z<B.locationSize;Z++)p(B.location+Z,G.meshPerAttribute);A.isInstancedMesh!==!0&&D._maxInstanceCount===void 0&&(D._maxInstanceCount=G.meshPerAttribute*G.count)}else for(let Z=0;Z<B.locationSize;Z++)m(B.location+Z);t.bindBuffer(t.ARRAY_BUFFER,ne);for(let Z=0;Z<B.locationSize;Z++)w(B.location+Z,z/B.locationSize,ee,k,z*j,z/B.locationSize*Z*j,Q)}}else if(H!==void 0){const k=H[$];if(k!==void 0)switch(k.length){case 2:t.vertexAttrib2fv(B.location,k);break;case 3:t.vertexAttrib3fv(B.location,k);break;case 4:t.vertexAttrib4fv(B.location,k);break;default:t.vertexAttrib1fv(B.location,k)}}}}y()}function S(){C();for(const A in r){const R=r[A];for(const P in R){const D=R[P];for(const F in D){const V=D[F];for(const H in V)d(V[H].object),delete V[H];delete D[F]}}delete r[A]}}function I(A){if(r[A.id]===void 0)return;const R=r[A.id];for(const P in R){const D=R[P];for(const F in D){const V=D[F];for(const H in V)d(V[H].object),delete V[H];delete D[F]}}delete r[A.id]}function M(A){for(const R in r){const P=r[R];for(const D in P){const F=P[D];if(F[A.id]===void 0)continue;const V=F[A.id];for(const H in V)d(V[H].object),delete V[H];delete F[A.id]}}}function E(A){for(const R in r){const P=r[R],D=A.isInstancedMesh===!0?A.id:0,F=P[D];if(F!==void 0){for(const V in F){const H=F[V];for(const $ in H)d(H[$].object),delete H[$];delete F[V]}delete P[D],Object.keys(P).length===0&&delete r[R]}}}function C(){T(),o=!0,s!==i&&(s=i,c(s.object))}function T(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:a,reset:C,resetDefaultState:T,dispose:S,releaseStatesOfGeometry:I,releaseStatesOfObject:E,releaseStatesOfProgram:M,initAttributes:v,enableAttribute:m,disableUnusedAttributes:y}}function Gse(t,e,n){let r;function i(c){r=c}function s(c,d){t.drawArrays(r,c,d),n.update(d,r,1)}function o(c,d,f){f!==0&&(t.drawArraysInstanced(r,c,d,f),n.update(d,r,f))}function a(c,d,f){if(f===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(r,c,0,d,0,f);let h=0;for(let g=0;g<f;g++)h+=d[g];n.update(h,r,1)}function l(c,d,f,u){if(f===0)return;const h=e.get("WEBGL_multi_draw");if(h===null)for(let g=0;g<c.length;g++)o(c[g],d[g],u[g]);
vendor: 6,658 bytes, line 7798
7798else{h.multiDrawArraysInstancedWEBGL(r,c,0,d,0,u,0,f);let g=0;for(let v=0;v<f;v++)g+=d[v]*u[v];n.update(g,r,1)}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=l}function $se(t,e,n,r){let i;function s(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const M=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(M.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(M){return!(M!==Yi&&r.convert(M)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(M){const E=M===So&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(M!==si&&r.convert(M)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_TYPE)&&M!==bs&&!E)}function l(M){if(M==="highp"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";M="mediump"}return M==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const d=l(c);d!==c&&(ut("WebGLRenderer:",c,"not supported, using",d,"instead."),c=d);const f=n.logarithmicDepthBuffer===!0,u=n.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),g=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=t.getParameter(t.MAX_TEXTURE_SIZE),m=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),p=t.getParameter(t.MAX_VERTEX_ATTRIBS),y=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),w=t.getParameter(t.MAX_VARYING_VECTORS),x=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),S=t.getParameter(t.MAX_SAMPLES),I=t.getParameter(t.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,reversedDepthBuffer:u,maxTextures:h,maxVertexTextures:g,maxTextureSize:v,maxCubemapSize:m,maxAttributes:p,maxVertexUniforms:y,maxVaryings:w,maxFragmentUniforms:x,maxSamples:S,samples:I}}function Wse(t){const e=this;let n=null,r=0,i=!1,s=!1;const o=new Ko,a=new wt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,u){const h=f.length!==0||u||r!==0||i;return i=u,r=f.length,h},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(f,u){n=d(f,u,0)},this.setState=function(f,u,h){const g=f.clippingPlanes,v=f.clipIntersection,m=f.clipShadows,p=t.get(f);if(!i||g===null||g.length===0||s&&!m)s?d(null):c();else{const y=s?0:r,w=y*4;let x=p.clippingState||null;l.value=x,x=d(g,u,w,h);for(let S=0;S!==w;++S)x[S]=n[S];p.clippingState=x,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function d(f,u,h,g){const v=f!==null?f.length:0;let m=null;if(v!==0){if(m=l.value,g!==!0||m===null){const p=h+v*4,y=u.matrixWorldInverse;a.getNormalMatrix(y),(m===null||m.length<p)&&(m=new Float32Array(p));for(let w=0,x=h;w!==v;++w,x+=4)o.copy(f[w]).applyMatrix4(y,a),o.normal.toArray(m,x),m[x+3]=o.constant}l.value=m,l.needsUpdate=!0}return e.numPlanes=v,e.numIntersection=0,m}}const fa=4,bP=[.125,.215,.35,.446,.526,.582],fl=20,qse=256,Gd=new LS,wP=new Pt;let B0=null,V0=0,z0=0,H0=!1;const Kse=new oe;class EP{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,n=0,r=.1,i=100,s={}){const{size:o=256,position:a=Kse}=s;B0=this._renderer.getRenderTarget(),V0=this._renderer.getActiveCubeFace(),z0=this._renderer.getActiveMipmapLevel(),H0=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,r,i,l,a),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=AP(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=TP(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(B0,V0,z0),this._renderer.xr.enabled=H0,e.scissorTest=!1,Tc(e,0,0,e.width,e.height)}_fromTexture(e,n){e.mapping===Bl||e.mapping===Bu?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),B0=this._renderer.getRenderTarget(),V0=this._renderer.getActiveCubeFace(),z0=this._renderer.getActiveMipmapLevel(),H0=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const r=n||this._allocateTargets();return this._textureToCubeUV(e,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),n=4*this._cubeSize,r={magFilter:yr,minFilter:yr,generateMipmaps:!1,type:So,format:Yi,colorSpace:zu,depthBuffer:!1},i=SP(e,n,r);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==n){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=SP(e,n,r);const{_lodMax:s}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=Xse(s)),this._blurMaterial=Qse(s,e,n),this._ggxMaterial=Yse(s,e,n)}return i}_compileMaterial(e){const n=new js(new Di,e);this._renderer.compile(n,Gd)}_sceneToCubeUV(e,n,r,i,s){const l=new Si(90,1,n,r),c=[1,-1,1,1,1,1],d=[1,1,1,-1,-1,-1],f=this._renderer,u=f.autoClear,h=f.toneMapping;f.getClearColor(wP),f.toneMapping=Rs,f.autoClear=!1,f.state.buffers.depth.getReversed()&&(f.setRenderTarget(i),f.clearDepth(),f.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new js(new tp,new AU({name:"PMREM.Backgroun
7798d",side:Qr,depthWrite:!1,depthTest:!1})));const v=this._backgroundBox,m=v.material;let p=!1;const y=e.background;y?y.isColor&&(m.color.copy(y),e.background=null,p=!0):(m.color.copy(wP),p=!0);for(let w=0;w<6;w++){const x=w%3;x===0?(l.up.set(0,c[w],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x+d[w],s.y,s.z)):x===1?(l.up.set(0,0,c[w]),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y+d[w],s.z)):(l.up.set(0,c[w],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y,s.z+d[w]));const S=this._cubeSize;Tc(i,x*S,w>2?S:0,S,S),f.setRenderTarget(i),p&&f.render(v,l),f.render(e,l)}f.toneMapping=h,f.autoClear=u,e.background=y}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Bl||e.mapping===Bu;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=AP()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=TP());const s=i?this._cubemapMaterial:this._equirectMaterial,o=this._lodMeshes[0];o.material=s;const a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Tc(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(o,Gd)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;const i=this._lodMeshes.length;for(let s=1;s<i;s++)this._applyGGXFilter(e,s-1,s);n.autoClear=r}_applyGGXFilter(e,n,r){const i=this._renderer,s=this._pingPongRenderTarget,o=this._ggxMaterial,a=this._lodMeshes[r];a.material=o;const l=o.uniforms,c=r/(this._lodMeshes.length-1),d=n/(this._lodMeshes.length-1),f=Math.sqrt(c*c-d*d),u=0+c*1.25,h=f*u,{_lodMax:g}=this,v=this._sizeLods[r],m=3*v*(r>g-fa?r-g+fa:0),p=4*(this._cubeSize-v);l.envMap.value=e.texture,l.roughness.value=h,l.mipInt.value=g-n,Tc(s,m,p,3*v,2*v),i.setRenderTarget(s),i.render(a,Gd),l.envMap.value=s.texture,l.roughness.value=0,l.mipInt.value=g-r,Tc(e,m,p,3*v,2*v),i.setRenderTarget(e),i.render(a,Gd)}_blur(e,n,r,i,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,n,r,i,"latitudinal",s),this._halfBlur(o,e,r,r,i,"longitudinal",s)}_halfBlur(e,n,r,i,s,o,a){const l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&zt("blur direction must be either latitudinal or longitudinal!");const d=3,f=this._lodMeshes[i];f.material=c;const u=c.uniforms,h=this._sizeLods[r]-1,g=isFinite(s)?Math.PI/(2*h):2*Math.PI/(2*fl-1),v=s/g,m=isFinite(s)?1+Math.floor(d*v):fl;m>fl&&ut(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${fl}`);const p=[];let y=0;for(let M=0;M<fl;++M){const E=M/v,C=Math.exp(-E*E/2);p.push(C),M===0?y+=C:M<m&&(y+=2*C)}for(let M=0;M<p.length;M++)p[M]=p[M]/y;u.envMap.value=e.texture,u.samples.value=m,u.weights.value=p,u.latitudinal.value=o==="latitudinal",a&&(u.poleAxis.value=a);const{_lodMax:w}=this;u.dTheta.value=g,u.mipInt.value=w-r;const x=this._sizeLods[i],S=3*x*(i>w-fa?i-w+fa:0),I=4*(this._cubeSize-x);Tc(n,S,I,3*x,2*x),l.setRenderTarget(n),l.render(f,Gd)}}function Xse(t){const e=[],n=[],r=[];let i=t;const s=t-fa+1+bP.length;for(let o=0;o<s;o++){const a=Math.pow(2,i);e.push(a);let l=1/a;o>t-fa?l=bP[o-t+fa-1]:o===0&&(l=0),n.push(l);const c=1/(a-2),d=-c,f=1+c,u=[d,d,f,d,f,f,d,d,f,f,d,f],h=6,g=6,v=3,m=2,p=1,y=new Float32Array(v*g*h),w=new Float32Array(m*g*h),x=new Float32Array(p*g*h);for(let I=0;I<h;I++){const M=I%3*2/3-1,E=I>2?0:-1,C=[M,E,0,M+2/3,E,0,M+2/3,E+1,0,M,E,0,M+2/3,E+1,0,M,E+1,0];y.set(C,v*g*I),w.set(u,m*g*I);const T=[I,I,I,I,I,I];x.set(T,p*g*I)}const S=new Di;S.setAttribute("position",new Is(y,v)),S.setAttribute("uv",new Is(w,m)),S.setAttribute("faceIndex",new Is(x,p)),r.push(new js(S,null)),i>fa&&i--}return{lodMeshes:r,sizeLods:e,sigmas:n}}function SP(t,e,n){const r=new Ps(t,e,n);return r.texture.mapping=Vy,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Tc(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function Yse(t,e,n){return new Bs({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:qse,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Gy(),fragmentShader:`
7799
7800			precision highp float;
7801			precision highp int;
7802
7803			varying vec3 vOutputDirection;
7804
7805			uniform sampler2D envMap;
7806			uniform float roughness;
7807			uniform float mipInt;
7808
7809			#define ENVMAP_TYPE_CUBE_UV
7810			#include <cube_uv_reflection_fragment>
7811
7812			#define PI 3.14159265359
7813
7814			// Van der Corput radical inverse
7815			float radicalInverse_VdC(uint bits) {
7816				bits = (bits << 16u) | (bits >> 16u);
7817				bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
7818				bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
7819				bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
7820				bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
7821				return float(bits) * 2.3283064365386963e-10; // / 0x100000000
7822			}
7823
7824			// Hammersley sequence
7825			vec2 hammersley(uint i, uint N) {
7826				return vec2(float(i) / float(N), radicalInverse_VdC(i));
7827			}
7828
7829			// GGX VNDF importance sampling (Eric Heitz 2018)
7830			// "Sampling the GGX Distribution of Visible Normals"
7831			// https://jcgt.org/published/0007/04/01/
7832			vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
7833				float alpha = roughness * roughness;
7834
7835				// Section 4.1: Orthonormal basis
7836				vec3 T1 = vec3(1.0, 0.0, 0.0);
7837				vec3 T2 = cross(V, T1);
7838
7839				// Section 4.2: Parameterization of projected area
7840				float r = sqrt(Xi.x);
7841				float phi = 2.0 * PI * Xi.y;
7842				float t1 = r * cos(phi);
7843				float t2 = r * sin(phi);
7844				float s = 0.5 * (1.0 + V.z);
7845				t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;
7846
7847				// Section 4.3: Reprojection onto hemisphere
7848				vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V;
7849
7850				// Section 3.4: Transform back to ellipsoid configuration
7851				return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));
7852			}
7853
7854			void main() {
7855				vec3 N = normalize(vOutputDirection);
7856				vec3 V = N; // Assume view direction equals normal for pre-filtering
7857
7858				vec3 prefilteredColor = vec3(0.0);
7859				float totalWeight = 0.0;
7860
7861				// For very low roughness, just sample the environment directly
7862				if (roughness < 0.001) {
7863					gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);
7864					return;
7865				}
7866
7867				// Tangent space basis for VNDF sampling
7868				vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
7869				vec3 tangent = normalize(cross(up, N));
7870				vec3 bitangent = cross(N, tangent);
7871
7872				for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
7873					vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
7874
7875					// For PMREM, V = N, so in tangent space V is always (0, 0, 1)
7876					vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
7877
7878					// Transform H back to world space
7879					vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);
7880					vec3 L = normalize(2.0 * dot(V, H) * H - V);
7881
7882					float NdotL = max(dot(N, L), 0.0);
7883
7884					if(NdotL > 0.0) {
7885						// Sample environment at fixed mip level
7886						// VNDF importance sampling handles the distribution filtering
7887						vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);
7888
7889						// Weight by NdotL for the split-sum approximation
7890						// VNDF PDF naturally accounts for the visible microfacet distribution
7891						prefilteredColor += sampleColor * NdotL;
7892						totalWeight += NdotL;
7893					}
7894				}
7895
7896				if (totalWeight > 0.0) {
7897					prefilteredColor = prefilteredColor / totalWeight;
7898				}
7899
7900				gl_FragColor = vec4(prefilteredColor, 1.0);
7901			}
7902		`,blending:uo,depthTest:!1,depthWrite:!1})}function Qse(t,e,n){const r=new Float32Array(fl),i=new oe(0,1,0);return new Bs({name:"SphericalGaussianBlur",defines:{n:fl,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Gy(),fragmentShader:`
7903
7904			precision mediump float;
7905			precision mediump int;
7906
7907			varying vec3 vOutputDirection;
7908
7909			uniform sampler2D envMap;
7910			uniform int samples;
7911			uniform float weights[ n ];
7912			uniform bool latitudinal;
7913			uniform float dTheta;
7914			uniform float mipInt;
7915			uniform vec3 poleAxis;
7916
7917			#define ENVMAP_TYPE_CUBE_UV
7918			#include <cube_uv_reflection_fragment>
7919
7920			vec3 getSample( float theta, vec3 axis ) {
7921
7922				float cosTheta = cos( theta );
7923				// Rodrigues' axis-angle rotation
7924				vec3 sampleDirection = vOutputDirection * cosTheta
7925					+ cross( axis, vOutputDirection ) * sin( theta )
7926					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
7927
7928				return bilinearCubeUV( envMap, sampleDirection, mipInt );
7929
7930			}
7931
7932			void main() {
7933
7934				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
7935
7936				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
7937
7938					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
7939
7940				}
7941
7942				axis = normalize( axis );
7943
7944				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
7945				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
7946
7947				for ( int i = 1; i < n; i++ ) {
7948
7949					if ( i >= samples ) {
7950
7951						break;
7952
7953					}
7954
7955					float theta = dTheta * float( i );
7956					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
7957					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
7958
7959				}
7960
7961			}
7962		`,blending:uo,depthTest:!1,depthWrite:!1})}function TP(){return new Bs({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Gy(),fragmentShader:`
7963
7964			precision mediump float;
7965			precision mediump int;
7966
7967			varying vec3 vOutputDirection;
7968
7969			uniform sampler2D envMap;
7970
7971			#include <common>
7972
7973			void main() {
7974
7975				vec3 outputDirection = normalize( vOutputDirection );
7976				vec2 uv = equirectUv( outputDirection );
7977
7978				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
7979
7980			}
7981		`,blending:uo,depthTest:!1,depthWrite:!1})}function AP(){return new Bs({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Gy(),fragmentShader:`
7982
7983			precision mediump float;
7984			precision mediump int;
7985
7986			uniform float flipEnvMap;
7987
7988			varying vec3 vOutputDirection;
7989
7990			uniform samplerCube envMap;
7991
7992			void main() {
7993
7994				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
7995
7996			}
7997		`,blending:uo,depthTest:!1,depthWrite:!1})}function Gy(){return`
7998
7999		precision mediump float;
8000		precision mediump int;
8001
8002		attribute float faceIndex;
8003
8004		varying vec3 vOutputDirection;
8005
8006		// RH coordinate system; PMREM face-indexing convention
8007		vec3 getDirection( vec2 uv, float face ) {
8008
8009			uv = 2.0 * uv - 1.0;
8010
8011			vec3 direction = vec3( uv, 1.0 );
8012
8013			if ( face == 0.0 ) {
8014
8015				direction = direction.zyx; // ( 1, v, u ) pos x
8016
8017			} else if ( face == 1.0 ) {
8018
8019				direction = direction.xzy;
8020				direction.xz *= -1.0; // ( -u, 1, -v ) pos y
8021
8022			} else if ( face == 2.0 ) {
8023
8024				direction.x *= -1.0; // ( -u, v, 1 ) pos z
8025
8026			} else if ( face == 3.0 ) {
8027
8028				direction = direction.zyx;
8029				direction.xz *= -1.0; // ( -1, v, -u ) neg x
8030
8031			} else if ( face == 4.0 ) {
8032
8033				direction = direction.xzy;
8034				direction.xy *= -1.0; // ( -u, -1, v ) neg y
8035
8036			} else if ( face == 5.0 ) {
8037
8038				direction.z *= -1.0; // ( u, v, -1 ) neg z
8039
8040			}
8041
8042			return direction;
8043
8044		}
8045
8046		void main() {
8047
8048			vOutputDirection = getDirection( uv, faceIndex );
8049			gl_Position = vec4( position, 1.0 );
8050
8051		}
8052	`}class DU extends Ps{constructor(e=1,n={}
vendor: 27,202 bytes, lines 8052-8168
8052){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new CU(i),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}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 r={uniforms:{tEquirect:{value:null}},vertexShader:`
8053
8054				varying vec3 vWorldDirection;
8055
8056				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
8057
8058					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
8059
8060				}
8061
8062				void main() {
8063
8064					vWorldDirection = transformDirection( position, modelMatrix );
8065
8066					#include <begin_vertex>
8067					#include <project_vertex>
8068
8069				}
8070			`,fragmentShader:`
8071
8072				uniform sampler2D tEquirect;
8073
8074				varying vec3 vWorldDirection;
8075
8076				#include <common>
8077
8078				void main() {
8079
8080					vec3 direction = normalize( vWorldDirection );
8081
8082					vec2 sampleUV = equirectUv( direction );
8083
8084					gl_FragColor = texture2D( tEquirect, sampleUV );
8085
8086				}
8087			`},i=new tp(5,5,5),s=new Bs({name:"CubemapFromEquirect",uniforms:Hu(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:Qr,blending:uo});s.uniforms.tEquirect.value=n;const o=new js(i,s),a=n.minFilter;return n.minFilter===yl&&(n.minFilter=yr),new nre(1,10,this).update(e,o),n.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,n=!0,r=!0,i=!0){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(n,r,i);e.setRenderTarget(s)}}function Zse(t){let e=new WeakMap,n=new WeakMap,r=null;function i(u,h=!1){return u==null?null:h?o(u):s(u)}function s(u){if(u&&u.isTexture){const h=u.mapping;if(h===h0||h===p0)if(e.has(u)){const g=e.get(u).texture;return a(g,u.mapping)}else{const g=u.image;if(g&&g.height>0){const v=new DU(g.height);return v.fromEquirectangularTexture(t,u),e.set(u,v),u.addEventListener("dispose",c),a(v.texture,u.mapping)}else return null}}return u}function o(u){if(u&&u.isTexture){const h=u.mapping,g=h===h0||h===p0,v=h===Bl||h===Bu;if(g||v){let m=n.get(u);const p=m!==void 0?m.texture.pmremVersion:0;if(u.isRenderTargetTexture&&u.pmremVersion!==p)return r===null&&(r=new EP(t)),m=g?r.fromEquirectangular(u,m):r.fromCubemap(u,m),m.texture.pmremVersion=u.pmremVersion,n.set(u,m),m.texture;if(m!==void 0)return m.texture;{const y=u.image;return g&&y&&y.height>0||v&&y&&l(y)?(r===null&&(r=new EP(t)),m=g?r.fromEquirectangular(u):r.fromCubemap(u),m.texture.pmremVersion=u.pmremVersion,n.set(u,m),u.addEventListener("dispose",d),m.texture):null}}}return u}function a(u,h){return h===h0?u.mapping=Bl:h===p0&&(u.mapping=Bu),u}function l(u){let h=0;const g=6;for(let v=0;v<g;v++)u[v]!==void 0&&h++;return h===g}function c(u){const h=u.target;h.removeEventListener("dispose",c);const g=e.get(h);g!==void 0&&(e.delete(h),g.dispose())}function d(u){const h=u.target;h.removeEventListener("dispose",d);const g=n.get(h);g!==void 0&&(n.delete(h),g.dispose())}function f(){e=new WeakMap,n=new WeakMap,r!==null&&(r.dispose(),r=null)}return{get:i,dispose:f}}function Jse(t){const e={};function n(r){if(e[r]!==void 0)return e[r];const i=t.getExtension(r);return e[r]=i,i}return{has:function(r){return n(r)!==null},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(r){const i=n(r);return i===null&&yv("WebGLRenderer: "+r+" extension not supported."),i}}}function eoe(t,e,n,r){const i={},s=new WeakMap;function o(f){const u=f.target;u.index!==null&&e.remove(u.index);for(const g in u.attributes)e.remove(u.attributes[g]);u.removeEventListener("dispose",o),delete i[u.id];const h=s.get(u);h&&(e.remove(h),s.delete(u)),r.releaseStatesOfGeometry(u),u.isInstancedBufferGeometry===!0&&delete u._maxInstanceCount,n.memory.geometries--}function a(f,u){return i[u.id]===!0||(u.addEventListener("dispose",o),i[u.id]=!0,n.memory.geometries++),u}function l(f){const u=f.attributes;for(const h in u)e.update(u[h],t.ARRAY_BUFFER)}function c(f){const u=[],h=f.index,g=f.attributes.position;let v=0;if(g===void 0)return;if(h!==null){const y=h.array;v=h.version;for(let w=0,x=y.length;w<x;w+=3){const S=y[w+0],I=y[w+1],M=y[w+2];u.push(S,I,I,M,M,S)}}else{const y=g.array;v=g.version;for(let w=0,x=y.length/3-1;w<x;w+=3){const S=w+0,I=w+1,M=w+2;u.push(S,I,I,M,M,S)}}const m=new(g.count>=65535?TU:SU)(u,1);m.version=v;const p=s.get(f);p&&e.remove(p),s.set(f,m)}function d(f){const u=s.get(f);if(u){const h=f.index;h!==null&&u.version<h.version&&c(f)}else c(f);return s.get(f)}return{get:a,update:l,getWireframeAttribute:d}}function toe(t,e,n){let r;function i(u){r=u}let s,o;function a(u){s=u.type,o=u.bytesPerElement}function l(u,h){t.drawElements(r,h,s,u*o),n.update(h,r,1)}function c(u,h,g){g!==0&&(t.drawElementsInstanced(r,h,s,u*o,g),n.update(h,r,g))}function d(u,h,g){if(g===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(r,h,0,s,u,0,g);let m=0;for(let p=0;p<g;p++)m+=h[p];n.update(m,r,1)}function f(u,h,g,v){if(g===0)return;const m=e.get("WEBGL_multi_draw");if(m===null)for(let p=0;p<u.length;p++)c(u[p]/o,h[p],v[p]);else{m.multiDrawElementsInstancedWEBGL(r,h,0,s,u,0,v,0,g);let p=0;for(let y=0;y<g;y++)p+=h[y]*v[y];n.update(p,r,1)}}this.setMode=i,this.setIndex=a,this.render=l,this.renderInstances=c,this.renderMultiDraw=d,this.renderMultiDrawInstances=f}function noe(t){const e={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function r(s,o,a){switch(n.calls++,o){case t.TRIANGLES:n.triangles+=a*(s/3);break;case t.LINES:n.lines+=a*(s/2);break;case t.LINE_STRIP:n.lines+=a*(s-1);break;case t.LINE_LOOP:n.lines+=a*s;break;case t.POINTS:n.points+=a*s;break;default:zt("WebGLInfo: Unknown draw mode:",o);break}}function i(){n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:e,render:n,programs:null,autoReset:!0,reset:i,update:r}}function roe(t,e,n){const r=new WeakMap,i=new An;function s(o,a,l){const c=o.morphTargetInfluences,d=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,f=d!==void 0?d.length:0;let u=r.get(a);if(u===void 0||u.count!==f){let T=function(){E.dispose(),r.delete(a),a.removeEventListener("dispose",T)};var h=T;u!==void 0&&u.texture.dispose();const g=a.morphAttributes.position!==void 0,v=a.morphAttributes.normal!==void 0,m=a.morphAttributes.color!==void 0,p=a.morphAttributes.position||[],y=a.morphAttributes.normal||[],w=a.morphAttributes.color||[];let x=0;g===!0&&(x=1),v===!0&&(x=2),m===!0&&(x=3);let S=a.attributes.position.count*x,I=1;S>e.maxTextureSize&&(I=Math.ceil(S/e.maxTextureSize),S=e.maxTextureSize);const M=new Float32Array(S*I*4*f),E=new bU(M,S,I,f);E.type=bs,E.needsUpdate=!0;const C=x*4;for(let A=0;A<f;A++){const R=p[A],P=y[A],D=w[A],F=S*I*4*A;for(let V=0;V<R.count;V++){const H=V*C;g===!0&&(i.fromBufferAttribute(R,V),M[F+H+0]=i.x,M[F+H+1]=i.y,M[F+H+2]=i.z,M[F+H+3]=0),v===!0&&(i.fromBufferAttribute(P,V),M[F+H+4]=i.x,M[F+H+5]=i.y,M[F+H+6]=i.z,M[F+H+7]=0),m===!0&&(i.fromBufferAttribute(D,V),M[F+H+8]=i.x,M[F+H+9]=i.y,M[F+H+10]=i.z,M[F+H+11]=D.itemSize===4?i.w:1)}}u={count:f,texture:E,size:new _t(S,I)},r.set(a,u),a.addEventListener("dispose",T)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)l.getUniforms().setValue(t,"morphTexture",o.morphTexture,n);else{let g=0;for(let m=0;m<c.length;m++)g+=c[m];const v=a.morphTargetsRelative?1:1-g;l.getUniforms().setValue(t,"morphTargetBaseInfluence",v),l.getUniforms().setValue(t,"morphTargetInfluences",c)}l.getUniforms().setValue(t,"morphTargetsTexture",u.texture,n),l.getUniforms().setValue(t,"morphTargetsTextureSize",u.size)}return{update:s}}function ioe(t,e,n,r,i){let s=new WeakMap;function o(c){const d=i.render.frame,f=c.geometry,u=e.get(c,f);if(s.get(u)!==d&&(e.update(u),s.set(u,d)),c.isInstancedMesh&&(c.hasEventListener("dispose",l)===!1&&c.addEventListener("dispose",l),s.get(c)!==d&&(n.update(c.instanceMatrix,t.ARRAY_BUFFER),c.instanceColor!==null&&n.update(c.instanceColor,t.ARRAY_BUFFER),s.set(c,d))),c.isSkinnedMesh){const h=c.skeleton;s.get(h)!==d&&(h.update(),s.set(h,d))}return u}function a(){s=new WeakMap}function l(c){const d=c.target;d.removeEventListener("dispose",l),r.releaseStatesOfObject(d),n.remove(d.instanceMatrix),d.instanceColor!==null&&n.remove(d.instanceColor)}return{update:o,dispose:a}}const soe={[iU]:"LINEAR_TONE_MAPPING",[sU]:"REINHARD_TONE_MAPPING",[oU]:"CINEON_TONE_MAPPING",[aU]:"ACES_FILMIC_TONE_MAPPING",[cU]:"AGX_TONE_MAPPING",[uU]:"NEUTRAL_TONE_MAPPING",[lU]:"CUSTOM_TONE_MAPPING"};function ooe(t,e,n,r,i){const s=new Ps(e,n,{type:t,depthBuffer:r,stencilBuffer:i}),o=new Ps(e,n,{type:So,depthBuffer:!1,stencilBuffer:!1}),a=new Di;a.setAttribute("position",new Nr([-1,3,0,-1,-1,0,3,-1,0],3)),a.setAttribute("uv",new Nr([0,2,0,0,2,0],2));const l=new Kne({uniforms:{tDiffuse:{value:null}},vertexShader:`
8088			precision highp float;
8089
8090			uniform mat4 modelViewMatrix;
8091			uniform mat4 projectionMatrix;
8092
8093			attribute vec3 position;
8094			attribute vec2 uv;
8095
8096			varying vec2 vUv;
8097
8098			void main() {
8099				vUv = uv;
8100				gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
8101			}`,fragmentShader:`
8102			precision highp float;
8103
8104			uniform sampler2D tDiffuse;
8105
8106			varying vec2 vUv;
8107
8108			#include <tonemapping_pars_fragment>
8109			#include <colorspace_pars_fragment>
8110
8111			void main() {
8112				gl_FragColor = texture2D( tDiffuse, vUv );
8113
8114				#ifdef LINEAR_TONE_MAPPING
8115					gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );
8116				#elif defined( REINHARD_TONE_MAPPING )
8117					gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );
8118				#elif defined( CINEON_TONE_MAPPING )
8119					gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );
8120				#elif defined( ACES_FILMIC_TONE_MAPPING )
8121					gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );
8122				#elif defined( AGX_TONE_MAPPING )
8123					gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );
8124				#elif defined( NEUTRAL_TONE_MAPPING )
8125					gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );
8126				#elif defined( CUSTOM_TONE_MAPPING )
8127					gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );
8128				#endif
8129
8130				#ifdef SRGB_TRANSFER
8131					gl_FragColor = sRGBTransferOETF( gl_FragColor );
8132				#endif
8133			}`,depthTest:!1,depthWrite:!1}),c=new js(a,l),d=new LS(-1,1,1,-1,0,1);let f=null,u=null,h=!1,g,v=null,m=[],p=!1;this.setSize=function(y,w){s.setSize(y,w),o.setSize(y,w);for(let x=0;x<m.length;x++){const S=m[x];S.setSize&&S.setSize(y,w)}},this.setEffects=function(y){m=y,p=m.length>0&&m[0].isRenderPass===!0;const w=s.width,x=s.height;for(let S=0;S<m.length;S++){const I=m[S];I.setSize&&I.setSize(w,x)}},this.begin=function(y,w){if(h||y.toneMapping===Rs&&m.length===0)return!1;if(v=w,w!==null){const x=w.width,S=w.height;(s.width!==x||s.height!==S)&&this.setSize(x,S)}return p===!1&&y.setRenderTarget(s),g=y.toneMapping,y.toneMapping=Rs,!0},this.hasRenderPass=function(){return p},this.end=function(y,w){y.toneMapping=g,h=!0;let x=s,S=o;for(let I=0;I<m.length;I++){const M=m[I];if(M.enabled!==!1&&(M.render(y,S,x,w),M.needsSwap!==!1)){const E=x;x=S,S=E}}if(f!==y.outputColorSpace||u!==y.toneMapping){f=y.outputColorSpace,u=y.toneMapping,l.defines={},Ft.getTransfer(f)===Xt&&(l.defines.SRGB_TRANSFER="");const I=soe[u];I&&(l.defines[I]=""),l.needsUpdate=!0}l.uniforms.tDiffuse.value=x.texture,y.setRenderTarget(v),y.render(c,d),v=null,h=!1},this.isCompositing=function(){return h},this.dispose=function(){s.dispose(),o.dispose(),a.dispose(),l.dispose()}}const kU=new Ir,k1=new Th(1,1),LU=new bU,FU=new Ene,UU=new CU,MP=[],CP=[],RP=new Float32Array(16),PP=new Float32Array(9),IP=new Float32Array(4);function dd(t,e,n){const r=t[0];if(r<=0||r>0)return t;const i=e*n;let s=MP[i];if(s===void 0&&(s=new Float32Array(i),MP[i]=s),e!==0){r.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=n,t[o].toArray(s,a)}return s}function Gn(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function $n(t,e){for(let n=0,r=e.length;n<r;n++)t[n]=e[n]}function $y(t,e){let n=CP[e];n===void 0&&(n=new Int32Array(e),CP[e]=n);for(let r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function aoe(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function loe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Gn(n,e))return;t.uniform2fv(this.addr,e),$n(n,e)}}function coe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(e.r!==void 0)(n[0]!==e.r||n[1]!==e.g||n[2]!==e.b)&&(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(Gn(n,e))return;t.uniform3fv(this.addr,e),$n(n,e)}}function uoe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Gn(n,e))return;t.uniform4fv(this.addr,e),$n(n,e)}}function doe(t,e){const n=this.cache,r=e.elements;if(r===void 0){if(Gn(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),$n(n,e)}else{if(Gn(n,r))return;IP.set(r),t.uniformMatrix2fv(this.addr,!1,IP),$n(n,r)}}function foe(t,e){const n=this.cache,r=e.elements;if(r===void 0){if(Gn(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),$n(n,e)}else{if(Gn(n,r))return;PP.set(r),t.uniformMatrix3fv(this.addr,!1,PP),$n(n,r)}}function hoe(t,e){const n=this.cache,r=e.elements;if(r===void 0){if(Gn(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),$n(n,e)}else{if(Gn(n,r))return;RP.set(r),t.uniformMatrix4fv(this.addr,!1,RP),$n(n,r)}}function poe(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function moe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Gn(n,e))return;t.uniform2iv(this.addr,e),$n(n,e)}}function goe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Gn(n,e))return;t.uniform3iv(this.addr,e),$n(n,e)}}function voe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Gn(n,e))return;t.uniform4iv(this.addr,e),$n(n,e)}}function yoe(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function _oe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Gn(n,e))return;t.uniform2uiv(this.addr,e),$n(n,e)}}function xoe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Gn(n,e))return;t.uniform3uiv(this.addr,e),$n(n,e)}}function boe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Gn(n,e))return;t.uniform4uiv(this.addr,e),$n(n,e)}}function woe(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i);let s;this.type===t.SAMPLER_2D_SHADOW?(k1.compareFunction=n.isReversedDepthBuffer()?IS:PS,s=k1):s=kU,n.setTexture2D(e||s,i)}function Eoe(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||FU,i)}function Soe(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(e||UU,i)}function Toe(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||LU,i)}function Aoe(t){switch(t){case 5126:return aoe;case 35664:return loe;case 35665:return coe;case 35666:return uoe;case 35674:return doe;case 35675:return foe;case 35676:return hoe;case 5124:case 35670:return poe;case 35667:case 35671:return moe;case 35668:case 35672:return goe;case 35669:case 35673:return voe;case 5125:return yoe;case 36294:return _oe;case 36295:return xoe;case 36296:return boe;case 35678:case 36198:case 36298:case 36306:case 35682:return woe;case 35679:case 36299:case 36307:return Eoe;case 35680:case 36300:case 36308:case 36293:return Soe;case 36289:case 36303:case 36311:case 36292:return Toe}}function Moe(t,e){t.uniform1fv(this.addr,e)}function Coe(t,e){const n=dd(e,this.size,2);t.uniform2fv(this.addr,n)}function Roe(t,e){const n=dd(e,this.size,3);t.uniform3fv(this.addr,n)}function Poe(t,e){const n=dd(e,this.size,4);t.uniform4fv(this.addr,n)}function Ioe(t,e){const n=dd(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function Noe(t,e){const n=dd(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function Ooe(t,e){const n=dd(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Doe(t,e){t.uniform1iv(this.addr,e)}function koe(t,e){t.uniform2iv(this.addr,e)}function Loe(t,e){t.uniform3iv(this.addr,e)}function Foe(t,e){t.uniform4iv(this.addr,e)}function Uoe(t,e){t.uniform1uiv(this.addr,e)}function joe(t,e){t.uniform2uiv(this.addr,e)}function Boe(t,e){t.uniform3uiv(this.addr,e)}function Voe(t,e){t.uniform4uiv(this.addr,e)}function zoe(t,e,n){const r=this.cache,i=e.length,s=$y(n,i);Gn(r,s)||(t.uniform1iv(this.addr,s),$n(r,s));let o;this.type===t.SAMPLER_2D_SHADOW?o=k1:o=kU;for(let a=0;a!==i;++a)n.setTexture2D(e[a]||o,s[a])}function Hoe(t,e,n){const r=this.cache,i=e.length,s=$y(n,i);Gn(r,s)||(t.uniform1iv(this.addr,s),$n(r,s));for(let o=0;o!==i;++o)n.setTexture3D(e[o]||FU,s[o])}function Goe(t,e,n){const r=this.cache,i=e.length,s=$y(n,i);Gn(r,s)||(t.uniform1iv(this.addr,s),$n(r,s));for(let o=0;o!==i;++o)n.setTextureCube(e[o]||UU,s[o])}function $oe(t,e,n){const r=this.cache,i=e.length,s=$y(n,i);Gn(r,s)||(t.uniform1iv(this.addr,s),$n(r,s));for(let o=0;o!==i;++o)n.setTexture2DArray(e[o]||LU,s[o])}function Woe(t){switch(t){case 5126:return Moe;case 35664:return Coe;case 35665:return Roe;case 35666:return Poe;case 35674:return Ioe;case 35675:return Noe;case 35676:return Ooe;case 5124:case 35670:return Doe;case 35667:case 35671:return koe;case 35668:case 35672:return Loe;case 35669:case 35673:return Foe;case 5125:return Uoe;case 36294:return joe;case 36295:return Boe;case 36296:return Voe;case 35678:case 36198:case 36298:case 36306:case 35682:return zoe;case 35679:case 36299:case 36307:return Hoe;case 35680:case 36300:case 36308:case 36293:return Goe;case 36289:case 36303:case 36311:case 36292:return $oe}}class qoe{constructor(e,n,r){this.id=e,this.addr=r,this.cache=[],this.type=n.type,this.setValue=Aoe(n.type)}}class Koe{constructor(e,n,r){this.id=e,this.addr=r,this.cache=[],this.type=n.type,this.size=n.size,this.setValue=Woe(n.type)}}class Xoe{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,n,r){const i=this.seq;for(let s=0,o=i.length;s!==o;++s){const a=i[s];a.setValue(e,n[a.id],r)}}}const G0=/(\w+)(\])?(\[|\.)?/g;function NP(t,e){t.seq.push(e),t.map[e.id]=e}function Yoe(t,e,n){const r=t.name,i=r.length;for(G0.lastIndex=0;;){const s=G0.exec(r),o=G0.lastIndex;let a=s[1];const l=s[2]==="]",c=s[3];if(l&&(a=a|0),c===void 0||c==="["&&o+2===i){NP(n,c===void 0?new qoe(a,t,e):new Koe(a,t,e));break}else{let f=n.map[a];f===void 0&&(f=new Xoe(a),NP(n,f)),n=f}}}class og{constructor(e,n){this.seq=[],this.map={};const r=e.getProgramParameter(n,e.ACTIVE_UNIFORMS);for(let o=0;o<r;++o){const a=e.getActiveUniform(n,o),l=e.getUniformLocation(n,a.name);Yoe(a,l,this)}const i=[],s=[];for(const o of this.seq)o.type===e.SAMPLER_2D_SHADOW||o.type===e.SAMPLER_CUBE_SHADOW||o.type===e.SAMPLER_2D_ARRAY_SHADOW?i.push(o):s.push(o);i.length>0&&(this.seq=i.concat(s))}setValue(e,n,r,i){const s=this.map[n];s!==void 0&&s.setValue(e,r,i)}setOptional(e,n,r){const i=n[r];i!==void 0&&this.setValue(e,r,i)}static upload(e,n,r,i){for(let s=0,o=n.length;s!==o;++s){const a=n[s],l=r[a.id];l.needsUpdate!==!1&&a.setValue(e,l.value,i)}}static seqWithValue(e,n){const r=[];for(let i=0,s=e.length;i!==s;++i){const o=e[i];o.id in n&&r.push(o)}return r}}function OP(t,e,n){const r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}const Qoe=37297;let Zoe=0;function Joe(t,e){const n=t.split(`
8134`),r=[],i=Math.max(e-6,0),s=Math.min(e+6,n.length);for(let o=i;o<s;o++){const a=o+1;r.push(`${a===e?">":" "} ${a}: ${n[o]}`)}return r.join(`
8135`)}const DP=new wt;function eae(t){Ft._getMatrix(DP,Ft.workingColorSpace,t);const e=`mat3( ${DP.elements.map(n=>n.toFixed(4))} )`;switch(Ft.getTransfer(t)){case gv:return[e,"LinearTransferOETF"];case Xt:return[e,"sRGBTransferOETF"];default:return ut("WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function kP(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),s=(t.getShaderInfoLog(e)||"").trim();if(r&&s==="")return"";const o=/ERROR: 0:(\d+)/.exec(s);if(o){const a=parseInt(o[1]);return n.toUpperCase()+`
8136
8137`+s+`
8138
8139`+Joe(t.getShaderSource(e),a)}else return s}function tae(t,e){const n=eae(e);return[`vec4 ${t}( vec4 value ) {`,`	return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join(`
8140`)}const nae={[iU]:"Linear",[sU]:"Reinhard",[oU]:"Cineon",[aU]:"ACESFilmic",[cU]:"AgX",[uU]:"Neutral",[lU]:"Custom"};function rae(t,e){const n=nae[e];return n===void 0?(ut("WebGLProgram: Unsupported toneMapping:",e),"vec3 "+t+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const Em=new oe;function iae(){Ft.getLuminanceCoefficients(Em);const t=Em.x.toFixed(4),e=Em.y.toFixed(4),n=Em.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",`	const vec3 weights = vec3( ${t}, ${e}, ${n} );`,"	return dot( weights, rgb );","}"].join(`
8141`)}function sae(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(df).join(`
8142`)}function oae(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(`
8143`)}function aae(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const s=t.getActiveAttrib(e,i),o=s.name;let a=1;s.type===t.FLOAT_MAT2&&(a=2),s.type===t.FLOAT_MAT3&&(a=3),s.type===t.FLOAT_MAT4&&(a=4),n[o]={type:s.type,location:t.getAttribLocation(e,o),locationSize:a}}return n}function df(t){return t!==""}function LP(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function FP(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const lae=/^[ \t]*#include +<([\w\d./]+)>/gm;function L1(t){return t.replace(lae,uae)}const cae=new Map;function uae(t,e){let n=Tt[e];if(n===void 0){const r=cae.get(e);if(r!==void 0)n=Tt[r],ut('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return L1(n)}const dae=/#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 UP(t){return t.replace(dae,fae)}function fae(t,e,n,r){let i="";for(let s=parseInt(e);s<parseInt(n);s++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function jP(t){let e=`precision ${t.precision} float;
8144	precision ${t.precision} int;
8145	precision ${t.precision} sampler2D;
8146	precision ${t.precision} samplerCube;
8147	precision ${t.precision} sampler3D;
8148	precision ${t.precision} sampler2DArray;
8149	precision ${t.precision} sampler2DShadow;
8150	precision ${t.precision} samplerCubeShadow;
8151	precision ${t.precision} sampler2DArrayShadow;
8152	precision ${t.precision} isampler2D;
8153	precision ${t.precision} isampler3D;
8154	precision ${t.precision} isamplerCube;
8155	precision ${t.precision} isampler2DArray;
8156	precision ${t.precision} usampler2D;
8157	precision ${t.precision} usampler3D;
8158	precision ${t.precision} usamplerCube;
8159	precision ${t.precision} usampler2DArray;
8160	`;return t.precision==="highp"?e+=`
8161#define HIGH_PRECISION`:t.precision==="mediump"?e+=`
8162#define MEDIUM_PRECISION`:t.precision==="lowp"&&(e+=`
8163#define LOW_PRECISION`),e}const hae={[tg]:"SHADOWMAP_TYPE_PCF",[cf]:"SHADOWMAP_TYPE_VSM"};function pae(t){return hae[t.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const mae={[Bl]:"ENVMAP_TYPE_CUBE",[Bu]:"ENVMAP_TYPE_CUBE",[Vy]:"ENVMAP_TYPE_CUBE_UV"};function gae(t){return t.envMap===!1?"ENVMAP_TYPE_CUBE":mae[t.envMapMode]||"ENVMAP_TYPE_CUBE"}const vae={[Bu]:"ENVMAP_MODE_REFRACTION"};function yae(t){return t.envMap===!1?"ENVMAP_MODE_REFLECTION":vae[t.envMapMode]||"ENVMAP_MODE_REFLECTION"}const _ae={[rU]:"ENVMAP_BLENDING_MULTIPLY",[Bte]:"ENVMAP_BLENDING_MIX",[Vte]:"ENVMAP_BLENDING_ADD"};function xae(t){return t.envMap===!1?"ENVMAP_BLENDING_NONE":_ae[t.combine]||"ENVMAP_BLENDING_NONE"}function bae(t){const e=t.envMapCubeUVHeight;if(e===null)return null;const n=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),7*16)),texelHeight:r,maxMip:n}}function wae(t,e,n,r){const i=t.getContext(),s=n.defines;let o=n.vertexShader,a=n.fragmentShader;const l=pae(n),c=gae(n),d=yae(n),f=xae(n),u=bae(n),h=sae(n),g=oae(s),v=i.createProgram();let m,p,y=n.glslVersion?"#version "+n.glslVersion+`
8164`:"";n.isRawShaderMaterial?(m=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(df).join(`
8165`),m.length>0&&(m+=`
8166`),p=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(df).join(`
8167`),p.length>0&&(p+=`
8168`)):(m=[jP(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+d:"",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_IR
8168IDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","	attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","	attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","	uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","	attribute vec2 uv1;","#endif","#ifdef USE_UV2","	attribute vec2 uv2;","#endif","#ifdef USE_UV3","	attribute vec2 uv3;","#endif","#ifdef USE_TANGENT","	attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","	attribute vec4 color;","#elif defined( USE_COLOR )","	attribute vec3 color;","#endif","#ifdef USE_SKINNING","	attribute vec4 skinIndex;","	attribute vec4 skinWeight;","#endif",`
8169`].filter(df).join(`
8170`),p=[jP(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.alph
vendor: 4,232 bytes, lines 8170-8177
8170aToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+d:"",n.envMap?"#define "+f:"",u?"#define CUBEUV_TEXEL_WIDTH "+u.texelWidth:"",u?"#define CUBEUV_TEXEL_HEIGHT "+u.texelHeight:"",u?"#define CUBEUV_MAX_MIP "+u.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas||n.batchingColor?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Rs?"#define TONE_MAPPING":"",n.toneMapping!==Rs?Tt.tonemapping_pars_fragment:"",n.toneMapping!==Rs?rae("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Tt.colorspace_pars_fragment,tae("linearToOutputTexel",n.outputColorSpace),iae(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",`
8171`].filter(df).join(`
8172`)),o=L1(o),o=LP(o,n),o=FP(o,n),a=L1(a),a=LP(a,n),a=FP(a,n),o=UP(o),a=UP(a),n.isRawShaderMaterial!==!0&&(y=`#version 300 es
8173`,m=[h,"#define attribute in","#define varying out","#define texture2D texture"].join(`
8174`)+`
8175`+m,p=["#define varying in",n.glslVersion===qR?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===qR?"":"#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(`
8176`)+`
8177`+p);const w=y+m+o,x=y+p+a,S=OP(i,i.VERTEX_SHADER,w),I=OP(i,i.FRAGMENT_SHADER,x);i.attachShader(v,S),i.attachShader(v,I),n.index0AttributeName!==void 0?i.bindAttribLocation(v,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v);
vendor: 22,991 bytes, lines 8177-8211
8177function M(A){if(t.debug.checkShaderErrors){const R=i.getProgramInfoLog(v)||"",P=i.getShaderInfoLog(S)||"",D=i.getShaderInfoLog(I)||"",F=R.trim(),V=P.trim(),H=D.trim();let $=!0,B=!0;if(i.getProgramParameter(v,i.LINK_STATUS)===!1)if($=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,v,S,I);else{const G=kP(i,S,"vertex"),k=kP(i,I,"fragment");zt("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(v,i.VALIDATE_STATUS)+`
8178
8179Material Name: `+A.name+`
8180Material Type: `+A.type+`
8181
8182Program Info Log: `+F+`
8183`+G+`
8184`+k)}else F!==""?ut("WebGLProgram: Program Info Log:",F):(V===""||H==="")&&(B=!1);B&&(A.diagnostics={runnable:$,programLog:F,vertexShader:{log:V,prefix:m},fragmentShader:{log:H,prefix:p}})}i.deleteShader(S),i.deleteShader(I),E=new og(i,v),C=aae(i,v)}let E;this.getUniforms=function(){return E===void 0&&M(this),E};let C;this.getAttributes=function(){return C===void 0&&M(this),C};let T=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return T===!1&&(T=i.getProgramParameter(v,Qoe)),T},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Zoe++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=S,this.fragmentShader=I,this}let Eae=0;class Sae{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),s=this._getShaderStage(r),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new Tae(e),n.set(e,r)),r}}class Tae{constructor(e){this.id=Eae++,this.code=e,this.usedTimes=0}}function Aae(t,e,n,r,i,s){const o=new wU,a=new Sae,l=new Set,c=[],d=new Map,f=r.logarithmicDepthBuffer;let u=r.precision;const h={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(E){return l.add(E),E===0?"uv":`uv${E}`}function v(E,C,T,A,R){const P=A.fog,D=R.geometry,F=E.isMeshStandardMaterial||E.isMeshLambertMaterial||E.isMeshPhongMaterial?A.environment:null,V=E.isMeshStandardMaterial||E.isMeshLambertMaterial&&!E.envMap||E.isMeshPhongMaterial&&!E.envMap,H=e.get(E.envMap||F,V),$=H&&H.mapping===Vy?H.image.height:null,B=h[E.type];E.precision!==null&&(u=r.getMaxPrecision(E.precision),u!==E.precision&&ut("WebGLProgram.getParameters:",E.precision,"not supported, using",u,"instead."));const G=D.morphAttributes.position||D.morphAttributes.normal||D.morphAttributes.color,k=G!==void 0?G.length:0;let z=0;D.morphAttributes.position!==void 0&&(z=1),D.morphAttributes.normal!==void 0&&(z=2),D.morphAttributes.color!==void 0&&(z=3);let q,ne,ee,j;if(B){const Dt=vs[B];q=Dt.vertexShader,ne=Dt.fragmentShader}else q=E.vertexShader,ne=E.fragmentShader,a.update(E),ee=a.getVertexShaderID(E),j=a.getFragmentShaderID(E);const Q=t.getRenderTarget(),Z=t.state.buffers.depth.getReversed(),re=R.isInstancedMesh===!0,se=R.isBatchedMesh===!0,ye=!!E.map,Ue=!!E.matcap,Ie=!!H,je=!!E.aoMap,Ke=!!E.lightMap,Xe=!!E.bumpMap,dt=!!E.normalMap,K=!!E.displacementMap,de=!!E.emissiveMap,_e=!!E.metalnessMap,Ae=!!E.roughnessMap,ce=E.anisotropy>0,X=E.clearcoat>0,U=E.dispersion>0,J=E.iridescence>0,he=E.sheen>0,me=E.transmission>0,fe=ce&&!!E.anisotropyMap,Ve=X&&!!E.clearcoatMap,Ee=X&&!!E.clearcoatNormalMap,qe=X&&!!E.clearcoatRoughnessMap,st=J&&!!E.iridescenceMap,Ce=J&&!!E.iridescenceThicknessMap,Pe=he&&!!E.sheenColorMap,Ge=he&&!!E.sheenRoughnessMap,He=!!E.specularMap,ze=!!E.specularColorMap,Ne=!!E.specularIntensityMap,te=me&&!!E.transmissionMap,xe=me&&!!E.thicknessMap,Se=!!E.gradientMap,ke=!!E.alphaMap,Me=E.alphaTest>0,ge=!!E.alphaHash,Qe=!!E.extensions;let at=Rs;E.toneMapped&&(Q===null||Q.isXRRenderTarget===!0)&&(at=t.toneMapping);const Kt={shaderID:B,shaderType:E.type,shaderName:E.name,vertexShader:q,fragmentShader:ne,defines:E.defines,customVertexShaderID:ee,customFragmentShaderID:j,isRawShaderMaterial:E.isRawShaderMaterial===!0,glslVersion:E.glslVersion,precision:u,batching:se,batchingColor:se&&R._colorsTexture!==null,instancing:re,instancingColor:re&&R.instanceColor!==null,instancingMorph:re&&R.morphTexture!==null,outputColorSpace:Q===null?t.outputColorSpace:Q.isXRRenderTarget===!0?Q.texture.colorSpace:zu,alphaToCoverage:!!E.alphaToCoverage,map:ye,matcap:Ue,envMap:Ie,envMapMode:Ie&&H.mapping,envMapCubeUVHeight:$,aoMap:je,lightMap:Ke,bumpMap:Xe,normalMap:dt,displacementMap:K,emissiveMap:de,normalMapObjectSpace:dt&&E.normalMapType===Gte,normalMapTangentSpace:dt&&E.normalMapType===_U,metalnessMap:_e,roughnessMap:Ae,anisotropy:ce,anisotropyMap:fe,clearcoat:X,clearcoatMap:Ve,clearcoatNormalMap:Ee,clearcoatRoughnessMap:qe,dispersion:U,iridescence:J,iridescenceMap:st,iridescenceThicknessMap:Ce,sheen:he,sheenColorMap:Pe,sheenRoughnessMap:Ge,specularMap:He,specularColorMap:ze,specularIntensityMap:Ne,transmission:me,transmissionMap:te,thicknessMap:xe,gradientMap:Se,opaque:E.transparent===!1&&E.blending===ou&&E.alphaToCoverage===!1,alphaMap:ke,alphaTest:Me,alphaHash:ge,combine:E.combine,mapUv:ye&&g(E.map.channel),aoMapUv:je&&g(E.aoMap.channel),lightMapUv:Ke&&g(E.lightMap.channel),bumpMapUv:Xe&&g(E.bumpMap.channel),normalMapUv:dt&&g(E.normalMap.channel),displacementMapUv:K&&g(E.displacementMap.channel),emissiveMapUv:de&&g(E.emissiveMap.channel),metalnessMapUv:_e&&g(E.metalnessMap.channel),roughnessMapUv:Ae&&g(E.roughnessMap.channel),anisotropyMapUv:fe&&g(E.anisotropyMap.channel),clearcoatMapUv:Ve&&g(E.clearcoatMap.channel),clearcoatNormalMapUv:Ee&&g(E.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:qe&&g(E.clearcoatRoughnessMap.channel),iridescenceMapUv:st&&g(E.iridescenceMap.channel),iridescenceThicknessMapUv:Ce&&g(E.iridescenceThicknessMap.channel),sheenColorMapUv:Pe&&g(E.sheenColorMap.channel),sheenRoughnessMapUv:Ge&&g(E.sheenRoughnessMap.channel),specularMapUv:He&&g(E.specularMap.channel),specularColorMapUv:ze&&g(E.specularColorMap.channel),specularIntensityMapUv:Ne&&g(E.specularIntensityMap.channel),transmissionMapUv:te&&g(E.transmissionMap.channel),thicknessMapUv:xe&&g(E.thicknessMap.channel),alphaMapUv:ke&&g(E.alphaMap.channel),vertexTangents:!!D.attributes.tangent&&(dt||ce),vertexColors:E.vertexColors,vertexAlphas:E.vertexColors===!0&&!!D.attributes.color&&D.attributes.color.itemSize===4,pointsUvs:R.isPoints===!0&&!!D.attributes.uv&&(ye||ke),fog:!!P,useFog:E.fog===!0,fogExp2:!!P&&P.isFogExp2,flatShading:E.wireframe===!1&&(E.flatShading===!0||D.attributes.normal===void 0&&dt===!1&&(E.isMeshLambertMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isMeshPhysicalMaterial)),sizeAttenuation:E.sizeAttenuation===!0,logarithmicDepthBuffer:f,reversedDepthBuffer:Z,skinning:R.isSkinnedMesh===!0,morphTargets:D.morphAttributes.position!==void 0,morphNormals:D.morphAttributes.normal!==void 0,morphColors:D.morphAttributes.color!==void 0,morphTargetsCount:k,morphTextureStride:z,numDirLights:C.directional.length,numPointLights:C.point.length,numSpotLights:C.spot.length,numSpotLightMaps:C.spotLightMap.length,numRectAreaLights:C.rectArea.length,numHemiLights:C.hemi.length,numDirLightShadows:C.directionalShadowMap.length,numPointLightShadows:C.pointShadowMap.length,numSpotLightShadows:C.spotShadowMap.length,numSpotLightShadowsWithMaps:C.numSpotLightShadowsWithMaps,numLightProbes:C.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:E.dithering,shadowMapEnabled:t.shadowMap.enabled&&T.length>0,shadowMapType:t.shadowMap.type,toneMapping:at,decodeVideoTexture:ye&&E.map.isVideoTexture===!0&&Ft.getTransfer(E.map.colorSpace)===Xt,decodeVideoTextureEmissive:de&&E.emissiveMap.isVideoTexture===!0&&Ft.getTransfer(E.emissiveMap.colorSpace)===Xt,premultipliedAlpha:E.premultipliedAlpha,doubleSided:E.side===no,flipSided:E.side===Qr,useDepthPacking:E.depthPacking>=0,depthPacking:E.depthPacking||0,index0AttributeName:E.index0AttributeName,extensionClipCullDistance:Qe&&E.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Qe&&E.extensions.multiDraw===!0||se)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:E.customProgramCacheKey()};return Kt.vertexUv1s=l.has(1),Kt.vertexUv2s=l.has(2),Kt.vertexUv3s=l.has(3),l.clear(),Kt}function m(E){const C=[];if(E.shaderID?C.push(E.shaderID):(C.push(E.customVertexShaderID),C.push(E.customFragmentShaderID)),E.defines!==void 0)for(const T in E.defines)C.push(T),C.push(E.defines[T]);return E.isRawShaderMaterial===!1&&(p(C,E),y(C,E),C.push(t.outputColorSpace)),C.push(E.customProgramCacheKey),C.join()}function p(E,C){E.push(C.precision),E.push(C.outputColorSpace),E.push(C.envMapMode),E.push(C.envMapCubeUVHeight),E.push(C.mapUv),E.push(C.alphaMapUv),E.push(C.lightMapUv),E.push(C.aoMapUv),E.push(C.bumpMapUv),E.push(C.normalMapUv),E.push(C.displacementMapUv),E.push(C.emissiveMapUv),E.push(C.metalnessMapUv),E.push(C.roughnessMapUv),E.push(C.anisotropyMapUv),E.push(C.clearcoatMapUv),E.push(C.clearcoatNormalMapUv),E.push(C.clearcoatRoughnessMapUv),E.push(C.iridescenceMapUv),E.push(C.iridescenceThicknessMapUv),E.push(C.sheenColorMapUv),E.push(C.sheenRoughnessMapUv),E.push(C.specularMapUv),E.push(C.specularColorMapUv),E.push(C.specularIntensityMapUv),E.push(C.transmissionMapUv),E.push(C.thicknessMapUv),E.push(C.combine),E.push(C.fogExp2),E.push(C.sizeAttenuation),E.push(C.morphTargetsCount),E.push(C.morphAttributeCount),E.push(C.numDirLights),E.push(C.numPointLights),E.push(C.numSpotLights),E.push(C.numSpotLightMaps),E.push(C.numHemiLights),E.push(C.numRectAreaLights),E.push(C.numDirLightShadows),E.push(C.numPointLightShadows),E.push(C.numSpotLightShadows),E.push(C.numSpotLightShadowsWithMaps),E.push(C.numLightProbes),E.push(C.shadowMapType),E.push(C.toneMapping),E.push(C.numClippingPlanes),E.push(C.numClipIntersection),E.push(C.depthPacking)}function y(E,C){o.disableAll(),C.instancing&&o.enable(0),C.instancingColor&&o.enable(1),C.instancingMorph&&o.enable(2),C.matcap&&o.enable(3),C.envMap&&o.enable(4),C.normalMapObjectSpace&&o.enable(5),C.normalMapTangentSpace&&o.enable(6),C.clearcoat&&o.enable(7),C.iridescence&&o.enable(8),C.alphaTest&&o.enable(9),C.vertexColors&&o.enable(10),C.vertexAlphas&&o.enable(11),C.vertexUv1s&&o.enable(12),C.vertexUv2s&&o.enable(13),C.vertexUv3s&&o.enable(14),C.vertexTangents&&o.enable(15),C.anisotropy&&o.enable(16),C.alphaHash&&o.enable(17),C.batching&&o.enable(18),C.dispersion&&o.enable(19),C.batchingColor&&o.enable(20),C.gradientMap&&o.enable(21),E.push(o.mask),o.disableAll(),C.fog&&o.enable(0),C.useFog&&o.enable(1),C.flatShading&&o.enable(2),C.logarithmicDepthBuffer&&o.enable(3),C.reversedDepthBuffer&&o.enable(4),C.skinning&&o.enable(5),C.morphTargets&&o.enable(6),C.morphNormals&&o.enable(7),C.morphColors&&o.enable(8),C.premultipliedAlpha&&o.enable(9),C.shadowMapEnabled&&o.enable(10),C.doubleSided&&o.enable(11),C.flipSided&&o.enable(12),C.useDepthPacking&&o.enable(13),C.dithering&&o.enable(14),C.transmission&&o.enable(15),C.sheen&&o.enable(16),C.opaque&&o.enable(17),C.pointsUvs&&o.enable(18),C.decodeVideoTexture&&o.enable(19),C.decodeVideoTextureEmissive&&o.enable(20),C.alphaToCoverage&&o.enable(21),E.push(o.mask)}function w(E){const C=h[E.type];let T;if(C){const A=vs[C];T=$ne.clone(A.uniforms)}else T=E.uniforms;return T}function x(E,C){let T=d.get(C);return T!==void 0?++T.usedTimes:(T=new wae(t,C,E,i),c.push(T),d.set(C,T)),T}function S(E){if(--E.usedTimes===0){const C=c.indexOf(E);c[C]=c[c.length-1],c.pop(),d.delete(E.cacheKey),E.destroy()}}function I(E){a.remove(E)}function M(){a.dispose()}return{getParameters:v,getProgramCacheKey:m,getUniforms:w,acquireProgram:x,releaseProgram:S,releaseShaderCache:I,programs:c,dispose:M}}function Mae(){let t=new WeakMap;function e(o){return t.has(o)}function n(o){let a=t.get(o);return a===void 0&&(a={},t.set(o,a)),a}function r(o){t.delete(o)}function i(o,a,l){t.get(o)[a]=l}function s(){t=new WeakMap}return{has:e,get:n,remove:r,update:i,dispose:s}}function Cae(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.materialVariant!==e.materialVariant?t.materialVariant-e.materialVariant:t.z!==e.z?t.z-e.z:t.id-e.id}function BP(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function VP(){const t=[];let e=0;const n=[],r=[],i=[];function s(){e=0,n.length=0,r.length=0,i.length=0}function o(u){let h=0;return u.isInstancedMesh&&(h+=2),u.isSkinnedMesh&&(h+=1),h}function a(u,h,g,v,m,p){let y=t[e];return y===void 0?(y={id:u.id,object:u,geometry:h,material:g,materialVariant:o(u),groupOrder:v,renderOrder:u.renderOrder,z:m,group:p},t[e]=y):(y.id=u.id,y.object=u,y.geometry=h,y.material=g,y.materialVariant=o(u),y.groupOrder=v,y.renderOrder=u.renderOrder,y.z=m,y.group=p),e++,y}function l(u,h,g,v,m,p){const y=a(u,h,g,v,m,p);g.transmission>0?r.push(y):g.transparent===!0?i.push(y):n.push(y)}function c(u,h,g,v,m,p){const y=a(u,h,g,v,m,p);g.transmission>0?r.unshift(y):g.transparent===!0?i.unshift(y):n.unshift(y)}function d(u,h){n.length>1&&n.sort(u||Cae),r.length>1&&r.sort(h||BP),i.length>1&&i.sort(h||BP)}function f(){for(let u=e,h=t.length;u<h;u++){const g=t[u];if(g.id===null)break;g.id=null,g.object=null,g.geometry=null,g.material=null,g.group=null}}return{opaque:n,transmissive:r,transparent:i,init:s,push:l,unshift:c,finish:f,sort:d}}function Rae(){let t=new WeakMap;function e(r,i){const s=t.get(r);let o;return s===void 0?(o=new VP,t.set(r,[o])):i>=s.length?(o=new VP,s.push(o)):o=s[i],o}function n(){t=new WeakMap}return{get:e,dispose:n}}function Pae(){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 oe,color:new Pt};break;case"SpotLight":n={position:new oe,direction:new oe,color:new Pt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new oe,color:new Pt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new oe,skyColor:new Pt,groundColor:new Pt};break;case"RectAreaLight":n={color:new Pt,position:new oe,halfWidth:new oe,halfHeight:new oe};break}return t[e.id]=n,n}}}function Iae(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _t};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _t};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _t,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let Nae=0;function Oae(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Dae(t){const e=new Pae,n=Iae(),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 c=0;c<9;c++)r.probe.push(new oe);const i=new oe,s=new xn,o=new xn;function a(c){let d=0,f=0,u=0;for(let C=0;C<9;C++)r.probe[C].set(0,0,0);let h=0,g=0,v=0,m=0,p=0,y=0,w=0,x=0,S=0,I=0,M=0;c.sort(Oae);for(let C=0,T=c.length;C<T;C++){const A=c[C],R=A.color,P=A.intensity,D=A.distance;let F=null;if(A.shadow&&A.shadow.map&&(A.shadow.map.texture.format===Vu?F=A.shadow.map.texture:F=A.shadow.map.depthTexture||A.shadow.map.texture),A.isAmbientLight)d+=R.r*P,f+=R.g*P,u+=R.b*P;else if(A.isLightProbe){for(let V=0;V<9;V++)r.probe[V].addScaledVector(A.sh.coefficients[V],P);M++}else if(A.isDirectionalLight){const V=e.get(A);if(V.color.copy(A.color).multiplyScalar(A.intensity),A.castShadow){const H=A.shadow,$=n.get(A);$.shadowIntensity=H.intensity,$.shadowBias=H.bias,$.shadowNormalBias=H.normalBias,$.shadowRadius=H.radius,$.shadowMapSize=H.mapSize,r.directionalShadow[h]=$,r.directionalShadowMap[h]=F,r.directionalShadowMatrix[h]=A.shadow.matrix,y++}r.directional[h]=V,h++}else if(A.isSpotLight){const V=e.get(A);V.position.setFromMatrixPosition(A.matrixWorld),V.color.copy(R).multiplyScalar(P),V.distance=D,V.coneCos=Math.cos(A.angle),V.penumbraCos=Math.cos(A.angle*(1-A.penumbra)),V.decay=A.decay,r.spot[v]=V;const H=A.shadow;if(A.map&&(r.spotLightMap[S]=A.map,S++,H.updateMatrices(A),A.castShadow&&I++),r.spotLightMatrix[v]=H.matrix,A.castShadow){const $=n.get(A);$.shadowIntensity=H.intensity,$.shadowBias=H.bias,$.shadowNormalBias=H.normalBias,$.shadowRadius=H.radius,$.shadowMapSize=H.mapSize,r.spotShadow[v]=$,r.spotShadowMap[v]=F,x++}v++}else if(A.isRectAreaLight){const V=e.get(A);V.color.copy(R).multiplyScalar(P),V.halfWidth.set(A.width*.5,0,0),V.halfHeight.set(0,A.height*.5,0),r.rectArea[m]=V,m++}else if(A.isPointLight){const V=e.get(A);if(V.color.copy(A.color).multiplyScalar(A.intensity),V.distance=A.distance,V.decay=A.decay,A.castShadow){const H=A.shadow,$=n.get(A);$.shadowIntensity=H.intensity,$.shadowBias=H.bias,$.shadowNormalBias=H.normalBias,$.shadowRadius=H.radius,$.shadowMapSize=H.mapSize,$.shadowCameraNear=H.camera.near,$.shadowCameraFar=H.camera.far,r.pointShadow[g]=$,r.pointShadowMap[g]=F,r.pointShadowMatrix[g]=A.shadow.matrix,w++}r.point[g]=V,g++}else if(A.isHemisphereLight){const V=e.get(A);V.skyColor.copy(A.color).multiplyScalar(P),V.groundColor.copy(A.groundColor).multiplyScalar(P),r.hemi[p]=V,p++}}m>0&&(t.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Be.LTC_FLOAT_1,r.rectAreaLTC2=Be.LTC_FLOAT_2):(r.rectAreaLTC1=Be.LTC_HALF_1,r.rectAreaLTC2=Be.LTC_HALF_2)),r.ambient[0]=d,r.ambient[1]=f,r.ambient[2]=u;const E=r.hash;(E.directionalLength!==h||E.pointLength!==g||E.spotLength!==v||E.rectAreaLength!==m||E.hemiLength!==p||E.numDirectionalShadows!==y||E.numPointShadows!==w||E.numSpotShadows!==x||E.numSpotMaps!==S||E.numLightProbes!==M)&&(r.directional.length=h,r.spot.length=v,r.rectArea.length=m,r.point.length=g,r.hemi.length=p,r.directionalShadow.length=y,r.directionalShadowMap.length=y,r.pointShadow.length=w,r.pointShadowMap.length=w,r.spotShadow.length=x,r.spotShadowMap.length=x,r.directionalShadowMatrix.length=y,r.pointShadowMatrix.length=w,r.spotLightMatrix.length=x+S-I,r.spotLightMap.length=S,r.numSpotLightShadowsWithMaps=I,r.numLightProbes=M,E.directionalLength=h,E.pointLength=g,E.spotLength=v,E.rectAreaLength=m,E.hemiLength=p,E.numDirectionalShadows=y,E.numPointShadows=w,E.numSpotShadows=x,E.numSpotMaps=S,E.numLightProbes=M,r.version=Nae++)}function l(c,d){let f=0,u=0,h=0,g=0,v=0;const m=d.matrixWorldInverse;for(let p=0,y=c.length;p<y;p++){const w=c[p];if(w.isDirectionalLight){const x=r.directional[f];x.direction.setFromMatrixPosition(w.matrixWorld),i.setFromMatrixPosition(w.target.matrixWorld),x.direction.sub(i),x.direction.transformDirection(m),f++}else if(w.isSpotLight){const x=r.spot[h];x.position.setFromMatrixPosition(w.matrixWorld),x.position.applyMatrix4(m),x.direction.setFromMatrixPosition(w.matrixWorld),i.setFromMatrixPosition(w.target.matrixWorld),x.direction.sub(i),x.direction.transformDirection(m),h++}else if(w.isRectAreaLight){const x=r.rectArea[g];x.position.setFromMatrixPosition(w.matrixWorld),x.position.applyMatrix4(m),o.identity(),s.copy(w.matrixWorld),s.premultiply(m),o.extractRotation(s),x.halfWidth.set(w.width*.5,0,0),x.halfHeight.set(0,w.height*.5,0),x.halfWidth.applyMatrix4(o),x.halfHeight.applyMatrix4(o),g++}else if(w.isPointLight){const x=r.point[u];x.position.setFromMatrixPosition(w.matrixWorld),x.position.applyMatrix4(m),u++}else if(w.isHemisphereLight){const x=r.hemi[v];x.direction.setFromMatrixPosition(w.matrixWorld),x.direction.transformDirection(m),v++}}}return{setup:a,setupView:l,state:r}}function zP(t){const e=new Dae(t),n=[],r=[];function i(d){c.camera=d,n.length=0,r.length=0}function s(d){n.push(d)}function o(d){r.push(d)}function a(){e.setup(n)}function l(d){e.setupView(n,d)}const c={lightsArray:n,shadowsArray:r,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:c,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function kae(t){let e=new WeakMap;function n(i,s=0){const o=e.get(i);let a;return o===void 0?(a=new zP(t),e.set(i,[a])):s>=o.length?(a=new zP(t),o.push(a)):a=o[s],a}function r(){e=new WeakMap}return{get:n,dispose:r}}const Lae=`void main() {
8185	gl_Position = vec4( position, 1.0 );
8186}`,Fae=`uniform sampler2D shadow_pass;
8187uniform vec2 resolution;
8188uniform float radius;
8189void main() {
8190	const float samples = float( VSM_SAMPLES );
8191	float mean = 0.0;
8192	float squared_mean = 0.0;
8193	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
8194	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
8195	for ( float i = 0.0; i < samples; i ++ ) {
8196		float uvOffset = uvStart + i * uvStride;
8197		#ifdef HORIZONTAL_PASS
8198			vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;
8199			mean += distribution.x;
8200			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
8201		#else
8202			float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;
8203			mean += depth;
8204			squared_mean += depth * depth;
8205		#endif
8206	}
8207	mean = mean / samples;
8208	squared_mean = squared_mean / samples;
8209	float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
8210	gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
8211}`,Uae=[new oe(1,0,0),new oe(-1,0,0),new oe(0,1,0),new oe(0,-1,0),new oe(0,0,1),new oe(0,0,-1)],jae=[new oe(0,-1,0),new oe(0,-1,0),new oe(0,0,1),new oe(0,0,-1),new oe(0,-1,0),new oe(0,-1,0)],HP=new xn,$d=new oe,$0=new oe;function Bae(t,e,n){let r=new kS;const i=new _t,s=new _t,o=new An,a=new Yne,l=new Qne,c={},d=n.maxTextureSize,f={[Va]:Qr,[Qr]:Va,[no]:no}
vendor: 3,536 bytes, line 8211
8211,u=new Bs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new _t},radius:{value:4}},vertexShader:Lae,fragmentShader:Fae}),h=u.clone();h.defines.HORIZONTAL_PASS=1;const g=new Di;g.setAttribute("position",new Is(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new js(g,u),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=tg;let p=this.type;this.render=function(I,M,E){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||I.length===0)return;this.type===bte&&(ut("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=tg);const C=t.getRenderTarget(),T=t.getActiveCubeFace(),A=t.getActiveMipmapLevel(),R=t.state;R.setBlending(uo),R.buffers.depth.getReversed()===!0?R.buffers.color.setClear(0,0,0,0):R.buffers.color.setClear(1,1,1,1),R.buffers.depth.setTest(!0),R.setScissorTest(!1);const P=p!==this.type;P&&M.traverse(function(D){D.material&&(Array.isArray(D.material)?D.material.forEach(F=>F.needsUpdate=!0):D.material.needsUpdate=!0)});for(let D=0,F=I.length;D<F;D++){const V=I[D],H=V.shadow;if(H===void 0){ut("WebGLShadowMap:",V,"has no shadow.");continue}if(H.autoUpdate===!1&&H.needsUpdate===!1)continue;i.copy(H.mapSize);const $=H.getFrameExtents();i.multiply($),s.copy(H.mapSize),(i.x>d||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/$.x),i.x=s.x*$.x,H.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/$.y),i.y=s.y*$.y,H.mapSize.y=s.y));const B=t.state.buffers.depth.getReversed();if(H.camera._reversedDepth=B,H.map===null||P===!0){if(H.map!==null&&(H.map.depthTexture!==null&&(H.map.depthTexture.dispose(),H.map.depthTexture=null),H.map.dispose()),this.type===cf){if(V.isPointLight){ut("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}H.map=new Ps(i.x,i.y,{format:Vu,type:So,minFilter:yr,magFilter:yr,generateMipmaps:!1}),H.map.texture.name=V.name+".shadowMap",H.map.depthTexture=new Th(i.x,i.y,bs),H.map.depthTexture.name=V.name+".shadowMapDepth",H.map.depthTexture.format=To,H.map.depthTexture.compareFunction=null,H.map.depthTexture.minFilter=tr,H.map.depthTexture.magFilter=tr}else V.isPointLight?(H.map=new DU(i.x),H.map.depthTexture=new Hne(i.x,Fs)):(H.map=new Ps(i.x,i.y),H.map.depthTexture=new Th(i.x,i.y,Fs)),H.map.depthTexture.name=V.name+".shadowMap",H.map.depthTexture.format=To,this.type===tg?(H.map.depthTexture.compareFunction=B?IS:PS,H.map.depthTexture.minFilter=yr,H.map.depthTexture.magFilter=yr):(H.map.depthTexture.compareFunction=null,H.map.depthTexture.minFilter=tr,H.map.depthTexture.magFilter=tr);H.camera.updateProjectionMatrix()}const G=H.map.isWebGLCubeRenderTarget?6:1;for(let k=0;k<G;k++){if(H.map.isWebGLCubeRenderTarget)t.setRenderTarget(H.map,k),t.clear();else{k===0&&(t.setRenderTarget(H.map),t.clear());const z=H.getViewport(k);o.set(s.x*z.x,s.y*z.y,s.x*z.z,s.y*z.w),R.viewport(o)}if(V.isPointLight){const z=H.camera,q=H.matrix,ne=V.distance||z.far;ne!==z.far&&(z.far=ne,z.updateProjectionMatrix()),$d.setFromMatrixPosition(V.matrixWorld),z.position.copy($d),$0.copy(z.position),$0.add(Uae[k]),z.up.copy(jae[k]),z.lookAt($0),z.updateMatrixWorld(),q.makeTranslation(-$d.x,-$d.y,-$d.z),HP.multiplyMatrices(z.projectionMatrix,z.matrixWorldInverse),H._frustum.setFromProjectionMatrix(HP,z.coordinateSystem,z.reversedDepth)}else H.updateMatrices(V);r=H.getFrustum(),x(M,E,H.camera,V,this.type)}H.isPointLightShadow!==!0&&this.type===cf&&y(H,E),H.needsUpdate=!1}p=this.type,m.needsUpdate=!1,t.setRenderTarget(C,T,A)};function y(I,M){const E=e.update(v);
vendor: 102,601 bytes, lines 8211-8235
8211u.defines.VSM_SAMPLES!==I.blurSamples&&(u.defines.VSM_SAMPLES=I.blurSamples,h.defines.VSM_SAMPLES=I.blurSamples,u.needsUpdate=!0,h.needsUpdate=!0),I.mapPass===null&&(I.mapPass=new Ps(i.x,i.y,{format:Vu,type:So})),u.uniforms.shadow_pass.value=I.map.depthTexture,u.uniforms.resolution.value=I.mapSize,u.uniforms.radius.value=I.radius,t.setRenderTarget(I.mapPass),t.clear(),t.renderBufferDirect(M,null,E,u,v,null),h.uniforms.shadow_pass.value=I.mapPass.texture,h.uniforms.resolution.value=I.mapSize,h.uniforms.radius.value=I.radius,t.setRenderTarget(I.map),t.clear(),t.renderBufferDirect(M,null,E,h,v,null)}function w(I,M,E,C){let T=null;const A=E.isPointLight===!0?I.customDistanceMaterial:I.customDepthMaterial;if(A!==void 0)T=A;else if(T=E.isPointLight===!0?l:a,t.localClippingEnabled&&M.clipShadows===!0&&Array.isArray(M.clippingPlanes)&&M.clippingPlanes.length!==0||M.displacementMap&&M.displacementScale!==0||M.alphaMap&&M.alphaTest>0||M.map&&M.alphaTest>0||M.alphaToCoverage===!0){const R=T.uuid,P=M.uuid;let D=c[R];D===void 0&&(D={},c[R]=D);let F=D[P];F===void 0&&(F=T.clone(),D[P]=F,M.addEventListener("dispose",S)),T=F}if(T.visible=M.visible,T.wireframe=M.wireframe,C===cf?T.side=M.shadowSide!==null?M.shadowSide:M.side:T.side=M.shadowSide!==null?M.shadowSide:f[M.side],T.alphaMap=M.alphaMap,T.alphaTest=M.alphaToCoverage===!0?.5:M.alphaTest,T.map=M.map,T.clipShadows=M.clipShadows,T.clippingPlanes=M.clippingPlanes,T.clipIntersection=M.clipIntersection,T.displacementMap=M.displacementMap,T.displacementScale=M.displacementScale,T.displacementBias=M.displacementBias,T.wireframeLinewidth=M.wireframeLinewidth,T.linewidth=M.linewidth,E.isPointLight===!0&&T.isMeshDistanceMaterial===!0){const R=t.properties.get(T);R.light=E}return T}function x(I,M,E,C,T){if(I.visible===!1)return;if(I.layers.test(M.layers)&&(I.isMesh||I.isLine||I.isPoints)&&(I.castShadow||I.receiveShadow&&T===cf)&&(!I.frustumCulled||r.intersectsObject(I))){I.modelViewMatrix.multiplyMatrices(E.matrixWorldInverse,I.matrixWorld);const P=e.update(I),D=I.material;if(Array.isArray(D)){const F=P.groups;for(let V=0,H=F.length;V<H;V++){const $=F[V],B=D[$.materialIndex];if(B&&B.visible){const G=w(I,B,C,T);I.onBeforeShadow(t,I,M,E,P,G,$),t.renderBufferDirect(E,null,P,G,I,$),I.onAfterShadow(t,I,M,E,P,G,$)}}}else if(D.visible){const F=w(I,D,C,T);I.onBeforeShadow(t,I,M,E,P,F,null),t.renderBufferDirect(E,null,P,F,I,null),I.onAfterShadow(t,I,M,E,P,F,null)}}const R=I.children;for(let P=0,D=R.length;P<D;P++)x(R[P],M,E,C,T)}function S(I){I.target.removeEventListener("dispose",S);for(const E in c){const C=c[E],T=I.target.uuid;T in C&&(C[T].dispose(),delete C[T])}}}function Vae(t,e){function n(){let te=!1;const xe=new An;let Se=null;const ke=new An(0,0,0,0);return{setMask:function(Me){Se!==Me&&!te&&(t.colorMask(Me,Me,Me,Me),Se=Me)},setLocked:function(Me){te=Me},setClear:function(Me,ge,Qe,at,Kt){Kt===!0&&(Me*=at,ge*=at,Qe*=at),xe.set(Me,ge,Qe,at),ke.equals(xe)===!1&&(t.clearColor(Me,ge,Qe,at),ke.copy(xe))},reset:function(){te=!1,Se=null,ke.set(-1,0,0,0)}}}function r(){let te=!1,xe=!1,Se=null,ke=null,Me=null;return{setReversed:function(ge){if(xe!==ge){const Qe=e.get("EXT_clip_control");ge?Qe.clipControlEXT(Qe.LOWER_LEFT_EXT,Qe.ZERO_TO_ONE_EXT):Qe.clipControlEXT(Qe.LOWER_LEFT_EXT,Qe.NEGATIVE_ONE_TO_ONE_EXT),xe=ge;const at=Me;Me=null,this.setClear(at)}},getReversed:function(){return xe},setTest:function(ge){ge?Q(t.DEPTH_TEST):Z(t.DEPTH_TEST)},setMask:function(ge){Se!==ge&&!te&&(t.depthMask(ge),Se=ge)},setFunc:function(ge){if(xe&&(ge=ene[ge]),ke!==ge){switch(ge){case Kb:t.depthFunc(t.NEVER);break;case Xb:t.depthFunc(t.ALWAYS);break;case Yb:t.depthFunc(t.LESS);break;case ju:t.depthFunc(t.LEQUAL);break;case Qb:t.depthFunc(t.EQUAL);break;case Zb:t.depthFunc(t.GEQUAL);break;case Jb:t.depthFunc(t.GREATER);break;case e1:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}ke=ge}},setLocked:function(ge){te=ge},setClear:function(ge){Me!==ge&&(Me=ge,xe&&(ge=1-ge),t.clearDepth(ge))},reset:function(){te=!1,Se=null,ke=null,Me=null,xe=!1}}}function i(){let te=!1,xe=null,Se=null,ke=null,Me=null,ge=null,Qe=null,at=null,Kt=null;return{setTest:function(Dt){te||(Dt?Q(t.STENCIL_TEST):Z(t.STENCIL_TEST))},setMask:function(Dt){xe!==Dt&&!te&&(t.stencilMask(Dt),xe=Dt)},setFunc:function(Dt,mi,en){(Se!==Dt||ke!==mi||Me!==en)&&(t.stencilFunc(Dt,mi,en),Se=Dt,ke=mi,Me=en)},setOp:function(Dt,mi,en){(ge!==Dt||Qe!==mi||at!==en)&&(t.stencilOp(Dt,mi,en),ge=Dt,Qe=mi,at=en)},setLocked:function(Dt){te=Dt},setClear:function(Dt){Kt!==Dt&&(t.clearStencil(Dt),Kt=Dt)},reset:function(){te=!1,xe=null,Se=null,ke=null,Me=null,ge=null,Qe=null,at=null,Kt=null}}}const s=new n,o=new r,a=new i,l=new WeakMap,c=new WeakMap;let d={},f={},u=new WeakMap,h=[],g=null,v=!1,m=null,p=null,y=null,w=null,x=null,S=null,I=null,M=new Pt(0,0,0),E=0,C=!1,T=null,A=null,R=null,P=null,D=null;const F=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let V=!1,H=0;const $=t.getParameter(t.VERSION);$.indexOf("WebGL")!==-1?(H=parseFloat(/^WebGL (\d)/.exec($)[1]),V=H>=1):$.indexOf("OpenGL ES")!==-1&&(H=parseFloat(/^OpenGL ES (\d)/.exec($)[1]),V=H>=2);let B=null,G={};const k=t.getParameter(t.SCISSOR_BOX),z=t.getParameter(t.VIEWPORT),q=new An().fromArray(k),ne=new An().fromArray(z);function ee(te,xe,Se,ke){const Me=new Uint8Array(4),ge=t.createTexture();t.bindTexture(te,ge),t.texParameteri(te,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(te,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Qe=0;Qe<Se;Qe++)te===t.TEXTURE_3D||te===t.TEXTURE_2D_ARRAY?t.texImage3D(xe,0,t.RGBA,1,1,ke,0,t.RGBA,t.UNSIGNED_BYTE,Me):t.texImage2D(xe+Qe,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,Me);return ge}const j={};j[t.TEXTURE_2D]=ee(t.TEXTURE_2D,t.TEXTURE_2D,1),j[t.TEXTURE_CUBE_MAP]=ee(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),j[t.TEXTURE_2D_ARRAY]=ee(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),j[t.TEXTURE_3D]=ee(t.TEXTURE_3D,t.TEXTURE_3D,1,1),s.setClear(0,0,0,1),o.setClear(1),a.setClear(0),Q(t.DEPTH_TEST),o.setFunc(ju),Xe(!1),dt(VR),Q(t.CULL_FACE),je(uo);function Q(te){d[te]!==!0&&(t.enable(te),d[te]=!0)}function Z(te){d[te]!==!1&&(t.disable(te),d[te]=!1)}function re(te,xe){return f[te]!==xe?(t.bindFramebuffer(te,xe),f[te]=xe,te===t.DRAW_FRAMEBUFFER&&(f[t.FRAMEBUFFER]=xe),te===t.FRAMEBUFFER&&(f[t.DRAW_FRAMEBUFFER]=xe),!0):!1}function se(te,xe){let Se=h,ke=!1;if(te){Se=u.get(xe),Se===void 0&&(Se=[],u.set(xe,Se));const Me=te.textures;if(Se.length!==Me.length||Se[0]!==t.COLOR_ATTACHMENT0){for(let ge=0,Qe=Me.length;ge<Qe;ge++)Se[ge]=t.COLOR_ATTACHMENT0+ge;Se.length=Me.length,ke=!0}}else Se[0]!==t.BACK&&(Se[0]=t.BACK,ke=!0);ke&&t.drawBuffers(Se)}function ye(te){return g!==te?(t.useProgram(te),g=te,!0):!1}const Ue={[dl]:t.FUNC_ADD,[Ete]:t.FUNC_SUBTRACT,[Ste]:t.FUNC_REVERSE_SUBTRACT};Ue[Tte]=t.MIN,Ue[Ate]=t.MAX;const Ie={[Mte]:t.ZERO,[Cte]:t.ONE,[Rte]:t.SRC_COLOR,[Wb]:t.SRC_ALPHA,[kte]:t.SRC_ALPHA_SATURATE,[Ote]:t.DST_COLOR,[Ite]:t.DST_ALPHA,[Pte]:t.ONE_MINUS_SRC_COLOR,[qb]:t.ONE_MINUS_SRC_ALPHA,[Dte]:t.ONE_MINUS_DST_COLOR,[Nte]:t.ONE_MINUS_DST_ALPHA,[Lte]:t.CONSTANT_COLOR,[Fte]:t.ONE_MINUS_CONSTANT_COLOR,[Ute]:t.CONSTANT_ALPHA,[jte]:t.ONE_MINUS_CONSTANT_ALPHA};function je(te,xe,Se,ke,Me,ge,Qe,at,Kt,Dt){if(te===uo){v===!0&&(Z(t.BLEND),v=!1);return}if(v===!1&&(Q(t.BLEND),v=!0),te!==wte){if(te!==m||Dt!==C){if((p!==dl||x!==dl)&&(t.blendEquation(t.FUNC_ADD),p=dl,x=dl),Dt)switch(te){case ou:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case zR:t.blendFunc(t.ONE,t.ONE);break;case HR:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case GR:t.blendFuncSeparate(t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ZERO,t.ONE);break;default:zt("WebGLState: Invalid blending: ",te);break}else switch(te){case ou:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case zR:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE,t.ONE,t.ONE);break;case HR:zt("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case GR:zt("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:zt("WebGLState: Invalid blending: ",te);break}y=null,w=null,S=null,I=null,M.set(0,0,0),E=0,m=te,C=Dt}return}Me=Me||xe,ge=ge||Se,Qe=Qe||ke,(xe!==p||Me!==x)&&(t.blendEquationSeparate(Ue[xe],Ue[Me]),p=xe,x=Me),(Se!==y||ke!==w||ge!==S||Qe!==I)&&(t.blendFuncSeparate(Ie[Se],Ie[ke],Ie[ge],Ie[Qe]),y=Se,w=ke,S=ge,I=Qe),(at.equals(M)===!1||Kt!==E)&&(t.blendColor(at.r,at.g,at.b,Kt),M.copy(at),E=Kt),m=te,C=!1}function Ke(te,xe){te.side===no?Z(t.CULL_FACE):Q(t.CULL_FACE);let Se=te.side===Qr;xe&&(Se=!Se),Xe(Se),te.blending===ou&&te.transparent===!1?je(uo):je(te.blending,te.blendEquation,te.blendSrc,te.blendDst,te.blendEquationAlpha,te.blendSrcAlpha,te.blendDstAlpha,te.blendColor,te.blendAlpha,te.premultipliedAlpha),o.setFunc(te.depthFunc),o.setTest(te.depthTest),o.setMask(te.depthWrite),s.setMask(te.colorWrite);const ke=te.stencilWrite;a.setTest(ke),ke&&(a.setMask(te.stencilWriteMask),a.setFunc(te.stencilFunc,te.stencilRef,te.stencilFuncMask),a.setOp(te.stencilFail,te.stencilZFail,te.stencilZPass)),de(te.polygonOffset,te.polygonOffsetFactor,te.polygonOffsetUnits),te.alphaToCoverage===!0?Q(t.SAMPLE_ALPHA_TO_COVERAGE):Z(t.SAMPLE_ALPHA_TO_COVERAGE)}function Xe(te){T!==te&&(te?t.frontFace(t.CW):t.frontFace(t.CCW),T=te)}function dt(te){te!==_te?(Q(t.CULL_FACE),te!==A&&(te===VR?t.cullFace(t.BACK):te===xte?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):Z(t.CULL_FACE),A=te}function K(te){te!==R&&(V&&t.lineWidth(te),R=te)}function de(te,xe,Se){te?(Q(t.POLYGON_OFFSET_FILL),(P!==xe||D!==Se)&&(P=xe,D=Se,o.getReversed()&&(xe=-xe),t.polygonOffset(xe,Se))):Z(t.POLYGON_OFFSET_FILL)}function _e(te){te?Q(t.SCISSOR_TEST):Z(t.SCISSOR_TEST)}function Ae(te){te===void 0&&(te=t.TEXTURE0+F-1),B!==te&&(t.activeTexture(te),B=te)}function ce(te,xe,Se){Se===void 0&&(B===null?Se=t.TEXTURE0+F-1:Se=B);let ke=G[Se];ke===void 0&&(ke={type:void 0,texture:void 0},G[Se]=ke),(ke.type!==te||ke.texture!==xe)&&(B!==Se&&(t.activeTexture(Se),B=Se),t.bindTexture(te,xe||j[te]),ke.type=te,ke.texture=xe)}function X(){const te=G[B];te!==void 0&&te.type!==void 0&&(t.bindTexture(te.type,null),te.type=void 0,te.texture=void 0)}function U(){try{t.compressedTexImage2D(...arguments)}catch(te){zt("WebGLState:",te)}}function J(){try{t.compressedTexImage3D(...arguments)}catch(te){zt("WebGLState:",te)}}function he(){try{t.texSubImage2D(...arguments)}catch(te){zt("WebGLState:",te)}}function me(){try{t.texSubImage3D(...arguments)}catch(te){zt("WebGLState:",te)}}function fe(){try{t.compressedTexSubImage2D(...arguments)}catch(te){zt("WebGLState:",te)}}function Ve(){try{t.compressedTexSubImage3D(...arguments)}catch(te){zt("WebGLState:",te)}}function Ee(){try{t.texStorage2D(...arguments)}catch(te){zt("WebGLState:",te)}}function qe(){try{t.texStorage3D(...arguments)}catch(te){zt("WebGLState:",te)}}function st(){try{t.texImage2D(...arguments)}catch(te){zt("WebGLState:",te)}}function Ce(){try{t.texImage3D(...arguments)}catch(te){zt("WebGLState:",te)}}function Pe(te){q.equals(te)===!1&&(t.scissor(te.x,te.y,te.z,te.w),q.copy(te))}function Ge(te){ne.equals(te)===!1&&(t.viewport(te.x,te.y,te.z,te.w),ne.copy(te))}function He(te,xe){let Se=c.get(xe);Se===void 0&&(Se=new WeakMap,c.set(xe,Se));let ke=Se.get(te);ke===void 0&&(ke=t.getUniformBlockIndex(xe,te.name),Se.set(te,ke))}function ze(te,xe){const ke=c.get(xe).get(te);l.get(xe)!==ke&&(t.uniformBlockBinding(xe,ke,te.__bindingPointIndex),l.set(xe,ke))}function Ne(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),o.setReversed(!1),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),d={},B=null,G={},f={},u=new WeakMap,h=[],g=null,v=!1,m=null,p=null,y=null,w=null,x=null,S=null,I=null,M=new Pt(0,0,0),E=0,C=!1,T=null,A=null,R=null,P=null,D=null,q.set(0,0,t.canvas.width,t.canvas.height),ne.set(0,0,t.canvas.width,t.canvas.height),s.reset(),o.reset(),a.reset()}return{buffers:{color:s,depth:o,stencil:a},enable:Q,disable:Z,bindFramebuffer:re,drawBuffers:se,useProgram:ye,setBlending:je,setMaterial:Ke,setFlipSided:Xe,setCullFace:dt,setLineWidth:K,setPolygonOffset:de,setScissorTest:_e,activeTexture:Ae,bindTexture:ce,unbindTexture:X,compressedTexImage2D:U,compressedTexImage3D:J,texImage2D:st,texImage3D:Ce,updateUBOMapping:He,uniformBlockBinding:ze,texStorage2D:Ee,texStorage3D:qe,texSubImage2D:he,texSubImage3D:me,compressedTexSubImage2D:fe,compressedTexSubImage3D:Ve,scissor:Pe,viewport:Ge,reset:Ne}}function zae(t,e,n,r,i,s,o){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new _t,d=new WeakMap;let f;const u=new WeakMap;let h=!1;try{h=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(X,U){return h?new OffscreenCanvas(X,U):vv("canvas")}function v(X,U,J){let he=1;const me=ce(X);if((me.width>J||me.height>J)&&(he=J/Math.max(me.width,me.height)),he<1)if(typeof HTMLImageElement<"u"&&X instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&X instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&X instanceof ImageBitmap||typeof VideoFrame<"u"&&X instanceof VideoFrame){const fe=Math.floor(he*me.width),Ve=Math.floor(he*me.height);f===void 0&&(f=g(fe,Ve));const Ee=U?g(fe,Ve):f;return Ee.width=fe,Ee.height=Ve,Ee.getContext("2d").drawImage(X,0,0,fe,Ve),ut("WebGLRenderer: Texture has been resized from ("+me.width+"x"+me.height+") to ("+fe+"x"+Ve+")."),Ee}else return"data"in X&&ut("WebGLRenderer: Image in DataTexture is too big ("+me.width+"x"+me.height+")."),X;return X}function m(X){return X.generateMipmaps}function p(X){t.generateMipmap(X)}function y(X){return X.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:X.isWebGL3DRenderTarget?t.TEXTURE_3D:X.isWebGLArrayRenderTarget||X.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function w(X,U,J,he,me=!1){if(X!==null){if(t[X]!==void 0)return t[X];ut("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+X+"'")}let fe=U;if(U===t.RED&&(J===t.FLOAT&&(fe=t.R32F),J===t.HALF_FLOAT&&(fe=t.R16F),J===t.UNSIGNED_BYTE&&(fe=t.R8)),U===t.RED_INTEGER&&(J===t.UNSIGNED_BYTE&&(fe=t.R8UI),J===t.UNSIGNED_SHORT&&(fe=t.R16UI),J===t.UNSIGNED_INT&&(fe=t.R32UI),J===t.BYTE&&(fe=t.R8I),J===t.SHORT&&(fe=t.R16I),J===t.INT&&(fe=t.R32I)),U===t.RG&&(J===t.FLOAT&&(fe=t.RG32F),J===t.HALF_FLOAT&&(fe=t.RG16F),J===t.UNSIGNED_BYTE&&(fe=t.RG8)),U===t.RG_INTEGER&&(J===t.UNSIGNED_BYTE&&(fe=t.RG8UI),J===t.UNSIGNED_SHORT&&(fe=t.RG16UI),J===t.UNSIGNED_INT&&(fe=t.RG32UI),J===t.BYTE&&(fe=t.RG8I),J===t.SHORT&&(fe=t.RG16I),J===t.INT&&(fe=t.RG32I)),U===t.RGB_INTEGER&&(J===t.UNSIGNED_BYTE&&(fe=t.RGB8UI),J===t.UNSIGNED_SHORT&&(fe=t.RGB16UI),J===t.UNSIGNED_INT&&(fe=t.RGB32UI),J===t.BYTE&&(fe=t.RGB8I),J===t.SHORT&&(fe=t.RGB16I),J===t.INT&&(fe=t.RGB32I)),U===t.RGBA_INTEGER&&(J===t.UNSIGNED_BYTE&&(fe=t.RGBA8UI),J===t.UNSIGNED_SHORT&&(fe=t.RGBA16UI),J===t.UNSIGNED_INT&&(fe=t.RGBA32UI),J===t.BYTE&&(fe=t.RGBA8I),J===t.SHORT&&(fe=t.RGBA16I),J===t.INT&&(fe=t.RGBA32I)),U===t.RGB&&(J===t.UNSIGNED_INT_5_9_9_9_REV&&(fe=t.RGB9_E5),J===t.UNSIGNED_INT_10F_11F_11F_REV&&(fe=t.R11F_G11F_B10F)),U===t.RGBA){const Ve=me?gv:Ft.getTransfer(he);J===t.FLOAT&&(fe=t.RGBA32F),J===t.HALF_FLOAT&&(fe=t.RGBA16F),J===t.UNSIGNED_BYTE&&(fe=Ve===Xt?t.SRGB8_ALPHA8:t.RGBA8),J===t.UNSIGNED_SHORT_4_4_4_4&&(fe=t.RGBA4),J===t.UNSIGNED_SHORT_5_5_5_1&&(fe=t.RGB5_A1)}return(fe===t.R16F||fe===t.R32F||fe===t.RG16F||fe===t.RG32F||fe===t.RGBA16F||fe===t.RGBA32F)&&e.get("EXT_color_buffer_float"),fe}function x(X,U){let J;return X?U===null||U===Fs||U===wh?J=t.DEPTH24_STENCIL8:U===bs?J=t.DEPTH32F_STENCIL8:U===bh&&(J=t.DEPTH24_STENCIL8,ut("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):U===null||U===Fs||U===wh?J=t.DEPTH_COMPONENT24:U===bs?J=t.DEPTH_COMPONENT32F:U===bh&&(J=t.DEPTH_COMPONENT16),J}function S(X,U){return m(X)===!0||X.isFramebufferTexture&&X.minFilter!==tr&&X.minFilter!==yr?Math.log2(Math.max(U.width,U.height))+1:X.mipmaps!==void 0&&X.mipmaps.length>0?X.mipmaps.length:X.isCompressedTexture&&Array.isArray(X.image)?U.mipmaps.length:1}function I(X){const U=X.target;U.removeEventListener("dispose",I),E(U),U.isVideoTexture&&d.delete(U)}function M(X){const U=X.target;U.removeEventListener("dispose",M),T(U)}function E(X){const U=r.get(X);if(U.__webglInit===void 0)return;const J=X.source,he=u.get(J);if(he){const me=he[U.__cacheKey];me.usedTimes--,me.usedTimes===0&&C(X),Object.keys(he).length===0&&u.delete(J)}r.remove(X)}function C(X){const U=r.get(X);t.deleteTexture(U.__webglTexture);const J=X.source,he=u.get(J);delete he[U.__cacheKey],o.memory.textures--}function T(X){const U=r.get(X);if(X.depthTexture&&(X.depthTexture.dispose(),r.remove(X.depthTexture)),X.isWebGLCubeRenderTarget)for(let he=0;he<6;he++){if(Array.isArray(U.__webglFramebuffer[he]))for(let me=0;me<U.__webglFramebuffer[he].length;me++)t.deleteFramebuffer(U.__webglFramebuffer[he][me]);else t.deleteFramebuffer(U.__webglFramebuffer[he]);U.__webglDepthbuffer&&t.deleteRenderbuffer(U.__webglDepthbuffer[he])}else{if(Array.isArray(U.__webglFramebuffer))for(let he=0;he<U.__webglFramebuffer.length;he++)t.deleteFramebuffer(U.__webglFramebuffer[he]);else t.deleteFramebuffer(U.__webglFramebuffer);if(U.__webglDepthbuffer&&t.deleteRenderbuffer(U.__webglDepthbuffer),U.__webglMultisampledFramebuffer&&t.deleteFramebuffer(U.__webglMultisampledFramebuffer),U.__webglColorRenderbuffer)for(let he=0;he<U.__webglColorRenderbuffer.length;he++)U.__webglColorRenderbuffer[he]&&t.deleteRenderbuffer(U.__webglColorRenderbuffer[he]);U.__webglDepthRenderbuffer&&t.deleteRenderbuffer(U.__webglDepthRenderbuffer)}const J=X.textures;for(let he=0,me=J.length;he<me;he++){const fe=r.get(J[he]);fe.__webglTexture&&(t.deleteTexture(fe.__webglTexture),o.memory.textures--),r.remove(J[he])}r.remove(X)}let A=0;function R(){A=0}function P(){const X=A;return X>=i.maxTextures&&ut("WebGLTextures: Trying to use "+X+" texture units while this GPU supports only "+i.maxTextures),A+=1,X}function D(X){const U=[];return U.push(X.wrapS),U.push(X.wrapT),U.push(X.wrapR||0),U.push(X.magFilter),U.push(X.minFilter),U.push(X.anisotropy),U.push(X.internalFormat),U.push(X.format),U.push(X.type),U.push(X.generateMipmaps),U.push(X.premultiplyAlpha),U.push(X.flipY),U.push(X.unpackAlignment),U.push(X.colorSpace),U.join()}function F(X,U){const J=r.get(X);if(X.isVideoTexture&&_e(X),X.isRenderTargetTexture===!1&&X.isExternalTexture!==!0&&X.version>0&&J.__version!==X.version){const he=X.image;if(he===null)ut("WebGLRenderer: Texture marked for update but no image data found.");else if(he.complete===!1)ut("WebGLRenderer: Texture marked for update but image is incomplete");else{j(J,X,U);return}}else X.isExternalTexture&&(J.__webglTexture=X.sourceTexture?X.sourceTexture:null);n.bindTexture(t.TEXTURE_2D,J.__webglTexture,t.TEXTURE0+U)}function V(X,U){const J=r.get(X);if(X.isRenderTargetTexture===!1&&X.version>0&&J.__version!==X.version){j(J,X,U);return}else X.isExternalTexture&&(J.__webglTexture=X.sourceTexture?X.sourceTexture:null);n.bindTexture(t.TEXTURE_2D_ARRAY,J.__webglTexture,t.TEXTURE0+U)}function H(X,U){const J=r.get(X);if(X.isRenderTargetTexture===!1&&X.version>0&&J.__version!==X.version){j(J,X,U);return}n.bindTexture(t.TEXTURE_3D,J.__webglTexture,t.TEXTURE0+U)}function $(X,U){const J=r.get(X);if(X.isCubeDepthTexture!==!0&&X.version>0&&J.__version!==X.version){Q(J,X,U);return}n.bindTexture(t.TEXTURE_CUBE_MAP,J.__webglTexture,t.TEXTURE0+U)}const B={[t1]:t.REPEAT,[ao]:t.CLAMP_TO_EDGE,[n1]:t.MIRRORED_REPEAT},G={[tr]:t.NEAREST,[zte]:t.NEAREST_MIPMAP_NEAREST,[em]:t.NEAREST_MIPMAP_LINEAR,[yr]:t.LINEAR,[m0]:t.LINEAR_MIPMAP_NEAREST,[yl]:t.LINEAR_MIPMAP_LINEAR},k={[$te]:t.NEVER,[Yte]:t.ALWAYS,[Wte]:t.LESS,[PS]:t.LEQUAL,[qte]:t.EQUAL,[IS]:t.GEQUAL,[Kte]:t.GREATER,[Xte]:t.NOTEQUAL};function z(X,U){if(U.type===bs&&e.has("OES_texture_float_linear")===!1&&(U.magFilter===yr||U.magFilter===m0||U.magFilter===em||U.magFilter===yl||U.minFilter===yr||U.minFilter===m0||U.minFilter===em||U.minFilter===yl)&&ut("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(X,t.TEXTURE_WRAP_S,B[U.wrapS]),t.texParameteri(X,t.TEXTURE_WRAP_T,B[U.wrapT]),(X===t.TEXTURE_3D||X===t.TEXTURE_2D_ARRAY)&&t.texParameteri(X,t.TEXTURE_WRAP_R,B[U.wrapR]),t.texParameteri(X,t.TEXTURE_MAG_FILTER,G[U.magFilter]),t.texParameteri(X,t.TEXTURE_MIN_FILTER,G[U.minFilter]),U.compareFunction&&(t.texParameteri(X,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(X,t.TEXTURE_COMPARE_FUNC,k[U.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(U.magFilter===tr||U.minFilter!==em&&U.minFilter!==yl||U.type===bs&&e.has("OES_texture_float_linear")===!1)return;if(U.anisotropy>1||r.get(U).__currentAnisotropy){const J=e.get("EXT_texture_filter_anisotropic");t.texParameterf(X,J.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(U.anisotropy,i.getMaxAnisotropy())),r.get(U).__currentAnisotropy=U.anisotropy}}}function q(X,U){let J=!1;X.__webglInit===void 0&&(X.__webglInit=!0,U.addEventListener("dispose",I));const he=U.source;let me=u.get(he);me===void 0&&(me={},u.set(he,me));const fe=D(U);if(fe!==X.__cacheKey){me[fe]===void 0&&(me[fe]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,J=!0),me[fe].usedTimes++;const Ve=me[X.__cacheKey];Ve!==void 0&&(me[X.__cacheKey].usedTimes--,Ve.usedTimes===0&&C(U)),X.__cacheKey=fe,X.__webglTexture=me[fe].texture}return J}function ne(X,U,J){return Math.floor(Math.floor(X/J)/U)}function ee(X,U,J,he){const fe=X.updateRanges;if(fe.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,U.width,U.height,J,he,U.data);else{fe.sort((Ce,Pe)=>Ce.start-Pe.start);let Ve=0;for(let Ce=1;Ce<fe.length;Ce++){const Pe=fe[Ve],Ge=fe[Ce],He=Pe.start+Pe.count,ze=ne(Ge.start,U.width,4),Ne=ne(Pe.start,U.width,4);Ge.start<=He+1&&ze===Ne&&ne(Ge.start+Ge.count-1,U.width,4)===ze?Pe.count=Math.max(Pe.count,Ge.start+Ge.count-Pe.start):(++Ve,fe[Ve]=Ge)}fe.length=Ve+1;const Ee=t.getParameter(t.UNPACK_ROW_LENGTH),qe=t.getParameter(t.UNPACK_SKIP_PIXELS),st=t.getParameter(t.UNPACK_SKIP_ROWS);t.pixelStorei(t.UNPACK_ROW_LENGTH,U.width);for(let Ce=0,Pe=fe.length;Ce<Pe;Ce++){const Ge=fe[Ce],He=Math.floor(Ge.start/4),ze=Math.ceil(Ge.count/4),Ne=He%U.width,te=Math.floor(He/U.width),xe=ze,Se=1;t.pixelStorei(t.UNPACK_SKIP_PIXELS,Ne),t.pixelStorei(t.UNPACK_SKIP_ROWS,te),n.texSubImage2D(t.TEXTURE_2D,0,Ne,te,xe,Se,J,he,U.data)}X.clearUpdateRanges(),t.pixelStorei(t.UNPACK_ROW_LENGTH,Ee),t.pixelStorei(t.UNPACK_SKIP_PIXELS,qe),t.pixelStorei(t.UNPACK_SKIP_ROWS,st)}}function j(X,U,J){let he=t.TEXTURE_2D;(U.isDataArrayTexture||U.isCompressedArrayTexture)&&(he=t.TEXTURE_2D_ARRAY),U.isData3DTexture&&(he=t.TEXTURE_3D);const me=q(X,U),fe=U.source;n.bindTexture(he,X.__webglTexture,t.TEXTURE0+J);const Ve=r.get(fe);if(fe.version!==Ve.__version||me===!0){n.activeTexture(t.TEXTURE0+J);const Ee=Ft.getPrimaries(Ft.workingColorSpace),qe=U.colorSpace===na?null:Ft.getPrimaries(U.colorSpace),st=U.colorSpace===na||Ee===qe?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,U.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,U.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,st);let Ce=v(U.image,!1,i.maxTextureSize);Ce=Ae(U,Ce);const Pe=s.convert(U.format,U.colorSpace),Ge=s.convert(U.type);let He=w(U.internalFormat,Pe,Ge,U.colorSpace,U.isVideoTexture);z(he,U);let ze;const Ne=U.mipmaps,te=U.isVideoTexture!==!0,xe=Ve.__version===void 0||me===!0,Se=fe.dataReady,ke=S(U,Ce);if(U.isDepthTexture)He=x(U.format===_l,U.type),xe&&(te?n.texStorage2D(t.TEXTURE_2D,1,He,Ce.width,Ce.height):n.texImage2D(t.TEXTURE_2D,0,He,Ce.width,Ce.height,0,Pe,Ge,null));else if(U.isDataTexture)if(Ne.length>0){te&&xe&&n.texStorage2D(t.TEXTURE_2D,ke,He,Ne[0].width,Ne[0].height);for(let Me=0,ge=Ne.length;Me<ge;Me++)ze=Ne[Me],te?Se&&n.texSubImage2D(t.TEXTURE_2D,Me,0,0,ze.width,ze.height,Pe,Ge,ze.data):n.texImage2D(t.TEXTURE_2D,Me,He,ze.width,ze.height,0,Pe,Ge,ze.data);U.generateMipmaps=!1}else te?(xe&&n.texStorage2D(t.TEXTURE_2D,ke,He,Ce.width,Ce.height),Se&&ee(U,Ce,Pe,Ge)):n.texImage2D(t.TEXTURE_2D,0,He,Ce.width,Ce.height,0,Pe,Ge,Ce.data);else if(U.isCompressedTexture)if(U.isCompressedArrayTexture){te&&xe&&n.texStorage3D(t.TEXTURE_2D_ARRAY,ke,He,Ne[0].width,Ne[0].height,Ce.depth);for(let Me=0,ge=Ne.length;Me<ge;Me++)if(ze=Ne[Me],U.format!==Yi)if(Pe!==null)if(te){if(Se)if(U.layerUpdates.size>0){const Qe=xP(ze.width,ze.height,U.format,U.type);for(const at of U.layerUpdates){const Kt=ze.data.subarray(at*Qe/ze.data.BYTES_PER_ELEMENT,(at+1)*Qe/ze.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Me,0,0,at,ze.width,ze.height,1,Pe,Kt)}U.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Me,0,0,0,ze.width,ze.height,Ce.depth,Pe,ze.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,Me,He,ze.width,ze.height,Ce.depth,0,ze.data,0,0);else ut("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else te?Se&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,Me,0,0,0,ze.width,ze.height,Ce.depth,Pe,Ge,ze.data):n.texImage3D(t.TEXTURE_2D_ARRAY,Me,He,ze.width,ze.height,Ce.depth,0,Pe,Ge,ze.data)}else{te&&xe&&n.texStorage2D(t.TEXTURE_2D,ke,He,Ne[0].width,Ne[0].height);for(let Me=0,ge=Ne.length;Me<ge;Me++)ze=Ne[Me],U.format!==Yi?Pe!==null?te?Se&&n.compressedTexSubImage2D(t.TEXTURE_2D,Me,0,0,ze.width,ze.height,Pe,ze.data):n.compressedTexImage2D(t.TEXTURE_2D,Me,He,ze.width,ze.height,0,ze.data):ut("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):te?Se&&n.texSubImage2D(t.TEXTURE_2D,Me,0,0,ze.width,ze.height,Pe,Ge,ze.data):n.texImage2D(t.TEXTURE_2D,Me,He,ze.width,ze.height,0,Pe,Ge,ze.data)}else if(U.isDataArrayTexture)if(te){if(xe&&n.texStorage3D(t.TEXTURE_2D_ARRAY,ke,He,Ce.width,Ce.height,Ce.depth),Se)if(U.layerUpdates.size>0){const Me=xP(Ce.width,Ce.height,U.format,U.type);for(const ge of U.layerUpdates){const Qe=Ce.data.subarray(ge*Me/Ce.data.BYTES_PER_ELEMENT,(ge+1)*Me/Ce.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,ge,Ce.width,Ce.height,1,Pe,Ge,Qe)}U.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Ce.width,Ce.height,Ce.depth,Pe,Ge,Ce.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,He,Ce.width,Ce.height,Ce.depth,0,Pe,Ge,Ce.data);else if(U.isData3DTexture)te?(xe&&n.texStorage3D(t.TEXTURE_3D,ke,He,Ce.width,Ce.height,Ce.depth),Se&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Ce.width,Ce.height,Ce.depth,Pe,Ge,Ce.data)):n.texImage3D(t.TEXTURE_3D,0,He,Ce.width,Ce.height,Ce.depth,0,Pe,Ge,Ce.data);else if(U.isFramebufferTexture){if(xe)if(te)n.texStorage2D(t.TEXTURE_2D,ke,He,Ce.width,Ce.height);else{let Me=Ce.width,ge=Ce.height;for(let Qe=0;Qe<ke;Qe++)n.texImage2D(t.TEXTURE_2D,Qe,He,Me,ge,0,Pe,Ge,null),Me>>=1,ge>>=1}}else if(Ne.length>0){if(te&&xe){const Me=ce(Ne[0]);n.texStorage2D(t.TEXTURE_2D,ke,He,Me.width,Me.height)}for(let Me=0,ge=Ne.length;Me<ge;Me++)ze=Ne[Me],te?Se&&n.texSubImage2D(t.TEXTURE_2D,Me,0,0,Pe,Ge,ze):n.texImage2D(t.TEXTURE_2D,Me,He,Pe,Ge,ze);U.generateMipmaps=!1}else if(te){if(xe){const Me=ce(Ce);n.texStorage2D(t.TEXTURE_2D,ke,He,Me.width,Me.height)}Se&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,Pe,Ge,Ce)}else n.texImage2D(t.TEXTURE_2D,0,He,Pe,Ge,Ce);m(U)&&p(he),Ve.__version=fe.version,U.onUpdate&&U.onUpdate(U)}X.__version=U.version}function Q(X,U,J){if(U.image.length!==6)return;const he=q(X,U),me=U.source;n.bindTexture(t.TEXTURE_CUBE_MAP,X.__webglTexture,t.TEXTURE0+J);const fe=r.get(me);if(me.version!==fe.__version||he===!0){n.activeTexture(t.TEXTURE0+J);const Ve=Ft.getPrimaries(Ft.workingColorSpace),Ee=U.colorSpace===na?null:Ft.getPrimaries(U.colorSpace),qe=U.colorSpace===na||Ve===Ee?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,U.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,U.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,qe);const st=U.isCompressedTexture||U.image[0].isCompressedTexture,Ce=U.image[0]&&U.image[0].isDataTexture,Pe=[];for(let ge=0;ge<6;ge++)!st&&!Ce?Pe[ge]=v(U.image[ge],!0,i.maxCubemapSize):Pe[ge]=Ce?U.image[ge].image:U.image[ge],Pe[ge]=Ae(U,Pe[ge]);const Ge=Pe[0],He=s.convert(U.format,U.colorSpace),ze=s.convert(U.type),Ne=w(U.internalFormat,He,ze,U.colorSpace),te=U.isVideoTexture!==!0,xe=fe.__version===void 0||he===!0,Se=me.dataReady;let ke=S(U,Ge);z(t.TEXTURE_CUBE_MAP,U);let Me;if(st){te&&xe&&n.texStorage2D(t.TEXTURE_CUBE_MAP,ke,Ne,Ge.width,Ge.height);for(let ge=0;ge<6;ge++){Me=Pe[ge].mipmaps;for(let Qe=0;Qe<Me.length;Qe++){const at=Me[Qe];U.format!==Yi?He!==null?te?Se&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ge,Qe,0,0,at.width,at.height,He,at.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ge,Qe,Ne,at.width,at.height,0,at.data):ut("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):te?Se&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ge,Qe,0,0,at.width,at.height,He,ze,at.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ge,Qe,Ne,at.width,at.height,0,He,ze,at.data)}}}else{if(Me=U.mipmaps,te&&xe){Me.length>0&&ke++;const ge=ce(Pe[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,ke,Ne,ge.width,ge.height)}for(let ge=0;ge<6;ge++)if(Ce){te?Se&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,0,0,Pe[ge].width,Pe[ge].height,He,ze,Pe[ge].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,Ne,Pe[ge].width,Pe[ge].height,0,He,ze,Pe[ge].data);for(let Qe=0;Qe<Me.length;Qe++){const Kt=Me[Qe].image[ge].image;te?Se&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ge,Qe+1,0,0,Kt.width,Kt.height,He,ze,Kt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ge,Qe+1,Ne,Kt.width,Kt.height,0,He,ze,Kt.data)}}else{te?Se&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,0,0,He,ze,Pe[ge]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,Ne,He,ze,Pe[ge]);for(let Qe=0;Qe<Me.length;Qe++){const at=Me[Qe];te?Se&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ge,Qe+1,0,0,He,ze,at.image[ge]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ge,Qe+1,Ne,He,ze,at.image[ge])}}}m(U)&&p(t.TEXTURE_CUBE_MAP),fe.__version=me.version,U.onUpdate&&U.onUpdate(U)}X.__version=U.version}function Z(X,U,J,he,me,fe){const Ve=s.convert(J.format,J.colorSpace),Ee=s.convert(J.type),qe=w(J.internalFormat,Ve,Ee,J.colorSpace),st=r.get(U),Ce=r.get(J);if(Ce.__renderTarget=U,!st.__hasExternalTextures){const Pe=Math.max(1,U.width>>fe),Ge=Math.max(1,U.height>>fe);me===t.TEXTURE_3D||me===t.TEXTURE_2D_ARRAY?n.texImage3D(me,fe,qe,Pe,Ge,U.depth,0,Ve,Ee,null):n.texImage2D(me,fe,qe,Pe,Ge,0,Ve,Ee,null)}n.bindFramebuffer(t.FRAMEBUFFER,X),de(U)?a.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,he,me,Ce.__webglTexture,0,K(U)):(me===t.TEXTURE_2D||me>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,he,me,Ce.__webglTexture,fe),n.bindFramebuffer(t.FRAMEBUFFER,null)}function re(X,U,J){if(t.bindRenderbuffer(t.RENDERBUFFER,X),U.depthBuffer){const he=U.depthTexture,me=he&&he.isDepthTexture?he.type:null,fe=x(U.stencilBuffer,me),Ve=U.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;de(U)?a.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,K(U),fe,U.width,U.height):J?t.renderbufferStorageMultisample(t.RENDERBUFFER,K(U),fe,U.width,U.height):t.renderbufferStorage(t.RENDERBUFFER,fe,U.width,U.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,Ve,t.RENDERBUFFER,X)}else{const he=U.textures;for(let me=0;me<he.length;me++){const fe=he[me],Ve=s.convert(fe.format,fe.colorSpace),Ee=s.convert(fe.type),qe=w(fe.internalFormat,Ve,Ee,fe.colorSpace);de(U)?a.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,K(U),qe,U.width,U.height):J?t.renderbufferStorageMultisample(t.RENDERBUFFER,K(U),qe,U.width,U.height):t.renderbufferStorage(t.RENDERBUFFER,qe,U.width,U.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function se(X,U,J){const he=U.isWebGLCubeRenderTarget===!0;if(n.bindFramebuffer(t.FRAMEBUFFER,X),!(U.depthTexture&&U.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const me=r.get(U.depthTexture);if(me.__renderTarget=U,(!me.__webglTexture||U.depthTexture.image.width!==U.width||U.depthTexture.image.height!==U.height)&&(U.depthTexture.image.width=U.width,U.depthTexture.image.height=U.height,U.depthTexture.needsUpdate=!0),he){if(me.__webglInit===void 0&&(me.__webglInit=!0,U.depthTexture.addEventListener("dispose",I)),me.__webglTexture===void 0){me.__webglTexture=t.createTexture(),n.bindTexture(t.TEXTURE_CUBE_MAP,me.__webglTexture),z(t.TEXTURE_CUBE_MAP,U.depthTexture);const st=s.convert(U.depthTexture.format),Ce=s.convert(U.depthTexture.type);let Pe;U.depthTexture.format===To?Pe=t.DEPTH_COMPONENT24:U.depthTexture.format===_l&&(Pe=t.DEPTH24_STENCIL8);for(let Ge=0;Ge<6;Ge++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Ge,0,Pe,U.width,U.height,0,st,Ce,null)}}else F(U.depthTexture,0);const fe=me.__webglTexture,Ve=K(U),Ee=he?t.TEXTURE_CUBE_MAP_POSITIVE_X+J:t.TEXTURE_2D,qe=U.depthTexture.format===_l?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;if(U.depthTexture.format===To)de(U)?a.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,qe,Ee,fe,0,Ve):t.framebufferTexture2D(t.FRAMEBUFFER,qe,Ee,fe,0);else if(U.depthTexture.format===_l)de(U)?a.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,qe,Ee,fe,0,Ve):t.framebufferTexture2D(t.FRAMEBUFFER,qe,Ee,fe,0);else throw new Error("Unknown depthTexture format")}function ye(X){const U=r.get(X),J=X.isWebGLCubeRenderTarget===!0;if(U.__boundDepthTexture!==X.depthTexture){const he=X.depthTexture;if(U.__depthDisposeCallback&&U.__depthDisposeCallback(),he){const me=()=>{delete U.__boundDepthTexture,delete U.__depthDisposeCallback,he.removeEventListener("dispose",me)};he.addEventListener("dispose",me),U.__depthDisposeCallback=me}U.__boundDepthTexture=he}if(X.depthTexture&&!U.__autoAllocateDepthBuffer)if(J)for(let he=0;he<6;he++)se(U.__webglFramebuffer[he],X,he);else{const he=X.texture.mipmaps;he&&he.length>0?se(U.__webglFramebuffer[0],X,0):se(U.__webglFramebuffer,X,0)}else if(J){U.__webglDepthbuffer=[];for(let he=0;he<6;he++)if(n.bindFramebuffer(t.FRAMEBUFFER,U.__webglFramebuffer[he]),U.__webglDepthbuffer[he]===void 0)U.__webglDepthbuffer[he]=t.createRenderbuffer(),re(U.__webglDepthbuffer[he],X,!1);else{const me=X.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,fe=U.__webglDepthbuffer[he];t.bindRenderbuffer(t.RENDERBUFFER,fe),t.framebufferRenderbuffer(t.FRAMEBUFFER,me,t.RENDERBUFFER,fe)}}else{const he=X.texture.mipmaps;if(he&&he.length>0?n.bindFramebuffer(t.FRAMEBUFFER,U.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,U.__webglFramebuffer),U.__webglDepthbuffer===void 0)U.__webglDepthbuffer=t.createRenderbuffer(),re(U.__webglDepthbuffer,X,!1);else{const me=X.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,fe=U.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,fe),t.framebufferRenderbuffer(t.FRAMEBUFFER,me,t.RENDERBUFFER,fe)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function Ue(X,U,J){const he=r.get(X);U!==void 0&&Z(he.__webglFramebuffer,X,X.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),J!==void 0&&ye(X)}function Ie(X){const U=X.texture,J=r.get(X),he=r.get(U);X.addEventListener("dispose",M);const me=X.textures,fe=X.isWebGLCubeRenderTarget===!0,Ve=me.length>1;if(Ve||(he.__webglTexture===void 0&&(he.__webglTexture=t.createTexture()),he.__version=U.version,o.memory.textures++),fe){J.__webglFramebuffer=[];for(let Ee=0;Ee<6;Ee++)if(U.mipmaps&&U.mipmaps.length>0){J.__webglFramebuffer[Ee]=[];for(let qe=0;qe<U.mipmaps.length;qe++)J.__webglFramebuffer[Ee][qe]=t.createFramebuffer()}else J.__webglFramebuffer[Ee]=t.createFramebuffer()}else{if(U.mipmaps&&U.mipmaps.length>0){J.__webglFramebuffer=[];for(let Ee=0;Ee<U.mipmaps.length;Ee++)J.__webglFramebuffer[Ee]=t.createFramebuffer()}else J.__webglFramebuffer=t.createFramebuffer();if(Ve)for(let Ee=0,qe=me.length;Ee<qe;Ee++){const st=r.get(me[Ee]);st.__webglTexture===void 0&&(st.__webglTexture=t.createTexture(),o.memory.textures++)}if(X.samples>0&&de(X)===!1){J.__webglMultisampledFramebuffer=t.createFramebuffer(),J.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,J.__webglMultisampledFramebuffer);for(let Ee=0;Ee<me.length;Ee++){const qe=me[Ee];J.__webglColorRenderbuffer[Ee]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,J.__webglColorRenderbuffer[Ee]);const st=s.convert(qe.format,qe.colorSpace),Ce=s.convert(qe.type),Pe=w(qe.internalFormat,st,Ce,qe.colorSpace,X.isXRRenderTarget===!0),Ge=K(X);t.renderbufferStorageMultisample(t.RENDERBUFFER,Ge,Pe,X.width,X.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ee,t.RENDERBUFFER,J.__webglColorRenderbuffer[Ee])}t.bindRenderbuffer(t.RENDERBUFFER,null),X.depthBuffer&&(J.__webglDepthRenderbuffer=t.createRenderbuffer(),re(J.__webglDepthRenderbuffer,X,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(fe){n.bindTexture(t.TEXTURE_CUBE_MAP,he.__webglTexture),z(t.TEXTURE_CUBE_MAP,U);for(let Ee=0;Ee<6;Ee++)if(U.mipmaps&&U.mipmaps.length>0)for(let qe=0;qe<U.mipmaps.length;qe++)Z(J.__webglFramebuffer[Ee][qe],X,U,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,qe);else Z(J.__webglFramebuffer[Ee],X,U,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,0);m(U)&&p(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(Ve){for(let Ee=0,qe=me.length;Ee<qe;Ee++){const st=me[Ee],Ce=r.get(st);let Pe=t.TEXTURE_2D;(X.isWebGL3DRenderTarget||X.isWebGLArrayRenderTarget)&&(Pe=X.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(Pe,Ce.__webglTexture),z(Pe,st),Z(J.__webglFramebuffer,X,st,t.COLOR_ATTACHMENT0+Ee,Pe,0),m(st)&&p(Pe)}n.unbindTexture()}else{let Ee=t.TEXTURE_2D;if((X.isWebGL3DRenderTarget||X.isWebGLArrayRenderTarget)&&(Ee=X.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(Ee,he.__webglTexture),z(Ee,U),U.mipmaps&&U.mipmaps.length>0)for(let qe=0;qe<U.mipmaps.length;qe++)Z(J.__webglFramebuffer[qe],X,U,t.COLOR_ATTACHMENT0,Ee,qe);else Z(J.__webglFramebuffer,X,U,t.COLOR_ATTACHMENT0,Ee,0);m(U)&&p(Ee),n.unbindTexture()}X.depthBuffer&&ye(X)}function je(X){const U=X.textures;for(let J=0,he=U.length;J<he;J++){const me=U[J];if(m(me)){const fe=y(X),Ve=r.get(me).__webglTexture;n.bindTexture(fe,Ve),p(fe),n.unbindTexture()}}}const Ke=[],Xe=[];function dt(X){if(X.samples>0){if(de(X)===!1){const U=X.textures,J=X.width,he=X.height;let me=t.COLOR_BUFFER_BIT;const fe=X.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ve=r.get(X),Ee=U.length>1;if(Ee)for(let st=0;st<U.length;st++)n.bindFramebuffer(t.FRAMEBUFFER,Ve.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+st,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,Ve.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+st,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,Ve.__webglMultisampledFramebuffer);const qe=X.texture.mipmaps;qe&&qe.length>0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ve.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ve.__webglFramebuffer);for(let st=0;st<U.length;st++){if(X.resolveDepthBuffer&&(X.depthBuffer&&(me|=t.DEPTH_BUFFER_BIT),X.stencilBuffer&&X.resolveStencilBuffer&&(me|=t.STENCIL_BUFFER_BIT)),Ee){t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,Ve.__webglColorRenderbuffer[st]);const Ce=r.get(U[st]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,Ce,0)}t.blitFramebuffer(0,0,J,he,0,0,J,he,me,t.NEAREST),l===!0&&(Ke.length=0,Xe.length=0,Ke.push(t.COLOR_ATTACHMENT0+st),X.depthBuffer&&X.resolveDepthBuffer===!1&&(Ke.push(fe),Xe.push(fe),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,Xe)),t.invalidateFramebuffer(t.READ_FRAMEBUFFER,Ke))}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),Ee)for(let st=0;st<U.length;st++){n.bindFramebuffer(t.FRAMEBUFFER,Ve.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+st,t.RENDERBUFFER,Ve.__webglColorRenderbuffer[st]);const Ce=r.get(U[st]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,Ve.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+st,t.TEXTURE_2D,Ce,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ve.__webglMultisampledFramebuffer)}else if(X.depthBuffer&&X.resolveDepthBuffer===!1&&l){const U=X.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[U])}}}function K(X){return Math.min(i.maxSamples,X.samples)}function de(X){const U=r.get(X);return X.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&U.__useRenderToTexture!==!1}function _e(X){const U=o.render.frame;d.get(X)!==U&&(d.set(X,U),X.update())}function Ae(X,U){const J=X.colorSpace,he=X.format,me=X.type;return X.isCompressedTexture===!0||X.isVideoTexture===!0||J!==zu&&J!==na&&(Ft.getTransfer(J)===Xt?(he!==Yi||me!==si)&&ut("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):zt("WebGLTextures: Unsupported texture color space:",J)),U}function ce(X){return typeof HTMLImageElement<"u"&&X instanceof HTMLImageElement?(c.width=X.naturalWidth||X.width,c.height=X.naturalHeight||X.height):typeof VideoFrame<"u"&&X instanceof VideoFrame?(c.width=X.displayWidth,c.height=X.displayHeight):(c.width=X.width,c.height=X.height),c}this.allocateTextureUnit=P,this.resetTextureUnits=R,this.setTexture2D=F,this.setTexture2DArray=V,this.setTexture3D=H,this.setTextureCube=$,this.rebindTextures=Ue,this.setupRenderTarget=Ie,this.updateRenderTargetMipmap=je,this.updateMultisampleRenderTarget=dt,this.setupDepthRenderbuffer=ye,this.setupFrameBufferTexture=Z,this.useMultisampledRTT=de,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function Hae(t,e){function n(r,i=na){let s;const o=Ft.getTransfer(i);if(r===si)return t.UNSIGNED_BYTE;if(r===TS)return t.UNSIGNED_SHORT_4_4_4_4;if(r===AS)return t.UNSIGNED_SHORT_5_5_5_1;if(r===pU)return t.UNSIGNED_INT_5_9_9_9_REV;if(r===mU)return t.UNSIGNED_INT_10F_11F_11F_REV;if(r===fU)return t.BYTE;if(r===hU)return t.SHORT;if(r===bh)return t.UNSIGNED_SHORT;if(r===SS)return t.INT;if(r===Fs)return t.UNSIGNED_INT;if(r===bs)return t.FLOAT;if(r===So)return t.HALF_FLOAT;if(r===gU)return t.ALPHA;if(r===vU)return t.RGB;if(r===Yi)return t.RGBA;if(r===To)return t.DEPTH_COMPONENT;if(r===_l)return t.DEPTH_STENCIL;if(r===yU)return t.RED;if(r===MS)return t.RED_INTEGER;if(r===Vu)return t.RG;if(r===CS)return t.RG_INTEGER;if(r===RS)return t.RGBA_INTEGER;if(r===ng||r===rg||r===ig||r===sg)if(o===Xt)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(r===ng)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===rg)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===ig)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===sg)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(r===ng)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===rg)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===ig)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===sg)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===r1||r===i1||r===s1||r===o1)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(r===r1)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===i1)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===s1)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===o1)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===a1||r===l1||r===c1||r===u1||r===d1||r===f1||r===h1)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(r===a1||r===l1)return o===Xt?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(r===c1)return o===Xt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC;if(r===u1)return s.COMPRESSED_R11_EAC;if(r===d1)return s.COMPRESSED_SIGNED_R11_EAC;if(r===f1)return s.COMPRESSED_RG11_EAC;if(r===h1)return s.COMPRESSED_SIGNED_RG11_EAC}else return null;if(r===p1||r===m1||r===g1||r===v1||r===y1||r===_1||r===x1||r===b1||r===w1||r===E1||r===S1||r===T1||r===A1||r===M1)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(r===p1)return o===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===m1)return o===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===g1)return o===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===v1)return o===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===y1)return o===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===_1)return o===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===x1)return o===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===b1)return o===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===w1)return o===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===E1)return o===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===S1)return o===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===T1)return o===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===A1)return o===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===M1)return o===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===C1||r===R1||r===P1)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(r===C1)return o===Xt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===R1)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===P1)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===I1||r===N1||r===O1||r===D1)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(r===I1)return s.COMPRESSED_RED_RGTC1_EXT;if(r===N1)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===O1)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===D1)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===wh?t.UNSIGNED_INT_24_8:t[r]!==void 0?t[r]:null}return{convert:n}}const Gae=`
8212void main() {
8213
8214	gl_Position = vec4( position, 1.0 );
8215
8216}`,$ae=`
8217uniform sampler2DArray depthColor;
8218uniform float depthWidth;
8219uniform float depthHeight;
8220
8221void main() {
8222
8223	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
8224
8225	if ( coord.x >= 1.0 ) {
8226
8227		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
8228
8229	} else {
8230
8231		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
8232
8233	}
8234
8235}`;class Wae{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n){if(this.texture===null){const r=new RU(e.texture);(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,r=new Bs({vertexShader:Gae,fragmentShader:$ae,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new js(new Hy(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class qae extends ec{constructor(e,n){super();const r=this;let i=null,s=1,o=null,a="local-floor",l=1,c=null,d=null,f=null,u=null,h=null,g=null;const v=typeof XRWebGLBinding<"u",m=new Wae,p={},y=n.getContextAttributes();let w=null,x=null;const S=[],I=[],M=new _t;let E=null;const C=new Si;C.viewport=new An;const T=new Si;T.viewport=new An;const A=[C,T],R=new rre;let P=null,D=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(j){let Q=S[j];return Q===void 0&&(Q=new b0,S[j]=Q),Q.getTargetRaySpace()},this.getControllerGrip=function(j){let Q=S[j];return Q===void 0&&(Q=new b0,S[j]=Q),Q.getGripSpace()},this.getHand=function(j){let Q=S[j];return Q===void 0&&(Q=new b0,S[j]=Q),Q.getHandSpace()};function F(j){const Q=I.indexOf(j.inputSource);if(Q===-1)return;const Z=S[Q];Z!==void 0&&(Z.update(j.inputSource,j.frame,c||o),Z.dispatchEvent({type:j.type,data:j.inputSource}))}function V(){i.removeEventListener("select",F),i.removeEventListener("selectstart",F),i.removeEventListener("selectend",F),i.removeEventListener("squeeze",F),i.removeEventListener("squeezestart",F),i.removeEventListener("squeezeend",F),i.removeEventListener("end",V),i.removeEventListener("inputsourceschange",H);for(let j=0;j<S.length;j++){const Q=I[j];Q!==null&&(I[j]=null,S[j].disconnect(Q))}P=null,D=null,m.reset();for(const j in p)delete p[j];e.setRenderTarget(w),h=null,u=null,f=null,i=null,x=null,ee.stop(),r.isPresenting=!1,e.setPixelRatio(E),e.setSize(M.width,M.height,!1),r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(j){s=j,r.isPresenting===!0&&ut("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(j){a=j,r.isPresenting===!0&&ut("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(j){c=j},this.getBaseLayer=function(){return u!==null?u:h},this.getBinding=function(){return f===null&&v&&(f=new XRWebGLBinding(i,n)),f},this.getFrame=function(){return g},this.getSession=function(){return i},this.setSession=async function(j){if(i=j,i!==null){if(w=e.getRenderTarget(),i.addEventListener("select",F),i.addEventListener("selectstart",F),i.addEventListener("selectend",F),i.addEventListener("squeeze",F),i.addEventListener("squeezestart",F),i.addEventListener("squeezeend",F),i.addEventListener("end",V),i.addEventListener("inputsourceschange",H),y.xrCompatible!==!0&&await n.makeXRCompatible(),E=e.getPixelRatio(),e.getSize(M),v&&"createProjectionLayer"in XRWebGLBinding.prototype){let Z=null,re=null,se=null;y.depth&&(se=y.stencil?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24,Z=y.stencil?_l:To,re=y.stencil?wh:Fs);const ye={colorFormat:n.RGBA8,depthFormat:se,scaleFactor:s};f=this.getBinding(),u=f.createProjectionLayer(ye),i.updateRenderState({layers:[u]}),e.setPixelRatio(1),e.setSize(u.textureWidth,u.textureHeight,!1),x=new Ps(u.textureWidth,u.textureHeight,{format:Yi,type:si,depthTexture:new Th(u.textureWidth,u.textureHeight,re,void 0,void 0,void 0,void 0,void 0,void 0,Z),stencilBuffer:y.stencil,colorSpace:e.outputColorSpace,samples:y.antialias?4:0,resolveDepthBuffer:u.ignoreDepthValues===!1,resolveStencilBuffer:u.ignoreDepthValues===!1})}else{const Z={antialias:y.antialias,alpha:!0,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:s};h=new XRWebGLLayer(i,n,Z),i.updateRenderState({baseLayer:h}),e.setPixelRatio(1),e.setSize(h.framebufferWidth,h.framebufferHeight,!1),x=new Ps(h.framebufferWidth,h.framebufferHeight,{format:Yi,type:si,colorSpace:e.outputColorSpace,stencilBuffer:y.stencil,resolveDepthBuffer:h.ignoreDepthValues===!1,resolveStencilBuffer:h.ignoreDepthValues===!1})}x.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await i.requestReferenceSpace(a),ee.setContext(i),ee.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return m.getDepthTexture()};function H(j){for(let Q=0;Q<j.removed.length;Q++){const Z=j.removed[Q],re=I.indexOf(Z);re>=0&&(I[re]=null,S[re].disconnect(Z))}for(let Q=0;Q<j.added.length;Q++){const Z=j.added[Q];let re=I.indexOf(Z);if(re===-1){for(let ye=0;ye<S.length;ye++)if(ye>=I.length){I.push(Z),re=ye;break}else if(I[ye]===null){I[ye]=Z,re=ye;break}if(re===-1)break}const se=S[re];se&&se.connect(Z)}}const $=new oe,B=new oe;function G(j,Q,Z){$.setFromMatrixPosition(Q.matrixWorld),B.setFromMatrixPosition(Z.matrixWorld);const re=$.distanceTo(B),se=Q.projectionMatrix.elements,ye=Z.projectionMatrix.elements,Ue=se[14]/(se[10]-1),Ie=se[14]/(se[10]+1),je=(se[9]+1)/se[5],Ke=(se[9]-1)/se[5],Xe=(se[8]-1)/se[0],dt=(ye[8]+1)/ye[0],K=Ue*Xe,de=Ue*dt,_e=re/(-Xe+dt),Ae=_e*-Xe;if(Q.matrixWorld.decompose(j.position,j.quaternion,j.scale),j.translateX(Ae),j.translateZ(_e),j.matrixWorld.compose(j.position,j.quaternion,j.scale),j.matrixWorldInverse.copy(j.matrixWorld).invert(),se[10]===-1)j.projectionMatrix.copy(Q.projectionMatrix),j.projectionMatrixInverse.copy(Q.projectionMatrixInverse);else{const ce=Ue+_e,X=Ie+_e,U=K-Ae,J=de+(re-Ae),he=je*Ie/X*ce,me=Ke*Ie/X*ce;j.projectionMatrix.makePerspective(U,J,he,me,ce,X),j.projectionMatrixInverse.copy(j.projectionMatrix).invert()}}function k(j,Q){Q===null?j.matrixWorld.copy(j.matrix):j.matrixWorld.multiplyMatrices(Q.matrixWorld,j.matrix),j.matrixWorldInverse.copy(j.matrixWorld).invert()}this.updateCamera=function(j){if(i===null)return;let Q=j.near,Z=j.far;m.texture!==null&&(m.depthNear>0&&(Q=m.depthNear),m.depthFar>0&&(Z=m.depthFar)),R.near=T.near=C.near=Q,R.far=T.far=C.far=Z,(P!==R.near||D!==R.far)&&(i.updateRenderState({depthNear:R.near,depthFar:R.far}),P=R.near,D=R.far),R.layers.mask=j.layers.mask|6,C.layers.mask=R.layers.mask&-5,T.layers.mask=R.layers.mask&-3;const re=j.parent,se=R.cameras;k(R,re);for(let ye=0;ye<se.length;ye++)k(se[ye],re);se.length===2?G(R,C,T):R.projectionMatrix.copy(C.projectionMatrix),z(j,R,re)};function z(j,Q,Z){Z===null?j.matrix.copy(Q.matrixWorld):(j.matrix.copy(Z.matrixWorld),j.matrix.invert(),j.matrix.multiply(Q.matrixWorld)),j.matrix.decompose(j.position,j.quaternion,j.scale),j.updateMatrixWorld(!0),j.projectionMatrix.copy(Q.projectionMatrix),j.projectionMatrixInverse.copy(Q.projectionMatrixInverse),j.isPerspectiveCamera&&(j.fov=Sh*2*Math.atan(1/j.projectionMatrix.elements[5]),j.zoom=1)}this.getCamera=function(){return R},this.getFoveation=function(){if(!(u===null&&h===null))return l},this.setFoveation=function(j){l=j,u!==null&&(u.fixedFoveation=j),h!==null&&h.fixedFoveation!==void 0&&(h.fixedFoveation=j)},this.hasDepthSensing=function(){return m.texture!==null},this.getDepthSensingMesh=function(){return m.getMesh(R)},this.getCameraTexture=function(j){return p[j]};let q=null;function ne(j,Q){if(d=Q.getViewerPose(c||o),g=Q,d!==null){const Z=d.views;h!==null&&(e.setRenderTargetFramebuffer(x,h.framebuffer),e.setRenderTarget(x));let re=!1;Z.length!==R.cameras.length&&(R.cameras.length=0,re=!0);for(let Ie=0;Ie<Z.length;Ie++){const je=Z[Ie];let Ke=null;if(h!==null)Ke=h.getViewport(je);else{const dt=f.getViewSubImage(u,je);Ke=dt.viewport,Ie===0&&(e.setRenderTargetTextures(x,dt.colorTexture,dt.depthStencilTexture),e.setRenderTarget(x))}let Xe=A[Ie];Xe===void 0&&(Xe=new Si,Xe.layers.enable(Ie),Xe.viewport=new An,A[Ie]=Xe),Xe.matrix.fromArray(je.transform.matrix),Xe.matrix.decompose(Xe.position,Xe.quaternion,Xe.scale),Xe.projectionMatrix.fromArray(je.projectionMatrix),Xe.projectionMatrixInverse.copy(Xe.projectionMatrix).invert(),Xe.viewport.set(Ke.x,Ke.y,Ke.width,Ke.height),Ie===0&&(R.matrix.copy(Xe.matrix),R.matrix.decompose(R.position,R.quaternion,R.scale)),re===!0&&R.cameras.push(Xe)}const se=i.enabledFeatures;if(se&&se.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&v){f=r.getBinding();const Ie=f.getDepthInformation(Z[0]);Ie&&Ie.isValid&&Ie.texture&&m.init(Ie,i.renderState)}if(se&&se.includes("camera-access")&&v){e.state.unbindTexture(),f=r.getBinding();for(let Ie=0;Ie<Z.length;Ie++){const je=Z[Ie].camera;if(je){let Ke=p[je];Ke||(Ke=new RU,p[je]=Ke);const Xe=f.getCameraImage(je);Ke.sourceTexture=Xe}}}}for(let Z=0;Z<S.length;Z++){const re=I[Z],se=S[Z];re!==null&&se!==void 0&&se.update(re,Q,c||o)}q&&q(j,Q),Q.detectedPlanes&&r.dispatchEvent({type:"planesdetected",data:Q}),g=null}const ee=new OU;ee.setAnimationLoop(ne),this.setAnimationLoop=function(j){q=j},this.dispose=function(){}}}const ol=new Us,Kae=new xn;function Xae(t,e){function n(m,p){m.matrixAutoUpdate===!0&&m.updateMatrix(),p.value.copy(m.matrix)}function r(m,p){p.color.getRGB(m.fogColor.value,PU(t)),p.isFog?(m.fogNear.value=p.near,m.fogFar.value=p.far):p.isFogExp2&&(m.fogDensity.value=p.density)}function i(m,p,y,w,x){p.isMeshBasicMaterial?s(m,p):p.isMeshLambertMaterial?(s(m,p),p.envMap&&(m.envMapIntensity.value=p.envMapIntensity)):p.isMeshToonMaterial?(s(m,p),f(m,p)):p.isMeshPhongMaterial?(s(m,p),d(m,p),p.envMap&&(m.envMapIntensity.value=p.envMapIntensity)):p.isMeshStandardMaterial?(s(m,p),u(m,p),p.isMeshPhysicalMaterial&&h(m,p,x)):p.isMeshMatcapMaterial?(s(m,p),g(m,p)):p.isMeshDepthMaterial?s(m,p):p.isMeshDistanceMaterial?(s(m,p),v(m,p)):p.isMeshNormalMaterial?s(m,p):p.isLineBasicMaterial?(o(m,p),p.isLineDashedMaterial&&a(m,p)):p.isPointsMaterial?l(m,p,y,w):p.isSpriteMaterial?c(m,p):p.isShadowMaterial?(m.color.value.copy(p.color),m.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function s(m,p){m.opacity.value=p.opacity,p.color&&m.diffuse.value.copy(p.color),p.emissive&&m.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(m.map.value=p.map,n(p.map,m.mapTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,n(p.alphaMap,m.alphaMapTransform)),p.bumpMap&&(m.bumpMap.value=p.bumpMap,n(p.bumpMap,m.bumpMapTransform),m.bumpScale.value=p.bumpScale,p.side===Qr&&(m.bumpScale.value*=-1)),p.normalMap&&(m.normalMap.value=p.normalMap,n(p.normalMap,m.normalMapTransform),m.normalScale.value.copy(p.normalScale),p.side===Qr&&m.normalScale.value.negate()),p.displacementMap&&(m.displacementMap.value=p.displacementMap,n(p.displacementMap,m.displacementMapTransform),m.displacementScale.value=p.displacementScale,m.displacementBias.value=p.displacementBias),p.emissiveMap&&(m.emissiveMap.value=p.emissiveMap,n(p.emissiveMap,m.emissiveMapTransform)),p.specularMap&&(m.specularMap.value=p.specularMap,n(p.specularMap,m.specularMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest);const y=e.get(p),w=y.envMap,x=y.envMapRotation;w&&(m.envMap.value=w,ol.copy(x),ol.x*=-1,ol.y*=-1,ol.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(ol.y*=-1,ol.z*=-1),m.envMapRotation.value.setFromMatrix4(Kae.makeRotationFromEuler(ol)),m.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=p.reflectivity,m.ior.value=p.ior,m.refractionRatio.value=p.refractionRatio),p.lightMap&&(m.lightMap.value=p.lightMap,m.lightMapIntensity.value=p.lightMapIntensity,n(p.lightMap,m.lightMapTransform)),p.aoMap&&(m.aoMap.value=p.aoMap,m.aoMapIntensity.value=p.aoMapIntensity,n(p.aoMap,m.aoMapTransform))}function o(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,p.map&&(m.map.value=p.map,n(p.map,m.mapTransform))}function a(m,p){m.dashSize.value=p.dashSize,m.totalSize.value=p.dashSize+p.gapSize,m.scale.value=p.scale}function l(m,p,y,w){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.size.value=p.size*y,m.scale.value=w*.5,p.map&&(m.map.value=p.map,n(p.map,m.uvTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,n(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function c(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.rotation.value=p.rotation,p.map&&(m.map.value=p.map,n(p.map,m.mapTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,n(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function d(m,p){m.specular.value.copy(p.specular),m.shininess.value=Math.max(p.shininess,1e-4)}function f(m,p){p.gradientMap&&(m.gradientMap.value=p.gradientMap)}function u(m,p){m.metalness.value=p.metalness,p.metalnessMap&&(m.metalnessMap.value=p.metalnessMap,n(p.metalnessMap,m.metalnessMapTransform)),m.roughness.value=p.roughness,p.roughnessMap&&(m.roughnessMap.value=p.roughnessMap,n(p.roughnessMap,m.roughnessMapTransform)),p.envMap&&(m.envMapIntensity.value=p.envMapIntensity)}function h(m,p,y){m.ior.value=p.ior,p.sheen>0&&(m.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),m.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(m.sheenColorMap.value=p.sheenColorMap,n(p.sheenColorMap,m.sheenColorMapTransform)),p.sheenRoughnessMap&&(m.sheenRoughnessMap.value=p.sheenRoughnessMap,n(p.sheenRoughnessMap,m.sheenRoughnessMapTransform))),p.clearcoat>0&&(m.clearcoat.value=p.clearcoat,m.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(m.clearcoatMap.value=p.clearcoatMap,n(p.clearcoatMap,m.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,n(p.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(m.clearcoatNormalMap.value=p.clearcoatNormalMap,n(p.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Qr&&m.clearcoatNormalScale.value.negate())),p.dispersion>0&&(m.dispersion.value=p.dispersion),p.iridescence>0&&(m.iridescence.value=p.iridescence,m.iridescenceIOR.value=p.iridescenceIOR,m.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(m.iridescenceMap.value=p.iridescenceMap,n(p.iridescenceMap,m.iridescenceMapTransform)),p.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=p.iridescenceThicknessMap,n(p.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),p.transmission>0&&(m.transmission.value=p.transmission,m.transmissionSamplerMap.value=y.texture,m.transmissionSamplerSize.value.set(y.width,y.height),p.transmissionMap&&(m.transmissionMap.value=p.transmissionMap,n(p.transmissionMap,m.transmissionMapTransform)),m.thickness.value=p.thickness,p.thicknessMap&&(m.thicknessMap.value=p.thicknessMap,n(p.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=p.attenuationDistance,m.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(m.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(m.anisotropyMap.value=p.anisotropyMap,n(p.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=p.specularIntensity,m.specularColor.value.copy(p.specularColor),p.specularColorMap&&(m.specularColorMap.value=p.specularColorMap,n(p.specularColorMap,m.specularColorMapTransform)),p.specularIntensityMap&&(m.specularIntensityMap.value=p.specularIntensityMap,n(p.specularIntensityMap,m.specularIntensityMapTransform))}function g(m,p){p.matcap&&(m.matcap.value=p.matcap)}function v(m,p){const y=e.get(p).light;m.referencePosition.value.setFromMatrixPosition(y.matrixWorld),m.nearDistance.value=y.shadow.camera.near,m.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function Yae(t,e,n,r){let i={},s={},o=[];const a=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,w){const x=w.program;r.uniformBlockBinding(y,x)}function c(y,w){let x=i[y.id];x===void 0&&(g(y),x=d(y),i[y.id]=x,y.addEventListener("dispose",m));const S=w.program;r.updateUBOMapping(y,S);const I=e.render.frame;s[y.id]!==I&&(u(y),s[y.id]=I)}function d(y){const w=f();y.__bindingPointIndex=w;const x=t.createBuffer(),S=y.__size,I=y.usage;return t.bindBuffer(t.UNIFORM_BUFFER,x),t.bufferData(t.UNIFORM_BUFFER,S,I),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,w,x),x}function f(){for(let y=0;y<a;y++)if(o.indexOf(y)===-1)return o.push(y),y;return zt("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function u(y){const w=i[y.id],x=y.uniforms,S=y.__cache;t.bindBuffer(t.UNIFORM_BUFFER,w);for(let I=0,M=x.length;I<M;I++){const E=Array.isArray(x[I])?x[I]:[x[I]];for(let C=0,T=E.length;C<T;C++){const A=E[C];if(h(A,I,C,S)===!0){const R=A.__offset,P=Array.isArray(A.value)?A.value:[A.value];let D=0;for(let F=0;F<P.length;F++){const V=P[F],H=v(V);typeof V=="number"||typeof V=="boolean"?(A.__data[0]=V,t.bufferSubData(t.UNIFORM_BUFFER,R+D,A.__data)):V.isMatrix3?(A.__data[0]=V.elements[0],A.__data[1]=V.elements[1],A.__data[2]=V.elements[2],A.__data[3]=0,A.__data[4]=V.elements[3],A.__data[5]=V.elements[4],A.__data[6]=V.elements[5],A.__data[7]=0,A.__data[8]=V.elements[6],A.__data[9]=V.elements[7],A.__data[10]=V.elements[8],A.__data[11]=0):(V.toArray(A.__data,D),D+=H.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,R,A.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}function h(y,w,x,S){const I=y.value,M=w+"_"+x;if(S[M]===void 0)return typeof I=="number"||typeof I=="boolean"?S[M]=I:S[M]=I.clone(),!0;{const E=S[M];if(typeof I=="number"||typeof I=="boolean"){if(E!==I)return S[M]=I,!0}else if(E.equals(I)===!1)return E.copy(I),!0}return!1}function g(y){const w=y.uniforms;let x=0;const S=16;for(let M=0,E=w.length;M<E;M++){const C=Array.isArray(w[M])?w[M]:[w[M]];for(let T=0,A=C.length;T<A;T++){const R=C[T],P=Array.isArray(R.value)?R.value:[R.value];for(let D=0,F=P.length;D<F;D++){const V=P[D],H=v(V),$=x%S,B=$%H.boundary,G=$+B;x+=B,G!==0&&S-G<H.storage&&(x+=S-G),R.__data=new Float32Array(H.storage/Float32Array.BYTES_PER_ELEMENT),R.__offset=x,x+=H.storage}}}const I=x%S;return I>0&&(x+=S-I),y.__size=x,y.__cache={},this}function v(y){const w={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(w.boundary=4,w.storage=4):y.isVector2?(w.boundary=8,w.storage=8):y.isVector3||y.isColor?(w.boundary=16,w.storage=12):y.isVector4?(w.boundary=16,w.storage=16):y.isMatrix3?(w.boundary=48,w.storage=48):y.isMatrix4?(w.boundary=64,w.storage=64):y.isTexture?ut("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ut("WebGLRenderer: Unsupported uniform value type.",y),w}function m(y){const w=y.target;w.removeEventListener("dispose",m);const x=o.indexOf(w.__bindingPointIndex);o.splice(x,1),t.deleteBuffer(i[w.id]),delete i[w.id],delete s[w.id]}function p(){for(const y in i)t.deleteBuffer(i[y]);o=[],i={},s={}}return{bind:l,update:c,dispose:p}}const Qae=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let us=null;function Zae(){return us===null&&(us=new Fne(Qae,16,16,Vu,So),us.name="DFG_LUT",us.minFilter=yr,us.magFilter=yr,us.wrapS=ao,us.wrapT=ao,us.generateMipmaps=!1,us.needsUpdate=!0),us}class Jae{constructor(e={}){const{canvas:n=Zte(),context:r=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:f=!1,reversedDepthBuffer:u=!1,outputBufferType:h=si}=e;this.isWebGLRenderer=!0;let g;if(r!==null){if(typeof WebGLRenderingContext<"u"&&r instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=r.getContextAttributes().alpha}else g=o;const v=h,m=new Set([RS,CS,MS]),p=new Set([si,Fs,bh,wh,TS,AS]),y=new Uint32Array(4),w=new Int32Array(4);let x=null,S=null;const I=[],M=[];let E=null;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.toneMapping=Rs,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const C=this;let T=!1;this._outputColorSpace=_i;let A=0,R=0,P=null,D=-1,F=null;const V=new An,H=new An;let $=null;const B=new Pt(0);let G=0,k=n.width,z=n.height,q=1,ne=null,ee=null;const j=new An(0,0,k,z),Q=new An(0,0,k,z);let Z=!1;const re=new kS;let se=!1,ye=!1;const Ue=new xn,Ie=new oe,je=new An,Ke={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Xe=!1;function dt(){return P===null?q:1}let K=r;function de(W,ie){return n.getContext(W,ie)}try{const W={alpha:!0,depth:i,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:d,failIfMajorPerformanceCaveat:f};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${ES}`),n.addEventListener("webglcontextlost",Qe,!1),n.addEventListener("webglcontextrestored",at,!1),n.addEventListener("webglcontextcreationerror",Kt,!1),K===null){const ie="webgl2";if(K=de(ie,W),K===null)throw de(ie)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(W){throw zt("WebGLRenderer: "+W.message),W}let _e,Ae,ce,X,U,J,he,me,fe,Ve,Ee,qe,st,Ce,Pe,Ge,He,ze,Ne,te,xe,Se,ke;function Me(){_e=new Jse(K),_e.init(),xe=new Hae(K,_e),Ae=new $se(K,_e,e,xe),ce=new Vae(K,_e),Ae.reversedDepthBuffer&&u&&ce.buffers.depth.setReversed(!0),X=new noe(K),U=new Mae,J=new zae(K,_e,ce,U,Ae,xe,X),he=new Zse(C),me=new are(K),Se=new Hse(K,me),fe=new eoe(K,me,X,Se),Ve=new ioe(K,fe,me,Se,X),ze=new roe(K,Ae,J),Pe=new Wse(U),Ee=new Aae(C,he,_e,Ae,Se,Pe),qe=new Xae(C,U),st=new Rae,Ce=new kae(_e),He=new zse(C,he,ce,Ve,g,l),Ge=new Bae(C,Ve,Ae),ke=new Yae(K,X,Ae,ce),Ne=new Gse(K,_e,X),te=new toe(K,_e,X),X.programs=Ee.programs,C.capabilities=Ae,C.extensions=_e,C.properties=U,C.renderLists=st,C.shadowMap=Ge,C.state=ce,C.info=X}Me(),v!==si&&(E=new ooe(v,n.width,n.height,i,s));const ge=new qae(C,K);this.xr=ge,this.getContext=function(){return K},this.getContextAttributes=function(){return K.getContextAttributes()},this.forceContextLoss=function(){const W=_e.get("WEBGL_lose_context");W&&W.loseContext()},this.forceContextRestore=function(){const W=_e.get("WEBGL_lose_context");W&&W.restoreContext()},this.getPixelRatio=function(){return q},this.setPixelRatio=function(W){W!==void 0&&(q=W,this.setSize(k,z,!1))},this.getSize=function(W){return W.set(k,z)},this.setSize=function(W,ie,pe=!0){if(ge.isPresenting){ut("WebGLRenderer: Can't change size while VR device is presenting.");return}k=W,z=ie,n.width=Math.floor(W*q),n.height=Math.floor(ie*q),pe===!0&&(n.style.width=W+"px",n.style.height=ie+"px"),E!==null&&E.setSize(n.width,n.height),this.setViewport(0,0,W,ie)},this.getDrawingBufferSize=function(W){return W.set(k*q,z*q).floor()},this.setDrawingBufferSize=function(W,ie,pe){k=W,z=ie,q=pe,n.width=Math.floor(W*pe),n.height=Math.floor(ie*pe),this.setViewport(0,0,W,ie)},this.setEffects=function(W){if(v===si){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(W){for(let ie=0;ie<W.length;ie++)if(W[ie].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}E.setEffects(W||[])},this.getCurrentViewport=function(W){return W.copy(V)},this.getViewport=function(W){return W.copy(j)},this.setViewport=function(W,ie,pe,ue){W.isVector4?j.set(W.x,W.y,W.z,W.w):j.set(W,ie,pe,ue),ce.viewport(V.copy(j).multiplyScalar(q).round())},this.getScissor=function(W){return W.copy(Q)},this.setScissor=function(W,ie,pe,ue){W.isVector4?Q.set(W.x,W.y,W.z,W.w):Q.set(W,ie,pe,ue),ce.scissor(H.copy(Q).multiplyScalar(q).round())},this.getScissorTest=function(){return Z},this.setScissorTest=function(W){ce.setScissorTest(Z=W)},this.setOpaqueSort=function(W){ne=W},this.setTransparentSort=function(W){ee=W},this.getClearColor=function(W){return W.copy(He.getClearColor())},this.setClearColor=function(){He.setClearColor(...arguments)},this.getClearAlpha=function(){return He.getClearAlpha()},this.setClearAlpha=function(){He.setClearAlpha(...arguments)},this.clear=function(W=!0,ie=!0,pe=!0){let ue=0;if(W){let le=!1;if(P!==null){const Le=P.texture.format;le=m.has(Le)}if(le){const Le=P.texture.type,$e=p.has(Le),Fe=He.getClearColor(),Ze=He.getClearAlpha(),et=Fe.r,ht=Fe.g,vt=Fe.b;$e?(y[0]=et,y[1]=ht,y[2]=vt,y[3]=Ze,K.clearBufferuiv(K.COLOR,0,y)):(w[0]=et,w[1]=ht,w[2]=vt,w[3]=Ze,K.clearBufferiv(K.COLOR,0,w))}else ue|=K.COLOR_BUFFER_BIT}ie&&(ue|=K.DEPTH_BUFFER_BIT),pe&&(ue|=K.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ue!==0&&K.clear(ue)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",Qe,!1),n.removeEventListener("webglcontextrestored",at,!1),n.removeEventListener("webglcontextcreationerror",Kt,!1),He.dispose(),st.dispose(),Ce.dispose(),U.dispose(),he.dispose(),Ve.dispose(),Se.dispose(),ke.dispose(),Ee.dispose(),ge.dispose(),ge.removeEventListener("sessionstart",np),ge.removeEventListener("sessionend",rp),Ur.stop()};function Qe(W){W.preventDefault(),XR("WebGLRenderer: Context Lost."),T=!0}function at(){XR("WebGLRenderer: Context Restored."),T=!1;const W=X.autoReset,ie=Ge.enabled,pe=Ge.autoUpdate,ue=Ge.needsUpdate,le=Ge.type;Me(),X.autoReset=W,Ge.enabled=ie,Ge.autoUpdate=pe,Ge.needsUpdate=ue,Ge.type=le}function Kt(W){zt("WebGLRenderer: A WebGL context could not be created. Reason: ",W.statusMessage)}function Dt(W){const ie=W.target;ie.removeEventListener("dispose",Dt),mi(ie)}function mi(W){en(W),U.remove(W)}function en(W){const ie=U.get(W).programs;ie!==void 0&&(ie.forEach(function(pe){Ee.releaseProgram(pe)}),W.isShaderMaterial&&Ee.releaseShaderCache(W))}this.renderBufferDirect=function(W,ie,pe,ue,le,Le){ie===null&&(ie=Ke);const $e=le.isMesh&&le.matrixWorld.determinant()<0,Fe=sp(W,ie,pe,ue,le);ce.setMaterial(ue,$e);let Ze=pe.index,et=1;if(ue.wireframe===!0){if(Ze=fe.getWireframeAttribute(pe),Ze===void 0)return;et=2}const ht=pe.drawRange,vt=pe.attributes.position;let nt=ht.start*et,Ht=(ht.start+ht.count)*et;Le!==null&&(nt=Math.max(nt,Le.start*et),Ht=Math.min(Ht,(Le.start+Le.count)*et)),Ze!==null?(nt=Math.max(nt,0),Ht=Math.min(Ht,Ze.count)):vt!=null&&(nt=Math.max(nt,0),Ht=Math.min(Ht,vt.count));const pn=Ht-nt;if(pn<0||pn===1/0)return;Se.setup(le,ue,Fe,pe,Ze);let un,Gt=Ne;if(Ze!==null&&(un=me.get(Ze),Gt=te,Gt.setIndex(un)),le.isMesh)ue.wireframe===!0?(ce.setLineWidth(ue.wireframeLinewidth*dt()),Gt.setMode(K.LINES)):Gt.setMode(K.TRIANGLES);else if(le.isLine){let Ln=ue.linewidth;Ln===void 0&&(Ln=1),ce.setLineWidth(Ln*dt()),le.isLineSegments?Gt.setMode(K.LINES):le.isLineLoop?Gt.setMode(K.LINE_LOOP):Gt.setMode(K.LINE_STRIP)}else le.isPoints?Gt.setMode(K.POINTS):le.isSprite&&Gt.setMode(K.TRIANGLES);if(le.isBatchedMesh)if(le._multiDrawInstances!==null)yv("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Gt.renderMultiDrawInstances(le._multiDrawStarts,le._multiDrawCounts,le._multiDrawCount,le._multiDrawInstances);else if(_e.get("WEBGL_multi_draw"))Gt.renderMultiDraw(le._multiDrawStarts,le._multiDrawCounts,le._multiDrawCount);else{const Ln=le._multiDrawStarts,Je=le._multiDrawCounts,Mn=le._multiDrawCount,yt=Ze?me.get(Ze).bytesPerElement:1,sr=U.get(ue).currentProgram.getUniforms();for(let wr=0;wr<Mn;wr++)sr.setValue(K,"_gl_DrawID",wr),Gt.render(Ln[wr]/yt,Je[wr])}else if(le.isInstancedMesh)Gt.renderInstances(nt,pn,le.count);else if(pe.isInstancedBufferGeometry){const Ln=pe._maxInstanceCount!==void 0?pe._maxInstanceCount:1/0,Je=Math.min(pe.instanceCount,Ln);Gt.renderInstances(nt,pn,Je)}else Gt.render(nt,pn)};function yd(W,ie,pe){W.transparent===!0&&W.side===no&&W.forceSinglePass===!1?(W.side=Qr,W.needsUpdate=!0,$s(W,ie,pe),W.side=Va,W.needsUpdate=!0,$s(W,ie,pe),W.side=no):$s(W,ie,pe)}this.compile=function(W,ie,pe=null){pe===null&&(pe=W),S=Ce.get(pe),S.init(ie),M.push(S),pe.traverseVisible(function(le){le.isLight&&le.layers.test(ie.layers)&&(S.pushLight(le),le.castShadow&&S.pushShadow(le))}),W!==pe&&W.traverseVisible(function(le){le.isLight&&le.layers.test(ie.layers)&&(S.pushLight(le),le.castShadow&&S.pushShadow(le))}),S.setupLights();const ue=new Set;return W.traverse(function(le){if(!(le.isMesh||le.isPoints||le.isLine||le.isSprite))return;const Le=le.material;if(Le)if(Array.isArray(Le))for(let $e=0;$e<Le.length;$e++){const Fe=Le[$e];yd(Fe,pe,le),ue.add(Fe)}else yd(Le,pe,le),ue.add(Le)}),S=M.pop(),ue},this.compileAsync=function(W,ie,pe=null){const ue=this.compile(W,ie,pe);return new Promise(le=>{function Le(){if(ue.forEach(function($e){U.get($e).currentProgram.isReady()&&ue.delete($e)}),ue.size===0){le(W);return}setTimeout(Le,10)}_e.get("KHR_parallel_shader_compile")!==null?Le():setTimeout(Le,10)})};let Gs=null;function Qa(W){Gs&&Gs(W)}function np(){Ur.stop()}function rp(){Ur.start()}const Ur=new OU;Ur.setAnimationLoop(Qa),typeof self<"u"&&Ur.setContext(self),this.setAnimationLoop=function(W){Gs=W,ge.setAnimationLoop(W),W===null?Ur.stop():Ur.start()},ge.addEventListener("sessionstart",np),ge.addEventListener("sessionend",rp),this.render=function(W,ie){if(ie!==void 0&&ie.isCamera!==!0){zt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(T===!0)return;const pe=ge.enabled===!0&&ge.isPresenting===!0,ue=E!==null&&(P===null||pe)&&E.begin(C,P);if(W.matrixWorldAutoUpdate===!0&&W.updateMatrixWorld(),ie.parent===null&&ie.matrixWorldAutoUpdate===!0&&ie.updateMatrixWorld(),ge.enabled===!0&&ge.isPresenting===!0&&(E===null||E.isCompositing()===!1)&&(ge.cameraAutoUpdate===!0&&ge.updateCamera(ie),ie=ge.getCamera()),W.isScene===!0&&W.onBeforeRender(C,W,ie,P),S=Ce.get(W,M.length),S.init(ie),M.push(S),Ue.multiplyMatrices(ie.projectionMatrix,ie.matrixWorldInverse),re.setFromProjectionMatrix(Ue,ws,ie.reversedDepth),ye=this.localClippingEnabled,se=Pe.init(this.clippingPlanes,ye),x=st.get(W,I.length),x.init(),I.push(x),ge.enabled===!0&&ge.isPresenting===!0){const $e=C.xr.getDepthSensingMesh();$e!==null&&_d($e,ie,-1/0,C.sortObjects)}_d(W,ie,0,C.sortObjects),x.finish(),C.sortObjects===!0&&x.sort(ne,ee),Xe=ge.enabled===!1||ge.isPresenting===!1||ge.hasDepthSensing()===!1,Xe&&He.addToRenderList(x,W),this.info.render.frame++,se===!0&&Pe.beginShadows();const le=S.state.shadowsArray;if(Ge.render(le,W,ie),se===!0&&Pe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(ue&&E.hasRenderPass())===!1){const $e=x.opaque,Fe=x.transmissive;if(S.setupLights(),ie.isArrayCamera){const Ze=ie.cameras;if(Fe.length>0)for(let et=0,ht=Ze.length;et<ht;et++){const vt=Ze[et];Za($e,Fe,W,vt)}Xe&&He.render(W);for(let et=0,ht=Ze.length;et<ht;et++){const vt=Ze[et];ip(x,W,vt,vt.viewport)}}else Fe.length>0&&Za($e,Fe,W,ie),Xe&&He.render(W),ip(x,W,ie)}P!==null&&R===0&&(J.updateMultisampleRenderTarget(P),J.updateRenderTargetMipmap(P)),ue&&E.end(C),W.isScene===!0&&W.onAfterRender(C,W,ie),Se.resetDefaultState(),D=-1,F=null,M.pop(),M.length>0?(S=M[M.length-1],se===!0&&Pe.setGlobalState(C.clippingPlanes,S.state.camera)):S=null,I.pop(),I.length>0?x=I[I.length-1]:x=null};function _d(W,ie,pe,ue){if(W.visible===!1)return;if(W.layers.test(ie.layers)){if(W.isGroup)pe=W.renderOrder;else if(W.isLOD)W.autoUpdate===!0&&W.update(ie);else if(W.isLight)S.pushLight(W),W.castShadow&&S.pushShadow(W);else if(W.isSprite){if(!W.frustumCulled||re.intersectsSprite(W)){ue&&je.setFromMatrixPosition(W.matrixWorld).applyMatrix4(Ue);const $e=Ve.update(W),Fe=W.material;Fe.visible&&x.push(W,$e,Fe,pe,je.z,null)}}else if((W.isMesh||W.isLine||W.isPoints)&&(!W.frustumCulled||re.intersectsObject(W))){const $e=Ve.update(W),Fe=W.material;if(ue&&(W.boundingSphere!==void 0?(W.boundingSphere===null&&W.computeBoundingSphere(),je.copy(W.boundingSphere.center)):($e.boundingSphere===null&&$e.computeBoundingSphere(),je.copy($e.boundingSphere.center)),je.applyMatrix4(W.matrixWorld).applyMatrix4(Ue)),Array.isArray(Fe)){const Ze=$e.groups;for(let et=0,ht=Ze.length;et<ht;et++){const vt=Ze[et],nt=Fe[vt.materialIndex];nt&&nt.visible&&x.push(W,$e,nt,pe,je.z,vt)}}else Fe.visible&&x.push(W,$e,Fe,pe,je.z,null)}}const Le=W.children;for(let $e=0,Fe=Le.length;$e<Fe;$e++)_d(Le[$e],ie,pe,ue)}function ip(W,ie,pe,ue){const{opaque:le,transmissive:Le,transparent:$e}=W;S.setupLightsView(pe),se===!0&&Pe.setGlobalState(C.clippingPlanes,pe),ue&&ce.viewport(V.copy(ue)),le.length>0&&Ja(le,ie,pe),Le.length>0&&Ja(Le,ie,pe),$e.length>0&&Ja($e,ie,pe),ce.buffers.depth.setTest(!0),ce.buffers.depth.setMask(!0),ce.buffers.color.setMask(!0),ce.setPolygonOffset(!1)}function Za(W,ie,pe,ue){if((pe.isScene===!0?pe.overrideMaterial:null)!==null)return;if(S.state.transmissionRenderTarget[ue.id]===void 0){const nt=_e.has("EXT_color_buffer_half_float")||_e.has("EXT_color_buffer_float");S.state.transmissionRenderTarget[ue.id]=new Ps(1,1,{generateMipmaps:!0,type:nt?So:si,minFilter:yl,samples:Math.max(4,Ae.samples),stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Ft.workingColorSpace})}const Le=S.state.transmissionRenderTarget[ue.id],$e=ue.viewport||V;Le.setSize($e.z*C.transmissionResolutionScale,$e.w*C.transmissionResolutionScale);const Fe=C.getRenderTarget(),Ze=C.getActiveCubeFace(),et=C.getActiveMipmapLevel();C.setRenderTarget(Le),C.getClearColor(B),G=C.getClearAlpha(),G<1&&C.setClearColor(16777215,.5),C.clear(),Xe&&He.render(pe);const ht=C.toneMapping;C.toneMapping=Rs;const vt=ue.viewport;if(ue.viewport!==void 0&&(ue.viewport=void 0),S.setupLightsView(ue),se===!0&&Pe.setGlobalState(C.clippingPlanes,ue),Ja(W,pe,ue),J.updateMultisampleRenderTarget(Le),J.updateRenderTargetMipmap(Le),_e.has("WEBGL_multisampled_render_to_texture")===!1){let nt=!1;for(let Ht=0,pn=ie.length;Ht<pn;Ht++){const un=ie[Ht],{object:Gt,geometry:Ln,material:Je,group:Mn}=un;if(Je.side===no&&Gt.layers.test(ue.layers)){const yt=Je.side;Je.side=Qr,Je.needsUpdate=!0,tc(Gt,pe,ue,Ln,Je,Mn),Je.side=yt,Je.needsUpdate=!0,nt=!0}}nt===!0&&(J.updateMultisampleRenderTarget(Le),J.updateRenderTargetMipmap(Le))}C.setRenderTarget(Fe,Ze,et),C.setClearColor(B,G),vt!==void 0&&(ue.viewport=vt),C.toneMapping=ht}function Ja(W,ie,pe){const ue=ie.isScene===!0?ie.overrideMaterial:null;for(let le=0,Le=W.length;le<Le;le++){const $e=W[le],{object:Fe,geometry:Ze,group:et}=$e;let ht=$e.material;ht.allowOverride===!0&&ue!==null&&(ht=ue),Fe.layers.test(pe.layers)&&tc(Fe,ie,pe,Ze,ht,et)}}function tc(W,ie,pe,ue,le,Le){W.onBeforeRender(C,ie,pe,ue,le,Le),W.modelViewMatrix.multiplyMatrices(pe.matrixWorldInverse,W.matrixWorld),W.normalMatrix.getNormalMatrix(W.modelViewMatrix),le.onBeforeRender(C,ie,pe,ue,W,Le),le.transparent===!0&&le.side===no&&le.forceSinglePass===!1?(le.side=Qr,le.needsUpdate=!0,C.renderBufferDirect(pe,ie,ue,le,W,Le),le.side=Va,le.needsUpdate=!0,C.renderBufferDirect(pe,ie,ue,le,W,Le),le.side=no):C.renderBufferDirect(pe,ie,ue,le,W,Le),W.onAfterRender(C,ie,pe,ue,le,Le)}function $s(W,ie,pe){ie.isScene!==!0&&(ie=Ke);const ue=U.get(W),le=S.state.lights,Le=S.state.shadowsArray,$e=le.state.version,Fe=Ee.getParameters(W,le.state,Le,ie,pe),Ze=Ee.getProgramCacheKey(Fe);let et=ue.programs;ue.environment=W.isMeshStandardMaterial||W.isMeshLambertMaterial||W.isMeshPhongMaterial?ie.environment:null,ue.fog=ie.fog;const ht=W.isMeshStandardMaterial||W.isMeshLambertMaterial&&!W.envMap||W.isMeshPhongMaterial&&!W.envMap;ue.envMap=he.get(W.envMap||ue.environment,ht),ue.envMapRotation=ue.environment!==null&&W.envMap===null?ie.environmentRotation:W.envMapRotation,et===void 0&&(W.addEventListener("dispose",Dt),et=new Map,ue.programs=et);let vt=et.get(Ze);if(vt!==void 0){if(ue.currentProgram===vt&&ue.lightsStateVersion===$e)return xd(W,Fe),vt}else Fe.uniforms=Ee.getUniforms(W),W.onBeforeCompile(Fe,C),vt=Ee.acquireProgram(Fe,Ze),et.set(Ze,vt),ue.uniforms=Fe.uniforms;const nt=ue.uniforms;return(!W.isShaderMaterial&&!W.isRawShaderMaterial||W.clipping===!0)&&(nt.clippingPlanes=Pe.uniform),xd(W,Fe),ue.needsLights=wd(W),ue.lightsStateVersion=$e,ue.needsLights&&(nt.ambientLightColor.value=le.state.ambient,nt.lightProbe.value=le.state.probe,nt.directionalLights.value=le.state.directional,nt.directionalLightShadows.value=le.state.directionalShadow,nt.spotLights.value=le.state.spot,nt.spotLightShadows.value=le.state.spotShadow,nt.rectAreaLights.value=le.state.rectArea,nt.ltc_1.value=le.state.rectAreaLTC1,nt.ltc_2.value=le.state.rectAreaLTC2,nt.pointLights.value=le.state.point,nt.pointLightShadows.value=le.state.pointShadow,nt.hemisphereLights.value=le.state.hemi,nt.directionalShadowMatrix.value=le.state.directionalShadowMatrix,nt.spotLightMatrix.value=le.state.spotLightMatrix,nt.spotLightMap.value=le.state.spotLightMap,nt.pointShadowMatrix.value=le.state.pointShadowMatrix),ue.currentProgram=vt,ue.uniformsList=null,vt}function ki(W){if(W.uniformsList===null){const ie=W.currentProgram.getUniforms();W.uniformsList=og.seqWithValue(ie.seq,W.uniforms)}return W.uniformsList}function xd(W,ie){const pe=U.get(W);pe.outputColorSpace=ie.outputColorSpace,pe.batching=ie.batching,pe.batchingColor=ie.batchingColor,pe.instancing=ie.instancing,pe.instancingColor=ie.instancingColor,pe.instancingMorph=ie.instancingMorph,pe.skinning=ie.skinning,pe.morphTargets=ie.morphTargets,pe.morphNormals=ie.morphNormals,pe.morphColors=ie.morphColors,pe.morphTargetsCount=ie.morphTargetsCount,pe.numClippingPlanes=ie.numClippingPlanes,pe.numIntersection=ie.numClipIntersection,pe.vertexAlphas=ie.vertexAlphas,pe.vertexTangents=ie.vertexTangents,pe.toneMapping=ie.toneMapping}function sp(W,ie,pe,ue,le){ie.isScene!==!0&&(ie=Ke),J.resetTextureUnits();const Le=ie.fog,$e=ue.isMeshStandardMaterial||ue.isMeshLambertMaterial||ue.isMeshPhongMaterial?ie.environment:null,Fe=P===null?C.outputColorSpace:P.isXRRenderTarget===!0?P.texture.colorSpace:zu,Ze=ue.isMeshStandardMaterial||ue.isMeshLambertMaterial&&!ue.envMap||ue.isMeshPhongMaterial&&!ue.envMap,et=he.get(ue.envMap||$e,Ze),ht=ue.vertexColors===!0&&!!pe.attributes.color&&pe.attributes.color.itemSize===4,vt=!!pe.attributes.tangent&&(!!ue.normalMap||ue.anisotropy>0),nt=!!pe.morphAttributes.position,Ht=!!pe.morphAttributes.normal,pn=!!pe.morphAttributes.color;let un=Rs;ue.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(un=C.toneMapping);const Gt=pe.morphAttributes.position||pe.morphAttributes.normal||pe.morphAttributes.color,Ln=Gt!==void 0?Gt.length:0,Je=U.get(ue),Mn=S.state.lights;if(se===!0&&(ye===!0||W!==F)){const In=W===F&&ue.id===D;Pe.setState(ue,W,In)}let yt=!1;ue.version===Je.__version?(Je.needsLights&&Je.lightsStateVersion!==Mn.state.version||Je.outputColorSpace!==Fe||le.isBatchedMesh&&Je.batching===!1||!le.isBatchedMesh&&Je.batching===!0||le.isBatchedMesh&&Je.batchingColor===!0&&le.colorTexture===null||le.isBatchedMesh&&Je.batchingColor===!1&&le.colorTexture!==null||le.isInstancedMesh&&Je.instancing===!1||!le.isInstancedMesh&&Je.instancing===!0||le.isSkinnedMesh&&Je.skinning===!1||!le.isSkinnedMesh&&Je.skinning===!0||le.isInstancedMesh&&Je.instancingColor===!0&&le.instanceColor===null||le.isInstancedMesh&&Je.instancingColor===!1&&le.instanceColor!==null||le.isInstancedMesh&&Je.instancingMorph===!0&&le.morphTexture===null||le.isInstancedMesh&&Je.instancingMorph===!1&&le.morphTexture!==null||Je.envMap!==et||ue.fog===!0&&Je.fog!==Le||Je.numClippingPlanes!==void 0&&(Je.numClippingPlanes!==Pe.numPlanes||Je.numIntersection!==Pe.numIntersection)||Je.vertexAlphas!==ht||Je.vertexTangents!==vt||Je.morphTargets!==nt||Je.morphNormals!==Ht||Je.morphColors!==pn||Je.toneMapping!==un||Je.morphTargetsCount!==Ln)&&(yt=!0):(yt=!0,Je.__version=ue.version);let sr=Je.currentProgram;yt===!0&&(sr=$s(ue,ie,le));let wr=!1,as=!1,jt=!1;const Bt=sr.getUniforms(),mn=Je.uniforms;if(ce.useProgram(sr.program)&&(wr=!0,as=!0,jt=!0),ue.id!==D&&(D=ue.id,as=!0),wr||F!==W){ce.buffers.depth.getReversed()&&W.reversedDepth!==!0&&(W._reversedDepth=!0,W.updateProjectionMatrix()),Bt.setValue(K,"projectionMatrix",W.projectionMatrix),Bt.setValue(K,"viewMatrix",W.matrixWorldInverse);const Li=Bt.map.cameraPosition;Li!==void 0&&Li.setValue(K,Ie.setFromMatrixPosition(W.matrixWorld)),Ae.logarithmicDepthBuffer&&Bt.setValue(K,"logDepthBufFC",2/(Math.log(W.far+1)/Math.LN2)),(ue.isMeshPhongMaterial||ue.isMeshToonMaterial||ue.isMeshLambertMaterial||ue.isMeshBasicMaterial||ue.isMeshStandardMaterial||ue.isShaderMaterial)&&Bt.setValue(K,"isOrthographic",W.isOrthographicCamera===!0),F!==W&&(F=W,as=!0,jt=!0)}if(Je.needsLights&&(Mn.state.directionalShadowMap.length>0&&Bt.setValue(K,"directionalShadowMap",Mn.state.directionalShadowMap,J),Mn.state.spotShadowMap.length>0&&Bt.setValue(K,"spotShadowMap",Mn.state.spotShadowMap,J),Mn.state.pointShadowMap.length>0&&Bt.setValue(K,"pointShadowMap",Mn.state.pointShadowMap,J)),le.isSkinnedMesh){Bt.setOptional(K,le,"bindMatrix"),Bt.setOptional(K,le,"bindMatrixInverse");const In=le.skeleton;In&&(In.boneTexture===null&&In.computeBoneTexture(),Bt.setValue(K,"boneTexture",In.boneTexture,J))}le.isBatchedMesh&&(Bt.setOptional(K,le,"batchingTexture"),Bt.setValue(K,"batchingTexture",le._matricesTexture,J),Bt.setOptional(K,le,"batchingIdTexture"),Bt.setValue(K,"batchingIdTexture",le._indirectTexture,J),Bt.setOptional(K,le,"batchingColorTexture"),le._colorsTexture!==null&&Bt.setValue(K,"batchingColorTexture",le._colorsTexture,J));const jr=pe.morphAttributes;if((jr.position!==void 0||jr.normal!==void 0||jr.color!==void 0)&&ze.update(le,pe,sr),(as||Je.receiveShadow!==le.receiveShadow)&&(Je.receiveShadow=le.receiveShadow,Bt.setValue(K,"receiveShadow",le.receiveShadow)),(ue.isMeshStandardMaterial||ue.isMeshLambertMaterial||ue.isMeshPhongMaterial)&&ue.envMap===null&&ie.environment!==null&&(mn.envMapIntensity.value=ie.environmentIntensity),mn.dfgLUT!==void 0&&(mn.dfgLUT.value=Zae()),as&&(Bt.setValue(K,"toneMappingExposure",C.toneMappingExposure),Je.needsLights&&bd(mn,jt),Le&&ue.fog===!0&&qe.refreshFogUniforms(mn,Le),qe.refreshMaterialUniforms(mn,ue,q,z,S.state.transmissionRenderTarget[W.id]),og.upload(K,ki(Je),mn,J)),ue.isShaderMaterial&&ue.uniformsNeedUpdate===!0&&(og.upload(K,ki(Je),mn,J),ue.uniformsNeedUpdate=!1),ue.isSpriteMaterial&&Bt.setValue(K,"center",le.center),Bt.setValue(K,"modelViewMatrix",le.modelViewMatrix),Bt.setValue(K,"normalMatrix",le.normalMatrix),Bt.setValue(K,"modelMatrix",le.matrixWorld),ue.isShaderMaterial||ue.isRawShaderMaterial){const In=ue.uniformsGroups;for(let Li=0,Io=In.length;Li<Io;Li++){const lp=In[Li];ke.update(lp,sr),ke.bind(lp,sr)}}return sr}function bd(W,ie){W.ambientLightColor.needsUpdate=ie,W.lightProbe.needsUpdate=ie,W.directionalLights.needsUpdate=ie,W.directionalLightShadows.needsUpdate=ie,W.pointLights.needsUpdate=ie,W.pointLightShadows.needsUpdate=ie,W.spotLights.needsUpdate=ie,W.spotLightShadows.needsUpdate=ie,W.rectAreaLights.needsUpdate=ie,W.hemisphereLights.needsUpdate=ie}function wd(W){return W.isMeshLambertMaterial||W.isMeshToonMaterial||W.isMeshPhongMaterial||W.isMeshStandardMaterial||W.isShadowMaterial||W.isShaderMaterial&&W.lights===!0}this.getActiveCubeFace=function(){return A},this.getActiveMipmapLevel=function(){return R},this.getRenderTarget=function(){return P},this.setRenderTargetTextures=function(W,ie,pe){const ue=U.get(W);ue.__autoAllocateDepthBuffer=W.resolveDepthBuffer===!1,ue.__autoAllocateDepthBuffer===!1&&(ue.__useRenderToTexture=!1),U.get(W.texture).__webglTexture=ie,U.get(W.depthTexture).__webglTexture=ue.__autoAllocateDepthBuffer?void 0:pe,ue.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(W,ie){const pe=U.get(W);pe.__webglFramebuffer=ie,pe.__useDefaultFramebuffer=ie===void 0};const op=K.createFramebuffer();this.setRenderTarget=function(W,ie=0,pe=0){P=W,A=ie,R=pe;let ue=null,le=!1,Le=!1;if(W){const Fe=U.get(W);if(Fe.__useDefaultFramebuffer!==void 0){ce.bindFramebuffer(K.FRAMEBUFFER,Fe.__webglFramebuffer),V.copy(W.viewport),H.copy(W.scissor),$=W.scissorTest,ce.viewport(V),ce.scissor(H),ce.setScissorTest($),D=-1;return}else if(Fe.__webglFramebuffer===void 0)J.setupRenderTarget(W);else if(Fe.__hasExternalTextures)J.rebindTextures(W,U.get(W.texture).__webglTexture,U.get(W.depthTexture).__webglTexture);else if(W.depthBuffer){const ht=W.depthTexture;if(Fe.__boundDepthTexture!==ht){if(ht!==null&&U.has(ht)&&(W.width!==ht.image.width||W.height!==ht.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");J.setupDepthRenderbuffer(W)}}const Ze=W.texture;(Ze.isData3DTexture||Ze.isDataArrayTexture||Ze.isCompressedArrayTexture)&&(Le=!0);const et=U.get(W).__webglFramebuffer;W.isWebGLCubeRenderTarget?(Array.isArray(et[ie])?ue=et[ie][pe]:ue=et[ie],le=!0):W.samples>0&&J.useMultisampledRTT(W)===!1?ue=U.get(W).__webglMultisampledFramebuffer:Array.isArray(et)?ue=et[pe]:ue=et,V.copy(W.viewport),H.copy(W.scissor),$=W.scissorTest}else V.copy(j).multiplyScalar(q).floor(),H.copy(Q).multiplyScalar(q).floor(),$=Z;if(pe!==0&&(ue=op),ce.bindFramebuffer(K.FRAMEBUFFER,ue)&&ce.drawBuffers(W,ue),ce.viewport(V),ce.scissor(H),ce.setScissorTest($),le){const Fe=U.get(W.texture);K.framebufferTexture2D(K.FRAMEBUFFER,K.COLOR_ATTACHMENT0,K.TEXTURE_CUBE_MAP_POSITIVE_X+ie,Fe.__webglTexture,pe)}else if(Le){const Fe=ie;for(let Ze=0;Ze<W.textures.length;Ze++){const et=U.get(W.textures[Ze]);K.framebufferTextureLayer(K.FRAMEBUFFER,K.COLOR_ATTACHMENT0+Ze,et.__webglTexture,pe,Fe)}}else if(W!==null&&pe!==0){const Fe=U.get(W.texture);K.framebufferTexture2D(K.FRAMEBUFFER,K.COLOR_ATTACHMENT0,K.TEXTURE_2D,Fe.__webglTexture,pe)}D=-1},this.readRenderTargetPixels=function(W,ie,pe,ue,le,Le,$e,Fe=0){if(!(W&&W.isWebGLRenderTarget)){zt("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ze=U.get(W).__webglFramebuffer;if(W.isWebGLCubeRenderTarget&&$e!==void 0&&(Ze=Ze[$e]),Ze){ce.bindFramebuffer(K.FRAMEBUFFER,Ze);try{const et=W.textures[Fe],ht=et.format,vt=et.type;if(W.textures.length>1&&K.readBuffer(K.COLOR_ATTACHMENT0+Fe),!Ae.textureFormatReadable(ht)){zt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ae.textureTypeReadable(vt)){zt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ie>=0&&ie<=W.width-ue&&pe>=0&&pe<=W.height-le&&K.readPixels(ie,pe,ue,le,xe.convert(ht),xe.convert(vt),Le)}finally{const et=P!==null?U.get(P).__webglFramebuffer:null;ce.bindFramebuffer(K.FRAMEBUFFER,et)}}},this.readRenderTargetPixelsAsync=async function(W,ie,pe,ue,le,Le,$e,Fe=0){if(!(W&&W.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ze=U.get(W).__webglFramebuffer;if(W.isWebGLCubeRenderTarget&&$e!==void 0&&(Ze=Ze[$e]),Ze)if(ie>=0&&ie<=W.width-ue&&pe>=0&&pe<=W.height-le){ce.bindFramebuffer(K.FRAMEBUFFER,Ze);const et=W.textures[Fe],ht=et.format,vt=et.type;if(W.textures.length>1&&K.readBuffer(K.COLOR_ATTACHMENT0+Fe),!Ae.textureFormatReadable(ht))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ae.textureTypeReadable(vt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const nt=K.createBuffer();K.bindBuffer(K.PIXEL_PACK_BUFFER,nt),K.bufferData(K.PIXEL_PACK_BUFFER,Le.byteLength,K.STREAM_READ),K.readPixels(ie,pe,ue,le,xe.convert(ht),xe.convert(vt),0);const Ht=P!==null?U.get(P).__webglFramebuffer:null;ce.bindFramebuffer(K.FRAMEBUFFER,Ht);const pn=K.fenceSync(K.SYNC_GPU_COMMANDS_COMPLETE,0);return K.flush(),await Jte(K,pn,4),K.bindBuffer(K.PIXEL_PACK_BUFFER,nt),K.getBufferSubData(K.PIXEL_PACK_BUFFER,0,Le),K.deleteBuffer(nt),K.deleteSync(pn),Le}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(W,ie=null,pe=0){const ue=Math.pow(2,-pe),le=Math.floor(W.image.width*ue),Le=Math.floor(W.image.height*ue),$e=ie!==null?ie.x:0,Fe=ie!==null?ie.y:0;J.setTexture2D(W,0),K.copyTexSubImage2D(K.TEXTURE_2D,pe,0,0,$e,Fe,le,Le),ce.unbindTexture()};const ap=K.createFramebuffer(),Jy=K.createFramebuffer();this.copyTextureToTexture=function(W,ie,pe=null,ue=null,le=0,Le=0){let $e,Fe,Ze,et,ht,vt,nt,Ht,pn;const un=W.isCompressedTexture?W.mipmaps[Le]:W.image;if(pe!==null)$e=pe.max.x-pe.min.x,Fe=pe.max.y-pe.min.y,Ze=pe.isBox3?pe.max.z-pe.min.z:1,et=pe.min.x,ht=pe.min.y,vt=pe.isBox3?pe.min.z:0;else{const mn=Math.pow(2,-le);$e=Math.floor(un.width*mn),Fe=Math.floor(un.height*mn),W.isDataArrayTexture?Ze=un.depth:W.isData3DTexture?Ze=Math.floor(un.depth*mn):Ze=1,et=0,ht=0,vt=0}ue!==null?(nt=ue.x,Ht=ue.y,pn=ue.z):(nt=0,Ht=0,pn=0);const Gt=xe.convert(ie.format),Ln=xe.convert(ie.type);let Je;ie.isData3DTexture?(J.setTexture3D(ie,0),Je=K.TEXTURE_3D):ie.isDataArrayTexture||ie.isCompressedArrayTexture?(J.setTexture2DArray(ie,0),Je=K.TEXTURE_2D_ARRAY):(J.setTexture2D(ie,0),Je=K.TEXTURE_2D),K.pixelStorei(K.UNPACK_FLIP_Y_WEBGL,ie.flipY),K.pixelStorei(K.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ie.premultiplyAlpha),K.pixelStorei(K.UNPACK_ALIGNMENT,ie.unpackAlignment);const Mn=K.getParameter(K.UNPACK_ROW_LENGTH),yt=K.getParameter(K.UNPACK_IMAGE_HEIGHT),sr=K.getParameter(K.UNPACK_SKIP_PIXELS),wr=K.getParameter(K.UNPACK_SKIP_ROWS),as=K.getParameter(K.UNPACK_SKIP_IMAGES);K.pixelStorei(K.UNPACK_ROW_LENGTH,un.width),K.pixelStorei(K.UNPACK_IMAGE_HEIGHT,un.height),K.pixelStorei(K.UNPACK_SKIP_PIXELS,et),K.pixelStorei(K.UNPACK_SKIP_ROWS,ht),K.pixelStorei(K.UNPACK_SKIP_IMAGES,vt);const jt=W.isDataArrayTexture||W.isData3DTexture,Bt=ie.isDataArrayTexture||ie.isData3DTexture;if(W.isDepthTexture){const mn=U.get(W),jr=U.get(ie),In=U.get(mn.__renderTarget),Li=U.get(jr.__renderTarget);ce.bindFramebuffer(K.READ_FRAMEBUFFER,In.__webglFramebuffer),ce.bindFramebuffer(K.DRAW_FRAMEBUFFER,Li.__webglFramebuffer);for(let Io=0;Io<Ze;Io++)jt&&(K.framebufferTextureLayer(K.READ_FRAMEBUFFER,K.COLOR_ATTACHMENT0,U.get(W).__webglTexture,le,vt+Io),K.framebufferTextureLayer(K.DRAW_FRAMEBUFFER,K.COLOR_ATTACHMENT0,U.get(ie).__webglTexture,Le,pn+Io)),K.blitFramebuffer(et,ht,$e,Fe,nt,Ht,$e,Fe,K.DEPTH_BUFFER_BIT,K.NEAREST);ce.bindFramebuffer(K.READ_FRAMEBUFFER,null),ce.bindFramebuffer(K.DRAW_FRAMEBUFFER,null)}else if(le!==0||W.isRenderTargetTexture||U.has(W)){const mn=U.get(W),jr=U.get(ie);ce.bindFramebuffer(K.READ_FRAMEBUFFER,ap),ce.bindFramebuffer(K.DRAW_FRAMEBUFFER,Jy);for(let In=0;In<Ze;In++)jt?K.framebufferTextureLayer(K.READ_FRAMEBUFFER,K.COLOR_ATTACHMENT0,mn.__webglTexture,le,vt+In):K.framebufferTexture2D(K.READ_FRAMEBUFFER,K.COLOR_ATTACHMENT0,K.TEXTURE_2D,mn.__webglTexture,le),Bt?K.framebufferTextureLayer(K.DRAW_FRAMEBUFFER,K.COLOR_ATTACHMENT0,jr.__webglTexture,Le,pn+In):K.framebufferTexture2D(K.DRAW_FRAMEBUFFER,K.COLOR_ATTACHMENT0,K.TEXTURE_2D,jr.__webglTexture,Le),le!==0?K.blitFramebuffer(et,ht,$e,Fe,nt,Ht,$e,Fe,K.COLOR_BUFFER_BIT,K.NEAREST):Bt?K.copyTexSubImage3D(Je,Le,nt,Ht,pn+In,et,ht,$e,Fe):K.copyTexSubImage2D(Je,Le,nt,Ht,et,ht,$e,Fe);ce.bindFramebuffer(K.READ_FRAMEBUFFER,null),ce.bindFramebuffer(K.DRAW_FRAMEBUFFER,null)}else Bt?W.isDataTexture||W.isData3DTexture?K.texSubImage3D(Je,Le,nt,Ht,pn,$e,Fe,Ze,Gt,Ln,un.data):ie.isCompressedArrayTexture?K.compressedTexSubImage3D(Je,Le,nt,Ht,pn,$e,Fe,Ze,Gt,un.data):K.texSubImage3D(Je,Le,nt,Ht,pn,$e,Fe,Ze,Gt,Ln,un):W.isDataTexture?K.texSubImage2D(K.TEXTURE_2D,Le,nt,Ht,$e,Fe,Gt,Ln,un.data):W.isCompressedTexture?K.compressedTexSubImage2D(K.TEXTURE_2D,Le,nt,Ht,un.width,un.height,Gt,un.data):K.texSubImage2D(K.TEXTURE_2D,Le,nt,Ht,$e,Fe,Gt,Ln,un);K.pixelStorei(K.UNPACK_ROW_LENGTH,Mn),K.pixelStorei(K.UNPACK_IMAGE_HEIGHT,yt),K.pixelStorei(K.UNPACK_SKIP_PIXELS,sr),K.pixelStorei(K.UNPACK_SKIP_ROWS,wr),K.pixelStorei(K.UNPACK_SKIP_IMAGES,as),Le===0&&ie.generateMipmaps&&K.generateMipmap(Je),ce.unbindTexture()},this.initRenderTarget=function(W){U.get(W).__webglFramebuffer===void 0&&J.setupRenderTarget(W)},this.initTexture=function(W){W.isCubeTexture?J.setTextureCube(W,0):W.isData3DTexture?J.setTexture3D(W,0):W.isDataArrayTexture||W.isCompressedArrayTexture?J.setTexture2DArray(W,0):J.setTexture2D(W,0),ce.unbindTexture()},this.resetState=function(){A=0,R=0,P=null,ce.reset(),Se.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return ws}get outputColorSpace(){return this._outputColorSpace}
vendor: 18,000 bytes, line 8235
8235set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=Ft._getDrawingBufferColorSpace(e),n.unpackColorSpace=Ft._getUnpackColorSpace()}}const GP={type:"change"},FS={type:"start"},jU={type:"end"},Sm=new DS,$P=new Ko,ele=Math.cos(70*vne.DEG2RAD),Fn=new oe,Br=2*Math.PI,Qt={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},W0=1e-6;class tle extends sre{constructor(e,n=null){super(e,n),this.state=Qt.NONE,this.target=new oe,this.cursor=new oe,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:su.ROTATE,MIDDLE:su.DOLLY,RIGHT:su.PAN},this.touches={ONE:$c.ROTATE,TWO:$c.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle="auto",this._domElementKeyEvents=null,this._lastPosition=new oe,this._lastQuaternion=new za,this._lastTargetPosition=new oe,this._quat=new za().setFromUnitVectors(e.up,new oe(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new _P,this._sphericalDelta=new _P,this._scale=1,this._panOffset=new oe,this._rotateStart=new _t,this._rotateEnd=new _t,this._rotateDelta=new _t,this._panStart=new _t,this._panEnd=new _t,this._panDelta=new _t,this._dollyStart=new _t,this._dollyEnd=new _t,this._dollyDelta=new _t,this._dollyDirection=new oe,this._mouse=new _t,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=rle.bind(this),this._onPointerDown=nle.bind(this),this._onPointerUp=ile.bind(this),this._onContextMenu=dle.bind(this),this._onMouseWheel=ale.bind(this),this._onKeyDown=lle.bind(this),this._onTouchStart=cle.bind(this),this._onTouchMove=ule.bind(this),this._onMouseDown=sle.bind(this),this._onMouseMove=ole.bind(this),this._interceptControlDown=fle.bind(this),this._interceptControlUp=hle.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(e){this._cursorStyle=e,e==="grab"?this.domElement.style.cursor="grab":this.domElement.style.cursor="auto"}get cursorStyle(){return this._cursorStyle}connect(e){super.connect(e),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(GP),this.update(),this.state=Qt.NONE}pan(e,n){this._pan(e,n),this.update()}dollyIn(e){this._dollyIn(e),this.update()}dollyOut(e){this._dollyOut(e),this.update()}rotateLeft(e){this._rotateLeft(e),this.update()}rotateUp(e){this._rotateUp(e),this.update()}update(e=null){const n=this.object.position;Fn.copy(n).sub(this.target),Fn.applyQuaternion(this._quat),this._spherical.setFromVector3(Fn),this.autoRotate&&this.state===Qt.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let r=this.minAzimuthAngle,i=this.maxAzimuthAngle;isFinite(r)&&isFinite(i)&&(r<-Math.PI?r+=Br:r>Math.PI&&(r-=Br),i<-Math.PI?i+=Br:i>Math.PI&&(i-=Br),r<=i?this._spherical.theta=Math.max(r,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(r+i)/2?Math.max(r,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let s=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const o=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),s=o!=this._spherical.radius}if(Fn.setFromSpherical(this._spherical),Fn.applyQuaternion(this._quatInverse),n.copy(this.target).add(Fn),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let o=null;if(this.object.isPerspectiveCamera){const a=Fn.length();o=this._clampDistance(a*this._scale);const l=a-o;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),s=!!l}else if(this.object.isOrthographicCamera){const a=new oe(this._mouse.x,this._mouse.y,0);a.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),s=l!==this.object.zoom;const c=new oe(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(a),this.object.updateMatrixWorld(),o=Fn.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;o!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position):(Sm.origin.copy(this.object.position),Sm.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Sm.direction))<ele?this.object.lookAt(this.target):($P.setFromNormalAndCoplanarPoint(this.object.up,this.target),Sm.intersectPlane($P,this.target))))}else if(this.object.isOrthographicCamera){const o=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),o!==this.object.zoom&&(this.object.updateProjectionMatrix(),s=!0)}return this._scale=1,this._performCursorZoom=!1,s||this._lastPosition.distanceToSquared(this.object.position)>W0||8*(1-this._lastQuaternion.dot(this.object.quaternion))>W0||this._lastTargetPosition.distanceToSquared(this.target)>W0?(this.dispatchEvent(GP),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?Br/60*this.autoRotateSpeed*e:Br/60/60*this.autoRotateSpeed}_getZoomScale(e){const n=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,n){Fn.setFromMatrixColumn(n,0),Fn.multiplyScalar(-e),this._panOffset.add(Fn)}_panUp(e,n){this.screenSpacePanning===!0?Fn.setFromMatrixColumn(n,1):(Fn.setFromMatrixColumn(n,0),Fn.crossVectors(this.object.up,Fn)),Fn.multiplyScalar(e),this._panOffset.add(Fn)}_pan(e,n){const r=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;Fn.copy(i).sub(this.target);let s=Fn.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*s/r.clientHeight,this.object.matrix),this._panUp(2*n*s/r.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/r.clientWidth,this.object.matrix),this._panUp(n*(this.object.top-this.object.bottom)/this.object.zoom/r.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const r=this.domElement.getBoundingClientRect(),i=e-r.left,s=n-r.top,o=r.width,a=r.height;this._mouse.x=i/o*2-1,this._mouse.y=-(s/a)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(Br*this._rotateDelta.x/n.clientHeight),this._rotateUp(Br*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let n=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(Br*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),n=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-Br*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),n=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(Br*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),n=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-Br*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),n=!0;break}n&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._rotateStart.set(r,i)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._panStart.set(r,i)}}_handleTouchStartDolly(e){const n=this._getSecondPointerPosition(e),r=e.pageX-n.x,i=e.pageY-n.y,s=Math.sqrt(r*r+i*i);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const r=this._getSecondPointerPosition(e),i=.5*(e.pageX+r.x),s=.5*(e.pageY+r.y);this._rotateEnd.set(i,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(Br*this._rotateDelta.x/n.clientHeight),this._rotateUp(Br*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._panEnd.set(r,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const n=this._getSecondPointerPosition(e),r=e.pageX-n.x,i=e.pageY-n.y,s=Math.sqrt(r*r+i*i);this._dollyEnd.set(0,s),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const o=(e.pageX+n.x)*.5,a=(e.pageY+n.y)*.5;this._updateZoomParameters(o,a)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let n=0;n<this._pointers.length;n++)if(this._pointers[n]==e.pointerId){this._pointers.splice(n,1);return}}_isTrackingPointer(e){for(let n=0;n<this._pointers.length;n++)if(this._pointers[n]==e.pointerId)return!0;return!1}_trackPointer(e){let n=this._pointerPositions[e.pointerId];n===void 0&&(n=new _t,this._pointerPositions[e.pointerId]=n),n.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const n=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[n]}_customWheelEvent(e){const n=e.deltaMode,r={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(n){case 1:r.deltaY*=16;break;case 2:r.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(r.deltaY*=10),r}}function nle(t){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(t.pointerId),this.domElement.ownerDocument.addEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(t)&&(this._addPointer(t),t.pointerType==="touch"?this._onTouchStart(t):this._onMouseDown(t),this._cursorStyle==="grab"&&(this.domElement.style.cursor="grabbing")))}function rle(t){this.enabled!==!1&&(t.pointerType==="touch"?this._onTouchMove(t):this._onMouseMove(t))}function ile(t){switch(this._removePointer(t),this._pointers.length){case 0:this.domElement.releasePointerCapture(t.pointerId),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(jU),this.state=Qt.NONE,this._cursorStyle==="grab"&&(this.domElement.style.cursor="grab");break;case 1:const e=this._pointers[0],n=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:n.x,pageY:n.y});break}}function sle(t){let e;switch(t.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case su.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(t),this.state=Qt.DOLLY;break;case su.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(t),this.state=Qt.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(t),this.state=Qt.ROTATE}break;case su.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(t),this.state=Qt.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(t),this.state=Qt.PAN}break;default:this.state=Qt.NONE}this.state!==Qt.NONE&&this.dispatchEvent(FS)}function ole(t){switch(this.state){case Qt.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(t);break;case Qt.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(t);break;case Qt.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(t);break}}
8235function ale(t){this.enabled===!1||this.enableZoom===!1||this.state!==Qt.NONE||(t.preventDefault(),this.dispatchEvent(FS),this._handleMouseWheel(this._customWheelEvent(t)),this.dispatchEvent(jU))}function lle(t){this.enabled!==!1&&this._handleKeyDown(t)}function cle(t){switch(this._trackPointer(t),this._pointers.length){case 1:switch(this.touches.ONE){case $c.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(t),this.state=Qt.TOUCH_ROTATE;break;case $c.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(t),this.state=Qt.TOUCH_PAN;break;default:this.state=Qt.NONE}break;case 2:switch(this.touches.TWO){case $c.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(t),this.state=Qt.TOUCH_DOLLY_PAN;break;case $c.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(t),this.state=Qt.TOUCH_DOLLY_ROTATE;break;default:this.state=Qt.NONE}break;default:this.state=Qt.NONE}this.state!==Qt.NONE&&this.dispatchEvent(FS)}function ule(t){switch(this._trackPointer(t),this.state){case Qt.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(t),this.update();break;case Qt.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(t),this.update();break;case Qt.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(t),this.update();break;case Qt.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(t),this.update();break;default:this.state=Qt.NONE}}function dle(t){this.enabled!==!1&&t.preventDefault()}function fle(t){t.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function hle(t){t.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}let Tm=null;async function ple(){return Tm||(Tm=new Promise((t,e)=>{if(window.occtimportjs){window.occtimportjs().then(t).catch(e);return}const n=document.createElement("script");n.src="https://cdn.jsdelivr.net/npm/[email protected]/dist/occt-import-js.js",n.async=!0,n.onload=()=>{if(!window.occtimportjs){e(new Error("occtimportjs global bulunamadi"));return}window.occtimportjs().then(t).catch(e)},n.onerror=()=>e(new Error("occt-import-js script yuklenemedi")),document.head.appendChild(n)}),Tm)}const mle=({fileUrl:t,className:e})=>{const n=O.useRef(null),[r,i]=O.useState("");return O.useEffect(()=>{if(!n.current)return;const s=n.current;let o=!1,a;try{a=new Jae({antialias:!0,alpha:!1,powerPreference:"low-power"})}catch{i("Bu cihazda WebGL desteklenmiyor");return}a.setPixelRatio(Math.min(window.devicePixelRatio,2)),s.appendChild(a.domElement);const l=new Ine;l.background=new Pt("#f8fafc");const c=new Si(45,1,.1,5e3);c.position.set(120,100,120);const d=new tle(c,a.domElement);d.enableDamping=!0,d.autoRotate=!0,d.autoRotateSpeed=3,d.target.set(0,0,0);const f=new Zne(16777215,9741240,1.1);l.add(f);const u=new tre(16777215,.9);u.position.set(80,120,60),l.add(u);const h=new ire(240,16,"#cbd5e1","#e2e8f0");h.material.opacity=.5,h.material.transparent=!0,l.add(h);const g=()=>{const y=s.clientWidth||400,w=s.clientHeight||400;a.setSize(y,w),c.aspect=y/w,c.updateProjectionMatrix()};g(),window.addEventListener("resize",g);const v=y=>{const w=new cd().setFromObject(y);if(w.isEmpty())return;const x=w.getSize(new oe),S=w.getCenter(new oe),M=(Math.max(x.x,x.y,x.z)||1)*1.6;c.position.set(S.x+M,S.y+M*.8,S.z+M),d.target.copy(S),d.update(),c.near=Math.max(.1,M/200),c.far=M*20,c.updateProjectionMatrix()};(async()=>{try{const w=await(await fetch(t)).arrayBuffer();if(o)return;const S=(await ple()).ReadStepFile(new Uint8Array(w),null);if(o)return;const I=new uf;(S.meshes||[]).forEach(M=>{var R,P,D,F;const E=new Di;E.setAttribute("position",new Nr(M.attributes.position.array,3)),(P=(R=M.attributes.normal)==null?void 0:R.array)!=null&&P.length?E.setAttribute("normal",new Nr(M.attributes.normal.array,3)):E.computeVertexNormals(),(F=(D=M.index)==null?void 0:D.array)!=null&&F.length&&E.setIndex(M.index.array);const C=M.color?new Pt(M.color[0],M.color[1],M.color[2]):new Pt("#64748b"),T=new Xne({color:C,metalness:.2,roughness:.65}),A=new js(E,T);I.add(A)}),l.add(I),v(I)}catch(y){console.error(y),i("STEP modeli bu tarayicida acilamadi")}})();const p=()=>{o||(d.update(),a.render(l,c),requestAnimationFrame(p))};return p(),()=>{o=!0,window.removeEventListener("resize",g),d.dispose(),a.dispose(),l.traverse(y=>{const w=y;w.geometry&&w.geometry.dispose(),Array.isArray(w.material)?w.material.forEach(x=>x.dispose()):w.material&&w.material.dispose()}),s.removeChild(a.domElement)}},[t]),_.jsxs("div",{className:e,children:[_.jsx("div",{ref:n,className:"h-full w-full"}),r?_.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2 bg-muted/70 p-4 text-center",children:[_.jsx("p",{className:"text-sm text-foreground",children:r}),_.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"text-xs text-primary underline underline-offset-2",children:"STEP dosyasini indir"})]}):null]})},gle=()=>{const{t}=ss(),e=[{icon:gD,title:t("services.parametric"),description:"Advanced parametric design solutions for c
8235omplex engineering challenges."},{icon:xD,title:t("services.optimization"),description:"Optimize your designs for performance, cost, and manufacturability."},{icon:D8,title:t("services.fea"),description:"Comprehensive finite element analysis for structural integrity."},{icon:_D,title:"Precision Engineering",description:"Delivering precise and reliable engineering solutions."}];return _.jsxs("div",{className:"min-h-screen",children:[_.jsx("section",{className:"relative bg-gradient-to-br from-primary/10 via-background to-secondary/10 py-14 px-4 sm:py-20 sm:px-6 lg:px-8",children:_.jsx("div",{className:"max-w-7xl mx-auto",children:_.jsxs("div",{className:"text-center",children:[_.jsx("h1",{className:"text-3xl sm:text-4xl md:text-6xl font-bold text-foreground mb-5 sm:mb-6",children:t("home.hero.title")}),_.jsx("p",{className:"text-base sm:text-xl text-muted-foreground mb-8 max-w-3xl mx-auto",children:t("home.hero.subtitle")}),_.jsx(kn,{to:"/services",children:_.jsxs(rt,{size:"lg",className:"group w-full sm:w-auto",onClick:()=>void xt("public_home_cta_click",{target:"services"}),children:[t("home.hero.cta"),_.jsx(y8,{className:"ml-2 h-4 w-4 group-hover:translate-x-1 transition-transform"})]})})]})})}),_.jsx("section",{className:"py-14 px-4 sm:py-20 sm:px-6 lg:px-8",children:_.jsxs("div",{className:"max-w-7xl mx-auto",children:[_.jsxs("div",{className:"text-center mb-16",children:[_.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold text-foreground mb-4",children:"Why Choose Phimec?"}),_.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"We combine cutting-edge technology with engineering expertise to deliver exceptional results."})]}),_.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-
82355 sm:gap-8",children:e.map((n,r)=>_.jsx(on,{className:"group hover:shadow-lg transition-all duration-300 border-border bg-card",children:_.jsxs(an,{className:"p-6 text-center",children:[_.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center mx-auto mb-4 group-hover:bg-primary/20 transition-colors",children:_.jsx(n.icon,{className:"h-6 w-6 text-primary"})}),_.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:n.title}),_.jsx("p",{className:"text-muted-foreground text-sm",children:n.description})]})},r))})]})}),_.jsx("section",{className:"py-14 px-4 sm:py-20 sm:px-6 lg:px-8 bg-secondary/5",children:_.jsx("div",{className:"max-w-7xl mx-auto",children:_.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 sm:gap-10 lg:gap-12 items-center",children:[_.jsxs("div",{className:"order-2 lg:order-1",children:[_.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold text-foreground mb-6",children:t("home.about.title")}),_.jsx("p",{className:"text-base sm:text-lg text-muted-foreground mb-8",children:t("home.about.description")}),_.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[_.jsxs("div",{className:"flex items-center text-base sm:text-lg",children:[_.jsx("div",{className:"w-2 h-2 bg-primary rounded-full mr-3"}),_.jsx("span",{className:"text-foreground",children:"15+ Years of Experience"})]}),_.jsxs("div",{className:"flex items-center text-base sm:text-lg",children:[_.jsx("div",{className:"w-2 h-2 bg-primary rounded-full mr-3"}),_.jsx("span",{className:"text-foreground",children:"100+ Successful Projects"})]}),_.jsxs("div",{className:"flex items-center text-base sm:text-lg",children:[_.jsx("div",{className:"w-2 h-2 bg-primary rounded-full mr-3"}),_.jsx("span",{className:"text-foreground",children:"Global Client Base"})]})]}),_.jsx(kn,{to:"/contact",className:"inline-block mt-6 sm:mt-8 w-full sm:w-auto",children:_.jsx(rt,{variant:"outline",className:"w-full sm:w-auto sm:min-w-[180px]",onClick:()=>void xt("public_home_about_contact_click"),children:t("nav.contact")})})]}),_.jsx("div",{className:"order-1 lg:order-2 relative w-full max-w-sm sm:max-w-md mx-auto lg:max-w-none",children:_.jsx("div",{className:"h-[150px] min-[420px]:h-[180px] sm:h-[260px] md:h-[320px] lg:h-[440px] overflow-hidden rounded-xl sm:rounded-2xl border border-border bg-gradient-to-br from-primary/10 to-secondary/10",children:_.jsx(mle,{fileUrl:"/RadyatorMontaj.stp",className:"relative h-full w-full"})})})]})})}),_.jsx("section",{className:"py-14 px-4 sm:py-20 sm:px-6 lg:px-8",children:_.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[_.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold text-foreground mb-6",children:"Ready to Start Your Project?"}),_.jsx("p",{className:"text-base sm:text-lg text-muted-foreground mb-8",children:"Let's discuss how we can help bring your engineering vision to life."}),_.jsx("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:_.jsx(kn,{to:"/contact",children:_.jsx(rt,{size:"lg",className:"w-full sm:w-auto",onClick:()=>void xt("public_home_bottom_cta_click",{target:"contact"}),children:"Get Started Today"})})})]})})]})},vle=ny("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Dr({className:t,variant:e,...n}){return _.jsx("div",{className:Mt(vle({variant:e}),t),...n})}const US={Box:jg,Cog:gD,Calculator:Bg,Library:R8,Zap:xD,Building:x8,Target:_D},yle=Object.keys(US);function _le(t){return US[t]??jg}function WP(t,e){const n=(e||"en").split("-")[0],r=t[n];return r!=null&&r.trim()?r:t.en||t.tr||t.ar||""}const xle=()=>{const{t,language:e}=ss(),[n,r]=O.useState([]),[i,s]=O.useState(!0);return O.useEffect(()=>{const o=Oi(Vn(Et,"services"),a=>{const l=a.docs.map(c=>({id:c.id,...c.data()})).filter(c=>c.enabled!==!1).sort((c,d)=>(c.order??999)-(d.order??999));r(l),s(!1)},()=>s(!1));return()=>o()},[]),i?_.jsx("div",{className:"min-h-screen flex items-center justify-center py-20",children:_.jsx(ad,{})}):_.jsx("div",{className:"min-h-screen py-20 px-4 sm:px-6 lg:px-8",children:_.jsxs("div",{className:"max-w-7xl mx-auto",children:[_.jsxs("div",{className:"text-center mb-16",children:[_.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-foreground mb-6",children:t("services.title")}),_.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"Comprehensive engineering design services tailored to meet your specific needs and challenges."})]}),n.length===0?_.jsx("p",{className:"text-center text-muted-foreground py-12",children:"No services are published yet."}):_.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:n.map(o=>{const a=_le(o.icon),l=WP(o.title,e),c=WP(o.description,e);return _.jsxs(on,{className:"group hover:shadow-lg transition-all duration-300 border-border bg-card",children:[_.jsxs(wi,{children:[_.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center mb-4 group-hover:bg-primary/20 transition-colors",children:_.jsx(a,{className:"h-6 w-6 text-primary"})}),_.jsx(Ei,{className:"text-foreground",children:l})]}),_.jsxs(an,{children:[_.jsx("p",{className:"text-muted-foreground mb-4",children:c}),_.jsx("div",{className:"flex flex-wrap gap-2",children:(o.features??[]).map((d,f)=>_.jsx(Dr,{variant:"secondary",className:"text-xs",children:d},f))})]})]},o.id)})}),_.jsx("div",{className:"mt-16 text-center",children:_.jsxs("div",{className:"bg-secondary/5 rounded-2xl p-8",children:[_.jsx("h2",{className:"text-2xl font-bold text-foreground mb-4",children:"Need a Custom Solution?"}),_.jsx("p",{className:"text-muted-foreground mb-6",children:"Our team can develop tailored engineering solutions for your unique requirements."}),_.jsx(rt,{asChild:!0,children:_.jsx(kn,{to:"/contact",onClick:()=>void xt("public_services_cta_click",{target:"contact"}),children:"Get in Touch"})})]})})]})})};function q0(t,e){const n=(e||"en").split("-")[0];return t[n]||t.en||t.tr||t.ar||""}const ble=()=>{const{t,language:e}=ss(),[n,r]=O.useState([]),[i,s]=O.useState(!0);return O.useEffect(()=>{const o=Oi(Vn(Et,"projects"),a=>{const l=a.docs.map(c=>({id:c.id,...c.data()})).filter(c=>c.enabled!==!1);r(l),s(!1)},()=>s(!1));return()=>o()},[]),_.jsx("div",{className:"min-h-screen py-20 px-4 sm:px-6 lg:px-8",children:_.jsxs("div",{className:"max-w-7xl mx-auto",children:[_.jsxs("div",{className:"text-center mb-16",children:[_.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-foreground mb-6",children:t("nav.projects")}),_.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"Explore our portfolio of successful engineering projects across various industries and disciplines."})]}),i?_.jsx("div",{className:"py-20",children:_.jsx(ad,{})}):n.length===0?_.jsxs("div",{className:"text-center py-16",children:[_.jsx("div",{className:"w-24 h-24 bg-secondary/20 rounded-full flex items-center justify-center mx-auto mb-6",children:_.jsx("svg",{className:"w-12 h-12 text-muted-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:_.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})})}),_.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"No Projects Yet"}),_.jsx("p",{className:"text-muted-foreground",children:"Projects will be displayed here once added by the admin."})]}):_.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:n.map(o=>_.jsx(kn,{to:`/projects/${o.id}`,className:"block",onClick:()=>void xt("public_project_card_click",{project_id:o.id,status:o.status}),children:_.jsxs(on,{className:"group hover:shadow-lg transition-all duration-300 border-border bg-card overflow-hidden hover:border-primary/40",children:[_.jsx("div",{className:"aspect-video bg-secondary/10 overflow-hidden",children:_.jsx("img",{src:o.image,alt:q0(o.title,e),className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"})}),_.jsxs(an,{className:"p-6",children:[_.jsx("div",{className:"flex items-center justify-between mb-2",children:_.jsx(Dr,{variant:o.status==="Completed"?"default":"secondary",className:"text-xs",children:o.status})}),_.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:q0(o.title,e)}),_.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:q0(o.description,e)}),_.jsx("div",{className:"flex flex-wrap gap-2",children:o.tags.map((a,l)=>_.jsx(Dr,{variant:"outline",className:"text-xs",children:a},l))})]})]})},o.id))})]})})},wle=()=>{const{id:t}=Vw(),{t:e,language:n}=ss(),[r,i]=O.useState(null),[s,o]=O.useState(!0),a=l=>{const c=(n||"en").split("-")[0];return l[c]||l.en||l.tr||l.ar||""};return O.useEffect(()=>{if(!t)return;const l=Oi(_n(Et,"projects",t),c=>{if(!c.exists()){i(null),o(!1);return}const d={id:c.id,...c.data()};i(d.enabled===!1?null:d),d.enabled!==!1&&xt("public_project_detail_view",{project_id:d.id,status:d.status}),o(!1)},()=>o(!1));return()=>l()},[t]),s?_.jsx("div",{className:"min-h-screen py-20",children:_.jsx(ad,{})}):r?_.jsx("div",{className:"min-h-screen py-20 px-4 sm:px-6 lg:px-8",children:_.jsxs("article",{className:"max-w-4xl mx-auto",children:[_.jsxs(kn,{to:"/projects",className:"text-sm text-primary hover:underline",children:["<-"," ",e("nav.projects")]}),_.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-foreground mt-4 mb-4",children:a(r.title)}),_.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-6",children:[_.jsx(Dr,{variant:r.status==="Completed"?"default":"secondary",children:r.status}),(r.tags||[]).map((l,c)=>_.jsx(Dr,{variant:"outline",className:"text-xs",children:l},c))]}),_.jsx("div",{className:"mb-6 overflow-hidden rounded-lg border border-border",children:_.jsx("img",{src:r.image,alt:a(r.title),className:"w-full h-auto object-cover"})}
8235),_.jsx("p",{className:"text-foreground/90 leading-7",children:a(r.description)})]})}):_.jsx("div",{className:"min-h-screen py-20 px-4 sm:px-6 lg:px-8",children:_.jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[_.jsx("h1",{className:"text-3xl font-bold text-foreground mb-4",children:"Project not found"}),_.jsx("p",{className:"text-muted-foreground mb-8",children:"This project may be disabled or removed."}),_.jsx(kn,{to:"/projects",className:"text-primary hover:underline",children:e("nav.projects")})]})})},Ele="https://placehold.net/800x600.png",Sle=()=>{const{t,language:e}=ss(),[n,r]=O.useState([]),[i,s]=O.useState(!0),o=l=>{const c=(e||"en").split("-")[0];return l[c]||l.en||l.tr||l.ar||""},a=l=>l.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();return O.useEffect(()=>{const l=Oi(Vn(Et,"blogs"),c=>{const d=c.docs.map(f=>({id:f.id,...f.data()}));r(d.filter(f=>f.enabled!==!1&&f.status==="Published")),s(!1)});return()=>l()},[]),_.jsx("div",{className:"min-h-screen py-20 px-4 sm:px-6 lg:px-8",children:_.jsxs("div",{className:"max-w-7xl mx-auto",children:[_.jsxs("div",{className:"text-center mb-16",children:[_.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-foreground mb-6",children:t("nav.blog")}),_.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"Insights, tutorials, and updates from the world of engineering design and innovation."})]}),i?_.jsxs("div",{className:"text-center py-16",children:[_.jsx("div",{className:"w-24 h-24 bg-secondary/20 rounded-full flex items-center justify-center mx-auto mb-6",children:_.jsx("svg",{className:"w-12 h-12 text-muted-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:_.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"})})}),_.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"No Blog Posts Yet"}),_.jsx("p",{className:"text-muted-foreground",children:"Blog posts will be displayed here once published by the admin."})]}):n.length===0?_.jsxs("div",{className:"text-center text-muted-foreground py-16 text-lg font-medium",children:[_.jsx("div",{className:"w-24 h-24 bg-secondary/20 rounded-full flex items-center justify-center mx-auto mb-6",children:_.jsx("svg",{className:"w-12 h-12 text-muted-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:_.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"})})}),_.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"No Blog Posts Yet"}),_.jsx("p",{className:"text-muted-foreground",children:"Blog posts will be displayed here once published by the admin."})]}):_.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:n.map(l=>_.jsx(kn,{to:`/blog/${l.id}`,className:"block",onClick:()=>void xt("public_blog_card_click",{blog_id:l.id,status:l.status}),children:_.jsxs(on,{className:"group border border-muted bg-white dark:bg-card rounded-lg shadow-sm transition hover:shadow-md hover:border-primary/40",children:[_.jsx("div",{className:"aspect-video bg-secondary/10 overflow-hidden rounded-t-lg",children:_.jsx("img",{src:l.featuredImage||Ele,alt:o(l.title),className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"})}),_.jsxs(an,{className:"p-4",children:[_.jsxs("div",{className:"flex items-center justify-between mb-2",children:[_.jsx(Dr,{variant:l.status==="Published"?"default":"secondary",className:"text-xs",children:l.status}),_.jsx("div",{className:"flex flex-wrap gap-1",children:l.tags.map((c,d)=>_.jsx(Dr,{variant:"outline",className:"text-xs",children:c},d))})]}),_.jsx("h3",{className:"text-lg font-semibold mb-1",children:o(l.title)}),_.jsx("p",{className:"text-muted-foreground text-sm mb-2 line-clamp-3",children:a(o(l.content))}),_.jsx("div",{className:"text-xs text-muted-foreground mt-2",children:l.createdAt&&new Date(l.createdAt.seconds?l.createdAt.seconds*1e3:l.createdAt).toLocaleDateString()})]})]})},l.id))})]})})};function Tle(){this.__data__=[],this.size=0}var Ale=Tle;function Mle(t,e){return t===e||t!==t&&e!==e}var BU=Mle,Cle=BU;function Rle(t,e){for(var n=t.length;n--;)if(Cle(t[n][0],e))return n;return-1}var Wy=Rle,Ple=Wy,Ile=Array.prototype,Nle=Ile.splice;function Ole(t){var e=this.__data__,n=Ple(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():Nle.call(e,n,1),--this.size,!0}var Dle=Ole,kle=Wy;function Lle(t){var e=this.__data__,n=kle(e,t);return n<0?void 0:e[n][1]}var Fle=Lle,Ule=Wy;function jle(t){return Ule(this.__data__,t)>-1}
vendor: 113,011 bytes, lines 8235-8265
8235var Ble=jle,Vle=Wy;function zle(t,e){var n=this.__data__,r=Vle(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Hle=zle,Gle=Ale,$le=Dle,Wle=Fle,qle=Ble,Kle=Hle;function fd(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}fd.prototype.clear=Gle;fd.prototype.delete=$le;fd.prototype.get=Wle;fd.prototype.has=qle;fd.prototype.set=Kle;var qy=fd,Xle=qy;function Yle(){this.__data__=new Xle,this.size=0}var Qle=Yle;function Zle(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var Jle=Zle;function ece(t){return this.__data__.get(t)}var tce=ece;function nce(t){return this.__data__.has(t)}var rce=nce,ice=typeof oi=="object"&&oi&&oi.Object===Object&&oi,VU=ice,sce=VU,oce=typeof self=="object"&&self&&self.Object===Object&&self,ace=sce||oce||Function("return this")(),Ro=ace,lce=Ro,cce=lce.Symbol,jS=cce,qP=jS,zU=Object.prototype,uce=zU.hasOwnProperty,dce=zU.toString,Wd=qP?qP.toStringTag:void 0;function fce(t){var e=uce.call(t,Wd),n=t[Wd];try{t[Wd]=void 0;var r=!0}catch{}var i=dce.call(t);return r&&(e?t[Wd]=n:delete t[Wd]),i}var hce=fce,pce=Object.prototype,mce=pce.toString;function gce(t){return mce.call(t)}var vce=gce,KP=jS,yce=hce,_ce=vce,xce="[object Null]",bce="[object Undefined]",XP=KP?KP.toStringTag:void 0;function wce(t){return t==null?t===void 0?bce:xce:XP&&XP in Object(t)?yce(t):_ce(t)}var Ky=wce;function Ece(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var HU=Ece,Sce=Ky,Tce=HU,Ace="[object AsyncFunction]",Mce="[object Function]",Cce="[object GeneratorFunction]",Rce="[object Proxy]";function Pce(t){if(!Tce(t))return!1;var e=Sce(t);return e==Mce||e==Cce||e==Ace||e==Rce}var GU=Pce,Ice=Ro,Nce=Ice["__core-js_shared__"],Oce=Nce,K0=Oce,YP=function(){var t=/[^.]+$/.exec(K0&&K0.keys&&K0.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Dce(t){return!!YP&&YP in t}var kce=Dce,Lce=Function.prototype,Fce=Lce.toString;function Uce(t){if(t!=null){try{return Fce.call(t)}catch{}try{return t+""}catch{}}return""}var $U=Uce,jce=GU,Bce=kce,Vce=HU,zce=$U,Hce=/[\\^$.*+?()[\]{}|]/g,Gce=/^\[object .+?Constructor\]$/,$ce=Function.prototype,Wce=Object.prototype,qce=$ce.toString,Kce=Wce.hasOwnProperty,Xce=RegExp("^"+qce.call(Kce).replace(Hce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Yce(t){if(!Vce(t)||Bce(t))return!1;var e=jce(t)?Xce:Gce;return e.test(zce(t))}var Qce=Yce;function Zce(t,e){return t==null?void 0:t[e]}var Jce=Zce,eue=Qce,tue=Jce;function nue(t,e){var n=tue(t,e);return eue(n)?n:void 0}var hd=nue,rue=hd,iue=Ro,sue=rue(iue,"Map"),BS=sue,oue=hd,aue=oue(Object,"create"),Xy=aue,QP=Xy;function lue(){this.__data__=QP?QP(null):{},this.size=0}var cue=lue;function uue(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var due=uue,fue=Xy,hue="__lodash_hash_undefined__",pue=Object.prototype,mue=pue.hasOwnProperty;function gue(t){var e=this.__data__;if(fue){var n=e[t];return n===hue?void 0:n}return mue.call(e,t)?e[t]:void 0}var vue=gue,yue=Xy,_ue=Object.prototype,xue=_ue.hasOwnProperty;function bue(t){var e=this.__data__;return yue?e[t]!==void 0:xue.call(e,t)}var wue=bue,Eue=Xy,Sue="__lodash_hash_undefined__";function Tue(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Eue&&e===void 0?Sue:e,this}var Aue=Tue,Mue=cue,Cue=due,Rue=vue,Pue=wue,Iue=Aue;function pd(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}pd.prototype.clear=Mue;pd.prototype.delete=Cue;pd.prototype.get=Rue;pd.prototype.has=Pue;pd.prototype.set=Iue;var Nue=pd,ZP=Nue,Oue=qy,Due=BS;function kue(){this.size=0,this.__data__={hash:new ZP,map:new(Due||Oue),string:new ZP}}var Lue=kue;function Fue(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Uue=Fue,jue=Uue;function Bue(t,e){var n=t.__data__;return jue(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Yy=Bue,Vue=Yy;function zue(t){var e=Vue(this,t).delete(t);return this.size-=e?1:0,e}var Hue=zue,Gue=Yy;function $ue(t){return Gue(this,t).get(t)}var Wue=$ue,que=Yy;function Kue(t){return que(this,t).has(t)}var Xue=Kue,Yue=Yy;function Que(t,e){var n=Yue(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var Zue=Que,Jue=Lue,ede=Hue,tde=Wue,nde=Xue,rde=Zue;function md(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}md.prototype.clear=Jue;md.prototype.delete=ede;md.prototype.get=tde;md.prototype.has=nde;md.prototype.set=rde;var WU=md,ide=qy,sde=BS,ode=WU,ade=200;function lde(t,e){var n=this.__data__;if(n instanceof ide){var r=n.__data__;if(!sde||r.length<ade-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ode(r)}return n.set(t,e),this.size=n.size,this}var cde=lde,ude=qy,dde=Qle,fde=Jle,hde=tce,pde=rce,mde=cde;function gd(t){var e=this.__data__=new ude(t);this.size=e.size}gd.prototype.clear=dde;gd.prototype.delete=fde;gd.prototype.get=hde;gd.prototype.has=pde;gd.prototype.set=mde;var gde=gd,vde="__lodash_hash_undefined__";function yde(t){return this.__data__.set(t,vde),this}var _de=yde;function xde(t){return this.__data__.has(t)}var bde=xde,wde=WU,Ede=_de,Sde=bde;function bv(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new wde;++e<n;)this.add(t[e])}bv.prototype.add=bv.prototype.push=Ede;bv.prototype.has=Sde;var Tde=bv;function Ade(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Mde=Ade;function Cde(t,e){return t.has(e)}var Rde=Cde,Pde=Tde,Ide=Mde,Nde=Rde,Ode=1,Dde=2;function kde(t,e,n,r,i,s){var o=n&Ode,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(t),d=s.get(e);if(c&&d)return c==e&&d==t;var f=-1,u=!0,h=n&Dde?new Pde:void 0;for(s.set(t,e),s.set(e,t);++f<a;){var g=t[f],v=e[f];if(r)var m=o?r(v,g,f,e,t,s):r(g,v,f,t,e,s);if(m!==void 0){if(m)continue;u=!1;break}if(h){if(!Ide(e,function(p,y){if(!Nde(h,y)&&(g===p||i(g,p,n,r,s)))return h.push(y)})){u=!1;break}}else if(!(g===v||i(g,v,n,r,s))){u=!1;break}}return s.delete(t),s.delete(e),u}var qU=kde,Lde=Ro,Fde=Lde.Uint8Array,Ude=Fde;function jde(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var Bde=jde;function Vde(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var zde=Vde,JP=jS,eI=Ude,Hde=BU,Gde=qU,$de=Bde,Wde=zde,qde=1,Kde=2,Xde="[object Boolean]",Yde="[object Date]",Qde="[object Error]",Zde="[object Map]",Jde="[object Number]",efe="[object RegExp]",tfe="[object Set]",nfe="[object String]",rfe="[object Symbol]",ife="[object ArrayBuffer]",sfe="[object DataView]",tI=JP?JP.prototype:void 0,X0=tI?tI.valueOf:void 0;function ofe(t,e,n,r,i,s,o){switch(n){case sfe:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ife:return!(t.byteLength!=e.byteLength||!s(new eI(t),new eI(e)));case Xde:case Yde:case Jde:return Hde(+t,+e);case Qde:return t.name==e.name&&t.message==e.message;case efe:case nfe:return t==e+"";case Zde:var a=$de;case tfe:var l=r&qde;if(a||(a=Wde),t.size!=e.size&&!l)return!1;var c=o.get(t);if(c)return c==e;r|=Kde,o.set(t,e);var d=Gde(a(t),a(e),r,i,s,o);return o.delete(t),d;case rfe:if(X0)return X0.call(t)==X0.call(e)}return!1}var afe=ofe;function lfe(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var cfe=lfe,ufe=Array.isArray,VS=ufe,dfe=cfe,ffe=VS;function hfe(t,e,n){var r=e(t);return ffe(t)?r:dfe(r,n(t))}var pfe=hfe;function mfe(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}var gfe=mfe;function vfe(){return[]}var yfe=vfe,_fe=gfe,xfe=yfe,bfe=Object.prototype,wfe=bfe.propertyIsEnumerable,nI=Object.getOwnPropertySymbols,Efe=nI?function(t){return t==null?[]:(t=Object(t),_fe(nI(t),function(e){return wfe.call(t,e)}))}:xfe,Sfe=Efe;function Tfe(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var Afe=Tfe;function Mfe(t){return t!=null&&typeof t=="object"}var Qy=Mfe,Cfe=Ky,Rfe=Qy,Pfe="[object Arguments]";function Ife(t){return Rfe(t)&&Cfe(t)==Pfe}var Nfe=Ife,rI=Nfe,Ofe=Qy,KU=Object.prototype,Dfe=KU.hasOwnProperty,kfe=KU.propertyIsEnumerable,Lfe=rI(function(){return arguments}())?rI:function(t){return Ofe(t)&&Dfe.call(t,"callee")&&!kfe.call(t,"callee")},Ffe=Lfe,wv={exports:{}};function Ufe(){return!1}var jfe=Ufe;wv.exports;(function(t,e){var n=Ro,r=jfe,i=e&&!e.nodeType&&e,s=i&&!0&&t&&!t.nodeType&&t,o=s&&s.exports===i,a=o?n.Buffer:void 0,l=a?a.isBuffer:void 0,c=l||r;t.exports=c})(wv,wv.exports);var XU=wv.exports,Bfe=9007199254740991,Vfe=/^(?:0|[1-9]\d*)$/;function zfe(t,e){var n=typeof t;return e=e??Bfe,!!e&&(n=="number"||n!="symbol"&&Vfe.test(t))&&t>-1&&t%1==0&&t<e}var Hfe=zfe,Gfe=9007199254740991;function $fe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Gfe}var YU=$fe,Wfe=Ky,qfe=YU,Kfe=Qy,Xfe="[object Arguments]",Yfe="[object Array]",Qfe="[object Boolean]",Zfe="[object Date]",Jfe="[object Error]",ehe="[object Function]",the="[object Map]",nhe="[object Number]",rhe="[object Object]",ihe="[object RegExp]",she="[object Set]",ohe="[object String]",ahe="[object WeakMap]",lhe="[object ArrayBuffer]",che="[object DataView]",uhe="[object Float32Array]",dhe="[object Float64Array]",fhe="[object Int8Array]",hhe="[object Int16Array]",phe="[object Int32Array]",mhe="[object Uint8Array]",ghe="[object Uint8ClampedArray]",vhe="[object Uint16Array]",yhe="[object Uint32Array]",rn={};rn[uhe]=rn[dhe]=rn[fhe]=rn[hhe]=rn[phe]=rn[mhe]=rn[ghe]=rn[vhe]=rn[yhe]=!0;rn[Xfe]=rn[Yfe]=rn[lhe]=rn[Qfe]=rn[che]=rn[Zfe]=rn[Jfe]=rn[ehe]=rn[the]=rn[nhe]=rn[rhe]=rn[ihe]=rn[she]=rn[ohe]=rn[ahe]=!1;function _he(t){return Kfe(t)&&qfe(t.length)&&!!rn[Wfe(t)]}var xhe=_he;function bhe(t){return function(e){return t(e)}}var whe=bhe,Ev={exports:{}};Ev.exports;(function(t,e){var n=VU,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===r,o=s&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();t.exports=a})(Ev,Ev.exports);var Ehe=Ev.exports,She=xhe,The=whe,iI=Ehe,sI=iI&&iI.isTypedArray,Ahe=sI?The(sI):She,QU=Ahe,Mhe=Afe,Che=Ffe,Rhe=VS,Phe=XU,Ihe=Hfe,Nhe=QU,Ohe=Object.prototype,Dhe=Ohe.hasOwnProperty;function khe(t,e){var n=Rhe(t),r=!n&&Che(t),i=!n&&!r&&Phe(t),s=!n&&!r&&!i&&Nhe(t),o=n||r||i||s,a=o?Mhe(t.length,String):[],l=a.length;for(var c in t)(e||Dhe.call(t,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ihe(c,l)))&&a.push(c);return a}var Lhe=khe,Fhe=Object.prototype;function Uhe(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Fhe;return t===n}var jhe=Uhe;function Bhe(t,e){return function(n){return t(e(n))}}var Vhe=Bhe,zhe=Vhe,Hhe=zhe(Object.keys,Object),Ghe=Hhe,$he=jhe,Whe=Ghe,qhe=Object.prototype,Khe=qhe.hasOwnProperty;function Xhe(t){if(!$he(t))return Whe(t);var e=[];for(var n in Object(t))Khe.call(t,n)&&n!="constructor"&&e.push(n);return e}var Yhe=Xhe,Qhe=GU,Zhe=YU;function Jhe(t){return t!=null&&Zhe(t.length)&&!Qhe(t)}var epe=Jhe,tpe=Lhe,npe=Yhe,rpe=epe;function ipe(t){return rpe(t)?tpe(t):npe(t)}var spe=ipe,ope=pfe,ape=Sfe,lpe=spe;function cpe(t){return ope(t,lpe,ape)}var upe=cpe,oI=upe,dpe=1,fpe=Object.prototype,hpe=fpe.hasOwnProperty;function ppe(t,e,n,r,i,s){var o=n&dpe,a=oI(t),l=a.length,c=oI(e),d=c.length;if(l!=d&&!o)return!1;for(var f=l;f--;){var u=a[f];if(!(o?u in e:hpe.call(e,u)))return!1}var h=s.get(t),g=s.get(e);if(h&&g)return h==e&&g==t;var v=!0;s.set(t,e),s.set(e,t);for(var m=o;++f<l;){u=a[f];var p=t[u],y=e[u];if(r)var w=o?r(y,p,u,e,t,s):r(p,y,u,t,e,s);if(!(w===void 0?p===y||i(p,y,n,r,s):w)){v=!1;break}m||(m=u=="constructor")}if(v&&!m){var x=t.constructor,S=e.constructor;x!=S&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof S=="function"&&S instanceof S)&&(v=!1)}return s.delete(t),s.delete(e),v}var mpe=ppe,gpe=hd,vpe=Ro,ype=gpe(vpe,"DataView"),_pe=ype,xpe=hd,bpe=Ro,wpe=xpe(bpe,"Promise"),Epe=wpe,Spe=hd,Tpe=Ro,Ape=Spe(Tpe,"Set"),Mpe=Ape,Cpe=hd,Rpe=Ro,Ppe=Cpe(Rpe,"WeakMap"),Ipe=Ppe,F1=_pe,U1=BS,j1=Epe,B1=Mpe,V1=Ipe,ZU=Ky,vd=$U,aI="[object Map]",Npe="[object Object]",lI="[object Promise]",cI="[object Set]",uI="[object WeakMap]",dI="[object DataView]",Ope=vd(F1),Dpe=vd(U1),kpe=vd(j1),Lpe=vd(B1),Fpe=vd(V1),ul=ZU;(F1&&ul(new F1(new ArrayBuffer(1)))!=dI||U1&&ul(new U1)!=aI||j1&&ul(j1.resolve())!=lI||B1&&ul(new B1)!=cI||V1&&ul(new V1)!=uI)&&(ul=function(t){var e=ZU(t),n=e==Npe?t.constructor:void 0,r=n?vd(n):"";if(r)switch(r){case Ope:return dI;case Dpe:return aI;case kpe:return lI;case Lpe:return cI;case Fpe:return uI}return e});var Upe=ul,Y0=gde,jpe=qU,Bpe=afe,Vpe=mpe,fI=Upe,hI=VS,pI=XU,zpe=QU,Hpe=1,mI="[object Arguments]",gI="[object Array]",Am="[object Object]",Gpe=Object.prototype,vI=Gpe.hasOwnProperty;function $pe(t,e,n,r,i,s){var o=hI(t),a=hI(e),l=o?gI:fI(t),c=a?gI:fI(e);l=l==mI?Am:l,c=c==mI?Am:c;var d=l==Am,f=c==Am,u=l==c;if(u&&pI(t)){if(!pI(e))return!1;o=!0,d=!1}if(u&&!d)return s||(s=new Y0),o||zpe(t)?jpe(t,e,n,r,i,s):Bpe(t,e,l,n,r,i,s);if(!(n&Hpe)){var h=d&&vI.call(t,"__wrapped__"),g=f&&vI.call(e,"__wrapped__");if(h||g){var v=h?t.value():t,m=g?e.value():e;return s||(s=new Y0),i(v,m,n,r,s)}}return u?(s||(s=new Y0),Vpe(t,e,n,r,i,s)):!1}var Wpe=$pe,qpe=Wpe,yI=Qy;function JU(t,e,n,r,i){return t===e?!0:t==null||e==null||!yI(t)&&!yI(e)?t!==t&&e!==e:qpe(t,e,n,r,JU,i)}var Kpe=JU,Xpe=Kpe;function Ype(t,e){return Xpe(t,e)}var Qpe=Ype,e4={exports:{}};/*!
8236 * Quill Editor v1.3.7
8237 * https://quilljs.com/
8238 * Copyright (c) 2014, Jason Chen
8239 * Copyright (c) 2013, salesforce.com
8240 */(function(t,e){(function(r,i){t.exports=i()})(typeof self<"u"?self:oi,function(){return function(n){var r={};function i(s){if(r[s])return r[s].exports;var o=r[s]={i:s,l:!1,exports:{}};return n[s].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=n,i.c=r,i.d=function(s,o,a){i.o(s,o)||Object.defineProperty(s,o,{configurable:!1,enumerable:!0,get:a})},i.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(o,"a",o),o},i.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},i.p="",i(i.s=109)}([function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(17),o=i(18),a=i(19),l=i(45),c=i(46),d=i(47),f=i(48),u=i(49),h=i(12),g=i(32),v=i(33),m=i(31),p=i(1),y={Scope:p.Scope,create:p.create,find:p.find,query:p.query,register:p.register,Container:s.default,Format:o.default,Leaf:a.default,Embed:f.default,Scroll:l.default,Block:d.default,Inline:c.default,Text:u.default,Attributor:{Attribute:h.default,Class:g.default,Style:v.default,Store:m.default}};r.default=y},function(n,r,i){var s=this&&this.__extends||function(){var m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,y){p.__proto__=y}||function(p,y){for(var w in y)y.hasOwnProperty(w)&&(p[w]=y[w])};return function(p,y){m(p,y);function w(){this.constructor=p}p.prototype=y===null?Object.create(y):(w.prototype=y.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var o=function(m){s(p,m);function p(y){var w=this;return y="[Parchment] "+y,w=m.call(this,y)||this,w.message=y,w.name=w.constructor.name,w}return p}(Error);r.ParchmentError=o;var a={},l={},c={},d={};r.DATA_KEY="__blot";var f;(function(m){m[m.TYPE=3]="TYPE",m[m.LEVEL=12]="LEVEL",m[m.ATTRIBUTE=13]="ATTRIBUTE",m[m.BLOT=14]="BLOT",m[m.INLINE=7]="INLINE",m[m.BLOCK=11]="BLOCK",m[m.BLOCK_BLOT=10]="BLOCK_BLOT",m[m.INLINE_BLOT=6]="INLINE_BLOT",m[m.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",m[m.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",m[m.ANY=15]="ANY"})(f=r.Scope||(r.Scope={}));function u(m,p){var y=g(m);if(y==null)throw new o("Unable to create "+m+" blot");var w=y,x=m instanceof Node||m.nodeType===Node.TEXT_NODE?m:w.create(p);return new w(x,p)}r.create=u;function h(m,p){return p===void 0&&(p=!1),m==null?null:m[r.DATA_KEY]!=null?m[r.DATA_KEY].blot:p?h(m.parentNode,p):null}r.find=h;function g(m,p){p===void 0&&(p=f.ANY);var y;if(typeof m=="string")y=d[m]||a[m];else if(m instanceof Text||m.nodeType===Node.TEXT_NODE)y=d.text;else if(typeof m=="number")m&f.LEVEL&f.BLOCK?y=d.block:m&f.LEVEL&f.INLINE&&(y=d.inline);else if(m instanceof HTMLElement){var w=(m.getAttribute("class")||"").split(/\s+/);for(var x in w)if(y=l[w[x]],y)break;y=y||c[m.tagName]}return y==null?null:p&f.LEVEL&y.scope&&p&f.TYPE&y.scope?y:null}r.query=g;function v(){for(var m=[],p=0;p<arguments.length;p++)m[p]=arguments[p];if(m.length>1)return m.map(function(x){return v(x)});var y=m[0];if(typeof y.blotName!="string"&&typeof y.attrName!="string")throw new o("Invalid definition");if(y.blotName==="abstract")throw new o("Cannot register abstract class");if(d[y.blotName||y.attrName]=y,typeof y.keyName=="string")a[y.keyName]=y;else if(y.className!=null&&(l[y.className]=y),y.tagName!=null){Array.isArray(y.tagName)?y.tagName=y.tagName.map(function(x){return x.toUpperCase()}):y.tagName=y.tagName.toUpperCase();var w=Array.isArray(y.tagName)?y.tagName:[y.tagName];w.forEach(function(x){(c[x]==null||y.className==null)&&(c[x]=y)})}return y}r.register=v},function(n,r,i){var s=i(51),o=i(11),a=i(3),l=i(20),c="\0",d=function(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]};d.prototype.insert=function(f,u){var h={};return f.length===0?this:(h.insert=f,u!=null&&typeof u=="object"&&Object.keys(u).length>0&&(h.attributes=u),this.push(h))},d.prototype.delete=function(f){return f<=0?this:this.push({delete:f})},d.prototype.retain=function(f,u){if(f<=0)return this;var h={retain:f};return u!=null&&typeof u=="object"&&Object.keys(u).length>0&&(h.attributes=u),this.push(h)},d.prototype.push=function(f){var u=this.ops.length,h=this.ops[u-1];if(f=a(!0,{},f),typeof h=="object"){if(typeof f.delete=="number"&&typeof h.delete=="number")return this.ops[u-1]={delete:h.delete+f.delete},this;if(typeof h.delete=="number"&&f.insert!=null&&(u-=1,h=this.ops[u-1],typeof h!="object"))return this.ops.unshift(f),this;if(o(f.attributes,h.attributes)){if(typeof f.insert=="string"&&typeof h.insert=="string")return this.ops[u-1]={insert:h.insert+f.insert},typeof f.attributes=="object"&&(this.ops[u-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof h.retain=="number")return this.ops[u-1]={retain:h.retain+f.retain},typeof f.attributes=="object"&&(this.ops[u-1].attributes=f.attributes),this}}return u===this.ops.length?this.ops.push(f):this.ops.splice(u,0,f),this},d.prototype.chop=function(){var f=this.ops[this.ops.length-1];return f&&f.retain&&!f.attributes&&this.ops.pop(),this},d.prototype.filter=function(f){return this.ops.filter(f)},d.prototype.forEach=function(f){this.ops.forEach(f)},d.prototype.map=function(f){return this.ops.map(f)},d.prototype.partition=function(f){var u=[],h=[];return this.forEach(function(g){var v=f(g)?u:h;v.push(g)}),[u,h]},d.prototype.reduce=function(f,u){return this.ops.reduce(f,u)},d.prototype.changeLength=function(){return this.reduce(function(f,u){return u.insert?f+l.length(u):u.delete?f-u.delete:f},0)},d.prototype.length=function(){return this.reduce(function(f,u){return f+l.length(u)},0)},d.prototype.slice=function(f,u){f=f||0,typeof u!="number"&&(u=1/0);for(var h=[],g=l.iterator(this.ops),v=0;v<u&&g.hasNext();){var m;v<f?m=g.next(f-v):(m=g.next(u-v),h.push(m)),v+=l.length(m)}return new d(h)},d.prototype.compose=function(f){var u=l.iterator(this.ops),h=l.iterator(f.ops),g=[],v=h.peek();if(v!=null&&typeof v.retain=="number"&&v.attributes==null){for(var m=v.retain;u.peekType()==="insert"&&u.peekLength()<=m;)m-=u.peekLength(),g.push(u.next());v.retain-m>0&&h.next(v.retain-m)}for(var p=new d(g);u.hasNext()||h.hasNext();)if(h.peekType()==="insert")p.push(h.next());else if(u.peekType()==="delete")p.push(u.next());else{var y=Math.min(u.peekLength(),h.peekLength()),w=u.next(y),x=h.next(y);if(typeof x.retain=="number"){var S={};typeof w.retain=="number"?S.retain=y:S.insert=w.insert;var I=l.attributes.compose(w.attributes,x.attributes,typeof w.retain=="number");if(I&&(S.attributes=I),p.push(S),!h.hasNext()&&o(p.ops[p.ops.length-1],S)){var M=new d(u.rest());return p.concat(M).chop()}}else typeof x.delete=="number"&&typeof w.retain=="number"&&p.push(x)}return p.chop()},d.prototype.concat=function(f){var u=new d(this.ops.slice());return f.ops.length>0&&(u.push(f.ops[0]),u.ops=u.ops.concat(f.ops.slice(1))),u},d.prototype.diff=function(f,u){if(this.ops===f.ops)return new d;var h=[this,f].map(function(y){return y.map(function(w){if(w.insert!=null)return typeof w.insert=="string"?w.insert:c;var x=y===f?"on":"with";throw new Error("diff() called "+x+" non-document")}).join("")}),g=new d,v=s(h[0],h[1],u),m=l.iterator(this.ops),p=l.iterator(f.ops);return v.forEach(function(y){for(var w=y[1].length;w>0;){var x=0;switch(y[0]){case s.INSERT:x=Math.min(p.peekLength(),w),g.push(p.next(x));break;case s.DELETE:x=Math.min(w,m.peekLength()),m.next(x),g.delete(x);break;case s.EQUAL:x=Math.min(m.peekLength(),p.peekLength(),w);var S=m.next(x),I=p.next(x);o(S.insert,I.insert)?g.retain(x,l.attributes.diff(S.attributes,I.attributes)):g.push(I).delete(x);break}w-=x}}),g.chop()},d.prototype.eachLine=function(f,u){u=u||`
8241`;for(var h=l.iterator(this.ops),g=new d,v=0;h.hasNext();){if(h.peekType()!=="insert")return;var m=h.peek(),p=l.length(m)-h.peekLength(),y=typeof m.insert=="string"?m.insert.indexOf(u,p)-p:-1;if(y<0)g.push(h.next());else if(y>0)g.push(h.next(y));else{if(f(g,h.next(1).attributes||{},v)===!1)return;v+=1,g=new d}}g.length()>0&&f(g,{},v)},d.prototype.transform=function(f,u){if(u=!!u,typeof f=="number")return this.transformPosition(f,u);for(var h=l.iterator(this.ops),g=l.iterator(f.ops),v=new d;h.hasNext()||g.hasNext();)if(h.peekType()==="insert"&&(u||g.peekType()!=="insert"))v.retain(l.length(h.next()));else if(g.peekType()==="insert")v.push(g.next());else{var m=Math.min(h.peekLength(),g.peekLength()),p=h.next(m),y=g.next(m);if(p.delete)continue;y.delete?v.push(y):v.retain(m,l.attributes.transform(p.attributes,y.attributes,u))}return v.chop()},d.prototype.transformPosition=function(f,u){u=!!u;for(var h=l.iterator(this.ops),g=0;h.hasNext()&&g<=f;){var v=h.peekLength(),m=h.peekType();if(h.next(),m==="delete"){f-=Math.min(v,f-g);continue}else m==="insert"&&(g<f||!u)&&(f+=v);g+=v}return f},n.exports=d},function(n,r){var i=Object.prototype.hasOwnProperty,s=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(h){return typeof Array.isArray=="function"?Array.isArray(h):s.call(h)==="[object Array]"},c=function(h){if(!h||s.call(h)!=="[object Object]")return!1;var g=i.call(h,"constructor"),v=h.constructor&&h.constructor.prototype&&i.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!v)return!1;var m;for(m in h);return typeof m>"u"||i.call(h,m)},d=function(h,g){o&&g.name==="__proto__"?o(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},f=function(h,g){if(g==="__proto__")if(i.call(h,g)){if(a)return a(h,g).value}else return;return h[g]};n.exports=function u(){var h,g,v,m,p,y,w=arguments[0],x=1,S=arguments.length,I=!1;for(typeof w=="boolean"&&(I=w,w=arguments[1]||{},x=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});x<S;++x)if(h=arguments[x],h!=null)for(g in h)v=f(w,g),m=f(h,g),w!==m&&(I&&m&&(c(m)||(p=l(m)))?(p?(p=!1,y=v&&l(v)?v:[]):y=v&&c(v)?v:{},d(w,{name:g,newValue:u(I,y,m)})):typeof m<"u"&&d(w,{name:g,newValue:m}));return w}},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BlockEmbed=r.bubbleFormats=void 0;var s=function(){function A(R,P){for(var D=0;D<P.length;D++){var F=P[D];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(R,F.key,F)}}return function(R,P,D){return P&&A(R.prototype,P),D&&A(R,D),R}}(),o=function A(R,P,D){R===null&&(R=Function.prototype);var F=Object.getOwnPropertyDescriptor(R,P);if(F===void 0){var V=Object.getPrototypeOf(R);return V===null?void 0:A(V,P,D)}else{if("value"in F)return F.value;var H=F.get;return H===void 0?void 0:H.call(D)}},a=i(3),l=w(a),c=i(2),d=w(c),f=i(0),u=w(f),h=i(16),g=w(h),v=i(6),m=w(v),p=i(7),y=w(p);function w(A){return A&&A.__esModule?A:{default:A}}function x(A,R){if(!(A instanceof R))throw new TypeError("Cannot call a class as a function")}function S(A,R){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:A}function I(A,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);A.prototype=Object.create(R&&R.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(A,R):A.__proto__=R)}var M=1,E=function(A){I(R,A);function R(){return x(this,R),S(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return s(R,[{key:"attach",value:function(){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"attach",this).call(this),this.attributes=new u.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new d.default().insert(this.value(),(0,l.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(D,F){var V=u.default.query(D,u.default.Scope.BLOCK_ATTRIBUTE);V!=null&&this.attributes.attribute(V,F)}},{key:"formatAt",value:function(D,F,V,H){this.format(V,H)}},{key:"insertAt",value:function(D,F,V){if(typeof F=="string"&&F.endsWith(`
8242`)){var H=u.default.create(C.blotName);this.parent.insertBefore(H,D===0?this:this.next),H.insertAt(0,F.slice(0,-1))}else o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,D,F,V)}}]),R}(u.default.Embed);E.scope=u.default.Scope.BLOCK_BLOT;var C=function(A){I(R,A);function R(P){x(this,R);var D=S(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,P));return D.cache={},D}return s(R,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(u.default.Leaf).reduce(function(D,F){return F.length()===0?D:D.insert(F.value(),T(F))},new d.default).insert(`
8243`,T(this))),this.cache.delta}},{key:"deleteAt",value:function(D,F){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"deleteAt",this).call(this,D,F),this.cache={}}},{key:"formatAt",value:function(D,F,V,H){F<=0||(u.default.query(V,u.default.Scope.BLOCK)?D+F===this.length()&&this.format(V,H):o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"formatAt",this).call(this,D,Math.min(F,this.length()-D-1),V,H),this.cache={})}},{key:"insertAt",value:function(D,F,V){if(V!=null)return o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,D,F,V);if(F.length!==0){var H=F.split(`
8244`),$=H.shift();$.length>0&&(D<this.length()-1||this.children.tail==null?o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,Math.min(D,this.length()-1),$):this.children.tail.insertAt(this.children.tail.length(),$),this.cache={});var B=this;H.reduce(function(G,k){return B=B.split(G,!0),B.insertAt(0,k),k.length},D+$.length)}}},{key:"insertBefore",value:function(D,F){var V=this.children.head;o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertBefore",this).call(this,D,F),V instanceof g.default&&V.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"length",this).call(this)+M),this.cache.length}},{key:"moveChildren",value:function(D,F){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"moveChildren",this).call(this,D,F),this.cache={}}},{key:"optimize",value:function(D){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"optimize",this).call(this,D),this.cache={}}},{key:"path",value:function(D){return o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"path",this).call(this,D,!0)}},{key:"removeChild",value:function(D){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"removeChild",this).call(this,D),this.cache={}}},{key:"split",value:function(D){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(F&&(D===0||D>=this.length()-M)){var V=this.clone();return D===0?(this.parent.insertBefore(V,this),this):(this.parent.insertBefore(V,this.next),V)}else{var H=o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"split",this).call(this,D,F);return this.cache={},H}}}]),R}(u.default.Block);C.blotName="block",C.tagName="P",C.defaultChild="break",C.allowedChildren=[m.default,u.default.Embed,y.default];function T(A){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return A==null||(typeof A.formats=="function"&&(R=(0,l.default)(R,A.formats())),A.parent==null||A.parent.blotName=="scroll"||A.parent.statics.scope!==A.statics.scope)?R:T(A.parent,R)}r.bubbleFormats=T,r.BlockEmbed=E,r.default=C},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.overload=r.expandConfig=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(B){return typeof B}:function(B){return B&&typeof Symbol=="function"&&B.constructor===Symbol&&B!==Symbol.prototype?"symbol":typeof B},o=function(){function B(G,k){var z=[],q=!0,ne=!1,ee=void 0;try{for(var j=G[Symbol.iterator](),Q;!(q=(Q=j.next()).done)&&(z.push(Q.value),!(k&&z.length===k));q=!0);}catch(Z){ne=!0,ee=Z}finally{try{!q&&j.return&&j.return()}finally{if(ne)throw ee}}return z}return function(G,k){if(Array.isArray(G))return G;if(Symbol.iterator in Object(G))return B(G,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function B(G,k){for(var z=0;z<k.length;z++){var q=k[z];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(G,q.key,q)}}return function(G,k,z){return k&&B(G.prototype,k),z&&B(G,z),G}}();i(50);var l=i(2),c=T(l),d=i(14),f=T(d),u=i(8),h=T(u),g=i(9),v=T(g),m=i(0),p=T(m),y=i(15),w=T(y),x=i(3),S=T(x),I=i(10),M=T(I),E=i(34),C=T(E);function T(B){return B&&B.__esModule?B:{default:B}}function A(B,G,k){return G in B?Object.defineProperty(B,G,{value:k,enumerable:!0,configurable:!0,writable:!0}):B[G]=k,B}function R(B,G){if(!(B instanceof G))throw new TypeError("Cannot call a class as a function")}var P=(0,M.default)("quill"),D=function(){a(B,null,[{key:"debug",value:function(k){k===!0&&(k="log"),M.default.level(k)}},{key:"find",value:function(k){return k.__quill||p.default.find(k)}},{key:"import",value:function(k){return this.imports[k]==null&&P.error("Cannot import "+k+". Are you sure it was registered?"),this.imports[k]}},{key:"register",value:function(k,z){var q=this,ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof k!="string"){var ee=k.attrName||k.blotName;typeof ee=="string"?this.register("formats/"+ee,k,z):Object.keys(k).forEach(function(j){q.register(j,k[j],z)})}else this.imports[k]!=null&&!ne&&P.warn("Overwriting "+k+" with",z),this.imports[k]=z,(k.startsWith("blots/")||k.startsWith("formats/"))&&z.blotName!=="abstract"?p.default.register(z):k.startsWith("modules")&&typeof z.register=="function"&&z.register()}}]);function B(G){var k=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(R(this,B),this.options=F(G,z),this.container=this.options.container,this.container==null)return P.error("Invalid Quill container",G);this.options.debug&&B.debug(this.options.debug);var q=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new h.default,this.scroll=p.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new f.default(this.scroll),this.selection=new w.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(h.default.events.EDITOR_CHANGE,function(ee){ee===h.default.events.TEXT_CHANGE&&k.root.classList.toggle("ql-blank",k.editor.isBlank())}),this.emitter.on(h.default.events.SCROLL_UPDATE,function(ee,j){var Q=k.selection.lastRange,Z=Q&&Q.length===0?Q.index:void 0;V.call(k,function(){return k.editor.update(null,j,Z)},ee)});var ne=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+q+"<p><br></p></div>");this.setContents(ne),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return a(B,[{key:"addContainer",value:function(k){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof k=="string"){var q=k;k=document.createElement("div"),k.classList.add(q)}return this.container.insertBefore(k,z),k}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(k,z,q){var ne=this,ee=H(k,z,q),j=o(ee,4);return k=j[0],z=j[1],q=j[3],V.call(this,function(){return ne.editor.deleteText(k,z)},q,k,-1*z)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(k),this.container.classList.toggle("ql-disabled",!k)}},{key:"focus",value:function(){var k=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=k,this.scrollIntoView()}},{key:"format",value:function(k,z){var q=this,ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h.default.sources.API;return V.call(this,function(){var ee=q.getSelection(!0),j=new c.default;if(ee==null)return j;if(p.default.query(k,p.default.Scope.BLOCK))j=q.editor.formatLine(ee.index,ee.length,A({},k,z));else{if(ee.length===0)return q.selection.format(k,z),j;j=q.editor.formatText(ee.index,ee.length,A({},k,z))}return q.setSelection(ee,h.default.sources.SILENT),j},ne)}},{key:"formatLine",value:function(k,z,q,ne,ee){var j=this,Q=void 0,Z=H(k,z,q,ne,ee),re=o(Z,4);return k=re[0],z=re[1],Q=re[2],ee=re[3],V.call(this,function(){return j.editor.formatLine(k,z,Q)},ee,k,0)}},{key:"formatText",value:function(k,z,q,ne,ee){var j=this,Q=void 0,Z=H(k,z,q,ne,ee),re=o(Z,4);return k=re[0],z=re[1],Q=re[2],ee=re[3],V.call(this,function(){return j.editor.formatText(k,z,Q)},ee,k,0)}},{key:"getBounds",value:function(k){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,q=void 0;typeof k=="number"?q=this.selection.getBounds(k,z):q=this.selection.getBounds(k.index,k.length);var ne=this.container.getBoundingClientRect();return{bottom:q.bottom-ne.top,height:q.height,left:q.left-ne.left,right:q.right-ne.left,top:q.top-ne.top,width:q.width}}},{key:"getContents",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-k,q=H(k,z),ne=o(q,2);return k=ne[0],z=ne[1],this.editor.getContents(k,z)}},{key:"getFormat",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof k=="number"?this.editor.getFormat(k,z):this.editor.getFormat(k.index,k.length)}},{key:"getIndex",value:function(k){return k.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(k){return this.scroll.leaf(k)}},{key:"getLine",value:function(k){return this.scroll.line(k)}},{key:"getLines",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof k!="number"?this.scroll.lines(k.index,k.length):this.scroll.lines(k,z)}},{key:"getModule",value:function(k){return this.theme.modules[k]}},{key:"getSelection",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return k&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-k,q=H(k,z),ne=o(q,2);return k=ne[0],z=ne[1],this.editor.getText(k,z)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(k,z,q){var ne=this,ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:B.sources.API;return V.call(this,function(){return ne.editor.insertEmbed(k,z,q)},ee,k)}},{key:"insertText",value:function(k,z,q,ne,ee){var j=this,Q=void 0,Z=H(k,0,q,ne,ee),re=o(Z,4);return k=re[0],Q=re[2],ee=re[3],V.call(this,function(){return j.editor.insertText(k,z,Q)},ee,k,z.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(k,z,q){this.clipboard.dangerouslyPasteHTML(k,z,q)}},{key:"removeFormat",value:function(k,z,q){var ne=this,ee=H(k,z,q),j=o(ee,4);return k=j[0],z=j[1],q=j[3],V.call(this,function(){return ne.editor.removeFormat(k,z)},q,k)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(k){var z=this,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API;return V.call(this,function(){k=new c.default(k);var ne=z.getLength(),ee=z.editor.deleteText(0,ne),j=z.editor.applyDelta(k),Q=j.ops[j.ops.length-1];Q!=null&&typeof Q.insert=="string"&&Q.insert[Q.insert.length-1]===`
8245`&&(z.editor.deleteText(z.getLength()-1,1),j.delete(1));var Z=ee.compose(j);return Z},q)}},{key:"setSelection",value:function(k,z,q){if(k==null)this.selection.setRange(null,z||B.sources.API);else{var ne=H(k,z,q),ee=o(ne,4);k=ee[0],z=ee[1],q=ee[3],this.selection.setRange(new y.Range(k,z),q),q!==h.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(k){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API,q=new c.default().insert(k);return this.setContents(q,z)}},{key:"update",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h.default.sources.USER,z=this.scroll.update(k);return this.selection.update(k),z}},{key:"updateContents",value:function(k){var z=this,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API;return V.call(this,function(){return k=new c.default(k),z.editor.applyDelta(k,q)},q,!0)}}]),B}();D.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},D.events=h.default.events,D.sources=h.default.sources,D.version="1.3.7",D.imports={delta:c.default,parchment:p.default,"core/module":v.default,"core/theme":C.default};function F(B,G){if(G=(0,S.default)(!0,{container:B,modules:{clipboard:!0,keyboard:!0,history:!0}},G),!G.theme||G.theme===D.DEFAULTS.theme)G.theme=C.default;else if(G.theme=D.import("themes/"+G.theme),G.theme==null)throw new Error("Invalid theme "+G.theme+". Did you register it?");var k=(0,S.default)(!0,{},G.theme.DEFAULTS);[k,G].forEach(function(ne){ne.modules=ne.modules||{},Object.keys(ne.modules).forEach(function(ee){ne.modules[ee]===!0&&(ne.modules[ee]={})})});var z=Object.keys(k.modules).concat(Object.keys(G.modules)),q=z.reduce(function(ne,ee){var j=D.import("modules/"+ee);return j==null?P.error("Cannot load "+ee+" module. Are you sure you registered it?"):ne[ee]=j.DEFAULTS||{},ne},{});return G.modules!=null&&G.modules.toolbar&&G.modules.toolbar.constructor!==Object&&(G.modules.toolbar={container:G.modules.toolbar}),G=(0,S.default)(!0,{},D.DEFAULTS,{modules:q},k,G),["bounds","container","scrollingContainer"].forEach(function(ne){typeof G[ne]=="string"&&(G[ne]=document.querySelector(G[ne]))}),G.modules=Object.keys(G.modules).reduce(function(ne,ee){return G.modules[ee]&&(ne[ee]=G.modules[ee]),ne},{}),G}function V(B,G,k,z){if(this.options.strict&&!this.isEnabled()&&G===h.default.sources.USER)return new c.default;var q=k==null?null:this.getSelection(),ne=this.editor.delta,ee=B();if(q!=null&&(k===!0&&(k=q.index),z==null?q=$(q,ee,G):z!==0&&(q=$(q,k,z,G)),this.setSelection(q,h.default.sources.SILENT)),ee.length()>0){var j,Q=[h.default.events.TEXT_CHANGE,ee,ne,G];if((j=this.emitter).emit.apply(j,[h.default.events.EDITOR_CHANGE].concat(Q)),G!==h.default.sources.SILENT){var Z;(Z=this.emitter).emit.apply(Z,Q)}}return ee}function H(B,G,k,z,q){var ne={};return typeof B.index=="number"&&typeof B.length=="number"?typeof G!="number"?(q=z,z=k,k=G,G=B.length,B=B.index):(G=B.length,B=B.index):typeof G!="number"&&(q=z,z=k,k=G,G=0),(typeof k>"u"?"undefined":s(k))==="object"?(ne=k,q=z):typeof k=="string"&&(z!=null?ne[k]=z:q=k),q=q||h.default.sources.API,[B,G,ne,q]}function $(B,G,k,z){if(B==null)return null;var q=void 0,ne=void 0;if(G instanceof c.default){var ee=[B.index,B.index+B.length].map(function(re){return G.transformPosition(re,z!==h.default.sources.USER)}),j=o(ee,2);q=j[0],ne=j[1]}else{var Q=[B.index,B.index+B.length].map(function(re){return re<G||re===G&&z===h.default.sources.USER?re:k>=0?re+k:Math.max(G,re+k)}),Z=o(Q,2);q=Z[0],ne=Z[1]}return new y.Range(q,ne-q)}r.expandConfig=F,r.overload=H,r.default=D},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function m(p,y){for(var w=0;w<y.length;w++){var x=y[w];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(p,x.key,x)}}return function(p,y,w){return y&&m(p.prototype,y),w&&m(p,w),p}}(),o=function m(p,y,w){p===null&&(p=Function.prototype);var x=Object.getOwnPropertyDescriptor(p,y);if(x===void 0){var S=Object.getPrototypeOf(p);return S===null?void 0:m(S,y,w)}else{if("value"in x)return x.value;var I=x.get;return I===void 0?void 0:I.call(w)}},a=i(7),l=f(a),c=i(0),d=f(c);function f(m){return m&&m.__esModule?m:{default:m}}function u(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}function h(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:m}function g(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}var v=function(m){g(p,m);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return s(p,[{key:"formatAt",value:function(w,x,S,I){if(p.compare(this.statics.blotName,S)<0&&d.default.query(S,d.default.Scope.BLOT)){var M=this.isolate(w,x);I&&M.wrap(S,I)}else o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"formatAt",this).call(this,w,x,S,I)}},{key:"optimize",value:function(w){if(o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"optimize",this).call(this,w),this.parent instanceof p&&p.compare(this.statics.blotName,this.parent.statics.blotName)>0){var x=this.parent.isolate(this.offset(),this.length());this.moveChildren(x),x.wrap(this)}}}],[{key:"compare",value:function(w,x){var S=p.order.indexOf(w),I=p.order.indexOf(x);return S>=0||I>=0?S-I:w===x?0:w<x?-1:1}}]),p}(d.default.Inline);v.allowedChildren=[v,d.default.Embed,l.default],v.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(0),o=a(s);function a(u){return u&&u.__esModule?u:{default:u}}function l(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}function c(u,h){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:u}function d(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);u.prototype=Object.create(h&&h.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(u,h):u.__proto__=h)}var f=function(u){d(h,u);function h(){return l(this,h),c(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default.Text);r.default=f},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function y(w,x){for(var S=0;S<x.length;S++){var I=x[S];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(w,I.key,I)}}return function(w,x,S){return x&&y(w.prototype,x),S&&y(w,S),w}}(),o=function y(w,x,S){w===null&&(w=Function.prototype);var I=Object.getOwnPropertyDescriptor(w,x);if(I===void 0){var M=Object.getPrototypeOf(w);return M===null?void 0:y(M,x,S)}else{if("value"in I)return I.value;var E=I.get;return E===void 0?void 0:E.call(S)}},a=i(54),l=f(a),c=i(10),d=f(c);function f(y){return y&&y.__esModule?y:{default:y}}function u(y,w){if(!(y instanceof w))throw new TypeError("Cannot call a class as a function")}function h(y,w){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:y}function g(y,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);y.prototype=Object.create(w&&w.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(y,w):y.__proto__=w)}var v=(0,d.default)("quill:events"),m=["selectionchange","mousedown","mouseup","click"];m.forEach(function(y){document.addEventListener(y,function(){for(var w=arguments.length,x=Array(w),S=0;S<w;S++)x[S]=arguments[S];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(I){if(I.__quill&&I.__quill.emitter){var M;(M=I.__quill.emitter).handleDOM.apply(M,x)}})})});var p=function(y){g(w,y);function w(){u(this,w);var x=h(this,(w.__proto__||Object.getPrototypeOf(w)).call(this));return x.listeners={},x.on("error",v.error),x}return s(w,[{key:"emit",value:function(){v.log.apply(v,arguments),o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(S){for(var I=arguments.length,M=Array(I>1?I-1:0),E=1;E<I;E++)M[E-1]=arguments[E];(this.listeners[S.type]||[]).forEach(function(C){var T=C.node,A=C.handler;(S.target===T||T.contains(S.target))&&A.apply(void 0,[S].concat(M))})}},{key:"listenDOM",value:function(S,I,M){this.listeners[S]||(this.listeners[S]=[]),this.listeners[S].push({node:I,handler:M})}}]),w}(l.default);p.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},p.sources={API:"api",SILENT:"silent",USER:"user"},r.default=p},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});function s(a,l){if(!(a instanceof l))throw new TypeError("Cannot call a class as a function")}var o=function a(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};s(this,a),this.quill=l,this.options=c};o.DEFAULTS={},r.default=o},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=["error","warn","log","info"],o="warn";function a(c){if(s.indexOf(c)<=s.indexOf(o)){for(var d,f=arguments.length,u=Array(f>1?f-1:0),h=1;h<f;h++)u[h-1]=arguments[h];(d=console)[c].apply(d,u)}}function l(c){return s.reduce(function(d,f){return d[f]=a.bind(console,f,c),d},{})}a.level=l.level=function(c){o=c},r.default=l},function(n,r,i){var s=Array.prototype.slice,o=i(52),a=i(53),l=n.exports=function(u,h,g){return g||(g={}),u===h?!0:u instanceof Date&&h instanceof Date?u.getTime()===h.getTime():!u||!h||typeof u!="object"&&typeof h!="object"?g.strict?u===h:u==h:f(u,h,g)};function c(u){return u==null}function d(u){return!(!u||typeof u!="object"||typeof u.length!="number"||typeof u.copy!="function"||typeof u.slice!="function"||u.length>0&&typeof u[0]!="number")}function f(u,h,g){var v,m;if(c(u)||c(h)||u.prototype!==h.prototype)return!1;if(a(u))return a(h)?(u=s.call(u),h=s.call(h),l(u,h,g)):!1;if(d(u)){if(!d(h)||u.length!==h.length)return!1;for(v=0;v<u.length;v++)if(u[v]!==h[v])return!1;return!0}try{var p=o(u),y=o(h)}catch{return!1}if(p.length!=y.length)return!1;for(p.sort(),y.sort(),v=p.length-1;v>=0;v--)if(p[v]!=y[v])return!1;for(v=p.length-1;v>=0;v--)if(m=p[v],!l(u[m],h[m],g))return!1;return typeof u==typeof h}},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(1),o=function(){function a(l,c,d){d===void 0&&(d={}),this.attrName=l,this.keyName=c;var f=s.Scope.TYPE&s.Scope.ATTRIBUTE;d.scope!=null?this.scope=d.scope&s.Scope.LEVEL|f:this.scope=s.Scope.ATTRIBUTE,d.whitelist!=null&&(this.whitelist=d.whitelist)}return a.keys=function(l){return[].map.call(l.attributes,function(c){return c.name})},a.prototype.add=function(l,c){return this.canAdd(l,c)?(l.setAttribute(this.keyName,c),!0):!1},a.prototype.canAdd=function(l,c){var d=s.query(l,s.Scope.BLOT&(this.scope|s.Scope.TYPE));return d==null?!1:this.whitelist==null?!0:typeof c=="string"?this.whitelist.indexOf(c.replace(/["']/g,""))>-1:this.whitelist.indexOf(c)>-1},a.prototype.remove=function(l){l.removeAttribute(this.keyName)},a.prototype.value=function(l){var c=l.getAttribute(this.keyName);return this.canAdd(l,c)&&c?c:""},a}();r.default=o},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Code=void 0;var s=function(){function E(C,T){var A=[],R=!0,P=!1,D=void 0;try{for(var F=C[Symbol.iterator](),V;!(R=(V=F.next()).done)&&(A.push(V.value),!(T&&A.length===T));R=!0);}catch(H){P=!0,D=H}finally{try{!R&&F.return&&F.return()}finally{if(P)throw D}}return A}return function(C,T){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return E(C,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function E(C,T){for(var A=0;A<T.length;A++){var R=T[A];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(C,R.key,R)}}return function(C,T,A){return T&&E(C.prototype,T),A&&E(C,A),C}}(),a=function E(C,T,A){C===null&&(C=Function.prototype);var R=Object.getOwnPropertyDescriptor(C,T);if(R===void 0){var P=Object.getPrototypeOf(C);return P===null?void 0:E(P,T,A)}else{if("value"in R)return R.value;var D=R.get;return D===void 0?void 0:D.call(A)}},l=i(2),c=y(l),d=i(0),f=y(d),u=i(4),h=y(u),g=i(6),v=y(g),m=i(7),p=y(m);function y(E){return E&&E.__esModule?E:{default:E}}function w(E,C){if(!(E instanceof C))throw new TypeError("Cannot call a class as a function")}function x(E,C){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:E}function S(E,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);E.prototype=Object.create(C&&C.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(E,C):E.__proto__=C)}var I=function(E){S(C,E);function C(){return w(this,C),x(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}return C}(v.default);I.blotName="code",I.tagName="CODE";var M=function(E){S(C,E);function C(){return w(this,C),x(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}return o(C,[{key:"delta",value:function(){var A=this,R=this.domNode.textContent;return R.endsWith(`
8246`)&&(R=R.slice(0,-1)),R.split(`
8247`).reduce(function(P,D){return P.insert(D).insert(`
8248`,A.formats())},new c.default)}},{key:"format",value:function(A,R){if(!(A===this.statics.blotName&&R)){var P=this.descendant(p.default,this.length()-1),D=s(P,1),F=D[0];F!=null&&F.deleteAt(F.length()-1,1),a(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"format",this).call(this,A,R)}}},{key:"formatAt",value:function(A,R,P,D){if(R!==0&&!(f.default.query(P,f.default.Scope.BLOCK)==null||P===this.statics.blotName&&D===this.statics.formats(this.domNode))){var F=this.newlineIndex(A);if(!(F<0||F>=A+R)){var V=this.newlineIndex(A,!0)+1,H=F-V+1,$=this.isolate(V,H),B=$.next;$.format(P,D),B instanceof C&&B.formatAt(0,A-V+R-H,P,D)}}}},{key:"insertAt",value:function(A,R,P){if(P==null){var D=this.descendant(p.default,A),F=s(D,2),V=F[0],H=F[1];V.insertAt(H,R)}}},{key:"length",value:function(){var A=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
8249`)?A:A+1}},{key:"newlineIndex",value:function(A){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(R)return this.domNode.textContent.slice(0,A).lastIndexOf(`
8250`);var P=this.domNode.textContent.slice(A).indexOf(`
8251`);return P>-1?A+P:-1}},{key:"optimize",value:function(A){this.domNode.textContent.endsWith(`
8252`)||this.appendChild(f.default.create("text",`
8253`)),a(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"optimize",this).call(this,A);var R=this.next;R!=null&&R.prev===this&&R.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===R.statics.formats(R.domNode)&&(R.optimize(A),R.moveChildren(this),R.remove())}},{key:"replace",value:function(A){a(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"replace",this).call(this,A),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(R){var P=f.default.find(R);P==null?R.parentNode.removeChild(R):P instanceof f.default.Embed?P.remove():P.unwrap()})}}],[{key:"create",value:function(A){var R=a(C.__proto__||Object.getPrototypeOf(C),"create",this).call(this,A);return R.setAttribute("spellcheck",!1),R}},{key:"formats",value:function(){return!0}}]),C}(h.default);M.blotName="code-block",M.tagName="PRE",M.TAB="  ",r.Code=I,r.default=M},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(B){return typeof B}:function(B){return B&&typeof Symbol=="function"&&B.constructor===Symbol&&B!==Symbol.prototype?"symbol":typeof B},o=function(){function B(G,k){var z=[],q=!0,ne=!1,ee=void 0;try{for(var j=G[Symbol.iterator](),Q;!(q=(Q=j.next()).done)&&(z.push(Q.value),!(k&&z.length===k));q=!0);}catch(Z){ne=!0,ee=Z}finally{try{!q&&j.return&&j.return()}finally{if(ne)throw ee}}return z}return function(G,k){if(Array.isArray(G))return G;if(Symbol.iterator in Object(G))return B(G,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function B(G,k){for(var z=0;z<k.length;z++){var q=k[z];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(G,q.key,q)}}return function(G,k,z){return k&&B(G.prototype,k),z&&B(G,z),G}}(),l=i(2),c=R(l),d=i(20),f=R(d),u=i(0),h=R(u),g=i(13),v=R(g),m=i(24),p=R(m),y=i(4),w=R(y),x=i(16),S=R(x),I=i(21),M=R(I),E=i(11),C=R(E),T=i(3),A=R(T);function R(B){return B&&B.__esModule?B:{default:B}}function P(B,G,k){return G in B?Object.defineProperty(B,G,{value:k,enumerable:!0,configurable:!0,writable:!0}):B[G]=k,B}function D(B,G){if(!(B instanceof G))throw new TypeError("Cannot call a class as a function")}var F=/^[ -~]*$/,V=function(){function B(G){D(this,B),this.scroll=G,this.delta=this.getDelta()}return a(B,[{key:"applyDelta",value:function(k){var z=this,q=!1;this.scroll.update();var ne=this.scroll.length();return this.scroll.batchStart(),k=$(k),k.reduce(function(ee,j){var Q=j.retain||j.delete||j.insert.length||1,Z=j.attributes||{};if(j.insert!=null){if(typeof j.insert=="string"){var re=j.insert;re.endsWith(`
8254`)&&q&&(q=!1,re=re.slice(0,-1)),ee>=ne&&!re.endsWith(`
8255`)&&(q=!0),z.scroll.insertAt(ee,re);var se=z.scroll.line(ee),ye=o(se,2),Ue=ye[0],Ie=ye[1],je=(0,A.default)({},(0,y.bubbleFormats)(Ue));if(Ue instanceof w.default){var Ke=Ue.descendant(h.default.Leaf,Ie),Xe=o(Ke,1),dt=Xe[0];je=(0,A.default)(je,(0,y.bubbleFormats)(dt))}Z=f.default.attributes.diff(je,Z)||{}}else if(s(j.insert)==="object"){var K=Object.keys(j.insert)[0];if(K==null)return ee;z.scroll.insertAt(ee,K,j.insert[K])}ne+=Q}return Object.keys(Z).forEach(function(de){z.scroll.formatAt(ee,Q,de,Z[de])}),ee+Q},0),k.reduce(function(ee,j){return typeof j.delete=="number"?(z.scroll.deleteAt(ee,j.delete),ee):ee+(j.retain||j.insert.length||1)},0),this.scroll.batchEnd(),this.update(k)}},{key:"deleteText",value:function(k,z){return this.scroll.deleteAt(k,z),this.update(new c.default().retain(k).delete(z))}},{key:"formatLine",value:function(k,z){var q=this,ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(ne).forEach(function(ee){if(!(q.scroll.whitelist!=null&&!q.scroll.whitelist[ee])){var j=q.scroll.lines(k,Math.max(z,1)),Q=z;j.forEach(function(Z){var re=Z.length();if(!(Z instanceof v.default))Z.format(ee,ne[ee]);else{var se=k-Z.offset(q.scroll),ye=Z.newlineIndex(se+Q)-se+1;Z.formatAt(se,ye,ee,ne[ee])}Q-=re})}}),this.scroll.optimize(),this.update(new c.default().retain(k).retain(z,(0,M.default)(ne)))}},{key:"formatText",value:function(k,z){var q=this,ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(ne).forEach(function(ee){q.scroll.formatAt(k,z,ee,ne[ee])}),this.update(new c.default().retain(k).retain(z,(0,M.default)(ne)))}},{key:"getContents",value:function(k,z){return this.delta.slice(k,k+z)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(k,z){return k.concat(z.delta())},new c.default)}},{key:"getFormat",value:function(k){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,q=[],ne=[];z===0?this.scroll.path(k).forEach(function(j){var Q=o(j,1),Z=Q[0];Z instanceof w.default?q.push(Z):Z instanceof h.default.Leaf&&ne.push(Z)}):(q=this.scroll.lines(k,z),ne=this.scroll.descendants(h.default.Leaf,k,z));var ee=[q,ne].map(function(j){if(j.length===0)return{};for(var Q=(0,y.bubbleFormats)(j.shift());Object.keys(Q).length>0;){var Z=j.shift();if(Z==null)return Q;Q=H((0,y.bubbleFormats)(Z),Q)}return Q});return A.default.apply(A.default,ee)}},{key:"getText",value:function(k,z){return this.getContents(k,z).filter(function(q){return typeof q.insert=="string"}).map(function(q){return q.insert}).join("")}},{key:"insertEmbed",value:function(k,z,q){return this.scroll.insertAt(k,z,q),this.update(new c.default().retain(k).insert(P({},z,q)))}},{key:"insertText",value:function(k,z){var q=this,ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return z=z.replace(/\r\n/g,`
8256`).replace(/\r/g,`
8257`),this.scroll.insertAt(k,z),Object.keys(ne).forEach(function(ee){q.scroll.formatAt(k,z.length,ee,ne[ee])}),this.update(new c.default().retain(k).insert(z,(0,M.default)(ne)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var k=this.scroll.children.head;return k.statics.blotName!==w.default.blotName||k.children.length>1?!1:k.children.head instanceof S.default}},{key:"removeFormat",value:function(k,z){var q=this.getText(k,z),ne=this.scroll.line(k+z),ee=o(ne,2),j=ee[0],Q=ee[1],Z=0,re=new c.default;j!=null&&(j instanceof v.default?Z=j.newlineIndex(Q)-Q+1:Z=j.length()-Q,re=j.delta().slice(Q,Q+Z-1).insert(`
8258`));var se=this.getContents(k,z+Z),ye=se.diff(new c.default().insert(q).concat(re)),Ue=new c.default().retain(k).concat(ye);return this.applyDelta(Ue)}},{key:"update",value:function(k){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,ne=this.delta;if(z.length===1&&z[0].type==="characterData"&&z[0].target.data.match(F)&&h.default.find(z[0].target)){var ee=h.default.find(z[0].target),j=(0,y.bubbleFormats)(ee),Q=ee.offset(this.scroll),Z=z[0].oldValue.replace(p.default.CONTENTS,""),re=new c.default().insert(Z),se=new c.default().insert(ee.value()),ye=new c.default().retain(Q).concat(re.diff(se,q));k=ye.reduce(function(Ue,Ie){return Ie.insert?Ue.insert(Ie.insert,j):Ue.push(Ie)},new c.default),this.delta=ne.compose(k)}else this.delta=this.getDelta(),(!k||!(0,C.default)(ne.compose(k),this.delta))&&(k=ne.diff(this.delta,q));return k}}]),B}();function H(B,G){return Object.keys(G).reduce(function(k,z){return B[z]==null||(G[z]===B[z]?k[z]=G[z]:Array.isArray(G[z])?G[z].indexOf(B[z])<0&&(k[z]=G[z].concat([B[z]])):k[z]=[G[z],B[z]]),k},{})}function $(B){return B.reduce(function(G,k){if(k.insert===1){var z=(0,M.default)(k.attributes);return delete z.image,G.insert({image:k.attributes.image},z)}if(k.attributes!=null&&(k.attributes.list===!0||k.attributes.bullet===!0)&&(k=(0,M.default)(k),k.attributes.list?k.attributes.list="ordered":(k.attributes.list="bullet",delete k.attributes.bullet)),typeof k.insert=="string"){var q=k.insert.replace(/\r\n/g,`
8259`).replace(/\r/g,`
8260`);return G.insert(q,k.attributes)}return G.push(k)},new c.default)}r.default=V},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Range=void 0;var s=function(){function E(C,T){var A=[],R=!0,P=!1,D=void 0;try{for(var F=C[Symbol.iterator](),V;!(R=(V=F.next()).done)&&(A.push(V.value),!(T&&A.length===T));R=!0);}catch(H){P=!0,D=H}finally{try{!R&&F.return&&F.return()}finally{if(P)throw D}}return A}return function(C,T){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return E(C,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function E(C,T){for(var A=0;A<T.length;A++){var R=T[A];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(C,R.key,R)}}return function(C,T,A){return T&&E(C.prototype,T),A&&E(C,A),C}}(),a=i(0),l=p(a),c=i(21),d=p(c),f=i(11),u=p(f),h=i(8),g=p(h),v=i(10),m=p(v);function p(E){return E&&E.__esModule?E:{default:E}}function y(E){if(Array.isArray(E)){for(var C=0,T=Array(E.length);C<E.length;C++)T[C]=E[C];return T}else return Array.from(E)}function w(E,C){if(!(E instanceof C))throw new TypeError("Cannot call a class as a function")}var x=(0,m.default)("quill:selection"),S=function E(C){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;w(this,E),this.index=C,this.length=T},I=function(){function E(C,T){var A=this;w(this,E),this.emitter=T,this.scroll=C,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=l.default.create("cursor",this),this.lastRange=this.savedRange=new S(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){A.mouseDown||setTimeout(A.update.bind(A,g.default.sources.USER),1)}),this.emitter.on(g.default.events.EDITOR_CHANGE,function(R,P){R===g.default.events.TEXT_CHANGE&&P.length()>0&&A.update(g.default.sources.SILENT)}),this.emitter.on(g.default.events.SCROLL_BEFORE_UPDATE,function(){if(A.hasFocus()){var R=A.getNativeRange();R!=null&&R.start.node!==A.cursor.textNode&&A.emitter.once(g.default.events.SCROLL_UPDATE,function(){try{A.setNativeRange(R.start.node,R.start.offset,R.end.node,R.end.offset)}catch{}})}}),this.emitter.on(g.default.events.SCROLL_OPTIMIZE,function(R,P){if(P.range){var D=P.range,F=D.startNode,V=D.startOffset,H=D.endNode,$=D.endOffset;A.setNativeRange(F,V,H,$)}}),this.update(g.default.sources.SILENT)}return o(E,[{key:"handleComposition",value:function(){var T=this;this.root.addEventListener("compositionstart",function(){T.composing=!0}),this.root.addEventListener("compositionend",function(){if(T.composing=!1,T.cursor.parent){var A=T.cursor.restore();if(!A)return;setTimeout(function(){T.setNativeRange(A.startNode,A.startOffset,A.endNode,A.endOffset)},1)}})}},{key:"handleDragging",value:function(){var T=this;this.emitter.listenDOM("mousedown",document.body,function(){T.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){T.mouseDown=!1,T.update(g.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(T,A){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[T])){this.scroll.update();var R=this.getNativeRange();if(!(R==null||!R.native.collapsed||l.default.query(T,l.default.Scope.BLOCK))){if(R.start.node!==this.cursor.textNode){var P=l.default.find(R.start.node,!1);if(P==null)return;if(P instanceof l.default.Leaf){var D=P.split(R.start.offset);P.parent.insertBefore(this.cursor,D)}else P.insertBefore(this.cursor,R.start.node);this.cursor.attach()}this.cursor.format(T,A),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(T){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,R=this.scroll.length();T=Math.min(T,R-1),A=Math.min(T+A,R-1)-T;var P=void 0,D=this.scroll.leaf(T),F=s(D,2),V=F[0],H=F[1];if(V==null)return null;var $=V.position(H,!0),B=s($,2);P=B[0],H=B[1];var G=document.createRange();if(A>0){G.setStart(P,H);var k=this.scroll.leaf(T+A),z=s(k,2);if(V=z[0],H=z[1],V==null)return null;var q=V.position(H,!0),ne=s(q,2);return P=ne[0],H=ne[1],G.setEnd(P,H),G.getBoundingClientRect()}else{var ee="left",j=void 0;return P instanceof Text?(H<P.data.length?(G.setStart(P,H),G.setEnd(P,H+1)):(G.setStart(P,H-1),G.setEnd(P,H),ee="right"),j=G.getBoundingClientRect()):(j=V.domNode.getBoundingClientRect(),H>0&&(ee="right")),{bottom:j.top+j.height,height:j.height,left:j[ee],right:j[ee],top:j.top,width:0}}}},{key:"getNativeRange",value:function(){var T=document.getSelection();if(T==null||T.rangeCount<=0)return null;var A=T.getRangeAt(0);if(A==null)return null;var R=this.normalizeNative(A);return x.info("getNativeRange",R),R}},{key:"getRange",value:function(){var T=this.getNativeRange();if(T==null)return[null,null];var A=this.normalizedToRange(T);return[A,T]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(T){var A=this,R=[[T.start.node,T.start.offset]];T.native.collapsed||R.push([T.end.node,T.end.offset]);var P=R.map(function(V){var H=s(V,2),$=H[0],B=H[1],G=l.default.find($,!0),k=G.offset(A.scroll);return B===0?k:G instanceof l.default.Container?k+G.length():k+G.index($,B)}),D=Math.min(Math.max.apply(Math,y(P)),this.scroll.length()-1),F=Math.min.apply(Math,[D].concat(y(P)));return new S(F,D-F)}},{key:"normalizeNative",value:function(T){if(!M(this.root,T.startContainer)||!T.collapsed&&!M(this.root,T.endContainer))return null;var A={start:{node:T.startContainer,offset:T.startOffset},end:{node:T.endContainer,offset:T.endOffset},native:T};return[A.start,A.end].forEach(function(R){for(var P=R.node,D=R.offset;!(P instanceof Text)&&P.childNodes.length>0;)if(P.childNodes.length>D)P=P.childNodes[D],D=0;else if(P.childNodes.length===D)P=P.lastChild,D=P instanceof Text?P.data.length:P.childNodes.length+1;else break;R.node=P,R.offset=D}),A}},{key:"rangeToNative",value:function(T){var A=this,R=T.collapsed?[T.index]:[T.index,T.index+T.length],P=[],D=this.scroll.length();return R.forEach(function(F,V){F=Math.min(D-1,F);var H=void 0,$=A.scroll.leaf(F),B=s($,2),G=B[0],k=B[1],z=G.position(k,V!==0),q=s(z,2);H=q[0],k=q[1],P.push(H,k)}),P.length<2&&(P=P.concat(P)),P}},{key:"scrollIntoView",value:function(T){var A=this.lastRange;if(A!=null){var R=this.getBounds(A.index,A.length);if(R!=null){var P=this.scroll.length()-1,D=this.scroll.line(Math.min(A.index,P)),F=s(D,1),V=F[0],H=V;if(A.length>0){var $=this.scroll.line(Math.min(A.index+A.length,P)),B=s($,1);H=B[0]}if(!(V==null||H==null)){var G=T.getBoundingClientRect();R.top<G.top?T.scrollTop-=G.top-R.top:R.bottom>G.bottom&&(T.scrollTop+=R.bottom-G.bottom)}}}}},{key:"setNativeRange",value:function(T,A){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:T,P=arguments.length>3&&arguments[3]!==void 0?arguments[3]:A,D=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(x.info("setNativeRange",T,A,R,P),!(T!=null&&(this.root.parentNode==null||T.parentNode==null||R.parentNode==null))){var F=document.getSelection();if(F!=null)if(T!=null){this.hasFocus()||this.root.focus();var V=(this.getNativeRange()||{}).native;if(V==null||D||T!==V.startContainer||A!==V.startOffset||R!==V.endContainer||P!==V.endOffset){T.tagName=="BR"&&(A=[].indexOf.call(T.parentNode.childNodes,T),T=T.parentNode),R.tagName=="BR"&&(P=[].indexOf.call(R.parentNode.childNodes,R),R=R.parentNode);var H=document.createRange();H.setStart(T,A),H.setEnd(R,P),F.removeAllRanges(),F.addRange(H)}}else F.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(T){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.default.sources.API;if(typeof A=="string"&&(R=A,A=!1),x.info("setRange",T),T!=null){var P=this.rangeToNative(T);this.setNativeRange.apply(this,y(P).concat([A]))}else this.setNativeRange(null);this.update(R)}},{key:"update",value:function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g.default.sources.USER,A=this.lastRange,R=this.getRange(),P=s(R,2),D=P[0],F=P[1];if(this.lastRange=D,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,u.default)(A,this.lastRange)){var V;!this.composing&&F!=null&&F.native.collapsed&&F.start.node!==this.cursor.textNode&&this.cursor.restore();var H=[g.default.events.SELECTION_CHANGE,(0,d.default)(this.lastRange),(0,d.default)(A),T];if((V=this.emitter).emit.apply(V,[g.default.events.EDITOR_CHANGE].concat(H)),T!==g.default.sources.SILENT){var $;($=this.emitter).emit.apply($,H)}}}}]),E}();function M(E,C){try{C.parentNode}catch{return!1}return C instanceof Text&&(C=C.parentNode),E.contains(C)}r.Range=S,r.default=I},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function g(v,m){for(var p=0;p<m.length;p++){var y=m[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(v,y.key,y)}}return function(v,m,p){return m&&g(v.prototype,m),p&&g(v,p),v}}(),o=function g(v,m,p){v===null&&(v=Function.prototype);var y=Object.getOwnPropertyDescriptor(v,m);if(y===void 0){var w=Object.getPrototypeOf(v);return w===null?void 0:g(w,m,p)}else{if("value"in y)return y.value;var x=y.get;return x===void 0?void 0:x.call(p)}},a=i(0),l=c(a);function c(g){return g&&g.__esModule?g:{default:g}}function d(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function f(g,v){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:g}function u(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);g.prototype=Object.create(v&&v.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(g,v):g.__proto__=v)}var h=function(g){u(v,g);function v(){return d(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"insertInto",value:function(p,y){p.children.length===0?o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertInto",this).call(this,p,y):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),v}(l.default.Embed);h.blotName="break",h.tagName="BR",r.default=h},function(n,r,i){var s=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,h){u.__proto__=h}||function(u,h){for(var g in h)h.hasOwnProperty(g)&&(u[g]=h[g])};return function(u,h){f(u,h);function g(){this.constructor=u}u.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}();Object.defineProperty(r,"__esModule",{value:!0});var o=i(44),a=i(30),l=i(1),c=function(f){s(u,f);function u(h){var g=f.call(this,h)||this;return g.build(),g}return u.prototype.appendChild=function(h){this.insertBefore(h)},u.prototype.attach=function(){f.prototype.attach.call(this),this.children.forEach(function(h){h.attach()})},u.prototype.build=function(){var h=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(g){try{var v=d(g);h.insertBefore(v,h.children.head||void 0)}catch(m){if(m instanceof l.ParchmentError)return;throw m}})},u.prototype.deleteAt=function(h,g){if(h===0&&g===this.length())return this.remove();this.children.forEachAt(h,g,function(v,m,p){v.deleteAt(m,p)})},u.prototype.descendant=function(h,g){var v=this.children.find(g),m=v[0],p=v[1];return h.blotName==null&&h(m)||h.blotName!=null&&m instanceof h?[m,p]:m instanceof u?m.descendant(h,p):[null,-1]},u.prototype.descendants=function(h,g,v){g===void 0&&(g=0),v===void 0&&(v=Number.MAX_VALUE);var m=[],p=v;return this.children.forEachAt(g,v,function(y,w,x){(h.blotName==null&&h(y)||h.blotName!=null&&y instanceof h)&&m.push(y),y instanceof u&&(m=m.concat(y.descendants(h,w,p))),p-=x}),m},u.prototype.detach=function(){this.children.forEach(function(h){h.detach()}),f.prototype.detach.call(this)},u.prototype.formatAt=function(h,g,v,m){this.children.forEachAt(h,g,function(p,y,w){p.formatAt(y,w,v,m)})},u.prototype.insertAt=function(h,g,v){var m=this.children.find(h),p=m[0],y=m[1];if(p)p.insertAt(y,g,v);else{var w=v==null?l.create("text",g):l.create(g,v);this.appendChild(w)}},u.prototype.insertBefore=function(h,g){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(v){return h instanceof v}))throw new l.ParchmentError("Cannot insert "+h.statics.blotName+" into "+this.statics.blotName);h.insertInto(this,g)},u.prototype.length=function(){return this.children.reduce(function(h,g){return h+g.length()},0)},u.prototype.moveChildren=function(h,g){this.children.forEach(function(v){h.insertBefore(v,g)})},u.prototype.optimize=function(h){if(f.prototype.optimize.call(this,h),this.children.length===0)if(this.statics.defaultChild!=null){var g=l.create(this.statics.defaultChild);this.appendChild(g),g.optimize(h)}else this.remove()},u.prototype.path=function(h,g){g===void 0&&(g=!1);var v=this.children.find(h,g),m=v[0],p=v[1],y=[[this,h]];return m instanceof u?y.concat(m.path(p,g)):(m!=null&&y.push([m,p]),y)},u.prototype.removeChild=function(h){this.children.remove(h)},u.prototype.replace=function(h){h instanceof u&&h.moveChildren(this),f.prototype.replace.call(this,h)},u.prototype.split=function(h,g){if(g===void 0&&(g=!1),!g){if(h===0)return this;if(h===this.length())return this.next}var v=this.clone();return this.parent.insertBefore(v,this.next),this.children.forEachAt(h,this.length(),function(m,p,y){m=m.split(p,g),v.appendChild(m)}),v},u.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},u.prototype.update=function(h,g){var v=this,m=[],p=[];h.forEach(function(y){y.target===v.domNode&&y.type==="childList"&&(m.push.apply(m,y.addedNodes),p.push.apply(p,y.removedNodes))}),p.forEach(function(y){if(!(y.parentNode!=null&&y.tagName!=="IFRAME"&&document.body.compareDocumentPosition(y)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var w=l.find(y);w!=null&&(w.domNode.parentNode==null||w.domNode.parentNode===v.domNode)&&w.detach()}}),m.filter(function(y){return y.parentNode==v.domNode}).sort(function(y,w){return y===w?0:y.compareDocumentPosition(w)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(y){var w=null;y.nextSibling!=null&&(w=l.find(y.nextSibling));var x=d(y);(x.next!=w||x.next==null)&&(x.parent!=null&&x.parent.removeChild(v),v.insertBefore(x,w||void 0))})},u}(a.default);function d(f){var u=l.find(f);if(u==null)try{u=l.create(f)}catch{u=l.create(l.Scope.INLINE),[].slice.call(f.childNodes).forEach(function(g){u.domNode.appendChild(g)}),f.parentNode&&f.parentNode.replaceChild(u.domNode,f),u.attach()}return u}r.default=c},function(n,r,i){var s=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,h){u.__proto__=h}||function(u,h){for(var g in h)h.hasOwnProperty(g)&&(u[g]=h[g])};return function(u,h){f(u,h);function g(){this.constructor=u}u.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}();Object.defineProperty(r,"__esModule",{value:!0});var o=i(12),a=i(31),l=i(17),c=i(1),d=function(f){s(u,f);function u(h){var g=f.call(this,h)||this;return g.attributes=new a.default(g.domNode),g}return u.formats=function(h){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return h.tagName.toLowerCase()},u.prototype.format=function(h,g){var v=c.query(h);v instanceof o.default?this.attributes.attribute(v,g):g&&v!=null&&(h!==this.statics.blotName||this.formats()[h]!==g)&&this.replaceWith(h,g)},u.prototype.formats=function(){var h=this.attributes.values(),g=this.statics.formats(this.domNode);return g!=null&&(h[this.statics.blotName]=g),h},u.prototype.replaceWith=function(h,g){var v=f.prototype.replaceWith.call(this,h,g);return this.attributes.copy(v),v},u.prototype.update=function(h,g){var v=this;f.prototype.update.call(this,h,g),h.some(function(m){return m.target===v.domNode&&m.type==="attributes"})&&this.attributes.build()},u.prototype.wrap=function(h,g){var v=f.prototype.wrap.call(this,h,g);return v instanceof u&&v.statics.scope===this.statics.scope&&this.attributes.move(v),v},u}(l.default);r.default=d},function(n,r,i){var s=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var u in f)f.hasOwnProperty(u)&&(d[u]=f[u])};return function(d,f){c(d,f);function u(){this.constructor=d}d.prototype=f===null?Object.create(f):(u.prototype=f.prototype,new u)}}();Object.defineProperty(r,"__esModule",{value:!0});var o=i(30),a=i(1),l=function(c){s(d,c);function d(){return c!==null&&c.apply(this,arguments)||this}return d.value=function(f){return!0},d.prototype.index=function(f,u){return this.domNode===f||this.domNode.compareDocumentPosition(f)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(u,1):-1},d.prototype.position=function(f,u){var h=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return f>0&&(h+=1),[this.parent.domNode,h]},d.prototype.value=function(){var f;return f={},f[this.statics.blotName]=this.statics.value(this.domNode)||!0,f},d.scope=a.Scope.INLINE_BLOT,d}(o.default);r.default=l},function(n,r,i){var s=i(11),o=i(3),a={attributes:{compose:function(c,d,f){typeof c!="object"&&(c={}),typeof d!="object"&&(d={});var u=o(!0,{},d);f||(u=Object.keys(u).reduce(function(g,v){return u[v]!=null&&(g[v]=u[v]),g},{}));for(var h in c)c[h]!==void 0&&d[h]===void 0&&(u[h]=c[h]);return Object.keys(u).length>0?u:void 0},diff:function(c,d){typeof c!="object"&&(c={}),typeof d!="object"&&(d={});var f=Object.keys(c).concat(Object.keys(d)).reduce(function(u,h){return s(c[h],d[h])||(u[h]=d[h]===void 0?null:d[h]),u},{});return Object.keys(f).length>0?f:void 0},transform:function(c,d,f){if(typeof c!="object")return d;if(typeof d=="object"){if(!f)return d;var u=Object.keys(d).reduce(function(h,g){return c[g]===void 0&&(h[g]=d[g]),h},{});return Object.keys(u).length>0?u:void 0}}},iterator:function(c){return new l(c)},length:function(c){return typeof c.delete=="number"?c.delete:typeof c.retain=="number"?c.retain:typeof c.insert=="string"?c.insert.length:1}};function l(c){this.ops=c,this.index=0,this.offset=0}l.prototype.hasNext=function(){return this.peekLength()<1/0},l.prototype.next=function(c){c||(c=1/0);var d=this.ops[this.index];if(d){var f=this.offset,u=a.length(d);if(c>=u-f?(c=u-f,this.index+=1,this.offset=0):this.offset+=c,typeof d.delete=="number")return{delete:c};var h={};return d.attributes&&(h.attributes=d.attributes),typeof d.retain=="number"?h.retain=c:typeof d.insert=="string"?h.insert=d.insert.substr(f,c):h.insert=d.insert,h}else return{retain:1/0}},l.prototype.peek=function(){return this.ops[this.index]},l.prototype.peekLength=function(){return this.ops[this.index]?a.length(this.ops[this.index])-this.offset:1/0},l.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},l.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var c=this.offset,d=this.index,f=this.next(),u=this.ops.slice(this.index);return this.offset=c,this.index=d,[f].concat(u)}else return[]},n.exports=a},function(n,r){var i=function(){function s(v,m){return m!=null&&v instanceof m}var o;try{o=Map}catch{o=function(){}}var a;try{a=Set}catch{a=function(){}}var l;try{l=Promise}catch{l=function(){}}function c(v,m,p,y,w){typeof m=="object"&&(p=m.depth,y=m.prototype,w=m.includeNonEnumerable,m=m.circular);var x=[],S=[],I=typeof Buffer<"u";typeof m>"u"&&(m=!0),typeof p>"u"&&(p=1/0);function M(E,C){if(E===null)return null;if(C===0)return E;var T,A;if(typeof E!="object")return E;if(s(E,o))T=new o;else if(s(E,a))T=new a;else if(s(E,l))T=new l(function(G,k){E.then(function(z){G(M(z,C-1))},function(z){k(M(z,C-1))})});else if(c.__isArray(E))T=[];else if(c.__isRegExp(E))T=new RegExp(E.source,g(E)),E.lastIndex&&(T.lastIndex=E.lastIndex);else if(c.__isDate(E))T=new Date(E.getTime());else{if(I&&Buffer.isBuffer(E))return Buffer.allocUnsafe?T=Buffer.allocUnsafe(E.length):T=new Buffer(E.length),E.copy(T),T;s(E,Error)?T=Object.create(E):typeof y>"u"?(A=Object.getPrototypeOf(E),T=Object.create(A)):(T=Object.create(y),A=y)}if(m){var R=x.indexOf(E);if(R!=-1)return S[R];x.push(E),S.push(T)}s(E,o)&&E.forEach(function(G,k){var z=M(k,C-1),q=M(G,C-1);T.set(z,q)}),s(E,a)&&E.forEach(function(G){var k=M(G,C-1);T.add(k)});for(var P in E){var D;A&&(D=Object.getOwnPropertyDescriptor(A,P)),!(D&&D.set==null)&&(T[P]=M(E[P],C-1))}if(Object.getOwnPropertySymbols)for(var F=Object.getOwnPropertySymbols(E),P=0;P<F.length;P++){var V=F[P],H=Object.getOwnPropertyDescriptor(E,V);H&&!H.enumerable&&!w||(T[V]=M(E[V],C-1),H.enumerable||Object.defineProperty(T,V,{enumerable:!1}))}if(w)for(var $=Object.getOwnPropertyNames(E),P=0;P<$.length;P++){var B=$[P],H=Object.getOwnPropertyDescriptor(E,B);H&&H.enumerable||(T[B]=M(E[B],C-1),Object.defineProperty(T,B,{enumerable:!1}))}return T}return M(v,p)}c.clonePrototype=function(m){if(m===null)return null;var p=function(){};return p.prototype=m,new p};function d(v){return Object.prototype.toString.call(v)}c.__objToStr=d;function f(v){return typeof v=="object"&&d(v)==="[object Date]"}c.__isDate=f;function u(v){return typeof v=="object"&&d(v)==="[object Array]"}c.__isArray=u;function h(v){return typeof v=="object"&&d(v)==="[object RegExp]"}c.__isRegExp=h;function g(v){var m="";return v.global&&(m+="g"),v.ignoreCase&&(m+="i"),v.multiline&&(m+="m"),m}return c.__getRegExpFlags=g,c}();typeof n=="object"&&n.exports&&(n.exports=i)},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function T(A,R){var P=[],D=!0,F=!1,V=void 0;try{for(var H=A[Symbol.iterator](),$;!(D=($=H.next()).done)&&(P.push($.value),!(R&&P.length===R));D=!0);}catch(B){F=!0,V=B}finally{try{!D&&H.return&&H.return()}finally{if(F)throw V}}return P}return function(A,R){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return T(A,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function T(A,R){for(var P=0;P<R.length;P++){var D=R[P];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(A,D.key,D)}}return function(A,R,P){return R&&T(A.prototype,R),P&&T(A,P),A}}(),a=function T(A,R,P){A===null&&(A=Function.prototype);var D=Object.getOwnPropertyDescriptor(A,R);if(D===void 0){var F=Object.getPrototypeOf(A);return F===null?void 0:T(F,R,P)}else{if("value"in D)return D.value;var V=D.get;return V===void 0?void 0:V.call(P)}},l=i(0),c=x(l),d=i(8),f=x(d),u=i(4),h=x(u),g=i(16),v=x(g),m=i(13),p=x(m),y=i(25),w=x(y);function x(T){return T&&T.__esModule?T:{default:T}}function S(T,A){if(!(T instanceof A))throw new TypeError("Cannot call a class as a function")}function I(T,A){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:T}function M(T,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);T.prototype=Object.create(A&&A.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(T,A):T.__proto__=A)}function E(T){return T instanceof h.default||T instanceof u.BlockEmbed}var C=function(T){M(A,T);function A(R,P){S(this,A);var D=I(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,R));return D.emitter=P.emitter,Array.isArray(P.whitelist)&&(D.whitelist=P.whitelist.reduce(function(F,V){return F[V]=!0,F},{})),D.domNode.addEventListener("DOMNodeInserted",function(){}),D.optimize(),D.enable(),D}return o(A,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(P,D){var F=this.line(P),V=s(F,2),H=V[0],$=V[1],B=this.line(P+D),G=s(B,1),k=G[0];if(a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"deleteAt",this).call(this,P,D),k!=null&&H!==k&&$>0){if(H instanceof u.BlockEmbed||k instanceof u.BlockEmbed){this.optimize();return}if(H instanceof p.default){var z=H.newlineIndex(H.length(),!0);if(z>-1&&(H=H.split(z+1),H===k)){this.optimize();return}}else if(k instanceof p.default){var q=k.newlineIndex(0);q>-1&&k.split(q+1)}var ne=k.children.head instanceof v.default?null:k.children.head;H.moveChildren(k,ne),H.remove()}this.optimize()}},{key:"enable",value:function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",P)}},{key:"formatAt",value:function(P,D,F,V){this.whitelist!=null&&!this.whitelist[F]||(a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"formatAt",this).call(this,P,D,F,V),this.optimize())}},{key:"insertAt",value:function(P,D,F){if(!(F!=null&&this.whitelist!=null&&!this.whitelist[D])){if(P>=this.length())if(F==null||c.default.query(D,c.default.Scope.BLOCK)==null){var V=c.default.create(this.statics.defaultChild);this.appendChild(V),F==null&&D.endsWith(`
8261`)&&(D=D.slice(0,-1)),V.insertAt(0,D,F)}else{var H=c.default.create(D,F);this.appendChild(H)}else a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertAt",this).call(this,P,D,F);this.optimize()}}},{key:"insertBefore",value:function(P,D){if(P.statics.scope===c.default.Scope.INLINE_BLOT){var F=c.default.create(this.statics.defaultChild);F.appendChild(P),P=F}a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertBefore",this).call(this,P,D)}},{key:"leaf",value:function(P){return this.path(P).pop()||[null,-1]}},{key:"line",value:function(P){return P===this.length()?this.line(P-1):this.descendant(E,P)}},{key:"lines",value:function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,F=function V(H,$,B){var G=[],k=B;return H.children.forEachAt($,B,function(z,q,ne){E(z)?G.push(z):z instanceof c.default.Container&&(G=G.concat(V(z,q,k))),k-=ne}),G};return F(this,P,D)}},{key:"optimize",value:function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"optimize",this).call(this,P,D),P.length>0&&this.emitter.emit(f.default.events.SCROLL_OPTIMIZE,P,D))}},{key:"path",value:function(P){return a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"path",this).call(this,P).slice(1)}},{key:"update",value:function(P){if(this.batch!==!0){var D=f.default.sources.USER;typeof P=="string"&&(D=P),Array.isArray(P)||(P=this.observer.takeRecords()),P.length>0&&this.emitter.emit(f.default.events.SCROLL_BEFORE_UPDATE,D,P),a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"update",this).call(this,P.concat([])),P.length>0&&this.emitter.emit(f.default.events.SCROLL_UPDATE,D,P)}}}]),A}(c.default.Scroll);C.blotName="scroll",C.className="ql-editor",C.tagName="DIV",C.defaultChild="block",C.allowedChildren=[h.default,u.BlockEmbed,w.default],r.default=C},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.SHORTKEY=r.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},o=function(){function j(Q,Z){var re=[],se=!0,ye=!1,Ue=void 0;try{for(var Ie=Q[Symbol.iterator](),je;!(se=(je=Ie.next()).done)&&(re.push(je.value),!(Z&&re.length===Z));se=!0);}catch(Ke){ye=!0,Ue=Ke}finally{try{!se&&Ie.return&&Ie.return()}finally{if(ye)throw Ue}}return re}return function(Q,Z){if(Array.isArray(Q))return Q;if(Symbol.iterator in Object(Q))return j(Q,Z);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function j(Q,Z){for(var re=0;re<Z.length;re++){var se=Z[re];se.enumerable=se.enumerable||!1,se.configurable=!0,"value"in se&&(se.writable=!0),Object.defineProperty(Q,se.key,se)}}return function(Q,Z,re){return Z&&j(Q.prototype,Z),re&&j(Q,re),Q}}(),l=i(21),c=T(l),d=i(11),f=T(d),u=i(3),h=T(u),g=i(2),v=T(g),m=i(20),p=T(m),y=i(0),w=T(y),x=i(5),S=T(x),I=i(10),M=T(I),E=i(9),C=T(E);function T(j){return j&&j.__esModule?j:{default:j}}function A(j,Q,Z){return Q in j?Object.defineProperty(j,Q,{value:Z,enumerable:!0,configurable:!0,writable:!0}):j[Q]=Z,j}function R(j,Q){if(!(j instanceof Q))throw new TypeError("Cannot call a class as a function")}function P(j,Q){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Q&&(typeof Q=="object"||typeof Q=="function")?Q:j}function D(j,Q){if(typeof Q!="function"&&Q!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Q);j.prototype=Object.create(Q&&Q.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}),Q&&(Object.setPrototypeOf?Object.setPrototypeOf(j,Q):j.__proto__=Q)}var F=(0,M.default)("quill:keyboard"),V=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",H=function(j){D(Q,j),a(Q,null,[{key:"match",value:function(re,se){return se=ee(se),["altKey","ctrlKey","metaKey","shiftKey"].some(function(ye){return!!se[ye]!==re[ye]&&se[ye]!==null})?!1:se.key===(re.which||re.keyCode)}}]);function Q(Z,re){R(this,Q);var se=P(this,(Q.__proto__||Object.getPrototypeOf(Q)).call(this,Z,re));return se.bindings={},Object.keys(se.options.bindings).forEach(function(ye){ye==="list autofill"&&Z.scroll.whitelist!=null&&!Z.scroll.whitelist.list||se.options.bindings[ye]&&se.addBinding(se.options.bindings[ye])}),se.addBinding({key:Q.keys.ENTER,shiftKey:null},z),se.addBinding({key:Q.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(se.addBinding({key:Q.keys.BACKSPACE},{collapsed:!0},B),se.addBinding({key:Q.keys.DELETE},{collapsed:!0},G)):(se.addBinding({key:Q.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},B),se.addBinding({key:Q.keys.DELETE},{collapsed:!0,suffix:/^.?$/},G)),se.addBinding({key:Q.keys.BACKSPACE},{collapsed:!1},k),se.addBinding({key:Q.keys.DELETE},{collapsed:!1},k),se.addBinding({key:Q.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},B),se.listen(),se}return a(Q,[{key:"addBinding",value:function(re){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ye=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ue=ee(re);if(Ue==null||Ue.key==null)return F.warn("Attempted to add invalid keyboard binding",Ue);typeof se=="function"&&(se={handler:se}),typeof ye=="function"&&(ye={handler:ye}),Ue=(0,h.default)(Ue,se,ye),this.bindings[Ue.key]=this.bindings[Ue.key]||[],this.bindings[Ue.key].push(Ue)}},{key:"listen",value:function(){var re=this;this.quill.root.addEventListener("keydown",function(se){if(!se.defaultPrevented){var ye=se.which||se.keyCode,Ue=(re.bindings[ye]||[]).filter(function(Ee){return Q.match(se,Ee)});if(Ue.length!==0){var Ie=re.quill.getSelection();if(!(Ie==null||!re.quill.hasFocus())){var je=re.quill.getLine(Ie.index),Ke=o(je,2),Xe=Ke[0],dt=Ke[1],K=re.quill.getLeaf(Ie.index),de=o(K,2),_e=de[0],Ae=de[1],ce=Ie.length===0?[_e,Ae]:re.quill.getLeaf(Ie.index+Ie.length),X=o(ce,2),U=X[0],J=X[1],he=_e instanceof w.default.Text?_e.value().slice(0,Ae):"",me=U instanceof w.default.Text?U.value().slice(J):"",fe={collapsed:Ie.length===0,empty:Ie.length===0&&Xe.length()<=1,format:re.quill.getFormat(Ie),offset:dt,prefix:he,suffix:me},Ve=Ue.some(function(Ee){if(Ee.collapsed!=null&&Ee.collapsed!==fe.collapsed||Ee.empty!=null&&Ee.empty!==fe.empty||Ee.offset!=null&&Ee.offset!==fe.offset)return!1;if(Array.isArray(Ee.format)){if(Ee.format.every(function(qe){return fe.format[qe]==null}))return!1}else if(s(Ee.format)==="object"&&!Object.keys(Ee.format).every(function(qe){return Ee.format[qe]===!0?fe.format[qe]!=null:Ee.format[qe]===!1?fe.format[qe]==null:(0,f.default)(Ee.format[qe],fe.format[qe])}))return!1;return Ee.prefix!=null&&!Ee.prefix.test(fe.prefix)||Ee.suffix!=null&&!Ee.suffix.test(fe.suffix)?!1:Ee.handler.call(re,Ie,fe)!==!0});Ve&&se.preventDefault()}}}})}}]),Q}(C.default);H.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},H.DEFAULTS={bindings:{bold:ne("bold"),italic:ne("italic"),underline:ne("underline"),indent:{key:H.keys.TAB,format:["blockquote","indent","list"],handler:function(Q,Z){if(Z.collapsed&&Z.offset!==0)return!0;this.quill.format("indent","+1",S.default.sources.USER)}},outdent:{key:H.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(Q,Z){if(Z.collapsed&&Z.offset!==0)return!0;this.quill.format("indent","-1",S.default.sources.USER)}},"outdent backspace":{key:H.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(Q,Z){Z.format.indent!=null?this.quill.format("indent","-1",S.default.sources.USER):Z.format.list!=null&&this.quill.format("list",!1,S.default.sources.USER)}},"indent code-block":q(!0),"outdent code-block":q(!1),"remove tab":{key:H.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(Q){this.quill.deleteText(Q.index-1,1,S.default.sources.USER)}},tab:{key:H.keys.TAB,handler:function(Q){this.quill.history.cutoff();var Z=new v.default().retain(Q.index).delete(Q.length).insert("	");this.quill.updateContents(Z,S.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(Q.index+1,S.default.sources.SILENT)}},"list empty enter":{key:H.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(Q,Z){this.quill.format("list",!1,S.default.sources.USER),Z.format.indent&&this.quill.format("indent",!1,S.default.sources.USER)}},"checklist enter":{key:H.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(Q){var Z=this.quill.getLine(Q.index),re=o(Z,2),se=re[0],ye=re[1],Ue=(0,h.default)({},se.formats(),{list:"checked"}),Ie=new v.default().retain(Q.index).insert(`
8262`,Ue).retain(se.length()-ye-1).retain(1,{list:"unchecked"});this.quill.updateContents(Ie,S.default.sources.USER),this.quill.setSelection(Q.index+1,S.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:H.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(Q,Z){var re=this.quill.getLine(Q.index),se=o(re,2),ye=se[0],Ue=se[1],Ie=new v.default().retain(Q.index).insert(`
8263`,Z.format).retain(ye.length()-Ue-1).retain(1,{header:null});this.quill.updateContents(Ie,S.default.sources.USER),this.quill.setSelection(Q.index+1,S.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(Q,Z){var re=Z.prefix.length,se=this.quill.getLine(Q.index),ye=o(se,2),Ue=ye[0],Ie=ye[1];if(Ie>re)return!0;var je=void 0;switch(Z.prefix.trim()){case"[]":case"[ ]":je="unchecked";break;case"[x]":je="checked";break;case"-":case"*":je="bullet";break;default:je="ordered"}this.quill.insertText(Q.index," ",S.default.sources.USER),this.quill.history.cutoff();var Ke=new v.default().retain(Q.index-Ie).delete(re+1).retain(Ue.length()-2-Ie).retain(1,{list:je});this.quill.updateContents(Ke,S.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(Q.index-re,S.default.sources.SILENT)}},"code exit":{key:H.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(Q){var Z=this.quill.getLine(Q.index),re=o(Z,2),se=re[0],ye=re[1],Ue=new v.default().retain(Q.index+se.length()-ye-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(Ue,S.default.sources.USER)}},"embed left":$(H.keys.LEFT,!1),"embed left shift":$(H.keys.LEFT,!0),"embed right":$(H.keys.RIGHT,!1),"embed right shift":$(H.keys.RIGHT,!0)}};function $(j,Q){var Z,re=j===H.keys.LEFT?"prefix":"suffix";return Z={key:j,shiftKey:Q,altKey:null},A(Z,re,/^$/),A(Z,"handler",function(ye){var Ue=ye.index;j===H.keys.RIGHT&&(Ue+=ye.length+1);var Ie=this.quill.getLeaf(Ue),je=o(Ie,1),Ke=je[0];return Ke instanceof w.default.Embed?(j===H.keys.LEFT?Q?this.quill.setSelection(ye.index-1,ye.length+1,S.default.sources.USER):this.quill.setSelection(ye.index-1,S.default.sources.USER):Q?this.quill.setSelection(ye.index,ye.length+1,S.default.sources.USER):this.quill.setSelection(ye.index+ye.length+1,S.default.sources.USER),!1):!0}),Z}function B(j,Q){if(!(j.index===0||this.quill.getLength()<=1)){var Z=this.quill.getLine(j.index),re=o(Z,1),se=re[0],ye={};if(Q.offset===0){var Ue=this.quill.getLine(j.index-1),Ie=o(Ue,1),je=Ie[0];if(je!=null&&je.length()>1){var Ke=se.formats(),Xe=this.quill.getFormat(j.index-1,1);ye=p.default.attributes.diff(Ke,Xe)||{}}}var dt=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(Q.prefix)?2:1;this.quill.deleteText(j.index-dt,dt,S.default.sources.USER),Object.keys(ye).length>0&&this.quill.formatLine(j.index-dt,dt,ye,S.default.sources.USER),this.quill.focus()}}function G(j,Q){var Z=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(Q.suffix)?2:1;if(!(j.index>=this.quill.getLength()-Z)){var re={},se=0,ye=this.quill.getLine(j.index),Ue=o(ye,1),Ie=Ue[0];if(Q.offset>=Ie.length()-1){var je=this.quill.getLine(j.index+1),Ke=o(je,1),Xe=Ke[0];if(Xe){var dt=Ie.formats(),K=this.quill.getFormat(j.index,1);re=p.default.attributes.diff(dt,K)||{},se=Xe.length()}}this.quill.deleteText(j.index,Z,S.default.sources.USER),Object.keys(re).length>0&&this.quill.formatLine(j.index+se-1,Z,re,S.default.sources.USER)}}function k(j){var Q=this.quill.getLines(j),Z={};if(Q.length>1){var re=Q[0].formats(),se=Q[Q.length-1].formats();Z=p.default.attributes.diff(se,re)||{}}this.quill.deleteText(j,S.default.sources.USER),Object.keys(Z).length>0&&this.quill.formatLine(j.index,1,Z,S.default.sources.USER),this.quill.setSelection(j.index,S.default.sources.SILENT),this.quill.focus()}function z(j,Q){var Z=this;j.length>0&&this.quill.scroll.deleteAt(j.index,j.length);var re=Object.keys(Q.format).reduce(function(se,ye){return w.default.query(ye,w.default.Scope.BLOCK)&&!Array.isArray(Q.format[ye])&&(se[ye]=Q.format[ye]),se},{});this.quill.insertText(j.index,`
8264`,re,S.default.sources.USER),this.quill.setSelection(j.index+1,S.default.sources.SILENT),this.quill.focus(),Object.keys(Q.format).forEach(function(se){re[se]==null&&(Array.isArray(Q.format[se])||se!=="link"&&Z.quill.format(se,Q.format[se],S.default.sources.USER))})}function q(j){return{key:H.keys.TAB,shiftKey:!j,format:{"code-block":!0},handler:function(Z){var re=w.default.query("code-block"),se=Z.index,ye=Z.length,Ue=this.quill.scroll.descendant(re,se),Ie=o(Ue,2),je=Ie[0],Ke=Ie[1];if(je!=null){var Xe=this.quill.getIndex(je),dt=je.newlineIndex(Ke,!0)+1,K=je.newlineIndex(Xe+Ke+ye),de=je.domNode.textContent.slice(dt,K).split(`
8265`);Ke=0,de.forEach(function(_e,Ae){j?(je.insertAt(dt+Ke,re.TAB),Ke+=re.TAB.length,Ae===0?se+=re.TAB.length:ye+=re.TAB.length):_e.startsWith(re.TAB)&&(je.deleteAt(dt+Ke,re.TAB.length),Ke-=re.TAB.length,Ae===0?se-=re.TAB.length:ye-=re.TAB.length),Ke+=_e.length+1}),this.quill.update(S.default.sources.USER),this.quill.setSelection(se,ye,S.default.sources.SILENT)}}}}function ne(j){return{key:j[0].toUpperCase(),shortKey:!0,handler:function(Z,re){this.quill.format(j,!re.format[j],S.default.sources.USER)}}}function ee(j){if(typeof j=="string"||typeof j=="number")return ee({key:j});if((typeof j>"u"?"undefined":s(j))==="object"&&(j=(0,c.default)(j,!1)),typeof j.key=="string")if(H.keys[j.key.toUpperCase()]!=null)j.key=H.keys[j.key.toUpperCase()];else if(j.key.length===1)j.key=j.key.toUpperCase().charCodeAt(0);else return null;return j.shortKey&&(j[V]=j.shortKey,delete j.shortKey),j}r.default=H,r.SHORTKEY=V},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function p(y,w){var x=[],S=!0,I=!1,M=void 0;try{for(var E=y[Symbol.iterator](),C;!(S=(C=E.next()).done)&&(x.push(C.value),!(w&&x.length===w));S=!0);}catch(T){I=!0,M=T}finally{try{!S&&E.return&&E.return()}finally{if(I)throw M}}return x}return function(y,w){if(Array.isArray(y))return y;if(Symbol.iterator in Object(y))return p(y,w);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function p(y,w,x){y===null&&(y=Function.prototype);var S=Object.getOwnPropertyDescriptor(y,w);if(S===void 0){var I=Object.getPrototypeOf(y);return I===null?void 0:p(I,w,x)}else{if("value"in S)return S.value;var M=S.get;return M===void 0?void 0:M.call(x)}},a=function(){function p(y,w){for(var x=0;x<w.length;x++){var S=w[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(y,S.key,S)}}return function(y,w,x){return w&&p(y.prototype,w),x&&p(y,x),y}}(),l=i(0),c=u(l),d=i(7),f=u(d);function u(p){return p&&p.__esModule?p:{default:p}}function h(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function g(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function v(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var m=function(p){v(y,p),a(y,null,[{key:"value",value:function(){}}]);function y(w,x){h(this,y);var S=g(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,w));return S.selection=x,S.textNode=document.createTextNode(y.CONTENTS),S.domNode.appendChild(S.textNode),S._length=0,S}return a(y,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(x,S){if(this._length!==0)return o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,x,S);for(var I=this,M=0;I!=null&&I.statics.scope!==c.default.Scope.BLOCK_BLOT;)M+=I.offset(I.parent),I=I.parent;I!=null&&(this._length=y.CONTENTS.length,I.optimize(),I.formatAt(M,y.CONTENTS.length,x,S),this._length=0)}},{key:"index",value:function(x,S){return x===this.textNode?0:o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,x,S)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var x=this.textNode,S=this.selection.getNativeRange(),I=void 0,M=void 0,E=void 0;if(S!=null&&S.start.node===x&&S.end.node===x){var C=[x,S.start.offset,S.end.offset];I=C[0],M=C[1],E=C[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==y.CONTENTS){var T=this.textNode.data.split(y.CONTENTS).join("");this.next instanceof f.default?(I=this.next.domNode,this.next.insertAt(0,T),this.textNode.data=y.CONTENTS):(this.textNode.data=T,this.parent.insertBefore(c.default.create(this.textNode),this),this.textNode=document.createTextNode(y.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),M!=null){var A=[M,E].map(function(P){return Math.max(0,Math.min(I.data.length,P-1))}),R=s(A,2);return M=R[0],E=R[1],{startNode:I,startOffset:M,endNode:I,endOffset:E}}}}},{key:"update",value:function(x,S){var I=this;if(x.some(function(E){return E.type==="characterData"&&E.target===I.textNode})){var M=this.restore();M&&(S.range=M)}}},{key:"value",value:function(){return""}}]),y}(c.default.Embed);m.blotName="cursor",m.className="ql-cursor",m.tagName="span",m.CONTENTS="\uFEFF",r.default=m},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(0),o=c(s),a=i(4),l=c(a);function c(g){return g&&g.__esModule?g:{default:g}}function d(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function f(g,v){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:g}function u(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);g.prototype=Object.create(v&&v.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(g,v):g.__proto__=v)}var h=function(g){u(v,g);function v(){return d(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(o.default.Container);h.allowedChildren=[l.default,a.BlockEmbed,h],r.default=h},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.ColorStyle=r.ColorClass=r.ColorAttributor=void 0;var s=function(){function m(p,y){for(var w=0;w<y.length;w++){var x=y[w];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(p,x.key,x)}}return function(p,y,w){return y&&m(p.prototype,y),w&&m(p,w),p}}(),o=function m(p,y,w){p===null&&(p=Function.prototype);var x=Object.getOwnPropertyDescriptor(p,y);if(x===void 0){var S=Object.getPrototypeOf(p);return S===null?void 0:m(S,y,w)}else{if("value"in x)return x.value;var I=x.get;return I===void 0?void 0:I.call(w)}},a=i(0),l=c(a);function c(m){return m&&m.__esModule?m:{default:m}}function d(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}function f(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:m}function u(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}var h=function(m){u(p,m);function p(){return d(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return s(p,[{key:"value",value:function(w){var x=o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"value",this).call(this,w);return x.startsWith("rgb(")?(x=x.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+x.split(",").map(function(S){return("00"+parseInt(S).toString(16)).slice(-2)}).join("")):x}}]),p}(l.default.Attributor.Style),g=new l.default.Attributor.Class("color","ql-color",{scope:l.default.Scope.INLINE}),v=new h("color","color",{scope:l.default.Scope.INLINE});r.ColorAttributor=h,r.ColorClass=g,r.ColorStyle=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.sanitize=r.default=void 0;var s=function(){function v(m,p){for(var y=0;y<p.length;y++){var w=p[y];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,p,y){return p&&v(m.prototype,p),y&&v(m,y),m}}(),o=function v(m,p,y){m===null&&(m=Function.prototype);var w=Object.getOwnPropertyDescriptor(m,p);if(w===void 0){var x=Object.getPrototypeOf(m);return x===null?void 0:v(x,p,y)}else{if("value"in w)return w.value;var S=w.get;return S===void 0?void 0:S.call(y)}},a=i(6),l=c(a);function c(v){return v&&v.__esModule?v:{default:v}}function d(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function f(v,m){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:v}function u(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(v,m):v.__proto__=m)}var h=function(v){u(m,v);function m(){return d(this,m),f(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return s(m,[{key:"format",value:function(y,w){if(y!==this.statics.blotName||!w)return o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"format",this).call(this,y,w);w=this.constructor.sanitize(w),this.domNode.setAttribute("href",w)}}],[{key:"create",value:function(y){var w=o(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,y);return y=this.sanitize(y),w.setAttribute("href",y),w.setAttribute("rel","noopener noreferrer"),w.setAttribute("target","_blank"),w}},{key:"formats",value:function(y){return y.getAttribute("href")}},{key:"sanitize",value:function(y){return g(y,this.PROTOCOL_WHITELIST)?y:this.SANITIZED_URL}}]),m}(l.default);h.blotName="link",h.tagName="A",h.SANITIZED_URL="about:blank",h.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function g(v,m){var p=document.createElement("a");p.href=v;var y=p.href.slice(0,p.href.indexOf(":"));return m.indexOf(y)>-1}r.default=h,r.sanitize=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},o=function(){function m(p,y){for(var w=0;w<y.length;w++){var x=y[w];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(p,x.key,x)}}return function(p,y,w){return y&&m(p.prototype,y),w&&m(p,w),p}}(),a=i(23),l=f(a),c=i(107),d=f(c);function f(m){return m&&m.__esModule?m:{default:m}}function u(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}var h=0;function g(m,p){m.setAttribute(p,m.getAttribute(p)!=="true")}var v=function(){function m(p){var y=this;u(this,m),this.select=p,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){y.togglePicker()}),this.label.addEventListener("keydown",function(w){switch(w.keyCode){case l.default.keys.ENTER:y.togglePicker();break;case l.default.keys.ESCAPE:y.escape(),w.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(m,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),g(this.label,"aria-expanded"),g(this.options,"aria-hidden")}},{key:"buildItem",value:function(y){var w=this,x=document.createElement("span");return x.tabIndex="0",x.setAttribute("role","button"),x.classList.add("ql-picker-item"),y.hasAttribute("value")&&x.setAttribute("data-value",y.getAttribute("value")),y.textContent&&x.setAttribute("data-label",y.textContent),x.addEventListener("click",function(){w.selectItem(x,!0)}),x.addEventListener("keydown",function(S){switch(S.keyCode){case l.default.keys.ENTER:w.selectItem(x,!0),S.preventDefault();break;case l.default.keys.ESCAPE:w.escape(),S.preventDefault();break}}),x}},{key:"buildLabel",value:function(){var y=document.createElement("span");return y.classList.add("ql-picker-label"),y.innerHTML=d.default,y.tabIndex="0",y.setAttribute("role","button"),y.setAttribute("aria-expanded","false"),this.container.appendChild(y),y}},{key:"buildOptions",value:function(){var y=this,w=document.createElement("span");w.classList.add("ql-picker-options"),w.setAttribute("aria-hidden","true"),w.tabIndex="-1",w.id="ql-picker-options-"+h,h+=1,this.label.setAttribute("aria-controls",w.id),this.options=w,[].slice.call(this.select.options).forEach(function(x){var S=y.buildItem(x);w.appendChild(S),x.selected===!0&&y.selectItem(S)}),this.container.appendChild(w)}},{key:"buildPicker",value:function(){var y=this;[].slice.call(this.select.attributes).forEach(function(w){y.container.setAttribute(w.name,w.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var y=this;this.close(),setTimeout(function(){return y.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","fal
8265se"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(y){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,x=this.container.querySelector(".ql-selected");if(y!==x&&(x!=null&&x.classList.remove("ql-selected"),y!=null&&(y.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(y.parentNode.children,y),y.hasAttribute("data-value")?this.label.setAttribute("data-value",y.getAttribute("data-value")):this.label.removeAttribute("data-value"),y.hasAttribute("data-label")?this.label.setAttribute("data-label",y.getAttribute("data-label")):this.label.removeAttribute("data-label"),w))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":s(Event))==="object"){var S=document.createEvent("Event");S.initEvent("change",!0,!0),this.select.dispatchEvent(S)}this.close()}}},{key:"update",value:function(){var y=void 0;if(this.select.selectedIndex>-1){var w=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];y=this.select.options[this.select.selectedIndex],this.selectItem(w)}else this.selectItem(null);var x=y!=null&&y!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",x)}}]),m}();r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(0),o=F(s),a=i(5),l=F(a),c=i(4),d=F(c),f=i(16),u=F(f),h=i(25),g=F(h),v=i(24),m=F(v),p=i(35),y=F(p),w=i(6),x=F(w),S=i(22),I=F(S),M=i(7),E=F(M),C=i(55),T=F(C),A=i(42),R=F(A),P=i(23),D=F(P);function F(V){return V&&V.__esModule?V:{default:V}}l.default.register({"blots/block":d.default,"blots/block/embed":c.BlockEmbed,"blots/break":u.default,"blots/container":g.default,"blots/cursor":m.default,"blots/embed":y.default,"blots/inline":x.default,"blots/scroll":I.default,"blots/text":E.default,"modules/clipboard":T.default,"modules/history":R.default,"modules/keyboard":D.default}),o.default.register(d.default,u.default,m.default,x.default,I.default,E.default),r.default=l.default},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(1),o=function(){function a(l){this.domNode=l,this.domNode[s.DATA_KEY]={blot:this}}return Object.defineProperty(a.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),a.create=function(l){if(this.tagName==null)throw new s.ParchmentError("Blot definition missing tagName");var c;return Array.isArray(this.tagName)?(typeof l=="string"&&(l=l.toUpperCase(),parseInt(l).toString()===l&&(l=parseInt(l))),typeof l=="number"?c=document.createElement(this.tagName[l-1]):this.tagName.indexOf(l)>-1?c=document.createElement(l):c=document.createElement(this.tagName[0])):c=document.createElement(this.tagName),this.className&&c.classList.add(this.className),c},a.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},a.prototype.clone=function(){var l=this.domNode.cloneNode(!1);return s.create(l)},a.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[s.DATA_KEY]},a.prototype.deleteAt=function(l,c){var d=this.isolate(l,c);d.remove()},a.prototype.formatAt=function(l,c,d,f){var u=this.isolate(l,c);if(s.query(d,s.Scope.BLOT)!=null&&f)u.wrap(d,f);else if(s.query(d,s.Scope.ATTRIBUTE)!=null){var h=s.create(this.statics.scope);u.wrap(h),h.format(d,f)}},a.prototype.insertAt=function(l,c,d){var f=d==null?s.create("text",c):s.create(c,d),u=this.split(l);this.parent.insertBefore(f,u)},a.prototype.insertInto=function(l,c){c===void 0&&(c=null),this.parent!=null&&this.parent.children.remove(this);var d=null;l.children.insertBefore(this,c),c!=null&&(d=c.domNode),(this.domNode.parentNode!=l.domNode||this.domNode.nextSibling!=d)&&l.domNode.insertBefore(this.domNode,d),this.parent=l,this.attach()},a.prototype.isolate=function(l,c){var d=this.split(l);return d.split(c),d},a.prototype.length=function(){return 1},a.prototype.offset=function(l){return l===void 0&&(l=this.parent),this.parent==null||this==l?0:this.parent.children.offset(this)+this.parent.offset(l)},a.prototype.optimize=function(l){this.domNode[s.DATA_KEY]!=null&&delete this.domNode[s.DATA_KEY].mutations},a.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},a.prototype.replace=function(l){l.parent!=null&&(l.parent.insertBefore(this,l.next),l.remove())},a.prototype.replaceWith=function(l,c){var d=typeof l=="string"?s.create(l,c):l;return d.replace(this),d},a.prototype.split=function(l,c){return l===0?this:this.next},a.prototype.update=function(l,c){},a.prototype.wrap=function(l,c){var d=typeof l=="string"?s.create(l,c):l;return this.parent!=null&&this.parent.insertBefore(d,this.next),d.appendChild(this),d},a.blotName="abstract",a}();r.default=o}
vendor: 97,916 bytes, lines 8265-8275
8265,function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(12),o=i(32),a=i(33),l=i(1),c=function(){function d(f){this.attributes={},this.domNode=f,this.build()}return d.prototype.attribute=function(f,u){u?f.add(this.domNode,u)&&(f.value(this.domNode)!=null?this.attributes[f.attrName]=f:delete this.attributes[f.attrName]):(f.remove(this.domNode),delete this.attributes[f.attrName])},d.prototype.build=function(){var f=this;this.attributes={};var u=s.default.keys(this.domNode),h=o.default.keys(this.domNode),g=a.default.keys(this.domNode);u.concat(h).concat(g).forEach(function(v){var m=l.query(v,l.Scope.ATTRIBUTE);m instanceof s.default&&(f.attributes[m.attrName]=m)})},d.prototype.copy=function(f){var u=this;Object.keys(this.attributes).forEach(function(h){var g=u.attributes[h].value(u.domNode);f.format(h,g)})},d.prototype.move=function(f){var u=this;this.copy(f),Object.keys(this.attributes).forEach(function(h){u.attributes[h].remove(u.domNode)}),this.attributes={}},d.prototype.values=function(){var f=this;return Object.keys(this.attributes).reduce(function(u,h){return u[h]=f.attributes[h].value(f.domNode),u},{})},d}();r.default=c},function(n,r,i){var s=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var u in f)f.hasOwnProperty(u)&&(d[u]=f[u])};return function(d,f){c(d,f);function u(){this.constructor=d}d.prototype=f===null?Object.create(f):(u.prototype=f.prototype,new u)}}();Object.defineProperty(r,"__esModule",{value:!0});var o=i(12);function a(c,d){var f=c.getAttribute("class")||"";return f.split(/\s+/).filter(function(u){return u.indexOf(d+"-")===0})}var l=function(c){s(d,c);function d(){return c!==null&&c.apply(this,arguments)||this}return d.keys=function(f){return(f.getAttribute("class")||"").split(/\s+/).map(function(u){return u.split("-").slice(0,-1).join("-")})},d.prototype.add=function(f,u){return this.canAdd(f,u)?(this.remove(f),f.classList.add(this.keyName+"-"+u),!0):!1},d.prototype.remove=function(f){var u=a(f,this.keyName);u.forEach(function(h){f.classList.remove(h)}),f.classList.length===0&&f.removeAttribute("class")},d.prototype.value=function(f){var u=a(f,this.keyName)[0]||"",h=u.slice(this.keyName.length+1);return this.canAdd(f,h)?h:""},d}(o.default);r.default=l},function(n,r,i){var s=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var u in f)f.hasOwnProperty(u)&&(d[u]=f[u])};return function(d,f){c(d,f);function u(){this.constructor=d}d.prototype=f===null?Object.create(f):(u.prototype=f.prototype,new u)}}();Object.defineProperty(r,"__esModule",{value:!0});var o=i(12);function a(c){var d=c.split("-"),f=d.slice(1).map(function(u){return u[0].toUpperCase()+u.slice(1)}).join("");return d[0]+f}var l=function(c){s(d,c);function d(){return c!==null&&c.apply(this,arguments)||this}return d.keys=function(f){return(f.getAttribute("style")||"").split(";").map(function(u){var h=u.split(":");return h[0].trim()})},d.prototype.add=function(f,u){return this.canAdd(f,u)?(f.style[a(this.keyName)]=u,!0):!1},d.prototype.remove=function(f){f.style[a(this.keyName)]="",f.getAttribute("style")||f.removeAttribute("style")},d.prototype.value=function(f){var u=f.style[a(this.keyName)];return this.canAdd(f,u)?u:""},d}(o.default);r.default=l},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function l(c,d){for(var f=0;f<d.length;f++){var u=d[f];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(c,u.key,u)}}return function(c,d,f){return d&&l(c.prototype,d),f&&l(c,f),c}}();function o(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}var a=function(){function l(c,d){o(this,l),this.quill=c,this.options=d,this.modules={}}return s(l,[{key:"init",value:function(){var d=this;Object.keys(this.options.modules).forEach(function(f){d.modules[f]==null&&d.addModule(f)})}},{key:"addModule",value:function(d){var f=this.quill.constructor.import("modules/"+d);return this.modules[d]=new f(this.quill,this.options.modules[d]||{}),this.modules[d]}}]),l}();a.DEFAULTS={modules:{}},a.themes={default:a},r.default=a},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function p(y,w){for(var x=0;x<w.length;x++){var S=w[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(y,S.key,S)}}return function(y,w,x){return w&&p(y.prototype,w),x&&p(y,x),y}}(),o=function p(y,w,x){y===null&&(y=Function.prototype);var S=Object.getOwnPropertyDescriptor(y,w);if(S===void 0){var I=Object.getPrototypeOf(y);return I===null?void 0:p(I,w,x)}else{if("value"in S)return S.value;var M=S.get;return M===void 0?void 0:M.call(x)}},a=i(0),l=f(a),c=i(7),d=f(c);function f(p){return p&&p.__esModule?p:{default:p}}function u(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function h(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function g(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var v="\uFEFF",m=function(p){g(y,p);function y(w){u(this,y);var x=h(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,w));return x.contentNode=document.createElement("span"),x.contentNode.setAttribute("contenteditable",!1),[].slice.call(x.domNode.childNodes).forEach(function(S){x.contentNode.appendChild(S)}),x.leftGuard=document.createTextNode(v),x.rightGuard=document.createTextNode(v),x.domNode.appendChild(x.leftGuard),x.domNode.appendChild(x.contentNode),x.domNode.appendChild(x.rightGuard),x}return s(y,[{key:"index",value:function(x,S){return x===this.leftGuard?0:x===this.rightGuard?1:o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,x,S)}},{key:"restore",value:function(x){var S=void 0,I=void 0,M=x.data.split(v).join("");if(x===this.leftGuard)if(this.prev instanceof d.default){var E=this.prev.length();this.prev.insertAt(E,M),S={startNode:this.prev.domNode,startOffset:E+M.length}}else I=document.createTextNode(M),this.parent.insertBefore(l.default.create(I),this),S={startNode:I,startOffset:M.length};else x===this.rightGuard&&(this.next instanceof d.default?(this.next.insertAt(0,M),S={startNode:this.next.domNode,startOffset:M.length}):(I=document.createTextNode(M),this.parent.insertBefore(l.default.create(I),this.next),S={startNode:I,startOffset:M.length}));return x.data=v,S}},{key:"update",value:function(x,S){var I=this;x.forEach(function(M){if(M.type==="characterData"&&(M.target===I.leftGuard||M.target===I.rightGuard)){var E=I.restore(M.target);E&&(S.range=E)}})}}]),y}(l.default.Embed);r.default=m},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.AlignStyle=r.AlignClass=r.AlignAttribute=void 0;var s=i(0),o=a(s);function a(u){return u&&u.__esModule?u:{default:u}}var l={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},c=new o.default.Attributor.Attribute("align","align",l),d=new o.default.Attributor.Class("align","ql-align",l),f=new o.default.Attributor.Style("align","text-align",l);r.AlignAttribute=c,r.AlignClass=d,r.AlignStyle=f},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.BackgroundStyle=r.BackgroundClass=void 0;var s=i(0),o=l(s),a=i(26);function l(f){return f&&f.__esModule?f:{default:f}}var c=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),d=new a.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});r.BackgroundClass=c,r.BackgroundStyle=d},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.DirectionStyle=r.DirectionClass=r.DirectionAttribute=void 0;var s=i(0),o=a(s);function a(u){return u&&u.__esModule?u:{default:u}}var l={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},c=new o.default.Attributor.Attribute("direction","dir",l),d=new o.default.Attributor.Class("direction","ql-direction",l),f=new o.default.Attributor.Style("direction","direction",l);r.DirectionAttribute=c,r.DirectionClass=d,r.DirectionStyle=f},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.FontClass=r.FontStyle=void 0;var s=function(){function p(y,w){for(var x=0;x<w.length;x++){var S=w[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(y,S.key,S)}}return function(y,w,x){return w&&p(y.prototype,w),x&&p(y,x),y}}(),o=function p(y,w,x){y===null&&(y=Function.prototype);var S=Object.getOwnPropertyDescriptor(y,w);if(S===void 0){var I=Object.getPrototypeOf(y);return I===null?void 0:p(I,w,x)}else{if("value"in S)return S.value;var M=S.get;return M===void 0?void 0:M.call(x)}},a=i(0),l=c(a);function c(p){return p&&p.__esModule?p:{default:p}}function d(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function f(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function u(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var h={scope:l.default.Scope.INLINE,whitelist:["serif","monospace"]},g=new l.default.Attributor.Class("font","ql-font",h),v=function(p){u(y,p);function y(){return d(this,y),f(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return s(y,[{key:"value",value:function(x){return o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,x).replace(/["']/g,"")}}]),y}(l.default.Attributor.Style),m=new v("font","font-family",h);r.FontStyle=m,r.FontClass=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.SizeStyle=r.SizeClass=void 0;var s=i(0),o=a(s);function a(d){return d&&d.__esModule?d:{default:d}}var l=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),c=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});r.SizeClass=l,r.SizeStyle=c},function(n,r,i){n.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.getLastChangeIndex=r.default=void 0;var s=function(){function w(x,S){for(var I=0;I<S.length;I++){var M=S[I];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(x,M.key,M)}}return function(x,S,I){return S&&w(x.prototype,S),I&&w(x,I),x}}(),o=i(0),a=u(o),l=i(5),c=u(l),d=i(9),f=u(d);function u(w){return w&&w.__esModule?w:{default:w}}function h(w,x){if(!(w instanceof x))throw new TypeError("Cannot call a class as a function")}function g(w,x){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:w}function v(w,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);w.prototype=Object.create(x&&x.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(w,x):w.__proto__=x)}var m=function(w){v(x,w);function x(S,I){h(this,x);var M=g(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,S,I));return M.lastRecorded=0,M.ignoreChange=!1,M.clear(),M.quill.on(c.default.events.EDITOR_CHANGE,function(E,C,T,A){E!==c.default.events.TEXT_CHANGE||M.ignoreChange||(!M.options.userOnly||A===c.default.sources.USER?M.record(C,T):M.transform(C))}),M.quill.keyboard.addBinding({key:"Z",shortKey:!0},M.undo.bind(M)),M.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},M.redo.bind(M)),/Win/i.test(navigator.platform)&&M.quill.keyboard.addBinding({key:"Y",shortKey:!0},M.redo.bind(M)),M}return s(x,[{key:"change",value:function(I,M){if(this.stack[I].length!==0){var E=this.stack[I].pop();this.stack[M].push(E),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(E[I],c.default.sources.USER),this.ignoreChange=!1;var C=y(E[I]);this.quill.setSelection(C)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(I,M){if(I.ops.length!==0){this.stack.redo=[];var E=this.quill.getContents().diff(M),C=Date.now();if(this.lastRecorded+this.options.delay>C&&this.stack.undo.length>0){var T=this.stack.undo.pop();E=E.compose(T.undo),I=T.redo.compose(I)}else this.lastRecorded=C;this.stack.undo.push({redo:I,undo:E}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(I){this.stack.undo.forEach(function(M){M.undo=I.transform(M.undo,!0),M.redo=I.transform(M.redo,!0)}),this.stack.redo.forEach(function(M){M.undo=I.transform(M.undo,!0),M.redo=I.transform(M.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),x}(f.default);m.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function p(w){var x=w.ops[w.ops.length-1];return x==null?!1:x.insert!=null?typeof x.insert=="string"&&x.insert.endsWith(`
8266`):x.attributes!=null?Object.keys(x.attributes).some(function(S){return a.default.query(S,a.default.Scope.BLOCK)!=null}):!1}function y(w){var x=w.reduce(function(I,M){return I+=M.delete||0,I},0),S=w.length()-x;return p(w)&&(S-=1),S}r.default=m,r.getLastChangeIndex=y},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BaseTooltip=void 0;var s=function(){function z(q,ne){for(var ee=0;ee<ne.length;ee++){var j=ne[ee];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(q,j.key,j)}}return function(q,ne,ee){return ne&&z(q.prototype,ne),ee&&z(q,ee),q}}(),o=function z(q,ne,ee){q===null&&(q=Function.prototype);var j=Object.getOwnPropertyDescriptor(q,ne);if(j===void 0){var Q=Object.getPrototypeOf(q);return Q===null?void 0:z(Q,ne,ee)}else{if("value"in j)return j.value;var Z=j.get;return Z===void 0?void 0:Z.call(ee)}},a=i(3),l=C(a),c=i(2),d=C(c),f=i(8),u=C(f),h=i(23),g=C(h),v=i(34),m=C(v),p=i(59),y=C(p),w=i(60),x=C(w),S=i(28),I=C(S),M=i(61),E=C(M);function C(z){return z&&z.__esModule?z:{default:z}}function T(z,q){if(!(z instanceof q))throw new TypeError("Cannot call a class as a function")}function A(z,q){if(!z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return q&&(typeof q=="object"||typeof q=="function")?q:z}function R(z,q){if(typeof q!="function"&&q!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof q);z.prototype=Object.create(q&&q.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),q&&(Object.setPrototypeOf?Object.setPrototypeOf(z,q):z.__proto__=q)}var P=[!1,"center","right","justify"],D=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],F=[!1,"serif","monospace"],V=["1","2","3",!1],H=["small",!1,"large","huge"],$=function(z){R(q,z);function q(ne,ee){T(this,q);var j=A(this,(q.__proto__||Object.getPrototypeOf(q)).call(this,ne,ee)),Q=function Z(re){if(!document.body.contains(ne.root))return document.body.removeEventListener("click",Z);j.tooltip!=null&&!j.tooltip.root.contains(re.target)&&document.activeElement!==j.tooltip.textbox&&!j.quill.hasFocus()&&j.tooltip.hide(),j.pickers!=null&&j.pickers.forEach(function(se){se.container.contains(re.target)||se.close()})};return ne.emitter.listenDOM("click",document.body,Q),j}return s(q,[{key:"addModule",value:function(ee){var j=o(q.prototype.__proto__||Object.getPrototypeOf(q.prototype),"addModule",this).call(this,ee);return ee==="toolbar"&&this.extendToolbar(j),j}},{key:"buildButtons",value:function(ee,j){ee.forEach(function(Q){var Z=Q.getAttribute("class")||"";Z.split(/\s+/).forEach(function(re){if(re.startsWith("ql-")&&(re=re.slice(3),j[re]!=null))if(re==="direction")Q.innerHTML=j[re][""]+j[re].rtl;else if(typeof j[re]=="string")Q.innerHTML=j[re];else{var se=Q.value||"";se!=null&&j[re][se]&&(Q.innerHTML=j[re][se])}})})}},{key:"buildPickers",value:function(ee,j){var Q=this;this.pickers=ee.map(function(re){if(re.classList.contains("ql-align"))return re.querySelector("option")==null&&k(re,P),new x.default(re,j.align);if(re.classList.contains("ql-background")||re.classList.contains("ql-color")){var se=re.classList.contains("ql-background")?"background":"color";return re.querySelector("option")==null&&k(re,D,se==="background"?"#ffffff":"#000000"),new y.default(re,j[se])}else return re.querySelector("option")==null&&(re.classList.contains("ql-font")?k(re,F):re.classList.contains("ql-header")?k(re,V):re.classList.contains("ql-size")&&k(re,H)),new I.default(re)});var Z=function(){Q.pickers.forEach(function(se){se.update()})};this.quill.on(u.default.events.EDITOR_CHANGE,Z)}}]),q}(m.default);$.DEFAULTS=(0,l.default)(!0,{},m.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var q=this,ne=this.container.querySelector("input.ql-image[type=file]");ne==null&&(ne=document.createElement("input"),ne.setAttribute("type","file"),ne.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),ne.classList.add("ql-image"),ne.addEventListener("change",function(){if(ne.files!=null&&ne.files[0]!=null){var ee=new FileReader;ee.onload=function(j){var Q=q.quill.getSelection(!0);q.quill.updateContents(new d.default().retain(Q.index).delete(Q.length).insert({image:j.target.result}),u.default.sources.USER),q.quill.setSelection(Q.index+1,u.default.sources.SILENT),ne.value=""},ee.readAsDataURL(ne.files[0])}}),this.container.appendChild(ne)),ne.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var B=function(z){R(q,z);function q(ne,ee){T(this,q);var j=A(this,(q.__proto__||Object.getPrototypeOf(q)).call(this,ne,ee));return j.textbox=j.root.querySelector('input[type="text"]'),j.listen(),j}return s(q,[{key:"listen",value:function(){var ee=this;this.textbox.addEventListener("keydown",function(j){g.default.match(j,"enter")?(ee.save(),j.preventDefault()):g.default.match(j,"escape")&&(ee.cancel(),j.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),j!=null?this.textbox.value=j:ee!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+ee)||""),this.root.setAttribute("data-mode",ee)}},{key:"restoreFocus",value:function(){var ee=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=ee}},{key:"save",value:function(){var ee=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var j=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",ee,u.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",ee,u.default.sources.USER)),this.quill.root.scrollTop=j;break}case"video":ee=G(ee);case"formula":{if(!ee)break;var Q=this.quill.getSelection(!0);if(Q!=null){var Z=Q.index+Q.length;this.quill.insertEmbed(Z,this.root.getAttribute("data-mode"),ee,u.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(Z+1," ",u.default.sources.USER),this.quill.setSelection(Z+2,u.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),q}(E.default);function G(z){var q=z.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||z.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return q?(q[1]||"https")+"://www.youtube.com/embed/"+q[2]+"?showinfo=0":(q=z.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(q[1]||"https")+"://player.vimeo.com/video/"+q[2]+"/":z}function k(z,q){var ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;q.forEach(function(ee){var j=document.createElement("option");ee===ne?j.setAttribute("selected","selected"):j.setAttribute("value",ee),z.appendChild(j)})}r.BaseTooltip=B,r.default=$},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];this.insertBefore(a[0],null),a.length>1&&this.append.apply(this,a.slice(1))},o.prototype.contains=function(a){for(var l,c=this.iterator();l=c();)if(l===a)return!0;return!1},o.prototype.insertBefore=function(a,l){a&&(a.next=l,l!=null?(a.prev=l.prev,l.prev!=null&&(l.prev.next=a),l.prev=a,l===this.head&&(this.head=a)):this.tail!=null?(this.tail.next=a,a.prev=this.tail,this.tail=a):(a.prev=null,this.head=this.tail=a),this.length+=1)},o.prototype.offset=function(a){for(var l=0,c=this.head;c!=null;){if(c===a)return l;l+=c.length(),c=c.next}return-1},o.prototype.remove=function(a){this.contains(a)&&(a.prev!=null&&(a.prev.next=a.next),a.next!=null&&(a.next.prev=a.prev),a===this.head&&(this.head=a.next),a===this.tail&&(this.tail=a.prev),this.length-=1)},o.prototype.iterator=function(a){return a===void 0&&(a=this.head),function(){var l=a;return a!=null&&(a=a.next),l}},o.prototype.find=function(a,l){l===void 0&&(l=!1);for(var c,d=this.iterator();c=d();){var f=c.length();if(a<f||l&&a===f&&(c.next==null||c.next.length()!==0))return[c,a];a-=f}return[null,0]},o.prototype.forEach=function(a){for(var l,c=this.iterator();l=c();)a(l)},o.prototype.forEachAt=function(a,l,c){if(!(l<=0))for(var d=this.find(a),f=d[0],u=d[1],h,g=a-u,v=this.iterator(f);(h=v())&&g<a+l;){var m=h.length();a>g?c(h,a-g,Math.min(l,g+m-a)):c(h,0,Math.min(m,a+l-g)),g+=m}},o.prototype.map=function(a){return this.reduce(function(l,c){return l.push(a(c)),l},[])},o.prototype.reduce=function(a,l){for(var c,d=this.iterator();c=d();)l=a(l,c);return l},o}();r.default=s},function(n,r,i){var s=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,h){u.__proto__=h}||function(u,h){for(var g in h)h.hasOwnProperty(g)&&(u[g]=h[g])};return function(u,h){f(u,h);function g(){this.constructor=u}u.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}();Object.defineProperty(r,"__esModule",{value:!0});var o=i(17),a=i(1),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},c=100,d=function(f){s(u,f);function u(h){var g=f.call(this,h)||this;return g.scroll=g,g.observer=new MutationObserver(function(v){g.update(v)}),g.observer.observe(g.domNode,l),g.attach(),g}return u.prototype.detach=function(){f.prototype.detach.call(this),this.observer.disconnect()},u.prototype.deleteAt=function(h,g){this.update(),h===0&&g===this.length()?this.children.forEach(function(v){v.remove()}):f.prototype.deleteAt.call(this,h,g)},u.prototype.formatAt=function(h,g,v,m){this.update(),f.prototype.formatAt.call(this,h,g,v,m)},u.prototype.insertAt=function(h,g,v){this.update(),f.prototype.insertAt.call(this,h,g,v)},u.prototype.optimize=function(h,g){var v=this;h===void 0&&(h=[]),g===void 0&&(g={}),f.prototype.optimize.call(this,g);for(var m=[].slice.call(this.observer.takeRecords());m.length>0;)h.push(m.pop());for(var p=function(S,I){I===void 0&&(I=!0),!(S==null||S===v)&&S.domNode.parentNode!=null&&(S.domNode[a.DATA_KEY].mutations==null&&(S.domNode[a.DATA_KEY].mutations=[]),I&&p(S.parent))},y=function(S){S.domNode[a.DATA_KEY]==null||S.domNode[a.DATA_KEY].mutations==null||(S instanceof o.default&&S.children.forEach(y),S.optimize(g))},w=h,x=0;w.length>0;x+=1){if(x>=c)throw new Error("[Parchment] Maximum optimize iterations reached");for(w.forEach(function(S){var I=a.find(S.target,!0);I!=null&&(I.domNode===S.target&&(S.type==="childList"?(p(a.find(S.previousSibling,!1)),[].forEach.call(S.addedNodes,function(M){var E=a.find(M,!1);p(E,!1),E instanceof o.default&&E.children.forEach(function(C){p(C,!1)})})):S.type==="attributes"&&p(I.prev)),p(I))}),this.children.forEach(y),w=[].slice.call(this.observer.takeRecords()),m=w.slice();m.length>0;)h.push(m.pop())}},u.prototype.update=function(h,g){var v=this;g===void 0&&(g={}),h=h||this.observer.takeRecords(),h.map(function(m){var p=a.find(m.target,!0);return p==null?null:p.domNode[a.DATA_KEY].mutations==null?(p.domNode[a.DATA_KEY].mutations=[m],p):(p.domNode[a.DATA_KEY].mutations.push(m),null)}).forEach(function(m){m==null||m===v||m.domNode[a.DATA_KEY]==null||m.update(m.domNode[a.DATA_KEY].mutations||[],g)}),this.domNode[a.DATA_KEY].mutations!=null&&f.prototype.update.call(this,this.domNode[a.DATA_KEY].mutations,g),this.optimize(h,g)},u.blotName="scroll",u.defaultChild="block",u.scope=a.Scope.BLOCK_BLOT,u.tagName="DIV",u}(o.default);r.default=d},function(n,r,i){var s=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,u){f.__proto__=u}||function(f,u){for(var h in u)u.hasOwnProperty(h)&&(f[h]=u[h])};return function(f,u){d(f,u);function h(){this.constructor=f}f.prototype=u===null?Object.create(u):(h.prototype=u.prototype,new h)}}();Object.defineProperty(r,"__esModule",{value:!0});var o=i(18),a=i(1);function l(d,f){if(Object.keys(d).length!==Object.keys(f).length)return!1;for(var u in d)if(d[u]!==f[u])return!1;return!0}var c=function(d){s(f,d);function f(){return d!==null&&d.apply(this,arguments)||this}return f.formats=function(u){if(u.tagName!==f.tagName)return d.formats.call(this,u)},f.prototype.format=function(u,h){var g=this;u===this.statics.blotName&&!h?(this.children.forEach(function(v){v instanceof o.default||(v=v.wrap(f.blotName,!0)),g.attributes.copy(v)}),this.unwrap()):d.prototype.format.call(this,u,h)},f.prototype.formatAt=function(u,h,g,v){if(this.formats()[g]!=null||a.query(g,a.Scope.ATTRIBUTE)){var m=this.isolate(u,h);m.format(g,v)}else d.prototype.formatAt.call(this,u,h,g,v)},f.prototype.optimize=function(u){d.prototype.optimize.call(this,u);var h=this.formats();if(Object.keys(h).length===0)return this.unwrap();var g=this.next;g instanceof f&&g.prev===this&&l(h,g.formats())&&(g.moveChildren(this),g.remove())},f.blotName="inline",f.scope=a.Scope.INLINE_BLOT,f.tagName="SPAN",f}(o.default);r.default=c},function(n,r,i){var s=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var u in f)f.hasOwnProperty(u)&&(d[u]=f[u])};return function(d,f){c(d,f);function u(){this.constructor=d}d.prototype=f===null?Object.create(f):(u.prototype=f.prototype,new u)}}();Object.defineProperty(r,"__esModule",{value:!0});var o=i(18),a=i(1),l=function(c){s(d,c);function d(){return c!==null&&c.apply(this,arguments)||this}return d.formats=function(f){var u=a.query(d.blotName).tagName;if(f.tagName!==u)return c.formats.call(this,f)},d.prototype.format=function(f,u){a.query(f,a.Scope.BLOCK)!=null&&(f===this.statics.blotName&&!u?this.replaceWith(d.blotName):c.prototype.format.call(this,f,u))},d.prototype.formatAt=function(f,u,h,g){a.query(h,a.Scope.BLOCK)!=null?this.format(h,g):c.prototype.formatAt.call(this,f,u,h,g)},d.prototype.insertAt=function(f,u,h){if(h==null||a.query(u,a.Scope.INLINE)!=null)c.prototype.insertAt.call(this,f,u,h);else{var g=this.split(f),v=a.create(u,h);g.parent.insertBefore(v,g)}},d.prototype.update=function(f,u){navigator.userAgent.match(/Trident/)?this.build():c.prototype.update.call(this,f,u)},d.blotName="block",d.scope=a.Scope.BLOCK_BLOT,d.tagName="P",d}(o.default);r.default=l},function(n,r,i){var s=this&&this.__extends||function(){var l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,d){c.__proto__=d}||function(c,d){for(var f in d)d.hasOwnProperty(f)&&(c[f]=d[f])};return function(c,d){l(c,d);function f(){this.constructor=c}c.prototype=d===null?Object.create(d):(f.prototype=d.prototype,new f)}}();Object.defineProperty(r,"__esModule",{value:!0});var o=i(19),a=function(l){s(c,l);function c(){return l!==null&&l.apply(this,arguments)||this}return c.formats=function(d){},c.prototype.format=function(d,f){l.prototype.formatAt.call(this,0,this.length(),d,f)},c.prototype.formatAt=function(d,f,u,h){d===0&&f===this.length()?this.format(u,h):l.prototype.formatAt.call(this,d,f,u,h)},c.prototype.formats=function(){return this.statics.formats(this.domNode)},c}(o.default);r.default=a},function(n,r,i){var s=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var u in f)f.hasOwnProperty(u)&&(d[u]=f[u])};return function(d,f){c(d,f);function u(){this.constructor=d}d.prototype=f===null?Object.create(f):(u.prototype=f.prototype,new u)}}();Object.defineProperty(r,"__esModule",{value:!0});var o=i(19),a=i(1),l=function(c){s(d,c);function d(f){var u=c.call(this,f)||this;return u.text=u.statics.value(u.domNode),u}return d.create=function(f){return document.createTextNode(f)},d.value=function(f){var u=f.data;return u.normalize&&(u=u.normalize()),u},d.prototype.deleteAt=function(f,u){this.domNode.data=this.text=this.text.slice(0,f)+this.text.slice(f+u)},d.prototype.index=function(f,u){return this.domNode===f?u:-1},d.prototype.insertAt=function(f,u,h){h==null?(this.text=this.text.slice(0,f)+u+this.text.slice(f),this.domNode.data=this.text):c.prototype.insertAt.call(this,f,u,h)},d.prototype.length=function(){return this.text.length},d.prototype.optimize=function(f){c.prototype.optimize.call(this,f),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof d&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},d.prototype.position=function(f,u){return[this.domNode,f]},d.prototype.split=function(f,u){if(u===void 0&&(u=!1),!u){if(f===0)return this;if(f===this.length())return this.next}var h=a.create(this.domNode.splitText(f));return this.parent.insertBefore(h,this.next),this.text=this.statics.value(this.domNode),h},d.prototype.update=function(f,u){var h=this;f.some(function(g){return g.type==="characterData"&&g.target===h.domNode})&&(this.text=this.statics.value(this.domNode))},d.prototype.value=function(){return this.text},d.blotName="text",d.scope=a.Scope.INLINE_BLOT,d}(o.default);r.default=l},function(n,r,i){var s=document.createElement("div");if(s.classList.toggle("test-class",!1),s.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(a,l){return arguments.length>1&&!this.contains(a)==!l?l:o.call(this,a)}}String.prototype.startsWith||(String.prototype.startsWith=function(a,l){return l=l||0,this.substr(l,a.length)===a}),String.prototype.endsWith||(String.prototype.endsWith=function(a,l){var c=this.toString();(typeof l!="number"||!isFinite(l)||Math.floor(l)!==l||l>c.length)&&(l=c.length),l-=a.length;var d=c.indexOf(a,l);return d!==-1&&d===l}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(l){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof l!="function")throw new TypeError("predicate must be a function");for(var c=Object(this),d=c.length>>>0,f=arguments[1],u,h=0;h<d;h++)if(u=c[h],l.call(f,u,h,c))return u}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(n,r){var i=-1,s=1,o=0;function a(x,S,I){if(x==S)return x?[[o,x]]:[];(I<0||x.length<I)&&(I=null);var M=f(x,S),E=x.substring(0,M);x=x.substring(M),S=S.substring(M),M=u(x,S);var C=x.substring(x.length-M);x=x.substring(0,x.length-M),S=S.substring(0,S.length-M);var T=l(x,S);return E&&T.unshift([o,E]),C&&T.push([o,C]),g(T),I!=null&&(T=p(T,I)),T=y(T),T}function l(x,S){var I;if(!x)return[[s,S]];if(!S)return[[i,x]];var M=x.length>S.length?x:S,E=x.length>S.length?S:x,C=M.indexOf(E);if(C!=-1)return I=[[s,M.substring(0,C)],[o,E],[s,M.substring(C+E.length)]],x.length>S.length&&(I[0][0]=I[2][0]=i),I;if(E.length==1)return[[i,x],[s,S]];var T=h(x,S);if(T){var A=T[0],R=T[1],P=T[2],D=T[3],F=T[4],V=a(A,P),H=a(R,D);return V.concat([[o,F]],H)}return c(x,S)}function c(x,S){for(var I=x.length,M=S.length,E=Math.ceil((I+M)/2),C=E,T=2*E,A=new Array(T),R=new Array(T),P=0;P<T;P++)A[P]=-1,R[P]=-1;A[C+1]=0,R[C+1]=0;for(var D=I-M,F=D%2!=0,V=0,H=0,$=0,B=0,G=0;G<E;G++){for(var k=-G+V;k<=G-H;k+=2){var z=C+k,q;k==-G||k!=G&&A[z-1]<A[z+1]?q=A[z+1]:q=A[z-1]+1;for(var ne=q-k;q<I&&ne<M&&x.charAt(q)==S.charAt(ne);)q++,ne++;if(A[z]=q,q>I)H+=2;else if(ne>M)V+=2;else if(F){var ee=C+D-k;if(ee>=0&&ee<T&&R[ee]!=-1){var j=I-R[ee];if(q>=j)return d(x,S,q,ne)}}}for(var Q=-G+$;Q<=G-B;Q+=2){var ee=C+Q,j;Q==-G||Q!=G&&R[ee-1]<R[ee+1]?j=R[ee+1]:j=R[ee-1]+1;for(var Z=j-Q;j<I&&Z<M&&x.charAt(I-j-1)==S.charAt(M-Z-1);)j++,Z++;if(R[ee]=j,j>I)B+=2;else if(Z>M)$+=2;else if(!F){var z=C+D-Q;if(z>=0&&z<T&&A[z]!=-1){var q=A[z],ne=C+q-z;if(j=I-j,q>=j)return d(x,S,q,ne)}}}}return[[i,x],[s,S]]}function d(x,S,I,M){var E=x.substring(0,I),C=S.substring(0,M),T=x.substring(I),A=S.substring(M),R=a(E,C),P=a(T,A);return R.concat(P)}function f(x,S){if(!x||!S||x.charAt(0)!=S.charAt(0))return 0;for(var I=0,M=Math.min(x.length,S.length),E=M,C=0;I<E;)x.substring(C,E)==S.substring(C,E)?(I=E,C=I):M=E,E=Math.floor((M-I)/2+I);return E}function u(x,S){if(!x||!S||x.charAt(x.length-1)!=S.charAt(S.length-1))return 0;for(var I=0,M=Math.min(x.length,S.length),E=M,C=0;I<E;)x.substring(x.length-E,x.length-C)==S.substring(S.length-E,S.length-C)?(I=E,C=I):M=E,E=Math.floor((M-I)/2+I);return E}function h(x,S){var I=x.length>S.length?x:S,M=x.length>S.length?S:x;if(I.length<4||M.length*2<I.length)return null;function E(H,$,B){for(var G=H.substring(B,B+Math.floor(H.length/4)),k=-1,z="",q,ne,ee,j;(k=$.indexOf(G,k+1))!=-1;){var Q=f(H.substring(B),$.substring(k)),Z=u(H.substring(0,B),$.substring(0,k));z.length<Z+Q&&(z=$.substring(k-Z,k)+$.substring(k,k+Q),q=H.substring(0,B-Z),ne=H.substring(B+Q),ee=$.substring(0,k-Z),j=$.substring(k+Q))}return z.length*2>=H.length?[q,ne,ee,j,z]:null}var C=E(I,M,Math.ceil(I.length/4)),T=E(I,M,Math.ceil(I.length/2)),A;if(!C&&!T)return null;T?C?A=C[4].length>T[4].length?C:T:A=T:A=C;var R,P,D,F;x.length>S.length?(R=A[0],P=A[1],D=A[2],F=A[3]):(D=A[0],F=A[1],R=A[2],P=A[3]);var V=A[4];return[R,P,D,F,V]}function g(x){x.push([o,""]);for(var S=0,I=0,M=0,E="",C="",T;S<x.length;)switch(x[S][0]){case s:M++,C+=x[S][1],S++;break;case i:I++,E+=x[S][1],S++;break;case o:I+M>1?(I!==0&&M!==0&&(T=f(C,E),T!==0&&(S-I-M>0&&x[S-I-M-1][0]==o?x[S-I-M-1][1]+=C.substring(0,T):(x.splice(0,0,[o,C.substring(0,T)]),S++),C=C.substring(T),E=E.substring(T)),T=u(C,E),T!==0&&(x[S][1]=C.substring(C.length-T)+x[S][1],C=C.substring(0,C.length-T),E=E.substring(0,E.length-T))),I===0?x.splice(S-M,I+M,[s,C]):M===0?x.splice(S-I,I+M,[i,E]):x.splice(S-I-M,I+M,[i,E],[s,C]),S=S-I-M+(I?1:0)+(M?1:0)+1):S!==0&&x[S-1][0]==o?(x[S-1][1]+=x[S][1],x.splice(S,1)):S++,M=0,I=0,E="",C="";break}x[x.length-1][1]===""&&x.pop();var A=!1;for(S=1;S<x.length-1;)x[S-1][0]==o&&x[S+1][0]==o&&(x[S][1].substring(x[S][1].length-x[S-1][1].length)==x[S-1][1]?(x[S][1]=x[S-1][1]+x[S][1].substring(0,x[S][1].length-x[S-1][1].length),x[S+1][1]=x[S-1][1]+x[S+1][1],x.splice(S-1,1),A=!0):x[S][1].substring(0,x[S+1][1].length)==x[S+1][1]&&(x[S-1][1]+=x[S+1][1],x[S][1]=x[S][1].substring(x[S+1][1].length)+x[S+1][1],x.splice(S+1,1),A=!0)),S++;A&&g(x)}var v=a;v.INSERT=s,v.DELETE=i,v.EQUAL=o,n.exports=v;function m(x,S){if(S===0)return[o,x];for(var I=0,M=0;M<x.length;M++){var E=x[M];if(E[0]===i||E[0]===o){var C=I+E[1].length;if(S===C)return[M+1,x];if(S<C){x=x.slice();var T=S-I,A=[E[0],E[1].slice(0,T)],R=[E[0],E[1].slice(T)];return x.splice(M,1,A,R),[M+1,x]}else I=C}}throw new Error("cursor_pos is out of bounds!")}function p(x,S){var I=m(x,S),M=I[1],E=I[0],C=M[E],T=M[E+1];if(C==null)return x;if(C[0]!==o)return x;if(T!=null&&C[1]+T[1]===T[1]+C[1])return M.splice(E,2,T,C),w(M,E,2);if(T!=null&&T[1].indexOf(C[1])===0){M.splice(E,2,[T[0],C[1]],[0,C[1]]);var A=T[1].slice(C[1].length);return A.length>0&&M.splice(E+2,0,[T[0],A]),w(M,E,3)}else return x}function y(x){for(var S=!1,I=function(T){return T.charCodeAt(0)>=56320&&T.charCodeAt(0)<=57343},M=function(T){return T.charCodeAt(T.length-1)>=55296&&T.charCodeAt(T.length-1)<=56319},E=2;E<x.length;E+=1)x[E-2][0]===o&&M(x[E-2][1])&&x[E-1][0]===i&&I(x[E-1][1])&&x[E][0]===s&&I(x[E][1])&&(S=!0,x[E-1][1]=x[E-2][1].slice(-1)+x[E-1][1],x[E][1]=x[E-2][1].slice(-1)+x[E][1],x[E-2][1]=x[E-2][1].slice(0,-1));if(!S)return x;for(var C=[],E=0;E<x.length;E+=1)x[E][1].length>0&&C.push(x[E]);return C}function w(x,S,I){for(var M=S+I-1;M>=0&&M>=S-1;M--)if(M+1<x.length){var E=x[M],C=x[M+1];E[0]===C[1]&&x.splice(M,2,[E[0],E[1]+C[1]])}return x}},function(n,r){r=n.exports=typeof Object.keys=="function"?Object.keys:i,r.shim=i;function i(s){var o=[];for(var a in s)o.push(a);return o}},function(n,r){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";r=n.exports=i?s:o,r.supported=s;function s(a){return Object.prototype.toString.call(a)=="[object Arguments]"}r.unsupported=o;function o(a){return a&&typeof a=="object"&&typeof a.length=="number"&&Object.prototype.hasOwnProperty.call(a,"callee")&&!Object.prototype.propertyIsEnumerable.call(a,"callee")||!1}},function(n,r){var i=Object.prototype.hasOwnProperty,s="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(s=!1));function a(c,d,f){this.fn=c,this.context=d,this.once=f||!1}function l(){this._events=new o,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],f,u;if(this._eventsCount===0)return d;for(u in f=this._events)i.call(f,u)&&d.push(s?u.slice(1):u);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(f)):d},l.prototype.listeners=function(d,f){var u=s?s+d:d,h=this._events[u];if(f)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var g=0,v=h.length,m=new Array(v);g<v;g++)m[g]=h[g].fn;return m},l.prototype.emit=function(d,f,u,h,g,v){var m=s?s+d:d;if(!this._events[m])return!1;var p=this._events[m],y=arguments.length,w,x;if(p.fn){switch(p.once&&this.removeListener(d,p.fn,void 0,!0),y){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,f),!0;case 3:return p.fn.call(p.context,f,u),!0;case 4:return p.fn.call(p.context,f,u,h),!0;case 5:return p.fn.call(p.context,f,u,h,g),!0;case 6:return p.fn.call(p.context,f,u,h,g,v),!0}for(x=1,w=new Array(y-1);x<y;x++)w[x-1]=arguments[x];p.fn.apply(p.context,w)}else{var S=p.length,I;for(x=0;x<S;x++)switch(p[x].once&&this.removeListener(d,p[x].fn,void 0,!0),y){case 1:p[x].fn.call(p[x].context);break;case 2:p[x].fn.call(p[x].context,f);break;case 3:p[x].fn.call(p[x].context,f,u);break;case 4:p[x].fn.call(p[x].context,f,u,h);break;default:if(!w)for(I=1,w=new Array(y-1);I<y;I++)w[I-1]=arguments[I];p[x].fn.apply(p[x].context,w)}}return!0},l.prototype.on=function(d,f,u){var h=new a(f,u||this),g=s?s+d:d;return this._events[g]?this._events[g].fn?this._events[g]=[this._events[g],h]:this._events[g].push(h):(this._events[g]=h,this._eventsCount++),this},l.prototype.once=function(d,f,u){var h=new a(f,u||this,!0),g=s?s+d:d;return this._events[g]?this._events[g].fn?this._events[g]=[this._events[g],h]:this._events[g].push(h):(this._events[g]=h,this._eventsCount++),this},l.prototype.removeListener=function(d,f,u,h){var g=s?s+d:d;if(!this._events[g])return this;if(!f)return--this._eventsCount===0?this._events=new o:delete this._events[g],this;var v=this._events[g];if(v.fn)v.fn===f&&(!h||v.once)&&(!u||v.context===u)&&(--this._eventsCount===0?this._events=new o:delete this._events[g]);else{for(var m=0,p=[],y=v.length;m<y;m++)(v[m].fn!==f||h&&!v[m].once||u&&v[m].context!==u)&&p.push(v[m]);p.length?this._events[g]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new o:delete this._events[g]}return this},l.prototype.removeAllListeners=function(d){var f;return d?(f=s?s+d:d,this._events[f]&&(--this._eventsCount===0?this._events=new o:delete this._events[f])):(this._events=new o,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prototype.setMaxListeners=function(){return this},l.prefixed=s,l.EventEmitter=l,typeof n<"u"&&(n.exports=l)},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.matchText=r.matchSpacing=r.matchNewline=r.matchBlot=r.matchAttributor=r.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(K){return typeof K}:function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},o=function(){function K(de,_e){var Ae=[],ce=!0,X=!1,U=void 0;try{for(var J=de[Symbol.iterator](),he;!(ce=(he=J.next()).done)&&(Ae.push(he.value),!(_e&&Ae.length===_e));ce=!0);}catch(me){X=!0,U=me}finally{try{!ce&&J.return&&J.return()}finally{if(X)throw U}}return Ae}return function(de,_e){if(Array.isArray(de))return de;if(Symbol.iterator in Object(de))return K(de,_e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function K(de,_e){for(var Ae=0;Ae<_e.length;Ae++){var ce=_e[Ae];ce.enumerable=ce.enumerable||!1,ce.configurable=!0,"value"in ce&&(ce.writable=!0),Object.defineProperty(de,ce.key,ce)}}return function(de,_e,Ae){return _e&&K(de.prototype,_e),Ae&&K(de,Ae),de}}(),l=i(3),c=R(l),d=i(2),f=R(d),u=i(0),h=R(u),g=i(5),v=R(g),m=i(10),p=R(m),y=i(9),w=R(y),x=i(36),S=i(37),I=i(13),M=R(I),E=i(26),C=i(38),T=i(39),A=i(40);function R(K){return K&&K.__esModule?K:{default:K}}function P(K,de,_e){return de in K?Object.defineProperty(K,de,{value:_e,enumerable:!0,configurable:!0,writable:!0}):K[de]=_e,K}function D(K,de){if(!(K instanceof de))throw new TypeError("Cannot call a class as a function")}function F(K,de){if(!K)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return de&&(typeof de=="object"||typeof de=="function")?de:K}function V(K,de){if(typeof de!="function"&&de!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof de);K.prototype=Object.create(de&&de.prototype,{constructor:{value:K,enumerable:!1,writable:!0,configurable:!0}}),de&&(Object.setPrototypeOf?Object.setPrototypeOf(K,de):K.__proto__=de)}var H=(0,p.default)("quill:clipboard"),$="__ql-matcher",B=[[Node.TEXT_NODE,dt],[Node.TEXT_NODE,je],["br",ye],[Node.ELEMENT_NODE,je],[Node.ELEMENT_NODE,se],[Node.ELEMENT_NODE,Ke],[Node.ELEMENT_NODE,re],[Node.ELEMENT_NODE,Xe],["li",Ie],["b",Z.bind(Z,"bold")],["i",Z.bind(Z,"italic")],["style",Ue]],G=[x.AlignAttribute,C.DirectionAttribute].reduce(function(K,de){return K[de.keyName]=de,K},{}),k=[x.AlignStyle,S.BackgroundStyle,E.ColorStyle,C.DirectionStyle,T.FontStyle,A.SizeStyle].reduce(function(K,de){return K[de.keyName]=de,K},{}),z=function(K){V(de,K);function de(_e,Ae){D(this,de);var ce=F(this,(de.__proto__||Object.getPrototypeOf(de)).call(this,_e,Ae));return ce.quill.root.addEventListener("paste",ce.onPaste.bind(ce)),ce.container=ce.quill.addContainer("ql-clipboard"),ce.container.setAttribute("contenteditable",!0),ce.container.setAttribute("tabindex",-1),ce.matchers=[],B.concat(ce.options.matchers).forEach(function(X){var U=o(X,2),J=U[0],he=U[1];!Ae.matchVisual&&he===Ke||ce.addMatcher(J,he)}),ce}return a(de,[{key:"addMatcher",value:function(Ae,ce){this.matchers.push([Ae,ce])}},{key:"convert",value:function(Ae){if(typeof Ae=="string")return this.container.innerHTML=Ae.replace(/\>\r?\n +\</g,"><"),this.convert();var ce=this.quill.getFormat(this.quill.selection.savedRange.index);if(ce[M.default.blotName]){var X=this.container.innerText;return this.container.innerHTML="",new f.default().insert(X,P({},M.default.blotName,ce[M.default.blotName]))}var U=this.prepareMatching(),J=o(U,2),he=J[0],me=J[1],fe=Q(this.container,he,me);return ee(fe,`
8267`)&&fe.ops[fe.ops.length-1].attributes==null&&(fe=fe.compose(new f.default().retain(fe.length()-1).delete(1))),H.log("convert",this.container.innerHTML,fe),this.container.innerHTML="",fe}},{key:"dangerouslyPasteHTML",value:function(Ae,ce){var X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v.default.sources.API;if(typeof Ae=="string")this.quill.setContents(this.convert(Ae),ce),this.quill.setSelection(0,v.default.sources.SILENT);else{var U=this.convert(ce);this.quill.updateContents(new f.default().retain(Ae).concat(U),X),this.quill.setSelection(Ae+U.length(),v.default.sources.SILENT)}}},{key:"onPaste",value:function(Ae){var ce=this;if(!(Ae.defaultPrevented||!this.quill.isEnabled())){var X=this.quill.getSelection(),U=new f.default().retain(X.index),J=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(v.default.sources.SILENT),setTimeout(function(){U=U.concat(ce.convert()).delete(X.length),ce.quill.updateContents(U,v.default.sources.USER),ce.quill.setSelection(U.length()-X.length,v.default.sources.SILENT),ce.quill.scrollingContainer.scrollTop=J,ce.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Ae=this,ce=[],X=[];return this.matchers.forEach(function(U){var J=o(U,2),he=J[0],me=J[1];switch(he){case Node.TEXT_NODE:X.push(me);break;case Node.ELEMENT_NODE:ce.push(me);break;default:[].forEach.call(Ae.container.querySelectorAll(he),function(fe){fe[$]=fe[$]||[],fe[$].push(me)});break}}),[ce,X]}}]),de}(w.default);z.DEFAULTS={matchers:[],matchVisual:!0};function q(K,de,_e){return(typeof de>"u"?"undefined":s(de))==="object"?Object.keys(de).reduce(function(Ae,ce){return q(Ae,ce,de[ce])},K):K.reduce(function(Ae,ce){return ce.attributes&&ce.attributes[de]?Ae.push(ce):Ae.insert(ce.insert,(0,c.default)({},P({},de,_e),ce.attributes))},new f.default)}function ne(K){if(K.nodeType!==Node.ELEMENT_NODE)return{};var de="__ql-computed-style";return K[de]||(K[de]=window.getComputedStyle(K))}function ee(K,de){for(var _e="",Ae=K.ops.length-1;Ae>=0&&_e.length<de.length;--Ae){var ce=K.ops[Ae];if(typeof ce.insert!="string")break;_e=ce.insert+_e}return _e.slice(-1*de.length)===de}function j(K){if(K.childNodes.length===0)return!1;var de=ne(K);return["block","list-item"].indexOf(de.display)>-1}function Q(K,de,_e){return K.nodeType===K.TEXT_NODE?_e.reduce(function(Ae,ce){return ce(K,Ae)},new f.default):K.nodeType===K.ELEMENT_NODE?[].reduce.call(K.childNodes||[],function(Ae,ce){var X=Q(ce,de,_e);return ce.nodeType===K.ELEMENT_NODE&&(X=de.reduce(function(U,J){return J(ce,U)},X),X=(ce[$]||[]).reduce(function(U,J){return J(ce,U)},X)),Ae.concat(X)},new f.default):new f.default}function Z(K,de,_e){return q(_e,K,!0)}function re(K,de){var _e=h.default.Attributor.Attribute.keys(K),Ae=h.default.Attributor.Class.keys(K),ce=h.default.Attributor.Style.keys(K),X={};return _e.concat(Ae).concat(ce).forEach(function(U){var J=h.default.query(U,h.default.Scope.ATTRIBUTE);J!=null&&(X[J.attrName]=J.value(K),X[J.attrName])||(J=G[U],J!=null&&(J.attrName===U||J.keyName===U)&&(X[J.attrName]=J.value(K)||void 0),J=k[U],J!=null&&(J.attrName===U||J.keyName===U)&&(J=k[U],X[J.attrName]=J.value(K)||void 0))}),Object.keys(X).length>0&&(de=q(de,X)),de}function se(K,de){var _e=h.default.query(K);if(_e==null)return de;if(_e.prototype instanceof h.default.Embed){var Ae={},ce=_e.value(K);ce!=null&&(Ae[_e.blotName]=ce,de=new f.default().insert(Ae,_e.formats(K)))}else typeof _e.formats=="function"&&(de=q(de,_e.blotName,_e.formats(K)));return de}function ye(K,de){return ee(de,`
8268`)||de.insert(`
8269`),de}function Ue(){return new f.default}function Ie(K,de){var _e=h.default.query(K);if(_e==null||_e.blotName!=="list-item"||!ee(de,`
8270`))return de;for(var Ae=-1,ce=K.parentNode;!ce.classList.contains("ql-clipboard");)(h.default.query(ce)||{}).blotName==="list"&&(Ae+=1),ce=ce.parentNode;return Ae<=0?de:de.compose(new f.default().retain(de.length()-1).retain(1,{indent:Ae}))}function je(K,de){return ee(de,`
8271`)||(j(K)||de.length()>0&&K.nextSibling&&j(K.nextSibling))&&de.insert(`
8272`),de}function Ke(K,de){if(j(K)&&K.nextElementSibling!=null&&!ee(de,`
8273
8274`)){var _e=K.offsetHeight+parseFloat(ne(K).marginTop)+parseFloat(ne(K).marginBottom);K.nextElementSibling.offsetTop>K.offsetTop+_e*1.5&&de.insert(`
8275`)}return de}function Xe(K,de){var _e={},Ae=K.style||{};return Ae.fontStyle&&ne(K).fontStyle==="italic"&&(_e.italic=!0),Ae.fontWeight&&(ne(K).fontWeight.startsWith("bold")||parseInt(ne(K).fontWeight)>=700)&&(_e.bold=!0),Object.keys(_e).length>0&&(de=q(de,_e)),parseFloat(Ae.textIndent||0)>0&&(de=new f.default().insert("	").concat(de)),de}function dt(K,de){var _e=K.data;if(K.parentNode.tagName==="O:P")return de.insert(_e.trim());if(_e.trim().length===0&&K.parentNode.classList.contains("ql-clipboard"))return de;if(!ne(K.parentNode).whiteSpace.startsWith("pre")){var Ae=function(X,U){return U=U.replace(/[^\u00a0]/g,""),U.length<1&&X?" ":U};_e=_e.replace(/\r\n/g," ").replace(/\n/g," "),_e=_e.replace(/\s\s+/g,Ae.bind(Ae,!0)),(K.previousSibling==null&&j(K.parentNode)||K.previousSibling!=null&&j(K.previousSibling))&&(_e=_e.replace(/^\s+/,Ae.bind(Ae,!1))),(K.nextSibling==null&&j(K.parentNode)||K.nextSibling!=null&&j(K.nextSibling))&&(_e=_e.replace(/\s+$/,Ae.bind(Ae,!1)))}return de.insert(_e)}r.default=z,r.matchAttributor=re,r.matchBlot=se,r.matchNewline=je,r.matchSpacing=Ke,r.matchText=dt},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function g(v,m){for(var p=0;p<m.length;p++){var y=m[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(v,y.key,y)}}return function(v,m,p){return m&&g(v.prototype,m),p&&g(v,p),v}}(),o=function g(v,m,p){v===null&&(v=Function.prototype);var y=Object.getOwnPropertyDescriptor(v,m);if(y===void 0){var w=Object.getPrototypeOf(v);return w===null?void 0:g(w,m,p)}else{if("value"in y)return y.value;var x=y.get;return x===void 0?void 0:x.call(p)}},a=i(6),l=c(a);function c(g){return g&&g.__esModule?g:{default:g}}function d(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function f(g,v){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:g}function u(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);g.prototype=Object.create(v&&v.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(g,v):g.__proto__=v)}var h=function(g){u(v,g);function v(){return d(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"optimize",value:function(p){o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,p),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),v}(l.default);h.blotName="bold",h.tagName=["STRONG","B"],r.default=h},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.addControls=r.default=void 0;var s=function(){function A(R,P){var D=[],F=!0,V=!1,H=void 0;try{for(var $=R[Symbol.iterator](),B;!(F=(B=$.next()).done)&&(D.push(B.value),!(P&&D.length===P));F=!0);}catch(G){V=!0,H=G}finally{try{!F&&$.return&&$.return()}finally{if(V)throw H}}return D}return function(R,P){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return A(R,P);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function A(R,P){for(var D=0;D<P.length;D++){var F=P[D];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(R,F.key,F)}}return function(R,P,D){return P&&A(R.prototype,P),D&&A(R,D),R}}(),a=i(2),l=p(a),c=i(0),d=p(c),f=i(5),u=p(f),h=i(10),g=p(h),v=i(9),m=p(v);function p(A){return A&&A.__esModule?A:{default:A}}function y(A,R,P){return R in A?Object.defineProperty(A,R,{value:P,enumerable:!0,configurable:!0,writable:!0}):A[R]=P,A}function w(A,R){if(!(A instanceof R))throw new TypeError("Cannot call a class as a function")}function x(A,R){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:A}function S(A,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);A.prototype=Object.create(R&&R.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(A,R):A.__proto__=R)}var I=(0,g.default)("quill:toolbar"),M=function(A){S(R,A);function R(P,D){w(this,R);var F=x(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,P,D));if(Array.isArray(F.options.container)){var V=document.createElement("div");C(V,F.options.container),P.container.parentNode.insertBefore(V,P.container),F.container=V}else typeof F.options.container=="string"?F.container=document.querySelector(F.options.container):F.container=F.options.container;if(!(F.container instanceof HTMLElement)){var H;return H=I.error("Container required for toolbar",F.options),x(F,H)}return F.container.classList.add("ql-toolbar"),F.controls=[],F.handlers={},Object.keys(F.options.handlers).forEach(function($){F.addHandler($,F.options.handlers[$])}),[].forEach.call(F.container.querySelectorAll("button, select"),function($){F.attach($)}),F.quill.on(u.default.events.EDITOR_CHANGE,function($,B){$===u.default.events.SELECTION_CHANGE&&F.update(B)}),F.quill.on(u.default.events.SCROLL_OPTIMIZE,function(){var $=F.quill.selection.getRange(),B=s($,1),G=B[0];F.update(G)}),F}return o(R,[{key:"addHandler",value:function(D,F){this.handlers[D]=F}},{key:"attach",value:function(D){var F=this,V=[].find.call(D.classList,function($){return $.indexOf("ql-")===0});if(V){if(V=V.slice(3),D.tagName==="BUTTON"&&D.setAttribute("type","button"),this.handlers[V]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[V]==null){I.warn("ignoring attaching to disabled format",V,D);return}if(d.default.query(V)==null){I.warn("ignoring attaching to nonexistent format",V,D);return}}var H=D.tagName==="SELECT"?"change":"click";D.addEventListener(H,function($){var B=void 0;if(D.tagName==="SELECT"){if(D.selectedIndex<0)return;var G=D.options[D.selectedIndex];G.hasAttribute("selected")?B=!1:B=G.value||!1}else D.classList.contains("ql-active")?B=!1:B=D.value||!D.hasAttribute("value"),$.preventDefault();F.quill.focus();var k=F.quill.selection.getRange(),z=s(k,1),q=z[0];if(F.handlers[V]!=null)F.handlers[V].call(F,B);else if(d.default.query(V).prototype instanceof d.default.Embed){if(B=prompt("Enter "+V),!B)return;F.quill.updateContents(new l.default().retain(q.index).delete(q.length).insert(y({},V,B)),u.default.sources.USER)}else F.quill.format(V,B,u.default.sources.USER);F.update(q)}),this.controls.push([V,D])}}},{key:"update",value:function(D){var F=D==null?{}:this.quill.getFormat(D);this.controls.forEach(function(V){var H=s(V,2),$=H[0],B=H[1];if(B.tagName==="SELECT"){var G=void 0;if(D==null)G=null;else if(F[$]==null)G=B.querySelector("option[selected]");else if(!Array.isArray(F[$])){var k=F[$];typeof k=="string"&&(k=k.replace(/\"/g,'\\"')),G=B.querySelector('option[value="'+k+'"]')}G==null?(B.value="",B.selectedIndex=-1):G.selected=!0}else if(D==null)B.classList.remove("ql-active");else if(B.hasAttribute("value")){var z=F[$]===B.getAttribute("value")||F[$]!=null&&F[$].toString()===B.getAttribute("value")||F[$]==null&&!B.getAttribute("value");B.classList.toggle("ql-active",z)}else B.classList.toggle("ql-active",F[$]!=null)})}}]),R}(m.default);M.DEFAULTS={};function E(A,R,P){var D=document.createElement("button");D.setAttribute("type","button"),D.classList.add("ql-"+R),P!=null&&(D.value=P),A.appendChild(D)}function C(A,R){Array.isArray(R[0])||(R=[R]),R.forEach(function(P){var D=document.createElement("span");D.classList.add("ql-formats"),P.forEach(function(F){if(typeof F=="string")E(D,F);else{var V=Object.keys(F)[0],H=F[V];Array.isArray(H)?T(D,V,H):E(D,V,H)}}),A.appendChild(D)})}function T(A,R,P){var D=document.createElement("select");D.classList.add("ql-"+R),P.forEach(function(F){var V=document.createElement("option");F!==!1?V.setAttribute("value",F):V.setAttribute("selected","selected"),D.appendChild(V)}),A.appendChild(D)}M.DEFAULTS={container:null,handlers:{clean:function(){var R=this,P=this.quill.getSelection();if(P!=null)if(P.length==0){var D=this.quill.getFormat();Object.keys(D).forEach(function(F){d.default.query(F,d.default.Scope.INLINE)!=null&&R.quill.format(F,!1)})}else this.quill.removeFormat(P,u.default.sources.USER)},direction:function(R){var P=this.quill.getFormat().align;R==="rtl"&&P==null?this.quill.format("align","right",u.default.sources.USER):!R&&P==="right"&&this.quill.format("align",!1,u.default.sources.USER),this.quill.format("direction",R,u.default.sources.USER)},indent:function(R){var P=this.quill.getSelection(),D=this.quill.getFormat(P),F=parseInt(D.indent||0);if(R==="+1"||R==="-1"){var V=R==="+1"?1:-1;D.direction==="rtl"&&(V*=-1),this.quill.format("indent",F+V,u.default.sources.USER)}},link:function(R){R===!0&&(R=prompt("Enter link URL:")),this.quill.format("link",R,u.default.sources.USER)},list:function(R){var P=this.quill.getSelection(),D=this.quill.getFormat(P);R==="check"?D.list==="checked"||D.list==="unchecked"?this.quill.format("list",!1,u.default.sources.USER):this.quill.format("list","unchecked",u.default.sources.USER):this.quill.format("list",R,u.default.sources.USER)}}},r.default=M,r.addControls=C},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function g(v,m){for(var p=0;p<m.length;p++){var y=m[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(v,y.key,y)}}return function(v,m,p){return m&&g(v.prototype,m),p&&g(v,p),v}}(),o=function g(v,m,p){v===null&&(v=Function.prototype);var y=Object.getOwnPropertyDescriptor(v,m);if(y===void 0){var w=Object.getPrototypeOf(v);return w===null?void 0:g(w,m,p)}else{if("value"in y)return y.value;var x=y.get;return x===void 0?void 0:x.call(p)}},a=i(28),l=c(a);function c(g){return g&&g.__esModule?g:{default:g}}function d(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function f(g,v){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:g}function u(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);g.prototype=Object.create(v&&v.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(g,v):g.__proto__=v)}var h=function(g){u(v,g);function v(m,p){d(this,v);var y=f(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,m));return y.label.innerHTML=p,y.container.classList.add("ql-color-picker"),[].slice.call(y.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(w){w.classList.add("ql-primary")}),y}return s(v,[{key:"buildItem",value:function(p){var y=o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"buildItem",this).call(this,p);return y.style.backgroundColor=p.getAttribute("value")||"",y}},{key:"selectItem",value:function(p,y){o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"selectItem",this).call(this,p,y);var w=this.label.querySelector(".ql-color-label"),x=p&&p.getAttribute("data-value")||"";w&&(w.tagName==="line"?w.style.stroke=x:w.style.fill=x)}}]),v}(l.default);r.default=h},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function g(v,m){for(var p=0;p<m.length;p++){var y=m[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(v,y.key,y)}}return function(v,m,p){return m&&g(v.prototype,m),p&&g(v,p),v}}(),o=function g(v,m,p){v===null&&(v=Function.prototype);var y=Object.getOwnPropertyDescriptor(v,m);if(y===void 0){var w=Object.getPrototypeOf(v);return w===null?void 0:g(w,m,p)}else{if("value"in y)return y.value;var x=y.get;return x===void 0?void 0:x.call(p)}},a=i(28),l=c(a);function c(g){return g&&g.__esModule?g:{default:g}}function d(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function f(g,v){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:g}function u(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);g.prototype=Object.create(v&&v.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(g,v):g.__proto__=v)}var h=function(g){u(v,g);function v(m,p){d(this,v);var y=f(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,m));return y.container.classList.add("ql-icon-picker"),[].forEach.call(y.container.querySelectorAll(".ql-picker-item"),function(w){w.innerHTML=p[w.getAttribute("data-value")||""]}),y.defaultItem=y.container.querySelector(".ql-selected"),y.selectItem(y.defaultItem),y}return s(v,[{key:"selectItem",value:function(p,y){o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"selectItem",this).call(this,p,y),p=p||this.defaultItem,this.label.innerHTML=p.innerHTML}}]),v}(l.default);r.default=h},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function l(c,d){for(var f=0;f<d.length;f++){var u=d[f];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(c,u.key,u)}}return function(c,d,f){return d&&l(c.prototype,d),f&&l(c,f),c}}();function o(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}var a=function(){function l(c,d){var f=this;o(this,l),this.quill=c,this.boundsContainer=d||document.body,this.root=c.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){f.root.style.marginTop=-1*f.quill.root.scrollTop+"px"}),this.hide()}return s(l,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(d){var f=d.left+d.width/2-this.root.offsetWidth/2,u=d.bottom+this.quill.root.scrollTop;this.root.style.left=f+"px",this.root.style.top=u+"px",this.root.classList.remove("ql-flip");var h=this.boundsContainer.getBoundingClientRect(),g=this.root.getBoundingClientRect(),v=0;if(g.right>h.right&&(v=h.right-g.right,this.root.style.left=f+v+"px"),g.left<h.left&&(v=h.left-g.left,this.root.style.left=f+v+"px"),g.bottom>h.bottom){var m=g.bottom-g.top,p=d.bottom-d.top+m;this.root.style.top=u-p+"px",this.root.classList.add("ql-flip")}return v}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),l}();r.default=a},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function T(A,R){var P=[],D=!0,F=!1,V=void 0;try{for(var H=A[Symbol.iterator](),$;!(D=($=H.next()).done)&&(P.push($.value),!(R&&P.length===R));D=!0);}catch(B){F=!0,V=B}finally{try{!D&&H.return&&H.return()}finally{if(F)throw V}}return P}return function(A,R){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return T(A,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function T(A,R,P){A===null&&(A=Function.prototype);var D=Object.getOwnPropertyDescriptor(A,R);if(D===void 0){var F=Object.getPrototypeOf(A);return F===null?void 0:T(F,R,P)}else{if("value"in D)return D.value;var V=D.get;return V===void 0?void 0:V.call(P)}},a=function(){function T(A,R){for(var P=0;P<R.length;P++){var D=R[P];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(A,D.key,D)}}return function(A,R,P){return R&&T(A.prototype,R),P&&T(A,P),A}}(),l=i(3),c=w(l),d=i(8),f=w(d),u=i(43),h=w(u),g=i(27),v=w(g),m=i(15),p=i(41),y=w(p);function w(T){return T&&T.__esModule?T:{default:T}}function x(T,A){if(!(T instanceof A))throw new TypeError("Cannot call a class as a function")}function S(T,A){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:T}function I(T,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);T.prototype=Object.create(A&&A.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(T,A):T.__proto__=A)}var M=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],E=function(T){I(A,T);function A(R,P){x(this,A),P.modules.toolbar!=null&&P.modules.toolbar.container==null&&(P.modules.toolbar.container=M);var D=S(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,R,P));return D.quill.container.classList.add("ql-snow"),D}return a(A,[{key:"extendToolbar",value:function(P){P.container.classList.add("ql-snow"),this.buildButtons([].slice.call(P.container.querySelectorAll("button")),y.default),this.buildPickers([].slice.call(P.container.querySelectorAll("select")),y.default),this.tooltip=new C(this.quill,this.options.bounds),P.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(D,F){P.handlers.link.call(P,!F.format.link)})}}]),A}(h.default);E.DEFAULTS=(0,c.default)(!0,{},h.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(A){if(A){var R=this.quill.getSelection();if(R==null||R.length==0)return;var P=this.quill.getText(R);/^\S+@\S+\.\S+$/.test(P)&&P.indexOf("mailto:")!==0&&(P="mailto:"+P);var D=this.quill.theme.tooltip;D.edit("link",P)}else this.quill.format("link",!1)}}}}});var C=function(T){I(A,T);function A(R,P){x(this,A);var D=S(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,R,P));return D.preview=D.root.querySelector("a.ql-preview"),D}return a(A,[{key:"listen",value:function(){var P=this;o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(D){P.root.classList.contains("ql-editing")?P.save():P.edit("link",P.preview.textContent),D.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(D){if(P.linkRange!=null){var F=P.linkRange;P.restoreFocus(),P.quill.formatText(F,"link",!1,f.default.sources.USER),delete P.linkRange}D.preventDefault(),P.hide()}),this.quill.on(f.default.events.SELECTION_CHANGE,function(D,F,V){if(D!=null){if(D.length===0&&V===f.default.sources.USER){var H=P.quill.scroll.descendant(v.default,D.index),$=s(H,2),B=$[0],G=$[1];if(B!=null){P.linkRange=new m.Range(D.index-G,B.length());var k=v.default.formats(B.domNode);P.preview.textContent=k,P.preview.setAttribute("href",k),P.show(),P.position(P.quill.getBounds(P.linkRange));return}}else delete P.linkRange;P.hide()}})}},{key:"show",value:function(){o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),A}(u.BaseTooltip);C.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),r.default=E},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(29),o=ce(s),a=i(36),l=i(38),c=i(64),d=i(65),f=ce(d),u=i(66),h=ce(u),g=i(67),v=ce(g),m=i(37),p=i(26),y=i(39),w=i(40),x=i(56),S=ce(x),I=i(68),M=ce(I),E=i(27),C=ce(E),T=i(69),A=ce(T),R=i(70),P=ce(R),D=i(71),F=ce(D),V=i(72),H=ce(V),$=i(73),B=ce($),G=i(13),k=ce(G),z=i(74),q=ce(z),ne=i(75),ee=ce(ne),j=i(57),Q=ce(j),Z=i(41),re=ce(Z),se=i(28),ye=ce(se),Ue=i(59),Ie=ce(Ue),je=i(60),Ke=ce(je),Xe=i(61),dt=ce(Xe),K=i(108),de=ce(K),_e=i(62),Ae=ce(_e);function ce(X){return X&&X.__esModule?X:{default:X}}o.default.register({"attributors/attribute/direction":l.DirectionAttribute,"attributors/class/align":a.AlignClass,"attributors/class/background":m.BackgroundClass,"attributors/class/color":p.ColorClass,"attributors/class/direction":l.DirectionClass,"attributors/class/font":y.FontClass,"attributors/class/size":w.SizeClass,"attributors/style/align":a.AlignStyle,"attributors/style/background":m.BackgroundStyle,"attributors/style/color":p.ColorStyle,"attributors/style/direction":l.DirectionStyle,"attributors/style/font":y.FontStyle,"attributors/style/size":w.SizeStyle},!0),o.default.register({"formats/align":a.AlignClass,"formats/direction":l.DirectionClass,"formats/indent":c.IndentClass,"formats/background":m.BackgroundStyle,"formats/color":p.ColorStyle,"formats/font":y.FontClass,"formats/size":w.SizeClass,"formats/blockquote":f.default,"formats/code-block":k.default,"formats/header":h.default,"formats/list":v.default,"formats/bold":S.default,"formats/code":G.Code,"formats/italic":M.default,"formats/link":C.default,"formats/script":A.default,"formats/strike":P.default,"formats/underline":F.default,"formats/image":H.default,"formats/video":B.default,"formats/list/item":g.ListItem,"modules/formula":q.default,"modules/syntax":ee.default,"modules/toolbar":Q.default,"themes/bubble":de.default,"themes/snow":Ae.default,"ui/icons":re.default,"ui/picker":ye.default,"ui/icon-picker":Ke.default,"ui/color-picker":Ie.default,"ui/tooltip":dt.default},!0),r.default=o.default},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.IndentClass=void 0;var s=function(){function v(m,p){for(var y=0;y<p.length;y++){var w=p[y];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,p,y){return p&&v(m.prototype,p),y&&v(m,y),m}}(),o=function v(m,p,y){m===null&&(m=Function.prototype);var w=Object.getOwnPropertyDescriptor(m,p);if(w===void 0){var x=Object.getPrototypeOf(m);return x===null?void 0:v(x,p,y)}else{if("value"in w)return w.value;var S=w.get;return S===void 0?void 0:S.call(y)}},a=i(0),l=c(a);function c(v){return v&&v.__esModule?v:{default:v}}function d(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function f(v,m){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:v}function u(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(v,m):v.__proto__=m)}var h=function(v){u(m,v);function m(){return d(this,m),f(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return s(m,[{key:"add",value:function(y,w){if(w==="+1"||w==="-1"){var x=this.value(y)||0;w=w==="+1"?x+1:x-1}return w===0?(this.remove(y),!0):o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"add",this).call(this,y,w)}},{key:"canAdd",value:function(y,w){return o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"canAdd",this).call(this,y,w)||o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"canAdd",this).call(this,y,parseInt(w))}},{key:"value",value:function(y){return parseInt(o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"value",this).call(this,y))||void 0}}]),m}(l.default.Attributor.Class),g=new h("indent","ql-indent",{scope:l.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});r.IndentClass=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(4),o=a(s);function a(u){return u&&u.__esModule?u:{default:u}}function l(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}function c(u,h){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:u}function d(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);u.prototype=Object.create(h&&h.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(u,h):u.__proto__=h)}var f=function(u){d(h,u);function h(){return l(this,h),c(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);f.blotName="blockquote",f.tagName="blockquote",r.default=f},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function h(g,v){for(var m=0;m<v.length;m++){var p=v[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(g,p.key,p)}}return function(g,v,m){return v&&h(g.prototype,v),m&&h(g,m),g}}(),o=i(4),a=l(o);function l(h){return h&&h.__esModule?h:{default:h}}function c(h,g){if(!(h instanceof g))throw new TypeError("Cannot call a class as a function")}function d(h,g){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:h}function f(h,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);h.prototype=Object.create(g&&g.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(h,g):h.__proto__=g)}var u=function(h){f(g,h);function g(){return c(this,g),d(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return s(g,null,[{key:"formats",value:function(m){return this.tagName.indexOf(m.tagName)+1}}]),g}(a.default);u.blotName="header",u.tagName=["H1","H2","H3","H4","H5","H6"],r.default=u},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.ListItem=void 0;var s=function(){function x(S,I){for(var M=0;M<I.length;M++){var E=I[M];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(S,E.key,E)}}return function(S,I,M){return I&&x(S.prototype,I),M&&x(S,M),S}}(),o=function x(S,I,M){S===null&&(S=Function.prototype);var E=Object.getOwnPropertyDescriptor(S,I);if(E===void 0){var C=Object.getPrototypeOf(S);return C===null?void 0:x(C,I,M)}else{if("value"in E)return E.value;var T=E.get;return T===void 0?void 0:T.call(M)}},a=i(0),l=h(a),c=i(4),d=h(c),f=i(25),u=h(f);function h(x){return x&&x.__esModule?x:{default:x}}function g(x,S,I){return S in x?Object.defineProperty(x,S,{value:I,enumerable:!0,configurable:!0,writable:!0}):x[S]=I,x}function v(x,S){if(!(x instanceof S))throw new TypeError("Cannot call a class as a function")}function m(x,S){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:x}function p(x,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);x.prototype=Object.create(S&&S.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(x,S):x.__proto__=S)}var y=function(x){p(S,x);function S(){return v(this,S),m(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return s(S,[{key:"format",value:function(M,E){M===w.blotName&&!E?this.replaceWith(l.default.create(this.statics.scope)):o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"format",this).call(this,M,E)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(M,E){return this.parent.isolate(this.offset(this.parent),this.length()),M===this.parent.statics.blotName?(this.parent.replaceWith(M,E),this):(this.parent.unwrap(),o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"replaceWith",this).call(this,M,E))}}],[{key:"formats",value:function(M){return M.tagName===this.tagName?void 0:o(S.__proto__||Object.getPrototypeOf(S),"formats",this).call(this,M)}}]),S}(d.default);y.blotName="list-item",y.tagName="LI";var w=function(x){p(S,x),s(S,null,[{key:"create",value:function(M){var E=M==="ordered"?"OL":"UL",C=o(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,E);return(M==="checked"||M==="unchecked")&&C.setAttribute("data-checked",M==="checked"),C}},{key:"formats",value:function(M){if(M.tagName==="OL")return"ordered";if(M.tagName==="UL")return M.hasAttribute("data-checked")?M.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function S(I){v(this,S);var M=m(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,I)),E=function(T){if(T.target.parentNode===I){var A=M.statics.formats(I),R=l.default.find(T.target);A==="checked"?R.format("list","unchecked"):A==="unchecked"&&R.format("list","checked")}};return I.addEventListener("touchstart",E),I.addEventListener("mousedown",E),M}return s(S,[{key:"format",value:function(M,E){this.children.length>0&&this.children.tail.format(M,E)}},{key:"formats",value:function(){return g({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(M,E){if(M instanceof y)o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"insertBefore",this).call(this,M,E);else{var C=E==null?this.length():E.offset(this),T=this.split(C);T.parent.insertBefore(M,T)}}},{key:"optimize",value:function(M){o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"optimize",this).call(this,M);var E=this.next;E!=null&&E.prev===this&&E.statics.blotName===this.statics.blotName&&E.domNode.tagName===this.domNode.tagName&&E.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(E.moveChildren(this),E.remove())}},{key:"replace",value:function(M){if(M.statics.blotName!==this.statics.blotName){var E=l.default.create(this.statics.defaultChild);M.moveChildren(E),this.appendChild(E)}o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"replace",this).call(this,M)}}]),S}(u.default);w.blotName="list",w.scope=l.default.Scope.BLOCK_BLOT,w.tagName=["OL","UL"],w.defaultChild="list-item",w.allowedChildren=[y],r.ListItem=y,r.default=w},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(56),o=a(s);function a(u){return u&&u.__esModule?u:{default:u}}function l(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}function c(u,h){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:u}function d(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);u.prototype=Object.create(h&&h.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(u,h):u.__proto__=h)}var f=function(u){d(h,u);function h(){return l(this,h),c(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);f.blotName="italic",f.tagName=["EM","I"],r.default=f},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function g(v,m){for(var p=0;p<m.length;p++){var y=m[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(v,y.key,y)}}return function(v,m,p){return m&&g(v.prototype,m),p&&g(v,p),v}}(),o=function g(v,m,p){v===null&&(v=Function.prototype);var y=Object.getOwnPropertyDescriptor(v,m);if(y===void 0){var w=Object.getPrototypeOf(v);return w===null?void 0:g(w,m,p)}else{if("value"in y)return y.value;var x=y.get;return x===void 0?void 0:x.call(p)}},a=i(6),l=c(a);function c(g){return g&&g.__esModule?g:{default:g}}function d(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function f(g,v){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:g}function u(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);g.prototype=Object.create(v&&v.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(g,v):g.__proto__=v)}var h=function(g){u(v,g);function v(){return d(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,null,[{key:"create",value:function(p){return p==="super"?document.createElement("sup"):p==="sub"?document.createElement("sub"):o(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,p)}},{key:"formats",value:function(p){if(p.tagName==="SUB")return"sub";if(p.tagName==="SUP")return"super"}}]),v}(l.default);h.blotName="script",h.tagName=["SUB","SUP"],r.default=h},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(6),o=a(s);function a(u){return u&&u.__esModule?u:{default:u}}function l(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}function c(u,h){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:u}function d(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);u.prototype=Object.create(h&&h.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(u,h):u.__proto__=h)}var f=function(u){d(h,u);function h(){return l(this,h),c(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);f.blotName="strike",f.tagName="S",r.default=f},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=i(6),o=a(s);function a(u){return u&&u.__esModule?u:{default:u}}function l(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}function c(u,h){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:u}function d(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);u.prototype=Object.create(h&&h.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(u,h):u.__proto__=h)}var f=function(u){d(h,u);function h(){return l(this,h),c(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);f.blotName="underline",f.tagName="U",r.default=f},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function m(p,y){for(var w=0;w<y.length;w++){var x=y[w];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(p,x.key,x)}}return function(p,y,w){return y&&m(p.prototype,y),w&&m(p,w),p}}(),o=function m(p,y,w){p===null&&(p=Function.prototype);var x=Object.getOwnPropertyDescriptor(p,y);if(x===void 0){var S=Object.getPrototypeOf(p);return S===null?void 0:m(S,y,w)}else{if("value"in x)return x.value;var I=x.get;return I===void 0?void 0:I.call(w)}},a=i(0),l=d(a),c=i(27);function d(m){return m&&m.__esModule?m:{default:m}}function f(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}function u(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:m}function h(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}var g=["alt","height","width"],v=function(m){h(p,m);function p(){return f(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return s(p,[{key:"format",value:function(w,x){g.indexOf(w)>-1?x?this.domNode.setAttribute(w,x):this.domNode.removeAttribute(w):o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,w,x)}}],[{key:"create",value:function(w){var x=o(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,w);return typeof w=="string"&&x.setAttribute("src",this.sanitize(w)),x}},{key:"formats",value:function(w){return g.reduce(function(x,S){return w.hasAttribute(S)&&(x[S]=w.getAttribute(S)),x},{})}},{key:"match",value:function(w){return/\.(jpe?g|gif|png)$/.test(w)||/^data:image\/.+;base64/.test(w)}},{key:"sanitize",value:function(w){return(0,c.sanitize)(w,["http","https","data"])?w:"//:0"}},{key:"value",value:function(w){return w.getAttribute("src")}}]),p}(l.default.Embed);v.blotName="image",v.tagName="IMG",r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function m(p,y){for(var w=0;w<y.length;w++){var x=y[w];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(p,x.key,x)}}return function(p,y,w){return y&&m(p.prototype,y),w&&m(p,w),p}}(),o=function m(p,y,w){p===null&&(p=Function.prototype);var x=Object.getOwnPropertyDescriptor(p,y);if(x===void 0){var S=Object.getPrototypeOf(p);return S===null?void 0:m(S,y,w)}else{if("value"in x)return x.value;var I=x.get;return I===void 0?void 0:I.call(w)}},a=i(4),l=i(27),c=d(l);function d(m){return m&&m.__esModule?m:{default:m}}function f(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}function u(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:m}function h(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}var g=["height","width"],v=function(m){h(p,m);function p(){return f(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return s(p,[{key:"format",value:function(w,x){g.indexOf(w)>-1?x?this.domNode.setAttribute(w,x):this.domNode.removeAttribute(w):o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,w,x)}}],[{key:"create",value:function(w){var x=o(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,w);return x.setAttribute("frameborder","0"),x.setAttribute("allowfullscreen",!0),x.setAttribute("src",this.sanitize(w)),x}},{key:"formats",value:function(w){return g.reduce(function(x,S){return w.hasAttribute(S)&&(x[S]=w.getAttribute(S)),x},{})}},{key:"sanitize",value:function(w){return c.default.sanitize(w)}},{key:"value",value:function(w){return w.getAttribute("src")}}]),p}(a.BlockEmbed);v.blotName="video",v.className="ql-video",v.tagName="IFRAME",r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.FormulaBlot=void 0;var s=function(){function w(x,S){for(var I=0;I<S.length;I++){var M=S[I];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(x,M.key,M)}}return function(x,S,I){return S&&w(x.prototype,S),I&&w(x,I),x}}(),o=function w(x,S,I){x===null&&(x=Function.prototype);var M=Object.getOwnPropertyDescriptor(x,S);if(M===void 0){var E=Object.getPrototypeOf(x);return E===null?void 0:w(E,S,I)}else{if("value"in M)return M.value;var C=M.get;return C===void 0?void 0:C.call(I)}},a=i(35),l=h(a),c=i(5),d=h(c),f=i(9),u=h(f);function h(w){return w&&w.__esModule?w:{default:w}}function g(w,x){if(!(w instanceof x))throw new TypeError("Cannot call a class as a function")}function v(w,x){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:w}function m(w,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);w.prototype=Object.create(x&&x.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(w,x):w.__proto__=x)}var p=function(w){m(x,w);function x(){return g(this,x),v(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return s(x,null,[{key:"create",value:function(I){var M=o(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,I);return typeof I=="string"&&(window.katex.render(I,M,{throwOnError:!1,errorColor:"#f00"}),M.setAttribute("data-value",I)),M}},{key:"value",value:function(I){return I.getAttribute("data-value")}}]),x}(l.default);p.blotName="formula",p.className="ql-formula",p.tagName="SPAN";var y=function(w){m(x,w),s(x,null,[{key:"register",value:function(){d.default.register(p,!0)}}]);function x(){g(this,x);var S=v(this,(x.__proto__||Object.getPrototypeOf(x)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return S}return x}(u.default);r.FormulaBlot=p,r.default=y},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.CodeToken=r.CodeBlock=void 0;var s=function(){function I(M,E){for(var C=0;C<E.length;C++){var T=E[C];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(M,T.key,T)}}return function(M,E,C){return E&&I(M.prototype,E),C&&I(M,C),M}}(),o=function I(M,E,C){M===null&&(M=Function.prototype);var T=Object.getOwnPropertyDescriptor(M,E);if(T===void 0){var A=Object.getPrototypeOf(M);return A===null?void 0:I(A,E,C)}else{if("value"in T)return T.value;var R=T.get;return R===void 0?void 0:R.call(C)}},a=i(0),l=v(a),c=i(5),d=v(c),f=i(9),u=v(f),h=i(13),g=v(h);function v(I){return I&&I.__esModule?I:{default:I}}function m(I,M){if(!(I instanceof M))throw new TypeError("Cannot call a class as a function")}function p(I,M){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:I}function y(I,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);I.prototype=Object.create(M&&M.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(I,M):I.__proto__=M)}var w=function(I){y(M,I);function M(){return m(this,M),p(this,(M.__proto__||Object.getPrototypeOf(M)).apply(this,arguments))}return s(M,[{key:"replaceWith",value:function(C){this.domNode.textContent=this.domNode.textContent,this.attach(),o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"replaceWith",this).call(this,C)}},{key:"highlight",value:function(C){var T=this.domNode.textContent;this.cachedText!==T&&((T.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=C(T),this.domNode.normalize(),this.attach()),this.cachedText=T)}}]),M}(g.default);w.className="ql-syntax";var x=new l.default.Attributor.Class("token","hljs",{scope:l.default.Scope.INLINE}),S=function(I){y(M,I),s(M,null,[{key:"register",value:function(){d.default.register(x,!0),d.default.register(w,!0)}}]);function M(E,C){m(this,M);var T=p(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,E,C));if(typeof T.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var A=null;return T.quill.on(d.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(A),A=setTimeout(function(){T.highlight(),A=null},T.options.interval)}),T.highlight(),T}return s(M,[{key:"highlight",value:function(){var C=this;if(!this.quill.selection.composing){this.quill.update(d.default.sources.USER);var T=this.quill.getSelection();this.quill.scroll.descendants(w).forEach(function(A){A.highlight(C.options.highlight)}),this.quill.update(d.default.sources.SILENT),T!=null&&this.quill.setSelection(T,d.default.sources.SILENT)}}}]),M}(u.default);S.DEFAULTS={highlight:function(){return window.hljs==null?null:function(I){var M=window.hljs.highlightAuto(I);return M.value}}(),interval:1e3},r.CodeBlock=w,r.CodeToken=x,r.default=S},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(n,r){n.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line>
8275 <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(n,r){n.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(n,r){n.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(n,r){n.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'}
vendor: 9,451 bytes, line 8275
8275,function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BubbleTooltip=void 0;var s=function M(E,C,T){E===null&&(E=Function.prototype);var A=Object.getOwnPropertyDescriptor(E,C);if(A===void 0){var R=Object.getPrototypeOf(E);return R===null?void 0:M(R,C,T)}else{if("value"in A)return A.value;var P=A.get;return P===void 0?void 0:P.call(T)}},o=function(){function M(E,C){for(var T=0;T<C.length;T++){var A=C[T];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(E,A.key,A)}}return function(E,C,T){return C&&M(E.prototype,C),T&&M(E,T),E}}(),a=i(3),l=m(a),c=i(8),d=m(c),f=i(43),u=m(f),h=i(15),g=i(41),v=m(g);function m(M){return M&&M.__esModule?M:{default:M}}function p(M,E){if(!(M instanceof E))throw new TypeError("Cannot call a class as a function")}function y(M,E){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:M}function w(M,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);M.prototype=Object.create(E&&E.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(M,E):M.__proto__=E)}var x=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],S=function(M){w(E,M);function E(C,T){p(this,E),T.modules.toolbar!=null&&T.modules.toolbar.container==null&&(T.modules.toolbar.container=x);var A=y(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,C,T));return A.quill.container.classList.add("ql-bubble"),A}return o(E,[{key:"extendToolbar",value:function(T){this.tooltip=new I(this.quill,this.options.bounds),this.tooltip.root.appendChild(T.container),this.buildButtons([].slice.call(T.container.querySelectorAll("button")),v.default),this.buildPickers([].slice.call(T.container.querySelectorAll("select")),v.default)}}]),E}(u.default);S.DEFAULTS=(0,l.default)(!0,{},u.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(E){E?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var I=function(M){w(E,M);function E(C,T){p(this,E);var A=y(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,C,T));return A.quill.on(d.default.events.EDITOR_CHANGE,function(R,P,D,F){if(R===d.default.events.SELECTION_CHANGE)if(P!=null&&P.length>0&&F===d.default.sources.USER){A.show(),A.root.style.left="0px",A.root.style.width="",A.root.style.width=A.root.offsetWidth+"px";var V=A.quill.getLines(P.index,P.length);if(V.length===1)A.position(A.quill.getBounds(P));else{var H=V[V.length-1],$=A.quill.getIndex(H),B=Math.min(H.length()-1,P.index+P.length-$),G=A.quill.getBounds(new h.Range($,B));A.position(G)}}else document.activeElement!==A.textbox&&A.quill.hasFocus()&&A.hide()}),A}return o(E,[{key:"listen",value:function(){var T=this;s(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){T.root.classList.remove("ql-editing")}),this.quill.on(d.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!T.root.classList.contains("ql-hidden")){var A=T.quill.getSelection();A!=null&&T.position(T.quill.getBounds(A))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(T){var A=s(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"position",this).call(this,T),R=this.root.querySelector(".ql-tooltip-arrow");if(R.style.marginLeft="",A===0)return A;R.style.marginLeft=-1*A-R.offsetWidth/2+"px"}}]),E}(f.BaseTooltip);I.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),r.BubbleTooltip=I,r.default=S},function(n,r,i){n.exports=i(63)}]).default})})(e4);var Zpe=e4.exports,Jpe=oi&&oi.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)i.hasOwnProperty(s)&&(r[s]=i[s])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sv=oi&&oi.__assign||function(){return Sv=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Sv.apply(this,arguments)},eme=oi&&oi.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r},Zy=oi&&oi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},ds=Zy(O),tme=Zy(qu),qd=Zy(Qpe),_I=Zy(Zpe),nme=function(t){Jpe(e,t);function e(n){var r=t.call(this,n)||this;r.dirtyProps=["modules","formats","bounds","theme","children"],r.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp"],r.state={generation:0},r.selection=null,r.onEditorChange=function(s,o,a,l){var c,d,f,u;s==="text-change"?(d=(c=r).onEditorChangeText)===null||d===void 0||d.call(c,r.editor.root.innerHTML,o,l,r.unprivilegedEditor):s==="selection-change"&&((u=(f=r).onEditorChangeSelection)===null||u===void 0||u.call(f,o,l,r.unprivilegedEditor))};var i=r.isControlled()?n.value:n.defaultValue;return r.value=i??"",r}return e.prototype.validateProps=function(n){var r;if(ds.default.Children.count(n.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(ds.default.Children.count(n.children)){var i=ds.default.Children.only(n.children);if(((r=i)===null||r===void 0?void 0:r.type)==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.")}if(this.lastDeltaChangeSet&&n.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")},e.prototype.shouldComponentUpdate=function(n,r){var i=this,s;if(this.validateProps(n),!this.editor||this.state.generation!==r.generation)return!0;if("value"in n){var o=this.getEditorContents(),a=(s=n.value,s??"");this.isEqualValue(a,o)||this.setEditorContents(this.editor,a)}return n.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,n.readOnly),eme(this.cleanProps,this.dirtyProps).some(function(l){return!qd.default(n[l],i.props[l])})},e.prototype.shouldComponentRegenerate=function(n){var r=this;return this.dirtyProps.some(function(i){return!qd.default(n[i],r.props[i])})},e.prototype.componentDidMount=function(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())},e.prototype.componentWillUnmount=function(){this.destroyEditor()},e.prototype.componentDidUpdate=function(n,r){var i=this;if(this.editor&&this.shouldComponentRegenerate(n)){var s=this.editor.getContents(),o=this.editor.getSelection();this.regenerationSnapshot={delta:s,selection:o},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==r.generation){var a=this.regenerationSnapshot,s=a.delta,l=a.selection;delete this.regenerationSnapshot,this.instantiateEditor();var c=this.editor;c.setContents(s),xI(function(){return i.setEditorSelection(c,l)})}},e.prototype.instantiateEditor=function(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())},e.prototype.destroyEditor=function(){this.editor&&this.unhookEditor(this.editor)},e.prototype.isControlled=function(){return"value"in this.props},e.prototype.getEditorConfig=function(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,scrollingContainer:this.props.scrollingContainer,tabIndex:this.props.tabIndex,theme:this.props.theme}},e.prototype.getEditor=function(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor},e.prototype.createEditor=function(n,r){var i=new _I.default(n,r);return r.tabIndex!=null&&this.setEditorTabIndex(i,r.tabIndex),this.hookEditor(i),i},e.prototype.hookEditor=function(n){this.unprivilegedEditor=this.makeUnprivilegedEditor(n),n.on("editor-change",this.onEditorChange)},e.prototype.unhookEditor=function(n){n.off("editor-change",this.onEditorChange)},e.prototype.getEditorContents=function(){return this.value},e.prototype.getEditorSelection=function(){return this.selection},e.prototype.isDelta=function(n){return n&&n.ops},e.prototype.isEqualValue=function(n,r){return this.isDelta(n)&&this.isDelta(r)?qd.default(n.ops,r.ops):qd.default(n,r)},e.prototype.setEditorContents=function(n,r){var i=this;this.value=r;var s=this.getEditorSelection();typeof r=="string"?n.setContents(n.clipboard.convert(r)):n.setContents(r),xI(function(){return i.setEditorSelection(n,s)})},e.prototype.setEditorSelection=function(n,r){if(this.selection=r,r){var i=n.getLength();r.index=Math.max(0,Math.min(r.index,i-1)),r.length=Math.max(0,Math.min(r.length,i-1-r.index)),n.setSelection(r)}},e.prototype.setEditorTabIndex=function(n,r){var i,s;!((s=(i=n)===null||i===void 0?void 0:i.scroll)===null||s===void 0)&&s.domNo
8275de&&(n.scroll.domNode.tabIndex=r)},e.prototype.setEditorReadOnly=function(n,r){r?n.disable():n.enable()},e.prototype.makeUnprivilegedEditor=function(n){var r=n;return{getHTML:function(){return r.root.innerHTML},getLength:r.getLength.bind(r),getText:r.getText.bind(r),getContents:r.getContents.bind(r),getSelection:r.getSelection.bind(r),getBounds:r.getBounds.bind(r)}},e.prototype.getEditingArea=function(){if(!this.editingArea)throw new Error("Instantiating on missing editing area");var n=tme.default.findDOMNode(this.editingArea);if(!n)throw new Error("Cannot find element for editing area");if(n.nodeType===3)throw new Error("Editing area cannot be a text node");return n},e.prototype.renderEditingArea=function(){var n=this,r=this.props,i=r.children,s=r.preserveWhitespace,o=this.state.generation,a={key:o,ref:function(l){n.editingArea=l}};return ds.default.Children.count(i)?ds.default.cloneElement(ds.default.Children.only(i),a):s?ds.default.createElement("pre",Sv({},a)):ds.default.createElement("div",Sv({},a))},e.prototype.render=function(){var n;return ds.default.createElement("div",{id:this.props.id,style:this.props.style,key:this.state.generation,className:"quill "+(n=this.props.className,n??""),onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp},this.renderEditingArea())},e.prototype.onEditorChangeText=function(n,r,i,s){var o,a;if(this.editor){var l=this.isDelta(this.value)?s.getContents():s.getHTML();l!==this.getEditorContents()&&(this.lastDeltaChangeSet=r,this.value=l,(a=(o=this.props).onChange)===null||a===void 0||a.call(o,n,r,i,s))}},e.prototype.onEditorChangeSelection=function(n,r,i){var s,o,a,l,c,d;if(this.editor){var f=this.getEditorSelection(),u=!f&&n,h=f&&!n;qd.default(n,f)||(this.selection=n,(o=(s=this.props).onChangeSelection)===null||o===void 0||o.call(s,n,r,i),u?(l=(a=this.props).onFocus)===null||l===void 0||l.call(a,n,r,i):h&&((d=(c=this.props).onBlur)===null||d===void 0||d.call(c,f,r,i)))}},e.prototype.focus=function(){this.editor&&this.editor.focus()},e.prototype.blur=function(){this.editor&&(this.selection=null,this.editor.blur())},e.displayName="React Quill",e.Quill=_I.default,e.defaultProps={theme:"snow",modules:{},readOnly:!1},e}(ds.default.Component);function xI(t){Promise.resolve().then(t)}var rme=nme;const ag=z1(rme),ime="https://placehold.net/800x600.png",sme=()=>{const{id:t}=Vw(),{t:e,language:n}=ss(),[r,i]=O.useState(null),[s,o]=O.useState(!0),a=c=>{const d=(n||"en").split("-")[0];return c[d]||c.en||c.tr||c.ar||""},l=c=>{if(!c)return"";try{const d=new URL(c),f=d.hostname.replace("www.","");if(f==="youtu.be"){const u=d.pathname.split("/").filter(Boolean)[0];return u?`https://www.youtube.com/embed/${u}`:""}if(f==="youtube.com"||f==="m.youtube.com"){if(d.pathname==="/watch"){const u=d.searchParams.get("v");return u?`https://www.youtube.com/embed/${u}`:""}if(d.pathname.startsWith("/shorts/")){const u=d.pathname.split("/").filter(Boolean)[1];return u?`https://www.youtube.com/embed/${u}`:""}if(d.pathname.startsWith("/embed/"))return c}return c}catch{return c}};return O.useEffect(()=>{if(!t)return;const c=Oi(_n(Et,"blogs",t),d=>{if(!d.exists()){i(null),o(!1);return}const f={id:d.id,...d.data()};f.enabled===!1||f.status!=="Published"?i(null):(i(f),xt("public_blog_detail_view",{blog_id:f.id,has_video:!!f.videoUrl})),o(!1)},()=>o(!1));return()=>c()},[t]),s?_.jsx("div",{className:"min-h-screen py-20",children:_.jsx(ad,{})}):r?_.jsx("div",{className:"min-h-screen py-20 px-4 sm:px-6 lg:px-8",children:_.jsxs("article",{className:"max-w-3xl mx-auto",children:[_.jsxs(kn,{to:"/blog",className:"text-sm text-primary hover:underline",children:["<-"," ",e("nav.blog")]}),_.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-foreground mt-4 mb-4",children:a(r.title)}),_.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-6",children:[(r.tags||[]).map((c,d)=>_.jsx(Dr,{variant:"outline",className:"text-xs",children:c},d)),r.createdAt&&_.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:new Date(r.createdAt.seconds?r.createdAt.seconds*1e3:r.createdAt).toLocaleDateString()})]}),_.jsx("div",{className:"mb-6 overflow-hidden rounded-lg border border-border",children:_.jsx("img",{src:r.featuredImage||ime,alt:a(r.title),className:"w-full h-auto object-cover"})}),_.jsx("div",{className:"[&_.ql-container]:border-0 [&_.ql-editor]:!p-0 [&_.ql-editor]:text-foreground [&_.ql-editor_blockquote]:text-muted-foreground",children:_.jsx(ag,{value:a(r.content),readOnly:!0,theme:"snow",modules:{toolbar:!1}})}),r.videoUrl?_.jsx("div",{className:"mt-8 aspect-video overflow-hidden rounded-lg border border-border",children:_.jsx("iframe",{src:l(r.videoUrl),className:"h-full w-full",loading:"lazy",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:a(r.title)})}):null]})}):_.jsx("div",{className:"min-h-screen py-20 px-4 sm:px-6 lg:px-8",children:_.jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[_.jsx("h1",{className:"text-3xl font-bold text-foreground mb-4",children:"Blog not found"}),_.jsx("p",{className:"text-muted-foreground mb-8",children:"This post may be unpublished or removed."}),_.jsx(kn,{to:"/blog",className:"text-primary hover:underline",children:e("nav.blog")})]})})},sn=O.forwardRef(({className:t,type:e,...n},r)=>_.jsx("input",{type:e,className:Mt("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));sn.displayName="Input";var ome="Label",t4=O.forwardRef((t,e)=>_.jsx(kt.label,{...t,ref:e,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));t4.displayName=ome;var n4=t4;const ame=ny("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),$t=O.forwardRef(({className:t,...e},n)=>_.jsx(n4,{ref:n,className:Mt(ame(),t),...e}));$t.displayName=n4.displayName;const r4=O.forwardRef(({className:t,...e},n)=>_.jsx("textarea",{className:Mt("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
8275ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...e}));r4.displayName="Textarea";const lme=()=>{const{t}=ss(),[e,n]=O.useState(!1),[r,i]=O.useState(!1),[s,o]=O.useState(""),[a,l]=O.useState({name:"",email:"",subject:"",message:""}),c=async u=>{var h;u.preventDefault(),n(!0);try{await Fu(Vn(Et,"contacts"),{name:a.name,email:a.email,message:a.message,status:"New",createdAt:hR(),responded:!1}),Rt({title:"Success!",description:t("contact.success")}),xt("contact_form_submit",{success:!0,has_subject:!!((h=a.subject)!=null&&h.trim())}),l({name:"",email:"",subject:"",message:""})}catch(g){console.error("Error submitting form:",g),xt("contact_form_submit",{success:!1}),Rt({title:"Error",description:"There was an error sending your message. Please try again.",variant:"destructive"})}finally{n(!1)}},d=(u,h)=>{l(g=>({...g,[u]:h}))},f=async u=>{if(u.preventDefault(),!!s.trim()){i(!0);try{await Fu(Vn(Et,"emailSubscriptions"),{email:s.trim().toLowerCase(),createdAt:hR()}),Rt({title:"Success!",description:"You have been subscribed to our email updates."}),xt("email_subscription_submit",{success:!0}),o("")}catch(h){console.error("Error subscribing email:",h),xt("email_subscription_submit",{success:!1}),Rt({title:"Error",description:"Subscription failed. Please try again.",variant:"destructive"})}finally{i(!1)}}};return _.jsx("div",{className:"min-h-screen py-20 px-4 sm:px-6 lg:px-8",children:_.jsxs("div",{className:"max-w-7xl mx-auto",children:[_.jsxs("div",{className:"text-center mb-16",children:[_.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-foreground mb-6",children:t("contact.title")}),_.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"Ready to start your next engineering project? Get in touch with our team of experts."})]}),_.jsxs("div",{className:"grid lg:grid-cols-2 gap-12",children:[_.jsxs(on,{className:"border-border bg-card",children:[_.jsx(wi,{children:_.jsx(Ei,{className:"text-foreground",children:"Send us a Message"})}),_.jsx(an,{children:_.jsxs("form",{onSubmit:c,className:"space-y-6",children:[_.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[_.jsxs("div",{className:"space-y-2",children:[_.jsx($t,{htmlFor:"name",children:t("contact.name")}),_.jsx(sn,{id:"name",type:"text",required:!0,value:a.name,onChange:u=>d("name",u.target.value),placeholder:"Your full name"})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx($t,{htmlFor:"email",children:t("contact.email")}),_.jsx(sn,{id:"email",type:"email",required:!0,value:a.email,onChange:u=>d("email",u.target.value),placeholder:"[email protected]"})]})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx($t,{htmlFor:"subject",children:t("contact.subject")}),_.jsx(sn,{id:"subject",type:"text",required:!0,value:a.subject,onChange:u=>d("subject",u.target.value),placeholder:"What can we help you with?"})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx($t,{htmlFor:"message",children:t("contact.message")}),_.jsx(r4,{id:"message",required:!0,rows:6,value:a.message,onChange:u=>d("message",u.target.value),placeholder:"Tell us about your project requirements..."})]}),_.jsx(rt,{type:"submit",className:"w-full",disabled:e,children:e?_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin mr-2"}),"Sending..."]}):_.jsxs(_.Fragment,{children:[_.jsx(N8,{className:"mr-2 h-4 w-4"}),t("contact.send")]})})]})})]}),_.jsxs("div",{className:"space-y-8",children:[_.jsxs(on,{className:"border-border bg-card",children:[_.jsx(wi,{children:_.jsx(Ei,{className:"text-foreground",children:"Get in Touch"})}),_.jsx(an,{className:"space-y-6",children:_.jsxs("div",{className:"flex items-start space-x-4",children:[_.jsx("div",{className:"w-10 h-10 bg-primary/10 rounded-lg flex items-center justify-center",children:_.jsx(ry,{className:"h-5 w-5 text-primary"})}),_.jsxs("div",{children:[_.jsx("h3",{className:"font-medium text-foreground",children:"Email"}),_.jsx("p",{className:"text-muted-foreground",children:"[email protected]"})]})]})})]}),_.jsxs(on,{className:"border-border bg-card",children:[_.jsx(wi,{children:_.jsx(Ei,{className:"text-foreground",children:"Email Subscription"})}),_.jsxs(an,{children:[_.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Subscribe to re
8275ceive product updates and engineering insights."}),_.jsxs("form",{onSubmit:f,className:"space-y-3",children:[_.jsx(sn,{type:"email",required:!0,value:s,onChange:u=>o(u.target.value),placeholder:"[email protected]"}),_.jsx(rt,{type:"submit",className:"w-full",disabled:r,children:r?"Subscribing...":"Subscribe"})]})]})]})]})]})]})})},cme=()=>{const{user:t,login:e}=Zh(),[n,r]=O.useState(!1),[i,s]=O.useState({email:"",password:""});if(t)return _.jsx(zw,{to:"/admin/dashboard",replace:!0});const o=async a=>{a.preventDefault(),r(!0);try{await e(i.email,i.password),xt("admin_login_form_submit",{success:!0}),Rt({title:"Success!",description:"Welcome back, admin!"})}catch(l){console.error("Login error:",l),xt("admin_login_form_submit",{success:!1}),Rt({title:"Login Failed",description:"Invalid email or password. Please try again.",variant:"destructive"})}finally{r(!1)}};return _.jsx("div",{className:"min-h-screen flex items-center justify-center py-20 px-4 sm:px-6 lg:px-8",children:_.jsx("div",{className:"max-w-md w-full",children:_.jsxs(on,{className:"border-border bg-card",children:[_.jsxs(wi,{className:"text-center",children:[_.jsx("div",{className:"w-12 h-12 bg-primary rounded-lg flex items-center justify-center mx-auto mb-4",children:_.jsx(pM,{className:"h-6 w-6 text-primary-foreground"})}),_.jsx(Ei,{className:"text-2xl text-foreground",children:"Admin Login"}),_.jsx("p",{className:"text-muted-foreground",children:"Sign in to access the admin dashboard"})]}),_.jsx(an,{children:_.jsxs("form",{onSubmit:o,className:"space-y-6",children:[_.jsxs("div",{className:"space-y-2",children:[_.jsx($t,{htmlFor:"email",children:"Email"}),_.jsx(sn,{id:"email",type:"email",required:!0,value:i.email,onChange:a=>s(l=>({...l,email:a.target.value})),placeholder:"Enter your email"})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx($t,{htmlFor:"password",children:"Password"}),_.jsx(sn,{id:"password",type:"password",required:!0,value:i.password,onChange:a=>s(l=>({...l,password:a.target.value})),placeholder:"Enter your password"})]}),_.jsx(rt,{type:"submit",className:"w-full",disabled:n,children:n?_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin mr-2"}),"Signing In..."]}):_.jsxs(_.Fragment,{children:[_.jsx(pM,{className:"mr-2 h-4 w-4"}),"Sign In"]})})]})})]})})})},ume=()=>{const{user:t,logout:e}=Zh(),n=Oh(),[r,i]=O.useState({services:0,projects:0,blogs:0,contacts:0}),[s,o]=O.useState(!0);if(O.useEffect(()=>{(async()=>{const[d,f,u,h]=await Promise.all([qp(Vn(Et,"services")),qp(Vn(Et,"projects")),qp(Vn(Et,"blogs")),qp(Vn(Et,"contacts"))]);i({services:d.data().count,projects:f.data().count,blogs:u.data().count,contacts:h.data().count}),o(!1)})()},[]),!t)return _.jsx(zw,{to:"/admin",replace:!0});const a=async()=>{try{await e(),Rt({title:"Logged Out",description:"You have been successfully logged out."})}catch(c){console.error("Logout error:",c)}},l=[{title:"Total Services",value:s?"...":r.services,icon:Bg,path:"/admin/services"},{title:"Projects",value:s?"...":r.projects,icon:ah,path:"/admin/projects"},{title:"Blog Posts",value:s?"...":r.blogs,icon:oh,path:"/admin/blog"},{title:"Contact Requests",value:s?"...":r.contacts,icon:Mu,path:"/admin/contacts"}];return _.jsx("div",{className:"min-h-screen py-20 px-2 sm:px-4 md:px-6 lg:px-8",children:_.jsxs("div",{className:"max-w-7xl mx-auto",children:[_.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8 gap-4",children:[_.jsxs("div",{children:[_.jsx("h1",{className:"text-2xl sm:text-3xl font-bold text-foreground",children:f7("admin.dashboard.title")}),_.jsxs("p",{className:"text-muted-foreground text-sm",children:["Welcome back, ",t.email]})]}),_.jsxs(rt,{onClick:a,variant:"outline",className:"w-full sm:w-auto",children:[_.jsx(aE,{className:"mr-2 h-4 w-4"}),"Logout"]})]}),_.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 sm:gap-6 mb-8",children:l.map((c,d)=>_.jsx(on,{className:"border-border bg-card cursor-pointer transition-colors hover:border-primary/40",onClick:()=>n(c.path),children:_.jsx(an,{className:"p-6",children:_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{children:[_.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:c.title}),_.jsx("p",{className:"text-xl sm:text-2xl font-bold text-foreground",children:c.value})]}),_.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-primary/10 rounded-lg flex items-center justify-center",children:_.jsx(c.icon,{className:"h-5 w-5 sm:h-6 sm:w-6 text-primary"})})]})})},d))}),_.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6",children:[_.jsxs(on,{className:"border-border bg-card",children:[_.jsx(wi,{children:_.jsx(Ei,{className:"text-foreground",children:"Manage Services"})}),_.jsxs(an,{children:[_.jsx("p",{className:"text-muted-foreground mb-4",children:"Add, edit, or remove engineering services from your portfolio."}),_.jsxs(rt,{className:"w-full",onClick:()=>n("/admin/services"),children:[_.jsx(Bg,{className:"mr-2 h-4 w-4"}),"Manage Services"]})]})]}),_.jsxs(on,{className:"border-border bg-card",children:[_.jsx(wi,{children:_.jsx(Ei,{className:"text-foreground",children:"Manage Projects"})}),_.jsxs(an,{children:[_.jsx("p",{className:"text-muted-foreground mb-4",children:"Showcase your completed and ongoing engineering projects."}),_.jsxs(rt,{className:"w-full",onClick:()=>n("/admin/projects"),children:[_.jsx(ah,{className:"mr-2 h-4 w-4"}),"Manage Projects"]})]})]}),_.jsxs(on,{className:"border-border bg-card",children:[_.jsx(wi,{children:_.jsx(Ei,{className:"text-foreground",children:"Blog Management"})}),_.jsxs(an,{children:[_.jsx("p",{className:"text-muted-foreground mb-4",children:"Publish and manage blog posts about engineering insights."}),_.jsxs(rt,{className:"w-full",onClick:()=>n("/admin/blog"),children:[_.jsx(oh,{className:"mr-2 h-4 w-4"}),"Manage Blog"]})]})]}),_.jsxs(on,{className:"border-border bg-card",children:[_.jsx(wi,{children:_.jsx(Ei,{className:"text-foreground",children:"Contact Requests"})}),_.jsxs(an,{children:[_.jsx("p",{className:"text-muted-foreground mb-4",children:"View and respond to customer inquiries and quote requests."}),_.jsxs(rt,{className:"w-full",onClick:()=>n("/admin/contacts"),children:[_.jsx(Mu,{className:"mr-2 h-4 w-4"}),"View Requests"]})]})]}),_.jsxs(on,{className:"border-border bg-card",children:[_.jsx(wi,{children:_.jsx(Ei,{className:"text-foreground",children:"Email Subscriptions"})}),_.jsxs(an,{children:[_.jsx("p",{className:"text-muted-foreground mb-4",children:"View subscriber list and export emails as CSV."}),_.jsxs(rt,{className:"w-full",onClick:()=>n("/admin/email-subscriptions"),children:[_.jsx(ry,{className:"mr-2 h-4 w-4"}),"Manage Subscriptions"]})]})]}),_.jsxs(on,{className:"border-border bg-card lg:col-span-2 cursor-pointer transition-colors hover:border-primary/40",onClick:()=>n("/admin/settings"),children:[_.jsx(wi,{children:_.jsx(Ei,{className:"text-foreground",children:"System Information"})}),_.jsxs(an,{children:[_.jsxs("div",{className:"space-y-2",children:[_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{className:"text-muted-foreground",children:"Firebase Status:"}),_.jsx("span",{className:"text-foreground",children:"Connected"})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{className:"text-muted-foreground",children:"Last Backup:"}),_.jsx("span",{className:"text-foreground",children:"2024-01-15"})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{className:"text-muted-foreground",children:"Version:"}),_.jsx("span",{className:"text-foreground",children:"1.0.0"})]})]}),_.jsxs(rt,{variant:"outline",className:"mt-4 w-full sm:w-auto",children:[_.jsx(cE,{className:"mr-2 h-4 w-4"}),"Open Settings"]})]})]})]}),_.jsx(on,{className:"mt-8 border-orange-200 bg-orange-50 dark:border-orange-900 dark:bg-orange-950/20",children:_.jsxs(an,{className:"p-6",children:[_.jsx("h3",{className:"text-lg font-semibold text-orange-800 dark:text-orange-200 mb-2",children:"Development Note"}),_.jsx("p",{className:"text-orange-700 dark:text-orange-300 text-sm",children:"This is the basic admin dashboard structure. Full CRUD operations for services, projects, and blog management will need to be implemented with proper Firestore integration. The current version provides the foundation and demonstrates the planned functionality."})]})})]})})},bI=()=>{const t=Vs();return O.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),_.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:_.jsxs("div",{className:"text-center",children:[_.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),_.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),_.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})},dme=[{id:"svc_2d3d",data:{icon:"Box",order:0,enabled:!0,title:{en:"2D/3D Design",tr:"2D/3D Tasarım",ar:"تصميم 2D/3D"},description:{en:"Comprehensive 2D drafting and 3D modeling services for all engineering disciplines.",tr:"Tüm mühendislik disiplinleri için kapsamlı 2D çizim ve 3D modelleme hizmetleri.",ar:"خدمات مسودات ثنائية الأبعاد ونمذجة ثلاثية الأبعاد شاملة لجميع التخصصات الهندسية."},features:["CAD Design","Technical Drawings","3D Visualization","Assembly Models"]}},{id:"svc_parametric",data:{icon:"Cog",order:1,enabled:!0,title:{en:"Parametric Design",tr:"Parametrik Tasarım",ar:"التصميم البارامتري"},description:{en:"Advanced parametric design that adapts to changing requirements automatically.",tr:"Değişen gereksinimlere otomatik uyum sağlayan gelişmiş parametrik tasarım.",ar:"تصميم بارامتري متقدم يتكيف تلقائياً مع المتطلبات المتغيرة."},features:["Automated Design","Parameter Control","Design Variants","Smart Constraints"]}},{id:"svc_fea",data:{icon:"Calculator",order:2,enabled:!0,title:{en:"FEA Analysis",tr:"FEA Analizi",ar:"تحليل FEA"},description:{en:"Finite Element Analysis for structural, thermal, and dynamic simulations.",tr:"Yapısal, termal ve dinamik simülasyonlar için sonlu elemanlar analizi.",ar:"تحليل العناصر المحدودة للمحاكاة الإنشائية والحرارية والديناميكية."},features:["Stress Analysis","Thermal Simulation","Modal Analysis","Fatigue Testing"]}},{id:"svc_library",data:{icon:"Library",order:3,enabled:!0,title:{en:"Library Creation",tr:"Kütüphane Oluşturma",ar:"إنشاء المكتبات"},description:{en:"Custom component libraries and standards for your organization.",tr:"Kuruluşunuz için özel bileşen kütüphaneleri ve standartlar.",ar:"مكتبات مكونات مخصصة ومعايير لمؤسستك."},features:["Standard Parts","Custom Libraries","Part Catalogs","Template Creation"]}},{id:"svc_transformer",data:{icon:"Zap",order:4,enabled:!0,title:{en:"Transformer Design",tr:"Transformatör Tasarımı",ar:"تصميم المحولات"},description:{en:"Specialized transformer design and electrical engineering solutions.",tr:"Özelleştirilmiş transformatör tasarımı ve elektrik mühendisliği çözümleri.",ar:"حلول تصميم محولات متخصصة وهندسة كهربائية."},features:["Electrical Design","Transformer Modeling","Power Systems","Circuit Analysis"]}},{id:"svc_concrete",data:{icon:"Building",order:5,enabled:!0,title:{en:"
8275Concrete Mold Design",tr:"Beton Kalıp Tasarımı",ar:"تصميم قوالب الخرسانة"},description:{en:"Concrete mold design and structural engineering expertise.",tr:"Beton kalıp tasarımı ve yapısal mühendislik uzmanlığı.",ar:"تصميم قوالب الخرسانة وخبرة في الهندسة الإنشائية."},features:["Mold Design","Structural Analysis","Material Selection","Production Planning"]}},{id:"svc_optimization",data:{icon:"Target",order:6,enabled:!0,title:{en:"Design Optimization",tr:"Tasarım Optimizasyonu",ar:"تحسين التصميم"},description:{en:"Design optimization for cost, weight, performance, and manufacturability.",tr:"Maliyet, ağırlık, performans ve üretilebilirlik için tasarım optimizasyonu.",ar:"تحسين التكلفة والوزن والأداء وقابلية التصنيع."},features:["Cost Reduction","Weight Optimization","Performance Tuning","Manufacturing"]}}];async function fme(t){const e=$Y(t);for(const{id:n,data:r}of dme)e.set(_n(t,"services",n),r);await e.commit()}const Q0=()=>({icon:"Box",order:0,title:{en:"",tr:"",ar:""},description:{en:"",tr:"",ar:""},features:"",enabled:!0}),hme=()=>{const[t,e]=O.useState([]),[n,r]=O.useState(!1),[i,s]=O.useState("add"),[o,a]=O.useState(Q0()),[l,c]=O.useState(null),[d,f]=O.useState(!1);O.useEffect(()=>{const S=Oi(Vn(Et,"services"),I=>{const M=I.docs.map(E=>({id:E.id,...E.data()})).sort((E,C)=>(E.order??999)-(C.order??999));e(M)});return()=>S()},[]);const u=()=>t.reduce((S,I)=>Math.max(S,I.order??0),-1)+1,h=()=>{s("add"),a({...Q0(),order:u()}),c(null),r(!0)},g=S=>{var I,M,E,C,T,A;s("edit"),c(S.id),a({icon:S.icon||"Box",order:S.order??0,title:{en:((I=S.title)==null?void 0:I.en)??"",tr:((M=S.title)==null?void 0:M.tr)??"",ar:((E=S.title)==null?void 0:E.ar)??""},description:{en:((C=S.description)==null?void 0:C.en)??"",tr:((T=S.description)==null?void 0:T.tr)??"",ar:((A=S.description)==null?void 0:A.ar)??""},features:(S.features??[]).join(", "),enabled:S.enabled!==!1}),r(!0)},v=()=>{r(!1),c(null),a(Q0())},m=(S,I,M)=>{["title","description"].includes(S)&&M?a(E=>({...E,[S]:{...E[S],[M]:I}})):a(E=>({...E,[S]:I}))},p=async()=>{if(!o.title.en&&!o.title.tr&&!o.title.ar){Rt({title:"Başlık gerekli",description:"En az bir dilde başlık girin.",variant:"destructive"});return}const S={icon:o.icon,order:Number(o.order)||0,title:o.title,description:o.description,features:o.features.split(",").map(I=>I.trim()).filter(Boolean),enabled:o.enabled};try{i==="add"?(await Fu(Vn(Et,"services"),S),xt("admin_service_save",{mode:"create",success:!0})):i==="edit"&&l&&(await Eo(_n(Et,"services",l),S),xt("admin_service_save",{mode:"edit",success:!0})),Rt({title:"Kaydedildi",description:"Hizmet güncellendi."}),v()}catch{xt("admin_service_save",{mode:i,success:!1}),Rt({title:"Hata",description:"Kayıt başarısız.",variant:"destructive"})}},y=async S=>{if(confirm("Bu hizmeti silmek istediğinize emin misiniz?"))try{await od(_n(Et,"services",S)),xt("admin_service_delete",{success:!0}),Rt({title:"Silindi"})}catch{xt("admin_service_delete",{success:!1}),Rt({title:"Hata",variant:"destructive"})}},w=async(S,I)=>{try{await Eo(_n(Et,"services",S),{enabled:!I}),xt("admin_service_toggle_enabled",{enabled:!I})}catch{Rt({title:"Hata",variant:"destructive"})}},x=async()=>{if(confirm("Varsayılan 7 hizmet Firestore'a yazılacak (aynı ID'ler varsa güncellenir). Devam edilsin mi?")){f(!0);try{await fme(Et),xt("admin_service_seed_defaults",{success:!0}),Rt({title:"Tamam",description:"Varsayılan hizmetler Firestore'a kaydedildi."})}catch{xt("admin_service_seed_defaults",{success:!1}),Rt({title:"Hata",description:"Tohum verisi yazılamadı. Firestore kurallarını kontrol edin.",variant:"destructive"})}finally{f(!1)}}};return _.jsxs("div",{className:"max-w-4xl mx-auto py-12 px-2",children:[_.jsxs("div",{className:"flex flex-col gap-2 mb-8",children:[_.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(jg,{className:"h-7 w-7 text-primary"}),_.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Service Management"})]}),_.jsxs("div",{className:"flex flex-wrap gap-2",children:[_.jsxs(rt,{type:"button",variant:"outline",onClick:x,disabled:d,children:[_.jsx(S8,{className:"mr-2 h-4 w-4"}),d?"Kaydediliyor…":"Varsayılanları Firestore’a yaz"]}),_.jsxs(rt,{type:"button",onClick:h,children:[_.jsx(lE,{className:"mr-2 h-4 w-4"}),"Add Service"]})]})]}),_.jsx("p",{className:"text-muted-foreground text-base",children:"Add, edit, enable/disable or remove your engineering services. Public site lists enabled items by order."})]}),n&&_.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:_.jsxs("div",{className:"bg-background dark:bg-[#18181b] rounded-lg shadow-lg p-6 w-full max-w-lg relative border border-border max-h-[90vh] overflow-y-auto",children:[_.jsx("button",{type:"button",className:"absolute top-3 right-3 text-muted-foreground hover:text-foreground",onClick:v,title:"Close",children:_.jsx(Gl,{className:"w-6 h-6"})}),_.jsx("h2",{className:"text-xl font-bold mb-4",children:i==="add"?"Add Service":"Edit Service"}),_.jsxs("div",{className:"flex flex-col gap-3",children:[_.jsxs("div",{children:[_.jsx($t,{htmlFor:"svc-icon",children:"Icon"}),_.jsx("select",{id:"svc-icon",className:"mt-1 w-full border border-border rounded px-3 py-2 min-w-0 bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40",value:o.icon,onChange:S=>m("icon",S.target.value),children:yle.map(S=>_.jsx("option",{value:S,children:S},S))})]}),_.jsxs("div",{children:[_.jsx($t,{htmlFor:"svc-order",children:"Order (sort)"}),_.jsx(sn,{id:"svc-order",type:"number",className:"mt-1",value:o.order,onChange:S=>a(I=>({...I,order:parseInt(S.target.value,10)||0}))})]}),_.jsx("input",{className:"border border-border rounded px-3 py-2 min-w-0 bg-background text-foreground",placeholder:"Service Title (English)",value:o.title.en,onChange:S=>m("title",S.target.value,"en")}),_.jsx("input",{className:"border border-border rounded px-3 py-2 min-w-0 bg-background text-foreground",placeholder:"Hizmet Başlığı (Türkçe)",value:o.title.tr,onChange:S=>m("title",S.target.value,"tr")}),_.jsx("input",{className:"border border-border rounded px-3 py-2 min-w-0 bg-background text-foreground",placeholder:"عنوان الخدمة (العربية)",value:o.title.ar,onChange:S=>m("title",S.target.value,"ar"),style:{direction:"rtl"}}),_.jsx("textarea",{className:"border border-border rounded px-3 py-2 min-w-0 resize-y bg-background text-foreground",placeholder:"Description (English)",value:o.description.en,onChange:S=>m("description",S.target.value,"en"),rows:2}),_.jsx("textarea",{className:"border border-border rounded px-3 py-2 min-w-0 resize-y bg-background text-foreground",placeholder:"Açıklama (Türkçe)",value:o.description.tr,onCh
8275ange:S=>m("description",S.target.value,"tr"),rows:2}),_.jsx("textarea",{className:"border border-border rounded px-3 py-2 min-w-0 resize-y bg-background text-foreground",placeholder:"الوصف (العربية)",value:o.description.ar,onChange:S=>m("description",S.target.value,"ar"),rows:2,style:{direction:"rtl"}}),_.jsxs("div",{children:[_.jsx($t,{htmlFor:"svc-features",children:"Features (comma separated)"}),_.jsx(sn,{id:"svc-features",className:"mt-1",placeholder:"Features (comma separated)",value:o.features,onChange:S=>m("features",S.target.value)})]}),_.jsxs("label",{className:"flex items-center gap-2 mt-2",children:[_.jsx("input",{type:"checkbox",checked:o.enabled,onChange:S=>m("enabled",S.target.checked)}),_.jsx("span",{children:"Enabled"})]}),_.jsxs("div",{className:"flex gap-2 mt-4",children:[_.jsxs(rt,{type:"button",onClick:p,className:"flex-1",variant:"default",children:[_.jsx(iy,{className:"mr-2 h-4 w-4"}),i==="add"?"Add":"Save"]}),_.jsx(rt,{type:"button",variant:"outline",onClick:v,className:"flex-1",children:"Cancel"})]})]})]})}),_.jsxs("ul",{className:"space-y-4",children:[t.length===0&&_.jsx("li",{className:"text-center text-muted-foreground py-8",children:`No services found. Use "Varsayılanları Firestore'a yaz" or Add Service.`}),t.map(S=>{var M,E,C,T,A,R;const I=US[S.icon]??jg;return _.jsxs("li",{className:"flex flex-col md:flex-row justify-between items-center bg-white dark:bg-card border border-muted rounded-lg p-5 shadow-sm gap-4 transition hover:shadow-md",children:[_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-center gap-2 mb-1 min-w-0",children:[_.jsx(I,{className:"h-5 w-5 text-primary shrink-0"}),_.jsx("span",{className:"font-semibold text-lg truncate max-w-[200px]",children:((M=S.title)==null?void 0:M.en)||((E=S.title)==null?void 0:E.tr)||((C=S.title)==null?void 0:C.ar)||"(no title)"}),_.jsxs("span",{className:"text-xs text-muted-foreground",children:["order: ",S.order??0]}),_.jsx("span",{className:`ml-2 text-xs px-2 py-1 rounded font-semibold shadow-sm border shrink-0 ${S.enabled!==!1?"bg-green-100 text-green-700 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-800":"bg-red-100 text-red-700 border-red-200 dark:bg-red-900/30 dark:text-red-300 dark:border-red-800"}`,children:S.enabled!==!1?"Enabled":"Disabled"})]}),_.jsx("div",{className:"text-muted-foreground mb-1 break-words text-sm",children:((T=S.description)==null?void 0:T.en)||((A=S.description)==null?void 0:A.tr)||((R=S.description)==null?void 0:R.ar)||""}),_.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:(S.features??[]).map((P,D)=>_.jsx("span",{className:"bg-primary/10 text-primary px-2 py-0.5 rounded-full text-xs font-medium break-words",children:P},D))})]}),_.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[_.jsx(rt,{size:"icon",variant:"outline",onClick:()=>g(S),title:"Edit",children:_.jsx(Uh,{className:"h-4 w-4"})}),_.jsx(rt,{size:"icon",variant:"destructive",onClick:()=>y(S.id),title:"Delete",children:_.jsx(ed,{className:"h-4 w-4"})}),_.jsx(rt,{size:"icon",variant:S.enabled!==!1?"secondary":"outline",onClick:()=>w(S.id,S.enabled!==!1),title:S.enabled!==!1?"Disable":"Enable",children:S.enabled!==!1?_.jsx(Lh,{className:"h-4 w-4 text-red-500"}):_.jsx(Fh,{className:"h-4 w-4 text-green-600"})})]})]},S.id)})]})]})},pme={maxWidth:1400,maxHeight:1400,maxBytes:700*1024,minQuality:.45};function mme(t){return new Promise((e,n)=>{const r=new Image;r.onload=()=>e(r),r.onerror=n,r.src=t})}function wI(t,e){return t.toDataURL("image/jpeg",e)}function gme(t,e,n,r){const i=Math.min(n/t,r/e,1);return{width:Math.max(1,Math.round(t*i)),height:Math.max(1,Math.round(e*i))}}async function i4(t,e={}){const n={...pme,...e},r=URL.createObjectURL(t);try{const i=await mme(r),{width:s,height:o}=gme(i.naturalWidth||i.width,i.naturalHeight||i.height,n.maxWidth,n.maxHeight),a=document.createElement("canvas");a.width=s,a.height=o;const l=a.getContext("2d");if(!l)throw new Error("Canvas context not available");l.drawImage(i,0,0,s,o);let c=.9,d=wI(a,c);for(;d.length>n.maxBytes&&c>n.minQuality;)c-=.1,d=wI(a,c);return d}finally{URL.revokeObjectURL(r)}}var zS="Dialog",[s4,o4]=qa(zS),[vme,os]=s4(zS),a4=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=O.useRef(null),l=O.useRef(null),[c=!1,d]=Zu({prop:r,defaultProp:i,onChange:s});return _.jsx(vme,{scope:e,triggerRef:a,contentRef:l,contentId:Al(),titleId:Al(),descriptionId:Al
vendor: 4,894 bytes, lines 8275-8279
8275(),open:c,onOpenChange:d,onOpenToggle:O.useCallback(()=>d(f=>!f),[d]),modal:o,children:n})};a4.displayName=zS;var l4="DialogTrigger",c4=O.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=os(l4,n),s=hn(e,i.triggerRef);return _.jsx(kt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":$S(i.open),...r,ref:s,onClick:tt(t.onClick,i.onOpenToggle)})});c4.displayName=l4;var HS="DialogPortal",[yme,u4]=s4(HS,{forceMount:void 0}),d4=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,s=os(HS,e);return _.jsx(yme,{scope:e,forceMount:n,children:O.Children.map(r,o=>_.jsx(is,{present:n||s.open,children:_.jsx(Yv,{asChild:!0,container:i,children:o})}))})};d4.displayName=HS;var Tv="DialogOverlay",f4=O.forwardRef((t,e)=>{const n=u4(Tv,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=os(Tv,t.__scopeDialog);return s.modal?_.jsx(is,{present:r||s.open,children:_.jsx(_me,{...i,ref:e})}):null});f4.displayName=Tv;var _me=O.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=os(Tv,n);return _.jsx(pS,{as:Ol,allowPinchZoom:!0,shards:[i.contentRef],children:_.jsx(kt.div,{"data-state":$S(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Vl="DialogContent",h4=O.forwardRef((t,e)=>{const n=u4(Vl,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=os(Vl,t.__scopeDialog);return _.jsx(is,{present:r||s.open,children:s.modal?_.jsx(xme,{...i,ref:e}):_.jsx(bme,{...i,ref:e})})});h4.displayName=Vl;var xme=O.forwardRef((t,e)=>{const n=os(Vl,t.__scopeDialog),r=O.useRef(null),i=hn(e,n.contentRef,r);return O.useEffect(()=>{const s=r.current;if(s)return rF(s)},[]),_.jsx(p4,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:tt(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:tt(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:tt(t.onFocusOutside,s=>s.preventDefault())})}),bme=O.forwardRef((t,e)=>{const n=os(Vl,t.__scopeDialog),r=O.useRef(!1),i=O.useRef(!1);return _.jsx(p4,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),p4=O.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=os(Vl,n),l=O.useRef(null),c=hn(e,l);return q3(),_.jsxs(_.Fragment,{children:[_.jsx(hS,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:_.jsx(Dh,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":$S(a.open),...o,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),_.jsxs(_.Fragment,{children:[_.jsx(Eme,{titleId:a.titleId}),_.jsx(Tme,{contentRef:l,descriptionId:a.descriptionId})]})]})}),GS="DialogTitle",m4=O.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=os(GS,n);return _.jsx(kt.h2,{id:i.titleId,...r,ref:e})});m4.displayName=GS;var g4="DialogDescription",v4=O.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=os(g4,n);return _.jsx(kt.p,{id:i.descriptionId,...r,ref:e})});v4.displayName=g4;var y4="DialogClose",_4=O.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=os(y4,n);return _.jsx(kt.button,{type:"button",...r,ref:e,onClick:tt(t.onClick,()=>i.onOpenChange(!1))})});_4.displayName=y4;function $S(t){return t?"open":"closed"}var x4="DialogTitleWarning",[wme,b4]=m6(x4,{contentName:Vl,titleName:GS,docsSlug:"dialog"}),Eme=({titleId:t})=>{const e=b4(x4),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
8276
8277If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
8278
8279For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return O.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Sme="DialogDescriptionWarning",Tme=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${b4(Sme).contentName}}.`;return O.useEffect(()=>{var s;const i=(s=t.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},Ame=a4,Mme=c4,Cme=d4,Rme=f4,Pme=h4,Ime=m4,Nme=v4,w4=_4,E4="AlertDialog",[Ome,Tge]=qa(E4,[o4]),Po=o4(),S4=t=>{const{__scopeAlertDialog:e,...n}=t,r=Po(e);return _.jsx(Ame,{...r,...n,modal:!0})};
8279S4.displayName=E4;var Dme="AlertDialogTrigger",kme=O.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Po(n);return _.jsx(Mme,{...i,...r,ref:e})});kme.displayName=Dme;var Lme="AlertDialogPortal",T4=t=>{const{__scopeAlertDialog:e,...n}=t,r=Po(e);return _.jsx(Cme,{...r,...n})};T4.displayName=Lme;var Fme="AlertDialogOverlay",A4=O.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Po(n);return _.jsx(Rme,{...i,...r,ref:e})});A4.displayName=Fme;var lu="AlertDialogContent",[Ume,jme]=Ome(lu),M4=O.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...i}=t,s=Po(n),o=O.useRef(null),a=hn(e,o),l=O.useRef(null);return _.jsx(wme,{contentName:lu,titleName:C4,docsSlug:"alert-dialog",children:_.jsx(Ume,{scope:n,cancelRef:l,children:_.jsxs(Pme,{role:"alertdialog",...s,...i,ref:a,onOpenAutoFocus:tt(i.onOpenAutoFocus,c=>{var d;c.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[_.jsx($w,{children:r}),_.jsx(Vme,{contentRef:o})]})})})});M4.displayName=lu;var C4="AlertDialogTitle",R4=O.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Po(n);return _.jsx(Ime,{...i,...r,ref:e})});R4.displayName=C4;var P4="AlertDialogDescription",I4=O.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Po(n);return _.jsx(Nme,{...i,...r,ref:e})});I4.displayName=P4;var Bme="AlertDialogAction",N4=O.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Po(n);return _.jsx(w4,{...i,...r,ref:e})});N4.displayName=Bme;var O4="AlertDialogCancel",D4=O.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:i}=jme(O4,n),s=Po(n),o=hn(e,i);return _.jsx(w4,{...s,...r,ref:o})});D4.displayName=O4;var Vme=({contentRef:t})=>{const e=`\`${lu}\` requires a description for the component to be accessible for screen reader users.
8280
8281You can add a description to the \`${lu}\` by passing a \`${P4}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
8282
8283Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${lu}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
8284
8285For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return O.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},zme=S4,Hme=T4,k4=A4,L4=M4,F4=N4,U4=D4,j4=R4,B4=I4;const V4=zme,Gme=Hme,z4=O.forwardRef(({className:t,...e},n)=>_.jsx(k4,{className:Mt("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));z4.displayName=k4.displayName;const WS=O.forwardRef(({className:t,...e},n)=>_.jsxs(Gme,{children:[_.jsx(z4,{}),_.jsx(L4,{ref:n,className:Mt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));WS.displayName=L4.displayName;const qS=({className:t,...e})=>_.jsx("div",{className:Mt("flex flex-col space-y-2 text-center sm:text-left",t),...e});qS.displayName="AlertDialogHeader";const KS=({className:t,...e})=>_.jsx("div",{className:Mt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});KS.displayName="AlertDialogFooter";const XS=O.forwardRef(({className:t,...e},n)=>_.jsx(j4,{ref:n,className:Mt("text-lg font-semibold",t),...e}));XS.displayName=j4.displayName;const YS=O.forwardRef(({className:t,...e},n)=>_.jsx(B4,{ref:n,className:Mt("text-sm text-muted-foreground",t),...e}));YS.displayName=B4.displayName;const H4=O.forwardRef(({className:t,...e},n)=>_.jsx(F4,{ref:n,className:Mt(dS(),t),...e}));H4.displayName=F4.displayName;const QS=O.forwardRef(({className:t,...e},n)=>_.jsx(U4,{ref:n,className:Mt(dS({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));QS.displayName=U4.displayName;const EI="https://placehold.net/800x600.png",$me=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?String(t.code):"";return e.includes("resource-exhausted")||e.includes("invalid-argument")?"Proje kaydedilemedi: görsel/veri boyutu çok büyük olabilir. Daha küçük bir görsel deneyin.":e.includes("permission-denied")?"Proje kaydedilemedi: Firestore yazma izni y
8285ok.":"Proje kaydedilemedi. Lütfen tekrar deneyin."},Mm={title:{en:"",tr:"",ar:""},description:{en:"",tr:"",ar:""},image:"",tags:[],status:"In Progress",enabled:!0},Wme=()=>{const[t,e]=O.useState([]),[n,r]=O.useState(!1),[i,s]=O.useState(Mm),[o,a]=O.useState(null),[l,c]=O.useState(!0),[d,f]=O.useState(""),[u,h]=O.useState(!1),[g,v]=O.useState(null),[m,p]=O.useState(!1);O.useEffect(()=>{const T=Oi(Vn(Et,"projects"),A=>{const R=A.docs.map(P=>({id:P.id,enabled:!0,...P.data()}));e(R),c(!1)});return()=>T()},[]);const y=(T,A)=>{const{name:R,value:P}=T.target;s((R==="title"||R==="description")&&A?{...i,[R]:{...i[R],[A]:P}}:{...i,[R]:P})},w=T=>{s({...i,tags:T.target.value.split(",").map(A=>A.trim())})},x=T=>{if(T.target.files&&T.target.files[0]){const A=T.target.files[0];(async()=>{try{const R=await i4(A);s(P=>({...P,image:R})),f(A.name),Rt({title:"Görsel hazır",description:"Görsel sıkıştırılarak eklendi."})}catch{Rt({title:"Hata",description:"Görsel işlenemedi. Lütfen farklı bir dosya deneyin.",variant:"destructive"})}})()}},S=async T=>{T.preventDefault(),h(!0);try{let A=i.image.trim();A||(A=EI);const R={...i,image:A,enabled:i.enabled!==void 0?i.enabled:!0};o?(await Eo(_n(Et,"projects",o),R),xt("admin_project_save",{mode:"edit",success:!0})):(await Fu(Vn(Et,"projects"),R),xt("admin_project_save",{mode:"create",success:!0})),Rt({title:"Başarılı",description:o?"Proje güncellendi.":"Proje eklendi."}),s(Mm),r(!1),a(null),f("")}catch(A){xt("admin_project_save",{mode:o?"edit":"create",success:!1}),Rt({title:"Hata",description:$me(A),variant:"destructive"})}finally{h(!1)}},I=async()=>{if(g){p(!0);try{await od(_n(Et,"projects",g.id)),xt("admin_project_delete",{success:!0}),v(null)}finally{p(!1)}}},M=T=>{s({title:T.title,description:T.description,image:T.image,tags:T.tags,status:T.status,enabled:T.enabled!==void 0?T.enabled:!0}),a(T.id),r(!0),f("")},E=async T=>{await Eo(_n(Et,"projects",T.id),{enabled:!T.enabled}),xt("admin_project_toggle_enabled",{enabled:!T.enabled})},C=()=>{r(!1),s(Mm),a(null),f("")};return _.jsxs("div",{className:"max-w-5xl mx-auto py-12 px-2",children:[_.jsxs("div",{className:"flex flex-col gap-2 mb-8",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(ah,{className:"h-7 w-7 text-primary"}),_.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Project Management"})]}),_.jsxs(rt,{onClick:()=>{r(!0),a(null),s(Mm),f("")},variant:"default",children:[_.jsx(lE,{className:"mr-2 h-4 w-4"}),"Add Project"]})]}),_.jsx("p",{className:"text-muted-foreground text-base",children:"Add, edit, enable/disable or remove your engineering projects."})]}),n&&_.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4 sm:p-6",children:_.jsxs("div",{className:"relative max-h-[min(90dvh,900px)] w-full max-w-lg overflow-y-auto overscroll-contain rounded-lg border border-border bg-background p-6 shadow-lg dark:bg-[#18181b]",children:[_.jsx("button",{type:"button",className:"absolute right-3 top-3 z-10 rounded-md bg-background/90 p-1 text-muted-foreground hover:text-foreground",onClick:C,title:"Close",children:_.jsx(Gl,{className:"h-6 w-6"})}),_.jsx("h2",{className:"pr-10 text-xl font-bold mb-4",children:o?"Edit Project":"Add Project"}),_.jsxs("form",{onSubmit:S,className:"flex flex-col gap-3 pb-1",children:[_.jsx("input",{name:"title",value:i.title.en,onChange:T=>y(T,"en"),className:"border border-border rounded px-3 py-2 min-w-0 bg-background text-foreground",placeholder:"Project Title (English)",required:!0}),_.jsx("input",{name:"title",value:i.title.tr,onChange:T=>y(T,"tr"),className:"border border-border rounded px-3 py-2 min-w-0 bg-background text-foreground",placeholder:"Proje Başlığı (Türkçe)"}),_.jsx("input",{name:"title",value:i.title.ar,onChange:T=>y(T,"ar"),className:"border border-border rounded px-3 py-2 min-w-0 bg-background text-foreground",placeholder:"عنوان المشروع (العربية)",style:{direction:"rtl"}}),_.jsx("textarea",{name:"description",value:i.description.en,onChange:T=>y(T,"en"),className:"border border-border rounded px-3 py-2 min-w-0 resize-y bg-background text-foreground",placeholder:"Description (English)",required:!0}),_.jsx("textarea",{name:"description",value:i.description.tr,onCh
8285ange:T=>y(T,"tr"),className:"border border-border rounded px-3 py-2 min-w-0 resize-y bg-background text-foreground",placeholder:"Açıklama (Türkçe)"}),_.jsx("textarea",{name:"description",value:i.description.ar,onChange:T=>y(T,"ar"),className:"border border-border rounded px-3 py-2 min-w-0 resize-y bg-background text-foreground",placeholder:"الوصف (العربية)",style:{direction:"rtl"}}),_.jsx("input",{name:"image",value:i.image,onChange:y,className:"border border-border rounded px-3 py-2 min-w-0 bg-background text-foreground",placeholder:"Image URL (optional)"}),_.jsxs("div",{children:[_.jsx("label",{className:"block mb-1 font-medium",children:"Or Upload Image"}),_.jsx("input",{type:"file",accept:"image/*",onChange:x,className:"w-full text-foreground dark:text-white file:bg-primary file:text-white file:rounded file:px-3 file:py-2 file:border-0"}),d&&_.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:d})]}),_.jsx("input",{name:"tags",value:i.tags.join(", "),onChange:w,className:"border border-border rounded px-3 py-2 min-w-0 bg-background text-foreground",placeholder:"Tags (comma separated)"}),_.jsxs("select",{name:"status",value:i.status,onChange:y,className:"border border-border rounded px-3 py-2 min-w-0 bg-background text-foreground",children:[_.jsx("option",{value:"In Progress",children:"In Progress"}),_.jsx("option",{value:"Completed",children:"Completed"})]}),_.jsxs("label",{className:"flex items-center gap-2 mt-2",children:[_.jsx("input",{type:"checkbox",name:"enabled",checked:i.enabled,onChange:T=>s({...i,enabled:T.target.checked})}),_.jsx("span",{children:"Enabled"})]}),_.jsxs("div",{className:"flex gap-2 mt-4",children:[_.jsxs(rt,{type:"submit",className:"flex-1",variant:"default",disabled:u,children:[_.jsx(iy,{className:"mr-2 h-4 w-4"}),u?"Uploading...":o?"Update Project":"Add Project"]}),_.jsx(rt,{type:"button",variant:"outline",onClick:C,className:"flex-1",children:"Cancel"})]})]})]})}),l?_.jsx("div",{children:"Loading..."}):t.length===0?_.jsx("div",{className:"text-center text-muted-foreground py-16 text-lg font-medium",children:"No projects found. Add your first project!"}):_.jsx("div",{className:"grid md:grid-cols-2 gap-6",children:t.map(T=>_.jsxs(on,{className:`relative ${T.enabled===!1?"opacity-50":""} border border-muted bg-white dark:bg-card rounded-lg shadow-sm transition hover:shadow-md`,children:[_.jsx("div",{className:"aspect-video bg-secondary/10 overflow-hidden rounded-t-lg",children:_.jsx("img",{src:T.image||EI,alt:T.title.en||T.title.tr||T.title.ar,className:"w-full h-full object-cover"})}),_.jsxs(an,{className:"p-4",children:[_.jsxs("div",{className:"flex items-center justify-between mb-2",children:[_.jsx(Dr,{variant:T.status==="Completed"?"default":"secondary",className:"text-xs",children:T.status}),_.jsxs("div",{className:"flex gap-2",children:[_.jsx(rt,{size:"icon",variant:T.enabled?"secondary":"outline",onClick:()=>E(T),title:T.enabled?"Disable":"Enable",children:T.enabled?_.jsx(Lh,{className:"h-4 w-4 text-red-500"}):_.jsx(Fh,{className:"h-4 w-4 text-green-600"})}),_.jsx(rt,{size:"icon",variant:"outline",onClick:()=>M(T),title:"Edit",children:_.jsx(Uh,{className:"h-4 w-4"})}),_.jsx(rt,{size:"icon",variant:"destructive",type:"button",onClick:()=>v(T),title:"Delete",children:_.jsx(ed,{className:"h-4 w-4"})})]})]}),_.jsx("h3",{className:"text-lg font-semibold mb-1",children:T.title.en||T.title.tr||T.title.ar}),_.jsx("p",{className:"text-muted-foreground text-sm mb-2",children:T.description.en||T.description.tr||T.description.ar}),_.jsx("div",{className:"flex flex-wrap gap-2",children:T.tags.map((A,R)=>_.jsx(Dr,{variant:"outline",className:"text-xs",children:A},R))})]})]},T.id))}),_.jsx(V4,{open:g!==null,onOpenChange:T=>{T||(v(null),p(!1))},children:_.jsxs(WS,{children:[_.jsxs(qS,{children:[_.jsx(XS,{children:"Delete this project?"}),_.jsxs(YS,{children:["This cannot be undone. The project"," ",_.jsxs("span",{className:"font-semibold text-foreground",children:['"',(g==null?void 0:g.title.en)||(g==null?void 0:g.title.tr)||(g==null?void 0:g.title.ar)||"Untitled",'"']})," ","will be permanently removed from Firestore."]})]}),_.jsxs(KS,{children:[_.jsx(QS,{disabled:m,children:"Cancel"}),_.jsx(rt,{type:"button",variant:"destructive",disabled:m,onClick:()=>void I(),children:m?"Deleting…":"Delete"})]})]})})]})},qme="https://placehold.net/800x600.png",Z0={title:{en:"",tr:"",ar:""},content:{en:"",tr:"",ar:""},tags:[],status:"Draft",enabled:!0,createdAt:null,updatedAt:null,featuredImage:"",videoUrl:""},J0={toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],["blockquote","code-block"],["link","image","video"],["clean"]]},ex=["header","bold","italic","underline","strike","list","bullet","blockquote","code-block","link","image","video"],S
8285I=t=>t.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim(),Kme=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?String(t.code):"";return e.includes("resource-exhausted")||e.includes("invalid-argument")?"Blog kaydedilemedi: görsel/veri boyutu çok büyük olabilir. Daha küçük bir görsel deneyin.":e.includes("permission-denied")?"Blog kaydedilemedi: Firestore yazma izni yok.":"Blog kaydedilemedi. Lütfen tekrar deneyin."},tx=()=>{const t=Oh(),e=Vs(),{id:n}=Vw(),r=e.pathname.endsWith("/new"),i=!!n,s=r||i,[o,a]=O.useState([]),[l,c]=O.useState(Z0),[d,f]=O.useState(!0),[u,h]=O.useState(!1),[g,v]=O.useState(""),[m,p]=O.useState(null),[y,w]=O.useState(!1);O.useEffect(()=>{const T=Oi(Vn(Et,"blogs"),A=>{const R=A.docs.map(P=>({id:P.id,enabled:!0,...P.data()}));a(R),f(!1)});return()=>T()},[]),O.useEffect(()=>{if(!s){c(Z0),v("");return}if(r){c(Z0),v("");return}const T=o.find(A=>A.id===n);T&&c({title:T.title||{en:"",tr:"",ar:""},content:T.content||{en:"",tr:"",ar:""},tags:T.tags||[],status:T.status||"Draft",enabled:T.enabled!==!1,createdAt:T.createdAt||null,updatedAt:T.updatedAt||null,featuredImage:T.featuredImage||"",videoUrl:T.videoUrl||""})},[s,r,n,o]);const x=O.useMemo(()=>[...o].sort((T,A)=>{var D,F;const R=(D=T.createdAt)!=null&&D.seconds?T.createdAt.seconds*1e3:new Date(T.createdAt||0).getTime();return((F=A.createdAt)!=null&&F.seconds?A.createdAt.seconds*1e3:new Date(A.createdAt||0).getTime())-R}),[o]),S=(T,A)=>{c(R=>({...R,title:{...R.title,[T]:A}}))},I=(T,A)=>{c(R=>({...R,content:{...R.content,[T]:A}}))},M=async()=>{if(m){w(!0);try{await od(_n(Et,"blogs",m.id)),xt("admin_blog_delete",{success:!0}),p(null)}finally{w(!1)}}},E=async T=>{await Eo(_n(Et,"blogs",T.id),{enabled:!T.enabled}),xt("admin_blog_toggle_enabled",{enabled:!T.enabled})},C=async T=>{if(T.preventDefault(),!l.title.en.trim()||!SI(l.content.en||"").trim()){Rt({title:"Eksik alan",description:"İngilizce başlık ve içerik zorunludur.",variant:"destructive"});return}h(!0);try{const A={...l,featuredImage:(l.featuredImage||"").trim()||qme,tags:l.tags.filter(Boolean),updatedAt:new Date,createdAt:l.createdAt||new Date,enabled:l.enabled!==!1};i&&n?(await Eo(_n(Et,"blogs",n),A),xt("admin_blog_save",{mode:"edit",success:!0,status:A.status})):(await Fu(Vn(Et,"blogs"),A),xt("admin_blog_save",{mode:"create",success:!0,status:A.status})),Rt({title:"Başarılı",description:i?"Blog güncellendi.":"Blog kaydedildi."}),t("/admin/blog")}catch(A){xt("admin_blog_save",{mode:i?"edit":"create",success:!1}),Rt({title:"Hata",description:Kme(A),variant:"destructive"})}finally{h(!1)}};return s?_.jsxs("div",{className:"max-w-5xl mx-auto py-10 px-2",children:[_.jsxs("div",{className:"flex items-center justify-between mb-6",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(oh,{className:"h-7 w-7 text-primary"}),_.jsx("h1",{className:"text-2xl font-bold text-foreground",children:i?"Edit Blog Post":"Create Blog Post"})]}),_.jsxs(rt,{variant:"outline",onClick:()=>t("/admin/blog"),children:[_.jsx(v8,{className:"mr-2 h-4 w-4"}),"Back to list"]})]}),_.jsxs("form",{onSubmit:C,className:"grid lg:grid-cols-3 gap-6",children:[_.jsx(on,{className:"lg:col-span-2 border border-muted bg-white dark:bg-card",children:_.jsxs(an,{className:"p-5 space-y-5",children:[_.jsxs("div",{className:"space-y-3",children:[_.jsx($t,{children:"Title (English)"}),_.jsx(sn,{value:l.title.en,onChange:T=>S("en",T.target.value),required:!0}),_.jsx($t,{children:"Başlık (Türkçe)"}),_.jsx(sn,{value:l.title.tr,onChange:T=>S("tr",T.target.value)}),_.jsx($t,{children:"العنوان (العربية)"}),_.jsx(sn,{value:l.title.ar,onChange:T=>S("ar",T.target.value),dir:"rtl"})]}),_.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{children:[_.jsx($t,{children:"Content (English)"}),_.jsx(ag,{theme:"snow",value:l.content.en,onChange:T=>I("en",T),modules:J0,formats:ex})]}),_.jsxs("div",{children:[_.jsx($t,{children:"İçerik (Türkçe)"}),_.jsx(ag,{theme:"snow",value:l.content.tr,onChange:T=>I("tr",T),modules:J0,formats:ex})]}),_.jsxs("div",{children:[_.jsx($t,{children:"المحتوى (العربية)"}),_.jsx("div",{dir:"rtl",children:_.jsx(ag,{theme:"snow",value:l.content.ar,onChange:T=>I("ar",T),modules:J0,formats:ex})})]})]})]})}),_.jsx(on,{className:"border border-muted bg-white dark:bg-card h-fit",children:_.jsxs(an,{className:"p-5 space-y-5",children:[_.jsxs("div",{className:"space-y-2",children:[_.jsx($t,{children:"Status"}),_.jsxs("select",{value:l.status,onChange:T=>
8285c(A=>({...A,status:T.target.value})),className:"w-full border border-border rounded px-3 py-2 bg-background text-foreground",children:[_.jsx("option",{value:"Draft",children:"Draft"}),_.jsx("option",{value:"Published",children:"Published"})]})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx($t,{children:"Tags"}),_.jsx(sn,{value:l.tags.join(", "),onChange:T=>c(A=>({...A,tags:T.target.value.split(",").map(R=>R.trim()).filter(Boolean)})),placeholder:"engineering, cad, tutorial"})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsxs($t,{className:"flex items-center gap-2",children:[_.jsx(ah,{className:"h-4 w-4"}),"Featured image URL"]}),_.jsx(sn,{value:l.featuredImage||"",onChange:T=>c(A=>({...A,featuredImage:T.target.value})),placeholder:"https://..."}),_.jsx($t,{children:"or upload cover image"}),_.jsx(sn,{type:"file",accept:"image/*",onChange:T=>{var R;const A=(R=T.target.files)==null?void 0:R[0];A&&(async()=>{try{const P=await i4(A);c(D=>({...D,featuredImage:P})),v(A.name),Rt({title:"Görsel hazır",description:"Kapak görseli sıkıştırılarak eklendi."})}catch{Rt({title:"Hata",description:"Görsel işlenemedi. Lütfen farklı bir dosya deneyin.",variant:"destructive"})}})()}}),g?_.jsx("p",{className:"text-xs text-muted-foreground",children:g}):null]}),_.jsxs("div",{className:"space-y-2",children:[_.jsxs($t,{className:"flex items-center gap-2",children:[_.jsx(L8,{className:"h-4 w-4"}),"Video URL (optional)"]}),_.jsx(sn,{value:l.videoUrl||"",onChange:T=>c(A=>({...A,videoUrl:T.target.value})),placeholder:"https://youtube.com/watch?v=..."})]}),_.jsxs("label",{className:"flex items-center gap-2",children:[_.jsx("input",{type:"checkbox",checked:l.enabled!==!1,onChange:T=>c(A=>({...A,enabled:T.target.checked}))}),_.jsx("span",{children:"Enabled"})]}),_.jsxs(rt,{type:"submit",className:"w-full",disabled:u,children:[_.jsx(iy,{className:"mr-2 h-4 w-4"}),u?"Saving...":i?"Update Post":"Publish / Save"]})]})})]})]}):_.jsxs("div",{className:"max-w-5xl mx-auto py-12 px-2",children:[_.jsxs("div",{className:"flex flex-col gap-2 mb-8",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(oh,{className:"h-7 w-7 text-primary"}),_.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Blog Management"})]}),_.jsxs(rt,{onClick:()=>t("/admin/blog/new"),variant:"default",children:[_.jsx(lE,{className:"mr-2 h-4 w-4"}),"Add Blog"]})]}),_.jsx("p",{className:"text-muted-foreground text-base",children:"Add, edit, enable/disable or remove your blog posts."})]}),d?_.jsx("div",{children:"Loading..."}):x.length===0?_.jsx("div",{className:"text-center text-muted-foreground py-16 text-lg font-medium",children:"No blog posts found. Add your first blog!"}):_.jsx("div",{className:"grid md:grid-cols-2 gap-6",children:x.map(T=>_.jsxs(on,{className:`relative ${T.enabled===!1?"opacity-50":""} border border-muted bg-white dark:bg-card rounded-lg shadow-sm transition hover:shadow-md`,children:[T.featuredImage?_.jsx("div",{className:"aspect-video overflow-hidden rounded-t-lg bg-secondary/10",children:_.jsx("img",{src:T.featuredImage,alt:T.title.en||"Blog cover",className:"w-full h-full object-cover"})}):null,_.jsxs(an,{className:"p-4",children:[_.jsxs("div",{className:"flex items-center justify-between mb-2",children:[_.jsx(Dr,{variant:T.status==="Published"?"default":"secondary",className:"text-xs",children:T.status}),_.jsxs("div",{className:"flex gap-2",children:[_.jsx(rt,{size:"icon",variant:T.enabled?"secondary":"outline",onClick:()=>E(T),title:T.enabled?"Disable":"Enable",children:T.enabled?_.jsx(Lh,{className:"h-4 w-4 text-red-500"}):_.jsx(Fh,{className:"h-4 w-4 text-green-600"})}),_.jsx(rt,{size:"icon",variant:"outline",onClick:()=>t(`/admin/blog/${T.id}/edit`),title:"Edit",children:_.jsx(Uh,{className:"h-4 w-4"})}),_.jsx(rt,{size:"icon",variant:"destructive",onClick:()=>p(T),title:"Delete",children:_.jsx(ed,{className:"h-4 w-4"})})]})]}),_.jsx("h3",{className:"text-lg font-semibold mb-1",children:T.title.en||T.title.tr||T.title.ar}),_.jsx("p",{className:"text-muted-foreground text-sm mb-2 line-clamp-3",children:SI(T.content.en||T.content.tr||T.content.ar)}),_.jsx("div",{className:"flex flex-wrap gap-2",children:(T.tags||[]).map((A,R)=>_.jsx(Dr,{variant:"outline",className:"text-xs",children:A},R))})]})]},T.id))}),_.jsx(V4,{open:m!==null,onOpenChange:T=>{T||(p(null),w(!1))},children:_.jsxs(WS,{children:[_.jsxs(qS,{children:[_.jsx(XS,{children:"Delete this blog post?"}),_.jsxs(YS,{children:["This action cannot be undone. The blog post"," ",_.jsxs("span",{className:"font-semibold text-foreground",children:['"',(m==null?void 0:m.title.en)||(m==null?void 0:m.title.tr)||(m==null?void 0:m.title.ar)||"Untitled",'"']})," ","will be permanently removed."]})]}),_.jsxs(KS,{children:[_.jsx(QS,{disabled:y,children:"Cancel"}),_.jsx(H4,{asChild:!0,children:_.jsx(rt,{type:"button",variant:"destructive",disabled:y,onClick:()=>void M(),children:y?"Deleting...":"Delete"})})]})]})})]})},Xme=()=>{const[t,e]=O.useState([]),[n,r]=O.useState(!0),[i,s]=O.useState(null);O.useEffect(()=>{const l=Oi(Vn(Et,"contacts"),c=>{const d=c.docs.map(f=>({id:f.id,...f.data()}));e(d),r(!1)});return()=>l()},[]);const o=async l=>{await od(_n(Et,"contacts",l))},a=async l=>{await Eo(_n(Et,"contacts",l.id),{responded:!l.responded})};return _.jsxs("div",{className:"max-w-5xl mx-auto py-12 px-2",children:[_.jsxs("div",{className:"flex flex-col gap-2 mb-8",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(Mu,{className:"h-7 w-7 text-primary"}),_.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Contact Requests"})]}),_.jsx("p",{className:"text-muted-foreground text-base",children:"View, archive, or delete customer inquiries and quote requests."})]}),n?_.jsx("div",{children:"Loading..."}):t.length===0?_.jsx("div",{className:"text-center text-muted-foreground py-16 text-lg font-medium",children:"No contact requests found."}):_.jsx("div",{className:"grid md:grid-cols-2 gap-6",children:t.map(l=>_.jsxs(on,{className:"relative border border-muted bg-white dark:bg-card rounded-lg shadow-sm transition hover:shadow-md",children:[_.jsxs(an,{className:"p-4",children:[_.jsxs("div",{className:"flex items-center justify-between mb-2",children:[_.jsx(Dr,{variant:l.status==="New"?"default":l.status==="Read"?"secondary":"outline",className:"text-xs",children:l.status}),_.jsxs("div",{className:"flex gap-2",children:[_.jsx(rt,{size:"icon",variant:l.responded?"secondary":"outline",onClick:()=>a(l),title:l.responded?"Mark as Not Responded":"Mark as Responded",children:l.responded?_.
8285jsx(Fh,{className:"h-4 w-4 text-green-600"}):_.jsx(Lh,{className:"h-4 w-4 text-red-500"})}),_.jsx(rt,{size:"icon",variant:"outline",onClick:()=>s(l.id),title:"View Message",children:_.jsx(Uh,{className:"h-4 w-4"})}),_.jsx(rt,{size:"icon",variant:"destructive",onClick:()=>o(l.id),title:"Delete",children:_.jsx(ed,{className:"h-4 w-4"})})]})]}),_.jsx("h3",{className:"text-lg font-semibold mb-1",children:l.name}),_.jsx("p",{className:"text-muted-foreground text-sm mb-1",children:l.email}),_.jsx("p",{className:"text-muted-foreground text-sm line-clamp-2",children:l.message}),_.jsx("div",{className:"text-xs text-muted-foreground mt-2",children:l.createdAt&&new Date(l.createdAt.seconds?l.createdAt.seconds*1e3:l.createdAt).toLocaleDateString()})]}),i===l.id&&_.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:_.jsxs("div",{className:"bg-background dark:bg-[#18181b] rounded-lg shadow-lg p-6 w-full max-w-md relative border border-border",children:[_.jsx("button",{className:"absolute top-3 right-3 text-muted-foreground hover:text-foreground",onClick:()=>s(null),title:"Close",children:_.jsx(Gl,{className:"w-6 h-6"})}),_.jsxs("h2",{className:"text-xl font-bold mb-4",children:["Message from ",l.name]}),_.jsxs("p",{className:"mb-2 text-muted-foreground text-sm",children:[_.jsx("b",{children:"Email:"})," ",l.email]}),_.jsx("div",{className:"mb-4 text-foreground whitespace-pre-line",children:l.message}),_.jsx(rt,{variant:"outline",onClick:()=>s(null),className:"w-full",children:"Close"})]})})]},l.id))})]})},Yme=()=>{const[t,e]=O.useState([]),[n,r]=O.useState(!0);O.useEffect(()=>{const a=Oi(Vn(Et,"emailSubscriptions"),l=>{const c=l.docs.map(d=>({id:d.id,...d.data()}));e(c),r(!1)});return()=>a()},[]);const i=O.useMemo(()=>[...t].sort((a,l)=>{var f,u;const c=(f=a.createdAt)!=null&&f.seconds?a.createdAt.seconds*1e3:Number(a.createdAt??0);return((u=l.createdAt)!=null&&u.seconds?l.createdAt.seconds*1e3:Number(l.createdAt??0))-c}),[t]),s=async a=>{await od(_n(Et,"emailSubscriptions",a)),xt("admin_email_subscription_delete")},o=()=>{if(!i.length){Rt({title:"Bilgi",description:"Export edilecek email bulunamadi."});return}xt("admin_email_subscriptions_export_csv",{count:i.length});const a=g=>`"${g.replace(/"/g,'""')}"`,l=["email","createdAt"],c=i.map(g=>{var m;const v=(m=g.createdAt)!=null&&m.seconds?new Date(g.createdAt.seconds*1e3).toISOString():g.createdAt?new Date(g.createdAt).toISOString():"";return[a(g.email||""),a(v)]}),d=[l.join(","),...c.map(g=>g.join(","))].join(`
8286`),f=new Blob([d],{type:"text/csv;charset=utf-8;"}),u=URL.createObjectURL(f),h=document.createElement("a");h.href=u,h.setAttribute("download",`email-subscriptions-${new Date().toISOString().slice(0,10)}.csv`),document.body.appendChild(h),h.click(),h.remove(),URL.revokeObjectURL(u)};return _.jsxs("div",{className:"max-w-4xl mx-auto py-12 px-2",children:[_.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 mb-8",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(ry,{className:"h-7 w-7 text-primary"}),_.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Email Subscriptions"}),_.jsx(Dr,{variant:"secondary",children:t.length})]}),_.jsxs(rt,{type:"button",variant:"outline",onClick:o,className:"w-full sm:w-auto",children:[_.jsx(T8,{className:"h-4 w-4 mr-2"}),"Export CSV"]})]}),n?_.jsx("div",{children:"Loading..."}):i.length===0?_.jsx("div",{className:"text-center text-muted-foreground py-16 text-lg font-medium",children:"No email subscriptions found."}):_.jsx("div",{className:"space-y-3",children:i.map(a=>_.jsx(on,{className:"border border-muted bg-white dark:bg-card rounded-lg shadow-sm",children:_.jsxs(an,{className:"p-4 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[_.jsxs("div",{children:[_.jsx("p",{className:"text-sm font-medium text-foreground break-all",children:a.email}),_.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a.createdAt?new Date(a.createdAt.seconds?a.createdAt.seconds*1e3:a.createdAt).toLocaleStr
8286ing():"-"})]}),_.jsxs(rt,{size:"sm",variant:"destructive",onClick:()=>void s(a.id),children:[_.jsx(ed,{className:"h-4 w-4 mr-2"}),"Unsubscribe"]})]})},a.id))})]})},Qme=()=>{const[t,e]=O.useState([]),[n,r]=O.useState(!0),[i,s]=O.useState(null),[o,a]=O.useState({name:"",email:"",role:"user",enabled:!0,createdAt:null}),[l,c]=O.useState(!1),[d,f]=O.useState(!1);O.useEffect(()=>{const p=Oi(Vn(Et,"users"),y=>{const w=y.docs.map(x=>({id:x.id,...x.data()}));e(w),r(!1)});return()=>p()},[]);const u=async p=>{await od(_n(Et,"users",p))},h=async p=>{await Eo(_n(Et,"users",p.id),{enabled:!p.enabled})},g=p=>{a({name:p.name,email:p.email,role:p.role,enabled:p.enabled!==void 0?p.enabled:!0,createdAt:p.createdAt||null}),s(p.id),c(!0)},v=async p=>{p.preventDefault(),f(!0);const y={...o,enabled:o.enabled!==void 0?o.enabled:!0,createdAt:o.createdAt||new Date};i?await Eo(_n(Et,"users",i),y):await Fu(Vn(Et,"users"),y),a({name:"",email:"",role:"user",enabled:!0,createdAt:null}),c(!1),s(null),f(!1)},m=()=>{c(!1),a({name:"",email:"",role:"user",enabled:!0,createdAt:null}),s(null)};return _.jsxs("div",{className:"max-w-5xl mx-auto py-12 px-2",children:[_.jsxs("div",{className:"flex flex-col gap-2 mb-8",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(Mu,{className:"h-7 w-7 text-primary"}),_.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Users Management"})]}),_.jsx(rt,{onClick:()=>{c(!0),s(null),a({name:"",email:"",role:"user",enabled:!0,createdAt:null})},variant:"default",children:"Add User"})]}),_.jsx("p",{className:"text-muted-foreground text-base",children:"Add, edit, enable/disable or remove users."})]}),l&&_.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:_.jsxs("div",{className:"bg-background dark:bg-[#18181b] rounded-lg shadow-lg p-6 w-full max-w-lg relative border border-border",children:[_.jsx("button",{className:"absolute top-3 right-3 text-muted-foreground hover:text-foreground",onClick:m,title:"Close",children:_.jsx(Gl,{className:"w-6 h-6"})}),_.jsx("h2",{className:"text-xl font-bold mb-4",children:i?"Edit User":"Add User"}),_.jsxs("form",{onSubmit:v,className:"flex flex-col gap-3",children:[_.jsx("input",{name:"name",value:o.name,onChange:p=>a({...o,name:p.target.value}),className:"border border-border rounded px-3 py-2 min-w-0 bg-background text-foreground",placeholder:"Full Name",required:!0}),_.jsx("input",{name:"email",value:o.email,onChange:p=>a({...o,email:p.target.value}),className:"border border-border rounded px-3 py-2 min-w-0 bg-background text-foreground",placeholder:"Email",required:!0}),_.jsxs("select",{name:"role",value:o.role,onChange:p=>a({...o,role:p.target.value}),className:"border border-border rounded px-3 py-2 min-w-0 bg-background text-foreground",children:[_.jsx("option",{value:"user",children:"User"}),_.jsx("option",{value:"admin",children:"Admin"})]}),_.jsxs("label",{className:"flex items-center gap-2 mt-2",children:[_.jsx("input",{type:"checkbox",name:"enabled",checked:o.enabled,onChange:p=>a({...o,enabled:p.target.checked})}),_.jsx("span",{children:"Enabled"})]}),_.jsxs("div",{className:"flex gap-2 mt-4",children:[_.jsx(rt,{type:"submit",className:"flex-1",variant:"default",disabled:d,children:d?"Saving...":i?"Update User":"Add User"}),_.jsx(rt,{type:"button",variant:"outline",onClick:m,className:"flex-1",children:"Cancel"})]})]})]})}),n?_.jsx("div",{children:"Loading..."}):t.length===0?_.jsx("div",{className:"text-center text-muted-foreground py-16 text-lg font-medium",children:"No users found."}):_.jsx("div",{className:"grid md:grid-cols-2 gap-6",children:t.map(p=>_.jsx(on,{className:`relative border border-muted bg-white dark:bg-card rounded-lg shadow-sm transition hover:shadow-md ${p.enabled===!1?"opacity-50":""}`,children:_.jsxs(an,{className:"p-4",children:[_.jsxs("div",{className:"flex items-center justify-between mb-2",children:[_.jsx(Dr,{variant:p.role==="admin"?"default":"secondary",className:"text-xs",children:p.role.charAt(0).toUpperCase()+p.role.slice(1)}),_.jsxs("div",{className:"flex gap-2",children:[_.jsx(rt,{size:"icon",variant:p.enabled?"secondary":"outline",onClick:()=>h(p),title:p.enabled?"Disable":"Enable",children:p.enabled?_.jsx(Lh,{className:"h-4 w-4 text-red-500"}):_.jsx(Fh,{className:"h-4 w-4 text-green-600"})}),_.jsx(rt,{size:"icon",variant:"outline",onClick:()=>g(p),title:"Edit",children:_.jsx(Uh,{className:"h-4 w-4"})}),_.jsx(rt,{size:"icon",variant:"destructive",onClick:()=>u(p.id),title:"Delete",children:_.jsx(ed,{className:"h-4 w-4"})})]})]}),_.jsx("h3",{className:"text-lg font-semibold mb-1",children:p.name}),_.jsx("p",{className:"text-muted-foreground text-sm mb-1",children:p.email}),_.jsx("div",{className:"text-xs text-muted-foreground mt-2",children:p.createdAt&&new Date(p.createdAt.seconds?p.createdAt.seconds*1e3:p.createdAt).toLocaleDateString()})]})},p.id))})]})};var ZS="Tabs",[Zme,Age]=qa(ZS,[Fy]),G4=Fy(),[Jme,JS]=Zme(ZS),$4=O.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:l="automatic",...c}=t,d=fS(a),[f,u]=Zu({prop:r,onChange:i,defaultProp:s});return _.jsx(Jme,{scope:n,baseId:Al(),value:f,onValueChange:u,orientation:o,dir:d,activationMode:l,children:_.jsx(kt.div,{dir:d,"data-orientation":o,...c,ref:e})})});$4.displayName=ZS;var W4="TabsList",q4=O.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...i}=t,s=JS(W4,n),o=G4(n);return _.jsx(eF,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:r,children:_.jsx(kt.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:e})})});q4.displayName=W4;var K4="TabsTrigger",X4=O.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...s}=t,o=JS(K4,n),a=G4(n),l=Z4(o.baseId,r),c=J4(o.baseId,r),d=r===o.value;return _.jsx(tF,{asChild:!0,...a,focusable:!i,active:d,children:_.jsx(kt.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...s,ref:e,onMouseDown:tt(t.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?o.onValueChange(r):f.preventDefault()}),onKeyDown:tt(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(r)}),onFocus:tt(t.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!i&&f&&o.onValueChange(r)})})})});X4.displayName=K4;var Y4="TabsContent",Q4=O.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:i,children:s,...o}=t,a=JS(Y4,n),l=Z4(a.baseId,r),c=J4(a.baseId,r),d=r===a.value,f=O.useRef(d);return O.useEffect(()=>{const u=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(u)},[]),_.jsx(is,{present:i||d,children:({present:u})=>_.jsx(kt.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!u,id:c,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0},children:u&&s})})});Q4.displayName=Y4;function Z4(t,e){return`${t}-trigger-${e}`}function J4(t,e){return`${t}-content-${e}`}var ege=$4,ej=q4,tj=X4,nj=Q4;const tge=ege,rj=O.forwardRef(({className:t,...e},n)=>_.jsx(ej,{ref:n,className:Mt("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...e}));rj.displayName=ej.displayName;const ff=O.forwardRef(({className:t,...e},n)=>_.jsx(tj,{ref:n,className:Mt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...e}));ff.displayName=tj.displayName;const hf=O.forwardRef(({className:t,...e},n)=>_.jsx(nj,{ref:n,className:Mt("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));hf.displayName=nj.displayName;function nge(t){const e=O.useRef({value:t,previous:t});return O.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var eT="Switch",[rge,Mge]=qa(eT),[ige,sge]=rge(eT),ij=O.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:s,required:o,disabled:a,value:l="on",onCheckedChange:c,form:d,...f}=t,[u,h]=O.useState(null),g=hn(e,w=>h(w)),v=O.useRef(!1),m=u?d||!!u.closest("form"):!0,[p=!1,y]=Zu({prop:i,defaultProp:s,onChange:c});return _.jsxs(ige,{scope:n,checked:p,disabled:a,children:[_.jsx(kt.button,{type:"button",role:"switch","aria-checked":p,"aria-required":o,"data-state":aj(p),"data-disabled":a?"":void 0,disabled:a,value:l,...f,ref:g,onClick:tt(t.onClick,w=>{y(x=>!x),m&&(v.current=w.isPropagationStopped(),v.current||w.stopPropagation())})}),m&&_.jsx(oge,{control:u,bubbles:!v.current,name:r,value:l,checked:p,required:o,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});ij.displayName=eT;var sj="SwitchThumb",oj=O.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=sge(sj,n);return _.jsx(kt.span,{"data-state":aj(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:e})});oj.displayName=sj;var oge=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,s=O.useRef(null),o=nge(n),a=wO(e);return O.useEffect(()=>{const l=s.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(o!==n&&f){const u=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(u)}},[o,n,r]),_.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function aj(t){return t?"checked":"unchecked"}var lj=ij,age=oj;const cj=O.forwardRef(({className:t,...e},n)=>_.jsx(lj,{dir:"ltr",className:Mt("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:_.jsx(age,{className:Mt("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}
8286));cj.displayName=lj.displayName;const nx={siteTitle:"",contactEmail:"",phone:"",address:"",maintenanceMode:!1,enabledLanguages:{...BZ},socialLinks:[{platform:"Twitter",url:""},{platform:"LinkedIn",url:""},{platform:"Instagram",url:""},{platform:"Facebook",url:""}]},lge=["Globe","Linkedin","Youtube","Instagram","Facebook","Twitter"];function cge(t,e){switch(typeof t=="object"&&t!==null&&"code"in t?String(t.code):""){case"auth/wrong-password":case"auth/invalid-credential":return e("admin.auth.wrongPassword");case"auth/weak-password":return e("admin.auth.weakPassword");case"auth/requires-recent-login":return e("admin.auth.requiresRecentLogin");case"auth/too-many-requests":return e("admin.auth.tooManyRequests");default:return t instanceof Error?t.message:e("admin.auth.unknown")}}const uge=()=>{var P;const{t,i18n:e}=OD(),{user:n,changePassword:r}=Zh(),i=O.useMemo(()=>lge.map(D=>({value:D,label:t(`admin.settings.socialIcon.${D}`)})),[t,e.language]),[s,o]=O.useState(nx),[a,l]=O.useState(!0),[c,d]=O.useState(!1),[f,u]=O.useState(""),[h,g]=O.useState(""),[v,m]=O.useState(""),[p,y]=O.useState(!1),w=!!((P=n==null?void 0:n.providerData)!=null&&P.some(D=>D.providerId==="password"));O.useEffect(()=>{(async()=>{const F=_n(Et,"settings","main"),V=await m3(F);if(V.exists()){const H=V.data(),{workingHours:$,...B}=H,G={...nx,...B};G.enabledLanguages={...nx.enabledLanguages,...B.enabledLanguages},o(G)}l(!1)})()},[]);const x=(D,F)=>{o(V=>({...V,[D]:F}))},S=(D,F,V)=>{o(H=>({...H,socialLinks:H.socialLinks.map(($,B)=>B===D?{...$,[F]:V}:$)}))},I=(D,F)=>{o(V=>({...V,socialLinks:V.socialLinks.map((H,$)=>$===D?{...H,icon:F}:H)}))},M=()=>{o(D=>({...D,socialLinks:[...D.socialLinks,{platform:"",url:""}]}))},E=D=>{o(F=>({...F,socialLinks:F.socialLinks.filter((V,H)=>H!==D)}))},C=(D,F)=>{if(!F&&Xp(s.enabledLanguages)<=1&&s.enabledLanguages[D]!==!1){Rt({title:t("admin.settings.toast.langLastTitle"),description:t("admin.settings.toast.langLastDesc"),variant:"destructive"});return}o(V=>({...V,enabledLanguages:{...V.enabledLanguages,[D]:F}}))},T=async()=>{if(Xp(s.enabledLanguages)<1){Rt({title:t("admin.settings.toast.saveNoLangTitle"),description:t("admin.settings.toast.saveNoLangDesc"),variant:"destructive"});return}d(!0);try{const D=_n(Et,"settings","main");await VY(D,{...s,workingHours:GY()},{merge:!0}),Rt({title:t("admin.settings.toast.saveSuccessTitle"),description:t("admin.settings.toast.saveSuccessDesc")}),xt("admin_settings_save",{success:!0,enabled_language_count:Xp(s.enabledLanguages),social_link_count:s.socialLinks.length})}catch{xt("admin_settings_save",{success:!1}),Rt({title:t("admin.settings.toast.saveErrorTitle"),description:t("admin.settings.toast.saveErrorDesc"),variant:"destructive"})}finally{d(!1)}},A=async D=>{if(D.preventDefault(),h.length<6){Rt({title:t("admin.settings.toast.passwordWeakTitle"),description:t("admin.settings.toast.passwordWeakDesc"),variant:"destructive"});return}if(h!==v){Rt({title:t("admin.settings.toast.passwordMismatch"),description:t("admin.settings.toast.passwordMismatchDesc"),variant:"destructive"});return}y(!0);try{await r(f,h),u(""),g(""),m(""),Rt({title:t("admin.settings.toast.passwordSuccessTitle"),description:t("admin.settings.toast.passwordSuccessDesc")}),xt("admin_password_change",{success:!0})}catch(F){xt("admin_password_change",{success:!1}),Rt({title:t("admin.settings.toast.errorTitle"),description:cge(F,t),variant:"destructive"})}finally{y(!1)}},R=()=>_.jsxs(rt,{type:"button",className:"mt-6 flex items-center gap-2",disabled:c,onClick:()=>void T(),children:[_.jsx(iy,{className:"h-4 w-4"}),t(c?"admin.settings.saving":"admin.settings.save")]});return _.jsxs("div",{className:"max-w-3xl mx-auto py-12 px-2",children:[_.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[_.jsx(cE,{className:"h-7 w-7 text-primary"}),_.jsx("h1",{className:"text-2xl font-bold text-foreground",children:t("admin.settings.title")})]}),_.jsx(on,{className:"border border-muted bg-white dark:bg-card rounded-lg shadow-sm",children:_.jsx(an,{className:"p-4 sm:p-6",children:a?_.jsx("div",{className:"py-16 text-center text-muted-foreground",children:t("admin.settings.loading")}):_.jsxs(tge,{defaultValue:"general",className:"w-full",children:[_.jsxs(rj,{className:"mb-6 flex h-auto min-h-10 w-full flex-wrap gap-1 p-1 sm:flex-nowrap",children:[_.jsxs(ff,{value:"general",className:"min-w-0 flex-1 basis-[calc(50%-2px)] gap-1.5 px-2 sm:basis-0 sm:px-3",children:[_.jsx(_8,{className:"h-4 w-4 shrink-0 opacity-80"}),_.jsx("span",{className:"truncate",children:t("admin.settings.tabGeneral")})]}),_.jsxs(ff,{value:"languages",className:"min-w-0 flex-1 basis-[calc(50%-2px)] gap-1.5 px-2 sm:basis-0 sm:px-3",children:[_.jsx(C8,{className:"h-4 w-4 shrink-0 opacity-80"}),_.jsx("span",{className:"truncate",children:t("admin.settings.tabLanguages")})]}),_.jsxs(ff,{value:"social",className:"min-w-0 flex-1 basis-[calc(50%-2px)] gap-1.5 px-2 sm:basis-0 sm:px-3",children:[_.jsx(O8,{className:"h-4 w-4 shrink-0 opacity-80"}),_.jsx("span",{className:"truncate",children:t("admin.settings.tabSocial")})]}),n&&_.jsxs(ff,{value:"account",className:"min-w-0 flex-1 basis-[calc(50%-2px)] gap-1.5 px-2 sm:basis-0 sm:px-3",children:[_.jsx(hM,{className:"h-4 w-4 shrink-0 opacity-80"}),_.jsx("span",{className:"truncate",children:t("admin.settings.tabAccount")}
8286)]})]}),_.jsxs(hf,{value:"general",className:"mt-0 space-y-4 focus-visible:outline-none",children:[_.jsxs("div",{children:[_.jsx($t,{htmlFor:"siteTitle",children:t("admin.settings.siteTitle")}),_.jsx(sn,{id:"siteTitle",value:s.siteTitle,onChange:D=>x("siteTitle",D.target.value),className:"mt-1",required:!0})]}),_.jsxs("div",{children:[_.jsx($t,{htmlFor:"contactEmail",children:t("admin.settings.contactEmail")}),_.jsx(sn,{id:"contactEmail",type:"email",value:s.contactEmail,onChange:D=>x("contactEmail",D.target.value),className:"mt-1",required:!0})]}),_.jsxs("div",{children:[_.jsx($t,{htmlFor:"phone",children:t("admin.settings.phone")}),_.jsx(sn,{id:"phone",value:s.phone,onChange:D=>x("phone",D.target.value),className:"mt-1"})]}),_.jsxs("div",{children:[_.jsx($t,{htmlFor:"address",children:t("admin.settings.address")}),_.jsx(sn,{id:"address",value:s.address,onChange:D=>x("address",D.target.value),className:"mt-1"})]}),_.jsx(R,{})]}),_.jsxs(hf,{value:"languages",className:"mt-0 space-y-4 focus-visible:outline-none",children:[_.jsxs("div",{children:[_.jsx($t,{children:t("admin.settings.siteLanguages")}),_.jsx("p",{className:"text-sm text-muted-foreground mt-1 mb-3",children:t("admin.settings.siteLanguagesHelp")}),_.jsx("div",{className:"flex flex-col gap-3",children:Uu.map(D=>{const F=s.enabledLanguages[D.code]!==!1,V=Xp(s.enabledLanguages)===1&&F,H=t(`admin.settings.siteLangLabel.${D.code}`);return _.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2",children:[_.jsxs("span",{className:"text-sm text-foreground",children:[_.jsx("span",{className:"mr-2",children:D.flag}),H," ",_.jsxs("span",{className:"text-muted-foreground",children:["(",D.code,")"]})]}),_.jsx(cj,{checked:F,disabled:V,onCheckedChange:$=>C(D.code,$),"aria-label":t("admin.settings.langSwitchAria",{name:H,code:D.code})})]},D.code)})})]}),_.jsx(R,{})]}),_.jsxs(hf,{value:"social",className:"mt-0 space-y-4 focus-visible:outline-none",children:[_.jsxs("div",{children:[_.jsx($t,{children:t("admin.settings.socialLinks")}),_.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[s.socialLinks.map((D,F)=>_.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_.jsxs("select",{value:D.icon||"",onChange:V=>I(F,V.target.value),className:"border border-border rounded px-2 py-2 min-h-10 bg-background text-foreground text-sm",children:[_.jsx("option",{value:"",children:t("admin.settings.selectIcon")}),i.map(V=>_.jsx("option",{value:V.value,children:V.label},V.value))]}),_.jsx(sn,{value:D.platform,onChange:V=>S(F,"platform",V.target.value),className:"w-full sm:w-32",placeholder:t("admin.settings.platformPlaceholder")}),_.jsx(sn,{value:D.url,onChange:V=>S(F,"url",V.target.value),className:"min-w-0 flex-1",placeholder:t("admin.settings.urlPlaceholder")}),_.jsx(rt,{type:"button",variant:"destructive",size:"icon",onClick:()=>E(F),title:t("admin.settings.removeTitle"),"aria-label":t("admin.settings.removeTitle"),children:"×"})]},F)),_.jsx(rt,{type:"button",variant:"outline",onClick:M,className:"mt-2 w-fit",children:t("admin.settings.addSocialLink")})]})]}),_.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border px-3 py-3",children:[_.jsx("input",{type:"checkbox",id:"maintenanceMode",checked:s.maintenanceMode,onChange:D=>x("maintenanceMode",D.target.checked)}),_.jsx($t,{htmlFor:"maintenanceMode",className:"cursor-pointer",children:t("admin.settings.maintenanceMode")})]}),_.jsx(R,{})]}),n&&_.jsxs(hf,{value:"account",className:"mt-0 space-y-4 focus-visible:outline-none",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(hM,{className:"h-5 w-5 text-primary"}),_.jsx("h2",{className:"text-lg font-semibold text-foreground",children:t("admin.settings.passwordTitle")})]}),n.email&&_.jsx("p",{className:"text-sm text-muted-foreground",children:t("admin.settings.sessionWithEmail",{email:n.email})}),w?_.jsxs("form",{onSubmit:A,className:"flex flex-col gap-4",children:[_.jsxs("div",{children:[_.jsx($t,{htmlFor:"currentPassword",children:t("admin.settings.passwordCurrent")}),_.jsx(sn,{id:"currentPassword",type:"password",autoComplete:"current-password",value:f,onChange:D=>u(D.target.value),className:"mt-1",required:!0})]}),_.jsxs("div",{children:[_.jsx($t,{htmlFor:"newPassword",children:t("admin.settings.passwordNew")}),_.jsx(sn,{id:"newPassword",type:"password",autoComplete:"new-password",value:h,onChange:D=>g(D.target.value),className:"mt-1",required:!0,minLength:6})]}),_.jsxs("div",{children:[_.jsx($t,{htmlFor:"confirmPassword",children:t("admin.settings.passwordConfirm")}),_.jsx(sn,{id:"confirmPassword",type:"password",autoComplete:"new-password",value:v,onCh
8286ange:D=>m(D.target.value),className:"mt-1",required:!0,minLength:6})]}),_.jsx(rt,{type:"submit",disabled:p,className:"w-fit",children:t(p?"admin.settings.passwordSubmitting":"admin.settings.passwordSubmit")})]}):_.jsx("p",{className:"text-sm text-muted-foreground",children:t("admin.settings.passwordOAuthNotice")})]})]})})})]})},dge=new d6,fge=()=>(O.useEffect(()=>{},[]),_.jsx(h6,{client:dge,children:_.jsx(V9,{children:_.jsx(zZ,{children:_.jsx(RH,{children:_.jsx(GZ,{children:_.jsxs(B5,{children:[_.jsxs(O.Suspense,{fallback:_.jsx(ad,{}),children:[_.jsx(gte,{}),_.jsxs(O_,{children:[_.jsx(gn,{path:"/admin/*",element:_.jsx(mte,{children:_.jsx(pte,{children:_.jsxs(O_,{children:[_.jsx(gn,{path:"dashboard",element:_.jsx(ume,{})}),_.jsx(gn,{path:"services",element:_.jsx(hme,{})}),_.jsx(gn,{path:"projects",element:_.jsx(Wme,{})}),_.jsx(gn,{path:"blog",element:_.jsx(tx,{})}),_.jsx(gn,{path:"blog/new",element:_.jsx(tx,{})}),_.jsx(gn,{path:"blog/:id/edit",element:_.jsx(tx,{})}),_.jsx(gn,{path:"contacts",element:_.jsx(Xme,{})}),_.jsx(gn,{path:"email-subscriptions",element:_.jsx(Yme,{})}),_.jsx(gn,{path:"users",element:_.jsx(Qme,{})}),_.jsx(gn,{path:"settings",element:_.jsx(uge,{})}),_.jsx(gn,{path:"*",element:_.jsx(bI,{})})]})})})}),_.jsx(gn,{path:"/*",element:_.jsxs(_.Fragment,{children:[_.jsx(cte,{}),_.jsx("main",{className:"flex-1 min-h-screen",children:_.jsxs(O_,{children:[_.jsx(gn,{path:"/",element:_.jsx(gle,{})}),_.jsx(gn,{path:"/services",element:_.jsx(xle,{})}),_.jsx(gn,{path:"/projects",element:_.jsx(ble,{})}),_.jsx(gn,{path:"/projects/:id",element:_.jsx(wle,{})}),_.jsx(gn,{path:"/blog",element:_.jsx(Sle,{})}),_.jsx(gn,{path:"/blog/:id",element:_.jsx(sme,{})}),_.jsx(gn,{path:"/contact",element:_.jsx(lme,{})}),_.jsx(gn,{path:"/login",element:_.jsx(cme,{})}),_.jsx(gn,{path:"*",element:_.jsx(bI,{})})]})}),_.jsx(ute,{})]})})]})]}),_.jsx(V8,{}),_.jsx(gH,{}),_.jsx(CH,{})]})})})})})}));qN(document.getElementById("root")).render(_.jsx(fge,{}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.