You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1691 lines
1.2 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

var xI=Object.defineProperty;var iE=t=>{throw TypeError(t)};var MI=(t,e,n)=>e in t?xI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var O=(t,e,n)=>MI(t,typeof e!="symbol"?e+"":e,n),Sv=(t,e,n)=>e.has(t)||iE("Cannot "+n);var G=(t,e,n)=>(Sv(t,e,"read from private field"),n?n.call(t):e.get(t)),St=(t,e,n)=>e.has(t)?iE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Xe=(t,e,n,r)=>(Sv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Wt=(t,e,n)=>(Sv(t,e,"access private method"),n);var sh=(t,e,n,r)=>({set _(i){Xe(t,e,i,n)},get _(){return G(t,e,r)}});function OI(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 l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).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)}})();function By(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wv={exports:{}},Uu={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var sE;function PI(){if(sE)return Uu;sE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var l=null;if(s!==void 0&&(l=""+s),i.key!==void 0&&(l=""+i.key),"key"in i){s={};for(var c in i)c!=="key"&&(s[c]=i[c])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:l,ref:i!==void 0?i:null,props:s}}return Uu.Fragment=e,Uu.jsx=n,Uu.jsxs=n,Uu}var aE;function NI(){return aE||(aE=1,wv.exports=PI()),wv.exports}var ar=NI(),jf=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(){}},Vo=typeof window>"u"||"Deno"in globalThis;function Mi(){}function II(t,e){return typeof t=="function"?t(e):t}function P0(t){return typeof t=="number"&&t>=0&&t!==1/0}function dR(t,e){return Math.max(t+(e||0)-Date.now(),0)}function nc(t,e){return typeof t=="function"?t(e):t}function Ki(t,e){return typeof t=="function"?t(e):t}function oE(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:l,stale:c}=t;if(l){if(r){if(e.queryHash!==Uy(l,e.options))return!1}else if(!_f(e.queryKey,l))return!1}if(n!=="all"){const f=e.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||i&&i!==e.state.fetchStatus||s&&!s(e))}function lE(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(vf(e.options.mutationKey)!==vf(s))return!1}else if(!_f(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function Uy(t,e){return((e==null?void 0:e.queryKeyHashFn)||vf)(t)}function vf(t){return JSON.stringify(t,(e,n)=>I0(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function _f(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!_f(t[n],e[n])):!1}function hR(t,e){if(t===e)return t;const n=cE(t)&&cE(e);if(n||I0(t)&&I0(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),l=s.length,c=n?[]:{};let f=0;for(let d=0;d<l;d++){const g=n?d:s[d];(!n&&r.includes(g)||n)&&t[g]===void 0&&e[g]===void 0?(c[g]=void 0,f++):(c[g]=hR(t[g],e[g]),c[g]===t[g]&&t[g]!==void 0&&f++)}return i===l&&f===i?t:c}return e}function N0(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function cE(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function I0(t){if(!uE(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!uE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function uE(t){return Object.prototype.toString.call(t)==="[object Object]"}function DI(t){return new Promise(e=>{setTimeout(e,t)})}function D0(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?hR(t,e):e}function FI(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function kI(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var Ly=Symbol();function gR(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Ly?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Co,Ca,cc,nR,BI=(nR=class extends jf{constructor(){super();St(this,Co);St(this,Ca);St(this,cc);Xe(this,cc,e=>{if(!Vo&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){G(this,Ca)||this.setEventListener(G(this,cc))}onUnsubscribe(){var e;this.hasListeners()||((e=G(this,Ca))==null||e.call(this),Xe(this,Ca,void 0))}setEventListener(e){var n;Xe(this,cc,e),(n=G(this,Ca))==null||n.call(this),Xe(this,Ca,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){G(this,Co)!==e&&(Xe(this,Co,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof G(this,Co)=="boolean"?G(this,Co):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Co=new WeakMap,Ca=new WeakMap,cc=new WeakMap,nR),zy=new BI,uc,Ra,fc,rR,UI=(rR=class extends jf{constructor(){super();St(this,uc,!0);St(this,Ra);St(this,fc);Xe(this,fc,e=>{if(!Vo&&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(){G(this,Ra)||this.setEventListener(G(this,fc))}onUnsubscribe(){var e;this.hasListeners()||((e=G(this,Ra))==null||e.call(this),Xe(this,Ra,void 0))}setEventListener(e){var n;Xe(this,fc,e),(n=G(this,Ra))==null||n.call(this),Xe(this,Ra,e(this.setOnline.bind(this)))}setOnline(e){G(this,uc)!==e&&(Xe(this,uc,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return G(this,uc)}},uc=new WeakMap,Ra=new WeakMap,fc=new WeakMap,rR),Yh=new UI;function F0(){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 LI(t){return Math.min(1e3*2**t,3e4)}function pR(t){return(t??"online")==="online"?Yh.isOnline():!0}var mR=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Ev(t){return t instanceof mR}function vR(t){let e=!1,n=0,r=!1,i;const s=F0(),l=w=>{var b;r||(v(new mR(w)),(b=t.abort)==null||b.call(t))},c=()=>{e=!0},f=()=>{e=!1},d=()=>zy.isFocused()&&(t.networkMode==="always"||Yh.isOnline())&&t.canRun(),g=()=>pR(t.networkMode)&&t.canRun(),m=w=>{var b;r||(r=!0,(b=t.onSuccess)==null||b.call(t,w),i==null||i(),s.resolve(w))},v=w=>{var b;r||(r=!0,(b=t.onError)==null||b.call(t,w),i==null||i(),s.reject(w))},S=()=>new Promise(w=>{var b;i=A=>{(r||d())&&w(A)},(b=t.onPause)==null||b.call(t)}).then(()=>{var w;i=void 0,r||(w=t.onContinue)==null||w.call(t)}),E=()=>{if(r)return;let w;const b=n===0?t.initialPromise:void 0;try{w=b??t.fn()}catch(A){w=Promise.reject(A)}Promise.resolve(w).then(m).catch(A=>{var N;if(r)return;const T=t.retry??(Vo?0:3),C=t.retryDelay??LI,M=typeof C=="function"?C(n,A):C,x=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,A);if(e||!x){v(A);return}n++,(N=t.onFail)==null||N.call(t,n,A),DI(M).then(()=>d()?void 0:S()).then(()=>{e?v(A):E()})})};return{promise:s,cancel:l,continue:()=>(i==null||i(),s),cancelRetry:c,continueRetry:f,canStart:g,start:()=>(g()?E():S().then(E),s)}}function zI(){let t=[],e=0,n=c=>{c()},r=c=>{c()},i=c=>setTimeout(c,0);const s=c=>{e?t.push(c):i(()=>{n(c)})},l=()=>{const c=t;t=[],c.length&&i(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;e++;try{f=c()}finally{e--,e||l()}return f},batchCalls:c=>(...f)=>{s(()=>{c(...f)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var Mr=zI(),Ro,iR,_R=(iR=class{constructor(){St(this,Ro)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),P0(this.gcTime)&&Xe(this,Ro,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Vo?1/0:5*60*1e3))}clearGcTimeout(){G(this,Ro)&&(clearTimeout(G(this,Ro)),Xe(this,Ro,void 0))}},Ro=new WeakMap,iR),dc,hc,xi,xo,kr,zf,Mo,Wi,$s,sR,$I=(sR=class extends _R{constructor(e){super();St(this,Wi);St(this,dc);St(this,hc);St(this,xi);St(this,xo);St(this,kr);St(this,zf);St(this,Mo);Xe(this,Mo,!1),Xe(this,zf,e.defaultOptions),this.setOptions(e.options),this.observers=[],Xe(this,xo,e.client),Xe(this,xi,G(this,xo).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Xe(this,dc,VI(this.options)),this.state=e.state??G(this,dc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=G(this,kr))==null?void 0:e.promise}setOptions(e){this.options={...G(this,zf),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&G(this,xi).remove(this)}setData(e,n){const r=D0(this.state.data,e,this.options);return Wt(this,Wi,$s).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Wt(this,Wi,$s).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=G(this,kr))==null?void 0:r.promise;return(i=G(this,kr))==null||i.cancel(e),n?n.then(Mi).catch(Mi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(G(this,dc))}isActive(){return this.observers.some(e=>Ki(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ly||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!dR(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=G(this,kr))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=G(this,kr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),G(this,xi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(G(this,kr)&&(G(this,Mo)?G(this,kr).cancel({revert:!0}):G(this,kr).cancelRetry()),this.scheduleGc()),G(this,xi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Wt(this,Wi,$s).call(this,{type:"invalidate"})}fetch(e,n){var f,d,g;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(G(this,kr))return G(this,kr).continueRetry(),G(this,kr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const m=this.observers.find(v=>v.options.queryFn);m&&this.setOptions(m.options)}const r=new AbortController,i=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(Xe(this,Mo,!0),r.signal)})},s=()=>{const m=gR(this.options,n),v={client:G(this,xo),queryKey:this.queryKey,meta:this.meta};return i(v),Xe(this,Mo,!1),this.options.persister?this.options.persister(m,v,this):m(v)},l={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:G(this,xo),state:this.state,fetchFn:s};i(l),(f=this.options.behavior)==null||f.onFetch(l,this),Xe(this,hc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&Wt(this,Wi,$s).call(this,{type:"fetch",meta:(g=l.fetchOptions)==null?void 0:g.meta});const c=m=>{var v,S,E,w;Ev(m)&&m.silent||Wt(this,Wi,$s).call(this,{type:"error",error:m}),Ev(m)||((S=(v=G(this,xi).config).onError)==null||S.call(v,m,this),(w=(E=G(this,xi).config).onSettled)==null||w.call(E,this.state.data,m,this)),this.scheduleGc()};return Xe(this,kr,vR({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:m=>{var v,S,E,w;if(m===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(b){c(b);return}(S=(v=G(this,xi).config).onSuccess)==null||S.call(v,m,this),(w=(E=G(this,xi).config).onSettled)==null||w.call(E,m,this.state.error,this),this.scheduleGc()},onError:c,onFail:(m,v)=>{Wt(this,Wi,$s).call(this,{type:"failed",failureCount:m,error:v})},onPause:()=>{Wt(this,Wi,$s).call(this,{type:"pause"})},onContinue:()=>{Wt(this,Wi,$s).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),G(this,kr).start()}},dc=new WeakMap,hc=new WeakMap,xi=new WeakMap,xo=new WeakMap,kr=new WeakMap,zf=new WeakMap,Mo=new WeakMap,Wi=new WeakSet,$s=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...yR(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return Ev(i)&&i.revert&&G(this,hc)?{...G(this,hc),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Mr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),G(this,xi).notify({query:this,type:"updated",action:e})})},sR);function yR(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pR(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function VI(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 ds,aR,HI=(aR=class extends jf{constructor(e={}){super();St(this,ds);this.config=e,Xe(this,ds,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??Uy(i,n);let l=this.get(s);return l||(l=new $I({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){G(this,ds).has(e.queryHash)||(G(this,ds).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=G(this,ds).get(e.queryHash);n&&(e.destroy(),n===e&&G(this,ds).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Mr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return G(this,ds).get(e)}getAll(){return[...G(this,ds).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>oE(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>oE(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()})})}},ds=new WeakMap,aR),hs,Vr,Oo,gs,Sa,oR,jI=(oR=class extends _R{constructor(e){super();St(this,gs);St(this,hs);St(this,Vr);St(this,Oo);this.mutationId=e.mutationId,Xe(this,Vr,e.mutationCache),Xe(this,hs,[]),this.state=e.state||WI(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){G(this,hs).includes(e)||(G(this,hs).push(e),this.clearGcTimeout(),G(this,Vr).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Xe(this,hs,G(this,hs).filter(n=>n!==e)),this.scheduleGc(),G(this,Vr).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){G(this,hs).length||(this.state.status==="pending"?this.scheduleGc():G(this,Vr).remove(this))}continue(){var e;return((e=G(this,Oo))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,l,c,f,d,g,m,v,S,E,w,b,A,T,C,M,x,N,F;Xe(this,Oo,vR({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(L,I)=>{Wt(this,gs,Sa).call(this,{type:"failed",failureCount:L,error:I})},onPause:()=>{Wt(this,gs,Sa).call(this,{type:"pause"})},onContinue:()=>{Wt(this,gs,Sa).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>G(this,Vr).canRun(this)}));const n=this.state.status==="pending",r=!G(this,Oo).canStart();try{if(!n){Wt(this,gs,Sa).call(this,{type:"pending",variables:e,isPaused:r}),await((s=(i=G(this,Vr).config).onMutate)==null?void 0:s.call(i,e,this));const I=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,e));I!==this.state.context&&Wt(this,gs,Sa).call(this,{type:"pending",context:I,variables:e,isPaused:r})}const L=await G(this,Oo).start();return await((d=(f=G(this,Vr).config).onSuccess)==null?void 0:d.call(f,L,e,this.state.context,this)),await((m=(g=this.options).onSuccess)==null?void 0:m.call(g,L,e,this.state.context)),await((S=(v=G(this,Vr).config).onSettled)==null?void 0:S.call(v,L,null,this.state.variables,this.state.context,this)),await((w=(E=this.options).onSettled)==null?void 0:w.call(E,L,null,e,this.state.context)),Wt(this,gs,Sa).call(this,{type:"success",data:L}),L}catch(L){try{throw await((A=(b=G(this,Vr).config).onError)==null?void 0:A.call(b,L,e,this.state.context,this)),await((C=(T=this.options).onError)==null?void 0:C.call(T,L,e,this.state.context)),await((x=(M=G(this,Vr).config).onSettled)==null?void 0:x.call(M,void 0,L,this.state.variables,this.state.context,this)),await((F=(N=this.options).onSettled)==null?void 0:F.call(N,void 0,L,e,this.state.context)),L}finally{Wt(this,gs,Sa).call(this,{type:"error",error:L})}}finally{G(this,Vr).runNext(this)}}},hs=new WeakMap,Vr=new WeakMap,Oo=new WeakMap,gs=new WeakSet,Sa=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Mr.batch(()=>{G(this,hs).forEach(r=>{r.onMutationUpdate(e)}),G(this,Vr).notify({mutation:this,type:"updated",action:e})})},oR);function WI(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vs,Xi,$f,lR,XI=(lR=class extends jf{constructor(e={}){super();St(this,Vs);St(this,Xi);St(this,$f);this.config=e,Xe(this,Vs,new Set),Xe(this,Xi,new Map),Xe(this,$f,0)}build(e,n,r){const i=new jI({mutationCache:this,mutationId:++sh(this,$f)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){G(this,Vs).add(e);const n=ah(e);if(typeof n=="string"){const r=G(this,Xi).get(n);r?r.push(e):G(this,Xi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(G(this,Vs).delete(e)){const n=ah(e);if(typeof n=="string"){const r=G(this,Xi).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&G(this,Xi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=ah(e);if(typeof n=="string"){const r=G(this,Xi).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=ah(e);if(typeof n=="string"){const i=(r=G(this,Xi).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Mr.batch(()=>{G(this,Vs).forEach(e=>{this.notify({type:"removed",mutation:e})}),G(this,Vs).clear(),G(this,Xi).clear()})}getAll(){return Array.from(G(this,Vs))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>lE(n,r))}findAll(e={}){return this.getAll().filter(n=>lE(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(Mi))))}},Vs=new WeakMap,Xi=new WeakMap,$f=new WeakMap,lR);function ah(t){var e;return(e=t.options.scope)==null?void 0:e.id}function fE(t){return{onFetch:(e,n)=>{var g,m,v,S,E;const r=e.options,i=(v=(m=(g=e.fetchOptions)==null?void 0:g.meta)==null?void 0:m.fetchMore)==null?void 0:v.direction,s=((S=e.state.data)==null?void 0:S.pages)||[],l=((E=e.state.data)==null?void 0:E.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const d=async()=>{let w=!1;const b=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(e.signal.aborted?w=!0:e.signal.addEventListener("abort",()=>{w=!0}),e.signal)})},A=gR(e.options,e.fetchOptions),T=async(C,M,x)=>{if(w)return Promise.reject();if(M==null&&C.pages.length)return Promise.resolve(C);const N={client:e.client,queryKey:e.queryKey,pageParam:M,direction:x?"backward":"forward",meta:e.options.meta};b(N);const F=await A(N),{maxPages:L}=e.options,I=x?kI:FI;return{pages:I(C.pages,F,L),pageParams:I(C.pageParams,M,L)}};if(i&&s.length){const C=i==="backward",M=C?qI:dE,x={pages:s,pageParams:l},N=M(r,x);c=await T(x,N,C)}else{const C=t??s.length;do{const M=f===0?l[0]??r.initialPageParam:dE(r,c);if(f>0&&M==null)break;c=await T(c,M),f++}while(f<C)}return c};e.options.persister?e.fetchFn=()=>{var w,b;return(b=(w=e.options).persister)==null?void 0:b.call(w,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function dE(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 qI(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 Yn,xa,Ma,gc,pc,Oa,mc,vc,cR,YI=(cR=class{constructor(t={}){St(this,Yn);St(this,xa);St(this,Ma);St(this,gc);St(this,pc);St(this,Oa);St(this,mc);St(this,vc);Xe(this,Yn,t.queryCache||new HI),Xe(this,xa,t.mutationCache||new XI),Xe(this,Ma,t.defaultOptions||{}),Xe(this,gc,new Map),Xe(this,pc,new Map),Xe(this,Oa,0)}mount(){sh(this,Oa)._++,G(this,Oa)===1&&(Xe(this,mc,zy.subscribe(async t=>{t&&(await this.resumePausedMutations(),G(this,Yn).onFocus())})),Xe(this,vc,Yh.subscribe(async t=>{t&&(await this.resumePausedMutations(),G(this,Yn).onOnline())})))}unmount(){var t,e;sh(this,Oa)._--,G(this,Oa)===0&&((t=G(this,mc))==null||t.call(this),Xe(this,mc,void 0),(e=G(this,vc))==null||e.call(this),Xe(this,vc,void 0))}isFetching(t){return G(this,Yn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return G(this,xa).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=G(this,Yn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=G(this,Yn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(nc(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return G(this,Yn).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=G(this,Yn).get(r.queryHash),s=i==null?void 0:i.state.data,l=II(e,s);if(l!==void 0)return G(this,Yn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(t,e,n){return Mr.batch(()=>G(this,Yn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=G(this,Yn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=G(this,Yn);Mr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=G(this,Yn),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(()=>G(this,Yn).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(Mi).catch(Mi)}invalidateQueries(t,e={}){return Mr.batch(()=>{if(G(this,Yn).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const n={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(n,e)})}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Mr.batch(()=>G(this,Yn).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Mi)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Mi)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=G(this,Yn).build(this,e);return n.isStaleByTime(nc(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Mi).catch(Mi)}fetchInfiniteQuery(t){return t.behavior=fE(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Mi).catch(Mi)}ensureInfiniteQueryData(t){return t.behavior=fE(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Yh.isOnline()?G(this,xa).resumePausedMutations():Promise.resolve()}getQueryCache(){return G(this,Yn)}getMutationCache(){return G(this,xa)}getDefaultOptions(){return G(this,Ma)}setDefaultOptions(t){Xe(this,Ma,t)}setQueryDefaults(t,e){G(this,gc).set(vf(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...G(this,gc).values()],n={};return e.forEach(r=>{_f(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){G(this,pc).set(vf(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...G(this,pc).values()];let n={};return e.forEach(r=>{_f(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...G(this,Ma).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Uy(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.queryFn===Ly&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...G(this,Ma).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){G(this,Yn).clear(),G(this,xa).clear()}},Yn=new WeakMap,xa=new WeakMap,Ma=new WeakMap,gc=new WeakMap,pc=new WeakMap,Oa=new WeakMap,mc=new WeakMap,vc=new WeakMap,cR),Kr,Xt,Vf,Hr,Po,_c,Pa,ps,Hf,yc,bc,No,Io,Na,Sc,on,Ku,k0,B0,U0,L0,z0,$0,V0,bR,uR,KI=(uR=class extends jf{constructor(e,n){super();St(this,on);St(this,Kr);St(this,Xt);St(this,Vf);St(this,Hr);St(this,Po);St(this,_c);St(this,Pa);St(this,ps);St(this,Hf);St(this,yc);St(this,bc);St(this,No);St(this,Io);St(this,Na);St(this,Sc,new Set);this.options=n,Xe(this,Kr,e),Xe(this,ps,null),Xe(this,Pa,F0()),this.options.experimental_prefetchInRender||G(this,Pa).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(G(this,Xt).addObserver(this),hE(G(this,Xt),this.options)?Wt(this,on,Ku).call(this):this.updateResult(),Wt(this,on,L0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return H0(G(this,Xt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return H0(G(this,Xt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Wt(this,on,z0).call(this),Wt(this,on,$0).call(this),G(this,Xt).removeObserver(this)}setOptions(e,n){const r=this.options,i=G(this,Xt);if(this.options=G(this,Kr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ki(this.options.enabled,G(this,Xt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Wt(this,on,V0).call(this),G(this,Xt).setOptions(this.options),r._defaulted&&!N0(this.options,r)&&G(this,Kr).getQueryCache().notify({type:"observerOptionsUpdated",query:G(this,Xt),observer:this});const s=this.hasListeners();s&&gE(G(this,Xt),i,this.options,r)&&Wt(this,on,Ku).call(this),this.updateResult(n),s&&(G(this,Xt)!==i||Ki(this.options.enabled,G(this,Xt))!==Ki(r.enabled,G(this,Xt))||nc(this.options.staleTime,G(this,Xt))!==nc(r.staleTime,G(this,Xt)))&&Wt(this,on,k0).call(this);const l=Wt(this,on,B0).call(this);s&&(G(this,Xt)!==i||Ki(this.options.enabled,G(this,Xt))!==Ki(r.enabled,G(this,Xt))||l!==G(this,Na))&&Wt(this,on,U0).call(this,l)}getOptimisticResult(e){const n=G(this,Kr).getQueryCache().build(G(this,Kr),e),r=this.createResult(n,e);return QI(this,r)&&(Xe(this,Hr,r),Xe(this,_c,this.options),Xe(this,Po,G(this,Xt).state)),r}getCurrentResult(){return G(this,Hr)}trackResult(e,n){const r={};return Object.keys(e).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),e[i])})}),r}trackProp(e){G(this,Sc).add(e)}getCurrentQuery(){return G(this,Xt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=G(this,Kr).defaultQueryOptions(e),r=G(this,Kr).getQueryCache().build(G(this,Kr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Wt(this,on,Ku).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),G(this,Hr)))}createResult(e,n){var L;const r=G(this,Xt),i=this.options,s=G(this,Hr),l=G(this,Po),c=G(this,_c),d=e!==r?e.state:G(this,Vf),{state:g}=e;let m={...g},v=!1,S;if(n._optimisticResults){const I=this.hasListeners(),V=!I&&hE(e,n),B=I&&gE(e,r,n,i);(V||B)&&(m={...m,...yR(g.data,e.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:E,errorUpdatedAt:w,status:b}=m;if(n.select&&m.data!==void 0)if(s&&m.data===(l==null?void 0:l.data)&&n.select===G(this,Hf))S=G(this,yc);else try{Xe(this,Hf,n.select),S=n.select(m.data),S=D0(s==null?void 0:s.data,S,n),Xe(this,yc,S),Xe(this,ps,null)}catch(I){Xe(this,ps,I)}else S=m.data;if(n.placeholderData!==void 0&&S===void 0&&b==="pending"){let I;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData))I=s.data;else if(I=typeof n.placeholderData=="function"?n.placeholderData((L=G(this,bc))==null?void 0:L.state.data,G(this,bc)):n.placeholderData,n.select&&I!==void 0)try{I=n.select(I),Xe(this,ps,null)}catch(V){Xe(this,ps,V)}I!==void 0&&(b="success",S=D0(s==null?void 0:s.data,I,n),v=!0)}G(this,ps)&&(E=G(this,ps),S=G(this,yc),w=Date.now(),b="error");const A=m.fetchStatus==="fetching",T=b==="pending",C=b==="error",M=T&&A,x=S!==void 0,F={status:b,fetchStatus:m.fetchStatus,isPending:T,isSuccess:b==="success",isError:C,isInitialLoading:M,isLoading:M,data:S,dataUpdatedAt:m.dataUpdatedAt,error:E,errorUpdatedAt:w,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:A,isRefetching:A&&!T,isLoadingError:C&&!x,isPaused:m.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:C&&x,isStale:$y(e,n),refetch:this.refetch,promise:G(this,Pa)};if(this.options.experimental_prefetchInRender){const I=j=>{F.status==="error"?j.reject(F.error):F.data!==void 0&&j.resolve(F.data)},V=()=>{const j=Xe(this,Pa,F.promise=F0());I(j)},B=G(this,Pa);switch(B.status){case"pending":e.queryHash===r.queryHash&&I(B);break;case"fulfilled":(F.status==="error"||F.data!==B.value)&&V();break;case"rejected":(F.status!=="error"||F.error!==B.reason)&&V();break}}return F}updateResult(e){const n=G(this,Hr),r=this.createResult(G(this,Xt),this.options);if(Xe(this,Po,G(this,Xt).state),Xe(this,_c,this.options),G(this,Po).data!==void 0&&Xe(this,bc,G(this,Xt)),N0(r,n))return;Xe(this,Hr,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:l}=this.options,c=typeof l=="function"?l():l;if(c==="all"||!c&&!G(this,Sc).size)return!0;const f=new Set(c??G(this,Sc));return this.options.throwOnError&&f.add("error"),Object.keys(G(this,Hr)).some(d=>{const g=d;return G(this,Hr)[g]!==n[g]&&f.has(g)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),Wt(this,on,bR).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Wt(this,on,L0).call(this)}},Kr=new WeakMap,Xt=new WeakMap,Vf=new WeakMap,Hr=new WeakMap,Po=new WeakMap,_c=new WeakMap,Pa=new WeakMap,ps=new WeakMap,Hf=new WeakMap,yc=new WeakMap,bc=new WeakMap,No=new WeakMap,Io=new WeakMap,Na=new WeakMap,Sc=new WeakMap,on=new WeakSet,Ku=function(e){Wt(this,on,V0).call(this);let n=G(this,Xt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Mi)),n},k0=function(){Wt(this,on,z0).call(this);const e=nc(this.options.staleTime,G(this,Xt));if(Vo||G(this,Hr).isStale||!P0(e))return;const r=dR(G(this,Hr).dataUpdatedAt,e)+1;Xe(this,No,setTimeout(()=>{G(this,Hr).isStale||this.updateResult()},r))},B0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(G(this,Xt)):this.options.refetchInterval)??!1},U0=function(e){Wt(this,on,$0).call(this),Xe(this,Na,e),!(Vo||Ki(this.options.enabled,G(this,Xt))===!1||!P0(G(this,Na))||G(this,Na)===0)&&Xe(this,Io,setInterval(()=>{(this.options.refetchIntervalInBackground||zy.isFocused())&&Wt(this,on,Ku).call(this)},G(this,Na)))},L0=function(){Wt(this,on,k0).call(this),Wt(this,on,U0).call(this,Wt(this,on,B0).call(this))},z0=function(){G(this,No)&&(clearTimeout(G(this,No)),Xe(this,No,void 0))},$0=function(){G(this,Io)&&(clearInterval(G(this,Io)),Xe(this,Io,void 0))},V0=function(){const e=G(this,Kr).getQueryCache().build(G(this,Kr),this.options);if(e===G(this,Xt))return;const n=G(this,Xt);Xe(this,Xt,e),Xe(this,Vf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},bR=function(e){Mr.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(G(this,Hr))}),G(this,Kr).getQueryCache().notify({query:G(this,Xt),type:"observerResultsUpdated"})})},uR);function ZI(t,e){return Ki(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function hE(t,e){return ZI(t,e)||t.state.data!==void 0&&H0(t,e,e.refetchOnMount)}function H0(t,e,n){if(Ki(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&$y(t,e)}return!1}function gE(t,e,n,r){return(t!==e||Ki(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&$y(t,n)}function $y(t,e){return Ki(e.enabled,t)!==!1&&t.isStaleByTime(nc(e.staleTime,t))}function QI(t,e){return!N0(t.getCurrentResult(),e)}var Tv={exports:{}},Ct={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var pE;function GI(){if(pE)return Ct;pE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.iterator;function v(P){return P===null||typeof P!="object"?null:(P=m&&P[m]||P["@@iterator"],typeof P=="function"?P:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,w={};function b(P,$,ie){this.props=P,this.context=$,this.refs=w,this.updater=ie||S}b.prototype.isReactComponent={},b.prototype.setState=function(P,$){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,$,"setState")},b.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function A(){}A.prototype=b.prototype;function T(P,$,ie){this.props=P,this.context=$,this.refs=w,this.updater=ie||S}var C=T.prototype=new A;C.constructor=T,E(C,b.prototype),C.isPureReactComponent=!0;var M=Array.isArray,x={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function F(P,$,ie,se,q,ce){return ie=ce.ref,{$$typeof:t,type:P,key:$,ref:ie!==void 0?ie:null,props:ce}}function L(P,$){return F(P.type,$,void 0,void 0,void 0,P.props)}function I(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function V(P){var $={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(ie){return $[ie]})}var B=/\/+/g;function j(P,$){return typeof P=="object"&&P!==null&&P.key!=null?V(""+P.key):$.toString(36)}function X(){}function Y(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(X,X):(P.status="pending",P.then(function($){P.status==="pending"&&(P.status="fulfilled",P.value=$)},function($){P.status==="pending"&&(P.status="rejected",P.reason=$)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function ae(P,$,ie,se,q){var ce=typeof P;(ce==="undefined"||ce==="boolean")&&(P=null);var fe=!1;if(P===null)fe=!0;else switch(ce){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(P.$$typeof){case t:case e:fe=!0;break;case g:return fe=P._init,ae(fe(P._payload),$,ie,se,q)}}if(fe)return q=q(P),fe=se===""?"."+j(P,0):se,M(q)?(ie="",fe!=null&&(ie=fe.replace(B,"$&/")+"/"),ae(q,$,ie,"",function(Ae){return Ae})):q!=null&&(I(q)&&(q=L(q,ie+(q.key==null||P&&P.key===q.key?"":(""+q.key).replace(B,"$&/")+"/")+fe)),$.push(q)),1;fe=0;var ye=se===""?".":se+":";if(M(P))for(var we=0;we<P.length;we++)se=P[we],ce=ye+j(se,we),fe+=ae(se,$,ie,ce,q);else if(we=v(P),typeof we=="function")for(P=we.call(P),we=0;!(se=P.next()).done;)se=se.value,ce=ye+j(se,we++),fe+=ae(se,$,ie,ce,q);else if(ce==="object"){if(typeof P.then=="function")return ae(Y(P),$,ie,se,q);throw $=String(P),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return fe}function U(P,$,ie){if(P==null)return P;var se=[],q=0;return ae(P,se,"","",function(ce){return $.call(ie,ce,q++)}),se}function z(P){if(P._status===-1){var $=P._result;$=$(),$.then(function(ie){(P._status===0||P._status===-1)&&(P._status=1,P._result=ie)},function(ie){(P._status===0||P._status===-1)&&(P._status=2,P._result=ie)}),P._status===-1&&(P._status=0,P._result=$)}if(P._status===1)return P._result.default;throw P._result}var W=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)};function Z(){}return Ct.Children={map:U,forEach:function(P,$,ie){U(P,function(){$.apply(this,arguments)},ie)},count:function(P){var $=0;return U(P,function(){$++}),$},toArray:function(P){return U(P,function($){return $})||[]},only:function(P){if(!I(P))throw Error("React.Children.only expected to receive a single React element child.");return P}},Ct.Component=b,Ct.Fragment=n,Ct.Profiler=i,Ct.PureComponent=T,Ct.StrictMode=r,Ct.Suspense=f,Ct.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,Ct.act=function(){throw Error("act(...) is not supported in production builds of React.")},Ct.cache=function(P){return function(){return P.apply(null,arguments)}},Ct.cloneElement=function(P,$,ie){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var se=E({},P.props),q=P.key,ce=void 0;if($!=null)for(fe in $.ref!==void 0&&(ce=void 0),$.key!==void 0&&(q=""+$.key),$)!N.call($,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&$.ref===void 0||(se[fe]=$[fe]);var fe=arguments.length-2;if(fe===1)se.children=ie;else if(1<fe){for(var ye=Array(fe),we=0;we<fe;we++)ye[we]=arguments[we+2];se.children=ye}return F(P.type,q,void 0,void 0,ce,se)},Ct.createContext=function(P){return P={$$typeof:l,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:s,_context:P},P},Ct.createElement=function(P,$,ie){var se,q={},ce=null;if($!=null)for(se in $.key!==void 0&&(ce=""+$.key),$)N.call($,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(q[se]=$[se]);var fe=arguments.length-2;if(fe===1)q.children=ie;else if(1<fe){for(var ye=Array(fe),we=0;we<fe;we++)ye[we]=arguments[we+2];q.children=ye}if(P&&P.defaultProps)for(se in fe=P.defaultProps,fe)q[se]===void 0&&(q[se]=fe[se]);return F(P,ce,void 0,void 0,null,q)},Ct.createRef=function(){return{current:null}},Ct.forwardRef=function(P){return{$$typeof:c,render:P}},Ct.isValidElement=I,Ct.lazy=function(P){return{$$typeof:g,_payload:{_status:-1,_result:P},_init:z}},Ct.memo=function(P,$){return{$$typeof:d,type:P,compare:$===void 0?null:$}},Ct.startTransition=function(P){var $=x.T,ie={};x.T=ie;try{var se=P(),q=x.S;q!==null&&q(ie,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(Z,W)}catch(ce){W(ce)}finally{x.T=$}},Ct.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},Ct.use=function(P){return x.H.use(P)},Ct.useActionState=function(P,$,ie){return x.H.useActionState(P,$,ie)},Ct.useCallback=function(P,$){return x.H.useCallback(P,$)},Ct.useContext=function(P){return x.H.useContext(P)},Ct.useDebugValue=function(){},Ct.useDeferredValue=function(P,$){return x.H.useDeferredValue(P,$)},Ct.useEffect=function(P,$){return x.H.useEffect(P,$)},Ct.useId=function(){return x.H.useId()},Ct.useImperativeHandle=function(P,$,ie){return x.H.useImperativeHandle(P,$,ie)},Ct.useInsertionEffect=function(P,$){return x.H.useInsertionEffect(P,$)},Ct.useLayoutEffect=function(P,$){return x.H.useLayoutEffect(P,$)},Ct.useMemo=function(P,$){return x.H.useMemo(P,$)},Ct.useOptimistic=function(P,$){return x.H.useOptimistic(P,$)},Ct.useReducer=function(P,$,ie){return x.H.useReducer(P,$,ie)},Ct.useRef=function(P){return x.H.useRef(P)},Ct.useState=function(P){return x.H.useState(P)},Ct.useSyncExternalStore=function(P,$,ie){return x.H.useSyncExternalStore(P,$,ie)},Ct.useTransition=function(){return x.H.useTransition()},Ct.version="19.0.0",Ct}var mE;function Vy(){return mE||(mE=1,Tv.exports=GI()),Tv.exports}var _=Vy();const Ft=By(_),rp=OI({__proto__:null,default:Ft},[_]);var SR=_.createContext(void 0),JI=t=>{const e=_.useContext(SR);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},e6=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),ar.jsx(SR.Provider,{value:t,children:e})),wR=_.createContext(!1),t6=()=>_.useContext(wR);wR.Provider;function n6(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var r6=_.createContext(n6()),i6=()=>_.useContext(r6);function s6(t,e){return typeof t=="function"?t(...e):!!t}function vE(){}var a6=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},o6=t=>{_.useEffect(()=>{t.clearReset()},[t])},l6=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||s6(n,[t.error,r])),c6=t=>{const e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...n)=>Math.max(e(...n),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},u6=(t,e)=>t.isLoading&&t.isFetching&&!e,f6=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,_E=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function d6(t,e,n){var m,v,S,E,w;const r=JI(),i=t6(),s=i6(),l=r.defaultQueryOptions(t);(v=(m=r.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||v.call(m,l),l._optimisticResults=i?"isRestoring":"optimistic",c6(l),a6(l,s),o6(s);const c=!r.getQueryCache().get(l.queryHash),[f]=_.useState(()=>new e(r,l)),d=f.getOptimisticResult(l),g=!i&&t.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(b=>{const A=g?f.subscribe(Mr.batchCalls(b)):vE;return f.updateResult(),A},[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),_.useEffect(()=>{f.setOptions(l,{listeners:!1})},[l,f]),f6(l,d))throw _E(l,f,s);if(l6({result:d,errorResetBoundary:s,throwOnError:l.throwOnError,query:r.getQueryCache().get(l.queryHash),suspense:l.suspense}))throw d.error;if((E=(S=r.getDefaultOptions().queries)==null?void 0:S._experimental_afterQuery)==null||E.call(S,l,d),l.experimental_prefetchInRender&&!Vo&&u6(d,i)){const b=c?_E(l,f,s):(w=r.getQueryCache().get(l.queryHash))==null?void 0:w.promise;b==null||b.catch(vE).finally(()=>{f.updateResult()})}return l.notifyOnChangeProps?d:f.trackResult(d)}function h6(t,e){return d6(t,KI)}const g6="modulepreload",p6=function(t){return"/"+t},yE={},m6=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(n.map(f=>{if(f=p6(f),f in yE)return;yE[f]=!0;const d=f.endsWith(".css"),g=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":g6,d||(m.as="script"),m.crossOrigin="",m.href=f,c&&m.setAttribute("nonce",c),document.head.appendChild(m),d)return new Promise((v,S)=>{m.addEventListener("load",v),m.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return i.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};var v6=function(){return null},Av={exports:{}},Lu={},Cv={exports:{}},Rv={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var bE;function _6(){return bE||(bE=1,function(t){function e(U,z){var W=U.length;U.push(z);e:for(;0<W;){var Z=W-1>>>1,P=U[Z];if(0<i(P,z))U[Z]=z,U[W]=P,W=Z;else break e}}function n(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var z=U[0],W=U.pop();if(W!==z){U[0]=W;e:for(var Z=0,P=U.length,$=P>>>1;Z<$;){var ie=2*(Z+1)-1,se=U[ie],q=ie+1,ce=U[q];if(0>i(se,W))q<P&&0>i(ce,se)?(U[Z]=ce,U[q]=W,Z=q):(U[Z]=se,U[ie]=W,Z=ie);else if(q<P&&0>i(ce,W))U[Z]=ce,U[q]=W,Z=q;else break e}}return z}function i(U,z){var W=U.sortIndex-z.sortIndex;return W!==0?W:U.id-z.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();t.unstable_now=function(){return l.now()-c}}var f=[],d=[],g=1,m=null,v=3,S=!1,E=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function C(U){for(var z=n(d);z!==null;){if(z.callback===null)r(d);else if(z.startTime<=U)r(d),z.sortIndex=z.expirationTime,e(f,z);else break;z=n(d)}}function M(U){if(w=!1,C(U),!E)if(n(f)!==null)E=!0,Y();else{var z=n(d);z!==null&&ae(M,z.startTime-U)}}var x=!1,N=-1,F=5,L=-1;function I(){return!(t.unstable_now()-L<F)}function V(){if(x){var U=t.unstable_now();L=U;var z=!0;try{e:{E=!1,w&&(w=!1,A(N),N=-1),S=!0;var W=v;try{t:{for(C(U),m=n(f);m!==null&&!(m.expirationTime>U&&I());){var Z=m.callback;if(typeof Z=="function"){m.callback=null,v=m.priorityLevel;var P=Z(m.expirationTime<=U);if(U=t.unstable_now(),typeof P=="function"){m.callback=P,C(U),z=!0;break t}m===n(f)&&r(f),C(U)}else r(f);m=n(f)}if(m!==null)z=!0;else{var $=n(d);$!==null&&ae(M,$.startTime-U),z=!1}}break e}finally{m=null,v=W,S=!1}z=void 0}}finally{z?B():x=!1}}}var B;if(typeof T=="function")B=function(){T(V)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,X=j.port2;j.port1.onmessage=V,B=function(){X.postMessage(null)}}else B=function(){b(V,0)};function Y(){x||(x=!0,B())}function ae(U,z){N=b(function(){U(t.unstable_now())},z)}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(U){U.callback=null},t.unstable_continueExecution=function(){E||S||(E=!0,Y())},t.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<U?Math.floor(1e3/U):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_getFirstCallbackNode=function(){return n(f)},t.unstable_next=function(U){switch(v){case 1:case 2:case 3:var z=3;break;default:z=v}var W=v;v=z;try{return U()}finally{v=W}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(U,z){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var W=v;v=U;try{return z()}finally{v=W}},t.unstable_scheduleCallback=function(U,z,W){var Z=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?Z+W:Z):W=Z,U){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=W+P,U={id:g++,callback:z,priorityLevel:U,startTime:W,expirationTime:P,sortIndex:-1},W>Z?(U.sortIndex=W,e(d,U),n(f)===null&&U===n(d)&&(w?(A(N),N=-1):w=!0,ae(M,W-Z))):(U.sortIndex=P,e(f,U),E||S||(E=!0,Y())),U},t.unstable_shouldYield=I,t.unstable_wrapCallback=function(U){var z=v;return function(){var W=v;v=z;try{return U.apply(this,arguments)}finally{v=W}}}}(Rv)),Rv}var SE;function y6(){return SE||(SE=1,Cv.exports=_6()),Cv.exports}var xv={exports:{}},Dr={};/**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var wE;function b6(){if(wE)return Dr;wE=1;var t=Vy();function e(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(f,d,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:f,containerInfo:d,implementation:g}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Dr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Dr.createPortal=function(f,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return s(f,d,null,g)},Dr.flushSync=function(f){var d=l.T,g=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=d,r.p=g,r.d.f()}},Dr.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},Dr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Dr.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var g=d.as,m=c(g,d.crossOrigin),v=typeof d.integrity=="string"?d.integrity:void 0,S=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:v,fetchPriority:S}):g==="script"&&r.d.X(f,{crossOrigin:m,integrity:v,fetchPriority:S,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Dr.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=c(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},Dr.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,m=c(g,d.crossOrigin);r.d.L(f,g,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Dr.preloadModule=function(f,d){if(typeof f=="string")if(d){var g=c(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},Dr.requestFormReset=function(f){r.d.r(f)},Dr.unstable_batchedUpdates=function(f,d){return f(d)},Dr.useFormState=function(f,d,g){return l.H.useFormState(f,d,g)},Dr.useFormStatus=function(){return l.H.useHostTransitionStatus()},Dr.version="19.0.0",Dr}var EE;function ER(){if(EE)return xv.exports;EE=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),xv.exports=b6(),xv.exports}/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var TE;function S6(){if(TE)return Lu;TE=1;var t=y6(),e=Vy(),n=ER();function r(a){var o="https://react.dev/errors/"+a;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)o+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}var s=Symbol.for("react.element"),l=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),v=Symbol.for("react.consumer"),S=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),C=Symbol.for("react.offscreen"),M=Symbol.for("react.memo_cache_sentinel"),x=Symbol.iterator;function N(a){return a===null||typeof a!="object"?null:(a=x&&a[x]||a["@@iterator"],typeof a=="function"?a:null)}var F=Symbol.for("react.client.reference");function L(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===F?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case f:return"Fragment";case c:return"Portal";case g:return"Profiler";case d:return"StrictMode";case w:return"Suspense";case b:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case S:return(a.displayName||"Context")+".Provider";case v:return(a._context.displayName||"Context")+".Consumer";case E:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case A:return o=a.displayName||null,o!==null?o:L(a.type)||"Memo";case T:o=a._payload,a=a._init;try{return L(a(o))}catch{}}return null}var I=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.assign,B,j;function X(a){if(B===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);B=o&&o[1]||"",j=-1<u.stack.indexOf(`
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
`+B+a+j}var Y=!1;function ae(a,o){if(!a||Y)return"";Y=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(o){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(he){var ue=he}Reflect.construct(a,[],Se)}else{try{Se.call()}catch(he){ue=he}a.call(Se.prototype)}}else{try{throw Error()}catch(he){ue=he}(Se=a())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(he){if(he&&ue&&typeof he.stack=="string")return[he.stack,ue.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=h.DetermineComponentFrameRoot(),R=y[0],D=y[1];if(R&&D){var H=R.split(`
`),ee=D.split(`
`);for(p=h=0;h<H.length&&!H[h].includes("DetermineComponentFrameRoot");)h++;for(;p<ee.length&&!ee[p].includes("DetermineComponentFrameRoot");)p++;if(h===H.length||p===ee.length)for(h=H.length-1,p=ee.length-1;1<=h&&0<=p&&H[h]!==ee[p];)p--;for(;1<=h&&0<=p;h--,p--)if(H[h]!==ee[p]){if(h!==1||p!==1)do if(h--,p--,0>p||H[h]!==ee[p]){var pe=`
`+H[h].replace(" at new "," at ");return a.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",a.displayName)),pe}while(1<=h&&0<=p);break}}}finally{Y=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?X(u):""}function U(a){switch(a.tag){case 26:case 27:case 5:return X(a.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("SuspenseList");case 0:case 15:return a=ae(a.type,!1),a;case 11:return a=ae(a.type.render,!1),a;case 1:return a=ae(a.type,!0),a;default:return""}}function z(a){try{var o="";do o+=U(a),a=a.return;while(a);return o}catch(u){return`
Error generating stack: `+u.message+`
`+u.stack}}function W(a){var o=a,u=a;if(a.alternate)for(;o.return;)o=o.return;else{a=o;do o=a,o.flags&4098&&(u=o.return),a=o.return;while(a)}return o.tag===3?u:null}function Z(a){if(a.tag===13){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function P(a){if(W(a)!==a)throw Error(r(188))}function $(a){var o=a.alternate;if(!o){if(o=W(a),o===null)throw Error(r(188));return o!==a?null:a}for(var u=a,h=o;;){var p=u.return;if(p===null)break;var y=p.alternate;if(y===null){if(h=p.return,h!==null){u=h;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===u)return P(p),a;if(y===h)return P(p),o;y=y.sibling}throw Error(r(188))}if(u.return!==h.return)u=p,h=y;else{for(var R=!1,D=p.child;D;){if(D===u){R=!0,u=p,h=y;break}if(D===h){R=!0,h=p,u=y;break}D=D.sibling}if(!R){for(D=y.child;D;){if(D===u){R=!0,u=y,h=p;break}if(D===h){R=!0,h=y,u=p;break}D=D.sibling}if(!R)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?a:o}function ie(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=ie(a),o!==null)return o;a=a.sibling}return null}var se=Array.isArray,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},fe=[],ye=-1;function we(a){return{current:a}}function Ae(a){0>ye||(a.current=fe[ye],fe[ye]=null,ye--)}function Te(a,o){ye++,fe[ye]=a.current,a.current=o}var ve=we(null),ge=we(null),_e=we(null),Ie=we(null);function Ee(a,o){switch(Te(_e,o),Te(ge,a),Te(ve,null),a=o.nodeType,a){case 9:case 11:o=(o=o.documentElement)&&(o=o.namespaceURI)?Iw(o):0;break;default:if(a=a===8?o.parentNode:o,o=a.tagName,a=a.namespaceURI)a=Iw(a),o=Dw(a,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}Ae(ve),Te(ve,o)}function xe(){Ae(ve),Ae(ge),Ae(_e)}function Ve(a){a.memoizedState!==null&&Te(Ie,a);var o=ve.current,u=Dw(o,a.type);o!==u&&(Te(ge,a),Te(ve,u))}function Fe(a){ge.current===a&&(Ae(ve),Ae(ge)),Ie.current===a&&(Ae(Ie),Iu._currentValue=ce)}var Be=Object.prototype.hasOwnProperty,nt=t.unstable_scheduleCallback,He=t.unstable_cancelCallback,Ge=t.unstable_shouldYield,Pe=t.unstable_requestPaint,Me=t.unstable_now,dt=t.unstable_getCurrentPriorityLevel,rt=t.unstable_ImmediatePriority,it=t.unstable_UserBlockingPriority,st=t.unstable_NormalPriority,at=t.unstable_LowPriority,Je=t.unstable_IdlePriority,lt=t.log,ft=t.unstable_setDisableYieldValue,ct=null,mt=null;function xt(a){if(mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(ct,a,void 0,(a.current.flags&128)===128)}catch{}}function Bt(a){if(typeof lt=="function"&&ft(a),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(ct,a)}catch{}}var ht=Math.clz32?Math.clz32:En,Vt=Math.log,qt=Math.LN2;function En(a){return a>>>=0,a===0?32:31-(Vt(a)/qt|0)|0}var Mn=128,Ut=4194304;function It(a){var o=a&42;if(o!==0)return o;switch(a&-a){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:return 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 a&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Lt(a,o){var u=a.pendingLanes;if(u===0)return 0;var h=0,p=a.suspendedLanes,y=a.pingedLanes,R=a.warmLanes;a=a.finishedLanes!==0;var D=u&134217727;return D!==0?(u=D&~p,u!==0?h=It(u):(y&=D,y!==0?h=It(y):a||(R=D&~R,R!==0&&(h=It(R))))):(D=u&~p,D!==0?h=It(D):y!==0?h=It(y):a||(R=u&~R,R!==0&&(h=It(R)))),h===0?0:o!==0&&o!==h&&!(o&p)&&(p=h&-h,R=o&-o,p>=R||p===32&&(R&4194176)!==0)?o:h}function Jt(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function Mt(a,o){switch(a){case 1:case 2:case 4:case 8:return o+250;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 o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qe(){var a=Mn;return Mn<<=1,!(Mn&4194176)&&(Mn=128),a}function ke(){var a=Ut;return Ut<<=1,!(Ut&62914560)&&(Ut=4194304),a}function Ne(a){for(var o=[],u=0;31>u;u++)o.push(a);return o}function wt(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function en(a,o,u,h,p,y){var R=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var D=a.entanglements,H=a.expirationTimes,ee=a.hiddenUpdates;for(u=R&~u;0<u;){var pe=31-ht(u),Se=1<<pe;D[pe]=0,H[pe]=-1;var ue=ee[pe];if(ue!==null)for(ee[pe]=null,pe=0;pe<ue.length;pe++){var he=ue[pe];he!==null&&(he.lane&=-536870913)}u&=~Se}h!==0&&Ue(a,h,0),y!==0&&p===0&&a.tag!==0&&(a.suspendedLanes|=y&~(R&~o))}function Ue(a,o,u){a.pendingLanes|=o,a.suspendedLanes&=~o;var h=31-ht(o);a.entangledLanes|=o,a.entanglements[h]=a.entanglements[h]|1073741824|u&4194218}function Oe(a,o){var u=a.entangledLanes|=o;for(a=a.entanglements;u;){var h=31-ht(u),p=1<<h;p&o|a[h]&o&&(a[h]|=o),u&=~p}}function je(a){return a&=-a,2<a?8<a?a&134217727?32:268435456:8:2}function Ye(){var a=q.p;return a!==0?a:(a=window.event,a===void 0?32:Gw(a.type))}function We(a,o){var u=q.p;try{return q.p=a,o()}finally{q.p=u}}var Qe=Math.random().toString(36).slice(2),bt="__reactFiber$"+Qe,_t="__reactProps$"+Qe,Zt="__reactContainer$"+Qe,Yt="__reactEvents$"+Qe,vn="__reactListeners$"+Qe,On="__reactHandles$"+Qe,_n="__reactResources$"+Qe,Zn="__reactMarker$"+Qe;function un(a){delete a[bt],delete a[_t],delete a[Yt],delete a[vn],delete a[On]}function rn(a){var o=a[bt];if(o)return o;for(var u=a.parentNode;u;){if(o=u[Zt]||u[bt]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(a=Bw(a);a!==null;){if(u=a[bt])return u;a=Bw(a)}return o}a=u,u=a.parentNode}return null}function Ce(a){if(a=a[bt]||a[Zt]){var o=a.tag;if(o===5||o===6||o===13||o===26||o===27||o===3)return a}return null}function Le(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(r(33))}function De(a){var o=a[_n];return o||(o=a[_n]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function be(a){a[Zn]=!0}var ut=new Set,zt={};function Ot(a,o){In(a,o),In(a+"Capture",o)}function In(a,o){for(zt[a]=o,a=0;a<o.length;a++)ut.add(o[a])}var tn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vn=RegExp("^[: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]*$"),Pn={},Bn={};function Nr(a){return Be.call(Bn,a)?!0:Be.call(Pn,a)?!1:Vn.test(a)?Bn[a]=!0:(Pn[a]=!0,!1)}function er(a,o,u){if(Nr(o))if(u===null)a.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var h=o.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+u)}}function Un(a,o,u){if(u===null)a.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttribute(o,""+u)}}function Tn(a,o,u,h){if(h===null)a.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(o,u,""+h)}}function Qn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Di(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Wr(a){var o=Di(a)?"checked":"value",u=Object.getOwnPropertyDescriptor(a.constructor.prototype,o),h=""+a[o];if(!a.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,y=u.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return p.call(this)},set:function(R){h=""+R,y.call(this,R)}}),Object.defineProperty(a,o,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(R){h=""+R},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function Fi(a){a._valueTracker||(a._valueTracker=Wr(a))}function ki(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var u=o.getValue(),h="";return a&&(h=Di(a)?a.checked?"true":"false":a.value),a=h,a!==u?(o.setValue(a),!0):!1}function Tt(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var yt=/[\n"\\]/g;function nn(a){return a.replace(yt,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Hn(a,o,u,h,p,y,R,D){a.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?a.type=R:a.removeAttribute("type"),o!=null?R==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+Qn(o)):a.value!==""+Qn(o)&&(a.value=""+Qn(o)):R!=="submit"&&R!=="reset"||a.removeAttribute("value"),o!=null?Nn(a,R,Qn(o)):u!=null?Nn(a,R,Qn(u)):h!=null&&a.removeAttribute("value"),p==null&&y!=null&&(a.defaultChecked=!!y),p!=null&&(a.checked=p&&typeof p!="function"&&typeof p!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?a.name=""+Qn(D):a.removeAttribute("name")}function An(a,o,u,h,p,y,R,D){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(a.type=y),o!=null||u!=null){if(!(y!=="submit"&&y!=="reset"||o!=null))return;u=u!=null?""+Qn(u):"",o=o!=null?""+Qn(o):u,D||o===a.value||(a.value=o),a.defaultValue=o}h=h??p,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=D?a.checked:!!h,a.defaultChecked=!!h,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(a.name=R)}function Nn(a,o,u){o==="number"&&Tt(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function tr(a,o,u,h){if(a=a.options,o){o={};for(var p=0;p<u.length;p++)o["$"+u[p]]=!0;for(u=0;u<a.length;u++)p=o.hasOwnProperty("$"+a[u].value),a[u].selected!==p&&(a[u].selected=p),p&&h&&(a[u].defaultSelected=!0)}else{for(u=""+Qn(u),o=null,p=0;p<a.length;p++){if(a[p].value===u){a[p].selected=!0,h&&(a[p].defaultSelected=!0);return}o!==null||a[p].disabled||(o=a[p])}o!==null&&(o.selected=!0)}}function Sr(a,o,u){if(o!=null&&(o=""+Qn(o),o!==a.value&&(a.value=o),u==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=u!=null?""+Qn(u):""}function Lr(a,o,u,h){if(o==null){if(h!=null){if(u!=null)throw Error(r(92));if(se(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),o=u}u=Qn(o),a.defaultValue=u,h=a.textContent,h===u&&h!==""&&h!==null&&(a.value=h)}function wr(a,o){if(o){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=o;return}}a.textContent=o}var Gr=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Jr(a,o,u){var h=o.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?a.setProperty(o,""):o==="float"?a.cssFloat="":a[o]="":h?a.setProperty(o,u):typeof u!="number"||u===0||Gr.has(o)?o==="float"?a.cssFloat=u:a[o]=(""+u).trim():a[o]=u+"px"}function pr(a,o,u){if(o!=null&&typeof o!="object")throw Error(r(62));if(a=a.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||o!=null&&o.hasOwnProperty(h)||(h.indexOf("--")===0?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="");for(var p in o)h=o[p],o.hasOwnProperty(p)&&u[p]!==h&&Jr(a,p,h)}else for(var y in o)o.hasOwnProperty(y)&&Jr(a,y,o[y])}function Ha(a){if(a.indexOf("-")===-1)return!1;switch(a){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 Xr=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),nl=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Bi(a){return nl.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}var di=null;function hi(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var gi=null,Ui=null;function rl(a){var o=Ce(a);if(o&&(a=o.stateNode)){var u=a[_t]||null;e:switch(a=o.stateNode,o.type){case"input":if(Hn(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),o=u.name,u.type==="radio"&&o!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+nn(""+o)+'"][type="radio"]'),o=0;o<u.length;o++){var h=u[o];if(h!==a&&h.form===a.form){var p=h[_t]||null;if(!p)throw Error(r(90));Hn(h,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(o=0;o<u.length;o++)h=u[o],h.form===a.form&&ki(h)}break e;case"textarea":Sr(a,u.value,u.defaultValue);break e;case"select":o=u.value,o!=null&&tr(a,!!u.multiple,o,!1)}}}var ja=!1;function il(a,o,u){if(ja)return a(o,u);ja=!0;try{var h=a(o);return h}finally{if(ja=!1,(gi!==null||Ui!==null)&&(Ld(),gi&&(o=gi,a=Ui,Ui=gi=null,rl(o),a)))for(o=0;o<a.length;o++)rl(a[o])}}function $e(a,o){var u=a.stateNode;if(u===null)return null;var h=u[_t]||null;if(h===null)return null;u=h[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(a=a.type,h=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!h;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(r(231,o,typeof u));return u}var gt=!1;if(tn)try{var sn={};Object.defineProperty(sn,"passive",{get:function(){gt=!0}}),window.addEventListener("test",sn,sn),window.removeEventListener("test",sn,sn)}catch{gt=!1}var fn=null,Cn=null,Ts=null;function sl(){if(Ts)return Ts;var a,o=Cn,u=o.length,h,p="value"in fn?fn.value:fn.textContent,y=p.length;for(a=0;a<u&&o[a]===p[a];a++);var R=u-a;for(h=1;h<=R&&o[u-h]===p[y-h];h++);return Ts=p.slice(a,1<h?1-h:void 0)}function Wa(a){var o=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&o===13&&(a=13)):a=o,a===10&&(a=13),32<=a||a===13?a:0}function As(){return!0}function Xb(){return!1}function qr(a){function o(u,h,p,y,R){this._reactName=u,this._targetInst=p,this.type=h,this.nativeEvent=y,this.target=R,this.currentTarget=null;for(var D in a)a.hasOwnProperty(D)&&(u=a[D],this[D]=u?u(y):y[D]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?As:Xb,this.isPropagationStopped=Xb,this}return V(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=As)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=As)},persist:function(){},isPersistent:As}),o}var Xa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ad=qr(Xa),Kc=V({},Xa,{view:0,detail:0}),xP=qr(Kc),Rp,xp,Zc,od=V({},Kc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Op,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Zc&&(Zc&&a.type==="mousemove"?(Rp=a.screenX-Zc.screenX,xp=a.screenY-Zc.screenY):xp=Rp=0,Zc=a),Rp)},movementY:function(a){return"movementY"in a?a.movementY:xp}}),qb=qr(od),MP=V({},od,{dataTransfer:0}),OP=qr(MP),PP=V({},Kc,{relatedTarget:0}),Mp=qr(PP),NP=V({},Xa,{animationName:0,elapsedTime:0,pseudoElement:0}),IP=qr(NP),DP=V({},Xa,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),FP=qr(DP),kP=V({},Xa,{data:0}),Yb=qr(kP),BP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},UP={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"},LP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zP(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=LP[a])?!!o[a]:!1}function Op(){return zP}var $P=V({},Kc,{key:function(a){if(a.key){var o=BP[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=Wa(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?UP[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Op,charCode:function(a){return a.type==="keypress"?Wa(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Wa(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),VP=qr($P),HP=V({},od,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kb=qr(HP),jP=V({},Kc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Op}),WP=qr(jP),XP=V({},Xa,{propertyName:0,elapsedTime:0,pseudoElement:0}),qP=qr(XP),YP=V({},od,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),KP=qr(YP),ZP=V({},Xa,{newState:0,oldState:0}),QP=qr(ZP),GP=[9,13,27,32],Pp=tn&&"CompositionEvent"in window,Qc=null;tn&&"documentMode"in document&&(Qc=document.documentMode);var JP=tn&&"TextEvent"in window&&!Qc,Zb=tn&&(!Pp||Qc&&8<Qc&&11>=Qc),Qb=" ",Gb=!1;function Jb(a,o){switch(a){case"keyup":return GP.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function e1(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var al=!1;function eN(a,o){switch(a){case"compositionend":return e1(o);case"keypress":return o.which!==32?null:(Gb=!0,Qb);case"textInput":return a=o.data,a===Qb&&Gb?null:a;default:return null}}function tN(a,o){if(al)return a==="compositionend"||!Pp&&Jb(a,o)?(a=sl(),Ts=Cn=fn=null,al=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Zb&&o.locale!=="ko"?null:o.data;default:return null}}var nN={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 t1(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!nN[a.type]:o==="textarea"}function n1(a,o,u,h){gi?Ui?Ui.push(h):Ui=[h]:gi=h,o=jd(o,"onChange"),0<o.length&&(u=new ad("onChange","change",null,u,h),a.push({event:u,listeners:o}))}var Gc=null,Jc=null;function rN(a){xw(a,0)}function ld(a){var o=Le(a);if(ki(o))return a}function r1(a,o){if(a==="change")return o}var i1=!1;if(tn){var Np;if(tn){var Ip="oninput"in document;if(!Ip){var s1=document.createElement("div");s1.setAttribute("oninput","return;"),Ip=typeof s1.oninput=="function"}Np=Ip}else Np=!1;i1=Np&&(!document.documentMode||9<document.documentMode)}function a1(){Gc&&(Gc.detachEvent("onpropertychange",o1),Jc=Gc=null)}function o1(a){if(a.propertyName==="value"&&ld(Jc)){var o=[];n1(o,Jc,a,hi(a)),il(rN,o)}}function iN(a,o,u){a==="focusin"?(a1(),Gc=o,Jc=u,Gc.attachEvent("onpropertychange",o1)):a==="focusout"&&a1()}function sN(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return ld(Jc)}function aN(a,o){if(a==="click")return ld(o)}function oN(a,o){if(a==="input"||a==="change")return ld(o)}function lN(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var ei=typeof Object.is=="function"?Object.is:lN;function eu(a,o){if(ei(a,o))return!0;if(typeof a!="object"||a===null||typeof o!="object"||o===null)return!1;var u=Object.keys(a),h=Object.keys(o);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var p=u[h];if(!Be.call(o,p)||!ei(a[p],o[p]))return!1}return!0}function l1(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function c1(a,o){var u=l1(a);a=0;for(var h;u;){if(u.nodeType===3){if(h=a+u.textContent.length,a<=o&&h>=o)return{node:u,offset:o-a};a=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=l1(u)}}function u1(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?u1(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function f1(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Tt(a.document);o instanceof a.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)a=o.contentWindow;else break;o=Tt(a.document)}return o}function Dp(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}function cN(a,o){var u=f1(o);o=a.focusedElem;var h=a.selectionRange;if(u!==o&&o&&o.ownerDocument&&u1(o.ownerDocument.documentElement,o)){if(h!==null&&Dp(o)){if(a=h.start,u=h.end,u===void 0&&(u=a),"selectionStart"in o)o.selectionStart=a,o.selectionEnd=Math.min(u,o.value.length);else if(u=(a=o.ownerDocument||document)&&a.defaultView||window,u.getSelection){u=u.getSelection();var p=o.textContent.length,y=Math.min(h.start,p);h=h.end===void 0?y:Math.min(h.end,p),!u.extend&&y>h&&(p=h,h=y,y=p),p=c1(o,y);var R=c1(o,h);p&&R&&(u.rangeCount!==1||u.anchorNode!==p.node||u.anchorOffset!==p.offset||u.focusNode!==R.node||u.focusOffset!==R.offset)&&(a=a.createRange(),a.setStart(p.node,p.offset),u.removeAllRanges(),y>h?(u.addRange(a),u.extend(R.node,R.offset)):(a.setEnd(R.node,R.offset),u.addRange(a)))}}for(a=[],u=o;u=u.parentNode;)u.nodeType===1&&a.push({element:u,left:u.scrollLeft,top:u.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<a.length;o++)u=a[o],u.element.scrollLeft=u.left,u.element.scrollTop=u.top}}var uN=tn&&"documentMode"in document&&11>=document.documentMode,ol=null,Fp=null,tu=null,kp=!1;function d1(a,o,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;kp||ol==null||ol!==Tt(h)||(h=ol,"selectionStart"in h&&Dp(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),tu&&eu(tu,h)||(tu=h,h=jd(Fp,"onSelect"),0<h.length&&(o=new ad("onSelect","select",null,o,u),a.push({event:o,listeners:h}),o.target=ol)))}function qa(a,o){var u={};return u[a.toLowerCase()]=o.toLowerCase(),u["Webkit"+a]="webkit"+o,u["Moz"+a]="moz"+o,u}var ll={animationend:qa("Animation","AnimationEnd"),animationiteration:qa("Animation","AnimationIteration"),animationstart:qa("Animation","AnimationStart"),transitionrun:qa("Transition","TransitionRun"),transitionstart:qa("Transition","TransitionStart"),transitioncancel:qa("Transition","TransitionCancel"),transitionend:qa("Transition","TransitionEnd")},Bp={},h1={};tn&&(h1=document.createElement("div").style,"AnimationEvent"in window||(delete ll.animationend.animation,delete ll.animationiteration.animation,delete ll.animationstart.animation),"TransitionEvent"in window||delete ll.transitionend.transition);function Ya(a){if(Bp[a])return Bp[a];if(!ll[a])return a;var o=ll[a],u;for(u in o)if(o.hasOwnProperty(u)&&u in h1)return Bp[a]=o[u];return a}var g1=Ya("animationend"),p1=Ya("animationiteration"),m1=Ya("animationstart"),fN=Ya("transitionrun"),dN=Ya("transitionstart"),hN=Ya("transitioncancel"),v1=Ya("transitionend"),_1=new Map,y1="abort auxClick beforeToggle 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 scrollEnd toggle touchMove waiting wheel".split(" ");function Li(a,o){_1.set(a,o),Ot(o,[a])}var pi=[],cl=0,Up=0;function cd(){for(var a=cl,o=Up=cl=0;o<a;){var u=pi[o];pi[o++]=null;var h=pi[o];pi[o++]=null;var p=pi[o];pi[o++]=null;var y=pi[o];if(pi[o++]=null,h!==null&&p!==null){var R=h.pending;R===null?p.next=p:(p.next=R.next,R.next=p),h.pending=p}y!==0&&b1(u,p,y)}}function ud(a,o,u,h){pi[cl++]=a,pi[cl++]=o,pi[cl++]=u,pi[cl++]=h,Up|=h,a.lanes|=h,a=a.alternate,a!==null&&(a.lanes|=h)}function Lp(a,o,u,h){return ud(a,o,u,h),fd(a)}function Zs(a,o){return ud(a,null,null,o),fd(a)}function b1(a,o,u){a.lanes|=u;var h=a.alternate;h!==null&&(h.lanes|=u);for(var p=!1,y=a.return;y!==null;)y.childLanes|=u,h=y.alternate,h!==null&&(h.childLanes|=u),y.tag===22&&(a=y.stateNode,a===null||a._visibility&1||(p=!0)),a=y,y=y.return;p&&o!==null&&a.tag===3&&(y=a.stateNode,p=31-ht(u),y=y.hiddenUpdates,a=y[p],a===null?y[p]=[o]:a.push(o),o.lane=u|536870912)}function fd(a){if(50<Cu)throw Cu=0,Wm=null,Error(r(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var ul={},S1=new WeakMap;function mi(a,o){if(typeof a=="object"&&a!==null){var u=S1.get(a);return u!==void 0?u:(o={value:a,source:o,stack:z(o)},S1.set(a,o),o)}return{value:a,source:o,stack:z(o)}}var fl=[],dl=0,dd=null,hd=0,vi=[],_i=0,Ka=null,Cs=1,Rs="";function Za(a,o){fl[dl++]=hd,fl[dl++]=dd,dd=a,hd=o}function w1(a,o,u){vi[_i++]=Cs,vi[_i++]=Rs,vi[_i++]=Ka,Ka=a;var h=Cs;a=Rs;var p=32-ht(h)-1;h&=~(1<<p),u+=1;var y=32-ht(o)+p;if(30<y){var R=p-p%5;y=(h&(1<<R)-1).toString(32),h>>=R,p-=R,Cs=1<<32-ht(o)+p|u<<p|h,Rs=y+a}else Cs=1<<y|u<<p|h,Rs=a}function zp(a){a.return!==null&&(Za(a,1),w1(a,1,0))}function $p(a){for(;a===dd;)dd=fl[--dl],fl[dl]=null,hd=fl[--dl],fl[dl]=null;for(;a===Ka;)Ka=vi[--_i],vi[_i]=null,Rs=vi[--_i],vi[_i]=null,Cs=vi[--_i],vi[_i]=null}var zr=null,Er=null,Qt=!1,zi=null,rs=!1,Vp=Error(r(519));function Qa(a){var o=Error(r(418,""));throw iu(mi(o,a)),Vp}function E1(a){var o=a.stateNode,u=a.type,h=a.memoizedProps;switch(o[bt]=a,o[_t]=h,u){case"dialog":jt("cancel",o),jt("close",o);break;case"iframe":case"object":case"embed":jt("load",o);break;case"video":case"audio":for(u=0;u<xu.length;u++)jt(xu[u],o);break;case"source":jt("error",o);break;case"img":case"image":case"link":jt("error",o),jt("load",o);break;case"details":jt("toggle",o);break;case"input":jt("invalid",o),An(o,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0),Fi(o);break;case"select":jt("invalid",o);break;case"textarea":jt("invalid",o),Lr(o,h.value,h.defaultValue,h.children),Fi(o)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||o.textContent===""+u||h.suppressHydrationWarning===!0||Nw(o.textContent,u)?(h.popover!=null&&(jt("beforetoggle",o),jt("toggle",o)),h.onScroll!=null&&jt("scroll",o),h.onScrollEnd!=null&&jt("scrollend",o),h.onClick!=null&&(o.onclick=Wd),o=!0):o=!1,o||Qa(a)}function T1(a){for(zr=a.return;zr;)switch(zr.tag){case 3:case 27:rs=!0;return;case 5:case 13:rs=!1;return;default:zr=zr.return}}function nu(a){if(a!==zr)return!1;if(!Qt)return T1(a),Qt=!0,!1;var o=!1,u;if((u=a.tag!==3&&a.tag!==27)&&((u=a.tag===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||lv(a.type,a.memoizedProps)),u=!u),u&&(o=!0),o&&Er&&Qa(a),T1(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));e:{for(a=a.nextSibling,o=0;a;){if(a.nodeType===8)if(u=a.data,u==="/$"){if(o===0){Er=Vi(a.nextSibling);break e}o--}else u!=="$"&&u!=="$!"&&u!=="$?"||o++;a=a.nextSibling}Er=null}}else Er=zr?Vi(a.stateNode.nextSibling):null;return!0}function ru(){Er=zr=null,Qt=!1}function iu(a){zi===null?zi=[a]:zi.push(a)}var su=Error(r(460)),A1=Error(r(474)),Hp={then:function(){}};function C1(a){return a=a.status,a==="fulfilled"||a==="rejected"}function gd(){}function R1(a,o,u){switch(u=a[u],u===void 0?a.push(o):u!==o&&(o.then(gd,gd),o=u),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,a===su?Error(r(483)):a;default:if(typeof o.status=="string")o.then(gd,gd);else{if(a=Rn,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=o,a.status="pending",a.then(function(h){if(o.status==="pending"){var p=o;p.status="fulfilled",p.value=h}},function(h){if(o.status==="pending"){var p=o;p.status="rejected",p.reason=h}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,a===su?Error(r(483)):a}throw au=o,su}}var au=null;function x1(){if(au===null)throw Error(r(459));var a=au;return au=null,a}var hl=null,ou=0;function pd(a){var o=ou;return ou+=1,hl===null&&(hl=[]),R1(hl,a,o)}function lu(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function md(a,o){throw o.$$typeof===s?Error(r(525)):(a=Object.prototype.toString.call(o),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function M1(a){var o=a._init;return o(a._payload)}function O1(a){function o(re,Q){if(a){var le=re.deletions;le===null?(re.deletions=[Q],re.flags|=16):le.push(Q)}}function u(re,Q){if(!a)return null;for(;Q!==null;)o(re,Q),Q=Q.sibling;return null}function h(re){for(var Q=new Map;re!==null;)re.key!==null?Q.set(re.key,re):Q.set(re.index,re),re=re.sibling;return Q}function p(re,Q){return re=la(re,Q),re.index=0,re.sibling=null,re}function y(re,Q,le){return re.index=le,a?(le=re.alternate,le!==null?(le=le.index,le<Q?(re.flags|=33554434,Q):le):(re.flags|=33554434,Q)):(re.flags|=1048576,Q)}function R(re){return a&&re.alternate===null&&(re.flags|=33554434),re}function D(re,Q,le,me){return Q===null||Q.tag!==6?(Q=Bm(le,re.mode,me),Q.return=re,Q):(Q=p(Q,le),Q.return=re,Q)}function H(re,Q,le,me){var Ke=le.type;return Ke===f?pe(re,Q,le.props.children,me,le.key):Q!==null&&(Q.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===T&&M1(Ke)===Q.type)?(Q=p(Q,le.props),lu(Q,le),Q.return=re,Q):(Q=Dd(le.type,le.key,le.props,null,re.mode,me),lu(Q,le),Q.return=re,Q)}function ee(re,Q,le,me){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==le.containerInfo||Q.stateNode.implementation!==le.implementation?(Q=Um(le,re.mode,me),Q.return=re,Q):(Q=p(Q,le.children||[]),Q.return=re,Q)}function pe(re,Q,le,me,Ke){return Q===null||Q.tag!==7?(Q=oo(le,re.mode,me,Ke),Q.return=re,Q):(Q=p(Q,le),Q.return=re,Q)}function Se(re,Q,le){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=Bm(""+Q,re.mode,le),Q.return=re,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case l:return le=Dd(Q.type,Q.key,Q.props,null,re.mode,le),lu(le,Q),le.return=re,le;case c:return Q=Um(Q,re.mode,le),Q.return=re,Q;case T:var me=Q._init;return Q=me(Q._payload),Se(re,Q,le)}if(se(Q)||N(Q))return Q=oo(Q,re.mode,le,null),Q.return=re,Q;if(typeof Q.then=="function")return Se(re,pd(Q),le);if(Q.$$typeof===S)return Se(re,Pd(re,Q),le);md(re,Q)}return null}function ue(re,Q,le,me){var Ke=Q!==null?Q.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Ke!==null?null:D(re,Q,""+le,me);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case l:return le.key===Ke?H(re,Q,le,me):null;case c:return le.key===Ke?ee(re,Q,le,me):null;case T:return Ke=le._init,le=Ke(le._payload),ue(re,Q,le,me)}if(se(le)||N(le))return Ke!==null?null:pe(re,Q,le,me,null);if(typeof le.then=="function")return ue(re,Q,pd(le),me);if(le.$$typeof===S)return ue(re,Q,Pd(re,le),me);md(re,le)}return null}function he(re,Q,le,me,Ke){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return re=re.get(le)||null,D(Q,re,""+me,Ke);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case l:return re=re.get(me.key===null?le:me.key)||null,H(Q,re,me,Ke);case c:return re=re.get(me.key===null?le:me.key)||null,ee(Q,re,me,Ke);case T:var Dt=me._init;return me=Dt(me._payload),he(re,Q,le,me,Ke)}if(se(me)||N(me))return re=re.get(le)||null,pe(Q,re,me,Ke,null);if(typeof me.then=="function")return he(re,Q,le,pd(me),Ke);if(me.$$typeof===S)return he(re,Q,le,Pd(Q,me),Ke);md(Q,me)}return null}function tt(re,Q,le,me){for(var Ke=null,Dt=null,ot=Q,vt=Q=0,_r=null;ot!==null&&vt<le.length;vt++){ot.index>vt?(_r=ot,ot=null):_r=ot.sibling;var Gt=ue(re,ot,le[vt],me);if(Gt===null){ot===null&&(ot=_r);break}a&&ot&&Gt.alternate===null&&o(re,ot),Q=y(Gt,Q,vt),Dt===null?Ke=Gt:Dt.sibling=Gt,Dt=Gt,ot=_r}if(vt===le.length)return u(re,ot),Qt&&Za(re,vt),Ke;if(ot===null){for(;vt<le.length;vt++)ot=Se(re,le[vt],me),ot!==null&&(Q=y(ot,Q,vt),Dt===null?Ke=ot:Dt.sibling=ot,Dt=ot);return Qt&&Za(re,vt),Ke}for(ot=h(ot);vt<le.length;vt++)_r=he(ot,re,vt,le[vt],me),_r!==null&&(a&&_r.alternate!==null&&ot.delete(_r.key===null?vt:_r.key),Q=y(_r,Q,vt),Dt===null?Ke=_r:Dt.sibling=_r,Dt=_r);return a&&ot.forEach(function(pa){return o(re,pa)}),Qt&&Za(re,vt),Ke}function Et(re,Q,le,me){if(le==null)throw Error(r(151));for(var Ke=null,Dt=null,ot=Q,vt=Q=0,_r=null,Gt=le.next();ot!==null&&!Gt.done;vt++,Gt=le.next()){ot.index>vt?(_r=ot,ot=null):_r=ot.sibling;var pa=ue(re,ot,Gt.value,me);if(pa===null){ot===null&&(ot=_r);break}a&&ot&&pa.alternate===null&&o(re,ot),Q=y(pa,Q,vt),Dt===null?Ke=pa:Dt.sibling=pa,Dt=pa,ot=_r}if(Gt.done)return u(re,ot),Qt&&Za(re,vt),Ke;if(ot===null){for(;!Gt.done;vt++,Gt=le.next())Gt=Se(re,Gt.value,me),Gt!==null&&(Q=y(Gt,Q,vt),Dt===null?Ke=Gt:Dt.sibling=Gt,Dt=Gt);return Qt&&Za(re,vt),Ke}for(ot=h(ot);!Gt.done;vt++,Gt=le.next())Gt=he(ot,re,vt,Gt.value,me),Gt!==null&&(a&&Gt.alternate!==null&&ot.delete(Gt.key===null?vt:Gt.key),Q=y(Gt,Q,vt),Dt===null?Ke=Gt:Dt.sibling=Gt,Dt=Gt);return a&&ot.forEach(function(RI){return o(re,RI)}),Qt&&Za(re,vt),Ke}function Xn(re,Q,le,me){if(typeof le=="object"&&le!==null&&le.type===f&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case l:e:{for(var Ke=le.key;Q!==null;){if(Q.key===Ke){if(Ke=le.type,Ke===f){if(Q.tag===7){u(re,Q.sibling),me=p(Q,le.props.children),me.return=re,re=me;break e}}else if(Q.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===T&&M1(Ke)===Q.type){u(re,Q.sibling),me=p(Q,le.props),lu(me,le),me.return=re,re=me;break e}u(re,Q);break}else o(re,Q);Q=Q.sibling}le.type===f?(me=oo(le.props.children,re.mode,me,le.key),me.return=re,re=me):(me=Dd(le.type,le.key,le.props,null,re.mode,me),lu(me,le),me.return=re,re=me)}return R(re);case c:e:{for(Ke=le.key;Q!==null;){if(Q.key===Ke)if(Q.tag===4&&Q.stateNode.containerInfo===le.containerInfo&&Q.stateNode.implementation===le.implementation){u(re,Q.sibling),me=p(Q,le.children||[]),me.return=re,re=me;break e}else{u(re,Q);break}else o(re,Q);Q=Q.sibling}me=Um(le,re.mode,me),me.return=re,re=me}return R(re);case T:return Ke=le._init,le=Ke(le._payload),Xn(re,Q,le,me)}if(se(le))return tt(re,Q,le,me);if(N(le)){if(Ke=N(le),typeof Ke!="function")throw Error(r(150));return le=Ke.call(le),Et(re,Q,le,me)}if(typeof le.then=="function")return Xn(re,Q,pd(le),me);if(le.$$typeof===S)return Xn(re,Q,Pd(re,le),me);md(re,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,Q!==null&&Q.tag===6?(u(re,Q.sibling),me=p(Q,le),me.return=re,re=me):(u(re,Q),me=Bm(le,re.mode,me),me.return=re,re=me),R(re)):u(re,Q)}return function(re,Q,le,me){try{ou=0;var Ke=Xn(re,Q,le,me);return hl=null,Ke}catch(ot){if(ot===su)throw ot;var Dt=wi(29,ot,null,re.mode);return Dt.lanes=me,Dt.return=re,Dt}finally{}}}var Ga=O1(!0),P1=O1(!1),gl=we(null),vd=we(0);function N1(a,o){a=Us,Te(vd,a),Te(gl,o),Us=a|o.baseLanes}function jp(){Te(vd,Us),Te(gl,gl.current)}function Wp(){Us=vd.current,Ae(gl),Ae(vd)}var yi=we(null),is=null;function Qs(a){var o=a.alternate;Te(cr,cr.current&1),Te(yi,a),is===null&&(o===null||gl.current!==null||o.memoizedState!==null)&&(is=a)}function I1(a){if(a.tag===22){if(Te(cr,cr.current),Te(yi,a),is===null){var o=a.alternate;o!==null&&o.memoizedState!==null&&(is=a)}}else Gs()}function Gs(){Te(cr,cr.current),Te(yi,yi.current)}function xs(a){Ae(yi),is===a&&(is=null),Ae(cr)}var cr=we(0);function _d(a){for(var o=a;o!==null;){if(o.tag===13){var u=o.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if(o.flags&128)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var gN=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(u,h){a.push(h)}};this.abort=function(){o.aborted=!0,a.forEach(function(u){return u()})}},pN=t.unstable_scheduleCallback,mN=t.unstable_NormalPriority,ur={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xp(){return{controller:new gN,data:new Map,refCount:0}}function cu(a){a.refCount--,a.refCount===0&&pN(mN,function(){a.controller.abort()})}var uu=null,qp=0,pl=0,ml=null;function vN(a,o){if(uu===null){var u=uu=[];qp=0,pl=Jm(),ml={status:"pending",value:void 0,then:function(h){u.push(h)}}}return qp++,o.then(D1,D1),o}function D1(){if(--qp===0&&uu!==null){ml!==null&&(ml.status="fulfilled");var a=uu;uu=null,pl=0,ml=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function _N(a,o){var u=[],h={status:"pending",value:null,reason:null,then:function(p){u.push(p)}};return a.then(function(){h.status="fulfilled",h.value=o;for(var p=0;p<u.length;p++)(0,u[p])(o)},function(p){for(h.status="rejected",h.reason=p,p=0;p<u.length;p++)(0,u[p])(void 0)}),h}var F1=I.S;I.S=function(a,o){typeof o=="object"&&o!==null&&typeof o.then=="function"&&vN(a,o),F1!==null&&F1(a,o)};var Ja=we(null);function Yp(){var a=Ja.current;return a!==null?a:Rn.pooledCache}function yd(a,o){o===null?Te(Ja,Ja.current):Te(Ja,o.pool)}function k1(){var a=Yp();return a===null?null:{parent:ur._currentValue,pool:a}}var Js=0,Pt=null,dn=null,nr=null,bd=!1,vl=!1,eo=!1,Sd=0,fu=0,_l=null,yN=0;function Gn(){throw Error(r(321))}function Kp(a,o){if(o===null)return!1;for(var u=0;u<o.length&&u<a.length;u++)if(!ei(a[u],o[u]))return!1;return!0}function Zp(a,o,u,h,p,y){return Js=y,Pt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,I.H=a===null||a.memoizedState===null?to:ea,eo=!1,y=u(h,p),eo=!1,vl&&(y=U1(o,u,h,p)),B1(a),y}function B1(a){I.H=ss;var o=dn!==null&&dn.next!==null;if(Js=0,nr=dn=Pt=null,bd=!1,fu=0,_l=null,o)throw Error(r(300));a===null||mr||(a=a.dependencies,a!==null&&Od(a)&&(mr=!0))}function U1(a,o,u,h){Pt=a;var p=0;do{if(vl&&(_l=null),fu=0,vl=!1,25<=p)throw Error(r(301));if(p+=1,nr=dn=null,a.updateQueue!=null){var y=a.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}I.H=no,y=o(u,h)}while(vl);return y}function bN(){var a=I.H,o=a.useState()[0];return o=typeof o.then=="function"?du(o):o,a=a.useState()[0],(dn!==null?dn.memoizedState:null)!==a&&(Pt.flags|=1024),o}function Qp(){var a=Sd!==0;return Sd=0,a}function Gp(a,o,u){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~u}function Jp(a){if(bd){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}bd=!1}Js=0,nr=dn=Pt=null,vl=!1,fu=Sd=0,_l=null}function Yr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nr===null?Pt.memoizedState=nr=a:nr=nr.next=a,nr}function rr(){if(dn===null){var a=Pt.alternate;a=a!==null?a.memoizedState:null}else a=dn.next;var o=nr===null?Pt.memoizedState:nr.next;if(o!==null)nr=o,dn=a;else{if(a===null)throw Pt.alternate===null?Error(r(467)):Error(r(310));dn=a,a={memoizedState:dn.memoizedState,baseState:dn.baseState,baseQueue:dn.baseQueue,queue:dn.queue,next:null},nr===null?Pt.memoizedState=nr=a:nr=nr.next=a}return nr}var wd;wd=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}};function du(a){var o=fu;return fu+=1,_l===null&&(_l=[]),a=R1(_l,a,o),o=Pt,(nr===null?o.memoizedState:nr.next)===null&&(o=o.alternate,I.H=o===null||o.memoizedState===null?to:ea),a}function Ed(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return du(a);if(a.$$typeof===S)return Ir(a)}throw Error(r(438,String(a)))}function em(a){var o=null,u=Pt.updateQueue;if(u!==null&&(o=u.memoCache),o==null){var h=Pt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(o={data:h.data.map(function(p){return p.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),u===null&&(u=wd(),Pt.updateQueue=u),u.memoCache=o,u=o.data[o.index],u===void 0)for(u=o.data[o.index]=Array(a),h=0;h<a;h++)u[h]=M;return o.index++,u}function Ms(a,o){return typeof o=="function"?o(a):o}function Td(a){var o=rr();return tm(o,dn,a)}function tm(a,o,u){var h=a.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var p=a.baseQueue,y=h.pending;if(y!==null){if(p!==null){var R=p.next;p.next=y.next,y.next=R}o.baseQueue=p=y,h.pending=null}if(y=a.baseState,p===null)a.memoizedState=y;else{o=p.next;var D=R=null,H=null,ee=o,pe=!1;do{var Se=ee.lane&-536870913;if(Se!==ee.lane?(Kt&Se)===Se:(Js&Se)===Se){var ue=ee.revertLane;if(ue===0)H!==null&&(H=H.next={lane:0,revertLane:0,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),Se===pl&&(pe=!0);else if((Js&ue)===ue){ee=ee.next,ue===pl&&(pe=!0);continue}else Se={lane:0,revertLane:ee.revertLane,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},H===null?(D=H=Se,R=y):H=H.next=Se,Pt.lanes|=ue,ca|=ue;Se=ee.action,eo&&u(y,Se),y=ee.hasEagerState?ee.eagerState:u(y,Se)}else ue={lane:Se,revertLane:ee.revertLane,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},H===null?(D=H=ue,R=y):H=H.next=ue,Pt.lanes|=Se,ca|=Se;ee=ee.next}while(ee!==null&&ee!==o);if(H===null?R=y:H.next=D,!ei(y,a.memoizedState)&&(mr=!0,pe&&(u=ml,u!==null)))throw u;a.memoizedState=y,a.baseState=R,a.baseQueue=H,h.lastRenderedState=y}return p===null&&(h.lanes=0),[a.memoizedState,h.dispatch]}function nm(a){var o=rr(),u=o.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var h=u.dispatch,p=u.pending,y=o.memoizedState;if(p!==null){u.pending=null;var R=p=p.next;do y=a(y,R.action),R=R.next;while(R!==p);ei(y,o.memoizedState)||(mr=!0),o.memoizedState=y,o.baseQueue===null&&(o.baseState=y),u.lastRenderedState=y}return[y,h]}function L1(a,o,u){var h=Pt,p=rr(),y=Qt;if(y){if(u===void 0)throw Error(r(407));u=u()}else u=o();var R=!ei((dn||p).memoizedState,u);if(R&&(p.memoizedState=u,mr=!0),p=p.queue,sm(V1.bind(null,h,p,a),[a]),p.getSnapshot!==o||R||nr!==null&&nr.memoizedState.tag&1){if(h.flags|=2048,yl(9,$1.bind(null,h,p,u,o),{destroy:void 0},null),Rn===null)throw Error(r(349));y||Js&60||z1(h,o,u)}return u}function z1(a,o,u){a.flags|=16384,a={getSnapshot:o,value:u},o=Pt.updateQueue,o===null?(o=wd(),Pt.updateQueue=o,o.stores=[a]):(u=o.stores,u===null?o.stores=[a]:u.push(a))}function $1(a,o,u,h){o.value=u,o.getSnapshot=h,H1(o)&&j1(a)}function V1(a,o,u){return u(function(){H1(o)&&j1(a)})}function H1(a){var o=a.getSnapshot;a=a.value;try{var u=o();return!ei(a,u)}catch{return!0}}function j1(a){var o=Zs(a,2);o!==null&&$r(o,a,2)}function rm(a){var o=Yr();if(typeof a=="function"){var u=a;if(a=u(),eo){Bt(!0);try{u()}finally{Bt(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:a},o}function W1(a,o,u,h){return a.baseState=u,tm(a,dn,typeof h=="function"?h:Ms)}function SN(a,o,u,h,p){if(Rd(a))throw Error(r(485));if(a=o.action,a!==null){var y={payload:p,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){y.listeners.push(R)}};I.T!==null?u(!0):y.isTransition=!1,h(y),u=o.pending,u===null?(y.next=o.pending=y,X1(o,y)):(y.next=u.next,o.pending=u.next=y)}}function X1(a,o){var u=o.action,h=o.payload,p=a.state;if(o.isTransition){var y=I.T,R={};I.T=R;try{var D=u(p,h),H=I.S;H!==null&&H(R,D),q1(a,o,D)}catch(ee){im(a,o,ee)}finally{I.T=y}}else try{y=u(p,h),q1(a,o,y)}catch(ee){im(a,o,ee)}}function q1(a,o,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){Y1(a,o,h)},function(h){return im(a,o,h)}):Y1(a,o,u)}function Y1(a,o,u){o.status="fulfilled",o.value=u,K1(o),a.state=u,o=a.pending,o!==null&&(u=o.next,u===o?a.pending=null:(u=u.next,o.next=u,X1(a,u)))}function im(a,o,u){var h=a.pending;if(a.pending=null,h!==null){h=h.next;do o.status="rejected",o.reason=u,K1(o),o=o.next;while(o!==h)}a.action=null}function K1(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function Z1(a,o){return o}function Q1(a,o){if(Qt){var u=Rn.formState;if(u!==null){e:{var h=Pt;if(Qt){if(Er){t:{for(var p=Er,y=rs;p.nodeType!==8;){if(!y){p=null;break t}if(p=Vi(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){Er=Vi(p.nextSibling),h=p.data==="F!";break e}}Qa(h)}h=!1}h&&(o=u[0])}}return u=Yr(),u.memoizedState=u.baseState=o,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Z1,lastRenderedState:o},u.queue=h,u=pS.bind(null,Pt,h),h.dispatch=u,h=rm(!1),y=um.bind(null,Pt,!1,h.queue),h=Yr(),p={state:o,dispatch:null,action:a,pending:null},h.queue=p,u=SN.bind(null,Pt,p,y,u),p.dispatch=u,h.memoizedState=a,[o,u,!1]}function G1(a){var o=rr();return J1(o,dn,a)}function J1(a,o,u){o=tm(a,o,Z1)[0],a=Td(Ms)[0],o=typeof o=="object"&&o!==null&&typeof o.then=="function"?du(o):o;var h=rr(),p=h.queue,y=p.dispatch;return u!==h.memoizedState&&(Pt.flags|=2048,yl(9,wN.bind(null,p,u),{destroy:void 0},null)),[o,y,a]}function wN(a,o){a.action=o}function eS(a){var o=rr(),u=dn;if(u!==null)return J1(o,u,a);rr(),o=o.memoizedState,u=rr();var h=u.queue.dispatch;return u.memoizedState=a,[o,h,!1]}function yl(a,o,u,h){return a={tag:a,create:o,inst:u,deps:h,next:null},o=Pt.updateQueue,o===null&&(o=wd(),Pt.updateQueue=o),u=o.lastEffect,u===null?o.lastEffect=a.next=a:(h=u.next,u.next=a,a.next=h,o.lastEffect=a),a}function tS(){return rr().memoizedState}function Ad(a,o,u,h){var p=Yr();Pt.flags|=a,p.memoizedState=yl(1|o,u,{destroy:void 0},h===void 0?null:h)}function Cd(a,o,u,h){var p=rr();h=h===void 0?null:h;var y=p.memoizedState.inst;dn!==null&&h!==null&&Kp(h,dn.memoizedState.deps)?p.memoizedState=yl(o,u,y,h):(Pt.flags|=a,p.memoizedState=yl(1|o,u,y,h))}function nS(a,o){Ad(8390656,8,a,o)}function sm(a,o){Cd(2048,8,a,o)}function rS(a,o){return Cd(4,2,a,o)}function iS(a,o){return Cd(4,4,a,o)}function sS(a,o){if(typeof o=="function"){a=a();var u=o(a);return function(){typeof u=="function"?u():o(null)}}if(o!=null)return a=a(),o.current=a,function(){o.current=null}}function aS(a,o,u){u=u!=null?u.concat([a]):null,Cd(4,4,sS.bind(null,o,a),u)}function am(){}function oS(a,o){var u=rr();o=o===void 0?null:o;var h=u.memoizedState;return o!==null&&Kp(o,h[1])?h[0]:(u.memoizedState=[a,o],a)}function lS(a,o){var u=rr();o=o===void 0?null:o;var h=u.memoizedState;if(o!==null&&Kp(o,h[1]))return h[0];if(h=a(),eo){Bt(!0);try{a()}finally{Bt(!1)}}return u.memoizedState=[h,o],h}function om(a,o,u){return u===void 0||Js&1073741824?a.memoizedState=o:(a.memoizedState=u,a=uw(),Pt.lanes|=a,ca|=a,u)}function cS(a,o,u,h){return ei(u,o)?u:gl.current!==null?(a=om(a,u,h),ei(a,o)||(mr=!0),a):Js&42?(a=uw(),Pt.lanes|=a,ca|=a,o):(mr=!0,a.memoizedState=u)}function uS(a,o,u,h,p){var y=q.p;q.p=y!==0&&8>y?y:8;var R=I.T,D={};I.T=D,um(a,!1,o,u);try{var H=p(),ee=I.S;if(ee!==null&&ee(D,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var pe=_N(H,h);hu(a,o,pe,ii(a))}else hu(a,o,h,ii(a))}catch(Se){hu(a,o,{then:function(){},status:"rejected",reason:Se},ii())}finally{q.p=y,I.T=R}}function EN(){}function lm(a,o,u,h){if(a.tag!==5)throw Error(r(476));var p=fS(a).queue;uS(a,p,o,ce,u===null?EN:function(){return dS(a),u(h)})}function fS(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:ce},next:null};var u={};return o.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:u},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function dS(a){var o=fS(a).next.queue;hu(a,o,{},ii())}function cm(){return Ir(Iu)}function hS(){return rr().memoizedState}function gS(){return rr().memoizedState}function TN(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var u=ii();a=ra(u);var h=ia(o,a,u);h!==null&&($r(h,o,u),mu(h,o,u)),o={cache:Xp()},a.payload=o;return}o=o.return}}function AN(a,o,u){var h=ii();u={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null},Rd(a)?mS(o,u):(u=Lp(a,o,u,h),u!==null&&($r(u,a,h),vS(u,o,h)))}function pS(a,o,u){var h=ii();hu(a,o,u,h)}function hu(a,o,u,h){var p={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null};if(Rd(a))mS(o,p);else{var y=a.alternate;if(a.lanes===0&&(y===null||y.lanes===0)&&(y=o.lastRenderedReducer,y!==null))try{var R=o.lastRenderedState,D=y(R,u);if(p.hasEagerState=!0,p.eagerState=D,ei(D,R))return ud(a,o,p,0),Rn===null&&cd(),!1}catch{}finally{}if(u=Lp(a,o,p,h),u!==null)return $r(u,a,h),vS(u,o,h),!0}return!1}function um(a,o,u,h){if(h={lane:2,revertLane:Jm(),action:h,hasEagerState:!1,eagerState:null,next:null},Rd(a)){if(o)throw Error(r(479))}else o=Lp(a,u,h,2),o!==null&&$r(o,a,2)}function Rd(a){var o=a.alternate;return a===Pt||o!==null&&o===Pt}function mS(a,o){vl=bd=!0;var u=a.pending;u===null?o.next=o:(o.next=u.next,u.next=o),a.pending=o}function vS(a,o,u){if(u&4194176){var h=o.lanes;h&=a.pendingLanes,u|=h,o.lanes=u,Oe(a,u)}}var ss={readContext:Ir,use:Ed,useCallback:Gn,useContext:Gn,useEffect:Gn,useImperativeHandle:Gn,useLayoutEffect:Gn,useInsertionEffect:Gn,useMemo:Gn,useReducer:Gn,useRef:Gn,useState:Gn,useDebugValue:Gn,useDeferredValue:Gn,useTransition:Gn,useSyncExternalStore:Gn,useId:Gn};ss.useCacheRefresh=Gn,ss.useMemoCache=Gn,ss.useHostTransitionStatus=Gn,ss.useFormState=Gn,ss.useActionState=Gn,ss.useOptimistic=Gn;var to={readContext:Ir,use:Ed,useCallback:function(a,o){return Yr().memoizedState=[a,o===void 0?null:o],a},useContext:Ir,useEffect:nS,useImperativeHandle:function(a,o,u){u=u!=null?u.concat([a]):null,Ad(4194308,4,sS.bind(null,o,a),u)},useLayoutEffect:function(a,o){return Ad(4194308,4,a,o)},useInsertionEffect:function(a,o){Ad(4,2,a,o)},useMemo:function(a,o){var u=Yr();o=o===void 0?null:o;var h=a();if(eo){Bt(!0);try{a()}finally{Bt(!1)}}return u.memoizedState=[h,o],h},useReducer:function(a,o,u){var h=Yr();if(u!==void 0){var p=u(o);if(eo){Bt(!0);try{u(o)}finally{Bt(!1)}}}else p=o;return h.memoizedState=h.baseState=p,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:p},h.queue=a,a=a.dispatch=AN.bind(null,Pt,a),[h.memoizedState,a]},useRef:function(a){var o=Yr();return a={current:a},o.memoizedState=a},useState:function(a){a=rm(a);var o=a.queue,u=pS.bind(null,Pt,o);return o.dispatch=u,[a.memoizedState,u]},useDebugValue:am,useDeferredValue:function(a,o){var u=Yr();return om(u,a,o)},useTransition:function(){var a=rm(!1);return a=uS.bind(null,Pt,a.queue,!0,!1),Yr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,u){var h=Pt,p=Yr();if(Qt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=o(),Rn===null)throw Error(r(349));Kt&60||z1(h,o,u)}p.memoizedState=u;var y={value:u,getSnapshot:o};return p.queue=y,nS(V1.bind(null,h,y,a),[a]),h.flags|=2048,yl(9,$1.bind(null,h,y,u,o),{destroy:void 0},null),u},useId:function(){var a=Yr(),o=Rn.identifierPrefix;if(Qt){var u=Rs,h=Cs;u=(h&~(1<<32-ht(h)-1)).toString(32)+u,o=":"+o+"R"+u,u=Sd++,0<u&&(o+="H"+u.toString(32)),o+=":"}else u=yN++,o=":"+o+"r"+u.toString(32)+":";return a.memoizedState=o},useCacheRefresh:function(){return Yr().memoizedState=TN.bind(null,Pt)}};to.useMemoCache=em,to.useHostTransitionStatus=cm,to.useFormState=Q1,to.useActionState=Q1,to.useOptimistic=function(a){var o=Yr();o.memoizedState=o.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=u,o=um.bind(null,Pt,!0,u),u.dispatch=o,[a,o]};var ea={readContext:Ir,use:Ed,useCallback:oS,useContext:Ir,useEffect:sm,useImperativeHandle:aS,useInsertionEffect:rS,useLayoutEffect:iS,useMemo:lS,useReducer:Td,useRef:tS,useState:function(){return Td(Ms)},useDebugValue:am,useDeferredValue:function(a,o){var u=rr();return cS(u,dn.memoizedState,a,o)},useTransition:function(){var a=Td(Ms)[0],o=rr().memoizedState;return[typeof a=="boolean"?a:du(a),o]},useSyncExternalStore:L1,useId:hS};ea.useCacheRefresh=gS,ea.useMemoCache=em,ea.useHostTransitionStatus=cm,ea.useFormState=G1,ea.useActionState=G1,ea.useOptimistic=function(a,o){var u=rr();return W1(u,dn,a,o)};var no={readContext:Ir,use:Ed,useCallback:oS,useContext:Ir,useEffect:sm,useImperativeHandle:aS,useInsertionEffect:rS,useLayoutEffect:iS,useMemo:lS,useReducer:nm,useRef:tS,useState:function(){return nm(Ms)},useDebugValue:am,useDeferredValue:function(a,o){var u=rr();return dn===null?om(u,a,o):cS(u,dn.memoizedState,a,o)},useTransition:function(){var a=nm(Ms)[0],o=rr().memoizedState;return[typeof a=="boolean"?a:du(a),o]},useSyncExternalStore:L1,useId:hS};no.useCacheRefresh=gS,no.useMemoCache=em,no.useHostTransitionStatus=cm,no.useFormState=eS,no.useActionState=eS,no.useOptimistic=function(a,o){var u=rr();return dn!==null?W1(u,dn,a,o):(u.baseState=a,[a,u.queue.dispatch])};function fm(a,o,u,h){o=a.memoizedState,u=u(h,o),u=u==null?o:V({},o,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var dm={isMounted:function(a){return(a=a._reactInternals)?W(a)===a:!1},enqueueSetState:function(a,o,u){a=a._reactInternals;var h=ii(),p=ra(h);p.payload=o,u!=null&&(p.callback=u),o=ia(a,p,h),o!==null&&($r(o,a,h),mu(o,a,h))},enqueueReplaceState:function(a,o,u){a=a._reactInternals;var h=ii(),p=ra(h);p.tag=1,p.payload=o,u!=null&&(p.callback=u),o=ia(a,p,h),o!==null&&($r(o,a,h),mu(o,a,h))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var u=ii(),h=ra(u);h.tag=2,o!=null&&(h.callback=o),o=ia(a,h,u),o!==null&&($r(o,a,u),mu(o,a,u))}};function _S(a,o,u,h,p,y,R){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(h,y,R):o.prototype&&o.prototype.isPureReactComponent?!eu(u,h)||!eu(p,y):!0}function yS(a,o,u,h){a=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(u,h),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(u,h),o.state!==a&&dm.enqueueReplaceState(o,o.state,null)}function ro(a,o){var u=o;if("ref"in o){u={};for(var h in o)h!=="ref"&&(u[h]=o[h])}if(a=a.defaultProps){u===o&&(u=V({},u));for(var p in a)u[p]===void 0&&(u[p]=a[p])}return u}var xd=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)};function bS(a){xd(a)}function SS(a){console.error(a)}function wS(a){xd(a)}function Md(a,o){try{var u=a.onUncaughtError;u(o.value,{componentStack:o.stack})}catch(h){setTimeout(function(){throw h})}}function ES(a,o,u){try{var h=a.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function hm(a,o,u){return u=ra(u),u.tag=3,u.payload={element:null},u.callback=function(){Md(a,o)},u}function TS(a){return a=ra(a),a.tag=3,a}function AS(a,o,u,h){var p=u.type.getDerivedStateFromError;if(typeof p=="function"){var y=h.value;a.payload=function(){return p(y)},a.callback=function(){ES(o,u,h)}}var R=u.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(a.callback=function(){ES(o,u,h),typeof p!="function"&&(ua===null?ua=new Set([this]):ua.add(this));var D=h.stack;this.componentDidCatch(h.value,{componentStack:D!==null?D:""})})}function CN(a,o,u,h,p){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(o=u.alternate,o!==null&&pu(o,u,p,!0),u=yi.current,u!==null){switch(u.tag){case 13:return is===null?Ym():u.alternate===null&&Wn===0&&(Wn=3),u.flags&=-257,u.flags|=65536,u.lanes=p,h===Hp?u.flags|=16384:(o=u.updateQueue,o===null?u.updateQueue=new Set([h]):o.add(h),Zm(a,h,p)),!1;case 22:return u.flags|=65536,h===Hp?u.flags|=16384:(o=u.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=o):(u=o.retryQueue,u===null?o.retryQueue=new Set([h]):u.add(h)),Zm(a,h,p)),!1}throw Error(r(435,u.tag))}return Zm(a,h,p),Ym(),!1}if(Qt)return o=yi.current,o!==null?(!(o.flags&65536)&&(o.flags|=256),o.flags|=65536,o.lanes=p,h!==Vp&&(a=Error(r(422),{cause:h}),iu(mi(a,u)))):(h!==Vp&&(o=Error(r(423),{cause:h}),iu(mi(o,u))),a=a.current.alternate,a.flags|=65536,p&=-p,a.lanes|=p,h=mi(h,u),p=hm(a.stateNode,h,p),xm(a,p),Wn!==4&&(Wn=2)),!1;var y=Error(r(520),{cause:h});if(y=mi(y,u),Tu===null?Tu=[y]:Tu.push(y),Wn!==4&&(Wn=2),o===null)return!0;h=mi(h,u),u=o;do{switch(u.tag){case 3:return u.flags|=65536,a=p&-p,u.lanes|=a,a=hm(u.stateNode,h,a),xm(u,a),!1;case 1:if(o=u.type,y=u.stateNode,(u.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ua===null||!ua.has(y))))return u.flags|=65536,p&=-p,u.lanes|=p,p=TS(p),AS(p,a,u,h),xm(u,p),!1}u=u.return}while(u!==null);return!1}var CS=Error(r(461)),mr=!1;function Tr(a,o,u,h){o.child=a===null?P1(o,null,u,h):Ga(o,a.child,u,h)}function RS(a,o,u,h,p){u=u.render;var y=o.ref;if("ref"in h){var R={};for(var D in h)D!=="ref"&&(R[D]=h[D])}else R=h;return so(o),h=Zp(a,o,u,R,y,p),D=Qp(),a!==null&&!mr?(Gp(a,o,p),Os(a,o,p)):(Qt&&D&&zp(o),o.flags|=1,Tr(a,o,h,p),o.child)}function xS(a,o,u,h,p){if(a===null){var y=u.type;return typeof y=="function"&&!km(y)&&y.defaultProps===void 0&&u.compare===null?(o.tag=15,o.type=y,MS(a,o,y,h,p)):(a=Dd(u.type,null,h,o,o.mode,p),a.ref=o.ref,a.return=o,o.child=a)}if(y=a.child,!wm(a,p)){var R=y.memoizedProps;if(u=u.compare,u=u!==null?u:eu,u(R,h)&&a.ref===o.ref)return Os(a,o,p)}return o.flags|=1,a=la(y,h),a.ref=o.ref,a.return=o,o.child=a}function MS(a,o,u,h,p){if(a!==null){var y=a.memoizedProps;if(eu(y,h)&&a.ref===o.ref)if(mr=!1,o.pendingProps=h=y,wm(a,p))a.flags&131072&&(mr=!0);else return o.lanes=a.lanes,Os(a,o,p)}return gm(a,o,u,h,p)}function OS(a,o,u){var h=o.pendingProps,p=h.children,y=(o.stateNode._pendingVisibility&2)!==0,R=a!==null?a.memoizedState:null;if(gu(a,o),h.mode==="hidden"||y){if(o.flags&128){if(h=R!==null?R.baseLanes|u:u,a!==null){for(p=o.child=a.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;o.childLanes=y&~h}else o.childLanes=0,o.child=null;return PS(a,o,h,u)}if(u&536870912)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&yd(o,R!==null?R.cachePool:null),R!==null?N1(o,R):jp(),I1(o);else return o.lanes=o.childLanes=536870912,PS(a,o,R!==null?R.baseLanes|u:u,u)}else R!==null?(yd(o,R.cachePool),N1(o,R),Gs(),o.memoizedState=null):(a!==null&&yd(o,null),jp(),Gs());return Tr(a,o,p,u),o.child}function PS(a,o,u,h){var p=Yp();return p=p===null?null:{parent:ur._currentValue,pool:p},o.memoizedState={baseLanes:u,cachePool:p},a!==null&&yd(o,null),jp(),I1(o),a!==null&&pu(a,o,h,!0),null}function gu(a,o){var u=o.ref;if(u===null)a!==null&&a.ref!==null&&(o.flags|=2097664);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(a===null||a.ref!==u)&&(o.flags|=2097664)}}function gm(a,o,u,h,p){return so(o),u=Zp(a,o,u,h,void 0,p),h=Qp(),a!==null&&!mr?(Gp(a,o,p),Os(a,o,p)):(Qt&&h&&zp(o),o.flags|=1,Tr(a,o,u,p),o.child)}function NS(a,o,u,h,p,y){return so(o),o.updateQueue=null,u=U1(o,h,u,p),B1(a),h=Qp(),a!==null&&!mr?(Gp(a,o,y),Os(a,o,y)):(Qt&&h&&zp(o),o.flags|=1,Tr(a,o,u,y),o.child)}function IS(a,o,u,h,p){if(so(o),o.stateNode===null){var y=ul,R=u.contextType;typeof R=="object"&&R!==null&&(y=Ir(R)),y=new u(h,y),o.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=dm,o.stateNode=y,y._reactInternals=o,y=o.stateNode,y.props=h,y.state=o.memoizedState,y.refs={},Cm(o),R=u.contextType,y.context=typeof R=="object"&&R!==null?Ir(R):ul,y.state=o.memoizedState,R=u.getDerivedStateFromProps,typeof R=="function"&&(fm(o,u,R,h),y.state=o.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(R=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),R!==y.state&&dm.enqueueReplaceState(y,y.state,null),_u(o,h,y,p),vu(),y.state=o.memoizedState),typeof y.componentDidMount=="function"&&(o.flags|=4194308),h=!0}else if(a===null){y=o.stateNode;var D=o.memoizedProps,H=ro(u,D);y.props=H;var ee=y.context,pe=u.contextType;R=ul,typeof pe=="object"&&pe!==null&&(R=Ir(pe));var Se=u.getDerivedStateFromProps;pe=typeof Se=="function"||typeof y.getSnapshotBeforeUpdate=="function",D=o.pendingProps!==D,pe||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(D||ee!==R)&&yS(o,y,h,R),na=!1;var ue=o.memoizedState;y.state=ue,_u(o,h,y,p),vu(),ee=o.memoizedState,D||ue!==ee||na?(typeof Se=="function"&&(fm(o,u,Se,h),ee=o.memoizedState),(H=na||_S(o,u,H,h,ue,ee,R))?(pe||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(o.flags|=4194308)):(typeof y.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=h,o.memoizedState=ee),y.props=h,y.state=ee,y.context=R,h=H):(typeof y.componentDidMount=="function"&&(o.flags|=4194308),h=!1)}else{y=o.stateNode,Rm(a,o),R=o.memoizedProps,pe=ro(u,R),y.props=pe,Se=o.pendingProps,ue=y.context,ee=u.contextType,H=ul,typeof ee=="object"&&ee!==null&&(H=Ir(ee)),D=u.getDerivedStateFromProps,(ee=typeof D=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(R!==Se||ue!==H)&&yS(o,y,h,H),na=!1,ue=o.memoizedState,y.state=ue,_u(o,h,y,p),vu();var he=o.memoizedState;R!==Se||ue!==he||na||a!==null&&a.dependencies!==null&&Od(a.dependencies)?(typeof D=="function"&&(fm(o,u,D,h),he=o.memoizedState),(pe=na||_S(o,u,pe,h,ue,he,H)||a!==null&&a.dependencies!==null&&Od(a.dependencies))?(ee||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(h,he,H),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(h,he,H)),typeof y.componentDidUpdate=="function"&&(o.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof y.componentDidUpdate!="function"||R===a.memoizedProps&&ue===a.memoizedState||(o.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||R===a.memoizedProps&&ue===a.memoizedState||(o.flags|=1024),o.memoizedProps=h,o.memoizedState=he),y.props=h,y.state=he,y.context=H,h=pe):(typeof y.componentDidUpdate!="function"||R===a.memoizedProps&&ue===a.memoizedState||(o.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||R===a.memoizedProps&&ue===a.memoizedState||(o.flags|=1024),h=!1)}return y=h,gu(a,o),h=(o.flags&128)!==0,y||h?(y=o.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:y.render(),o.flags|=1,a!==null&&h?(o.child=Ga(o,a.child,null,p),o.child=Ga(o,null,u,p)):Tr(a,o,u,p),o.memoizedState=y.state,a=o.child):a=Os(a,o,p),a}function DS(a,o,u,h){return ru(),o.flags|=256,Tr(a,o,u,h),o.child}var pm={dehydrated:null,treeContext:null,retryLane:0};function mm(a){return{baseLanes:a,cachePool:k1()}}function vm(a,o,u){return a=a!==null?a.childLanes&~u:0,o&&(a|=Ei),a}function FS(a,o,u){var h=o.pendingProps,p=!1,y=(o.flags&128)!==0,R;if((R=y)||(R=a!==null&&a.memoizedState===null?!1:(cr.current&2)!==0),R&&(p=!0,o.flags&=-129),R=(o.flags&32)!==0,o.flags&=-33,a===null){if(Qt){if(p?Qs(o):Gs(),Qt){var D=Er,H;if(H=D){e:{for(H=D,D=rs;H.nodeType!==8;){if(!D){D=null;break e}if(H=Vi(H.nextSibling),H===null){D=null;break e}}D=H}D!==null?(o.memoizedState={dehydrated:D,treeContext:Ka!==null?{id:Cs,overflow:Rs}:null,retryLane:536870912},H=wi(18,null,null,0),H.stateNode=D,H.return=o,o.child=H,zr=o,Er=null,H=!0):H=!1}H||Qa(o)}if(D=o.memoizedState,D!==null&&(D=D.dehydrated,D!==null))return D.data==="$!"?o.lanes=16:o.lanes=536870912,null;xs(o)}return D=h.children,h=h.fallback,p?(Gs(),p=o.mode,D=ym({mode:"hidden",children:D},p),h=oo(h,p,u,null),D.return=o,h.return=o,D.sibling=h,o.child=D,p=o.child,p.memoizedState=mm(u),p.childLanes=vm(a,R,u),o.memoizedState=pm,h):(Qs(o),_m(o,D))}if(H=a.memoizedState,H!==null&&(D=H.dehydrated,D!==null)){if(y)o.flags&256?(Qs(o),o.flags&=-257,o=bm(a,o,u)):o.memoizedState!==null?(Gs(),o.child=a.child,o.flags|=128,o=null):(Gs(),p=h.fallback,D=o.mode,h=ym({mode:"visible",children:h.children},D),p=oo(p,D,u,null),p.flags|=2,h.return=o,p.return=o,h.sibling=p,o.child=h,Ga(o,a.child,null,u),h=o.child,h.memoizedState=mm(u),h.childLanes=vm(a,R,u),o.memoizedState=pm,o=p);else if(Qs(o),D.data==="$!"){if(R=D.nextSibling&&D.nextSibling.dataset,R)var ee=R.dgst;R=ee,h=Error(r(419)),h.stack="",h.digest=R,iu({value:h,source:null,stack:null}),o=bm(a,o,u)}else if(mr||pu(a,o,u,!1),R=(u&a.childLanes)!==0,mr||R){if(R=Rn,R!==null){if(h=u&-u,h&42)h=1;else switch(h){case 2:h=1;break;case 8:h=4;break;case 32:h=16;break;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:h=64;break;case 268435456:h=134217728;break;default:h=0}if(h=h&(R.suspendedLanes|u)?0:h,h!==0&&h!==H.retryLane)throw H.retryLane=h,Zs(a,h),$r(R,a,h),CS}D.data==="$?"||Ym(),o=bm(a,o,u)}else D.data==="$?"?(o.flags|=128,o.child=a.child,o=$N.bind(null,a),D._reactRetry=o,o=null):(a=H.treeContext,Er=Vi(D.nextSibling),zr=o,Qt=!0,zi=null,rs=!1,a!==null&&(vi[_i++]=Cs,vi[_i++]=Rs,vi[_i++]=Ka,Cs=a.id,Rs=a.overflow,Ka=o),o=_m(o,h.children),o.flags|=4096);return o}return p?(Gs(),p=h.fallback,D=o.mode,H=a.child,ee=H.sibling,h=la(H,{mode:"hidden",children:h.children}),h.subtreeFlags=H.subtreeFlags&31457280,ee!==null?p=la(ee,p):(p=oo(p,D,u,null),p.flags|=2),p.return=o,h.return=o,h.sibling=p,o.child=h,h=p,p=o.child,D=a.child.memoizedState,D===null?D=mm(u):(H=D.cachePool,H!==null?(ee=ur._currentValue,H=H.parent!==ee?{parent:ee,pool:ee}:H):H=k1(),D={baseLanes:D.baseLanes|u,cachePool:H}),p.memoizedState=D,p.childLanes=vm(a,R,u),o.memoizedState=pm,h):(Qs(o),u=a.child,a=u.sibling,u=la(u,{mode:"visible",children:h.children}),u.return=o,u.sibling=null,a!==null&&(R=o.deletions,R===null?(o.deletions=[a],o.flags|=16):R.push(a)),o.child=u,o.memoizedState=null,u)}function _m(a,o){return o=ym({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function ym(a,o){return ow(a,o,0,null)}function bm(a,o,u){return Ga(o,a.child,null,u),a=_m(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function kS(a,o,u){a.lanes|=o;var h=a.alternate;h!==null&&(h.lanes|=o),Tm(a.return,o,u)}function Sm(a,o,u,h,p){var y=a.memoizedState;y===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:p}:(y.isBackwards=o,y.rendering=null,y.renderingStartTime=0,y.last=h,y.tail=u,y.tailMode=p)}function BS(a,o,u){var h=o.pendingProps,p=h.revealOrder,y=h.tail;if(Tr(a,o,h.children,u),h=cr.current,h&2)h=h&1|2,o.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&kS(a,u,o);else if(a.tag===19)kS(a,u,o);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}h&=1}switch(Te(cr,h),p){case"forwards":for(u=o.child,p=null;u!==null;)a=u.alternate,a!==null&&_d(a)===null&&(p=u),u=u.sibling;u=p,u===null?(p=o.child,o.child=null):(p=u.sibling,u.sibling=null),Sm(o,!1,p,u,y);break;case"backwards":for(u=null,p=o.child,o.child=null;p!==null;){if(a=p.alternate,a!==null&&_d(a)===null){o.child=p;break}a=p.sibling,p.sibling=u,u=p,p=a}Sm(o,!0,u,null,y);break;case"together":Sm(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function Os(a,o,u){if(a!==null&&(o.dependencies=a.dependencies),ca|=o.lanes,!(u&o.childLanes))if(a!==null){if(pu(a,o,u,!1),(u&o.childLanes)===0)return null}else return null;if(a!==null&&o.child!==a.child)throw Error(r(153));if(o.child!==null){for(a=o.child,u=la(a,a.pendingProps),o.child=u,u.return=o;a.sibling!==null;)a=a.sibling,u=u.sibling=la(a,a.pendingProps),u.return=o;u.sibling=null}return o.child}function wm(a,o){return a.lanes&o?!0:(a=a.dependencies,!!(a!==null&&Od(a)))}function RN(a,o,u){switch(o.tag){case 3:Ee(o,o.stateNode.containerInfo),ta(o,ur,a.memoizedState.cache),ru();break;case 27:case 5:Ve(o);break;case 4:Ee(o,o.stateNode.containerInfo);break;case 10:ta(o,o.type,o.memoizedProps.value);break;case 13:var h=o.memoizedState;if(h!==null)return h.dehydrated!==null?(Qs(o),o.flags|=128,null):u&o.child.childLanes?FS(a,o,u):(Qs(o),a=Os(a,o,u),a!==null?a.sibling:null);Qs(o);break;case 19:var p=(a.flags&128)!==0;if(h=(u&o.childLanes)!==0,h||(pu(a,o,u,!1),h=(u&o.childLanes)!==0),p){if(h)return BS(a,o,u);o.flags|=128}if(p=o.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Te(cr,cr.current),h)break;return null;case 22:case 23:return o.lanes=0,OS(a,o,u);case 24:ta(o,ur,a.memoizedState.cache)}return Os(a,o,u)}function US(a,o,u){if(a!==null)if(a.memoizedProps!==o.pendingProps)mr=!0;else{if(!wm(a,u)&&!(o.flags&128))return mr=!1,RN(a,o,u);mr=!!(a.flags&131072)}else mr=!1,Qt&&o.flags&1048576&&w1(o,hd,o.index);switch(o.lanes=0,o.tag){case 16:e:{a=o.pendingProps;var h=o.elementType,p=h._init;if(h=p(h._payload),o.type=h,typeof h=="function")km(h)?(a=ro(h,a),o.tag=1,o=IS(null,o,h,a,u)):(o.tag=0,o=gm(null,o,h,a,u));else{if(h!=null){if(p=h.$$typeof,p===E){o.tag=11,o=RS(null,o,h,a,u);break e}else if(p===A){o.tag=14,o=xS(null,o,h,a,u);break e}}throw o=L(h)||h,Error(r(306,o,""))}}return o;case 0:return gm(a,o,o.type,o.pendingProps,u);case 1:return h=o.type,p=ro(h,o.pendingProps),IS(a,o,h,p,u);case 3:e:{if(Ee(o,o.stateNode.containerInfo),a===null)throw Error(r(387));var y=o.pendingProps;p=o.memoizedState,h=p.element,Rm(a,o),_u(o,y,null,u);var R=o.memoizedState;if(y=R.cache,ta(o,ur,y),y!==p.cache&&Am(o,[ur],u,!0),vu(),y=R.element,p.isDehydrated)if(p={element:y,isDehydrated:!1,cache:R.cache},o.updateQueue.baseState=p,o.memoizedState=p,o.flags&256){o=DS(a,o,y,u);break e}else if(y!==h){h=mi(Error(r(424)),o),iu(h),o=DS(a,o,y,u);break e}else for(Er=Vi(o.stateNode.containerInfo.firstChild),zr=o,Qt=!0,zi=null,rs=!0,u=P1(o,null,y,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(ru(),y===h){o=Os(a,o,u);break e}Tr(a,o,y,u)}o=o.child}return o;case 26:return gu(a,o),a===null?(u=$w(o.type,null,o.pendingProps,null))?o.memoizedState=u:Qt||(u=o.type,a=o.pendingProps,h=Xd(_e.current).createElement(u),h[bt]=o,h[_t]=a,Ar(h,u,a),be(h),o.stateNode=h):o.memoizedState=$w(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return Ve(o),a===null&&Qt&&(h=o.stateNode=Uw(o.type,o.pendingProps,_e.current),zr=o,rs=!0,Er=Vi(h.firstChild)),h=o.pendingProps.children,a!==null||Qt?Tr(a,o,h,u):o.child=Ga(o,null,h,u),gu(a,o),o.child;case 5:return a===null&&Qt&&((p=h=Er)&&(h=rI(h,o.type,o.pendingProps,rs),h!==null?(o.stateNode=h,zr=o,Er=Vi(h.firstChild),rs=!1,p=!0):p=!1),p||Qa(o)),Ve(o),p=o.type,y=o.pendingProps,R=a!==null?a.memoizedProps:null,h=y.children,lv(p,y)?h=null:R!==null&&lv(p,R)&&(o.flags|=32),o.memoizedState!==null&&(p=Zp(a,o,bN,null,null,u),Iu._currentValue=p),gu(a,o),Tr(a,o,h,u),o.child;case 6:return a===null&&Qt&&((a=u=Er)&&(u=iI(u,o.pendingProps,rs),u!==null?(o.stateNode=u,zr=o,Er=null,a=!0):a=!1),a||Qa(o)),null;case 13:return FS(a,o,u);case 4:return Ee(o,o.stateNode.containerInfo),h=o.pendingProps,a===null?o.child=Ga(o,null,h,u):Tr(a,o,h,u),o.child;case 11:return RS(a,o,o.type,o.pendingProps,u);case 7:return Tr(a,o,o.pendingProps,u),o.child;case 8:return Tr(a,o,o.pendingProps.children,u),o.child;case 12:return Tr(a,o,o.pendingProps.children,u),o.child;case 10:return h=o.pendingProps,ta(o,o.type,h.value),Tr(a,o,h.children,u),o.child;case 9:return p=o.type._context,h=o.pendingProps.children,so(o),p=Ir(p),h=h(p),o.flags|=1,Tr(a,o,h,u),o.child;case 14:return xS(a,o,o.type,o.pendingProps,u);case 15:return MS(a,o,o.type,o.pendingProps,u);case 19:return BS(a,o,u);case 22:return OS(a,o,u);case 24:return so(o),h=Ir(ur),a===null?(p=Yp(),p===null&&(p=Rn,y=Xp(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=u),p=y),o.memoizedState={parent:h,cache:p},Cm(o),ta(o,ur,p)):(a.lanes&u&&(Rm(a,o),_u(o,null,null,u),vu()),p=a.memoizedState,y=o.memoizedState,p.parent!==h?(p={parent:h,cache:h},o.memoizedState=p,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=p),ta(o,ur,h)):(h=y.cache,ta(o,ur,h),h!==p.cache&&Am(o,[ur],u,!0))),Tr(a,o,o.pendingProps.children,u),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}var Em=we(null),io=null,Ps=null;function ta(a,o,u){Te(Em,o._currentValue),o._currentValue=u}function Ns(a){a._currentValue=Em.current,Ae(Em)}function Tm(a,o,u){for(;a!==null;){var h=a.alternate;if((a.childLanes&o)!==o?(a.childLanes|=o,h!==null&&(h.childLanes|=o)):h!==null&&(h.childLanes&o)!==o&&(h.childLanes|=o),a===u)break;a=a.return}}function Am(a,o,u,h){var p=a.child;for(p!==null&&(p.return=a);p!==null;){var y=p.dependencies;if(y!==null){var R=p.child;y=y.firstContext;e:for(;y!==null;){var D=y;y=p;for(var H=0;H<o.length;H++)if(D.context===o[H]){y.lanes|=u,D=y.alternate,D!==null&&(D.lanes|=u),Tm(y.return,u,a),h||(R=null);break e}y=D.next}}else if(p.tag===18){if(R=p.return,R===null)throw Error(r(341));R.lanes|=u,y=R.alternate,y!==null&&(y.lanes|=u),Tm(R,u,a),R=null}else R=p.child;if(R!==null)R.return=p;else for(R=p;R!==null;){if(R===a){R=null;break}if(p=R.sibling,p!==null){p.return=R.return,R=p;break}R=R.return}p=R}}function pu(a,o,u,h){a=null;for(var p=o,y=!1;p!==null;){if(!y){if(p.flags&524288)y=!0;else if(p.flags&262144)break}if(p.tag===10){var R=p.alternate;if(R===null)throw Error(r(387));if(R=R.memoizedProps,R!==null){var D=p.type;ei(p.pendingProps.value,R.value)||(a!==null?a.push(D):a=[D])}}else if(p===Ie.current){if(R=p.alternate,R===null)throw Error(r(387));R.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(a!==null?a.push(Iu):a=[Iu])}p=p.return}a!==null&&Am(o,a,u,h),o.flags|=262144}function Od(a){for(a=a.firstContext;a!==null;){if(!ei(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function so(a){io=a,Ps=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Ir(a){return LS(io,a)}function Pd(a,o){return io===null&&so(a),LS(a,o)}function LS(a,o){var u=o._currentValue;if(o={context:o,memoizedValue:u,next:null},Ps===null){if(a===null)throw Error(r(308));Ps=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else Ps=Ps.next=o;return u}var na=!1;function Cm(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rm(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ra(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ia(a,o,u){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,zn&2){var p=h.pending;return p===null?o.next=o:(o.next=p.next,p.next=o),h.pending=o,o=fd(a),b1(a,null,u),o}return ud(a,h,o,u),fd(a)}function mu(a,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194176)!==0)){var h=o.lanes;h&=a.pendingLanes,u|=h,o.lanes=u,Oe(a,u)}}function xm(a,o){var u=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var p=null,y=null;if(u=u.firstBaseUpdate,u!==null){do{var R={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};y===null?p=y=R:y=y.next=R,u=u.next}while(u!==null);y===null?p=y=o:y=y.next=o}else p=y=o;u={baseState:h.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:h.shared,callbacks:h.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=o:a.next=o,u.lastBaseUpdate=o}var Mm=!1;function vu(){if(Mm){var a=ml;if(a!==null)throw a}}function _u(a,o,u,h){Mm=!1;var p=a.updateQueue;na=!1;var y=p.firstBaseUpdate,R=p.lastBaseUpdate,D=p.shared.pending;if(D!==null){p.shared.pending=null;var H=D,ee=H.next;H.next=null,R===null?y=ee:R.next=ee,R=H;var pe=a.alternate;pe!==null&&(pe=pe.updateQueue,D=pe.lastBaseUpdate,D!==R&&(D===null?pe.firstBaseUpdate=ee:D.next=ee,pe.lastBaseUpdate=H))}if(y!==null){var Se=p.baseState;R=0,pe=ee=H=null,D=y;do{var ue=D.lane&-536870913,he=ue!==D.lane;if(he?(Kt&ue)===ue:(h&ue)===ue){ue!==0&&ue===pl&&(Mm=!0),pe!==null&&(pe=pe.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var tt=a,Et=D;ue=o;var Xn=u;switch(Et.tag){case 1:if(tt=Et.payload,typeof tt=="function"){Se=tt.call(Xn,Se,ue);break e}Se=tt;break e;case 3:tt.flags=tt.flags&-65537|128;case 0:if(tt=Et.payload,ue=typeof tt=="function"?tt.call(Xn,Se,ue):tt,ue==null)break e;Se=V({},Se,ue);break e;case 2:na=!0}}ue=D.callback,ue!==null&&(a.flags|=64,he&&(a.flags|=8192),he=p.callbacks,he===null?p.callbacks=[ue]:he.push(ue))}else he={lane:ue,tag:D.tag,payload:D.payload,callback:D.callback,next:null},pe===null?(ee=pe=he,H=Se):pe=pe.next=he,R|=ue;if(D=D.next,D===null){if(D=p.shared.pending,D===null)break;he=D,D=he.next,he.next=null,p.lastBaseUpdate=he,p.shared.pending=null}}while(!0);pe===null&&(H=Se),p.baseState=H,p.firstBaseUpdate=ee,p.lastBaseUpdate=pe,y===null&&(p.shared.lanes=0),ca|=R,a.lanes=R,a.memoizedState=Se}}function zS(a,o){if(typeof a!="function")throw Error(r(191,a));a.call(o)}function $S(a,o){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)zS(u[a],o)}function yu(a,o){try{var u=o.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var p=h.next;u=p;do{if((u.tag&a)===a){h=void 0;var y=u.create,R=u.inst;h=y(),R.destroy=h}u=u.next}while(u!==p)}}catch(D){yn(o,o.return,D)}}function sa(a,o,u){try{var h=o.updateQueue,p=h!==null?h.lastEffect:null;if(p!==null){var y=p.next;h=y;do{if((h.tag&a)===a){var R=h.inst,D=R.destroy;if(D!==void 0){R.destroy=void 0,p=o;var H=u;try{D()}catch(ee){yn(p,H,ee)}}}h=h.next}while(h!==y)}}catch(ee){yn(o,o.return,ee)}}function VS(a){var o=a.updateQueue;if(o!==null){var u=a.stateNode;try{$S(o,u)}catch(h){yn(a,a.return,h)}}}function HS(a,o,u){u.props=ro(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(h){yn(a,o,h)}}function ao(a,o){try{var u=a.ref;if(u!==null){var h=a.stateNode;switch(a.tag){case 26:case 27:case 5:var p=h;break;default:p=h}typeof u=="function"?a.refCleanup=u(p):u.current=p}}catch(y){yn(a,o,y)}}function ti(a,o){var u=a.ref,h=a.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(p){yn(a,o,p)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(p){yn(a,o,p)}else u.current=null}function jS(a){var o=a.type,u=a.memoizedProps,h=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(p){yn(a,a.return,p)}}function WS(a,o,u){try{var h=a.stateNode;GN(h,a.type,u,o),h[_t]=o}catch(p){yn(a,a.return,p)}}function XS(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27||a.tag===4}function Om(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||XS(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==27&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Pm(a,o,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,o?u.nodeType===8?u.parentNode.insertBefore(a,o):u.insertBefore(a,o):(u.nodeType===8?(o=u.parentNode,o.insertBefore(a,u)):(o=u,o.appendChild(a)),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=Wd));else if(h!==4&&h!==27&&(a=a.child,a!==null))for(Pm(a,o,u),a=a.sibling;a!==null;)Pm(a,o,u),a=a.sibling}function Nd(a,o,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,o?u.insertBefore(a,o):u.appendChild(a);else if(h!==4&&h!==27&&(a=a.child,a!==null))for(Nd(a,o,u),a=a.sibling;a!==null;)Nd(a,o,u),a=a.sibling}var Is=!1,jn=!1,Nm=!1,qS=typeof WeakSet=="function"?WeakSet:Set,vr=null,YS=!1;function xN(a,o){if(a=a.containerInfo,av=Gd,a=f1(a),Dp(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var p=h.anchorOffset,y=h.focusNode;h=h.focusOffset;try{u.nodeType,y.nodeType}catch{u=null;break e}var R=0,D=-1,H=-1,ee=0,pe=0,Se=a,ue=null;t:for(;;){for(var he;Se!==u||p!==0&&Se.nodeType!==3||(D=R+p),Se!==y||h!==0&&Se.nodeType!==3||(H=R+h),Se.nodeType===3&&(R+=Se.nodeValue.length),(he=Se.firstChild)!==null;)ue=Se,Se=he;for(;;){if(Se===a)break t;if(ue===u&&++ee===p&&(D=R),ue===y&&++pe===h&&(H=R),(he=Se.nextSibling)!==null)break;Se=ue,ue=Se.parentNode}Se=he}u=D===-1||H===-1?null:{start:D,end:H}}else u=null}u=u||{start:0,end:0}}else u=null;for(ov={focusedElem:a,selectionRange:u},Gd=!1,vr=o;vr!==null;)if(o=vr,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,vr=a;else for(;vr!==null;){switch(o=vr,y=o.alternate,a=o.flags,o.tag){case 0:break;case 11:case 15:break;case 1:if(a&1024&&y!==null){a=void 0,u=o,p=y.memoizedProps,y=y.memoizedState,h=u.stateNode;try{var tt=ro(u.type,p,u.elementType===u.type);a=h.getSnapshotBeforeUpdate(tt,y),h.__reactInternalSnapshotBeforeUpdate=a}catch(Et){yn(u,u.return,Et)}}break;case 3:if(a&1024){if(a=o.stateNode.containerInfo,u=a.nodeType,u===9)fv(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":fv(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(a&1024)throw Error(r(163))}if(a=o.sibling,a!==null){a.return=o.return,vr=a;break}vr=o.return}return tt=YS,YS=!1,tt}function KS(a,o,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Fs(a,u),h&4&&yu(5,u);break;case 1:if(Fs(a,u),h&4)if(a=u.stateNode,o===null)try{a.componentDidMount()}catch(D){yn(u,u.return,D)}else{var p=ro(u.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(p,o,a.__reactInternalSnapshotBeforeUpdate)}catch(D){yn(u,u.return,D)}}h&64&&VS(u),h&512&&ao(u,u.return);break;case 3:if(Fs(a,u),h&64&&(h=u.updateQueue,h!==null)){if(a=null,u.child!==null)switch(u.child.tag){case 27:case 5:a=u.child.stateNode;break;case 1:a=u.child.stateNode}try{$S(h,a)}catch(D){yn(u,u.return,D)}}break;case 26:Fs(a,u),h&512&&ao(u,u.return);break;case 27:case 5:Fs(a,u),o===null&&h&4&&jS(u),h&512&&ao(u,u.return);break;case 12:Fs(a,u);break;case 13:Fs(a,u),h&4&&GS(a,u);break;case 22:if(p=u.memoizedState!==null||Is,!p){o=o!==null&&o.memoizedState!==null||jn;var y=Is,R=jn;Is=p,(jn=o)&&!R?aa(a,u,(u.subtreeFlags&8772)!==0):Fs(a,u),Is=y,jn=R}h&512&&(u.memoizedProps.mode==="manual"?ao(u,u.return):ti(u,u.return));break;default:Fs(a,u)}}function ZS(a){var o=a.alternate;o!==null&&(a.alternate=null,ZS(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&un(o)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var ir=null,ni=!1;function Ds(a,o,u){for(u=u.child;u!==null;)QS(a,o,u),u=u.sibling}function QS(a,o,u){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(ct,u)}catch{}switch(u.tag){case 26:jn||ti(u,o),Ds(a,o,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:jn||ti(u,o);var h=ir,p=ni;for(ir=u.stateNode,Ds(a,o,u),u=u.stateNode,o=u.attributes;o.length;)u.removeAttributeNode(o[0]);un(u),ir=h,ni=p;break;case 5:jn||ti(u,o);case 6:p=ir;var y=ni;if(ir=null,Ds(a,o,u),ir=p,ni=y,ir!==null)if(ni)try{a=ir,h=u.stateNode,a.nodeType===8?a.parentNode.removeChild(h):a.removeChild(h)}catch(R){yn(u,o,R)}else try{ir.removeChild(u.stateNode)}catch(R){yn(u,o,R)}break;case 18:ir!==null&&(ni?(o=ir,u=u.stateNode,o.nodeType===8?uv(o.parentNode,u):o.nodeType===1&&uv(o,u),Bu(o)):uv(ir,u.stateNode));break;case 4:h=ir,p=ni,ir=u.stateNode.containerInfo,ni=!0,Ds(a,o,u),ir=h,ni=p;break;case 0:case 11:case 14:case 15:jn||sa(2,u,o),jn||sa(4,u,o),Ds(a,o,u);break;case 1:jn||(ti(u,o),h=u.stateNode,typeof h.componentWillUnmount=="function"&&HS(u,o,h)),Ds(a,o,u);break;case 21:Ds(a,o,u);break;case 22:jn||ti(u,o),jn=(h=jn)||u.memoizedState!==null,Ds(a,o,u),jn=h;break;default:Ds(a,o,u)}}function GS(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Bu(a)}catch(u){yn(o,o.return,u)}}function MN(a){switch(a.tag){case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new qS),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new qS),o;default:throw Error(r(435,a.tag))}}function Im(a,o){var u=MN(a);o.forEach(function(h){var p=VN.bind(null,a,h);u.has(h)||(u.add(h),h.then(p,p))})}function bi(a,o){var u=o.deletions;if(u!==null)for(var h=0;h<u.length;h++){var p=u[h],y=a,R=o,D=R;e:for(;D!==null;){switch(D.tag){case 27:case 5:ir=D.stateNode,ni=!1;break e;case 3:ir=D.stateNode.containerInfo,ni=!0;break e;case 4:ir=D.stateNode.containerInfo,ni=!0;break e}D=D.return}if(ir===null)throw Error(r(160));QS(y,R,p),ir=null,ni=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(o.subtreeFlags&13878)for(o=o.child;o!==null;)JS(o,a),o=o.sibling}var $i=null;function JS(a,o){var u=a.alternate,h=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:bi(o,a),Si(a),h&4&&(sa(3,a,a.return),yu(3,a),sa(5,a,a.return));break;case 1:bi(o,a),Si(a),h&512&&(jn||u===null||ti(u,u.return)),h&64&&Is&&(a=a.updateQueue,a!==null&&(h=a.callbacks,h!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var p=$i;if(bi(o,a),Si(a),h&512&&(jn||u===null||ti(u,u.return)),h&4){var y=u!==null?u.memoizedState:null;if(h=a.memoizedState,u===null)if(h===null)if(a.stateNode===null){e:{h=a.type,u=a.memoizedProps,p=p.ownerDocument||p;t:switch(h){case"title":y=p.getElementsByTagName("title")[0],(!y||y[Zn]||y[bt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(h),p.head.insertBefore(y,p.querySelector("head > title"))),Ar(y,h,u),y[bt]=a,be(y),h=y;break e;case"link":var R=jw("link","href",p).get(h+(u.href||""));if(R){for(var D=0;D<R.length;D++)if(y=R[D],y.getAttribute("href")===(u.href==null?null:u.href)&&y.getAttribute("rel")===(u.rel==null?null:u.rel)&&y.getAttribute("title")===(u.title==null?null:u.title)&&y.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){R.splice(D,1);break t}}y=p.createElement(h),Ar(y,h,u),p.head.appendChild(y);break;case"meta":if(R=jw("meta","content",p).get(h+(u.content||""))){for(D=0;D<R.length;D++)if(y=R[D],y.getAttribute("content")===(u.content==null?null:""+u.content)&&y.getAttribute("name")===(u.name==null?null:u.name)&&y.getAttribute("property")===(u.property==null?null:u.property)&&y.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&y.getAttribute("charset")===(u.charSet==null?null:u.charSet)){R.splice(D,1);break t}}y=p.createElement(h),Ar(y,h,u),p.head.appendChild(y);break;default:throw Error(r(468,h))}y[bt]=a,be(y),h=y}a.stateNode=h}else Ww(p,a.type,a.stateNode);else a.stateNode=Hw(p,h,a.memoizedProps);else y!==h?(y===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):y.count--,h===null?Ww(p,a.type,a.stateNode):Hw(p,h,a.memoizedProps)):h===null&&a.stateNode!==null&&WS(a,a.memoizedProps,u.memoizedProps)}break;case 27:if(h&4&&a.alternate===null){p=a.stateNode,y=a.memoizedProps;try{for(var H=p.firstChild;H;){var ee=H.nextSibling,pe=H.nodeName;H[Zn]||pe==="HEAD"||pe==="BODY"||pe==="SCRIPT"||pe==="STYLE"||pe==="LINK"&&H.rel.toLowerCase()==="stylesheet"||p.removeChild(H),H=ee}for(var Se=a.type,ue=p.attributes;ue.length;)p.removeAttributeNode(ue[0]);Ar(p,Se,y),p[bt]=a,p[_t]=y}catch(tt){yn(a,a.return,tt)}}case 5:if(bi(o,a),Si(a),h&512&&(jn||u===null||ti(u,u.return)),a.flags&32){p=a.stateNode;try{wr(p,"")}catch(tt){yn(a,a.return,tt)}}h&4&&a.stateNode!=null&&(p=a.memoizedProps,WS(a,p,u!==null?u.memoizedProps:p)),h&1024&&(Nm=!0);break;case 6:if(bi(o,a),Si(a),h&4){if(a.stateNode===null)throw Error(r(162));h=a.memoizedProps,u=a.stateNode;try{u.nodeValue=h}catch(tt){yn(a,a.return,tt)}}break;case 3:if(Kd=null,p=$i,$i=qd(o.containerInfo),bi(o,a),$i=p,Si(a),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Bu(o.containerInfo)}catch(tt){yn(a,a.return,tt)}Nm&&(Nm=!1,ew(a));break;case 4:h=$i,$i=qd(a.stateNode.containerInfo),bi(o,a),Si(a),$i=h;break;case 12:bi(o,a),Si(a);break;case 13:bi(o,a),Si(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Vm=Me()),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Im(a,h)));break;case 22:if(h&512&&(jn||u===null||ti(u,u.return)),H=a.memoizedState!==null,ee=u!==null&&u.memoizedState!==null,pe=Is,Se=jn,Is=pe||H,jn=Se||ee,bi(o,a),jn=Se,Is=pe,Si(a),o=a.stateNode,o._current=a,o._visibility&=-3,o._visibility|=o._pendingVisibility&2,h&8192&&(o._visibility=H?o._visibility&-2:o._visibility|1,H&&(o=Is||jn,u===null||ee||o||bl(a)),a.memoizedProps===null||a.memoizedProps.mode!=="manual"))e:for(u=null,o=a;;){if(o.tag===5||o.tag===26||o.tag===27){if(u===null){ee=u=o;try{if(p=ee.stateNode,H)y=p.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{R=ee.stateNode,D=ee.memoizedProps.style;var he=D!=null&&D.hasOwnProperty("display")?D.display:null;R.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(tt){yn(ee,ee.return,tt)}}}else if(o.tag===6){if(u===null){ee=o;try{ee.stateNode.nodeValue=H?"":ee.memoizedProps}catch(tt){yn(ee,ee.return,tt)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===a)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;u===o&&(u=null),o=o.return}u===o&&(u=null),o.sibling.return=o.return,o=o.sibling}h&4&&(h=a.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Im(a,u))));break;case 19:bi(o,a),Si(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Im(a,h)));break;case 21:break;default:bi(o,a),Si(a)}}function Si(a){var o=a.flags;if(o&2){try{if(a.tag!==27){e:{for(var u=a.return;u!==null;){if(XS(u)){var h=u;break e}u=u.return}throw Error(r(160))}switch(h.tag){case 27:var p=h.stateNode,y=Om(a);Nd(a,y,p);break;case 5:var R=h.stateNode;h.flags&32&&(wr(R,""),h.flags&=-33);var D=Om(a);Nd(a,D,R);break;case 3:case 4:var H=h.stateNode.containerInfo,ee=Om(a);Pm(a,ee,H);break;default:throw Error(r(161))}}}catch(pe){yn(a,a.return,pe)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function ew(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;ew(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function Fs(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)KS(a,o.alternate,o),o=o.sibling}function bl(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:sa(4,o,o.return),bl(o);break;case 1:ti(o,o.return);var u=o.stateNode;typeof u.componentWillUnmount=="function"&&HS(o,o.return,u),bl(o);break;case 26:case 27:case 5:ti(o,o.return),bl(o);break;case 22:ti(o,o.return),o.memoizedState===null&&bl(o);break;default:bl(o)}a=a.sibling}}function aa(a,o,u){for(u=u&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var h=o.alternate,p=a,y=o,R=y.flags;switch(y.tag){case 0:case 11:case 15:aa(p,y,u),yu(4,y);break;case 1:if(aa(p,y,u),h=y,p=h.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(ee){yn(h,h.return,ee)}if(h=y,p=h.updateQueue,p!==null){var D=h.stateNode;try{var H=p.shared.hiddenCallbacks;if(H!==null)for(p.shared.hiddenCallbacks=null,p=0;p<H.length;p++)zS(H[p],D)}catch(ee){yn(h,h.return,ee)}}u&&R&64&&VS(y),ao(y,y.return);break;case 26:case 27:case 5:aa(p,y,u),u&&h===null&&R&4&&jS(y),ao(y,y.return);break;case 12:aa(p,y,u);break;case 13:aa(p,y,u),u&&R&4&&GS(p,y);break;case 22:y.memoizedState===null&&aa(p,y,u),ao(y,y.return);break;default:aa(p,y,u)}o=o.sibling}}function Dm(a,o){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(a=o.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&cu(u))}function Fm(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&cu(a))}function oa(a,o,u,h){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)tw(a,o,u,h),o=o.sibling}function tw(a,o,u,h){var p=o.flags;switch(o.tag){case 0:case 11:case 15:oa(a,o,u,h),p&2048&&yu(9,o);break;case 3:oa(a,o,u,h),p&2048&&(a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&cu(a)));break;case 12:if(p&2048){oa(a,o,u,h),a=o.stateNode;try{var y=o.memoizedProps,R=y.id,D=y.onPostCommit;typeof D=="function"&&D(R,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(H){yn(o,o.return,H)}}else oa(a,o,u,h);break;case 23:break;case 22:y=o.stateNode,o.memoizedState!==null?y._visibility&4?oa(a,o,u,h):bu(a,o):y._visibility&4?oa(a,o,u,h):(y._visibility|=4,Sl(a,o,u,h,(o.subtreeFlags&10256)!==0)),p&2048&&Dm(o.alternate,o);break;case 24:oa(a,o,u,h),p&2048&&Fm(o.alternate,o);break;default:oa(a,o,u,h)}}function Sl(a,o,u,h,p){for(p=p&&(o.subtreeFlags&10256)!==0,o=o.child;o!==null;){var y=a,R=o,D=u,H=h,ee=R.flags;switch(R.tag){case 0:case 11:case 15:Sl(y,R,D,H,p),yu(8,R);break;case 23:break;case 22:var pe=R.stateNode;R.memoizedState!==null?pe._visibility&4?Sl(y,R,D,H,p):bu(y,R):(pe._visibility|=4,Sl(y,R,D,H,p)),p&&ee&2048&&Dm(R.alternate,R);break;case 24:Sl(y,R,D,H,p),p&&ee&2048&&Fm(R.alternate,R);break;default:Sl(y,R,D,H,p)}o=o.sibling}}function bu(a,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var u=a,h=o,p=h.flags;switch(h.tag){case 22:bu(u,h),p&2048&&Dm(h.alternate,h);break;case 24:bu(u,h),p&2048&&Fm(h.alternate,h);break;default:bu(u,h)}o=o.sibling}}var Su=8192;function wl(a){if(a.subtreeFlags&Su)for(a=a.child;a!==null;)nw(a),a=a.sibling}function nw(a){switch(a.tag){case 26:wl(a),a.flags&Su&&a.memoizedState!==null&&vI($i,a.memoizedState,a.memoizedProps);break;case 5:wl(a);break;case 3:case 4:var o=$i;$i=qd(a.stateNode.containerInfo),wl(a),$i=o;break;case 22:a.memoizedState===null&&(o=a.alternate,o!==null&&o.memoizedState!==null?(o=Su,Su=16777216,wl(a),Su=o):wl(a));break;default:wl(a)}}function rw(a){var o=a.alternate;if(o!==null&&(a=o.child,a!==null)){o.child=null;do o=a.sibling,a.sibling=null,a=o;while(a!==null)}}function wu(a){var o=a.deletions;if(a.flags&16){if(o!==null)for(var u=0;u<o.length;u++){var h=o[u];vr=h,sw(h,a)}rw(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)iw(a),a=a.sibling}function iw(a){switch(a.tag){case 0:case 11:case 15:wu(a),a.flags&2048&&sa(9,a,a.return);break;case 3:wu(a);break;case 12:wu(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&4&&(a.return===null||a.return.tag!==13)?(o._visibility&=-5,Id(a)):wu(a);break;default:wu(a)}}function Id(a){var o=a.deletions;if(a.flags&16){if(o!==null)for(var u=0;u<o.length;u++){var h=o[u];vr=h,sw(h,a)}rw(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:sa(8,o,o.return),Id(o);break;case 22:u=o.stateNode,u._visibility&4&&(u._visibility&=-5,Id(o));break;default:Id(o)}a=a.sibling}}function sw(a,o){for(;vr!==null;){var u=vr;switch(u.tag){case 0:case 11:case 15:sa(8,u,o);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:cu(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,vr=h;else e:for(u=a;vr!==null;){h=vr;var p=h.sibling,y=h.return;if(ZS(h),h===u){vr=null;break e}if(p!==null){p.return=y,vr=p;break e}vr=y}}}function ON(a,o,u,h){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wi(a,o,u,h){return new ON(a,o,u,h)}function km(a){return a=a.prototype,!(!a||!a.isReactComponent)}function la(a,o){var u=a.alternate;return u===null?(u=wi(a.tag,o,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=o,u.type=a.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=a.flags&31457280,u.childLanes=a.childLanes,u.lanes=a.lanes,u.child=a.child,u.memoizedProps=a.memoizedProps,u.memoizedState=a.memoizedState,u.updateQueue=a.updateQueue,o=a.dependencies,u.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function aw(a,o){a.flags&=31457282;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=o,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,o=u.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),a}function Dd(a,o,u,h,p,y){var R=0;if(h=a,typeof a=="function")km(a)&&(R=1);else if(typeof a=="string")R=pI(a,u,ve.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case f:return oo(u.children,p,y,o);case d:R=8,p|=24;break;case g:return a=wi(12,u,o,p|2),a.elementType=g,a.lanes=y,a;case w:return a=wi(13,u,o,p),a.elementType=w,a.lanes=y,a;case b:return a=wi(19,u,o,p),a.elementType=b,a.lanes=y,a;case C:return ow(u,p,y,o);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case m:case S:R=10;break e;case v:R=9;break e;case E:R=11;break e;case A:R=14;break e;case T:R=16,h=null;break e}R=29,u=Error(r(130,a===null?"null":typeof a,"")),h=null}return o=wi(R,u,o,p),o.elementType=a,o.type=h,o.lanes=y,o}function oo(a,o,u,h){return a=wi(7,a,h,o),a.lanes=u,a}function ow(a,o,u,h){a=wi(22,a,h,o),a.elementType=C,a.lanes=u;var p={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var y=p._current;if(y===null)throw Error(r(456));if(!(p._pendingVisibility&2)){var R=Zs(y,2);R!==null&&(p._pendingVisibility|=2,$r(R,y,2))}},attach:function(){var y=p._current;if(y===null)throw Error(r(456));if(p._pendingVisibility&2){var R=Zs(y,2);R!==null&&(p._pendingVisibility&=-3,$r(R,y,2))}}};return a.stateNode=p,a}function Bm(a,o,u){return a=wi(6,a,null,o),a.lanes=u,a}function Um(a,o,u){return o=wi(4,a.children!==null?a.children:[],a.key,o),o.lanes=u,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}function ks(a){a.flags|=4}function lw(a,o){if(o.type!=="stylesheet"||o.state.loading&4)a.flags&=-16777217;else if(a.flags|=16777216,!Xw(o)){if(o=yi.current,o!==null&&((Kt&4194176)===Kt?is!==null:(Kt&62914560)!==Kt&&!(Kt&536870912)||o!==is))throw au=Hp,A1;a.flags|=8192}}function Fd(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?ke():536870912,a.lanes|=o,Tl|=o)}function Eu(a,o){if(!Qt)switch(a.tailMode){case"hidden":o=a.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:h.sibling=null}}function Ln(a){var o=a.alternate!==null&&a.alternate.child===a.child,u=0,h=0;if(o)for(var p=a.child;p!==null;)u|=p.lanes|p.childLanes,h|=p.subtreeFlags&31457280,h|=p.flags&31457280,p.return=a,p=p.sibling;else for(p=a.child;p!==null;)u|=p.lanes|p.childLanes,h|=p.subtreeFlags,h|=p.flags,p.return=a,p=p.sibling;return a.subtreeFlags|=h,a.childLanes=u,o}function PN(a,o,u){var h=o.pendingProps;switch($p(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ln(o),null;case 1:return Ln(o),null;case 3:return u=o.stateNode,h=null,a!==null&&(h=a.memoizedState.cache),o.memoizedState.cache!==h&&(o.flags|=2048),Ns(ur),xe(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(nu(o)?ks(o):a===null||a.memoizedState.isDehydrated&&!(o.flags&256)||(o.flags|=1024,zi!==null&&(Xm(zi),zi=null))),Ln(o),null;case 26:return u=o.memoizedState,a===null?(ks(o),u!==null?(Ln(o),lw(o,u)):(Ln(o),o.flags&=-16777217)):u?u!==a.memoizedState?(ks(o),Ln(o),lw(o,u)):(Ln(o),o.flags&=-16777217):(a.memoizedProps!==h&&ks(o),Ln(o),o.flags&=-16777217),null;case 27:Fe(o),u=_e.current;var p=o.type;if(a!==null&&o.stateNode!=null)a.memoizedProps!==h&&ks(o);else{if(!h){if(o.stateNode===null)throw Error(r(166));return Ln(o),null}a=ve.current,nu(o)?E1(o):(a=Uw(p,h,u),o.stateNode=a,ks(o))}return Ln(o),null;case 5:if(Fe(o),u=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==h&&ks(o);else{if(!h){if(o.stateNode===null)throw Error(r(166));return Ln(o),null}if(a=ve.current,nu(o))E1(o);else{switch(p=Xd(_e.current),a){case 1:a=p.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:a=p.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":a=p.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":a=p.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":a=p.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof h.is=="string"?p.createElement("select",{is:h.is}):p.createElement("select"),h.multiple?a.multiple=!0:h.size&&(a.size=h.size);break;default:a=typeof h.is=="string"?p.createElement(u,{is:h.is}):p.createElement(u)}}a[bt]=o,a[_t]=h;e:for(p=o.child;p!==null;){if(p.tag===5||p.tag===6)a.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===o)break e;for(;p.sibling===null;){if(p.return===null||p.return===o)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}o.stateNode=a;e:switch(Ar(a,u,h),u){case"button":case"input":case"select":case"textarea":a=!!h.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ks(o)}}return Ln(o),o.flags&=-16777217,null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==h&&ks(o);else{if(typeof h!="string"&&o.stateNode===null)throw Error(r(166));if(a=_e.current,nu(o)){if(a=o.stateNode,u=o.memoizedProps,h=null,p=zr,p!==null)switch(p.tag){case 27:case 5:h=p.memoizedProps}a[bt]=o,a=!!(a.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||Nw(a.nodeValue,u)),a||Qa(o)}else a=Xd(a).createTextNode(h),a[bt]=o,o.stateNode=a}return Ln(o),null;case 13:if(h=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(p=nu(o),h!==null&&h.dehydrated!==null){if(a===null){if(!p)throw Error(r(318));if(p=o.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[bt]=o}else ru(),!(o.flags&128)&&(o.memoizedState=null),o.flags|=4;Ln(o),p=!1}else zi!==null&&(Xm(zi),zi=null),p=!0;if(!p)return o.flags&256?(xs(o),o):(xs(o),null)}if(xs(o),o.flags&128)return o.lanes=u,o;if(u=h!==null,a=a!==null&&a.memoizedState!==null,u){h=o.child,p=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(p=h.alternate.memoizedState.cachePool.pool);var y=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(y=h.memoizedState.cachePool.pool),y!==p&&(h.flags|=2048)}return u!==a&&u&&(o.child.flags|=8192),Fd(o,o.updateQueue),Ln(o),null;case 4:return xe(),a===null&&rv(o.stateNode.containerInfo),Ln(o),null;case 10:return Ns(o.type),Ln(o),null;case 19:if(Ae(cr),p=o.memoizedState,p===null)return Ln(o),null;if(h=(o.flags&128)!==0,y=p.rendering,y===null)if(h)Eu(p,!1);else{if(Wn!==0||a!==null&&a.flags&128)for(a=o.child;a!==null;){if(y=_d(a),y!==null){for(o.flags|=128,Eu(p,!1),a=y.updateQueue,o.updateQueue=a,Fd(o,a),o.subtreeFlags=0,a=u,u=o.child;u!==null;)aw(u,a),u=u.sibling;return Te(cr,cr.current&1|2),o.child}a=a.sibling}p.tail!==null&&Me()>kd&&(o.flags|=128,h=!0,Eu(p,!1),o.lanes=4194304)}else{if(!h)if(a=_d(y),a!==null){if(o.flags|=128,h=!0,a=a.updateQueue,o.updateQueue=a,Fd(o,a),Eu(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!Qt)return Ln(o),null}else 2*Me()-p.renderingStartTime>kd&&u!==536870912&&(o.flags|=128,h=!0,Eu(p,!1),o.lanes=4194304);p.isBackwards?(y.sibling=o.child,o.child=y):(a=p.last,a!==null?a.sibling=y:o.child=y,p.last=y)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=Me(),o.sibling=null,a=cr.current,Te(cr,h?a&1|2:a&1),o):(Ln(o),null);case 22:case 23:return xs(o),Wp(),h=o.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(o.flags|=8192):h&&(o.flags|=8192),h?u&536870912&&!(o.flags&128)&&(Ln(o),o.subtreeFlags&6&&(o.flags|=8192)):Ln(o),u=o.updateQueue,u!==null&&Fd(o,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048),a!==null&&Ae(Ja),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),Ns(ur),Ln(o),null;case 25:return null}throw Error(r(156,o.tag))}function NN(a,o){switch($p(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return Ns(ur),xe(),a=o.flags,a&65536&&!(a&128)?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return Fe(o),null;case 13:if(xs(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));ru()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return Ae(cr),null;case 4:return xe(),null;case 10:return Ns(o.type),null;case 22:case 23:return xs(o),Wp(),a!==null&&Ae(Ja),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return Ns(ur),null;case 25:return null;default:return null}}function cw(a,o){switch($p(o),o.tag){case 3:Ns(ur),xe();break;case 26:case 27:case 5:Fe(o);break;case 4:xe();break;case 13:xs(o);break;case 19:Ae(cr);break;case 10:Ns(o.type);break;case 22:case 23:xs(o),Wp(),a!==null&&Ae(Ja);break;case 24:Ns(ur)}}var IN={getCacheForType:function(a){var o=Ir(ur),u=o.data.get(a);return u===void 0&&(u=a(),o.data.set(a,u)),u}},DN=typeof WeakMap=="function"?WeakMap:Map,zn=0,Rn=null,$t=null,Kt=0,xn=0,ri=null,Bs=!1,El=!1,Lm=!1,Us=0,Wn=0,ca=0,lo=0,zm=0,Ei=0,Tl=0,Tu=null,as=null,$m=!1,Vm=0,kd=1/0,Bd=null,ua=null,Ud=!1,co=null,Au=0,Hm=0,jm=null,Cu=0,Wm=null;function ii(){if(zn&2&&Kt!==0)return Kt&-Kt;if(I.T!==null){var a=pl;return a!==0?a:Jm()}return Ye()}function uw(){Ei===0&&(Ei=!(Kt&536870912)||Qt?qe():536870912);var a=yi.current;return a!==null&&(a.flags|=32),Ei}function $r(a,o,u){(a===Rn&&xn===2||a.cancelPendingCommit!==null)&&(Al(a,0),Ls(a,Kt,Ei,!1)),wt(a,u),(!(zn&2)||a!==Rn)&&(a===Rn&&(!(zn&2)&&(lo|=u),Wn===4&&Ls(a,Kt,Ei,!1)),os(a))}function fw(a,o,u){if(zn&6)throw Error(r(327));var h=!u&&(o&60)===0&&(o&a.expiredLanes)===0||Jt(a,o),p=h?BN(a,o):Km(a,o,!0),y=h;do{if(p===0){El&&!h&&Ls(a,o,0,!1);break}else if(p===6)Ls(a,o,0,!Bs);else{if(u=a.current.alternate,y&&!FN(u)){p=Km(a,o,!1),y=!1;continue}if(p===2){if(y=o,a.errorRecoveryDisabledLanes&y)var R=0;else R=a.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){o=R;e:{var D=a;p=Tu;var H=D.current.memoizedState.isDehydrated;if(H&&(Al(D,R).flags|=256),R=Km(D,R,!1),R!==2){if(Lm&&!H){D.errorRecoveryDisabledLanes|=y,lo|=y,p=4;break e}y=as,as=p,y!==null&&Xm(y)}p=R}if(y=!1,p!==2)continue}}if(p===1){Al(a,0),Ls(a,o,0,!0);break}e:{switch(h=a,p){case 0:case 1:throw Error(r(345));case 4:if((o&4194176)===o){Ls(h,o,Ei,!Bs);break e}break;case 2:as=null;break;case 3:case 5:break;default:throw Error(r(329))}if(h.finishedWork=u,h.finishedLanes=o,(o&62914560)===o&&(y=Vm+300-Me(),10<y)){if(Ls(h,o,Ei,!Bs),Lt(h,0)!==0)break e;h.timeoutHandle=Fw(dw.bind(null,h,u,as,Bd,$m,o,Ei,lo,Tl,Bs,2,-0,0),y);break e}dw(h,u,as,Bd,$m,o,Ei,lo,Tl,Bs,0,-0,0)}}break}while(!0);os(a)}function Xm(a){as===null?as=a:as.push.apply(as,a)}function dw(a,o,u,h,p,y,R,D,H,ee,pe,Se,ue){var he=o.subtreeFlags;if((he&8192||(he&16785408)===16785408)&&(Nu={stylesheets:null,count:0,unsuspend:mI},nw(o),o=_I(),o!==null)){a.cancelPendingCommit=o(yw.bind(null,a,u,h,p,R,D,H,1,Se,ue)),Ls(a,y,R,!ee);return}yw(a,u,h,p,R,D,H,pe,Se,ue)}function FN(a){for(var o=a;;){var u=o.tag;if((u===0||u===11||u===15)&&o.flags&16384&&(u=o.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var p=u[h],y=p.getSnapshot;p=p.value;try{if(!ei(y(),p))return!1}catch{return!1}}if(u=o.child,o.subtreeFlags&16384&&u!==null)u.return=o,o=u;else{if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Ls(a,o,u,h){o&=~zm,o&=~lo,a.suspendedLanes|=o,a.pingedLanes&=~o,h&&(a.warmLanes|=o),h=a.expirationTimes;for(var p=o;0<p;){var y=31-ht(p),R=1<<y;h[y]=-1,p&=~R}u!==0&&Ue(a,u,o)}function Ld(){return zn&6?!0:(Ru(0),!1)}function qm(){if($t!==null){if(xn===0)var a=$t.return;else a=$t,Ps=io=null,Jp(a),hl=null,ou=0,a=$t;for(;a!==null;)cw(a.alternate,a),a=a.return;$t=null}}function Al(a,o){a.finishedWork=null,a.finishedLanes=0;var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,eI(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),qm(),Rn=a,$t=u=la(a.current,null),Kt=o,xn=0,ri=null,Bs=!1,El=Jt(a,o),Lm=!1,Tl=Ei=zm=lo=ca=Wn=0,as=Tu=null,$m=!1,o&8&&(o|=o&32);var h=a.entangledLanes;if(h!==0)for(a=a.entanglements,h&=o;0<h;){var p=31-ht(h),y=1<<p;o|=a[p],h&=~y}return Us=o,cd(),u}function hw(a,o){Pt=null,I.H=ss,o===su?(o=x1(),xn=3):o===A1?(o=x1(),xn=4):xn=o===CS?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,ri=o,$t===null&&(Wn=1,Md(a,mi(o,a.current)))}function gw(){var a=I.H;return I.H=ss,a===null?ss:a}function pw(){var a=I.A;return I.A=IN,a}function Ym(){Wn=4,Bs||(Kt&4194176)!==Kt&&yi.current!==null||(El=!0),!(ca&134217727)&&!(lo&134217727)||Rn===null||Ls(Rn,Kt,Ei,!1)}function Km(a,o,u){var h=zn;zn|=2;var p=gw(),y=pw();(Rn!==a||Kt!==o)&&(Bd=null,Al(a,o)),o=!1;var R=Wn;e:do try{if(xn!==0&&$t!==null){var D=$t,H=ri;switch(xn){case 8:qm(),R=6;break e;case 3:case 2:case 6:yi.current===null&&(o=!0);var ee=xn;if(xn=0,ri=null,Cl(a,D,H,ee),u&&El){R=0;break e}break;default:ee=xn,xn=0,ri=null,Cl(a,D,H,ee)}}kN(),R=Wn;break}catch(pe){hw(a,pe)}while(!0);return o&&a.shellSuspendCounter++,Ps=io=null,zn=h,I.H=p,I.A=y,$t===null&&(Rn=null,Kt=0,cd()),R}function kN(){for(;$t!==null;)mw($t)}function BN(a,o){var u=zn;zn|=2;var h=gw(),p=pw();Rn!==a||Kt!==o?(Bd=null,kd=Me()+500,Al(a,o)):El=Jt(a,o);e:do try{if(xn!==0&&$t!==null){o=$t;var y=ri;t:switch(xn){case 1:xn=0,ri=null,Cl(a,o,y,1);break;case 2:if(C1(y)){xn=0,ri=null,vw(o);break}o=function(){xn===2&&Rn===a&&(xn=7),os(a)},y.then(o,o);break e;case 3:xn=7;break e;case 4:xn=5;break e;case 7:C1(y)?(xn=0,ri=null,vw(o)):(xn=0,ri=null,Cl(a,o,y,7));break;case 5:var R=null;switch($t.tag){case 26:R=$t.memoizedState;case 5:case 27:var D=$t;if(!R||Xw(R)){xn=0,ri=null;var H=D.sibling;if(H!==null)$t=H;else{var ee=D.return;ee!==null?($t=ee,zd(ee)):$t=null}break t}}xn=0,ri=null,Cl(a,o,y,5);break;case 6:xn=0,ri=null,Cl(a,o,y,6);break;case 8:qm(),Wn=6;break e;default:throw Error(r(462))}}UN();break}catch(pe){hw(a,pe)}while(!0);return Ps=io=null,I.H=h,I.A=p,zn=u,$t!==null?0:(Rn=null,Kt=0,cd(),Wn)}function UN(){for(;$t!==null&&!Ge();)mw($t)}function mw(a){var o=US(a.alternate,a,Us);a.memoizedProps=a.pendingProps,o===null?zd(a):$t=o}function vw(a){var o=a,u=o.alternate;switch(o.tag){case 15:case 0:o=NS(u,o,o.pendingProps,o.type,void 0,Kt);break;case 11:o=NS(u,o,o.pendingProps,o.type.render,o.ref,Kt);break;case 5:Jp(o);default:cw(u,o),o=$t=aw(o,Us),o=US(u,o,Us)}a.memoizedProps=a.pendingProps,o===null?zd(a):$t=o}function Cl(a,o,u,h){Ps=io=null,Jp(o),hl=null,ou=0;var p=o.return;try{if(CN(a,p,o,u,Kt)){Wn=1,Md(a,mi(u,a.current)),$t=null;return}}catch(y){if(p!==null)throw $t=p,y;Wn=1,Md(a,mi(u,a.current)),$t=null;return}o.flags&32768?(Qt||h===1?a=!0:El||Kt&536870912?a=!1:(Bs=a=!0,(h===2||h===3||h===6)&&(h=yi.current,h!==null&&h.tag===13&&(h.flags|=16384))),_w(o,a)):zd(o)}function zd(a){var o=a;do{if(o.flags&32768){_w(o,Bs);return}a=o.return;var u=PN(o.alternate,o,Us);if(u!==null){$t=u;return}if(o=o.sibling,o!==null){$t=o;return}$t=o=a}while(o!==null);Wn===0&&(Wn=5)}function _w(a,o){do{var u=NN(a.alternate,a);if(u!==null){u.flags&=32767,$t=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!o&&(a=a.sibling,a!==null)){$t=a;return}$t=a=u}while(a!==null);Wn=6,$t=null}function yw(a,o,u,h,p,y,R,D,H,ee){var pe=I.T,Se=q.p;try{q.p=2,I.T=null,LN(a,o,u,h,Se,p,y,R,D,H,ee)}finally{I.T=pe,q.p=Se}}function LN(a,o,u,h,p,y,R,D){do Rl();while(co!==null);if(zn&6)throw Error(r(327));var H=a.finishedWork;if(h=a.finishedLanes,H===null)return null;if(a.finishedWork=null,a.finishedLanes=0,H===a.current)throw Error(r(177));a.callbackNode=null,a.callbackPriority=0,a.cancelPendingCommit=null;var ee=H.lanes|H.childLanes;if(ee|=Up,en(a,h,ee,y,R,D),a===Rn&&($t=Rn=null,Kt=0),!(H.subtreeFlags&10256)&&!(H.flags&10256)||Ud||(Ud=!0,Hm=ee,jm=u,HN(st,function(){return Rl(),null})),u=(H.flags&15990)!==0,H.subtreeFlags&15990||u?(u=I.T,I.T=null,y=q.p,q.p=2,R=zn,zn|=4,xN(a,H),JS(H,a),cN(ov,a.containerInfo),Gd=!!av,ov=av=null,a.current=H,KS(a,H.alternate,H),Pe(),zn=R,q.p=y,I.T=u):a.current=H,Ud?(Ud=!1,co=a,Au=h):bw(a,ee),ee=a.pendingLanes,ee===0&&(ua=null),xt(H.stateNode),os(a),o!==null)for(p=a.onRecoverableError,H=0;H<o.length;H++)ee=o[H],p(ee.value,{componentStack:ee.stack});return Au&3&&Rl(),ee=a.pendingLanes,h&4194218&&ee&42?a===Wm?Cu++:(Cu=0,Wm=a):Cu=0,Ru(0),null}function bw(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,cu(o)))}function Rl(){if(co!==null){var a=co,o=Hm;Hm=0;var u=je(Au),h=I.T,p=q.p;try{if(q.p=32>u?32:u,I.T=null,co===null)var y=!1;else{u=jm,jm=null;var R=co,D=Au;if(co=null,Au=0,zn&6)throw Error(r(331));var H=zn;if(zn|=4,iw(R.current),tw(R,R.current,D,u),zn=H,Ru(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(ct,R)}catch{}y=!0}return y}finally{q.p=p,I.T=h,bw(a,o)}}return!1}function Sw(a,o,u){o=mi(u,o),o=hm(a.stateNode,o,2),a=ia(a,o,2),a!==null&&(wt(a,2),os(a))}function yn(a,o,u){if(a.tag===3)Sw(a,a,u);else for(;o!==null;){if(o.tag===3){Sw(o,a,u);break}else if(o.tag===1){var h=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ua===null||!ua.has(h))){a=mi(u,a),u=TS(2),h=ia(o,u,2),h!==null&&(AS(u,h,o,a),wt(h,2),os(h));break}}o=o.return}}function Zm(a,o,u){var h=a.pingCache;if(h===null){h=a.pingCache=new DN;var p=new Set;h.set(o,p)}else p=h.get(o),p===void 0&&(p=new Set,h.set(o,p));p.has(u)||(Lm=!0,p.add(u),a=zN.bind(null,a,o,u),o.then(a,a))}function zN(a,o,u){var h=a.pingCache;h!==null&&h.delete(o),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,Rn===a&&(Kt&u)===u&&(Wn===4||Wn===3&&(Kt&62914560)===Kt&&300>Me()-Vm?!(zn&2)&&Al(a,0):zm|=u,Tl===Kt&&(Tl=0)),os(a)}function ww(a,o){o===0&&(o=ke()),a=Zs(a,o),a!==null&&(wt(a,o),os(a))}function $N(a){var o=a.memoizedState,u=0;o!==null&&(u=o.retryLane),ww(a,u)}function VN(a,o){var u=0;switch(a.tag){case 13:var h=a.stateNode,p=a.memoizedState;p!==null&&(u=p.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(o),ww(a,u)}function HN(a,o){return nt(a,o)}var $d=null,xl=null,Qm=!1,Vd=!1,Gm=!1,uo=0;function os(a){a!==xl&&a.next===null&&(xl===null?$d=xl=a:xl=xl.next=a),Vd=!0,Qm||(Qm=!0,WN(jN))}function Ru(a,o){if(!Gm&&Vd){Gm=!0;do for(var u=!1,h=$d;h!==null;){if(a!==0){var p=h.pendingLanes;if(p===0)var y=0;else{var R=h.suspendedLanes,D=h.pingedLanes;y=(1<<31-ht(42|a)+1)-1,y&=p&~(R&~D),y=y&201326677?y&201326677|1:y?y|2:0}y!==0&&(u=!0,Aw(h,y))}else y=Kt,y=Lt(h,h===Rn?y:0),!(y&3)||Jt(h,y)||(u=!0,Aw(h,y));h=h.next}while(u);Gm=!1}}function jN(){Vd=Qm=!1;var a=0;uo!==0&&(JN()&&(a=uo),uo=0);for(var o=Me(),u=null,h=$d;h!==null;){var p=h.next,y=Ew(h,o);y===0?(h.next=null,u===null?$d=p:u.next=p,p===null&&(xl=u)):(u=h,(a!==0||y&3)&&(Vd=!0)),h=p}Ru(a)}function Ew(a,o){for(var u=a.suspendedLanes,h=a.pingedLanes,p=a.expirationTimes,y=a.pendingLanes&-62914561;0<y;){var R=31-ht(y),D=1<<R,H=p[R];H===-1?(!(D&u)||D&h)&&(p[R]=Mt(D,o)):H<=o&&(a.expiredLanes|=D),y&=~D}if(o=Rn,u=Kt,u=Lt(a,a===o?u:0),h=a.callbackNode,u===0||a===o&&xn===2||a.cancelPendingCommit!==null)return h!==null&&h!==null&&He(h),a.callbackNode=null,a.callbackPriority=0;if(!(u&3)||Jt(a,u)){if(o=u&-u,o===a.callbackPriority)return o;switch(h!==null&&He(h),je(u)){case 2:case 8:u=it;break;case 32:u=st;break;case 268435456:u=Je;break;default:u=st}return h=Tw.bind(null,a),u=nt(u,h),a.callbackPriority=o,a.callbackNode=u,o}return h!==null&&h!==null&&He(h),a.callbackPriority=2,a.callbackNode=null,2}function Tw(a,o){var u=a.callbackNode;if(Rl()&&a.callbackNode!==u)return null;var h=Kt;return h=Lt(a,a===Rn?h:0),h===0?null:(fw(a,h,o),Ew(a,Me()),a.callbackNode!=null&&a.callbackNode===u?Tw.bind(null,a):null)}function Aw(a,o){if(Rl())return null;fw(a,o,!0)}function WN(a){tI(function(){zn&6?nt(rt,a):a()})}function Jm(){return uo===0&&(uo=qe()),uo}function Cw(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Bi(""+a)}function Rw(a,o){var u=o.ownerDocument.createElement("input");return u.name=o.name,u.value=o.value,a.id&&u.setAttribute("form",a.id),o.parentNode.insertBefore(u,o),a=new FormData(a),u.parentNode.removeChild(u),a}function XN(a,o,u,h,p){if(o==="submit"&&u&&u.stateNode===p){var y=Cw((p[_t]||null).action),R=h.submitter;R&&(o=(o=R[_t]||null)?Cw(o.formAction):R.getAttribute("formAction"),o!==null&&(y=o,R=null));var D=new ad("action","action",null,h,p);a.push({event:D,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(uo!==0){var H=R?Rw(p,R):new FormData(p);lm(u,{pending:!0,data:H,method:p.method,action:y},null,H)}}else typeof y=="function"&&(D.preventDefault(),H=R?Rw(p,R):new FormData(p),lm(u,{pending:!0,data:H,method:p.method,action:y},y,H))},currentTarget:p}]})}}for(var ev=0;ev<y1.length;ev++){var tv=y1[ev],qN=tv.toLowerCase(),YN=tv[0].toUpperCase()+tv.slice(1);Li(qN,"on"+YN)}Li(g1,"onAnimationEnd"),Li(p1,"onAnimationIteration"),Li(m1,"onAnimationStart"),Li("dblclick","onDoubleClick"),Li("focusin","onFocus"),Li("focusout","onBlur"),Li(fN,"onTransitionRun"),Li(dN,"onTransitionStart"),Li(hN,"onTransitionCancel"),Li(v1,"onTransitionEnd"),In("onMouseEnter",["mouseout","mouseover"]),In("onMouseLeave",["mouseout","mouseover"]),In("onPointerEnter",["pointerout","pointerover"]),In("onPointerLeave",["pointerout","pointerover"]),Ot("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ot("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ot("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ot("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ot("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ot("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xu="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(" "),KN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xu));function xw(a,o){o=(o&4)!==0;for(var u=0;u<a.length;u++){var h=a[u],p=h.event;h=h.listeners;e:{var y=void 0;if(o)for(var R=h.length-1;0<=R;R--){var D=h[R],H=D.instance,ee=D.currentTarget;if(D=D.listener,H!==y&&p.isPropagationStopped())break e;y=D,p.currentTarget=ee;try{y(p)}catch(pe){xd(pe)}p.currentTarget=null,y=H}else for(R=0;R<h.length;R++){if(D=h[R],H=D.instance,ee=D.currentTarget,D=D.listener,H!==y&&p.isPropagationStopped())break e;y=D,p.currentTarget=ee;try{y(p)}catch(pe){xd(pe)}p.currentTarget=null,y=H}}}}function jt(a,o){var u=o[Yt];u===void 0&&(u=o[Yt]=new Set);var h=a+"__bubble";u.has(h)||(Mw(o,a,2,!1),u.add(h))}function nv(a,o,u){var h=0;o&&(h|=4),Mw(u,a,h,o)}var Hd="_reactListening"+Math.random().toString(36).slice(2);function rv(a){if(!a[Hd]){a[Hd]=!0,ut.forEach(function(u){u!=="selectionchange"&&(KN.has(u)||nv(u,!1,a),nv(u,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[Hd]||(o[Hd]=!0,nv("selectionchange",!1,o))}}function Mw(a,o,u,h){switch(Gw(o)){case 2:var p=SI;break;case 8:p=wI;break;default:p=mv}u=p.bind(null,o,u,a),p=void 0,!gt||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(p=!0),h?p!==void 0?a.addEventListener(o,u,{capture:!0,passive:p}):a.addEventListener(o,u,!0):p!==void 0?a.addEventListener(o,u,{passive:p}):a.addEventListener(o,u,!1)}function iv(a,o,u,h,p){var y=h;if(!(o&1)&&!(o&2)&&h!==null)e:for(;;){if(h===null)return;var R=h.tag;if(R===3||R===4){var D=h.stateNode.containerInfo;if(D===p||D.nodeType===8&&D.parentNode===p)break;if(R===4)for(R=h.return;R!==null;){var H=R.tag;if((H===3||H===4)&&(H=R.stateNode.containerInfo,H===p||H.nodeType===8&&H.parentNode===p))return;R=R.return}for(;D!==null;){if(R=rn(D),R===null)return;if(H=R.tag,H===5||H===6||H===26||H===27){h=y=R;continue e}D=D.parentNode}}h=h.return}il(function(){var ee=y,pe=hi(u),Se=[];e:{var ue=_1.get(a);if(ue!==void 0){var he=ad,tt=a;switch(a){case"keypress":if(Wa(u)===0)break e;case"keydown":case"keyup":he=VP;break;case"focusin":tt="focus",he=Mp;break;case"focusout":tt="blur",he=Mp;break;case"beforeblur":case"afterblur":he=Mp;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=qb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=OP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=WP;break;case g1:case p1:case m1:he=IP;break;case v1:he=qP;break;case"scroll":case"scrollend":he=xP;break;case"wheel":he=KP;break;case"copy":case"cut":case"paste":he=FP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=Kb;break;case"toggle":case"beforetoggle":he=QP}var Et=(o&4)!==0,Xn=!Et&&(a==="scroll"||a==="scrollend"),re=Et?ue!==null?ue+"Capture":null:ue;Et=[];for(var Q=ee,le;Q!==null;){var me=Q;if(le=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||le===null||re===null||(me=$e(Q,re),me!=null&&Et.push(Mu(Q,me,le))),Xn)break;Q=Q.return}0<Et.length&&(ue=new he(ue,tt,null,u,pe),Se.push({event:ue,listeners:Et}))}}if(!(o&7)){e:{if(ue=a==="mouseover"||a==="pointerover",he=a==="mouseout"||a==="pointerout",ue&&u!==di&&(tt=u.relatedTarget||u.fromElement)&&(rn(tt)||tt[Zt]))break e;if((he||ue)&&(ue=pe.window===pe?pe:(ue=pe.ownerDocument)?ue.defaultView||ue.parentWindow:window,he?(tt=u.relatedTarget||u.toElement,he=ee,tt=tt?rn(tt):null,tt!==null&&(Xn=W(tt),Et=tt.tag,tt!==Xn||Et!==5&&Et!==27&&Et!==6)&&(tt=null)):(he=null,tt=ee),he!==tt)){if(Et=qb,me="onMouseLeave",re="onMouseEnter",Q="mouse",(a==="pointerout"||a==="pointerover")&&(Et=Kb,me="onPointerLeave",re="onPointerEnter",Q="pointer"),Xn=he==null?ue:Le(he),le=tt==null?ue:Le(tt),ue=new Et(me,Q+"leave",he,u,pe),ue.target=Xn,ue.relatedTarget=le,me=null,rn(pe)===ee&&(Et=new Et(re,Q+"enter",tt,u,pe),Et.target=le,Et.relatedTarget=Xn,me=Et),Xn=me,he&&tt)t:{for(Et=he,re=tt,Q=0,le=Et;le;le=Ml(le))Q++;for(le=0,me=re;me;me=Ml(me))le++;for(;0<Q-le;)Et=Ml(Et),Q--;for(;0<le-Q;)re=Ml(re),le--;for(;Q--;){if(Et===re||re!==null&&Et===re.alternate)break t;Et=Ml(Et),re=Ml(re)}Et=null}else Et=null;he!==null&&Ow(Se,ue,he,Et,!1),tt!==null&&Xn!==null&&Ow(Se,Xn,tt,Et,!0)}}e:{if(ue=ee?Le(ee):window,he=ue.nodeName&&ue.nodeName.toLowerCase(),he==="select"||he==="input"&&ue.type==="file")var Ke=r1;else if(t1(ue))if(i1)Ke=oN;else{Ke=sN;var Dt=iN}else he=ue.nodeName,!he||he.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?ee&&Ha(ee.elementType)&&(Ke=r1):Ke=aN;if(Ke&&(Ke=Ke(a,ee))){n1(Se,Ke,u,pe);break e}Dt&&Dt(a,ue,ee),a==="focusout"&&ee&&ue.type==="number"&&ee.memoizedProps.value!=null&&Nn(ue,"number",ue.value)}switch(Dt=ee?Le(ee):window,a){case"focusin":(t1(Dt)||Dt.contentEditable==="true")&&(ol=Dt,Fp=ee,tu=null);break;case"focusout":tu=Fp=ol=null;break;case"mousedown":kp=!0;break;case"contextmenu":case"mouseup":case"dragend":kp=!1,d1(Se,u,pe);break;case"selectionchange":if(uN)break;case"keydown":case"keyup":d1(Se,u,pe)}var ot;if(Pp)e:{switch(a){case"compositionstart":var vt="onCompositionStart";break e;case"compositionend":vt="onCompositionEnd";break e;case"compositionupdate":vt="onCompositionUpdate";break e}vt=void 0}else al?Jb(a,u)&&(vt="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(vt="onCompositionStart");vt&&(Zb&&u.locale!=="ko"&&(al||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&al&&(ot=sl()):(fn=pe,Cn="value"in fn?fn.value:fn.textContent,al=!0)),Dt=jd(ee,vt),0<Dt.length&&(vt=new Yb(vt,a,null,u,pe),Se.push({event:vt,listeners:Dt}),ot?vt.data=ot:(ot=e1(u),ot!==null&&(vt.data=ot)))),(ot=JP?eN(a,u):tN(a,u))&&(vt=jd(ee,"onBeforeInput"),0<vt.length&&(Dt=new Yb("onBeforeInput","beforeinput",null,u,pe),Se.push({event:Dt,listeners:vt}),Dt.data=ot)),XN(Se,a,ee,u,pe)}xw(Se,o)})}function Mu(a,o,u){return{instance:a,listener:o,currentTarget:u}}function jd(a,o){for(var u=o+"Capture",h=[];a!==null;){var p=a,y=p.stateNode;p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=$e(a,u),p!=null&&h.unshift(Mu(a,p,y)),p=$e(a,o),p!=null&&h.push(Mu(a,p,y))),a=a.return}return h}function Ml(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function Ow(a,o,u,h,p){for(var y=o._reactName,R=[];u!==null&&u!==h;){var D=u,H=D.alternate,ee=D.stateNode;if(D=D.tag,H!==null&&H===h)break;D!==5&&D!==26&&D!==27||ee===null||(H=ee,p?(ee=$e(u,y),ee!=null&&R.unshift(Mu(u,ee,H))):p||(ee=$e(u,y),ee!=null&&R.push(Mu(u,ee,H)))),u=u.return}R.length!==0&&a.push({event:o,listeners:R})}var ZN=/\r\n?/g,QN=/\u0000|\uFFFD/g;function Pw(a){return(typeof a=="string"?a:""+a).replace(ZN,`
`).replace(QN,"")}function Nw(a,o){return o=Pw(o),Pw(a)===o}function Wd(){}function hn(a,o,u,h,p,y){switch(u){case"children":typeof h=="string"?o==="body"||o==="textarea"&&h===""||wr(a,h):(typeof h=="number"||typeof h=="bigint")&&o!=="body"&&wr(a,""+h);break;case"className":Un(a,"class",h);break;case"tabIndex":Un(a,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Un(a,u,h);break;case"style":pr(a,h,y);break;case"data":if(o!=="object"){Un(a,"data",h);break}case"src":case"href":if(h===""&&(o!=="a"||u!=="href")){a.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(u);break}h=Bi(""+h),a.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){a.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(u==="formAction"?(o!=="input"&&hn(a,o,"name",p.name,p,null),hn(a,o,"formEncType",p.formEncType,p,null),hn(a,o,"formMethod",p.formMethod,p,null),hn(a,o,"formTarget",p.formTarget,p,null)):(hn(a,o,"encType",p.encType,p,null),hn(a,o,"method",p.method,p,null),hn(a,o,"target",p.target,p,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(u);break}h=Bi(""+h),a.setAttribute(u,h);break;case"onClick":h!=null&&(a.onclick=Wd);break;case"onScroll":h!=null&&jt("scroll",a);break;case"onScrollEnd":h!=null&&jt("scrollend",a);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(p.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"multiple":a.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":a.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){a.removeAttribute("xlink:href");break}u=Bi(""+h),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,""+h):a.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":h===!0?a.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,h):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?a.setAttribute(u,h):a.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?a.removeAttribute(u):a.setAttribute(u,h);break;case"popover":jt("beforetoggle",a),jt("toggle",a),er(a,"popover",h);break;case"xlinkActuate":Tn(a,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Tn(a,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Tn(a,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Tn(a,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Tn(a,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Tn(a,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Tn(a,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Tn(a,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Tn(a,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":er(a,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Xr.get(u)||u,er(a,u,h))}}function sv(a,o,u,h,p,y){switch(u){case"style":pr(a,h,y);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(p.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"children":typeof h=="string"?wr(a,h):(typeof h=="number"||typeof h=="bigint")&&wr(a,""+h);break;case"onScroll":h!=null&&jt("scroll",a);break;case"onScrollEnd":h!=null&&jt("scrollend",a);break;case"onClick":h!=null&&(a.onclick=Wd);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zt.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(p=u.endsWith("Capture"),o=u.slice(2,p?u.length-7:void 0),y=a[_t]||null,y=y!=null?y[u]:null,typeof y=="function"&&a.removeEventListener(o,y,p),typeof h=="function")){typeof y!="function"&&y!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(o,h,p);break e}u in a?a[u]=h:h===!0?a.setAttribute(u,""):er(a,u,h)}}}function Ar(a,o,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":jt("error",a),jt("load",a);var h=!1,p=!1,y;for(y in u)if(u.hasOwnProperty(y)){var R=u[y];if(R!=null)switch(y){case"src":h=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:hn(a,o,y,R,u,null)}}p&&hn(a,o,"srcSet",u.srcSet,u,null),h&&hn(a,o,"src",u.src,u,null);return;case"input":jt("invalid",a);var D=y=R=p=null,H=null,ee=null;for(h in u)if(u.hasOwnProperty(h)){var pe=u[h];if(pe!=null)switch(h){case"name":p=pe;break;case"type":R=pe;break;case"checked":H=pe;break;case"defaultChecked":ee=pe;break;case"value":y=pe;break;case"defaultValue":D=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,o));break;default:hn(a,o,h,pe,u,null)}}An(a,y,D,H,ee,R,p,!1),Fi(a);return;case"select":jt("invalid",a),h=R=y=null;for(p in u)if(u.hasOwnProperty(p)&&(D=u[p],D!=null))switch(p){case"value":y=D;break;case"defaultValue":R=D;break;case"multiple":h=D;default:hn(a,o,p,D,u,null)}o=y,u=R,a.multiple=!!h,o!=null?tr(a,!!h,o,!1):u!=null&&tr(a,!!h,u,!0);return;case"textarea":jt("invalid",a),y=p=h=null;for(R in u)if(u.hasOwnProperty(R)&&(D=u[R],D!=null))switch(R){case"value":h=D;break;case"defaultValue":p=D;break;case"children":y=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(r(91));break;default:hn(a,o,R,D,u,null)}Lr(a,h,p,y),Fi(a);return;case"option":for(H in u)if(u.hasOwnProperty(H)&&(h=u[H],h!=null))switch(H){case"selected":a.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:hn(a,o,H,h,u,null)}return;case"dialog":jt("cancel",a),jt("close",a);break;case"iframe":case"object":jt("load",a);break;case"video":case"audio":for(h=0;h<xu.length;h++)jt(xu[h],a);break;case"image":jt("error",a),jt("load",a);break;case"details":jt("toggle",a);break;case"embed":case"source":case"link":jt("error",a),jt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in u)if(u.hasOwnProperty(ee)&&(h=u[ee],h!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:hn(a,o,ee,h,u,null)}return;default:if(Ha(o)){for(pe in u)u.hasOwnProperty(pe)&&(h=u[pe],h!==void 0&&sv(a,o,pe,h,u,void 0));return}}for(D in u)u.hasOwnProperty(D)&&(h=u[D],h!=null&&hn(a,o,D,h,u,null))}function GN(a,o,u,h){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,R=null,D=null,H=null,ee=null,pe=null;for(he in u){var Se=u[he];if(u.hasOwnProperty(he)&&Se!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":H=Se;default:h.hasOwnProperty(he)||hn(a,o,he,null,h,Se)}}for(var ue in h){var he=h[ue];if(Se=u[ue],h.hasOwnProperty(ue)&&(he!=null||Se!=null))switch(ue){case"type":y=he;break;case"name":p=he;break;case"checked":ee=he;break;case"defaultChecked":pe=he;break;case"value":R=he;break;case"defaultValue":D=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,o));break;default:he!==Se&&hn(a,o,ue,he,h,Se)}}Hn(a,R,D,H,ee,pe,y,p);return;case"select":he=R=D=ue=null;for(y in u)if(H=u[y],u.hasOwnProperty(y)&&H!=null)switch(y){case"value":break;case"multiple":he=H;default:h.hasOwnProperty(y)||hn(a,o,y,null,h,H)}for(p in h)if(y=h[p],H=u[p],h.hasOwnProperty(p)&&(y!=null||H!=null))switch(p){case"value":ue=y;break;case"defaultValue":D=y;break;case"multiple":R=y;default:y!==H&&hn(a,o,p,y,h,H)}o=D,u=R,h=he,ue!=null?tr(a,!!u,ue,!1):!!h!=!!u&&(o!=null?tr(a,!!u,o,!0):tr(a,!!u,u?[]:"",!1));return;case"textarea":he=ue=null;for(D in u)if(p=u[D],u.hasOwnProperty(D)&&p!=null&&!h.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:hn(a,o,D,null,h,p)}for(R in h)if(p=h[R],y=u[R],h.hasOwnProperty(R)&&(p!=null||y!=null))switch(R){case"value":ue=p;break;case"defaultValue":he=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(r(91));break;default:p!==y&&hn(a,o,R,p,h,y)}Sr(a,ue,he);return;case"option":for(var tt in u)if(ue=u[tt],u.hasOwnProperty(tt)&&ue!=null&&!h.hasOwnProperty(tt))switch(tt){case"selected":a.selected=!1;break;default:hn(a,o,tt,null,h,ue)}for(H in h)if(ue=h[H],he=u[H],h.hasOwnProperty(H)&&ue!==he&&(ue!=null||he!=null))switch(H){case"selected":a.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:hn(a,o,H,ue,h,he)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Et in u)ue=u[Et],u.hasOwnProperty(Et)&&ue!=null&&!h.hasOwnProperty(Et)&&hn(a,o,Et,null,h,ue);for(ee in h)if(ue=h[ee],he=u[ee],h.hasOwnProperty(ee)&&ue!==he&&(ue!=null||he!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,o));break;default:hn(a,o,ee,ue,h,he)}return;default:if(Ha(o)){for(var Xn in u)ue=u[Xn],u.hasOwnProperty(Xn)&&ue!==void 0&&!h.hasOwnProperty(Xn)&&sv(a,o,Xn,void 0,h,ue);for(pe in h)ue=h[pe],he=u[pe],!h.hasOwnProperty(pe)||ue===he||ue===void 0&&he===void 0||sv(a,o,pe,ue,h,he);return}}for(var re in u)ue=u[re],u.hasOwnProperty(re)&&ue!=null&&!h.hasOwnProperty(re)&&hn(a,o,re,null,h,ue);for(Se in h)ue=h[Se],he=u[Se],!h.hasOwnProperty(Se)||ue===he||ue==null&&he==null||hn(a,o,Se,ue,h,he)}var av=null,ov=null;function Xd(a){return a.nodeType===9?a:a.ownerDocument}function Iw(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Dw(a,o){if(a===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&o==="foreignObject"?0:a}function lv(a,o){return a==="textarea"||a==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var cv=null;function JN(){var a=window.event;return a&&a.type==="popstate"?a===cv?!1:(cv=a,!0):(cv=null,!1)}var Fw=typeof setTimeout=="function"?setTimeout:void 0,eI=typeof clearTimeout=="function"?clearTimeout:void 0,kw=typeof Promise=="function"?Promise:void 0,tI=typeof queueMicrotask=="function"?queueMicrotask:typeof kw<"u"?function(a){return kw.resolve(null).then(a).catch(nI)}:Fw;function nI(a){setTimeout(function(){throw a})}function uv(a,o){var u=o,h=0;do{var p=u.nextSibling;if(a.removeChild(u),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(h===0){a.removeChild(p),Bu(o);return}h--}else u!=="$"&&u!=="$?"&&u!=="$!"||h++;u=p}while(u);Bu(o)}function fv(a){var o=a.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var u=o;switch(o=o.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":fv(u),un(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function rI(a,o,u,h){for(;a.nodeType===1;){var p=u;if(a.nodeName.toLowerCase()!==o.toLowerCase()){if(!h&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(h){if(!a[Zn])switch(o){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(y=a.getAttribute("rel"),y==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(y!==p.rel||a.getAttribute("href")!==(p.href==null?null:p.href)||a.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||a.getAttribute("title")!==(p.title==null?null:p.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(y=a.getAttribute("src"),(y!==(p.src==null?null:p.src)||a.getAttribute("type")!==(p.type==null?null:p.type)||a.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(o==="input"&&a.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&a.getAttribute("name")===y)return a}else return a;if(a=Vi(a.nextSibling),a===null)break}return null}function iI(a,o,u){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=Vi(a.nextSibling),a===null))return null;return a}function Vi(a){for(;a!=null;a=a.nextSibling){var o=a.nodeType;if(o===1||o===3)break;if(o===8){if(o=a.data,o==="$"||o==="$!"||o==="$?"||o==="F!"||o==="F")break;if(o==="/$")return null}}return a}function Bw(a){a=a.previousSibling;for(var o=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"){if(o===0)return a;o--}else u==="/$"&&o++}a=a.previousSibling}return null}function Uw(a,o,u){switch(o=Xd(u),a){case"html":if(a=o.documentElement,!a)throw Error(r(452));return a;case"head":if(a=o.head,!a)throw Error(r(453));return a;case"body":if(a=o.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}var Ti=new Map,Lw=new Set;function qd(a){return typeof a.getRootNode=="function"?a.getRootNode():a.ownerDocument}var zs=q.d;q.d={f:sI,r:aI,D:oI,C:lI,L:cI,m:uI,X:dI,S:fI,M:hI};function sI(){var a=zs.f(),o=Ld();return a||o}function aI(a){var o=Ce(a);o!==null&&o.tag===5&&o.type==="form"?dS(o):zs.r(a)}var Ol=typeof document>"u"?null:document;function zw(a,o,u){var h=Ol;if(h&&typeof o=="string"&&o){var p=nn(o);p='link[rel="'+a+'"][href="'+p+'"]',typeof u=="string"&&(p+='[crossorigin="'+u+'"]'),Lw.has(p)||(Lw.add(p),a={rel:a,crossOrigin:u,href:o},h.querySelector(p)===null&&(o=h.createElement("link"),Ar(o,"link",a),be(o),h.head.appendChild(o)))}}function oI(a){zs.D(a),zw("dns-prefetch",a,null)}function lI(a,o){zs.C(a,o),zw("preconnect",a,o)}function cI(a,o,u){zs.L(a,o,u);var h=Ol;if(h&&a&&o){var p='link[rel="preload"][as="'+nn(o)+'"]';o==="image"&&u&&u.imageSrcSet?(p+='[imagesrcset="'+nn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(p+='[imagesizes="'+nn(u.imageSizes)+'"]')):p+='[href="'+nn(a)+'"]';var y=p;switch(o){case"style":y=Pl(a);break;case"script":y=Nl(a)}Ti.has(y)||(a=V({rel:"preload",href:o==="image"&&u&&u.imageSrcSet?void 0:a,as:o},u),Ti.set(y,a),h.querySelector(p)!==null||o==="style"&&h.querySelector(Ou(y))||o==="script"&&h.querySelector(Pu(y))||(o=h.createElement("link"),Ar(o,"link",a),be(o),h.head.appendChild(o)))}}function uI(a,o){zs.m(a,o);var u=Ol;if(u&&a){var h=o&&typeof o.as=="string"?o.as:"script",p='link[rel="modulepreload"][as="'+nn(h)+'"][href="'+nn(a)+'"]',y=p;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Nl(a)}if(!Ti.has(y)&&(a=V({rel:"modulepreload",href:a},o),Ti.set(y,a),u.querySelector(p)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Pu(y)))return}h=u.createElement("link"),Ar(h,"link",a),be(h),u.head.appendChild(h)}}}function fI(a,o,u){zs.S(a,o,u);var h=Ol;if(h&&a){var p=De(h).hoistableStyles,y=Pl(a);o=o||"default";var R=p.get(y);if(!R){var D={loading:0,preload:null};if(R=h.querySelector(Ou(y)))D.loading=5;else{a=V({rel:"stylesheet",href:a,"data-precedence":o},u),(u=Ti.get(y))&&dv(a,u);var H=R=h.createElement("link");be(H),Ar(H,"link",a),H._p=new Promise(function(ee,pe){H.onload=ee,H.onerror=pe}),H.addEventListener("load",function(){D.loading|=1}),H.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Yd(R,o,h)}R={type:"stylesheet",instance:R,count:1,state:D},p.set(y,R)}}}function dI(a,o){zs.X(a,o);var u=Ol;if(u&&a){var h=De(u).hoistableScripts,p=Nl(a),y=h.get(p);y||(y=u.querySelector(Pu(p)),y||(a=V({src:a,async:!0},o),(o=Ti.get(p))&&hv(a,o),y=u.createElement("script"),be(y),Ar(y,"link",a),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},h.set(p,y))}}function hI(a,o){zs.M(a,o);var u=Ol;if(u&&a){var h=De(u).hoistableScripts,p=Nl(a),y=h.get(p);y||(y=u.querySelector(Pu(p)),y||(a=V({src:a,async:!0,type:"module"},o),(o=Ti.get(p))&&hv(a,o),y=u.createElement("script"),be(y),Ar(y,"link",a),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},h.set(p,y))}}function $w(a,o,u,h){var p=(p=_e.current)?qd(p):null;if(!p)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(o=Pl(u.href),u=De(p).hoistableStyles,h=u.get(o),h||(h={type:"style",instance:null,count:0,state:null},u.set(o,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=Pl(u.href);var y=De(p).hoistableStyles,R=y.get(a);if(R||(p=p.ownerDocument||p,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(a,R),(y=p.querySelector(Ou(a)))&&!y._p&&(R.instance=y,R.state.loading=5),Ti.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Ti.set(a,u),y||gI(p,a,u,R.state))),o&&h===null)throw Error(r(528,""));return R}if(o&&h!==null)throw Error(r(529,""));return null;case"script":return o=u.async,u=u.src,typeof u=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Nl(u),u=De(p).hoistableScripts,h=u.get(o),h||(h={type:"script",instance:null,count:0,state:null},u.set(o,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Pl(a){return'href="'+nn(a)+'"'}function Ou(a){return'link[rel="stylesheet"]['+a+"]"}function Vw(a){return V({},a,{"data-precedence":a.precedence,precedence:null})}function gI(a,o,u,h){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?h.loading=1:(o=a.createElement("link"),h.preload=o,o.addEventListener("load",function(){return h.loading|=1}),o.addEventListener("error",function(){return h.loading|=2}),Ar(o,"link",u),be(o),a.head.appendChild(o))}function Nl(a){return'[src="'+nn(a)+'"]'}function Pu(a){return"script[async]"+a}function Hw(a,o,u){if(o.count++,o.instance===null)switch(o.type){case"style":var h=a.querySelector('style[data-href~="'+nn(u.href)+'"]');if(h)return o.instance=h,be(h),h;var p=V({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),be(h),Ar(h,"style",p),Yd(h,u.precedence,a),o.instance=h;case"stylesheet":p=Pl(u.href);var y=a.querySelector(Ou(p));if(y)return o.state.loading|=4,o.instance=y,be(y),y;h=Vw(u),(p=Ti.get(p))&&dv(h,p),y=(a.ownerDocument||a).createElement("link"),be(y);var R=y;return R._p=new Promise(function(D,H){R.onload=D,R.onerror=H}),Ar(y,"link",h),o.state.loading|=4,Yd(y,u.precedence,a),o.instance=y;case"script":return y=Nl(u.src),(p=a.querySelector(Pu(y)))?(o.instance=p,be(p),p):(h=u,(p=Ti.get(y))&&(h=V({},u),hv(h,p)),a=a.ownerDocument||a,p=a.createElement("script"),be(p),Ar(p,"link",h),a.head.appendChild(p),o.instance=p);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&!(o.state.loading&4)&&(h=o.instance,o.state.loading|=4,Yd(h,u.precedence,a));return o.instance}function Yd(a,o,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=h.length?h[h.length-1]:null,y=p,R=0;R<h.length;R++){var D=h[R];if(D.dataset.precedence===o)y=D;else if(y!==p)break}y?y.parentNode.insertBefore(a,y.nextSibling):(o=u.nodeType===9?u.head:u,o.insertBefore(a,o.firstChild))}function dv(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function hv(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var Kd=null;function jw(a,o,u){if(Kd===null){var h=new Map,p=Kd=new Map;p.set(u,h)}else p=Kd,h=p.get(u),h||(h=new Map,p.set(u,h));if(h.has(a))return h;for(h.set(a,null),u=u.getElementsByTagName(a),p=0;p<u.length;p++){var y=u[p];if(!(y[Zn]||y[bt]||a==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var R=y.getAttribute(o)||"";R=a+R;var D=h.get(R);D?D.push(y):h.set(R,[y])}}return h}function Ww(a,o,u){a=a.ownerDocument||a,a.head.insertBefore(u,o==="title"?a.querySelector("head > title"):null)}function pI(a,o,u){if(u===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return a=o.disabled,typeof o.precedence=="string"&&a==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function Xw(a){return!(a.type==="stylesheet"&&!(a.state.loading&3))}var Nu=null;function mI(){}function vI(a,o,u){if(Nu===null)throw Error(r(475));var h=Nu;if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&!(o.state.loading&4)){if(o.instance===null){var p=Pl(u.href),y=a.querySelector(Ou(p));if(y){a=y._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(h.count++,h=Zd.bind(h),a.then(h,h)),o.state.loading|=4,o.instance=y,be(y);return}y=a.ownerDocument||a,u=Vw(u),(p=Ti.get(p))&&dv(u,p),y=y.createElement("link"),be(y);var R=y;R._p=new Promise(function(D,H){R.onload=D,R.onerror=H}),Ar(y,"link",u),o.instance=y}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(o,a),(a=o.state.preload)&&!(o.state.loading&3)&&(h.count++,o=Zd.bind(h),a.addEventListener("load",o),a.addEventListener("error",o))}}function _I(){if(Nu===null)throw Error(r(475));var a=Nu;return a.stylesheets&&a.count===0&&gv(a,a.stylesheets),0<a.count?function(o){var u=setTimeout(function(){if(a.stylesheets&&gv(a,a.stylesheets),a.unsuspend){var h=a.unsuspend;a.unsuspend=null,h()}},6e4);return a.unsuspend=o,function(){a.unsuspend=null,clearTimeout(u)}}:null}function Zd(){if(this.count--,this.count===0){if(this.stylesheets)gv(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Qd=null;function gv(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Qd=new Map,o.forEach(yI,a),Qd=null,Zd.call(a))}function yI(a,o){if(!(o.state.loading&4)){var u=Qd.get(a);if(u)var h=u.get(null);else{u=new Map,Qd.set(a,u);for(var p=a.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var R=p[y];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(u.set(R.dataset.precedence,R),h=R)}h&&u.set(null,h)}p=o.instance,R=p.getAttribute("data-precedence"),y=u.get(R)||h,y===h&&u.set(null,p),u.set(R,p),this.count++,h=Zd.bind(this),p.addEventListener("load",h),p.addEventListener("error",h),y?y.parentNode.insertBefore(p,y.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(p,a.firstChild)),o.state.loading|=4}}var Iu={$$typeof:S,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function bI(a,o,u,h,p,y,R,D){this.tag=1,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ne(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ne(0),this.hiddenUpdates=Ne(null),this.identifierPrefix=h,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function qw(a,o,u,h,p,y,R,D,H,ee,pe,Se){return a=new bI(a,o,u,R,D,H,ee,Se),o=1,y===!0&&(o|=24),y=wi(3,null,null,o),a.current=y,y.stateNode=a,o=Xp(),o.refCount++,a.pooledCache=o,o.refCount++,y.memoizedState={element:h,isDehydrated:u,cache:o},Cm(y),a}function Yw(a){return a?(a=ul,a):ul}function Kw(a,o,u,h,p,y){p=Yw(p),h.context===null?h.context=p:h.pendingContext=p,h=ra(o),h.payload={element:u},y=y===void 0?null:y,y!==null&&(h.callback=y),u=ia(a,h,o),u!==null&&($r(u,a,o),mu(u,a,o))}function Zw(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<o?u:o}}function pv(a,o){Zw(a,o),(a=a.alternate)&&Zw(a,o)}function Qw(a){if(a.tag===13){var o=Zs(a,67108864);o!==null&&$r(o,a,67108864),pv(a,67108864)}}var Gd=!0;function SI(a,o,u,h){var p=I.T;I.T=null;var y=q.p;try{q.p=2,mv(a,o,u,h)}finally{q.p=y,I.T=p}}function wI(a,o,u,h){var p=I.T;I.T=null;var y=q.p;try{q.p=8,mv(a,o,u,h)}finally{q.p=y,I.T=p}}function mv(a,o,u,h){if(Gd){var p=vv(h);if(p===null)iv(a,o,h,Jd,u),Jw(a,h);else if(TI(p,a,o,u,h))h.stopPropagation();else if(Jw(a,h),o&4&&-1<EI.indexOf(a)){for(;p!==null;){var y=Ce(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var R=It(y.pendingLanes);if(R!==0){var D=y;for(D.pendingLanes|=2,D.entangledLanes|=2;R;){var H=1<<31-ht(R);D.entanglements[1]|=H,R&=~H}os(y),!(zn&6)&&(kd=Me()+500,Ru(0))}}break;case 13:D=Zs(y,2),D!==null&&$r(D,y,2),Ld(),pv(y,2)}if(y=vv(h),y===null&&iv(a,o,h,Jd,u),y===p)break;p=y}p!==null&&h.stopPropagation()}else iv(a,o,h,null,u)}}function vv(a){return a=hi(a),_v(a)}var Jd=null;function _v(a){if(Jd=null,a=rn(a),a!==null){var o=W(a);if(o===null)a=null;else{var u=o.tag;if(u===13){if(a=Z(o),a!==null)return a;a=null}else if(u===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return Jd=a,null}function Gw(a){switch(a){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(dt()){case rt:return 2;case it:return 8;case st:case at:return 32;case Je:return 268435456;default:return 32}default:return 32}}var yv=!1,fa=null,da=null,ha=null,Du=new Map,Fu=new Map,ga=[],EI="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".split(" ");function Jw(a,o){switch(a){case"focusin":case"focusout":fa=null;break;case"dragenter":case"dragleave":da=null;break;case"mouseover":case"mouseout":ha=null;break;case"pointerover":case"pointerout":Du.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fu.delete(o.pointerId)}}function ku(a,o,u,h,p,y){return a===null||a.nativeEvent!==y?(a={blockedOn:o,domEventName:u,eventSystemFlags:h,nativeEvent:y,targetContainers:[p]},o!==null&&(o=Ce(o),o!==null&&Qw(o)),a):(a.eventSystemFlags|=h,o=a.targetContainers,p!==null&&o.indexOf(p)===-1&&o.push(p),a)}function TI(a,o,u,h,p){switch(o){case"focusin":return fa=ku(fa,a,o,u,h,p),!0;case"dragenter":return da=ku(da,a,o,u,h,p),!0;case"mouseover":return ha=ku(ha,a,o,u,h,p),!0;case"pointerover":var y=p.pointerId;return Du.set(y,ku(Du.get(y)||null,a,o,u,h,p)),!0;case"gotpointercapture":return y=p.pointerId,Fu.set(y,ku(Fu.get(y)||null,a,o,u,h,p)),!0}return!1}function eE(a){var o=rn(a.target);if(o!==null){var u=W(o);if(u!==null){if(o=u.tag,o===13){if(o=Z(u),o!==null){a.blockedOn=o,We(a.priority,function(){if(u.tag===13){var h=ii(),p=Zs(u,h);p!==null&&$r(p,u,h),pv(u,h)}});return}}else if(o===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function eh(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var u=vv(a.nativeEvent);if(u===null){u=a.nativeEvent;var h=new u.constructor(u.type,u);di=h,u.target.dispatchEvent(h),di=null}else return o=Ce(u),o!==null&&Qw(o),a.blockedOn=u,!1;o.shift()}return!0}function tE(a,o,u){eh(a)&&u.delete(o)}function AI(){yv=!1,fa!==null&&eh(fa)&&(fa=null),da!==null&&eh(da)&&(da=null),ha!==null&&eh(ha)&&(ha=null),Du.forEach(tE),Fu.forEach(tE)}function th(a,o){a.blockedOn===o&&(a.blockedOn=null,yv||(yv=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,AI)))}var nh=null;function nE(a){nh!==a&&(nh=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){nh===a&&(nh=null);for(var o=0;o<a.length;o+=3){var u=a[o],h=a[o+1],p=a[o+2];if(typeof h!="function"){if(_v(h||u)===null)continue;break}var y=Ce(u);y!==null&&(a.splice(o,3),o-=3,lm(y,{pending:!0,data:p,method:u.method,action:h},h,p))}}))}function Bu(a){function o(H){return th(H,a)}fa!==null&&th(fa,a),da!==null&&th(da,a),ha!==null&&th(ha,a),Du.forEach(o),Fu.forEach(o);for(var u=0;u<ga.length;u++){var h=ga[u];h.blockedOn===a&&(h.blockedOn=null)}for(;0<ga.length&&(u=ga[0],u.blockedOn===null);)eE(u),u.blockedOn===null&&ga.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var p=u[h],y=u[h+1],R=p[_t]||null;if(typeof y=="function")R||nE(u);else if(R){var D=null;if(y&&y.hasAttribute("formAction")){if(p=y,R=y[_t]||null)D=R.formAction;else if(_v(p)!==null)continue}else D=R.action;typeof D=="function"?u[h+1]=D:(u.splice(h,3),h-=3),nE(u)}}}function bv(a){this._internalRoot=a}rh.prototype.render=bv.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(r(409));var u=o.current,h=ii();Kw(u,h,a,o,null,null)},rh.prototype.unmount=bv.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;a.tag===0&&Rl(),Kw(a.current,2,null,a,null,null),Ld(),o[Zt]=null}};function rh(a){this._internalRoot=a}rh.prototype.unstable_scheduleHydration=function(a){if(a){var o=Ye();a={blockedOn:null,target:a,priority:o};for(var u=0;u<ga.length&&o!==0&&o<ga[u].priority;u++);ga.splice(u,0,a),u===0&&eE(a)}};var rE=e.version;if(rE!=="19.0.0")throw Error(r(527,rE,"19.0.0"));q.findDOMNode=function(a){var o=a._reactInternals;if(o===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=$(o),a=a!==null?ie(a):null,a=a===null?null:a.stateNode,a};var CI={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:I,findFiberByHostInstance:rn,reconcilerVersion:"19.0.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ih=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ih.isDisabled&&ih.supportsFiber)try{ct=ih.inject(CI),mt=ih}catch{}}return Lu.createRoot=function(a,o){if(!i(a))throw Error(r(299));var u=!1,h="",p=bS,y=SS,R=wS,D=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onUncaughtError!==void 0&&(p=o.onUncaughtError),o.onCaughtError!==void 0&&(y=o.onCaughtError),o.onRecoverableError!==void 0&&(R=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(D=o.unstable_transitionCallbacks)),o=qw(a,1,!1,null,null,u,h,p,y,R,D,null),a[Zt]=o.current,rv(a.nodeType===8?a.parentNode:a),new bv(o)},Lu.hydrateRoot=function(a,o,u){if(!i(a))throw Error(r(299));var h=!1,p="",y=bS,R=SS,D=wS,H=null,ee=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(p=u.identifierPrefix),u.onUncaughtError!==void 0&&(y=u.onUncaughtError),u.onCaughtError!==void 0&&(R=u.onCaughtError),u.onRecoverableError!==void 0&&(D=u.onRecoverableError),u.unstable_transitionCallbacks!==void 0&&(H=u.unstable_transitionCallbacks),u.formState!==void 0&&(ee=u.formState)),o=qw(a,1,!0,o,u??null,h,p,y,R,D,H,ee),o.context=Yw(null),u=o.current,h=ii(),p=ra(h),p.callback=null,ia(u,p,h),o.current.lanes=h,wt(o,h),os(o),a[Zt]=o.current,rv(a),new rh(o)},Lu.version="19.0.0",Lu}var AE;function w6(){if(AE)return Av.exports;AE=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Av.exports=S6(),Av.exports}var E6=w6();function Kh(t,e){if(!t)throw new Error(e||"loader assertion failed.")}const Hy=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),CE=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);CE&&parseFloat(CE[1]);const oh=globalThis,Il=globalThis.process||{},T6=globalThis.navigator||{};function TR(t){var r,i;if(typeof window<"u"&&((r=window.process)==null?void 0:r.type)==="renderer"||typeof process<"u"&&((i=process.versions)!=null&&i.electron))return!0;const n=typeof navigator<"u"&&navigator.userAgent;return!!(n&&n.indexOf("Electron")>=0)}function qo(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||TR()}function A6(t){return qo()?TR()?"Electron":(T6.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const AR="4.1.0";function C6(t){try{const e=window[t],n="__storage_test__";return e.setItem(n,n),e.removeItem(n),e}catch{return null}}class R6{constructor(e,n,r="sessionStorage"){this.storage=C6(r),this.id=e,this.config=n,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const n=JSON.stringify(this.config);this.storage.setItem(this.id,n)}}_loadConfiguration(){let e={};if(this.storage){const n=this.storage.getItem(this.id);e=n?JSON.parse(n):{}}return Object.assign(this.config,e),this}}function x6(t){let e;return t<10?e=`${t.toFixed(2)}ms`:t<100?e=`${t.toFixed(1)}ms`:t<1e3?e=`${t.toFixed(0)}ms`:e=`${(t/1e3).toFixed(2)}s`,e}function M6(t,e=8){const n=Math.max(e-t.length,0);return`${" ".repeat(n)}${t}`}var Zh;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Zh||(Zh={}));const O6=10;function RE(t){return typeof t!="string"?t:(t=t.toUpperCase(),Zh[t]||Zh.WHITE)}function P6(t,e,n){return!qo&&typeof t=="string"&&(e&&(t=`\x1B[${RE(e)}m${t}\x1B[39m`),n&&(t=`\x1B[${RE(n)+O6}m${t}\x1B[49m`)),t}function N6(t,e=["constructor"]){const n=Object.getPrototypeOf(t),r=Object.getOwnPropertyNames(n),i=t;for(const s of r){const l=i[s];typeof l=="function"&&(e.find(c=>s===c)||(i[s]=l.bind(t)))}}function jy(t,e){if(!t)throw new Error("Assertion failed")}function Dl(){var e,n,r;let t;if(qo()&&oh.performance)t=(n=(e=oh==null?void 0:oh.performance)==null?void 0:e.now)==null?void 0:n.call(e);else if("hrtime"in Il){const i=(r=Il==null?void 0:Il.hrtime)==null?void 0:r.call(Il);t=i[0]*1e3+i[1]/1e6}else t=Date.now();return t}const Fl={debug:qo()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},I6={enabled:!0,level:0};function kl(){}const xE={},ME={once:!0};class Wf{constructor({id:e}={id:""}){this.VERSION=AR,this._startTs=Dl(),this._deltaTs=Dl(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new R6(`__probe-${this.id}__`,I6),this.timeStamp(`${this.id} started`),N6(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Dl()-this._startTs).toPrecision(10))}getDelta(){return Number((Dl()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,n){this._storage.setConfiguration({[e]:n})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,n){if(!e)throw new Error(n||"Assertion failed")}warn(e){return this._getLogFunction(0,e,Fl.warn,arguments,ME)}error(e){return this._getLogFunction(0,e,Fl.error,arguments)}deprecated(e,n){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${n}\` instead`)}removed(e,n){return this.error(`\`${e}\` has been removed. Use \`${n}\` instead`)}probe(e,n){return this._getLogFunction(e,n,Fl.log,arguments,{time:!0,once:!0})}log(e,n){return this._getLogFunction(e,n,Fl.debug,arguments)}info(e,n){return this._getLogFunction(e,n,console.info,arguments)}once(e,n){return this._getLogFunction(e,n,Fl.debug||Fl.info,arguments,ME)}table(e,n,r){return n?this._getLogFunction(e,n,console.table||kl,r&&[r],{tag:F6(n)}):kl}time(e,n){return this._getLogFunction(e,n,console.time?console.time:console.info)}timeEnd(e,n){return this._getLogFunction(e,n,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,n){return this._getLogFunction(e,n,console.timeStamp||kl)}group(e,n,r={collapsed:!1}){const i=OE({logLevel:e,message:n,opts:r}),{collapsed:s}=r;return i.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,n,r={}){return this.group(e,n,Object.assign({},r,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||kl)}withGroup(e,n,r){this.group(e,n)();try{r()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=CR(e)}_getLogFunction(e,n,r,i,s){if(this._shouldLog(e)){s=OE({logLevel:e,message:n,args:i,opts:s}),r=r||s.method,jy(r),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=Dl();const l=s.tag||s.message;if(s.once&&l)if(!xE[l])xE[l]=Dl();else return kl;return n=D6(this.id,s.message,s),r.bind(console,n,...s.args)}return kl}}Wf.VERSION=AR;function CR(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return jy(Number.isFinite(e)&&e>=0),e}function OE(t){const{logLevel:e,message:n}=t;t.logLevel=CR(e);const r=t.args?Array.from(t.args):[];for(;r.length&&r.shift()!==n;);switch(typeof e){case"string":case"function":n!==void 0&&r.unshift(n),t.message=e;break;case"object":Object.assign(t,e);break}typeof t.message=="function"&&(t.message=t.message());const i=typeof t.message;return jy(i==="string"||i==="object"),Object.assign(t,{args:r},t.opts)}function D6(t,e,n){if(typeof e=="string"){const r=n.time?M6(x6(n.total)):"";e=n.time?`${t}: ${r} ${e}`:`${t}: ${e}`,e=P6(e,n.color,n.background)}return e}function F6(t){for(const e in t)for(const n in t[e])return n||"untitled";return"empty"}const Mv="4.3.2",k6=Mv[0]>="0"&&Mv[0]<="9"?`v${Mv}`:"";function B6(){const t=new Wf({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=t,globalThis.loaders.version=k6,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=t,t}const U6=B6();function L6(t,e){return RR(t||{},e)}function RR(t,e,n=0){if(n>3)return e;const r={...t};for(const[i,s]of Object.entries(e))s&&typeof s=="object"&&!Array.isArray(s)?r[i]=RR(r[i]||{},e[i],n+1):r[i]=e[i];return r}const z6="latest";function $6(){var t;return(t=globalThis._loadersgl_)!=null&&t.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.2"),globalThis._loadersgl_.version}const V6=$6();function za(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}const Do=typeof process!="object"||String(process)!=="[object process]"||process.browser,H6=typeof window<"u"&&typeof window.orientation<"u",PE=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);PE&&parseFloat(PE[1]);class j6{constructor(e,n){O(this,"name");O(this,"workerThread");O(this,"isRunning",!0);O(this,"result");O(this,"_resolve",()=>{});O(this,"_reject",()=>{});this.name=e,this.workerThread=n,this.result=new Promise((r,i)=>{this._resolve=r,this._reject=i})}postMessage(e,n){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:n})}done(e){za(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){za(this.isRunning),this.isRunning=!1,this._reject(e)}}class Ov{terminate(){}}const Pv=new Map;function W6(t){za(t.source&&!t.url||!t.source&&t.url);let e=Pv.get(t.source||t.url);return e||(t.url&&(e=X6(t.url),Pv.set(t.url,e)),t.source&&(e=xR(t.source),Pv.set(t.source,e))),za(e),e}function X6(t){if(!t.startsWith("http"))return t;const e=q6(t);return xR(e)}function xR(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function q6(t){return`try {
importScripts('${t}');
} catch (error) {
console.error(error);
throw error;
}`}function MR(t,e=!0,n){const r=n||new Set;if(t){if(NE(t))r.add(t);else if(NE(t.buffer))r.add(t.buffer);else if(!ArrayBuffer.isView(t)){if(e&&typeof t=="object")for(const i in t)MR(t[i],e,r)}}return n===void 0?Array.from(r):[]}function NE(t){return t?t instanceof ArrayBuffer||typeof MessagePort<"u"&&t instanceof MessagePort||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas:!1}const Nv=()=>{};class j0{constructor(e){O(this,"name");O(this,"source");O(this,"url");O(this,"terminated",!1);O(this,"worker");O(this,"onMessage");O(this,"onError");O(this,"_loadableURL","");const{name:n,source:r,url:i}=e;za(r||i),this.name=n,this.source=r,this.url=i,this.onMessage=Nv,this.onError=s=>console.log(s),this.worker=Do?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker<"u"&&Do||typeof Ov<"u"&&!Do}destroy(){this.onMessage=Nv,this.onError=Nv,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,n){n=n||MR(e),this.worker.postMessage(e,n)}_getErrorFromErrorEvent(e){let n="Failed to load ";return n+=`worker ${this.name} from ${this.url}. `,e.message&&(n+=`${e.message} in `),e.lineno&&(n+=`:${e.lineno}:${e.colno}`),new Error(n)}_createBrowserWorker(){this._loadableURL=W6({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=n=>{n.data?this.onMessage(n.data):this.onError(new Error("No data received"))},e.onerror=n=>{this.onError(this._getErrorFromErrorEvent(n)),this.terminated=!0},e.onmessageerror=n=>console.error(n),e}_createNodeWorker(){let e;if(this.url){const r=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new Ov(r,{eval:!1})}else if(this.source)e=new Ov(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",n=>{this.onMessage(n)}),e.on("error",n=>{this.onError(n)}),e.on("exit",n=>{}),e}}class Y6{constructor(e){O(this,"name","unnamed");O(this,"source");O(this,"url");O(this,"maxConcurrency",1);O(this,"maxMobileConcurrency",1);O(this,"onDebug",()=>{});O(this,"reuseWorkers",!0);O(this,"props",{});O(this,"jobQueue",[]);O(this,"idleQueue",[]);O(this,"count",0);O(this,"isDestroyed",!1);this.source=e.source,this.url=e.url,this.setProps(e)}static isSupported(){return j0.isSupported()}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,n=(i,s,l)=>i.done(l),r=(i,s)=>i.error(s)){const i=new Promise(s=>(this.jobQueue.push({name:e,onMessage:n,onError:r,onStart:s}),this));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const n=this.jobQueue.shift();if(n){this.onDebug({message:"Starting job",name:n.name,workerThread:e,backlog:this.jobQueue.length});const r=new j6(n.name,e);e.onMessage=i=>n.onMessage(r,i.type,i.payload),e.onError=i=>n.onError(r,i),n.onStart(r);try{await r.result}catch(i){console.error(`Worker exception: ${i}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!Do||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new j0({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return H6?this.maxMobileConcurrency:this.maxConcurrency}}const K6={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Ta=class Ta{constructor(e){O(this,"props");O(this,"workerPools",new Map);this.props={...K6},this.setProps(e),this.workerPools=new Map}static isSupported(){return j0.isSupported()}static getWorkerFarm(e={}){return Ta._workerFarm=Ta._workerFarm||new Ta({}),Ta._workerFarm.setProps(e),Ta._workerFarm}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const n of this.workerPools.values())n.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:n,source:r,url:i}=e;let s=this.workerPools.get(n);return s||(s=new Y6({name:n,source:r,url:i}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(n,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}};O(Ta,"_workerFarm");let Qh=Ta;function Z6(t,e={}){const n=e[t.id]||{},r=Do?`${t.id}-worker.js`:`${t.id}-worker-node.js`;let i=n.workerUrl;if(!i&&t.id==="compression"&&(i=e.workerUrl),e._workerType==="test"&&(Do?i=`modules/${t.module}/dist/${r}`:i=`modules/${t.module}/src/workers/${t.id}-worker-node.ts`),!i){let s=t.version;s==="latest"&&(s=z6);const l=s?`@${s}`:"";i=`https://unpkg.com/@loaders.gl/${t.module}${l}/dist/${r}`}return za(i),i}function Q6(t,e=V6){za(t,"no worker provided");const n=t.version;return!(!e||!n)}function G6(t,e){return!Qh.isSupported()||!Do&&!(e!=null&&e._nodeWorkers)?!1:t.worker&&(e==null?void 0:e.worker)}async function J6(t,e,n,r,i){const s=t.id,l=Z6(t,n),f=Qh.getWorkerFarm(n).getWorkerPool({name:s,url:l});n=JSON.parse(JSON.stringify(n)),r=JSON.parse(JSON.stringify(r||{}));const d=await f.startJob("process-on-worker",eD.bind(null,i));return d.postMessage("process",{input:e,options:n,context:r}),await(await d.result).result}async function eD(t,e,n,r){switch(n){case"done":e.done(r);break;case"error":e.error(new Error(r.error));break;case"process":const{id:i,input:s,options:l}=r;try{const c=await t(s,l);e.postMessage("done",{id:i,result:c})}catch(c){const f=c instanceof Error?c.message:"unknown error";e.postMessage("error",{id:i,error:f})}break;default:console.warn(`parse-with-worker unknown message ${n}`)}}function tD(t,e,n){if(n=n||t.byteLength,t.byteLength<n||e.byteLength<n)return!1;const r=new Uint8Array(t),i=new Uint8Array(e);for(let s=0;s<r.length;++s)if(r[s]!==i[s])return!1;return!0}function nD(...t){return rD(t)}function rD(t){const e=t.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),n=e.reduce((s,l)=>s+l.byteLength,0),r=new Uint8Array(n);let i=0;for(const s of e)r.set(s,i),i+=s.byteLength;return r.buffer}async function iD(t){const e=[];for await(const n of t)e.push(n);return nD(...e)}function IE(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){const e=process.hrtime();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}class DE{constructor(e,n){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=e,this.type=n,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=IE(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(IE()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class ip{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,n="count"){return this._getOrCreate({name:e,type:n})}get size(){return Object.keys(this.stats).length}reset(){for(const e of Object.values(this.stats))e.reset();return this}forEach(e){for(const n of Object.values(this.stats))e(n)}getTable(){const e={};return this.forEach(n=>{e[n.name]={time:n.time||0,count:n.count||0,average:n.getAverageTime()||0,hz:n.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(n=>this._getOrCreate(n))}_getOrCreate(e){const{name:n,type:r}=e;let i=this.stats[n];return i||(e instanceof DE?i=e:i=new DE(n,r),this.stats[n]=i),i}}let sD="";const FE={};function aD(t){for(const e in FE)if(t.startsWith(e)){const n=FE[e];t=t.replace(e,n)}return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${sD}${t}`),t}function oD(t){return t&&typeof t=="object"&&t.isBuffer}function OR(t){if(oD(t))return t;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if(typeof t=="string"){const e=t;return new TextEncoder().encode(e).buffer}if(t&&typeof t=="object"&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function PR(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function lD(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}const cD=t=>typeof t=="boolean",nf=t=>typeof t=="function",Xf=t=>t!==null&&typeof t=="object",kE=t=>Xf(t)&&t.constructor==={}.constructor,uD=t=>!!t&&typeof t[Symbol.iterator]=="function",fD=t=>t&&typeof t[Symbol.asyncIterator]=="function",Yo=t=>typeof Response<"u"&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,Ko=t=>typeof Blob<"u"&&t instanceof Blob,dD=t=>t&&typeof t=="object"&&t.isBuffer,hD=t=>typeof ReadableStream<"u"&&t instanceof ReadableStream||Xf(t)&&nf(t.tee)&&nf(t.cancel)&&nf(t.getReader),gD=t=>Xf(t)&&nf(t.read)&&nf(t.pipe)&&cD(t.readable),NR=t=>hD(t)||gD(t);class pD extends Error{constructor(n,r){super(n);O(this,"reason");O(this,"url");O(this,"response");this.reason=r.reason,this.url=r.url,this.response=r.response}}const mD=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,vD=/^([-\w.]+\/[-\w.+]+)/;function BE(t,e){return t.toLowerCase()===e.toLowerCase()}function _D(t){const e=vD.exec(t);return e?e[1]:t}function UE(t){const e=mD.exec(t);return e?e[1]:""}const IR=/\?.*/;function yD(t){const e=t.match(IR);return e&&e[0]}function Wy(t){return t.replace(IR,"")}function bD(t){if(t.length<50)return t;const e=t.slice(t.length-15);return`${t.substr(0,32)}...${e}`}function sp(t){return Yo(t)?t.url:Ko(t)?t.name||"":typeof t=="string"?t:""}function Xy(t){if(Yo(t)){const e=t,n=e.headers.get("content-type")||"",r=Wy(e.url);return _D(n)||UE(r)}return Ko(t)?t.type||"":typeof t=="string"?UE(t):""}function SD(t){return Yo(t)?t.headers["content-length"]||-1:Ko(t)?t.size:typeof t=="string"?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}async function DR(t){if(Yo(t))return t;const e={},n=SD(t);n>=0&&(e["content-length"]=String(n));const r=sp(t),i=Xy(t);i&&(e["content-type"]=i);const s=await TD(t);s&&(e["x-first-bytes"]=s),typeof t=="string"&&(t=new TextEncoder().encode(t));const l=new Response(t,{headers:e});return Object.defineProperty(l,"url",{value:r}),l}async function wD(t){if(!t.ok)throw await ED(t)}async function ED(t){const e=bD(t.url);let n=`Failed to fetch resource (${t.status}) ${t.statusText}: ${e}`;n=n.length>100?`${n.slice(0,100)}...`:n;const r={reason:t.statusText,url:t.url,response:t};try{const i=t.headers.get("Content-Type");r.reason=!t.bodyUsed&&(i!=null&&i.includes("application/json"))?await t.json():await t.text()}catch{}return new pD(n,r)}async function TD(t){if(typeof t=="string")return`data:,${t.slice(0,5)}`;if(t instanceof Blob){const n=t.slice(0,5);return await new Promise(r=>{const i=new FileReader;i.onload=s=>{var l;return r((l=s==null?void 0:s.target)==null?void 0:l.result)},i.readAsDataURL(n)})}if(t instanceof ArrayBuffer){const n=t.slice(0,5);return`data:base64,${AD(n)}`}return null}function AD(t){let e="";const n=new Uint8Array(t);for(let r=0;r<n.byteLength;r++)e+=String.fromCharCode(n[r]);return btoa(e)}function CD(t){return!RD(t)&&!xD(t)}function RD(t){return t.startsWith("http:")||t.startsWith("https:")}function xD(t){return t.startsWith("data:")}async function LE(t,e){var n,r;if(typeof t=="string"){const i=aD(t);return CD(i)&&(n=globalThis.loaders)!=null&&n.fetchNode?(r=globalThis.loaders)==null?void 0:r.fetchNode(i,e):await fetch(i,e)}return await DR(t)}const zE=new Wf({id:"loaders.gl"});class MD{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}class OD{constructor(){O(this,"console");this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}}const FR={fetch:null,mimeType:void 0,nothrow:!1,log:new OD,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Hy,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},PD={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function kR(){globalThis.loaders=globalThis.loaders||{};const{loaders:t}=globalThis;return t._state||(t._state={}),t._state}function BR(){const t=kR();return t.globalOptions=t.globalOptions||{...FR},t.globalOptions}function ND(t,e,n,r){return n=n||[],n=Array.isArray(n)?n:[n],ID(t,n),FD(e,t,r)}function ID(t,e){$E(t,null,FR,PD,e);for(const n of e){const r=t&&t[n.id]||{},i=n.options&&n.options[n.id]||{},s=n.deprecatedOptions&&n.deprecatedOptions[n.id]||{};$E(r,n.id,i,s,e)}}function $E(t,e,n,r,i){const s=e||"Top level",l=e?`${e}.`:"";for(const c in t){const f=!e&&Xf(t[c]),d=c==="baseUri"&&!e,g=c==="workerUrl"&&e;if(!(c in n)&&!d&&!g){if(c in r)zE.warn(`${s} loader option '${l}${c}' no longer supported, use '${r[c]}'`)();else if(!f){const m=DD(c,i);zE.warn(`${s} loader option '${l}${c}' not recognized. ${m}`)()}}}}function DD(t,e){const n=t.toLowerCase();let r="";for(const i of e)for(const s in i.options){if(t===s)return`Did you mean '${i.id}.${s}'?`;const l=s.toLowerCase();(n.startsWith(l)||l.startsWith(n))&&(r=r||`Did you mean '${i.id}.${s}'?`)}return r}function FD(t,e,n){const i={...t.options||{}};return kD(i,n),i.log===null&&(i.log=new MD),VE(i,BR()),VE(i,e),i}function VE(t,e){for(const n in e)if(n in e){const r=e[n];kE(r)&&kE(t[n])?t[n]={...t[n],...e[n]}:t[n]=e[n]}}function kD(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}function qy(t){return t?(Array.isArray(t)&&(t=t[0]),Array.isArray(t==null?void 0:t.extensions)):!1}function Yy(t){Kh(t,"null loader"),Kh(qy(t),"invalid loader");let e;return Array.isArray(t)&&(e=t[1],t=t[0],t={...t,options:{...t.options,...e}}),(t!=null&&t.parseTextSync||t!=null&&t.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}const UR=()=>{const t=kR();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function BD(t){const e=UR();t=Array.isArray(t)?t:[t];for(const n of t){const r=Yy(n);e.find(i=>r===i)||e.unshift(r)}}function UD(){return UR()}const LD=/\.([^.]+)$/;async function zD(t,e=[],n,r){if(!LR(t))return null;let i=HE(t,e,{...n,nothrow:!0},r);if(i)return i;if(Ko(t)&&(t=await t.slice(0,10).arrayBuffer(),i=HE(t,e,n,r)),!i&&!(n!=null&&n.nothrow))throw new Error(zR(t));return i}function HE(t,e=[],n,r){if(!LR(t))return null;if(e&&!Array.isArray(e))return Yy(e);let i=[];e&&(i=i.concat(e)),n!=null&&n.ignoreRegisteredLoaders||i.push(...UD()),VD(i);const s=$D(t,i,n,r);if(!s&&!(n!=null&&n.nothrow))throw new Error(zR(t));return s}function $D(t,e,n,r){const i=sp(t),s=Xy(t),l=Wy(i)||(r==null?void 0:r.url);let c=null,f="";return n!=null&&n.mimeType&&(c=Iv(e,n==null?void 0:n.mimeType),f=`match forced by supplied MIME type ${n==null?void 0:n.mimeType}`),c=c||HD(e,l),f=f||(c?`matched url ${l}`:""),c=c||Iv(e,s),f=f||(c?`matched MIME type ${s}`:""),c=c||WD(e,t),f=f||(c?`matched initial data ${$R(t)}`:""),n!=null&&n.fallbackMimeType&&(c=c||Iv(e,n==null?void 0:n.fallbackMimeType),f=f||(c?`matched fallback MIME type ${s}`:"")),f&&U6.log(1,`selectLoader selected ${c==null?void 0:c.name}: ${f}.`),c}function LR(t){return!(t instanceof Response&&t.status===204)}function zR(t){const e=sp(t),n=Xy(t);let r="No valid loader found (";r+=e?`${PR(e)}, `:"no url provided, ",r+=`MIME type: ${n?`"${n}"`:"not provided"}, `;const i=t?$R(t):"";return r+=i?` first bytes: "${i}"`:"first bytes: not available",r+=")",r}function VD(t){for(const e of t)Yy(e)}function HD(t,e){const n=e&&LD.exec(e),r=n&&n[1];return r?jD(t,r):null}function jD(t,e){e=e.toLowerCase();for(const n of t)for(const r of n.extensions)if(r.toLowerCase()===e)return n;return null}function Iv(t,e){var n;for(const r of t)if((n=r.mimeTypes)!=null&&n.some(i=>BE(e,i))||BE(e,`application/x.${r.id}`))return r;return null}function WD(t,e){if(!e)return null;for(const n of t)if(typeof e=="string"){if(XD(e,n))return n}else if(ArrayBuffer.isView(e)){if(jE(e.buffer,e.byteOffset,n))return n}else if(e instanceof ArrayBuffer&&jE(e,0,n))return n;return null}function XD(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some(r=>t.startsWith(r))}function jE(t,e,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some(i=>qD(t,e,n,i))}function qD(t,e,n,r){if(r instanceof ArrayBuffer)return tD(r,t,r.byteLength);switch(typeof r){case"function":return r(t);case"string":const i=W0(t,e,r.length);return r===i;default:return!1}}function $R(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?W0(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?W0(t,0,e):""}function W0(t,e,n){if(t.byteLength<e+n)return"";const r=new DataView(t);let i="";for(let s=0;s<n;s++)i+=String.fromCharCode(r.getUint8(e+s));return i}const YD=256*1024;function*KD(t,e){const n=(e==null?void 0:e.chunkSize)||YD;let r=0;const i=new TextEncoder;for(;r<t.length;){const s=Math.min(t.length-r,n),l=t.slice(r,r+s);r+=s,yield i.encode(l)}}const ZD=256*1024;function*QD(t,e={}){const{chunkSize:n=ZD}=e;let r=0;for(;r<t.byteLength;){const i=Math.min(t.byteLength-r,n),s=new ArrayBuffer(i),l=new Uint8Array(t,r,i);new Uint8Array(s).set(l),r+=i,yield s}}const GD=1024*1024;async function*JD(t,e){const n=(e==null?void 0:e.chunkSize)||GD;let r=0;for(;r<t.size;){const i=r+n,s=await t.slice(r,i).arrayBuffer();r=i,yield s}}function WE(t,e){return Hy?e4(t,e):t4(t)}async function*e4(t,e){const n=t.getReader();let r;try{for(;;){const i=r||n.read();e!=null&&e._streamReadAhead&&(r=n.read());const{done:s,value:l}=await i;if(s)return;yield OR(l)}}catch{n.releaseLock()}}async function*t4(t,e){for await(const n of t)yield OR(n)}function n4(t,e){if(typeof t=="string")return KD(t,e);if(t instanceof ArrayBuffer)return QD(t,e);if(Ko(t))return JD(t,e);if(NR(t))return WE(t,e);if(Yo(t))return WE(t.body,e);throw new Error("makeIterator")}const VR="Cannot convert supplied data type";function r4(t,e,n){if(e.text&&typeof t=="string")return t;if(dD(t)&&(t=t.buffer),t instanceof ArrayBuffer){const r=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(r):r}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);let r=t.buffer;const i=t.byteLength||t.length;return(t.byteOffset!==0||i!==r.byteLength)&&(r=r.slice(t.byteOffset,t.byteOffset+i)),r}throw new Error(VR)}async function i4(t,e,n){const r=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if(typeof t=="string"||r)return r4(t,e);if(Ko(t)&&(t=await DR(t)),Yo(t)){const i=t;return await wD(i),e.binary?await i.arrayBuffer():await i.text()}if(NR(t)&&(t=n4(t,n)),uD(t)||fD(t))return iD(t);throw new Error(VR)}function HR(t,e){const n=BR(),r=t||n;return typeof r.fetch=="function"?r.fetch:Xf(r.fetch)?i=>LE(i,r.fetch):e!=null&&e.fetch?e==null?void 0:e.fetch:LE}function s4(t,e,n){if(n)return n;const r={fetch:HR(e,t),...t};if(r.url){const i=Wy(r.url);r.baseUrl=i,r.queryString=yD(r.url),r.filename=PR(i),r.baseUrl=lD(i)}return Array.isArray(r.loaders)||(r.loaders=null),r}function a4(t,e){if(t&&!Array.isArray(t))return t;let n;if(t&&(n=Array.isArray(t)?t:[t]),e&&e.loaders){const r=Array.isArray(e.loaders)?e.loaders:[e.loaders];n=n?[...n,...r]:r}return n&&n.length?n:void 0}async function Gh(t,e,n,r){e&&!Array.isArray(e)&&!qy(e)&&(r=void 0,n=e,e=void 0),t=await t,n=n||{};const i=sp(t),l=a4(e,r),c=await zD(t,l,n);return c?(n=ND(n,c,l,i),r=s4({url:i,_parse:Gh,loaders:l},n,r||null),await o4(c,t,n,r)):null}async function o4(t,e,n,r){if(Q6(t),n=L6(t.options,n),Yo(e)){const s=e,{ok:l,redirected:c,status:f,statusText:d,type:g,url:m}=s,v=Object.fromEntries(s.headers.entries());r.response={headers:v,ok:l,redirected:c,status:f,statusText:d,type:g,url:m}}e=await i4(e,t,n);const i=t;if(i.parseTextSync&&typeof e=="string")return i.parseTextSync(e,n,r);if(G6(t,n))return await J6(t,e,n,r,Gh);if(i.parseText&&typeof e=="string")return await i.parseText(e,n,r);if(i.parse)return await i.parse(e,n,r);throw za(!i.parseSync),new Error(`${t.id} loader - no parser found and worker is disabled`)}const XE=100;class l4{constructor(e,n){O(this,"schema");O(this,"options");O(this,"shape");O(this,"length",0);O(this,"rows",null);O(this,"cursor",0);O(this,"_headers",[]);if(this.options=n,this.schema=e,!Array.isArray(e)){this._headers=[];for(const r in e)this._headers[e[r].index]=e[r].name}}rowCount(){return this.length}addArrayRow(e,n){Number.isFinite(n)&&(this.cursor=n),this.shape="array-row-table",this.rows=this.rows||new Array(XE),this.rows[this.length]=e,this.length++}addObjectRow(e,n){Number.isFinite(n)&&(this.cursor=n),this.shape="object-row-table",this.rows=this.rows||new Array(XE),this.rows[this.length]=e,this.length++}getBatch(){let e=this.rows;return e?(e=e.slice(0,this.length),this.rows=null,{shape:this.shape||"array-row-table",batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}}function jR(t,e){if(!t)throw new Error("null row");const n={};if(e)for(let r=0;r<e.length;r++)n[e[r]]=t[r];else for(let r=0;r<t.length;r++){const i=`column-${r}`;n[i]=t[r]}return n}function WR(t,e){if(!t)throw new Error("null row");if(e){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=t[e[r]];return n}return Object.values(t)}function c4(t){const e=[];for(let n=0;n<t.length;n++){const r=`column-${n}`;e.push(r)}return e}function u4(t){return Object.keys(t)}const qE=100;class f4{constructor(e,n){O(this,"schema");O(this,"options");O(this,"length",0);O(this,"objectRows",null);O(this,"arrayRows",null);O(this,"cursor",0);O(this,"_headers",null);if(this.options=n,this.schema=e,e){this._headers=[];for(const r in e)this._headers[e[r].index]=e[r].name}}rowCount(){return this.length}addArrayRow(e,n){switch(Number.isFinite(n)&&(this.cursor=n),this._headers||(this._headers=c4(e)),this.options.shape){case"object-row-table":const r=jR(e,this._headers);this.addObjectRow(r,n);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(qE),this.arrayRows[this.length]=e,this.length++;break}}addObjectRow(e,n){switch(Number.isFinite(n)&&(this.cursor=n),this._headers||(this._headers=u4(e)),this.options.shape){case"array-row-table":const r=WR(e,this._headers);this.addArrayRow(r,n);break;case"object-row-table":this.objectRows=this.objectRows||new Array(qE),this.objectRows[this.length]=e,this.length++;break}}getBatch(){let e=this.arrayRows||this.objectRows;return e?(e=e.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}}const d4=100;class h4{constructor(e,n){O(this,"schema");O(this,"length",0);O(this,"allocated",0);O(this,"columns",{});this.schema=e,this._reallocateColumns()}rowCount(){return this.length}addArrayRow(e){this._reallocateColumns();let n=0;for(const r in this.columns)this.columns[r][this.length]=e[n++];this.length++}addObjectRow(e){this._reallocateColumns();for(const n in e)this.columns[n][this.length]=e[n];this.length++}getBatch(){this._pruneColumns();const e=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(const r in this.schema){const i=this.schema[r];e[i.name]=this.columns[i.index]}return this.columns={},{shape:"columnar-table",batchType:"data",data:e,schema:this.schema,length:this.length}}_reallocateColumns(){if(!(this.length<this.allocated)){this.allocated=this.allocated>0?this.allocated*=2:d4,this.columns={};for(const e in this.schema){const n=this.schema[e],r=n.type||Float32Array,i=this.columns[n.index];if(i&&ArrayBuffer.isView(i)){const s=new r(this.allocated);s.set(i),this.columns[n.index]=s}else i?(i.length=this.allocated,this.columns[n.index]=i):this.columns[n.index]=new r(this.allocated)}}}_pruneColumns(){for(const[e,n]of Object.entries(this.columns))this.columns[e]=n.slice(0,this.length)}}const g4={shape:void 0,batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},p4="TableBatchBuilder",gf=class gf{constructor(e,n){O(this,"schema");O(this,"options");O(this,"aggregator",null);O(this,"batchCount",0);O(this,"bytesUsed",0);O(this,"isChunkComplete",!1);O(this,"lastBatchEmittedMs",Date.now());O(this,"totalLength",0);O(this,"totalBytes",0);O(this,"rowBytes",0);this.schema=e,this.options={...g4,...n}}limitReached(){var e,n;return!!((e=this.options)!=null&&e.limit&&this.totalLength>=this.options.limit||(n=this.options)!=null&&n._limitMB&&this.totalBytes/1e6>=this.options._limitMB)}addRow(e){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(e),this.totalBytes+=this.rowBytes,Array.isArray(e)?this.addArrayRow(e):this.addObjectRow(e))}addArrayRow(e){if(!this.aggregator){const n=this._getTableBatchType();this.aggregator=new n(this.schema,this.options)}this.aggregator.addArrayRow(e)}addObjectRow(e){if(!this.aggregator){const n=this._getTableBatchType();this.aggregator=new n(this.schema,this.options)}this.aggregator.addObjectRow(e)}chunkComplete(e){e instanceof ArrayBuffer&&(this.bytesUsed+=e.byteLength),typeof e=="string"&&(this.bytesUsed+=e.length),this.isChunkComplete=!0}getFullBatch(e){return this._isFull()?this._getBatch(e):null}getFinalBatch(e){return this._getBatch(e)}_estimateRowMB(e){return Array.isArray(e)?e.length*8:Object.keys(e).length*8}_isFull(){if(!this.aggregator||this.aggregator.rowCount()===0)return!1;if(this.options.batchSize==="auto"){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs?!1:(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(e){if(!this.aggregator)return null;e!=null&&e.bytesUsed&&(this.bytesUsed=e.bytesUsed);const n=this.aggregator.getBatch();return n.count=this.batchCount,n.bytesUsed=this.bytesUsed,Object.assign(n,e),this.batchCount++,this.aggregator=null,n}_getTableBatchType(){switch(this.options.shape){case"array-row-table":case"object-row-table":return f4;case"columnar-table":return h4;case"arrow-table":if(!gf.ArrowBatch)throw new Error(p4);return gf.ArrowBatch;default:return l4}}};O(gf,"ArrowBatch");let X0=gf;class YE extends Array{enqueue(e){return this.push(e)}dequeue(){return this.shift()}}class m4{constructor(){O(this,"_values");O(this,"_settlers");O(this,"_closed");this._values=new YE,this._settlers=new YE,this._closed=!1}close(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}[Symbol.asyncIterator](){return this}enqueue(e){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");const n=this._settlers.dequeue();e instanceof Error?n.reject(e):n.resolve({value:e})}else this._values.enqueue(e)}next(){if(this._values.length>0){const e=this._values.dequeue();return e instanceof Error?Promise.reject(e):Promise.resolve({value:e})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise((e,n)=>{this._settlers.enqueue({resolve:e,reject:n})})}}async function Jh(t,e,n,r){let i,s;!Array.isArray(e)&&!qy(e)?(i=[],s=e):(i=e,s=n);const l=HR(s);let c=t;return typeof t=="string"&&(c=await l(t)),Ko(t)&&(c=await l(t)),Array.isArray(i)?await Gh(c,i,s):await Gh(c,i,s)}/* @license
Papa Parse
v5.0.0-beta.0
https://github.com/mholt/PapaParse
License: MIT
*/const KE="\uFEFF";function v4(t,e={},n=y4){e=e||{};var r=e.dynamicTyping||!1;Qi(r)&&(e.dynamicTypingFunction=r,r={}),e.dynamicTyping=r,e.transform=Qi(e.transform)?e.transform:!1;var i=new n(e);return i.stream(t)}function _4(t,e){var n=!1,r=!0,i=",",s=`\r
`,l='"',c=l+l,f=!1,d=null;m();var g=new RegExp(yf(l),"g");if(typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return v(null,t,f);if(typeof t[0]=="object")return v(d||Object.keys(t[0]),t,f)}else if(typeof t=="object")return typeof t.data=="string"&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:Object.keys(t.data[0])),!Array.isArray(t.data[0])&&typeof t.data[0]!="object"&&(t.data=[t.data])),v(t.fields||[],t.data||[],f);throw new Error("Unable to serialize unrecognized input");function m(){if(typeof e=="object"){if(typeof e.delimiter=="string"&&!Oi.BAD_DELIMITERS.filter(function(w){return e.delimiter.indexOf(w)!==-1}).length&&(i=e.delimiter),(typeof e.quotes=="boolean"||Array.isArray(e.quotes))&&(n=e.quotes),(typeof e.skipEmptyLines=="boolean"||typeof e.skipEmptyLines=="string")&&(f=e.skipEmptyLines),typeof e.newline=="string"&&(s=e.newline),typeof e.quoteChar=="string"&&(l=e.quoteChar),typeof e.header=="boolean"&&(r=e.header),Array.isArray(e.columns)){if(e.columns.length===0)throw new Error("Option columns is empty");d=e.columns}e.escapeChar!==void 0&&(c=e.escapeChar+l)}}function v(w,b,A){var T="";typeof w=="string"&&(w=JSON.parse(w)),typeof b=="string"&&(b=JSON.parse(b));var C=Array.isArray(w)&&w.length>0,M=!Array.isArray(b[0]);if(C&&r){for(var x=0;x<w.length;x++)x>0&&(T+=i),T+=S(w[x],x);b.length>0&&(T+=s)}for(var N=0;N<b.length;N++){var F=C?w.length:b[N].length,L=!1,I=C?Object.keys(b[N]).length===0:b[N].length===0;if(A&&!C&&(L=A==="greedy"?b[N].join("").trim()==="":b[N].length===1&&b[N][0].length===0),A==="greedy"&&C){for(var V=[],B=0;B<F;B++){var j=M?w[B]:B;V.push(b[N][j])}L=V.join("").trim()===""}if(!L){for(var X=0;X<F;X++){X>0&&!I&&(T+=i);var Y=C&&M?w[X]:X;T+=S(b[N][Y],X)}N<b.length-1&&(!A||F>0&&!I)&&(T+=s)}}return T}function S(w,b){if(typeof w>"u"||w===null)return"";if(w.constructor===Date)return JSON.stringify(w).slice(1,25);w=w.toString().replace(g,c);var A=typeof n=="boolean"&&n||Array.isArray(n)&&n[b]||E(w,Oi.BAD_DELIMITERS)||w.indexOf(i)>-1||w.charAt(0)===" "||w.charAt(w.length-1)===" ";return A?l+w+l:w}function E(w,b){for(var A=0;A<b.length;A++)if(w.indexOf(b[A])>-1)return!0;return!1}}let XR=class{constructor(e){O(this,"_handle");O(this,"_config");O(this,"_finished",!1);O(this,"_completed",!1);O(this,"_input",null);O(this,"_baseIndex",0);O(this,"_partialLine","");O(this,"_rowCount",0);O(this,"_start",0);O(this,"isFirstChunk",!0);O(this,"_completeResults",{data:[],errors:[],meta:{}});var n={...e};n.chunkSize=parseInt(n.chunkSize),!e.step&&!e.chunk&&(n.chunkSize=null),this._handle=new qR(n),this._handle.streamer=this,this._config=n}parseChunk(e,n){if(this.isFirstChunk&&Qi(this._config.beforeFirstChunk)){var r=this._config.beforeFirstChunk(e);r!==void 0&&(e=r)}this.isFirstChunk=!1;var i=this._partialLine+e;this._partialLine="";var s=this._handle.parse(i,this._baseIndex,!this._finished);if(!(this._handle.paused()||this._handle.aborted())){var l=s.meta.cursor;this._finished||(this._partialLine=i.substring(l-this._baseIndex),this._baseIndex=l),s&&s.data&&(this._rowCount+=s.data.length);var c=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(Qi(this._config.chunk)&&!n){if(this._config.chunk(s,this._handle),this._handle.paused()||this._handle.aborted())return;s=void 0,this._completeResults=void 0}return!this._config.step&&!this._config.chunk&&(this._completeResults.data=this._completeResults.data.concat(s.data),this._completeResults.errors=this._completeResults.errors.concat(s.errors),this._completeResults.meta=s.meta),!this._completed&&c&&Qi(this._config.complete)&&(!s||!s.meta.aborted)&&(this._config.complete(this._completeResults,this._input),this._completed=!0),s}}_sendError(e){Qi(this._config.error)&&this._config.error(e)}};class y4 extends XR{constructor(n={}){super(n);O(this,"remaining")}stream(n){return this.remaining=n,this._nextChunk()}_nextChunk(){if(!this._finished){var n=this._config.chunkSize,r=n?this.remaining.substr(0,n):this.remaining;return this.remaining=n?this.remaining.substr(n):"",this._finished=!this.remaining,this.parseChunk(r)}}}const b4=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,S4=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/;class qR{constructor(e){O(this,"_config");O(this,"_stepCounter",0);O(this,"_rowCounter",0);O(this,"_input");O(this,"_parser");O(this,"_paused",!1);O(this,"_aborted",!1);O(this,"_delimiterError",!1);O(this,"_fields",[]);O(this,"_results",{data:[],errors:[],meta:{}});if(Qi(e.step)){var n=e.step;e.step=r=>{if(this._results=r,this.needsHeaderRow())this.processResults();else{if(this.processResults(),!this._results.data||this._results.data.length===0)return;this._stepCounter+=r.data.length,e.preview&&this._stepCounter>e.preview?this._parser.abort():n(this._results,this)}}}this._config=e}parse(e,n,r){var i=this._config.quoteChar||'"';if(this._config.newline||(this._config.newline=w4(e,i)),this._delimiterError=!1,this._config.delimiter)Qi(this._config.delimiter)&&(this._config.delimiter=this._config.delimiter(e),this._results.meta.delimiter=this._config.delimiter);else{var s=this.guessDelimiter(e,this._config.newline,this._config.skipEmptyLines,this._config.comments,this._config.delimitersToGuess);s.successful?this._config.delimiter=s.bestDelimiter:(this._delimiterError=!0,this._config.delimiter=Oi.DefaultDelimiter),this._results.meta.delimiter=this._config.delimiter}var l=YR(this._config);return this._config.preview&&this._config.header&&l.preview++,this._input=e,this._parser=new q0(l),this._results=this._parser.parse(this._input,n,r),this.processResults(),this._paused?{meta:{paused:!0}}:this._results||{meta:{paused:!1}}}paused(){return this._paused}pause(){this._paused=!0,this._parser.abort(),this._input=this._input.substr(this._parser.getCharIndex())}resume(){this._paused=!1,this.streamer.parseChunk(this._input,!0)}aborted(){return this._aborted}abort(){this._aborted=!0,this._parser.abort(),this._results.meta.aborted=!0,Qi(this._config.complete)&&this._config.complete(this._results),this._input=""}testEmptyLine(e){return this._config.skipEmptyLines==="greedy"?e.join("").trim()==="":e.length===1&&e[0].length===0}processResults(){if(this._results&&this._delimiterError&&(this.addError("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+Oi.DefaultDelimiter+"'"),this._delimiterError=!1),this._config.skipEmptyLines)for(var e=0;e<this._results.data.length;e++)this.testEmptyLine(this._results.data[e])&&this._results.data.splice(e--,1);return this.needsHeaderRow()&&this.fillHeaderFields(),this.applyHeaderAndDynamicTypingAndTransformation()}needsHeaderRow(){return this._config.header&&this._fields.length===0}fillHeaderFields(){if(!this._results)return;const e=r=>{Qi(this._config.transformHeader)&&(r=this._config.transformHeader(r)),this._fields.push(r)};if(Array.isArray(this._results.data[0])){for(var n=0;this.needsHeaderRow()&&n<this._results.data.length;n++)this._results.data[n].forEach(e);this._results.data.splice(0,1)}else this._results.data.forEach(e)}shouldApplyDynamicTyping(e){return this._config.dynamicTypingFunction&&this._config.dynamicTyping[e]===void 0&&(this._config.dynamicTyping[e]=this._config.dynamicTypingFunction(e)),(this._config.dynamicTyping[e]||this._config.dynamicTyping)===!0}parseDynamic(e,n){return this.shouldApplyDynamicTyping(e)?n==="true"||n==="TRUE"?!0:n==="false"||n==="FALSE"?!1:b4.test(n)?parseFloat(n):S4.test(n)?new Date(n):n===""?null:n:n}applyHeaderAndDynamicTypingAndTransformation(){if(!this._results||!this._results.data||!this._config.header&&!this._config.dynamicTyping&&!this._config.transform)return this._results;var e=1;return!this._results.data[0]||Array.isArray(this._results.data[0])?(this._results.data=this._results.data.map(this.processRow.bind(this)),e=this._results.data.length):this._results.data=this.processRow(this._results.data,0),this._config.header&&this._results.meta&&(this._results.meta.fields=this._fields),this._rowCounter+=e,this._results}processRow(e,n){var r=this._config.header?{}:[],i;for(i=0;i<e.length;i++){var s=i,l=e[i];this._config.header&&(s=i>=this._fields.length?"__parsed_extra":this._fields[i]),this._config.transform&&(l=this._config.transform(l,s)),l=this.parseDynamic(s,l),s==="__parsed_extra"?(r[s]=r[s]||[],r[s].push(l)):r[s]=l}return this._config.header&&(i>this._fields.length?this.addError("FieldMismatch","TooManyFields","Too many fields: expected "+this._fields.length+" fields but parsed "+i,this._rowCounter+n):i<this._fields.length&&this.addError("FieldMismatch","TooFewFields","Too few fields: expected "+this._fields.length+" fields but parsed "+i,this._rowCounter+n)),r}guessDelimiter(e,n,r,i,s){var l,c,f;s=s||[","," ","|",";",Oi.RECORD_SEP,Oi.UNIT_SEP];for(var d=0;d<s.length;d++){var g=s[d],m=0,v=0,S=0;f=void 0;for(var E=new q0({comments:i,delimiter:g,newline:n,preview:10}).parse(e),w=0;w<E.data.length;w++){if(r&&this.testEmptyLine(E.data[w])){S++;continue}var b=E.data[w].length;if(v+=b,typeof f>"u"){f=0;continue}else b>1&&(m+=Math.abs(b-f),f=b)}E.data.length>0&&(v/=E.data.length-S),(typeof c>"u"||m>c)&&v>1.99&&(c=m,l=g)}return this._config.delimiter=l,{successful:!!l,bestDelimiter:l}}addError(e,n,r,i){this._results.errors.push({type:e,code:n,message:r,row:i})}}function w4(t,e){t=t.substr(0,1024*1024);var n=new RegExp(yf(e)+"([^]*?)"+yf(e),"gm");t=t.replace(n,"");var r=t.split("\r"),i=t.split(`
`),s=i.length>1&&i[0].length<r[0].length;if(r.length===1||s)return`
`;for(var l=0,c=0;c<r.length;c++)r[c][0]===`
`&&l++;return l>=r.length/2?`\r
`:"\r"}function yf(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q0(t){t=t||{};var e=t.delimiter,n=t.newline,r=t.comments,i=t.step,s=t.preview,l=t.fastMode,c;t.quoteChar===void 0?c='"':c=t.quoteChar;var f=c;if(t.escapeChar!==void 0&&(f=t.escapeChar),(typeof e!="string"||Oi.BAD_DELIMITERS.indexOf(e)>-1)&&(e=","),r===e)throw new Error("Comment character same as delimiter");r===!0?r="#":(typeof r!="string"||Oi.BAD_DELIMITERS.indexOf(r)>-1)&&(r=!1),n!==`
`&&n!=="\r"&&n!==`\r
`&&(n=`
`);var d=0,g=!1;this.parse=function(m,v,S){if(typeof m!="string")throw new Error("Input must be a string");var E=m.length,w=e.length,b=n.length,A=r.length,T=Qi(i);d=0;var C=[],M=[],x=[],N=0;if(!m)return $();if(l||l!==!1&&m.indexOf(c)===-1){for(var F=m.split(n),L=0;L<F.length;L++){const se=F[L];if(d+=se.length,L!==F.length-1)d+=n.length;else if(S)return $();if(!(r&&se.substr(0,A)===r)){if(T){if(C=[],z(se.split(e)),ie(),g)return $()}else z(se.split(e));if(s&&L>=s)return C=C.slice(0,s),$(!0)}}return $()}for(var I=m.indexOf(e,d),V=m.indexOf(n,d),B=new RegExp(yf(f)+yf(c),"g"),j;;){if(m[d]===c){for(j=d,d++;;){if(j=m.indexOf(c,j+1),j===-1)return S||M.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:C.length,index:d}),Z();if(j===E-1){var X=m.substring(d,j).replace(B,c);return Z(X)}if(c===f&&m[j+1]===f){j++;continue}if(!(c!==f&&j!==0&&m[j-1]===f)){var Y=V===-1?I:Math.min(I,V),ae=W(Y);if(m[j+1+ae]===e){if(x.push(m.substring(d,j).replace(B,c)),d=j+1+ae+w,I=m.indexOf(e,d),V=m.indexOf(n,d),T&&(ie(),g))return $();if(s&&C.length>=s)return $(!0);break}var U=W(V);if(m.substr(j+1+U,b)===n){if(x.push(m.substring(d,j).replace(B,c)),P(j+1+U+b),I=m.indexOf(e,d),T&&(ie(),g))return $();if(s&&C.length>=s)return $(!0);break}M.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:C.length,index:d}),j++}}if(T&&(ie(),g))return $();if(s&&C.length>=s)return $(!0);continue}if(r&&x.length===0&&m.substr(d,A)===r){if(V===-1)return $();d=V+b,V=m.indexOf(n,d),I=m.indexOf(e,d);continue}if(I!==-1&&(I<V||V===-1)){x.push(m.substring(d,I)),d=I+w,I=m.indexOf(e,d);continue}if(V!==-1){if(x.push(m.substring(d,V)),P(V+b),T&&(ie(),g))return $();if(s&&C.length>=s)return $(!0);continue}break}return Z();function z(se){C.push(se),N=d}function W(se){var q=0;if(se!==-1){var ce=m.substring(j+1,se);ce&&ce.trim()===""&&(q=ce.length)}return q}function Z(se){return S||(typeof se>"u"&&(se=m.substr(d)),x.push(se),d=E,z(x),T&&ie()),$()}function P(se){d=se,z(x),x=[],V=m.indexOf(n,d)}function $(se,q){var ce=q||!1;return{data:ce?C[0]:C,errors:M,meta:{delimiter:e,linebreak:n,aborted:g,truncated:!!se,cursor:N+(v||0)}}}function ie(){i($(void 0,!0)),C=[],M=[]}},this.abort=function(){g=!0},this.getCharIndex=function(){return d}}function YR(t){if(typeof t!="object"||t===null)return t;var e=Array.isArray(t)?[]:{};for(var n in t)e[n]=YR(t[n]);return e}function Qi(t){return typeof t=="function"}const Oi={parse:v4,unparse:_4,RECORD_SEP:"",UNIT_SEP:"",BYTE_ORDER_MARK:KE,BAD_DELIMITERS:["\r",`
`,'"',KE],WORKERS_SUPPORTED:!1,NODE_STREAM_INPUT:1,LocalChunkSize:1024*1024*10,RemoteChunkSize:1024*1024*5,DefaultDelimiter:",",Parser:q0,ParserHandle:qR,ChunkStreamer:XR},{ChunkStreamer:E4}=Oi;class T4 extends E4{constructor(n={}){super(n);O(this,"textDecoder",new TextDecoder(this._config.encoding))}async stream(n){this._input=n;try{for await(const r of n)this.parseChunk(this.getStringChunk(r));this._finished=!0,this.parseChunk("")}catch(r){this._sendError(r)}}_nextChunk(){}getStringChunk(n){return typeof n=="string"?n:this.textDecoder.decode(n,{stream:!0})}}const A4="4.3.2",Ky="object-row-table",Zy={dataType:null,batchType:null,id:"csv",module:"csv",name:"CSV",version:A4,extensions:["csv","tsv","dsv"],mimeTypes:["text/csv","text/tab-separated-values","text/dsv"],category:"table",parse:async(t,e)=>ZE(new TextDecoder().decode(t),e),parseText:(t,e)=>ZE(t,e),parseInBatches:C4,options:{csv:{shape:Ky,optimizeMemoryUsage:!1,header:"auto",columnPrefix:"column",quoteChar:'"',escapeChar:'"',dynamicTyping:!0,comments:!1,skipEmptyLines:!0,delimitersToGuess:[","," ","|",";"]}}};async function ZE(t,e){const n={...Zy.options.csv,...e==null?void 0:e.csv},r=R4(t),s=n.header==="auto"?KR(r):!!n.header,l={...n,header:s,download:!1,transformHeader:s?ZR():void 0,error:m=>{throw new Error(m)}},c=Oi.parse(t,l),f=c.data,d=c.meta.fields||QR(n.columnPrefix,r.length),g=n.shape||Ky;switch(g){case"object-row-table":return{shape:"object-row-table",data:f.map(m=>Array.isArray(m)?jR(m,d):m)};case"array-row-table":return{shape:"array-row-table",data:f.map(m=>Array.isArray(m)?m:WR(m,d))};default:throw new Error(g)}}function C4(t,e){e={...e},e.batchSize==="auto"&&(e.batchSize=4e3);const n={...Zy.options.csv,...e==null?void 0:e.csv},r=new m4;let i=!0,s=null,l=null,c=null;const f={...n,header:!1,download:!1,chunkSize:1024*1024*5,skipEmptyLines:!1,step(d){let g=d.data;if(n.skipEmptyLines&&g.flat().join("").trim()==="")return;const m=d.meta.cursor;if(i&&!s&&(n.header==="auto"?KR(g):!!n.header)){s=g.map(ZR());return}i&&(i=!1,s||(s=QR(n.columnPrefix,g.length)),c=x4(g,s)),n.optimizeMemoryUsage&&(g=JSON.parse(JSON.stringify(g)));const v=n.shape||Ky;l=l||new X0(c,{shape:v,...e});try{l.addRow(g);const S=l&&l.getFullBatch({bytesUsed:m});S&&r.enqueue(S)}catch(S){r.enqueue(S)}},complete(d){try{const g=d.meta.cursor,m=l&&l.getFinalBatch({bytesUsed:g});m&&r.enqueue(m)}catch(g){r.enqueue(g)}r.close()}};return Oi.parse(t,f,T4),r}function KR(t){return t&&t.every(e=>typeof e=="string")}function R4(t){return Oi.parse(t,{dynamicTyping:!0,preview:1}).data[0]}function ZR(){const t=new Set;return e=>{let n=e,r=1;for(;t.has(n);)n=`${e}.${r}`,r++;return t.add(n),n}}function QR(t,e=0){const n=[];for(let r=0;r<e;r++)n.push(`${t}${r+1}`);return n}function x4(t,e){const n=e?{}:[];for(let r=0;r<t.length;r++){const i=e&&e[r]||r;switch(typeof t[r]){case"number":case"boolean":n[i]={name:String(i),index:r,type:Float32Array};break;case"string":default:n[i]={name:String(i),index:r,type:Array}}}return n}var Dv={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/var QE;function M4(){return QE||(QE=1,function(t){(function(){var e={}.hasOwnProperty;function n(){for(var s="",l=0;l<arguments.length;l++){var c=arguments[l];c&&(s=i(s,r(c)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var l="";for(var c in s)e.call(s,c)&&s[c]&&(l=i(l,c));return l}function i(s,l){return l?s?s+" "+l:s+l:s}t.exports?(n.default=n,t.exports=n):window.classNames=n})()}(Dv)),Dv.exports}var O4=M4();const Ze=By(O4);function kt(){return kt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},kt.apply(null,arguments)}function pt(t){"@babel/helpers - typeof";return pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pt(t)}var P4=Symbol.for("react.element"),N4=Symbol.for("react.transitional.element"),I4=Symbol.for("react.fragment");function GR(t){return t&&pt(t)==="object"&&(t.$$typeof===P4||t.$$typeof===N4)&&t.type===I4}function Ho(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[];return Ft.Children.forEach(t,function(r){r==null&&!e.keepEmpty||(Array.isArray(r)?n=n.concat(Ho(r)):GR(r)&&r.props?n=n.concat(Ho(r.props.children,e)):n.push(r))}),n}var Y0={},D4=function(e){};function F4(t,e){}function k4(t,e){}function B4(){Y0={}}function JR(t,e,n){!e&&!Y0[n]&&(t(!1,n),Y0[n]=!0)}function Ur(t,e){JR(F4,t,e)}function U4(t,e){JR(k4,t,e)}Ur.preMessage=D4;Ur.resetWarned=B4;Ur.noteOnce=U4;function L4(t,e){if(pt(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(pt(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function e3(t){var e=L4(t,"string");return pt(e)=="symbol"?e:e+""}function K(t,e,n){return(e=e3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function J(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?GE(Object(n),!0).forEach(function(r){K(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):GE(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var $a=ER();const JE=By($a);function bf(t){return t instanceof HTMLElement||t instanceof SVGElement}function z4(t){return t&&pt(t)==="object"&&bf(t.nativeElement)?t.nativeElement:bf(t)?t:null}function rf(t){var e=z4(t);if(e)return e;if(t instanceof Ft.Component){var n;return(n=JE.findDOMNode)===null||n===void 0?void 0:n.call(JE,t)}return null}var Fv={exports:{}},an={};/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var eT;function $4(){if(eT)return an;eT=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),E;E=Symbol.for("react.module.reference");function w(b){if(typeof b=="object"&&b!==null){var A=b.$$typeof;switch(A){case t:switch(b=b.type,b){case n:case i:case r:case d:case g:return b;default:switch(b=b&&b.$$typeof,b){case c:case l:case f:case v:case m:case s:return b;default:return A}}case e:return A}}}return an.ContextConsumer=l,an.ContextProvider=s,an.Element=t,an.ForwardRef=f,an.Fragment=n,an.Lazy=v,an.Memo=m,an.Portal=e,an.Profiler=i,an.StrictMode=r,an.Suspense=d,an.SuspenseList=g,an.isAsyncMode=function(){return!1},an.isConcurrentMode=function(){return!1},an.isContextConsumer=function(b){return w(b)===l},an.isContextProvider=function(b){return w(b)===s},an.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===t},an.isForwardRef=function(b){return w(b)===f},an.isFragment=function(b){return w(b)===n},an.isLazy=function(b){return w(b)===v},an.isMemo=function(b){return w(b)===m},an.isPortal=function(b){return w(b)===e},an.isProfiler=function(b){return w(b)===i},an.isStrictMode=function(b){return w(b)===r},an.isSuspense=function(b){return w(b)===d},an.isSuspenseList=function(b){return w(b)===g},an.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===i||b===r||b===d||b===g||b===S||typeof b=="object"&&b!==null&&(b.$$typeof===v||b.$$typeof===m||b.$$typeof===s||b.$$typeof===l||b.$$typeof===f||b.$$typeof===E||b.getModuleId!==void 0)},an.typeOf=w,an}var tT;function V4(){return tT||(tT=1,Fv.exports=$4()),Fv.exports}var kv=V4();function ap(t,e,n){var r=_.useRef({});return(!("value"in r.current)||n(r.current.condition,e))&&(r.current.value=t(),r.current.condition=e),r.current.value}var H4=Number(_.version.split(".")[0]),Qy=function(e,n){typeof e=="function"?e(n):pt(e)==="object"&&e&&"current"in e&&(e.current=n)},op=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n.filter(Boolean);return i.length<=1?i[0]:function(s){n.forEach(function(l){Qy(l,s)})}},lp=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return ap(function(){return op.apply(void 0,n)},n,function(i,s){return i.length!==s.length||i.every(function(l,c){return l!==s[c]})})},cp=function(e){var n,r;if(!e)return!1;if(t3(e)&&H4>=19)return!0;var i=kv.isMemo(e)?e.type.type:e.type;return!(typeof i=="function"&&!((n=i.prototype)!==null&&n!==void 0&&n.render)&&i.$$typeof!==kv.ForwardRef||typeof e=="function"&&!((r=e.prototype)!==null&&r!==void 0&&r.render)&&e.$$typeof!==kv.ForwardRef)};function t3(t){return _.isValidElement(t)&&!GR(t)}var Gy=function(e){if(e&&t3(e)){var n=e;return n.props.propertyIsEnumerable("ref")?n.props.ref:n.ref}return null},K0=_.createContext(null);function j4(t){var e=t.children,n=t.onBatchResize,r=_.useRef(0),i=_.useRef([]),s=_.useContext(K0),l=_.useCallback(function(c,f,d){r.current+=1;var g=r.current;i.current.push({size:c,element:f,data:d}),Promise.resolve().then(function(){g===r.current&&(n==null||n(i.current),i.current=[])}),s==null||s(c,f,d)},[n,s]);return _.createElement(K0.Provider,{value:l},e)}var n3=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(i,s){return i[0]===n?(r=s,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(n,r){var i=t(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,i=t(r,n);~i&&r.splice(i,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,s=this.__entries__;i<s.length;i++){var l=s[i];n.call(r,l[1],l[0])}},e}()}(),Z0=typeof window<"u"&&typeof document<"u"&&window.document===document,eg=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),W4=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(eg):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),X4=2;function q4(t,e){var n=!1,r=!1,i=0;function s(){n&&(n=!1,t()),r&&c()}function l(){W4(s)}function c(){var f=Date.now();if(n){if(f-i<X4)return;r=!0}else n=!0,r=!1,setTimeout(l,e);i=f}return c}var Y4=20,K4=["top","right","bottom","left","width","height","size","weight"],Z4=typeof MutationObserver<"u",Q4=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=q4(this.refresh.bind(this),Y4)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var n=this.observers_,r=n.indexOf(e);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return e.forEach(function(n){return n.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!Z0||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Z4?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!Z0||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,i=K4.some(function(s){return!!~r.indexOf(s)});i&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),r3=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},wc=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||eg},i3=up(0,0,0,0);function tg(t){return parseFloat(t)||0}function nT(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(r,i){var s=t["border-"+i+"-width"];return r+tg(s)},0)}function G4(t){for(var e=["top","right","bottom","left"],n={},r=0,i=e;r<i.length;r++){var s=i[r],l=t["padding-"+s];n[s]=tg(l)}return n}function J4(t){var e=t.getBBox();return up(0,0,e.width,e.height)}function e5(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return i3;var r=wc(t).getComputedStyle(t),i=G4(r),s=i.left+i.right,l=i.top+i.bottom,c=tg(r.width),f=tg(r.height);if(r.boxSizing==="border-box"&&(Math.round(c+s)!==e&&(c-=nT(r,"left","right")+s),Math.round(f+l)!==n&&(f-=nT(r,"top","bottom")+l)),!n5(t)){var d=Math.round(c+s)-e,g=Math.round(f+l)-n;Math.abs(d)!==1&&(c-=d),Math.abs(g)!==1&&(f-=g)}return up(i.left,i.top,c,f)}var t5=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof wc(t).SVGGraphicsElement}:function(t){return t instanceof wc(t).SVGElement&&typeof t.getBBox=="function"}}();function n5(t){return t===wc(t).document.documentElement}function r5(t){return Z0?t5(t)?J4(t):e5(t):i3}function i5(t){var e=t.x,n=t.y,r=t.width,i=t.height,s=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,l=Object.create(s.prototype);return r3(l,{x:e,y:n,width:r,height:i,top:n,right:e+r,bottom:i+n,left:e}),l}function up(t,e,n,r){return{x:t,y:e,width:n,height:r}}var s5=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=up(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=r5(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),a5=function(){function t(e,n){var r=i5(n);r3(this,{target:e,contentRect:r})}return t}(),o5=function(){function t(e,n,r){if(this.activeObservations_=[],this.observations_=new n3,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=n,this.callbackCtx_=r}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof wc(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new s5(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof wc(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new a5(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),s3=typeof WeakMap<"u"?new WeakMap:new n3,a3=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Q4.getInstance(),r=new o5(e,n,this);s3.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){a3.prototype[t]=function(){var e;return(e=s3.get(this))[t].apply(e,arguments)}});var l5=function(){return typeof eg.ResizeObserver<"u"?eg.ResizeObserver:a3}(),Ia=new Map;function c5(t){t.forEach(function(e){var n,r=e.target;(n=Ia.get(r))===null||n===void 0||n.forEach(function(i){return i(r)})})}var o3=new l5(c5);function u5(t,e){Ia.has(t)||(Ia.set(t,new Set),o3.observe(t)),Ia.get(t).add(e)}function f5(t,e){Ia.has(t)&&(Ia.get(t).delete(e),Ia.get(t).size||(o3.unobserve(t),Ia.delete(t)))}function Or(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rT(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,e3(r.key),r)}}function Pr(t,e,n){return e&&rT(t.prototype,e),n&&rT(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Sf(t,e){return Sf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Sf(t,e)}function Zo(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Sf(t,e)}function wf(t){return wf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wf(t)}function Jy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Jy=function(){return!!t})()}function Nt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d5(t,e){if(e&&(pt(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nt(t)}function Qo(t){var e=Jy();return function(){var n,r=wf(t);if(e){var i=wf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d5(this,n)}}var h5=function(t){Zo(n,t);var e=Qo(n);function n(){return Or(this,n),e.apply(this,arguments)}return Pr(n,[{key:"render",value:function(){return this.props.children}}]),n}(_.Component);function g5(t,e){var n=t.children,r=t.disabled,i=_.useRef(null),s=_.useRef(null),l=_.useContext(K0),c=typeof n=="function",f=c?n(i):n,d=_.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),g=!c&&_.isValidElement(f)&&cp(f),m=g?Gy(f):null,v=lp(m,i),S=function(){var A;return rf(i.current)||(i.current&&pt(i.current)==="object"?rf((A=i.current)===null||A===void 0?void 0:A.nativeElement):null)||rf(s.current)};_.useImperativeHandle(e,function(){return S()});var E=_.useRef(t);E.current=t;var w=_.useCallback(function(b){var A=E.current,T=A.onResize,C=A.data,M=b.getBoundingClientRect(),x=M.width,N=M.height,F=b.offsetWidth,L=b.offsetHeight,I=Math.floor(x),V=Math.floor(N);if(d.current.width!==I||d.current.height!==V||d.current.offsetWidth!==F||d.current.offsetHeight!==L){var B={width:I,height:V,offsetWidth:F,offsetHeight:L};d.current=B;var j=F===Math.round(x)?x:F,X=L===Math.round(N)?N:L,Y=J(J({},B),{},{offsetWidth:j,offsetHeight:X});l==null||l(Y,b,C),T&&Promise.resolve().then(function(){T(Y,b)})}},[]);return _.useEffect(function(){var b=S();return b&&!r&&u5(b,w),function(){return f5(b,w)}},[i.current,r]),_.createElement(h5,{ref:s},g?_.cloneElement(f,{ref:v}):f)}var p5=_.forwardRef(g5),m5="rc-observer-key";function v5(t,e){var n=t.children,r=typeof n=="function"?[n]:Ho(n);return r.map(function(i,s){var l=(i==null?void 0:i.key)||"".concat(m5,"-").concat(s);return _.createElement(p5,kt({},t,{key:l,ref:s===0?e:void 0}),i)})}var Go=_.forwardRef(v5);Go.Collection=j4;function Q0(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function _5(t){if(Array.isArray(t))return Q0(t)}function l3(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function eb(t,e){if(t){if(typeof t=="string")return Q0(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Q0(t,e):void 0}}function y5(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ze(t){return _5(t)||l3(t)||eb(t)||y5()}var c3=function(e){return+setTimeout(e,16)},u3=function(e){return clearTimeout(e)};typeof window<"u"&&"requestAnimationFrame"in window&&(c3=function(e){return window.requestAnimationFrame(e)},u3=function(e){return window.cancelAnimationFrame(e)});var iT=0,tb=new Map;function f3(t){tb.delete(t)}var hr=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;iT+=1;var r=iT;function i(s){if(s===0)f3(r),e();else{var l=c3(function(){i(s-1)});tb.set(r,l)}}return i(n),r};hr.cancel=function(t){var e=tb.get(t);return f3(t),u3(e)};function d3(t){if(Array.isArray(t))return t}function b5(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,l,c=[],f=!0,d=!1;try{if(s=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=s.call(n)).done)&&(c.push(r.value),c.length!==e);f=!0);}catch(g){d=!0,i=g}finally{try{if(!f&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw i}}return c}}function h3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function de(t,e){return d3(t)||b5(t,e)||eb(t,e)||h3()}function Ef(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}function Qr(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function S5(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var n=e;n;){if(n===t)return!0;n=n.parentNode}return!1}var sT="data-rc-order",aT="data-rc-priority",w5="rc-util-key",G0=new Map;function g3(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.mark;return e?e.startsWith("data-")?e:"data-".concat(e):w5}function fp(t){if(t.attachTo)return t.attachTo;var e=document.querySelector("head");return e||document.body}function E5(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function nb(t){return Array.from((G0.get(t)||t).children).filter(function(e){return e.tagName==="STYLE"})}function p3(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Qr())return null;var n=e.csp,r=e.prepend,i=e.priority,s=i===void 0?0:i,l=E5(r),c=l==="prependQueue",f=document.createElement("style");f.setAttribute(sT,l),c&&s&&f.setAttribute(aT,"".concat(s)),n!=null&&n.nonce&&(f.nonce=n==null?void 0:n.nonce),f.innerHTML=t;var d=fp(e),g=d.firstChild;if(r){if(c){var m=(e.styles||nb(d)).filter(function(v){if(!["prepend","prependQueue"].includes(v.getAttribute(sT)))return!1;var S=Number(v.getAttribute(aT)||0);return s>=S});if(m.length)return d.insertBefore(f,m[m.length-1].nextSibling),f}d.insertBefore(f,g)}else d.appendChild(f);return f}function m3(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=fp(e);return(e.styles||nb(n)).find(function(r){return r.getAttribute(g3(e))===t})}function Tf(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=m3(t,e);if(n){var r=fp(e);r.removeChild(n)}}function T5(t,e){var n=G0.get(t);if(!n||!S5(document,n)){var r=p3("",e),i=r.parentNode;G0.set(t,i),t.removeChild(r)}}function js(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=fp(n),i=nb(r),s=J(J({},n),{},{styles:i});T5(r,s);var l=m3(e,s);if(l){var c,f;if((c=s.csp)!==null&&c!==void 0&&c.nonce&&l.nonce!==((f=s.csp)===null||f===void 0?void 0:f.nonce)){var d;l.nonce=(d=s.csp)===null||d===void 0?void 0:d.nonce}return l.innerHTML!==t&&(l.innerHTML=t),l}var g=p3(t,s);return g.setAttribute(g3(s),e),g}function A5(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function Fn(t,e){if(t==null)return{};var n,r,i=A5(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function ng(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function i(s,l){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=r.has(s);if(Ur(!f,"Warning: There may be circular references"),f)return!1;if(s===l)return!0;if(n&&c>1)return!1;r.add(s);var d=c+1;if(Array.isArray(s)){if(!Array.isArray(l)||s.length!==l.length)return!1;for(var g=0;g<s.length;g++)if(!i(s[g],l[g],d))return!1;return!0}if(s&&l&&pt(s)==="object"&&pt(l)==="object"){var m=Object.keys(s);return m.length!==Object.keys(l).length?!1:m.every(function(v){return i(s[v],l[v],d)})}return!1}return i(t,e)}var C5="%";function J0(t){return t.join(C5)}var R5=function(){function t(e){Or(this,t),K(this,"instanceId",void 0),K(this,"cache",new Map),this.instanceId=e}return Pr(t,[{key:"get",value:function(n){return this.opGet(J0(n))}},{key:"opGet",value:function(n){return this.cache.get(n)||null}},{key:"update",value:function(n,r){return this.opUpdate(J0(n),r)}},{key:"opUpdate",value:function(n,r){var i=this.cache.get(n),s=r(i);s===null?this.cache.delete(n):this.cache.set(n,s)}}]),t}(),Ec="data-token-hash",es="data-css-hash",Da="__cssinjs_instance__";function x5(){var t=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){var e=document.body.querySelectorAll("style[".concat(es,"]"))||[],n=document.head.firstChild;Array.from(e).forEach(function(i){i[Da]=i[Da]||t,i[Da]===t&&document.head.insertBefore(i,n)});var r={};Array.from(document.querySelectorAll("style[".concat(es,"]"))).forEach(function(i){var s=i.getAttribute(es);if(r[s]){if(i[Da]===t){var l;(l=i.parentNode)===null||l===void 0||l.removeChild(i)}}else r[s]=!0})}return new R5(t)}var qf=_.createContext({hashPriority:"low",cache:x5(),defaultCache:!0});function M5(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}var rb=function(){function t(){Or(this,t),K(this,"cache",void 0),K(this,"keys",void 0),K(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return Pr(t,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(n){var r,i,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l={map:this.cache};return n.forEach(function(c){if(!l)l=void 0;else{var f;l=(f=l)===null||f===void 0||(f=f.map)===null||f===void 0?void 0:f.get(c)}}),(r=l)!==null&&r!==void 0&&r.value&&s&&(l.value[1]=this.cacheCallTimes++),(i=l)===null||i===void 0?void 0:i.value}},{key:"get",value:function(n){var r;return(r=this.internalGet(n,!0))===null||r===void 0?void 0:r[0]}},{key:"has",value:function(n){return!!this.internalGet(n)}},{key:"set",value:function(n,r){var i=this;if(!this.has(n)){if(this.size()+1>t.MAX_CACHE_SIZE+t.MAX_CACHE_OFFSET){var s=this.keys.reduce(function(d,g){var m=de(d,2),v=m[1];return i.internalGet(g)[1]<v?[g,i.internalGet(g)[1]]:d},[this.keys[0],this.cacheCallTimes]),l=de(s,1),c=l[0];this.delete(c)}this.keys.push(n)}var f=this.cache;n.forEach(function(d,g){if(g===n.length-1)f.set(d,{value:[r,i.cacheCallTimes++]});else{var m=f.get(d);m?m.map||(m.map=new Map):f.set(d,{map:new Map}),f=f.get(d).map}})}},{key:"deleteByPath",value:function(n,r){var i=n.get(r[0]);if(r.length===1){var s;return i.map?n.set(r[0],{map:i.map}):n.delete(r[0]),(s=i.value)===null||s===void 0?void 0:s[0]}var l=this.deleteByPath(i.map,r.slice(1));return(!i.map||i.map.size===0)&&!i.value&&n.delete(r[0]),l}},{key:"delete",value:function(n){if(this.has(n))return this.keys=this.keys.filter(function(r){return!M5(r,n)}),this.deleteByPath(this.cache,n)}}]),t}();K(rb,"MAX_CACHE_SIZE",20);K(rb,"MAX_CACHE_OFFSET",5);var oT=0,v3=function(){function t(e){Or(this,t),K(this,"derivatives",void 0),K(this,"id",void 0),this.derivatives=Array.isArray(e)?e:[e],this.id=oT,e.length===0&&(e.length>0,void 0),oT+=1}return Pr(t,[{key:"getDerivativeToken",value:function(n){return this.derivatives.reduce(function(r,i){return i(n,r)},void 0)}}]),t}(),Bv=new rb;function e_(t){var e=Array.isArray(t)?t:[t];return Bv.has(e)||Bv.set(e,new v3(e)),Bv.get(e)}var O5=new WeakMap,Uv={};function P5(t,e){for(var n=O5,r=0;r<e.length;r+=1){var i=e[r];n.has(i)||n.set(i,new WeakMap),n=n.get(i)}return n.has(Uv)||n.set(Uv,t()),n.get(Uv)}var lT=new WeakMap;function sf(t){var e=lT.get(t)||"";return e||(Object.keys(t).forEach(function(n){var r=t[n];e+=n,r instanceof v3?e+=r.id:r&&pt(r)==="object"?e+=sf(r):e+=r}),e=Ef(e),lT.set(t,e)),e}function cT(t,e){return Ef("".concat(e,"_").concat(sf(t)))}var t_=Qr();function Rt(t){return typeof t=="number"?"".concat(t,"px"):t}function rg(t,e,n){var r,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(s)return t;var l=J(J({},i),{},(r={},K(r,Ec,e),K(r,es,n),r)),c=Object.keys(l).map(function(f){var d=l[f];return d?"".concat(f,'="').concat(d,'"'):null}).filter(function(f){return f}).join(" ");return"<style ".concat(c,">").concat(t,"</style>")}var Fh=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(n?"".concat(n,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},N5=function(e,n,r){return Object.keys(e).length?".".concat(n).concat(r!=null&&r.scope?".".concat(r.scope):"","{").concat(Object.entries(e).map(function(i){var s=de(i,2),l=s[0],c=s[1];return"".concat(l,":").concat(c,";")}).join(""),"}"):""},_3=function(e,n,r){var i={},s={};return Object.entries(e).forEach(function(l){var c,f,d=de(l,2),g=d[0],m=d[1];if(r!=null&&(c=r.preserve)!==null&&c!==void 0&&c[g])s[g]=m;else if((typeof m=="string"||typeof m=="number")&&!(r!=null&&(f=r.ignore)!==null&&f!==void 0&&f[g])){var v,S=Fh(g,r==null?void 0:r.prefix);i[S]=typeof m=="number"&&!(r!=null&&(v=r.unitless)!==null&&v!==void 0&&v[g])?"".concat(m,"px"):String(m),s[g]="var(".concat(S,")")}}),[s,N5(i,n,{scope:r==null?void 0:r.scope})]},uT=Qr()?_.useLayoutEffect:_.useEffect,Dn=function(e,n){var r=_.useRef(!0);uT(function(){return e(r.current)},n),uT(function(){return r.current=!1,function(){r.current=!0}},[])},fT=function(e,n){Dn(function(r){if(!r)return e()},n)},I5=J({},rp),dT=I5.useInsertionEffect,D5=function(e,n,r){_.useMemo(e,r),Dn(function(){return n(!0)},r)},F5=dT?function(t,e,n){return dT(function(){return t(),e()},n)}:D5,k5=J({},rp),B5=k5.useInsertionEffect,U5=function(e){var n=[],r=!1;function i(s){r||n.push(s)}return _.useEffect(function(){return r=!1,function(){r=!0,n.length&&n.forEach(function(s){return s()})}},e),i},L5=function(){return function(e){e()}},z5=typeof B5<"u"?U5:L5;function ib(t,e,n,r,i){var s=_.useContext(qf),l=s.cache,c=[t].concat(ze(e)),f=J0(c),d=z5([f]),g=function(E){l.opUpdate(f,function(w){var b=w||[void 0,void 0],A=de(b,2),T=A[0],C=T===void 0?0:T,M=A[1],x=M,N=x||n(),F=[C,N];return E?E(F):F})};_.useMemo(function(){g()},[f]);var m=l.opGet(f),v=m[1];return F5(function(){i==null||i(v)},function(S){return g(function(E){var w=de(E,2),b=w[0],A=w[1];return S&&b===0&&(i==null||i(v)),[b+1,A]}),function(){l.opUpdate(f,function(E){var w=E||[],b=de(w,2),A=b[0],T=A===void 0?0:A,C=b[1],M=T-1;return M===0?(d(function(){(S||!l.opGet(f))&&(r==null||r(C,!1))}),null):[T-1,C]})}},[f]),v}var $5={},V5="css",vo=new Map;function H5(t){vo.set(t,(vo.get(t)||0)+1)}function j5(t,e){if(typeof document<"u"){var n=document.querySelectorAll("style[".concat(Ec,'="').concat(t,'"]'));n.forEach(function(r){if(r[Da]===e){var i;(i=r.parentNode)===null||i===void 0||i.removeChild(r)}})}}var W5=0;function X5(t,e){vo.set(t,(vo.get(t)||0)-1);var n=Array.from(vo.keys()),r=n.filter(function(i){var s=vo.get(i)||0;return s<=0});n.length-r.length>W5&&r.forEach(function(i){j5(i,e),vo.delete(i)})}var q5=function(e,n,r,i){var s=r.getDerivativeToken(e),l=J(J({},s),n);return i&&(l=i(l)),l},y3="token";function Y5(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=_.useContext(qf),i=r.cache.instanceId,s=r.container,l=n.salt,c=l===void 0?"":l,f=n.override,d=f===void 0?$5:f,g=n.formatToken,m=n.getComputedToken,v=n.cssVar,S=P5(function(){return Object.assign.apply(Object,[{}].concat(ze(e)))},e),E=sf(S),w=sf(d),b=v?sf(v):"",A=ib(y3,[c,t.id,E,w,b],function(){var T,C=m?m(S,d,t):q5(S,d,t,g),M=J({},C),x="";if(v){var N=_3(C,v.key,{prefix:v.prefix,ignore:v.ignore,unitless:v.unitless,preserve:v.preserve}),F=de(N,2);C=F[0],x=F[1]}var L=cT(C,c);C._tokenKey=L,M._tokenKey=cT(M,c);var I=(T=v==null?void 0:v.key)!==null&&T!==void 0?T:L;C._themeKey=I,H5(I);var V="".concat(V5,"-").concat(Ef(L));return C._hashId=V,[C,V,M,x,(v==null?void 0:v.key)||""]},function(T){X5(T[0]._themeKey,i)},function(T){var C=de(T,4),M=C[0],x=C[3];if(v&&x){var N=js(x,Ef("css-variables-".concat(M._themeKey)),{mark:es,prepend:"queue",attachTo:s,priority:-999});N[Da]=i,N.setAttribute(Ec,M._themeKey)}});return A}var K5=function(e,n,r){var i=de(e,5),s=i[2],l=i[3],c=i[4],f=r||{},d=f.plain;if(!l)return null;var g=s._tokenKey,m=-999,v={"data-rc-order":"prependQueue","data-rc-priority":"".concat(m)},S=rg(l,c,g,v,d);return[m,g,S]},Z5={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},b3="comm",S3="rule",w3="decl",Q5="@import",G5="@namespace",J5="@keyframes",eF="@layer",E3=Math.abs,sb=String.fromCharCode;function T3(t){return t.trim()}function kh(t,e,n){return t.replace(e,n)}function tF(t,e,n){return t.indexOf(e,n)}function rc(t,e){return t.charCodeAt(e)|0}function Tc(t,e,n){return t.slice(e,n)}function fs(t){return t.length}function nF(t){return t.length}function lh(t,e){return e.push(t),t}var dp=1,Ac=1,A3=0,Ii=0,or=0,$c="";function ab(t,e,n,r,i,s,l,c){return{value:t,root:e,parent:n,type:r,props:i,children:s,line:dp,column:Ac,length:l,return:"",siblings:c}}function rF(){return or}function iF(){return or=Ii>0?rc($c,--Ii):0,Ac--,or===10&&(Ac=1,dp--),or}function ts(){return or=Ii<A3?rc($c,Ii++):0,Ac++,or===10&&(Ac=1,dp++),or}function Fa(){return rc($c,Ii)}function Bh(){return Ii}function hp(t,e){return Tc($c,t,e)}function Af(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function sF(t){return dp=Ac=1,A3=fs($c=t),Ii=0,[]}function aF(t){return $c="",t}function Lv(t){return T3(hp(Ii-1,n_(t===91?t+2:t===40?t+1:t)))}function oF(t){for(;(or=Fa())&&or<33;)ts();return Af(t)>2||Af(or)>3?"":" "}function lF(t,e){for(;--e&&ts()&&!(or<48||or>102||or>57&&or<65||or>70&&or<97););return hp(t,Bh()+(e<6&&Fa()==32&&ts()==32))}function n_(t){for(;ts();)switch(or){case t:return Ii;case 34:case 39:t!==34&&t!==39&&n_(or);break;case 40:t===41&&n_(t);break;case 92:ts();break}return Ii}function cF(t,e){for(;ts()&&t+or!==57;)if(t+or===84&&Fa()===47)break;return"/*"+hp(e,Ii-1)+"*"+sb(t===47?t:ts())}function uF(t){for(;!Af(Fa());)ts();return hp(t,Ii)}function fF(t){return aF(Uh("",null,null,null,[""],t=sF(t),0,[0],t))}function Uh(t,e,n,r,i,s,l,c,f){for(var d=0,g=0,m=l,v=0,S=0,E=0,w=1,b=1,A=1,T=0,C="",M=i,x=s,N=r,F=C;b;)switch(E=T,T=ts()){case 40:if(E!=108&&rc(F,m-1)==58){tF(F+=kh(Lv(T),"&","&\f"),"&\f",E3(d?c[d-1]:0))!=-1&&(A=-1);break}case 34:case 39:case 91:F+=Lv(T);break;case 9:case 10:case 13:case 32:F+=oF(E);break;case 92:F+=lF(Bh()-1,7);continue;case 47:switch(Fa()){case 42:case 47:lh(dF(cF(ts(),Bh()),e,n,f),f),(Af(E||1)==5||Af(Fa()||1)==5)&&fs(F)&&Tc(F,-1,void 0)!==" "&&(F+=" ");break;default:F+="/"}break;case 123*w:c[d++]=fs(F)*A;case 125*w:case 59:case 0:switch(T){case 0:case 125:b=0;case 59+g:A==-1&&(F=kh(F,/\f/g,"")),S>0&&(fs(F)-m||w===0&&E===47)&&lh(S>32?gT(F+";",r,n,m-1,f):gT(kh(F," ","")+";",r,n,m-2,f),f);break;case 59:F+=";";default:if(lh(N=hT(F,e,n,d,g,i,c,C,M=[],x=[],m,s),s),T===123)if(g===0)Uh(F,e,N,N,M,s,m,c,x);else{switch(v){case 99:if(rc(F,3)===110)break;case 108:if(rc(F,2)===97)break;default:g=0;case 100:case 109:case 115:}g?Uh(t,N,N,r&&lh(hT(t,N,N,0,0,i,c,C,i,M=[],m,x),x),i,x,m,c,r?M:x):Uh(F,N,N,N,[""],x,0,c,x)}}d=g=S=0,w=A=1,C=F="",m=l;break;case 58:m=1+fs(F),S=E;default:if(w<1){if(T==123)--w;else if(T==125&&w++==0&&iF()==125)continue}switch(F+=sb(T),T*w){case 38:A=g>0?1:(F+="\f",-1);break;case 44:c[d++]=(fs(F)-1)*A,A=1;break;case 64:Fa()===45&&(F+=Lv(ts())),v=Fa(),g=m=fs(C=F+=uF(Bh())),T++;break;case 45:E===45&&fs(F)==2&&(w=0)}}return s}function hT(t,e,n,r,i,s,l,c,f,d,g,m){for(var v=i-1,S=i===0?s:[""],E=nF(S),w=0,b=0,A=0;w<r;++w)for(var T=0,C=Tc(t,v+1,v=E3(b=l[w])),M=t;T<E;++T)(M=T3(b>0?S[T]+" "+C:kh(C,/&\f/g,S[T])))&&(f[A++]=M);return ab(t,e,n,i===0?S3:c,f,d,g,m)}function dF(t,e,n,r){return ab(t,e,n,b3,sb(rF()),Tc(t,2,-2),0,r)}function gT(t,e,n,r,i){return ab(t,e,n,w3,Tc(t,0,r),Tc(t,r+1,-1),r,i)}function r_(t,e){for(var n="",r=0;r<t.length;r++)n+=e(t[r],r,t,e)||"";return n}function hF(t,e,n,r){switch(t.type){case eF:if(t.children.length)break;case Q5:case G5:case w3:return t.return=t.return||t.value;case b3:return"";case J5:return t.return=t.value+"{"+r_(t.children,r)+"}";case S3:if(!fs(t.value=t.props.join(",")))return""}return fs(n=r_(t.children,r))?t.return=t.value+"{"+n+"}":""}var pT="data-ant-cssinjs-cache-path",C3="_FILE_STYLE__",Fo,R3=!0;function gF(){if(!Fo&&(Fo={},Qr())){var t=document.createElement("div");t.className=pT,t.style.position="fixed",t.style.visibility="hidden",t.style.top="-9999px",document.body.appendChild(t);var e=getComputedStyle(t).content||"";e=e.replace(/^"/,"").replace(/"$/,""),e.split(";").forEach(function(i){var s=i.split(":"),l=de(s,2),c=l[0],f=l[1];Fo[c]=f});var n=document.querySelector("style[".concat(pT,"]"));if(n){var r;R3=!1,(r=n.parentNode)===null||r===void 0||r.removeChild(n)}document.body.removeChild(t)}}function pF(t){return gF(),!!Fo[t]}function mF(t){var e=Fo[t],n=null;if(e&&Qr())if(R3)n=C3;else{var r=document.querySelector("style[".concat(es,'="').concat(Fo[t],'"]'));r?n=r.innerHTML:delete Fo[t]}return[n,e]}var vF="_skip_check_",x3="_multi_value_";function Lh(t){var e=r_(fF(t),hF);return e.replace(/\{%%%\:[^;];}/g,";")}function _F(t){return pt(t)==="object"&&t&&(vF in t||x3 in t)}function mT(t,e,n){if(!e)return t;var r=".".concat(e),i=n==="low"?":where(".concat(r,")"):r,s=t.split(",").map(function(l){var c,f=l.trim().split(/\s+/),d=f[0]||"",g=((c=d.match(/^\w+/))===null||c===void 0?void 0:c[0])||"";return d="".concat(g).concat(i).concat(d.slice(g.length)),[d].concat(ze(f.slice(1))).join(" ")});return s.join(",")}var yF=function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},i=r.root,s=r.injectHash,l=r.parentSelectors,c=n.hashId,f=n.layer;n.path;var d=n.hashPriority,g=n.transformers,m=g===void 0?[]:g;n.linters;var v="",S={};function E(A){var T=A.getName(c);if(!S[T]){var C=t(A.style,n,{root:!1,parentSelectors:l}),M=de(C,1),x=M[0];S[T]="@keyframes ".concat(A.getName(c)).concat(x)}}function w(A){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return A.forEach(function(C){Array.isArray(C)?w(C,T):C&&T.push(C)}),T}var b=w(Array.isArray(e)?e:[e]);return b.forEach(function(A){var T=typeof A=="string"&&!i?{}:A;if(typeof T=="string")v+="".concat(T,`
`);else if(T._keyframe)E(T);else{var C=m.reduce(function(M,x){var N;return(x==null||(N=x.visit)===null||N===void 0?void 0:N.call(x,M))||M},T);Object.keys(C).forEach(function(M){var x=C[M];if(pt(x)==="object"&&x&&(M!=="animationName"||!x._keyframe)&&!_F(x)){var N=!1,F=M.trim(),L=!1;(i||s)&&c?F.startsWith("@")?N=!0:F==="&"?F=mT("",c,d):F=mT(M,c,d):i&&!c&&(F==="&"||F==="")&&(F="",L=!0);var I=t(x,n,{root:L,injectHash:N,parentSelectors:[].concat(ze(l),[F])}),V=de(I,2),B=V[0],j=V[1];S=J(J({},S),j),v+="".concat(F).concat(B)}else{let ae=function(U,z){var W=U.replace(/[A-Z]/g,function(P){return"-".concat(P.toLowerCase())}),Z=z;!Z5[U]&&typeof Z=="number"&&Z!==0&&(Z="".concat(Z,"px")),U==="animationName"&&z!==null&&z!==void 0&&z._keyframe&&(E(z),Z=z.getName(c)),v+="".concat(W,":").concat(Z,";")};var X,Y=(X=x==null?void 0:x.value)!==null&&X!==void 0?X:x;pt(x)==="object"&&x!==null&&x!==void 0&&x[x3]&&Array.isArray(Y)?Y.forEach(function(U){ae(M,U)}):ae(M,Y)}})}}),i?f&&(v&&(v="@layer ".concat(f.name," {").concat(v,"}")),f.dependencies&&(S["@layer ".concat(f.name)]=f.dependencies.map(function(A){return"@layer ".concat(A,", ").concat(f.name,";")}).join(`
`))):v="{".concat(v,"}"),[v,S]};function M3(t,e){return Ef("".concat(t.join("%")).concat(e))}function bF(){return null}var O3="style";function i_(t,e){var n=t.token,r=t.path,i=t.hashId,s=t.layer,l=t.nonce,c=t.clientOnly,f=t.order,d=f===void 0?0:f,g=_.useContext(qf),m=g.autoClear;g.mock;var v=g.defaultCache,S=g.hashPriority,E=g.container,w=g.ssrInline,b=g.transformers,A=g.linters,T=g.cache,C=g.layer,M=n._tokenKey,x=[M];C&&x.push("layer"),x.push.apply(x,ze(r));var N=t_,F=ib(O3,x,function(){var j=x.join("|");if(pF(j)){var X=mF(j),Y=de(X,2),ae=Y[0],U=Y[1];if(ae)return[ae,M,U,{},c,d]}var z=e(),W=yF(z,{hashId:i,hashPriority:S,layer:C?s:void 0,path:r.join("-"),transformers:b,linters:A}),Z=de(W,2),P=Z[0],$=Z[1],ie=Lh(P),se=M3(x,ie);return[ie,M,se,$,c,d]},function(j,X){var Y=de(j,3),ae=Y[2];(X||m)&&t_&&Tf(ae,{mark:es})},function(j){var X=de(j,4),Y=X[0];X[1];var ae=X[2],U=X[3];if(N&&Y!==C3){var z={mark:es,prepend:C?!1:"queue",attachTo:E,priority:d},W=typeof l=="function"?l():l;W&&(z.csp={nonce:W});var Z=[],P=[];Object.keys(U).forEach(function(ie){ie.startsWith("@layer")?Z.push(ie):P.push(ie)}),Z.forEach(function(ie){js(Lh(U[ie]),"_layer-".concat(ie),J(J({},z),{},{prepend:!0}))});var $=js(Y,ae,z);$[Da]=T.instanceId,$.setAttribute(Ec,M),P.forEach(function(ie){js(Lh(U[ie]),"_effect-".concat(ie),z)})}}),L=de(F,3),I=L[0],V=L[1],B=L[2];return function(j){var X;if(!w||N||!v)X=_.createElement(bF,null);else{var Y;X=_.createElement("style",kt({},(Y={},K(Y,Ec,V),K(Y,es,B),Y),{dangerouslySetInnerHTML:{__html:I}}))}return _.createElement(_.Fragment,null,X,j)}}var SF=function(e,n,r){var i=de(e,6),s=i[0],l=i[1],c=i[2],f=i[3],d=i[4],g=i[5],m=r||{},v=m.plain;if(d)return null;var S=s,E={"data-rc-order":"prependQueue","data-rc-priority":"".concat(g)};return S=rg(s,l,c,E,v),f&&Object.keys(f).forEach(function(w){if(!n[w]){n[w]=!0;var b=Lh(f[w]),A=rg(b,l,"_effect-".concat(w),E,v);w.startsWith("@layer")?S=A+S:S+=A}}),[g,c,S]},P3="cssVar",wF=function(e,n){var r=e.key,i=e.prefix,s=e.unitless,l=e.ignore,c=e.token,f=e.scope,d=f===void 0?"":f,g=_.useContext(qf),m=g.cache.instanceId,v=g.container,S=c._tokenKey,E=[].concat(ze(e.path),[r,d,S]),w=ib(P3,E,function(){var b=n(),A=_3(b,r,{prefix:i,unitless:s,ignore:l,scope:d}),T=de(A,2),C=T[0],M=T[1],x=M3(E,M);return[C,M,x,r]},function(b){var A=de(b,3),T=A[2];t_&&Tf(T,{mark:es})},function(b){var A=de(b,3),T=A[1],C=A[2];if(T){var M=js(T,C,{mark:es,prepend:"queue",attachTo:v,priority:-999});M[Da]=m,M.setAttribute(Ec,r)}});return w},EF=function(e,n,r){var i=de(e,4),s=i[1],l=i[2],c=i[3],f=r||{},d=f.plain;if(!s)return null;var g=-999,m={"data-rc-order":"prependQueue","data-rc-priority":"".concat(g)},v=rg(s,c,l,m,d);return[g,l,v]},zu;zu={},K(zu,O3,SF),K(zu,y3,K5),K(zu,P3,EF);var ln=function(){function t(e,n){Or(this,t),K(this,"name",void 0),K(this,"style",void 0),K(this,"_keyframe",!0),this.name=e,this.style=n}return Pr(t,[{key:"getName",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return n?"".concat(n,"-").concat(this.name):this.name}}]),t}();function Bl(t){return t.notSplit=!0,t}Bl(["borderTop","borderBottom"]),Bl(["borderTop"]),Bl(["borderBottom"]),Bl(["borderLeft","borderRight"]),Bl(["borderLeft"]),Bl(["borderRight"]);var ob=_.createContext({});function N3(t){return d3(t)||l3(t)||eb(t)||h3()}function _s(t,e){for(var n=t,r=0;r<e.length;r+=1){if(n==null)return;n=n[e[r]]}return n}function I3(t,e,n,r){if(!e.length)return n;var i=N3(e),s=i[0],l=i.slice(1),c;return!t&&typeof s=="number"?c=[]:Array.isArray(t)?c=ze(t):c=J({},t),r&&n===void 0&&l.length===1?delete c[s][l[0]]:c[s]=I3(c[s],l,n,r),c}function qi(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&r&&n===void 0&&!_s(t,e.slice(0,-1))?t:I3(t,e,n,r)}function TF(t){return pt(t)==="object"&&t!==null&&Object.getPrototypeOf(t)===Object.prototype}function vT(t){return Array.isArray(t)?[]:{}}var AF=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function ql(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=vT(e[0]);return e.forEach(function(i){function s(l,c){var f=new Set(c),d=_s(i,l),g=Array.isArray(d);if(g||TF(d)){if(!f.has(d)){f.add(d);var m=_s(r,l);g?r=qi(r,l,[]):(!m||pt(m)!=="object")&&(r=qi(r,l,vT(d))),AF(d).forEach(function(v){s([].concat(ze(l),[v]),f)})}}else r=qi(r,l,d)}s([])}),r}function CF(){}const RF=_.createContext({}),D3=()=>{const t=()=>{};return t.deprecated=CF,t},xF=_.createContext(void 0);var MF={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},OF={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},PF=J(J({},OF),{},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",week:"Week",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",dateFormat:"M/D/YYYY",dateTimeFormat:"M/D/YYYY HH:mm:ss",previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"});const F3={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},_T={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},PF),timePickerLocale:Object.assign({},F3)},si="${label} is not a valid ${type}",Cc={locale:"en",Pagination:MF,DatePicker:_T,TimePicker:F3,Calendar:_T,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckAll:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:si,method:si,array:si,object:si,number:si,date:si,boolean:si,integer:si,float:si,regexp:si,email:si,url:si,hex:si},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty",transparent:"Transparent",singleColor:"Single",gradientColor:"Gradient"}};Object.assign({},Cc.Modal);let zh=[];const yT=()=>zh.reduce((t,e)=>Object.assign(Object.assign({},t),e),Cc.Modal);function NF(t){if(t){const e=Object.assign({},t);return zh.push(e),yT(),()=>{zh=zh.filter(n=>n!==e),yT()}}Object.assign({},Cc.Modal)}const lb=_.createContext(void 0),cb=(t,e)=>{const n=_.useContext(lb),r=_.useMemo(()=>{var s;const l=Cc[t],c=(s=n==null?void 0:n[t])!==null&&s!==void 0?s:{};return Object.assign(Object.assign({},typeof l=="function"?l():l),c||{})},[t,e,n]),i=_.useMemo(()=>{const s=n==null?void 0:n.locale;return n!=null&&n.exist&&!s?Cc.locale:s},[n]);return[r,i]},IF="internalMark",DF=t=>{const{locale:e={},children:n,_ANT_MARK__:r}=t;_.useEffect(()=>NF(e==null?void 0:e.Modal),[e]);const i=_.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return _.createElement(lb.Provider,{value:i},n)},k3={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},Cf=Object.assign(Object.assign({},k3),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0}),yr=Math.round;function zv(t,e){const n=t.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],r=n.map(i=>parseFloat(i));for(let i=0;i<3;i+=1)r[i]=e(r[i]||0,n[i]||"",i);return n[3]?r[3]=n[3].includes("%")?r[3]/100:r[3]:r[3]=1,r}const bT=(t,e,n)=>n===0?t:t/100;function $u(t,e){const n=e||255;return t>n?n:t<0?0:t}class wn{constructor(e){K(this,"isValid",!0),K(this,"r",0),K(this,"g",0),K(this,"b",0),K(this,"a",1),K(this,"_h",void 0),K(this,"_s",void 0),K(this,"_l",void 0),K(this,"_v",void 0),K(this,"_max",void 0),K(this,"_min",void 0),K(this,"_brightness",void 0);function n(r){return r[0]in e&&r[1]in e&&r[2]in e}if(e)if(typeof e=="string"){let i=function(s){return r.startsWith(s)};const r=e.trim();/^#?[A-F\d]{3,8}$/i.test(r)?this.fromHexString(r):i("rgb")?this.fromRgbString(r):i("hsl")?this.fromHslString(r):(i("hsv")||i("hsb"))&&this.fromHsvString(r)}else if(e instanceof wn)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(n("rgb"))this.r=$u(e.r),this.g=$u(e.g),this.b=$u(e.b),this.a=typeof e.a=="number"?$u(e.a,1):1;else if(n("hsl"))this.fromHsl(e);else if(n("hsv"))this.fromHsv(e);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e))}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){const n=this.toHsv();return n.h=e,this._c(n)}getLuminance(){function e(s){const l=s/255;return l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4)}const n=e(this.r),r=e(this.g),i=e(this.b);return .2126*n+.7152*r+.0722*i}getHue(){if(typeof this._h>"u"){const e=this.getMax()-this.getMin();e===0?this._h=0:this._h=yr(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/e+2:(this.r-this.g)/e+4))}return this._h}getSaturation(){if(typeof this._s>"u"){const e=this.getMax()-this.getMin();e===0?this._s=0:this._s=e/this.getMax()}return this._s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(e=10){const n=this.getHue(),r=this.getSaturation();let i=this.getLightness()-e/100;return i<0&&(i=0),this._c({h:n,s:r,l:i,a:this.a})}lighten(e=10){const n=this.getHue(),r=this.getSaturation();let i=this.getLightness()+e/100;return i>1&&(i=1),this._c({h:n,s:r,l:i,a:this.a})}mix(e,n=50){const r=this._c(e),i=n/100,s=c=>(r[c]-this[c])*i+this[c],l={r:yr(s("r")),g:yr(s("g")),b:yr(s("b")),a:yr(s("a")*100)/100};return this._c(l)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){const n=this._c(e),r=this.a+n.a*(1-this.a),i=s=>yr((this[s]*this.a+n[s]*n.a*(1-this.a))/r);return this._c({r:i("r"),g:i("g"),b:i("b"),a:r})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#";const n=(this.r||0).toString(16);e+=n.length===2?n:"0"+n;const r=(this.g||0).toString(16);e+=r.length===2?r:"0"+r;const i=(this.b||0).toString(16);if(e+=i.length===2?i:"0"+i,typeof this.a=="number"&&this.a>=0&&this.a<1){const s=yr(this.a*255).toString(16);e+=s.length===2?s:"0"+s}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const e=this.getHue(),n=yr(this.getSaturation()*100),r=yr(this.getLightness()*100);return this.a!==1?`hsla(${e},${n}%,${r}%,${this.a})`:`hsl(${e},${n}%,${r}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,n,r){const i=this.clone();return i[e]=$u(n,r),i}_c(e){return new this.constructor(e)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){const n=e.replace("#","");function r(i,s){return parseInt(n[i]+n[s||i],16)}n.length<6?(this.r=r(0),this.g=r(1),this.b=r(2),this.a=n[3]?r(3)/255:1):(this.r=r(0,1),this.g=r(2,3),this.b=r(4,5),this.a=n[6]?r(6,7)/255:1)}fromHsl({h:e,s:n,l:r,a:i}){if(this._h=e%360,this._s=n,this._l=r,this.a=typeof i=="number"?i:1,n<=0){const v=yr(r*255);this.r=v,this.g=v,this.b=v}let s=0,l=0,c=0;const f=e/60,d=(1-Math.abs(2*r-1))*n,g=d*(1-Math.abs(f%2-1));f>=0&&f<1?(s=d,l=g):f>=1&&f<2?(s=g,l=d):f>=2&&f<3?(l=d,c=g):f>=3&&f<4?(l=g,c=d):f>=4&&f<5?(s=g,c=d):f>=5&&f<6&&(s=d,c=g);const m=r-d/2;this.r=yr((s+m)*255),this.g=yr((l+m)*255),this.b=yr((c+m)*255)}fromHsv({h:e,s:n,v:r,a:i}){this._h=e%360,this._s=n,this._v=r,this.a=typeof i=="number"?i:1;const s=yr(r*255);if(this.r=s,this.g=s,this.b=s,n<=0)return;const l=e/60,c=Math.floor(l),f=l-c,d=yr(r*(1-n)*255),g=yr(r*(1-n*f)*255),m=yr(r*(1-n*(1-f))*255);switch(c){case 0:this.g=m,this.b=d;break;case 1:this.r=g,this.b=d;break;case 2:this.r=d,this.b=m;break;case 3:this.r=d,this.g=g;break;case 4:this.r=m,this.g=d;break;case 5:default:this.g=d,this.b=g;break}}fromHsvString(e){const n=zv(e,bT);this.fromHsv({h:n[0],s:n[1],v:n[2],a:n[3]})}fromHslString(e){const n=zv(e,bT);this.fromHsl({h:n[0],s:n[1],l:n[2],a:n[3]})}fromRgbString(e){const n=zv(e,(r,i)=>i.includes("%")?yr(r/100*255):r);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]}}var ch=2,ST=.16,FF=.05,kF=.05,BF=.15,B3=5,U3=4,UF=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function wT(t,e,n){var r;return Math.round(t.h)>=60&&Math.round(t.h)<=240?r=n?Math.round(t.h)-ch*e:Math.round(t.h)+ch*e:r=n?Math.round(t.h)+ch*e:Math.round(t.h)-ch*e,r<0?r+=360:r>=360&&(r-=360),r}function ET(t,e,n){if(t.h===0&&t.s===0)return t.s;var r;return n?r=t.s-ST*e:e===U3?r=t.s+ST:r=t.s+FF*e,r>1&&(r=1),n&&e===B3&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(r*100)/100}function TT(t,e,n){var r;return n?r=t.v+kF*e:r=t.v-BF*e,r=Math.max(0,Math.min(1,r)),Math.round(r*100)/100}function Rf(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=new wn(t),i=r.toHsv(),s=B3;s>0;s-=1){var l=new wn({h:wT(i,s,!0),s:ET(i,s,!0),v:TT(i,s,!0)});n.push(l)}n.push(r);for(var c=1;c<=U3;c+=1){var f=new wn({h:wT(i,c),s:ET(i,c),v:TT(i,c)});n.push(f)}return e.theme==="dark"?UF.map(function(d){var g=d.index,m=d.amount;return new wn(e.backgroundColor||"#141414").mix(n[g],m).toHexString()}):n.map(function(d){return d.toHexString()})}var $v={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},s_=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];s_.primary=s_[5];var a_=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];a_.primary=a_[5];var o_=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];o_.primary=o_[5];var l_=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];l_.primary=l_[5];var c_=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];c_.primary=c_[5];var u_=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];u_.primary=u_[5];var f_=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];f_.primary=f_[5];var d_=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];d_.primary=d_[5];var ig=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];ig.primary=ig[5];var h_=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];h_.primary=h_[5];var g_=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];g_.primary=g_[5];var p_=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];p_.primary=p_[5];var m_=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];m_.primary=m_[5];var Vv={red:s_,volcano:a_,orange:o_,gold:l_,yellow:c_,lime:u_,green:f_,cyan:d_,blue:ig,geekblue:h_,purple:g_,magenta:p_,grey:m_};function LF(t,e){let{generateColorPalettes:n,generateNeutralColorPalettes:r}=e;const{colorSuccess:i,colorWarning:s,colorError:l,colorInfo:c,colorPrimary:f,colorBgBase:d,colorTextBase:g}=t,m=n(f),v=n(i),S=n(s),E=n(l),w=n(c),b=r(d,g),A=t.colorLink||t.colorInfo,T=n(A),C=new wn(E[1]).mix(new wn(E[3]),50).toHexString();return Object.assign(Object.assign({},b),{colorPrimaryBg:m[1],colorPrimaryBgHover:m[2],colorPrimaryBorder:m[3],colorPrimaryBorderHover:m[4],colorPrimaryHover:m[5],colorPrimary:m[6],colorPrimaryActive:m[7],colorPrimaryTextHover:m[8],colorPrimaryText:m[9],colorPrimaryTextActive:m[10],colorSuccessBg:v[1],colorSuccessBgHover:v[2],colorSuccessBorder:v[3],colorSuccessBorderHover:v[4],colorSuccessHover:v[4],colorSuccess:v[6],colorSuccessActive:v[7],colorSuccessTextHover:v[8],colorSuccessText:v[9],colorSuccessTextActive:v[10],colorErrorBg:E[1],colorErrorBgHover:E[2],colorErrorBgFilledHover:C,colorErrorBgActive:E[3],colorErrorBorder:E[3],colorErrorBorderHover:E[4],colorErrorHover:E[5],colorError:E[6],colorErrorActive:E[7],colorErrorTextHover:E[8],colorErrorText:E[9],colorErrorTextActive:E[10],colorWarningBg:S[1],colorWarningBgHover:S[2],colorWarningBorder:S[3],colorWarningBorderHover:S[4],colorWarningHover:S[4],colorWarning:S[6],colorWarningActive:S[7],colorWarningTextHover:S[8],colorWarningText:S[9],colorWarningTextActive:S[10],colorInfoBg:w[1],colorInfoBgHover:w[2],colorInfoBorder:w[3],colorInfoBorderHover:w[4],colorInfoHover:w[4],colorInfo:w[6],colorInfoActive:w[7],colorInfoTextHover:w[8],colorInfoText:w[9],colorInfoTextActive:w[10],colorLinkHover:T[4],colorLink:T[6],colorLinkActive:T[7],colorBgMask:new wn("#000").setA(.45).toRgbString(),colorWhite:"#fff"})}const zF=t=>{let e=t,n=t,r=t,i=t;return t<6&&t>=5?e=t+1:t<16&&t>=6?e=t+2:t>=16&&(e=16),t<7&&t>=5?n=4:t<8&&t>=7?n=5:t<14&&t>=8?n=6:t<16&&t>=14?n=7:t>=16&&(n=8),t<6&&t>=2?r=1:t>=6&&(r=2),t>4&&t<8?i=4:t>=8&&(i=6),{borderRadius:t,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:e,borderRadiusOuter:i}};function $F(t){const{motionUnit:e,motionBase:n,borderRadius:r,lineWidth:i}=t;return Object.assign({motionDurationFast:`${(n+e).toFixed(1)}s`,motionDurationMid:`${(n+e*2).toFixed(1)}s`,motionDurationSlow:`${(n+e*3).toFixed(1)}s`,lineWidthBold:i+1},zF(r))}const VF=t=>{const{controlHeight:e}=t;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}};function HF(t){return(t+8)/t}function jF(t){const e=new Array(10).fill(null).map((n,r)=>{const i=r-1,s=t*Math.pow(Math.E,i/5),l=r>1?Math.floor(s):Math.ceil(s);return Math.floor(l/2)*2});return e[1]=t,e.map(n=>({size:n,lineHeight:HF(n)}))}const WF=t=>{const e=jF(t),n=e.map(g=>g.size),r=e.map(g=>g.lineHeight),i=n[1],s=n[0],l=n[2],c=r[1],f=r[0],d=r[2];return{fontSizeSM:s,fontSize:i,fontSizeLG:l,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:c,lineHeightLG:d,lineHeightSM:f,fontHeight:Math.round(c*i),fontHeightLG:Math.round(d*l),fontHeightSM:Math.round(f*s),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};function XF(t){const{sizeUnit:e,sizeStep:n}=t;return{sizeXXL:e*(n+8),sizeXL:e*(n+4),sizeLG:e*(n+2),sizeMD:e*(n+1),sizeMS:e*n,size:e*n,sizeSM:e*(n-1),sizeXS:e*(n-2),sizeXXS:e*(n-3)}}const Ai=(t,e)=>new wn(t).setA(e).toRgbString(),Vu=(t,e)=>new wn(t).darken(e).toHexString(),qF=t=>{const e=Rf(t);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},YF=(t,e)=>{const n=t||"#fff",r=e||"#000";return{colorBgBase:n,colorTextBase:r,colorText:Ai(r,.88),colorTextSecondary:Ai(r,.65),colorTextTertiary:Ai(r,.45),colorTextQuaternary:Ai(r,.25),colorFill:Ai(r,.15),colorFillSecondary:Ai(r,.06),colorFillTertiary:Ai(r,.04),colorFillQuaternary:Ai(r,.02),colorBgSolid:Ai(r,1),colorBgSolidHover:Ai(r,.75),colorBgSolidActive:Ai(r,.95),colorBgLayout:Vu(n,4),colorBgContainer:Vu(n,0),colorBgElevated:Vu(n,0),colorBgSpotlight:Ai(r,.85),colorBgBlur:"transparent",colorBorder:Vu(n,15),colorBorderSecondary:Vu(n,6)}};function KF(t){$v.pink=$v.magenta,Vv.pink=Vv.magenta;const e=Object.keys(k3).map(n=>{const r=t[n]===$v[n]?Vv[n]:Rf(t[n]);return new Array(10).fill(1).reduce((i,s,l)=>(i[`${n}-${l+1}`]=r[l],i[`${n}${l+1}`]=r[l],i),{})}).reduce((n,r)=>(n=Object.assign(Object.assign({},n),r),n),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),e),LF(t,{generateColorPalettes:qF,generateNeutralColorPalettes:YF})),WF(t.fontSize)),XF(t)),VF(t)),$F(t))}const L3=e_(KF),v_={token:Cf,override:{override:Cf},hashed:!0},z3=Ft.createContext(v_),__="ant",ub="anticon",ZF=["outlined","borderless","filled","underlined"],QF=(t,e)=>e||(t?`${__}-${t}`:__),ui=_.createContext({getPrefixCls:QF,iconPrefixCls:ub}),{Consumer:IJ}=ui,AT={};function Vc(t){const e=_.useContext(ui),{getPrefixCls:n,direction:r,getPopupContainer:i}=e,s=e[t];return Object.assign(Object.assign({classNames:AT,styles:AT},s),{getPrefixCls:n,direction:r,getPopupContainer:i})}const GF=`-ant-${Date.now()}-${Math.random()}`;function JF(t,e){const n={},r=(l,c)=>{let f=l.clone();return f=(c==null?void 0:c(f))||f,f.toRgbString()},i=(l,c)=>{const f=new wn(l),d=Rf(f.toRgbString());n[`${c}-color`]=r(f),n[`${c}-color-disabled`]=d[1],n[`${c}-color-hover`]=d[4],n[`${c}-color-active`]=d[6],n[`${c}-color-outline`]=f.clone().setA(.2).toRgbString(),n[`${c}-color-deprecated-bg`]=d[0],n[`${c}-color-deprecated-border`]=d[2]};if(e.primaryColor){i(e.primaryColor,"primary");const l=new wn(e.primaryColor),c=Rf(l.toRgbString());c.forEach((d,g)=>{n[`primary-${g+1}`]=d}),n["primary-color-deprecated-l-35"]=r(l,d=>d.lighten(35)),n["primary-color-deprecated-l-20"]=r(l,d=>d.lighten(20)),n["primary-color-deprecated-t-20"]=r(l,d=>d.tint(20)),n["primary-color-deprecated-t-50"]=r(l,d=>d.tint(50)),n["primary-color-deprecated-f-12"]=r(l,d=>d.setA(d.a*.12));const f=new wn(c[0]);n["primary-color-active-deprecated-f-30"]=r(f,d=>d.setA(d.a*.3)),n["primary-color-active-deprecated-d-02"]=r(f,d=>d.darken(2))}return e.successColor&&i(e.successColor,"success"),e.warningColor&&i(e.warningColor,"warning"),e.errorColor&&i(e.errorColor,"error"),e.infoColor&&i(e.infoColor,"info"),`
:root {
${Object.keys(n).map(l=>`--${t}-${l}: ${n[l]};`).join(`
`)}
}
`.trim()}function e8(t,e){const n=JF(t,e);Qr()&&js(n,`${GF}-dynamic-theme`)}const xf=_.createContext(!1),t8=t=>{let{children:e,disabled:n}=t;const r=_.useContext(xf);return _.createElement(xf.Provider,{value:n??r},e)},Rc=_.createContext(void 0),n8=t=>{let{children:e,size:n}=t;const r=_.useContext(Rc);return _.createElement(Rc.Provider,{value:n||r},e)};function r8(){const t=_.useContext(xf),e=_.useContext(Rc);return{componentDisabled:t,componentSize:e}}var $3=Pr(function t(){Or(this,t)}),V3="CALC_UNIT",i8=new RegExp(V3,"g");function Hv(t){return typeof t=="number"?"".concat(t).concat(V3):t}var s8=function(t){Zo(n,t);var e=Qo(n);function n(r,i){var s;Or(this,n),s=e.call(this),K(Nt(s),"result",""),K(Nt(s),"unitlessCssVar",void 0),K(Nt(s),"lowPriority",void 0);var l=pt(r);return s.unitlessCssVar=i,r instanceof n?s.result="(".concat(r.result,")"):l==="number"?s.result=Hv(r):l==="string"&&(s.result=r),s}return Pr(n,[{key:"add",value:function(i){return i instanceof n?this.result="".concat(this.result," + ").concat(i.getResult()):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," + ").concat(Hv(i))),this.lowPriority=!0,this}},{key:"sub",value:function(i){return i instanceof n?this.result="".concat(this.result," - ").concat(i.getResult()):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," - ").concat(Hv(i))),this.lowPriority=!0,this}},{key:"mul",value:function(i){return this.lowPriority&&(this.result="(".concat(this.result,")")),i instanceof n?this.result="".concat(this.result," * ").concat(i.getResult(!0)):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," * ").concat(i)),this.lowPriority=!1,this}},{key:"div",value:function(i){return this.lowPriority&&(this.result="(".concat(this.result,")")),i instanceof n?this.result="".concat(this.result," / ").concat(i.getResult(!0)):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," / ").concat(i)),this.lowPriority=!1,this}},{key:"getResult",value:function(i){return this.lowPriority||i?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(i){var s=this,l=i||{},c=l.unit,f=!0;return typeof c=="boolean"?f=c:Array.from(this.unitlessCssVar).some(function(d){return s.result.includes(d)})&&(f=!1),this.result=this.result.replace(i8,f?"px":""),typeof this.lowPriority<"u"?"calc(".concat(this.result,")"):this.result}}]),n}($3),a8=function(t){Zo(n,t);var e=Qo(n);function n(r){var i;return Or(this,n),i=e.call(this),K(Nt(i),"result",0),r instanceof n?i.result=r.result:typeof r=="number"&&(i.result=r),i}return Pr(n,[{key:"add",value:function(i){return i instanceof n?this.result+=i.result:typeof i=="number"&&(this.result+=i),this}},{key:"sub",value:function(i){return i instanceof n?this.result-=i.result:typeof i=="number"&&(this.result-=i),this}},{key:"mul",value:function(i){return i instanceof n?this.result*=i.result:typeof i=="number"&&(this.result*=i),this}},{key:"div",value:function(i){return i instanceof n?this.result/=i.result:typeof i=="number"&&(this.result/=i),this}},{key:"equal",value:function(){return this.result}}]),n}($3),o8=function(e,n){var r=e==="css"?s8:a8;return function(i){return new r(i,n)}},CT=function(e,n){return"".concat([n,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"))};function dr(t){var e=_.useRef();e.current=t;var n=_.useCallback(function(){for(var r,i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];return(r=e.current)===null||r===void 0?void 0:r.call.apply(r,[e].concat(s))},[]);return n}function Mf(t){var e=_.useRef(!1),n=_.useState(t),r=de(n,2),i=r[0],s=r[1];_.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]);function l(c,f){f&&e.current||s(c)}return[i,l]}function jv(t){return t!==void 0}function xc(t,e){var n=e||{},r=n.defaultValue,i=n.value,s=n.onChange,l=n.postState,c=Mf(function(){return jv(i)?i:jv(r)?typeof r=="function"?r():r:typeof t=="function"?t():t}),f=de(c,2),d=f[0],g=f[1],m=i!==void 0?i:d,v=l?l(m):m,S=dr(s),E=Mf([m]),w=de(E,2),b=w[0],A=w[1];fT(function(){var C=b[0];d!==C&&S(d,C)},[b]),fT(function(){jv(i)||g(i)},[i]);var T=dr(function(C,M){g(C,M),A([m],M)});return[v,T]}function RT(t,e,n,r){var i=J({},e[t]);if(r!=null&&r.deprecatedTokens){var s=r.deprecatedTokens;s.forEach(function(c){var f=de(c,2),d=f[0],g=f[1];if(i!=null&&i[d]||i!=null&&i[g]){var m;(m=i[g])!==null&&m!==void 0||(i[g]=i==null?void 0:i[d])}})}var l=J(J({},n),i);return Object.keys(l).forEach(function(c){l[c]===e[c]&&delete l[c]}),l}var H3=typeof CSSINJS_STATISTIC<"u",y_=!0;function fi(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(!H3)return Object.assign.apply(Object,[{}].concat(e));y_=!1;var r={};return e.forEach(function(i){if(pt(i)==="object"){var s=Object.keys(i);s.forEach(function(l){Object.defineProperty(r,l,{configurable:!0,enumerable:!0,get:function(){return i[l]}})})}}),y_=!0,r}var xT={};function l8(){}var c8=function(e){var n,r=e,i=l8;return H3&&typeof Proxy<"u"&&(n=new Set,r=new Proxy(e,{get:function(l,c){if(y_){var f;(f=n)===null||f===void 0||f.add(c)}return l[c]}}),i=function(l,c){var f;xT[l]={global:Array.from(n),component:J(J({},(f=xT[l])===null||f===void 0?void 0:f.component),c)}}),{token:r,keys:n,flush:i}};function MT(t,e,n){if(typeof n=="function"){var r;return n(fi(e,(r=e[t])!==null&&r!==void 0?r:{}))}return n??{}}function u8(t){return t==="js"?{max:Math.max,min:Math.min}:{max:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return"max(".concat(r.map(function(s){return Rt(s)}).join(","),")")},min:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return"min(".concat(r.map(function(s){return Rt(s)}).join(","),")")}}}var f8=1e3*60*10,d8=function(){function t(){Or(this,t),K(this,"map",new Map),K(this,"objectIDMap",new WeakMap),K(this,"nextID",0),K(this,"lastAccessBeat",new Map),K(this,"accessBeat",0)}return Pr(t,[{key:"set",value:function(n,r){this.clear();var i=this.getCompositeKey(n);this.map.set(i,r),this.lastAccessBeat.set(i,Date.now())}},{key:"get",value:function(n){var r=this.getCompositeKey(n),i=this.map.get(r);return this.lastAccessBeat.set(r,Date.now()),this.accessBeat+=1,i}},{key:"getCompositeKey",value:function(n){var r=this,i=n.map(function(s){return s&&pt(s)==="object"?"obj_".concat(r.getObjectID(s)):"".concat(pt(s),"_").concat(s)});return i.join("|")}},{key:"getObjectID",value:function(n){if(this.objectIDMap.has(n))return this.objectIDMap.get(n);var r=this.nextID;return this.objectIDMap.set(n,r),this.nextID+=1,r}},{key:"clear",value:function(){var n=this;if(this.accessBeat>1e4){var r=Date.now();this.lastAccessBeat.forEach(function(i,s){r-i>f8&&(n.map.delete(s),n.lastAccessBeat.delete(s))}),this.accessBeat=0}}}]),t}(),OT=new d8;function h8(t,e){return Ft.useMemo(function(){var n=OT.get(e);if(n)return n;var r=t();return OT.set(e,r),r},e)}var g8=function(){return{}};function p8(t){var e=t.useCSP,n=e===void 0?g8:e,r=t.useToken,i=t.usePrefix,s=t.getResetStyles,l=t.getCommonStyle,c=t.getCompUnitless;function f(v,S,E,w){var b=Array.isArray(v)?v[0]:v;function A(L){return"".concat(String(b)).concat(L.slice(0,1).toUpperCase()).concat(L.slice(1))}var T=(w==null?void 0:w.unitless)||{},C=typeof c=="function"?c(v):{},M=J(J({},C),{},K({},A("zIndexPopup"),!0));Object.keys(T).forEach(function(L){M[A(L)]=T[L]});var x=J(J({},w),{},{unitless:M,prefixToken:A}),N=g(v,S,E,x),F=d(b,E,x);return function(L){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L,V=N(L,I),B=de(V,2),j=B[1],X=F(I),Y=de(X,2),ae=Y[0],U=Y[1];return[ae,j,U]}}function d(v,S,E){var w=E.unitless,b=E.injectStyle,A=b===void 0?!0:b,T=E.prefixToken,C=E.ignore,M=function(F){var L=F.rootCls,I=F.cssVar,V=I===void 0?{}:I,B=r(),j=B.realToken;return wF({path:[v],prefix:V.prefix,key:V.key,unitless:w,ignore:C,token:j,scope:L},function(){var X=MT(v,j,S),Y=RT(v,j,X,{deprecatedTokens:E==null?void 0:E.deprecatedTokens});return Object.keys(X).forEach(function(ae){Y[T(ae)]=Y[ae],delete Y[ae]}),Y}),null},x=function(F){var L=r(),I=L.cssVar;return[function(V){return A&&I?Ft.createElement(Ft.Fragment,null,Ft.createElement(M,{rootCls:F,cssVar:I,component:v}),V):V},I==null?void 0:I.key]};return x}function g(v,S,E){var w=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},b=Array.isArray(v)?v:[v,v],A=de(b,1),T=A[0],C=b.join("-"),M=t.layer||{name:"antd"};return function(x){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:x,F=r(),L=F.theme,I=F.realToken,V=F.hashId,B=F.token,j=F.cssVar,X=i(),Y=X.rootPrefixCls,ae=X.iconPrefixCls,U=n(),z=j?"css":"js",W=h8(function(){var q=new Set;return j&&Object.keys(w.unitless||{}).forEach(function(ce){q.add(Fh(ce,j.prefix)),q.add(Fh(ce,CT(T,j.prefix)))}),o8(z,q)},[z,T,j==null?void 0:j.prefix]),Z=u8(z),P=Z.max,$=Z.min,ie={theme:L,token:B,hashId:V,nonce:function(){return U.nonce},clientOnly:w.clientOnly,layer:M,order:w.order||-999};typeof s=="function"&&i_(J(J({},ie),{},{clientOnly:!1,path:["Shared",Y]}),function(){return s(B,{prefix:{rootPrefixCls:Y,iconPrefixCls:ae},csp:U})});var se=i_(J(J({},ie),{},{path:[C,x,ae]}),function(){if(w.injectStyle===!1)return[];var q=c8(B),ce=q.token,fe=q.flush,ye=MT(T,I,E),we=".".concat(x),Ae=RT(T,I,ye,{deprecatedTokens:w.deprecatedTokens});j&&ye&&pt(ye)==="object"&&Object.keys(ye).forEach(function(_e){ye[_e]="var(".concat(Fh(_e,CT(T,j.prefix)),")")});var Te=fi(ce,{componentCls:we,prefixCls:x,iconCls:".".concat(ae),antCls:".".concat(Y),calc:W,max:P,min:$},j?ye:Ae),ve=S(Te,{hashId:V,prefixCls:x,rootPrefixCls:Y,iconPrefixCls:ae});fe(T,Ae);var ge=typeof l=="function"?l(Te,x,N,w.resetFont):null;return[w.resetStyle===!1?null:ge,ve]});return[se,V]}}function m(v,S,E){var w=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},b=g(v,S,E,J({resetStyle:!1,order:-998},w)),A=function(C){var M=C.prefixCls,x=C.rootCls,N=x===void 0?M:x;return b(M,N),null};return A}return{genStyleHooks:f,genSubStyleComponent:m,genComponentStyleHook:g}}const sg=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"],m8="5.24.0";function Wv(t){return t>=0&&t<=255}function uh(t,e){const{r:n,g:r,b:i,a:s}=new wn(t).toRgb();if(s<1)return t;const{r:l,g:c,b:f}=new wn(e).toRgb();for(let d=.01;d<=1;d+=.01){const g=Math.round((n-l*(1-d))/d),m=Math.round((r-c*(1-d))/d),v=Math.round((i-f*(1-d))/d);if(Wv(g)&&Wv(m)&&Wv(v))return new wn({r:g,g:m,b:v,a:Math.round(d*100)/100}).toRgbString()}return new wn({r:n,g:r,b:i,a:1}).toRgbString()}var v8=function(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 j3(t){const{override:e}=t,n=v8(t,["override"]),r=Object.assign({},e);Object.keys(Cf).forEach(v=>{delete r[v]});const i=Object.assign(Object.assign({},n),r),s=480,l=576,c=768,f=992,d=1200,g=1600;if(i.motion===!1){const v="0s";i.motionDurationFast=v,i.motionDurationMid=v,i.motionDurationSlow=v}return Object.assign(Object.assign(Object.assign({},i),{colorFillContent:i.colorFillSecondary,colorFillContentHover:i.colorFill,colorFillAlter:i.colorFillQuaternary,colorBgContainerDisabled:i.colorFillTertiary,colorBorderBg:i.colorBgContainer,colorSplit:uh(i.colorBorderSecondary,i.colorBgContainer),colorTextPlaceholder:i.colorTextQuaternary,colorTextDisabled:i.colorTextQuaternary,colorTextHeading:i.colorText,colorTextLabel:i.colorTextSecondary,colorTextDescription:i.colorTextTertiary,colorTextLightSolid:i.colorWhite,colorHighlight:i.colorError,colorBgTextHover:i.colorFillSecondary,colorBgTextActive:i.colorFill,colorIcon:i.colorTextTertiary,colorIconHover:i.colorText,colorErrorOutline:uh(i.colorErrorBg,i.colorBgContainer),colorWarningOutline:uh(i.colorWarningBg,i.colorBgContainer),fontSizeIcon:i.fontSizeSM,lineWidthFocus:i.lineWidth*3,lineWidth:i.lineWidth,controlOutlineWidth:i.lineWidth*2,controlInteractiveSize:i.controlHeight/2,controlItemBgHover:i.colorFillTertiary,controlItemBgActive:i.colorPrimaryBg,controlItemBgActiveHover:i.colorPrimaryBgHover,controlItemBgActiveDisabled:i.colorFill,controlTmpOutline:i.colorFillQuaternary,controlOutline:uh(i.colorPrimaryBg,i.colorBgContainer),lineType:i.lineType,borderRadius:i.borderRadius,borderRadiusXS:i.borderRadiusXS,borderRadiusSM:i.borderRadiusSM,borderRadiusLG:i.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:i.sizeXXS,paddingXS:i.sizeXS,paddingSM:i.sizeSM,padding:i.size,paddingMD:i.sizeMD,paddingLG:i.sizeLG,paddingXL:i.sizeXL,paddingContentHorizontalLG:i.sizeLG,paddingContentVerticalLG:i.sizeMS,paddingContentHorizontal:i.sizeMS,paddingContentVertical:i.sizeSM,paddingContentHorizontalSM:i.size,paddingContentVerticalSM:i.sizeXS,marginXXS:i.sizeXXS,marginXS:i.sizeXS,marginSM:i.sizeSM,margin:i.size,marginMD:i.sizeMD,marginLG:i.sizeLG,marginXL:i.sizeXL,marginXXL:i.sizeXXL,boxShadow:`
0 6px 16px 0 rgba(0, 0, 0, 0.08),
0 3px 6px -4px rgba(0, 0, 0, 0.12),
0 9px 28px 8px rgba(0, 0, 0, 0.05)
`,boxShadowSecondary:`
0 6px 16px 0 rgba(0, 0, 0, 0.08),
0 3px 6px -4px rgba(0, 0, 0, 0.12),
0 9px 28px 8px rgba(0, 0, 0, 0.05)
`,boxShadowTertiary:`
0 1px 2px 0 rgba(0, 0, 0, 0.03),
0 1px 6px -1px rgba(0, 0, 0, 0.02),
0 2px 4px 0 rgba(0, 0, 0, 0.02)
`,screenXS:s,screenXSMin:s,screenXSMax:l-1,screenSM:l,screenSMMin:l,screenSMMax:c-1,screenMD:c,screenMDMin:c,screenMDMax:f-1,screenLG:f,screenLGMin:f,screenLGMax:d-1,screenXL:d,screenXLMin:d,screenXLMax:g-1,screenXXL:g,screenXXLMin:g,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:`
0 1px 2px -2px ${new wn("rgba(0, 0, 0, 0.16)").toRgbString()},
0 3px 6px 0 ${new wn("rgba(0, 0, 0, 0.12)").toRgbString()},
0 5px 12px 4px ${new wn("rgba(0, 0, 0, 0.09)").toRgbString()}
`,boxShadowDrawerRight:`
-6px 0 16px 0 rgba(0, 0, 0, 0.08),
-3px 0 6px -4px rgba(0, 0, 0, 0.12),
-9px 0 28px 8px rgba(0, 0, 0, 0.05)
`,boxShadowDrawerLeft:`
6px 0 16px 0 rgba(0, 0, 0, 0.08),
3px 0 6px -4px rgba(0, 0, 0, 0.12),
9px 0 28px 8px rgba(0, 0, 0, 0.05)
`,boxShadowDrawerUp:`
0 6px 16px 0 rgba(0, 0, 0, 0.08),
0 3px 6px -4px rgba(0, 0, 0, 0.12),
0 9px 28px 8px rgba(0, 0, 0, 0.05)
`,boxShadowDrawerDown:`
0 -6px 16px 0 rgba(0, 0, 0, 0.08),
0 -3px 6px -4px rgba(0, 0, 0, 0.12),
0 -9px 28px 8px rgba(0, 0, 0, 0.05)
`,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var PT=function(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};const W3={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},_8={size:!0,sizeSM:!0,sizeLG:!0,sizeMD:!0,sizeXS:!0,sizeXXS:!0,sizeMS:!0,sizeXL:!0,sizeXXL:!0,sizeUnit:!0,sizeStep:!0,motionBase:!0,motionUnit:!0},y8={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},X3=(t,e,n)=>{const r=n.getDerivativeToken(t),{override:i}=e,s=PT(e,["override"]);let l=Object.assign(Object.assign({},r),{override:i});return l=j3(l),s&&Object.entries(s).forEach(c=>{let[f,d]=c;const{theme:g}=d,m=PT(d,["theme"]);let v=m;g&&(v=X3(Object.assign(Object.assign({},l),m),{override:m},g)),l[f]=v}),l};function Xs(){const{token:t,hashed:e,theme:n,override:r,cssVar:i}=Ft.useContext(z3),s=`${m8}-${e||""}`,l=n||L3,[c,f,d]=Y5(l,[Cf,t],{salt:s,override:r,getComputedToken:X3,formatToken:j3,cssVar:i&&{prefix:i.prefix,key:i.key,unitless:W3,ignore:_8,preserve:y8}});return[l,d,e?f:"",c,i]}const b_={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},Hc=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return{boxSizing:"border-box",margin:0,padding:0,color:t.colorText,fontSize:t.fontSize,lineHeight:t.lineHeight,listStyle:"none",fontFamily:e?"inherit":t.fontFamily}},fb=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),b8=t=>({a:{color:t.colorLink,textDecoration:t.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${t.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:t.colorLinkHover},"&:active":{color:t.colorLinkActive},"&:active, &:hover":{textDecoration:t.linkHoverDecoration,outline:0},"&:focus":{textDecoration:t.linkFocusDecoration,outline:0},"&[disabled]":{color:t.colorTextDisabled,cursor:"not-allowed"}}}),S8=(t,e,n,r)=>{const i=`[class^="${e}"], [class*=" ${e}"]`,s=n?`.${n}`:i,l={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let c={};return r!==!1&&(c={fontFamily:t.fontFamily,fontSize:t.fontSize}),{[s]:Object.assign(Object.assign(Object.assign({},c),l),{[i]:l})}},q3=t=>({[`.${t}`]:Object.assign(Object.assign({},fb()),{[`.${t} .${t}-icon`]:{display:"block"}})}),{genStyleHooks:jc}=p8({usePrefix:()=>{const{getPrefixCls:t,iconPrefixCls:e}=_.useContext(ui);return{rootPrefixCls:t(),iconPrefixCls:e}},useToken:()=>{const[t,e,n,r,i]=Xs();return{theme:t,realToken:e,hashId:n,token:r,cssVar:i}},useCSP:()=>{const{csp:t}=_.useContext(ui);return t??{}},getResetStyles:(t,e)=>{var n;return[{"&":b8(t)},q3((n=e==null?void 0:e.prefix.iconPrefixCls)!==null&&n!==void 0?n:ub)]},getCommonStyle:S8,getCompUnitless:()=>W3});function w8(t,e){return sg.reduce((n,r)=>{const i=t[`${r}1`],s=t[`${r}3`],l=t[`${r}6`],c=t[`${r}7`];return Object.assign(Object.assign({},n),e(r,{lightColor:i,lightBorderColor:s,darkColor:l,textColor:c}))},{})}const E8=(t,e)=>{const[n,r]=Xs();return i_({token:r,hashId:"",path:["ant-design-icons",t],nonce:()=>e==null?void 0:e.nonce,layer:{name:"antd"}},()=>[q3(t)])},T8=Object.assign({},rp),{useId:NT}=T8,A8=()=>"",C8=typeof NT>"u"?A8:NT;function R8(t,e,n){var r;D3();const i=t||{},s=i.inherit===!1||!e?Object.assign(Object.assign({},v_),{hashed:(r=e==null?void 0:e.hashed)!==null&&r!==void 0?r:v_.hashed,cssVar:e==null?void 0:e.cssVar}):e,l=C8();return ap(()=>{var c,f;if(!t)return e;const d=Object.assign({},s.components);Object.keys(t.components||{}).forEach(v=>{d[v]=Object.assign(Object.assign({},d[v]),t.components[v])});const g=`css-var-${l.replace(/:/g,"")}`,m=((c=i.cssVar)!==null&&c!==void 0?c:s.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:n==null?void 0:n.prefixCls},typeof s.cssVar=="object"?s.cssVar:{}),typeof i.cssVar=="object"?i.cssVar:{}),{key:typeof i.cssVar=="object"&&((f=i.cssVar)===null||f===void 0?void 0:f.key)||g});return Object.assign(Object.assign(Object.assign({},s),i),{token:Object.assign(Object.assign({},s.token),i.token),components:d,cssVar:m})},[i,s],(c,f)=>c.some((d,g)=>{const m=f[g];return!ng(d,m,!0)}))}var x8=["children"],Y3=_.createContext({});function M8(t){var e=t.children,n=Fn(t,x8);return _.createElement(Y3.Provider,{value:n},e)}var O8=function(t){Zo(n,t);var e=Qo(n);function n(){return Or(this,n),e.apply(this,arguments)}return Pr(n,[{key:"render",value:function(){return this.props.children}}]),n}(_.Component);function P8(t){var e=_.useReducer(function(c){return c+1},0),n=de(e,2),r=n[1],i=_.useRef(t),s=dr(function(){return i.current}),l=dr(function(c){i.current=typeof c=="function"?c(i.current):c,r()});return[s,l]}var wa="none",fh="appear",dh="enter",hh="leave",IT="none",Yi="prepare",Yl="start",Kl="active",db="end",K3="prepared";function DT(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit".concat(t)]="webkit".concat(e),n["Moz".concat(t)]="moz".concat(e),n["ms".concat(t)]="MS".concat(e),n["O".concat(t)]="o".concat(e.toLowerCase()),n}function N8(t,e){var n={animationend:DT("Animation","AnimationEnd"),transitionend:DT("Transition","TransitionEnd")};return t&&("AnimationEvent"in e||delete n.animationend.animation,"TransitionEvent"in e||delete n.transitionend.transition),n}var I8=N8(Qr(),typeof window<"u"?window:{}),Z3={};if(Qr()){var D8=document.createElement("div");Z3=D8.style}var gh={};function Q3(t){if(gh[t])return gh[t];var e=I8[t];if(e)for(var n=Object.keys(e),r=n.length,i=0;i<r;i+=1){var s=n[i];if(Object.prototype.hasOwnProperty.call(e,s)&&s in Z3)return gh[t]=e[s],gh[t]}return""}var G3=Q3("animationend"),J3=Q3("transitionend"),ex=!!(G3&&J3),FT=G3||"animationend",kT=J3||"transitionend";function BT(t,e){if(!t)return null;if(pt(t)==="object"){var n=e.replace(/-\w/g,function(r){return r[1].toUpperCase()});return t[n]}return"".concat(t,"-").concat(e)}const F8=function(t){var e=_.useRef();function n(i){i&&(i.removeEventListener(kT,t),i.removeEventListener(FT,t))}function r(i){e.current&&e.current!==i&&n(e.current),i&&i!==e.current&&(i.addEventListener(kT,t),i.addEventListener(FT,t),e.current=i)}return _.useEffect(function(){return function(){n(e.current)}},[]),[r,n]};var tx=Qr()?_.useLayoutEffect:_.useEffect;const k8=function(){var t=_.useRef(null);function e(){hr.cancel(t.current)}function n(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;e();var s=hr(function(){i<=1?r({isCanceled:function(){return s!==t.current}}):n(r,i-1)});t.current=s}return _.useEffect(function(){return function(){e()}},[]),[n,e]};var B8=[Yi,Yl,Kl,db],U8=[Yi,K3],nx=!1,L8=!0;function rx(t){return t===Kl||t===db}const z8=function(t,e,n){var r=Mf(IT),i=de(r,2),s=i[0],l=i[1],c=k8(),f=de(c,2),d=f[0],g=f[1];function m(){l(Yi,!0)}var v=e?U8:B8;return tx(function(){if(s!==IT&&s!==db){var S=v.indexOf(s),E=v[S+1],w=n(s);w===nx?l(E,!0):E&&d(function(b){function A(){b.isCanceled()||l(E,!0)}w===!0?A():Promise.resolve(w).then(A)})}},[t,s]),_.useEffect(function(){return function(){g()}},[]),[m,s]};function $8(t,e,n,r){var i=r.motionEnter,s=i===void 0?!0:i,l=r.motionAppear,c=l===void 0?!0:l,f=r.motionLeave,d=f===void 0?!0:f,g=r.motionDeadline,m=r.motionLeaveImmediately,v=r.onAppearPrepare,S=r.onEnterPrepare,E=r.onLeavePrepare,w=r.onAppearStart,b=r.onEnterStart,A=r.onLeaveStart,T=r.onAppearActive,C=r.onEnterActive,M=r.onLeaveActive,x=r.onAppearEnd,N=r.onEnterEnd,F=r.onLeaveEnd,L=r.onVisibleChanged,I=Mf(),V=de(I,2),B=V[0],j=V[1],X=P8(wa),Y=de(X,2),ae=Y[0],U=Y[1],z=Mf(null),W=de(z,2),Z=W[0],P=W[1],$=ae(),ie=_.useRef(!1),se=_.useRef(null);function q(){return n()}var ce=_.useRef(!1);function fe(){U(wa),P(null,!0)}var ye=dr(function(He){var Ge=ae();if(Ge!==wa){var Pe=q();if(!(He&&!He.deadline&&He.target!==Pe)){var Me=ce.current,dt;Ge===fh&&Me?dt=x==null?void 0:x(Pe,He):Ge===dh&&Me?dt=N==null?void 0:N(Pe,He):Ge===hh&&Me&&(dt=F==null?void 0:F(Pe,He)),Me&&dt!==!1&&fe()}}}),we=F8(ye),Ae=de(we,1),Te=Ae[0],ve=function(Ge){switch(Ge){case fh:return K(K(K({},Yi,v),Yl,w),Kl,T);case dh:return K(K(K({},Yi,S),Yl,b),Kl,C);case hh:return K(K(K({},Yi,E),Yl,A),Kl,M);default:return{}}},ge=_.useMemo(function(){return ve($)},[$]),_e=z8($,!t,function(He){if(He===Yi){var Ge=ge[Yi];return Ge?Ge(q()):nx}if(xe in ge){var Pe;P(((Pe=ge[xe])===null||Pe===void 0?void 0:Pe.call(ge,q(),null))||null)}return xe===Kl&&$!==wa&&(Te(q()),g>0&&(clearTimeout(se.current),se.current=setTimeout(function(){ye({deadline:!0})},g))),xe===K3&&fe(),L8}),Ie=de(_e,2),Ee=Ie[0],xe=Ie[1],Ve=rx(xe);ce.current=Ve;var Fe=_.useRef(null);tx(function(){if(!(ie.current&&Fe.current===e)){j(e);var He=ie.current;ie.current=!0;var Ge;!He&&e&&c&&(Ge=fh),He&&e&&s&&(Ge=dh),(He&&!e&&d||!He&&m&&!e&&d)&&(Ge=hh);var Pe=ve(Ge);Ge&&(t||Pe[Yi])?(U(Ge),Ee()):U(wa),Fe.current=e}},[e]),_.useEffect(function(){($===fh&&!c||$===dh&&!s||$===hh&&!d)&&U(wa)},[c,s,d]),_.useEffect(function(){return function(){ie.current=!1,clearTimeout(se.current)}},[]);var Be=_.useRef(!1);_.useEffect(function(){B&&(Be.current=!0),B!==void 0&&$===wa&&((Be.current||B)&&(L==null||L(B)),Be.current=!0)},[B,$]);var nt=Z;return ge[Yi]&&xe===Yl&&(nt=J({transition:"none"},nt)),[$,xe,nt,B??e]}function V8(t){var e=t;pt(t)==="object"&&(e=t.transitionSupport);function n(i,s){return!!(i.motionName&&e&&s!==!1)}var r=_.forwardRef(function(i,s){var l=i.visible,c=l===void 0?!0:l,f=i.removeOnLeave,d=f===void 0?!0:f,g=i.forceRender,m=i.children,v=i.motionName,S=i.leavedClassName,E=i.eventProps,w=_.useContext(Y3),b=w.motion,A=n(i,b),T=_.useRef(),C=_.useRef();function M(){try{return T.current instanceof HTMLElement?T.current:rf(C.current)}catch{return null}}var x=$8(A,c,M,i),N=de(x,4),F=N[0],L=N[1],I=N[2],V=N[3],B=_.useRef(V);V&&(B.current=!0);var j=_.useCallback(function(W){T.current=W,Qy(s,W)},[s]),X,Y=J(J({},E),{},{visible:c});if(!m)X=null;else if(F===wa)V?X=m(J({},Y),j):!d&&B.current&&S?X=m(J(J({},Y),{},{className:S}),j):g||!d&&!S?X=m(J(J({},Y),{},{style:{display:"none"}}),j):X=null;else{var ae;L===Yi?ae="prepare":rx(L)?ae="active":L===Yl&&(ae="start");var U=BT(v,"".concat(F,"-").concat(ae));X=m(J(J({},Y),{},{className:Ze(BT(v,F),K(K({},U,U&&ae),v,typeof v=="string")),style:I}),j)}if(_.isValidElement(X)&&cp(X)){var z=Gy(X);z||(X=_.cloneElement(X,{ref:j}))}return _.createElement(O8,{ref:C},X)});return r.displayName="CSSMotion",r}const hb=V8(ex);var S_="add",w_="keep",E_="remove",Xv="removed";function H8(t){var e;return t&&pt(t)==="object"&&"key"in t?e=t:e={key:t},J(J({},e),{},{key:String(e.key)})}function T_(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return t.map(H8)}function j8(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,i=e.length,s=T_(t),l=T_(e);s.forEach(function(d){for(var g=!1,m=r;m<i;m+=1){var v=l[m];if(v.key===d.key){r<m&&(n=n.concat(l.slice(r,m).map(function(S){return J(J({},S),{},{status:S_})})),r=m),n.push(J(J({},v),{},{status:w_})),r+=1,g=!0;break}}g||n.push(J(J({},d),{},{status:E_}))}),r<i&&(n=n.concat(l.slice(r).map(function(d){return J(J({},d),{},{status:S_})})));var c={};n.forEach(function(d){var g=d.key;c[g]=(c[g]||0)+1});var f=Object.keys(c).filter(function(d){return c[d]>1});return f.forEach(function(d){n=n.filter(function(g){var m=g.key,v=g.status;return m!==d||v!==E_}),n.forEach(function(g){g.key===d&&(g.status=w_)})}),n}var W8=["component","children","onVisibleChanged","onAllRemoved"],X8=["status"],q8=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function Y8(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hb,n=function(r){Zo(s,r);var i=Qo(s);function s(){var l;Or(this,s);for(var c=arguments.length,f=new Array(c),d=0;d<c;d++)f[d]=arguments[d];return l=i.call.apply(i,[this].concat(f)),K(Nt(l),"state",{keyEntities:[]}),K(Nt(l),"removeKey",function(g){l.setState(function(m){var v=m.keyEntities.map(function(S){return S.key!==g?S:J(J({},S),{},{status:Xv})});return{keyEntities:v}},function(){var m=l.state.keyEntities,v=m.filter(function(S){var E=S.status;return E!==Xv}).length;v===0&&l.props.onAllRemoved&&l.props.onAllRemoved()})}),l}return Pr(s,[{key:"render",value:function(){var c=this,f=this.state.keyEntities,d=this.props,g=d.component,m=d.children,v=d.onVisibleChanged;d.onAllRemoved;var S=Fn(d,W8),E=g||_.Fragment,w={};return q8.forEach(function(b){w[b]=S[b],delete S[b]}),delete S.keys,_.createElement(E,S,f.map(function(b,A){var T=b.status,C=Fn(b,X8),M=T===S_||T===w_;return _.createElement(e,kt({},w,{key:C.key,visible:M,eventProps:C,onVisibleChanged:function(N){v==null||v(N,{key:C.key}),N||c.removeKey(C.key)}}),function(x,N){return m(J(J({},x),{},{index:A}),N)})}))}}],[{key:"getDerivedStateFromProps",value:function(c,f){var d=c.keys,g=f.keyEntities,m=T_(d),v=j8(g,m);return{keyEntities:v.filter(function(S){var E=g.find(function(w){var b=w.key;return S.key===b});return!(E&&E.status===Xv&&S.status===E_)})}}}]),s}(_.Component);return K(n,"defaultProps",{component:"div"}),n}Y8(ex);function K8(t){const{children:e}=t,[,n]=Xs(),{motion:r}=n,i=_.useRef(!1);return i.current=i.current||r===!1,i.current?_.createElement(M8,{motion:r},e):e}const Z8=()=>null;var Q8=function(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};const G8=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];let ix;function J8(){return ix||__}function ek(t){return Object.keys(t).some(e=>e.endsWith("Color"))}const tk=t=>{const{prefixCls:e,iconPrefixCls:n,theme:r,holderRender:i}=t;e!==void 0&&(ix=e),r&&ek(r)&&e8(J8(),r)},nk=t=>{const{children:e,csp:n,autoInsertSpaceInButton:r,alert:i,anchor:s,form:l,locale:c,componentSize:f,direction:d,space:g,splitter:m,virtual:v,dropdownMatchSelectWidth:S,popupMatchSelectWidth:E,popupOverflow:w,legacyLocale:b,parentContext:A,iconPrefixCls:T,theme:C,componentDisabled:M,segmented:x,statistic:N,spin:F,calendar:L,carousel:I,cascader:V,collapse:B,typography:j,checkbox:X,descriptions:Y,divider:ae,drawer:U,skeleton:z,steps:W,image:Z,layout:P,list:$,mentions:ie,modal:se,progress:q,result:ce,slider:fe,breadcrumb:ye,menu:we,pagination:Ae,input:Te,textArea:ve,empty:ge,badge:_e,radio:Ie,rate:Ee,switch:xe,transfer:Ve,avatar:Fe,message:Be,tag:nt,table:He,card:Ge,tabs:Pe,timeline:Me,timePicker:dt,upload:rt,notification:it,tree:st,colorPicker:at,datePicker:Je,rangePicker:lt,flex:ft,wave:ct,dropdown:mt,warning:xt,tour:Bt,tooltip:ht,popover:Vt,popconfirm:qt,floatButtonGroup:En,variant:Mn,inputNumber:Ut,treeSelect:It}=t,Lt=_.useCallback((We,Qe)=>{const{prefixCls:bt}=t;if(Qe)return Qe;const _t=bt||A.getPrefixCls("");return We?`${_t}-${We}`:_t},[A.getPrefixCls,t.prefixCls]),Jt=T||A.iconPrefixCls||ub,Mt=n||A.csp;E8(Jt,Mt);const qe=R8(C,A.theme,{prefixCls:Lt("")}),ke={csp:Mt,autoInsertSpaceInButton:r,alert:i,anchor:s,locale:c||b,direction:d,space:g,splitter:m,virtual:v,popupMatchSelectWidth:E??S,popupOverflow:w,getPrefixCls:Lt,iconPrefixCls:Jt,theme:qe,segmented:x,statistic:N,spin:F,calendar:L,carousel:I,cascader:V,collapse:B,typography:j,checkbox:X,descriptions:Y,divider:ae,drawer:U,skeleton:z,steps:W,image:Z,input:Te,textArea:ve,layout:P,list:$,mentions:ie,modal:se,progress:q,result:ce,slider:fe,breadcrumb:ye,menu:we,pagination:Ae,empty:ge,badge:_e,radio:Ie,rate:Ee,switch:xe,transfer:Ve,avatar:Fe,message:Be,tag:nt,table:He,card:Ge,tabs:Pe,timeline:Me,timePicker:dt,upload:rt,notification:it,tree:st,colorPicker:at,datePicker:Je,rangePicker:lt,flex:ft,wave:ct,dropdown:mt,warning:xt,tour:Bt,tooltip:ht,popover:Vt,popconfirm:qt,floatButtonGroup:En,variant:Mn,inputNumber:Ut,treeSelect:It},Ne=Object.assign({},A);Object.keys(ke).forEach(We=>{ke[We]!==void 0&&(Ne[We]=ke[We])}),G8.forEach(We=>{const Qe=t[We];Qe&&(Ne[We]=Qe)}),typeof r<"u"&&(Ne.button=Object.assign({autoInsertSpace:r},Ne.button));const wt=ap(()=>Ne,Ne,(We,Qe)=>{const bt=Object.keys(We),_t=Object.keys(Qe);return bt.length!==_t.length||bt.some(Zt=>We[Zt]!==Qe[Zt])}),{layer:en}=_.useContext(qf),Ue=_.useMemo(()=>({prefixCls:Jt,csp:Mt,layer:en?"antd":void 0}),[Jt,Mt,en]);let Oe=_.createElement(_.Fragment,null,_.createElement(Z8,{dropdownMatchSelectWidth:S}),e);const je=_.useMemo(()=>{var We,Qe,bt,_t;return ql(((We=Cc.Form)===null||We===void 0?void 0:We.defaultValidateMessages)||{},((bt=(Qe=wt.locale)===null||Qe===void 0?void 0:Qe.Form)===null||bt===void 0?void 0:bt.defaultValidateMessages)||{},((_t=wt.form)===null||_t===void 0?void 0:_t.validateMessages)||{},(l==null?void 0:l.validateMessages)||{})},[wt,l==null?void 0:l.validateMessages]);Object.keys(je).length>0&&(Oe=_.createElement(xF.Provider,{value:je},Oe)),c&&(Oe=_.createElement(DF,{locale:c,_ANT_MARK__:IF},Oe)),Oe=_.createElement(ob.Provider,{value:Ue},Oe),f&&(Oe=_.createElement(n8,{size:f},Oe)),Oe=_.createElement(K8,null,Oe);const Ye=_.useMemo(()=>{const We=qe||{},{algorithm:Qe,token:bt,components:_t,cssVar:Zt}=We,Yt=Q8(We,["algorithm","token","components","cssVar"]),vn=Qe&&(!Array.isArray(Qe)||Qe.length>0)?e_(Qe):L3,On={};Object.entries(_t||{}).forEach(Zn=>{let[un,rn]=Zn;const Ce=Object.assign({},rn);"algorithm"in Ce&&(Ce.algorithm===!0?Ce.theme=vn:(Array.isArray(Ce.algorithm)||typeof Ce.algorithm=="function")&&(Ce.theme=e_(Ce.algorithm)),delete Ce.algorithm),On[un]=Ce});const _n=Object.assign(Object.assign({},Cf),bt);return Object.assign(Object.assign({},Yt),{theme:vn,token:_n,components:On,override:Object.assign({override:_n},On),cssVar:Zt})},[qe]);return C&&(Oe=_.createElement(z3.Provider,{value:Ye},Oe)),wt.warning&&(Oe=_.createElement(RF.Provider,{value:wt.warning},Oe)),M!==void 0&&(Oe=_.createElement(t8,{disabled:M},Oe)),_.createElement(ui.Provider,{value:wt},Oe)},Wc=t=>{const e=_.useContext(ui),n=_.useContext(lb);return _.createElement(nk,Object.assign({parentContext:e,legacyLocale:n},t))};Wc.ConfigContext=ui;Wc.SizeContext=Rc;Wc.config=tk;Wc.useConfig=r8;Object.defineProperty(Wc,"SizeContext",{get:()=>Rc});function sx(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}function rk(t){return sx(t)instanceof ShadowRoot}function ag(t){return rk(t)?sx(t):null}function ik(t){return t.replace(/-(.)/g,function(e,n){return n.toUpperCase()})}function sk(t,e){Ur(t,"[@ant-design/icons] ".concat(e))}function UT(t){return pt(t)==="object"&&typeof t.name=="string"&&typeof t.theme=="string"&&(pt(t.icon)==="object"||typeof t.icon=="function")}function LT(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(t).reduce(function(e,n){var r=t[n];switch(n){case"class":e.className=r,delete e.class;break;default:delete e[n],e[ik(n)]=r}return e},{})}function A_(t,e,n){return n?Ft.createElement(t.tag,J(J({key:e},LT(t.attrs)),n),(t.children||[]).map(function(r,i){return A_(r,"".concat(e,"-").concat(t.tag,"-").concat(i))})):Ft.createElement(t.tag,J({key:e},LT(t.attrs)),(t.children||[]).map(function(r,i){return A_(r,"".concat(e,"-").concat(t.tag,"-").concat(i))}))}function ax(t){return Rf(t)[0]}function ox(t){return t?Array.isArray(t)?t:[t]:[]}var ak=`
.anticon {
display: inline-flex;
align-items: center;
color: inherit;
font-style: normal;
line-height: 0;
text-align: center;
text-transform: none;
vertical-align: -0.125em;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.anticon > * {
line-height: 1;
}
.anticon svg {
display: inline-block;
}
.anticon::before {
display: none;
}
.anticon .anticon-icon {
display: block;
}
.anticon[tabindex] {
cursor: pointer;
}
.anticon-spin::before,
.anticon-spin {
display: inline-block;
-webkit-animation: loadingCircle 1s infinite linear;
animation: loadingCircle 1s infinite linear;
}
@-webkit-keyframes loadingCircle {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes loadingCircle {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
`,ok=function(e){var n=_.useContext(ob),r=n.csp,i=n.prefixCls,s=n.layer,l=ak;i&&(l=l.replace(/anticon/g,i)),s&&(l="@layer ".concat(s,` {
`).concat(l,`
}`)),_.useEffect(function(){var c=e.current,f=ag(c);js(l,"@ant-design-icons",{prepend:!s,csp:r,attachTo:f})},[])},lk=["icon","className","onClick","style","primaryColor","secondaryColor"],af={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function ck(t){var e=t.primaryColor,n=t.secondaryColor;af.primaryColor=e,af.secondaryColor=n||ax(e),af.calculated=!!n}function uk(){return J({},af)}var Xc=function(e){var n=e.icon,r=e.className,i=e.onClick,s=e.style,l=e.primaryColor,c=e.secondaryColor,f=Fn(e,lk),d=_.useRef(),g=af;if(l&&(g={primaryColor:l,secondaryColor:c||ax(l)}),ok(d),sk(UT(n),"icon should be icon definiton, but got ".concat(n)),!UT(n))return null;var m=n;return m&&typeof m.icon=="function"&&(m=J(J({},m),{},{icon:m.icon(g.primaryColor,g.secondaryColor)})),A_(m.icon,"svg-".concat(m.name),J(J({className:r,onClick:i,style:s,"data-icon":m.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},f),{},{ref:d}))};Xc.displayName="IconReact";Xc.getTwoToneColors=uk;Xc.setTwoToneColors=ck;function lx(t){var e=ox(t),n=de(e,2),r=n[0],i=n[1];return Xc.setTwoToneColors({primaryColor:r,secondaryColor:i})}function fk(){var t=Xc.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor}var dk=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];lx(ig.primary);var qs=_.forwardRef(function(t,e){var n=t.className,r=t.icon,i=t.spin,s=t.rotate,l=t.tabIndex,c=t.onClick,f=t.twoToneColor,d=Fn(t,dk),g=_.useContext(ob),m=g.prefixCls,v=m===void 0?"anticon":m,S=g.rootClassName,E=Ze(S,v,K(K({},"".concat(v,"-").concat(r.name),!!r.name),"".concat(v,"-spin"),!!i||r.name==="loading"),n),w=l;w===void 0&&c&&(w=-1);var b=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,A=ox(f),T=de(A,2),C=T[0],M=T[1];return _.createElement("span",kt({role:"img","aria-label":r.name},d,{ref:e,tabIndex:w,onClick:c,className:E}),_.createElement(Xc,{icon:r,primaryColor:C,secondaryColor:M,style:b}))});qs.displayName="AntdIcon";qs.getTwoToneColor=fk;qs.setTwoToneColor=lx;var hk={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},gk=function(e,n){return _.createElement(qs,kt({},e,{ref:n,icon:hk}))},pk=_.forwardRef(gk),mk={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},vk=function(e,n){return _.createElement(qs,kt({},e,{ref:n,icon:mk}))},_k=_.forwardRef(vk),yk=`accept acceptCharset accessKey action allowFullScreen allowTransparency
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
charSet checked classID className colSpan cols content contentEditable contextMenu
controls coords crossOrigin data dateTime default defer dir disabled download draggable
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
mediaGroup method min minLength multiple muted name noValidate nonce open
optimum pattern placeholder poster preload radioGroup readOnly rel required
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
summary tabIndex target title type useMap value width wmode wrap`,bk=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Sk="".concat(yk," ").concat(bk).split(/[\s\n]+/),wk="aria-",Ek="data-";function zT(t,e){return t.indexOf(e)===0}function og(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;e===!1?n={aria:!0,data:!0,attr:!0}:e===!0?n={aria:!0}:n=J({},e);var r={};return Object.keys(t).forEach(function(i){(n.aria&&(i==="role"||zT(i,wk))||n.data&&zT(i,Ek)||n.attr&&Sk.includes(i))&&(r[i]=t[i])}),r}function Tk(t){return t&&Ft.isValidElement(t)&&t.type===Ft.Fragment}const Ak=(t,e,n)=>Ft.isValidElement(t)?Ft.cloneElement(t,typeof n=="function"?n(t.props||{}):n):e;function cx(t,e){return Ak(t,t,e)}const Ck=t=>{const[,,,,e]=Xs();return e?`${t}-css-var`:""};var et={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,CAPS_LOCK:20,ESC:27,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,N:78,P:80,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,EQUALS:187,WIN_KEY:224},Rk={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},xk=function(e,n){return _.createElement(qs,kt({},e,{ref:n,icon:Rk}))},Mk=_.forwardRef(xk);const ux=Ft.createContext(void 0),fo=100,fx={Modal:fo,Drawer:fo,Popover:fo,Popconfirm:fo,Tooltip:fo,Tour:fo,FloatButton:fo},Ok={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function Pk(t){return t in fx}const dx=(t,e)=>{const[,n]=Xs(),r=Ft.useContext(ux),i=Pk(t);let s;if(e!==void 0)s=[e,e];else{let l=r??0;i?l+=(r?0:n.zIndexPopupBase)+fx[t]:l+=Ok[t],s=[r===void 0?e:l,l]}return s};function ns(){ns=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(U,z,W){U[z]=W.value},s=typeof Symbol=="function"?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",f=s.toStringTag||"@@toStringTag";function d(U,z,W){return Object.defineProperty(U,z,{value:W,enumerable:!0,configurable:!0,writable:!0}),U[z]}try{d({},"")}catch{d=function(W,Z,P){return W[Z]=P}}function g(U,z,W,Z){var P=z&&z.prototype instanceof A?z:A,$=Object.create(P.prototype),ie=new Y(Z||[]);return i($,"_invoke",{value:V(U,W,ie)}),$}function m(U,z,W){try{return{type:"normal",arg:U.call(z,W)}}catch(Z){return{type:"throw",arg:Z}}}e.wrap=g;var v="suspendedStart",S="suspendedYield",E="executing",w="completed",b={};function A(){}function T(){}function C(){}var M={};d(M,l,function(){return this});var x=Object.getPrototypeOf,N=x&&x(x(ae([])));N&&N!==n&&r.call(N,l)&&(M=N);var F=C.prototype=A.prototype=Object.create(M);function L(U){["next","throw","return"].forEach(function(z){d(U,z,function(W){return this._invoke(z,W)})})}function I(U,z){function W(P,$,ie,se){var q=m(U[P],U,$);if(q.type!=="throw"){var ce=q.arg,fe=ce.value;return fe&&pt(fe)=="object"&&r.call(fe,"__await")?z.resolve(fe.__await).then(function(ye){W("next",ye,ie,se)},function(ye){W("throw",ye,ie,se)}):z.resolve(fe).then(function(ye){ce.value=ye,ie(ce)},function(ye){return W("throw",ye,ie,se)})}se(q.arg)}var Z;i(this,"_invoke",{value:function($,ie){function se(){return new z(function(q,ce){W($,ie,q,ce)})}return Z=Z?Z.then(se,se):se()}})}function V(U,z,W){var Z=v;return function(P,$){if(Z===E)throw Error("Generator is already running");if(Z===w){if(P==="throw")throw $;return{value:t,done:!0}}for(W.method=P,W.arg=$;;){var ie=W.delegate;if(ie){var se=B(ie,W);if(se){if(se===b)continue;return se}}if(W.method==="next")W.sent=W._sent=W.arg;else if(W.method==="throw"){if(Z===v)throw Z=w,W.arg;W.dispatchException(W.arg)}else W.method==="return"&&W.abrupt("return",W.arg);Z=E;var q=m(U,z,W);if(q.type==="normal"){if(Z=W.done?w:S,q.arg===b)continue;return{value:q.arg,done:W.done}}q.type==="throw"&&(Z=w,W.method="throw",W.arg=q.arg)}}}function B(U,z){var W=z.method,Z=U.iterator[W];if(Z===t)return z.delegate=null,W==="throw"&&U.iterator.return&&(z.method="return",z.arg=t,B(U,z),z.method==="throw")||W!=="return"&&(z.method="throw",z.arg=new TypeError("The iterator does not provide a '"+W+"' method")),b;var P=m(Z,U.iterator,z.arg);if(P.type==="throw")return z.method="throw",z.arg=P.arg,z.delegate=null,b;var $=P.arg;return $?$.done?(z[U.resultName]=$.value,z.next=U.nextLoc,z.method!=="return"&&(z.method="next",z.arg=t),z.delegate=null,b):$:(z.method="throw",z.arg=new TypeError("iterator result is not an object"),z.delegate=null,b)}function j(U){var z={tryLoc:U[0]};1 in U&&(z.catchLoc=U[1]),2 in U&&(z.finallyLoc=U[2],z.afterLoc=U[3]),this.tryEntries.push(z)}function X(U){var z=U.completion||{};z.type="normal",delete z.arg,U.completion=z}function Y(U){this.tryEntries=[{tryLoc:"root"}],U.forEach(j,this),this.reset(!0)}function ae(U){if(U||U===""){var z=U[l];if(z)return z.call(U);if(typeof U.next=="function")return U;if(!isNaN(U.length)){var W=-1,Z=function P(){for(;++W<U.length;)if(r.call(U,W))return P.value=U[W],P.done=!1,P;return P.value=t,P.done=!0,P};return Z.next=Z}}throw new TypeError(pt(U)+" is not iterable")}return T.prototype=C,i(F,"constructor",{value:C,configurable:!0}),i(C,"constructor",{value:T,configurable:!0}),T.displayName=d(C,f,"GeneratorFunction"),e.isGeneratorFunction=function(U){var z=typeof U=="function"&&U.constructor;return!!z&&(z===T||(z.displayName||z.name)==="GeneratorFunction")},e.mark=function(U){return Object.setPrototypeOf?Object.setPrototypeOf(U,C):(U.__proto__=C,d(U,f,"GeneratorFunction")),U.prototype=Object.create(F),U},e.awrap=function(U){return{__await:U}},L(I.prototype),d(I.prototype,c,function(){return this}),e.AsyncIterator=I,e.async=function(U,z,W,Z,P){P===void 0&&(P=Promise);var $=new I(g(U,z,W,Z),P);return e.isGeneratorFunction(z)?$:$.next().then(function(ie){return ie.done?ie.value:$.next()})},L(F),d(F,f,"Generator"),d(F,l,function(){return this}),d(F,"toString",function(){return"[object Generator]"}),e.keys=function(U){var z=Object(U),W=[];for(var Z in z)W.push(Z);return W.reverse(),function P(){for(;W.length;){var $=W.pop();if($ in z)return P.value=$,P.done=!1,P}return P.done=!0,P}},e.values=ae,Y.prototype={constructor:Y,reset:function(z){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(X),!z)for(var W in this)W.charAt(0)==="t"&&r.call(this,W)&&!isNaN(+W.slice(1))&&(this[W]=t)},stop:function(){this.done=!0;var z=this.tryEntries[0].completion;if(z.type==="throw")throw z.arg;return this.rval},dispatchException:function(z){if(this.done)throw z;var W=this;function Z(ce,fe){return ie.type="throw",ie.arg=z,W.next=ce,fe&&(W.method="next",W.arg=t),!!fe}for(var P=this.tryEntries.length-1;P>=0;--P){var $=this.tryEntries[P],ie=$.completion;if($.tryLoc==="root")return Z("end");if($.tryLoc<=this.prev){var se=r.call($,"catchLoc"),q=r.call($,"finallyLoc");if(se&&q){if(this.prev<$.catchLoc)return Z($.catchLoc,!0);if(this.prev<$.finallyLoc)return Z($.finallyLoc)}else if(se){if(this.prev<$.catchLoc)return Z($.catchLoc,!0)}else{if(!q)throw Error("try statement without catch or finally");if(this.prev<$.finallyLoc)return Z($.finallyLoc)}}}},abrupt:function(z,W){for(var Z=this.tryEntries.length-1;Z>=0;--Z){var P=this.tryEntries[Z];if(P.tryLoc<=this.prev&&r.call(P,"finallyLoc")&&this.prev<P.finallyLoc){var $=P;break}}$&&(z==="break"||z==="continue")&&$.tryLoc<=W&&W<=$.finallyLoc&&($=null);var ie=$?$.completion:{};return ie.type=z,ie.arg=W,$?(this.method="next",this.next=$.finallyLoc,b):this.complete(ie)},complete:function(z,W){if(z.type==="throw")throw z.arg;return z.type==="break"||z.type==="continue"?this.next=z.arg:z.type==="return"?(this.rval=this.arg=z.arg,this.method="return",this.next="end"):z.type==="normal"&&W&&(this.next=W),b},finish:function(z){for(var W=this.tryEntries.length-1;W>=0;--W){var Z=this.tryEntries[W];if(Z.finallyLoc===z)return this.complete(Z.completion,Z.afterLoc),X(Z),b}},catch:function(z){for(var W=this.tryEntries.length-1;W>=0;--W){var Z=this.tryEntries[W];if(Z.tryLoc===z){var P=Z.completion;if(P.type==="throw"){var $=P.arg;X(Z)}return $}}throw Error("illegal catch attempt")},delegateYield:function(z,W,Z){return this.delegate={iterator:ae(z),resultName:W,nextLoc:Z},this.method==="next"&&(this.arg=t),b}},e}function $T(t,e,n,r,i,s,l){try{var c=t[s](l),f=c.value}catch(d){return void n(d)}c.done?e(f):Promise.resolve(f).then(r,i)}function Yf(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var s=t.apply(e,n);function l(f){$T(s,r,i,l,c,"next",f)}function c(f){$T(s,r,i,l,c,"throw",f)}l(void 0)})}}const hx=(t,e,n)=>n!==void 0?n:`${t}-${e}`;function gx(t,e){var n=Object.assign({},t);return Array.isArray(e)&&e.forEach(function(r){delete n[r]}),n}const Nk=function(t){if(!t)return!1;if(t instanceof Element){if(t.offsetParent)return!0;if(t.getBBox){var e=t.getBBox(),n=e.width,r=e.height;if(n||r)return!0}if(t.getBoundingClientRect){var i=t.getBoundingClientRect(),s=i.width,l=i.height;if(s||l)return!0}}return!1},px=t=>{const e=Ft.useContext(Rc);return Ft.useMemo(()=>t?typeof t=="string"?t??e:t instanceof Function?t(e):e:e,[t,e])},Ik=t=>{const{componentCls:e}=t;return{[e]:{"&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"}}}},Dk=t=>{const{componentCls:e,antCls:n}=t;return{[e]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${e}-item:empty`]:{display:"none"},[`${e}-item > ${n}-badge-not-a-wrapper:only-child`]:{display:"block"}}}},Fk=t=>{const{componentCls:e}=t;return{[e]:{"&-gap-row-small":{rowGap:t.spaceGapSmallSize},"&-gap-row-middle":{rowGap:t.spaceGapMiddleSize},"&-gap-row-large":{rowGap:t.spaceGapLargeSize},"&-gap-col-small":{columnGap:t.spaceGapSmallSize},"&-gap-col-middle":{columnGap:t.spaceGapMiddleSize},"&-gap-col-large":{columnGap:t.spaceGapLargeSize}}}},mx=jc("Space",t=>{const e=fi(t,{spaceGapSmallSize:t.paddingXS,spaceGapMiddleSize:t.padding,spaceGapLargeSize:t.paddingLG});return[Dk(e),Fk(e),Ik(e)]},()=>({}),{resetStyle:!1});var vx=function(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};const gp=_.createContext(null),kk=(t,e)=>{const n=_.useContext(gp),r=_.useMemo(()=>{if(!n)return"";const{compactDirection:i,isFirstItem:s,isLastItem:l}=n,c=i==="vertical"?"-vertical-":"-";return Ze(`${t}-compact${c}item`,{[`${t}-compact${c}first-item`]:s,[`${t}-compact${c}last-item`]:l,[`${t}-compact${c}item-rtl`]:e==="rtl"})},[t,e,n]);return{compactSize:n==null?void 0:n.compactSize,compactDirection:n==null?void 0:n.compactDirection,compactItemClassnames:r}},Bk=t=>{const{children:e}=t;return _.createElement(gp.Provider,{value:null},e)},Uk=t=>{const{children:e}=t,n=vx(t,["children"]);return _.createElement(gp.Provider,{value:_.useMemo(()=>n,[n])},e)},Lk=t=>{const{getPrefixCls:e,direction:n}=_.useContext(ui),{size:r,direction:i,block:s,prefixCls:l,className:c,rootClassName:f,children:d}=t,g=vx(t,["size","direction","block","prefixCls","className","rootClassName","children"]),m=px(C=>r??C),v=e("space-compact",l),[S,E]=mx(v),w=Ze(v,E,{[`${v}-rtl`]:n==="rtl",[`${v}-block`]:s,[`${v}-vertical`]:i==="vertical"},c,f),b=_.useContext(gp),A=Ho(d),T=_.useMemo(()=>A.map((C,M)=>{const x=(C==null?void 0:C.key)||`${v}-item-${M}`;return _.createElement(Uk,{key:x,compactSize:m,compactDirection:i,isFirstItem:M===0&&(!b||(b==null?void 0:b.isFirstItem)),isLastItem:M===A.length-1&&(!b||(b==null?void 0:b.isLastItem))},C)}),[r,A,b]);return A.length===0?null:S(_.createElement("div",Object.assign({className:w},g),T))},zk=t=>({animationDuration:t,animationFillMode:"both"}),$k=t=>({animationDuration:t,animationFillMode:"both"}),gb=function(t,e,n,r){const s=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[`
${s}${t}-enter,
${s}${t}-appear
`]:Object.assign(Object.assign({},zk(r)),{animationPlayState:"paused"}),[`${s}${t}-leave`]:Object.assign(Object.assign({},$k(r)),{animationPlayState:"paused"}),[`
${s}${t}-enter${t}-enter-active,
${s}${t}-appear${t}-appear-active
`]:{animationName:e,animationPlayState:"running"},[`${s}${t}-leave${t}-leave-active`]:{animationName:n,animationPlayState:"running",pointerEvents:"none"}}},Vk=new ln("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Hk=new ln("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),jk=new ln("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Wk=new ln("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Xk=new ln("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),qk=new ln("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Yk=new ln("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Kk=new ln("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),Zk={"move-up":{inKeyframes:Yk,outKeyframes:Kk},"move-down":{inKeyframes:Vk,outKeyframes:Hk},"move-left":{inKeyframes:jk,outKeyframes:Wk},"move-right":{inKeyframes:Xk,outKeyframes:qk}},VT=(t,e)=>{const{antCls:n}=t,r=`${n}-${e}`,{inKeyframes:i,outKeyframes:s}=Zk[e];return[gb(r,i,s,t.motionDurationMid),{[`
${r}-enter,
${r}-appear
`]:{opacity:0,animationTimingFunction:t.motionEaseOutCirc},[`${r}-leave`]:{animationTimingFunction:t.motionEaseInOutCirc}}]},_x=new ln("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),yx=new ln("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),bx=new ln("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),Sx=new ln("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),Qk=new ln("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),Gk=new ln("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),Jk=new ln("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),eB=new ln("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),tB={"slide-up":{inKeyframes:_x,outKeyframes:yx},"slide-down":{inKeyframes:bx,outKeyframes:Sx},"slide-left":{inKeyframes:Qk,outKeyframes:Gk},"slide-right":{inKeyframes:Jk,outKeyframes:eB}},HT=(t,e)=>{const{antCls:n}=t,r=`${n}-${e}`,{inKeyframes:i,outKeyframes:s}=tB[e];return[gb(r,i,s,t.motionDurationMid),{[`
${r}-enter,
${r}-appear
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:t.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${r}-leave`]:{animationTimingFunction:t.motionEaseInQuint}}]},nB=new ln("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),rB=new ln("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),jT=new ln("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),WT=new ln("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),iB=new ln("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),sB=new ln("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),aB=new ln("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),oB=new ln("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),lB=new ln("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),cB=new ln("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}}),uB=new ln("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),fB=new ln("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}}),dB={zoom:{inKeyframes:nB,outKeyframes:rB},"zoom-big":{inKeyframes:jT,outKeyframes:WT},"zoom-big-fast":{inKeyframes:jT,outKeyframes:WT},"zoom-left":{inKeyframes:aB,outKeyframes:oB},"zoom-right":{inKeyframes:lB,outKeyframes:cB},"zoom-up":{inKeyframes:iB,outKeyframes:sB},"zoom-down":{inKeyframes:uB,outKeyframes:fB}},hB=(t,e)=>{const{antCls:n}=t,r=`${n}-${e}`,{inKeyframes:i,outKeyframes:s}=dB[e];return[gb(r,i,s,t.motionDurationFast),{[`
${r}-enter,
${r}-appear
`]:{transform:"scale(0)",opacity:0,animationTimingFunction:t.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${r}-leave`]:{animationTimingFunction:t.motionEaseInOutCirc}}]};function gB(t,e,n){const{focusElCls:r,focus:i,borderElCls:s}=n,l=s?"> *":"",c=["hover",i?"focus":null,"active"].filter(Boolean).map(f=>`&:${f} ${l}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:t.calc(t.lineWidth).mul(-1).equal()},"&-item":Object.assign(Object.assign({[c]:{zIndex:2}},r?{[`&${r}`]:{zIndex:2}}:{}),{[`&[disabled] ${l}`]:{zIndex:0}})}}function pB(t,e,n){const{borderElCls:r}=n,i=r?`> ${r}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${i}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${i}, &${t}-sm ${i}, &${t}-lg ${i}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${i}, &${t}-sm ${i}, &${t}-lg ${i}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function mB(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:n}=t,r=`${n}-compact`;return{[r]:Object.assign(Object.assign({},gB(t,r,e)),pB(n,r,e))}}var wx=_.createContext(null),XT=[];function vB(t,e){var n=_.useState(function(){if(!Qr())return null;var E=document.createElement("div");return E}),r=de(n,1),i=r[0],s=_.useRef(!1),l=_.useContext(wx),c=_.useState(XT),f=de(c,2),d=f[0],g=f[1],m=l||(s.current?void 0:function(E){g(function(w){var b=[E].concat(ze(w));return b})});function v(){i.parentElement||document.body.appendChild(i),s.current=!0}function S(){var E;(E=i.parentElement)===null||E===void 0||E.removeChild(i),s.current=!1}return Dn(function(){return t?l?l(v):v():S(),S},[t]),Dn(function(){d.length&&(d.forEach(function(E){return E()}),g(XT))},[d]),[i,m]}function _B(t){var e="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),n=document.createElement("div");n.id=e;var r=n.style;r.position="absolute",r.left="0",r.top="0",r.width="100px",r.height="100px",r.overflow="scroll";var i,s;if(t){var l=getComputedStyle(t);r.scrollbarColor=l.scrollbarColor,r.scrollbarWidth=l.scrollbarWidth;var c=getComputedStyle(t,"::-webkit-scrollbar"),f=parseInt(c.width,10),d=parseInt(c.height,10);try{var g=f?"width: ".concat(c.width,";"):"",m=d?"height: ".concat(c.height,";"):"";js(`
#`.concat(e,`::-webkit-scrollbar {
`).concat(g,`
`).concat(m,`
}`),e)}catch(E){console.error(E),i=f,s=d}}document.body.appendChild(n);var v=t&&i&&!isNaN(i)?i:n.offsetWidth-n.clientWidth,S=t&&s&&!isNaN(s)?s:n.offsetHeight-n.clientHeight;return document.body.removeChild(n),Tf(e),{width:v,height:S}}function yB(t){return typeof document>"u"||!t||!(t instanceof Element)?{width:0,height:0}:_B(t)}function bB(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var SB="rc-util-locker-".concat(Date.now()),qT=0;function wB(t){var e=!!t,n=_.useState(function(){return qT+=1,"".concat(SB,"_").concat(qT)}),r=de(n,1),i=r[0];Dn(function(){if(e){var s=yB(document.body).width,l=bB();js(`
html body {
overflow-y: hidden;
`.concat(l?"width: calc(100% - ".concat(s,"px);"):"",`
}`),i)}else Tf(i);return function(){Tf(i)}},[e,i])}var EB=!1;function TB(t){return EB}var YT=function(e){return e===!1?!1:!Qr()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},Ex=_.forwardRef(function(t,e){var n=t.open,r=t.autoLock,i=t.getContainer;t.debug;var s=t.autoDestroy,l=s===void 0?!0:s,c=t.children,f=_.useState(n),d=de(f,2),g=d[0],m=d[1],v=g||n;_.useEffect(function(){(l||n)&&m(n)},[n,l]);var S=_.useState(function(){return YT(i)}),E=de(S,2),w=E[0],b=E[1];_.useEffect(function(){var B=YT(i);b(B??null)});var A=vB(v&&!w),T=de(A,2),C=T[0],M=T[1],x=w??C;wB(r&&n&&Qr()&&(x===C||x===document.body));var N=null;if(c&&cp(c)&&e){var F=c;N=F.ref}var L=lp(N,e);if(!v||!Qr()||w===void 0)return null;var I=x===!1||TB(),V=c;return e&&(V=_.cloneElement(c,{ref:L})),_.createElement(wx.Provider,{value:M},I?V:$a.createPortal(V,x))});function AB(){var t=J({},rp);return t.useId}var KT=0,ZT=AB();const Tx=ZT?function(e){var n=ZT();return e||n}:function(e){var n=_.useState("ssr-id"),r=de(n,2),i=r[0],s=r[1];return _.useEffect(function(){var l=KT;KT+=1,s("rc_unique_".concat(l))},[]),e||i};var Eo="RC_FORM_INTERNAL_HOOKS",gn=function(){Ur(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Mc=_.createContext({getFieldValue:gn,getFieldsValue:gn,getFieldError:gn,getFieldWarning:gn,getFieldsError:gn,isFieldsTouched:gn,isFieldTouched:gn,isFieldValidating:gn,isFieldsValidating:gn,resetFields:gn,setFields:gn,setFieldValue:gn,setFieldsValue:gn,validateFields:gn,submit:gn,getInternalHooks:function(){return gn(),{dispatch:gn,initEntityValue:gn,registerField:gn,useSubscribe:gn,setInitialValues:gn,destroyForm:gn,setCallbacks:gn,registerWatch:gn,getFields:gn,setValidateMessages:gn,setPreserve:gn,getInitialValue:gn}}}),lg=_.createContext(null);function C_(t){return t==null?[]:Array.isArray(t)?t:[t]}function CB(t){return t&&!!t._init}function R_(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var x_=R_();function RB(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function xB(t,e,n){if(Jy())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Sf(i,n.prototype),i}function M_(t){var e=typeof Map=="function"?new Map:void 0;return M_=function(r){if(r===null||!RB(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return xB(r,arguments,wf(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Sf(i,r)},M_(t)}var MB=/%[sdj%]/g,OB=function(){};function O_(t){if(!t||!t.length)return null;var e={};return t.forEach(function(n){var r=n.field;e[r]=e[r]||[],e[r].push(n)}),e}function ci(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=0,s=n.length;if(typeof t=="function")return t.apply(null,n);if(typeof t=="string"){var l=t.replace(MB,function(c){if(c==="%%")return"%";if(i>=s)return c;switch(c){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}break;default:return c}});return l}return t}function PB(t){return t==="string"||t==="url"||t==="hex"||t==="email"||t==="date"||t==="pattern"}function gr(t,e){return!!(t==null||e==="array"&&Array.isArray(t)&&!t.length||PB(e)&&typeof t=="string"&&!t)}function NB(t,e,n){var r=[],i=0,s=t.length;function l(c){r.push.apply(r,ze(c||[])),i++,i===s&&n(r)}t.forEach(function(c){e(c,l)})}function QT(t,e,n){var r=0,i=t.length;function s(l){if(l&&l.length){n(l);return}var c=r;r=r+1,c<i?e(t[c],s):n([])}s([])}function IB(t){var e=[];return Object.keys(t).forEach(function(n){e.push.apply(e,ze(t[n]||[]))}),e}var GT=function(t){Zo(n,t);var e=Qo(n);function n(r,i){var s;return Or(this,n),s=e.call(this,"Async Validation Error"),K(Nt(s),"errors",void 0),K(Nt(s),"fields",void 0),s.errors=r,s.fields=i,s}return Pr(n)}(M_(Error));function DB(t,e,n,r,i){if(e.first){var s=new Promise(function(v,S){var E=function(A){return r(A),A.length?S(new GT(A,O_(A))):v(i)},w=IB(t);QT(w,n,E)});return s.catch(function(v){return v}),s}var l=e.firstFields===!0?Object.keys(t):e.firstFields||[],c=Object.keys(t),f=c.length,d=0,g=[],m=new Promise(function(v,S){var E=function(b){if(g.push.apply(g,b),d++,d===f)return r(g),g.length?S(new GT(g,O_(g))):v(i)};c.length||(r(g),v(i)),c.forEach(function(w){var b=t[w];l.indexOf(w)!==-1?QT(b,n,E):NB(b,n,E)})});return m.catch(function(v){return v}),m}function FB(t){return!!(t&&t.message!==void 0)}function kB(t,e){for(var n=t,r=0;r<e.length;r++){if(n==null)return n;n=n[e[r]]}return n}function JT(t,e){return function(n){var r;return t.fullFields?r=kB(e,t.fullFields):r=e[n.field||t.fullField],FB(n)?(n.field=n.field||t.fullField,n.fieldValue=r,n):{message:typeof n=="function"?n():n,fieldValue:r,field:n.field||t.fullField}}}function e2(t,e){if(e){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];pt(r)==="object"&&pt(t[n])==="object"?t[n]=J(J({},t[n]),r):t[n]=r}}return t}var Ul="enum",BB=function(e,n,r,i,s){e[Ul]=Array.isArray(e[Ul])?e[Ul]:[],e[Ul].indexOf(n)===-1&&i.push(ci(s.messages[Ul],e.fullField,e[Ul].join(", ")))},UB=function(e,n,r,i,s){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(n)||i.push(ci(s.messages.pattern.mismatch,e.fullField,n,e.pattern));else if(typeof e.pattern=="string"){var l=new RegExp(e.pattern);l.test(n)||i.push(ci(s.messages.pattern.mismatch,e.fullField,n,e.pattern))}}},LB=function(e,n,r,i,s){var l=typeof e.len=="number",c=typeof e.min=="number",f=typeof e.max=="number",d=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,g=n,m=null,v=typeof n=="number",S=typeof n=="string",E=Array.isArray(n);if(v?m="number":S?m="string":E&&(m="array"),!m)return!1;E&&(g=n.length),S&&(g=n.replace(d,"_").length),l?g!==e.len&&i.push(ci(s.messages[m].len,e.fullField,e.len)):c&&!f&&g<e.min?i.push(ci(s.messages[m].min,e.fullField,e.min)):f&&!c&&g>e.max?i.push(ci(s.messages[m].max,e.fullField,e.max)):c&&f&&(g<e.min||g>e.max)&&i.push(ci(s.messages[m].range,e.fullField,e.min,e.max))},Ax=function(e,n,r,i,s,l){e.required&&(!r.hasOwnProperty(e.field)||gr(n,l||e.type))&&i.push(ci(s.messages.required,e.fullField))},ph;const zB=function(){if(ph)return ph;var t="[a-fA-F\\d:]",e=function(N){return N&&N.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(t,")|(?<=").concat(t,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",i=["(?:".concat(r,":){7}(?:").concat(r,"|:)"),"(?:".concat(r,":){6}(?:").concat(n,"|:").concat(r,"|:)"),"(?:".concat(r,":){5}(?::").concat(n,"|(?::").concat(r,"){1,2}|:)"),"(?:".concat(r,":){4}(?:(?::").concat(r,"){0,1}:").concat(n,"|(?::").concat(r,"){1,3}|:)"),"(?:".concat(r,":){3}(?:(?::").concat(r,"){0,2}:").concat(n,"|(?::").concat(r,"){1,4}|:)"),"(?:".concat(r,":){2}(?:(?::").concat(r,"){0,3}:").concat(n,"|(?::").concat(r,"){1,5}|:)"),"(?:".concat(r,":){1}(?:(?::").concat(r,"){0,4}:").concat(n,"|(?::").concat(r,"){1,6}|:)"),"(?::(?:(?::".concat(r,"){0,5}:").concat(n,"|(?::").concat(r,"){1,7}|:))")],s="(?:%[0-9a-zA-Z]{1,})?",l="(?:".concat(i.join("|"),")").concat(s),c=new RegExp("(?:^".concat(n,"$)|(?:^").concat(l,"$)")),f=new RegExp("^".concat(n,"$")),d=new RegExp("^".concat(l,"$")),g=function(N){return N&&N.exact?c:new RegExp("(?:".concat(e(N)).concat(n).concat(e(N),")|(?:").concat(e(N)).concat(l).concat(e(N),")"),"g")};g.v4=function(x){return x&&x.exact?f:new RegExp("".concat(e(x)).concat(n).concat(e(x)),"g")},g.v6=function(x){return x&&x.exact?d:new RegExp("".concat(e(x)).concat(l).concat(e(x)),"g")};var m="(?:(?:[a-z]+:)?//)",v="(?:\\S+(?::\\S*)?@)?",S=g.v4().source,E=g.v6().source,w="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",b="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",A="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",T="(?::\\d{2,5})?",C='(?:[/?#][^\\s"]*)?',M="(?:".concat(m,"|www\\.)").concat(v,"(?:localhost|").concat(S,"|").concat(E,"|").concat(w).concat(b).concat(A,")").concat(T).concat(C);return ph=new RegExp("(?:^".concat(M,"$)"),"i"),ph};var t2={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Zu={integer:function(e){return Zu.number(e)&&parseInt(e,10)===e},float:function(e){return Zu.number(e)&&!Zu.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return pt(e)==="object"&&!Zu.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(t2.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(zB())},hex:function(e){return typeof e=="string"&&!!e.match(t2.hex)}},$B=function(e,n,r,i,s){if(e.required&&n===void 0){Ax(e,n,r,i,s);return}var l=["integer","float","array","regexp","object","method","email","number","date","url","hex"],c=e.type;l.indexOf(c)>-1?Zu[c](n)||i.push(ci(s.messages.types[c],e.fullField,e.type)):c&&pt(n)!==e.type&&i.push(ci(s.messages.types[c],e.fullField,e.type))},VB=function(e,n,r,i,s){(/^\s+$/.test(n)||n==="")&&i.push(ci(s.messages.whitespace,e.fullField))};const Ht={required:Ax,whitespace:VB,type:$B,range:LB,enum:BB,pattern:UB};var HB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s)}r(l)},jB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(n==null&&!e.required)return r();Ht.required(e,n,i,l,s,"array"),n!=null&&(Ht.type(e,n,i,l,s),Ht.range(e,n,i,l,s))}r(l)},WB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),n!==void 0&&Ht.type(e,n,i,l,s)}r(l)},XB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n,"date")&&!e.required)return r();if(Ht.required(e,n,i,l,s),!gr(n,"date")){var f;n instanceof Date?f=n:f=new Date(n),Ht.type(e,f,i,l,s),f&&Ht.range(e,f.getTime(),i,l,s)}}r(l)},qB="enum",YB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),n!==void 0&&Ht[qB](e,n,i,l,s)}r(l)},KB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),n!==void 0&&(Ht.type(e,n,i,l,s),Ht.range(e,n,i,l,s))}r(l)},ZB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),n!==void 0&&(Ht.type(e,n,i,l,s),Ht.range(e,n,i,l,s))}r(l)},QB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),n!==void 0&&Ht.type(e,n,i,l,s)}r(l)},GB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(n===""&&(n=void 0),gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),n!==void 0&&(Ht.type(e,n,i,l,s),Ht.range(e,n,i,l,s))}r(l)},JB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),n!==void 0&&Ht.type(e,n,i,l,s)}r(l)},eU=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n,"string")&&!e.required)return r();Ht.required(e,n,i,l,s),gr(n,"string")||Ht.pattern(e,n,i,l,s)}r(l)},tU=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),gr(n)||Ht.type(e,n,i,l,s)}r(l)},nU=function(e,n,r,i,s){var l=[],c=Array.isArray(n)?"array":pt(n);Ht.required(e,n,i,l,s,c),r(l)},rU=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n,"string")&&!e.required)return r();Ht.required(e,n,i,l,s,"string"),gr(n,"string")||(Ht.type(e,n,i,l,s),Ht.range(e,n,i,l,s),Ht.pattern(e,n,i,l,s),e.whitespace===!0&&Ht.whitespace(e,n,i,l,s))}r(l)},qv=function(e,n,r,i,s){var l=e.type,c=[],f=e.required||!e.required&&i.hasOwnProperty(e.field);if(f){if(gr(n,l)&&!e.required)return r();Ht.required(e,n,i,c,s,l),gr(n,l)||Ht.type(e,n,i,c,s)}r(c)};const of={string:rU,method:QB,number:GB,boolean:WB,regexp:tU,integer:ZB,float:KB,array:jB,object:JB,enum:YB,pattern:eU,date:XB,url:qv,hex:qv,email:qv,required:nU,any:HB};var Kf=function(){function t(e){Or(this,t),K(this,"rules",null),K(this,"_messages",x_),this.define(e)}return Pr(t,[{key:"define",value:function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(pt(n)!=="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(i){var s=n[i];r.rules[i]=Array.isArray(s)?s:[s]})}},{key:"messages",value:function(n){return n&&(this._messages=e2(R_(),n)),this._messages}},{key:"validate",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},l=n,c=i,f=s;if(typeof c=="function"&&(f=c,c={}),!this.rules||Object.keys(this.rules).length===0)return f&&f(null,l),Promise.resolve(l);function d(E){var w=[],b={};function A(C){if(Array.isArray(C)){var M;w=(M=w).concat.apply(M,ze(C))}else w.push(C)}for(var T=0;T<E.length;T++)A(E[T]);w.length?(b=O_(w),f(w,b)):f(null,l)}if(c.messages){var g=this.messages();g===x_&&(g=R_()),e2(g,c.messages),c.messages=g}else c.messages=this.messages();var m={},v=c.keys||Object.keys(this.rules);v.forEach(function(E){var w=r.rules[E],b=l[E];w.forEach(function(A){var T=A;typeof T.transform=="function"&&(l===n&&(l=J({},l)),b=l[E]=T.transform(b),b!=null&&(T.type=T.type||(Array.isArray(b)?"array":pt(b)))),typeof T=="function"?T={validator:T}:T=J({},T),T.validator=r.getValidationMethod(T),T.validator&&(T.field=E,T.fullField=T.fullField||E,T.type=r.getType(T),m[E]=m[E]||[],m[E].push({rule:T,value:b,source:l,field:E}))})});var S={};return DB(m,c,function(E,w){var b=E.rule,A=(b.type==="object"||b.type==="array")&&(pt(b.fields)==="object"||pt(b.defaultField)==="object");A=A&&(b.required||!b.required&&E.value),b.field=E.field;function T(F,L){return J(J({},L),{},{fullField:"".concat(b.fullField,".").concat(F),fullFields:b.fullFields?[].concat(ze(b.fullFields),[F]):[F]})}function C(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],L=Array.isArray(F)?F:[F];!c.suppressWarning&&L.length&&t.warning("async-validator:",L),L.length&&b.message!==void 0&&(L=[].concat(b.message));var I=L.map(JT(b,l));if(c.first&&I.length)return S[b.field]=1,w(I);if(!A)w(I);else{if(b.required&&!E.value)return b.message!==void 0?I=[].concat(b.message).map(JT(b,l)):c.error&&(I=[c.error(b,ci(c.messages.required,b.field))]),w(I);var V={};b.defaultField&&Object.keys(E.value).map(function(X){V[X]=b.defaultField}),V=J(J({},V),E.rule.fields);var B={};Object.keys(V).forEach(function(X){var Y=V[X],ae=Array.isArray(Y)?Y:[Y];B[X]=ae.map(T.bind(null,X))});var j=new t(B);j.messages(c.messages),E.rule.options&&(E.rule.options.messages=c.messages,E.rule.options.error=c.error),j.validate(E.value,E.rule.options||c,function(X){var Y=[];I&&I.length&&Y.push.apply(Y,ze(I)),X&&X.length&&Y.push.apply(Y,ze(X)),w(Y.length?Y:null)})}}var M;if(b.asyncValidator)M=b.asyncValidator(b,E.value,C,E.source,c);else if(b.validator){try{M=b.validator(b,E.value,C,E.source,c)}catch(F){var x,N;(x=(N=console).error)===null||x===void 0||x.call(N,F),c.suppressValidatorError||setTimeout(function(){throw F},0),C(F.message)}M===!0?C():M===!1?C(typeof b.message=="function"?b.message(b.fullField||b.field):b.message||"".concat(b.fullField||b.field," fails")):M instanceof Array?C(M):M instanceof Error&&C(M.message)}M&&M.then&&M.then(function(){return C()},function(F){return C(F)})},function(E){d(E)},l)}},{key:"getType",value:function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!of.hasOwnProperty(n.type))throw new Error(ci("Unknown rule type %s",n.type));return n.type||"string"}},{key:"getValidationMethod",value:function(n){if(typeof n.validator=="function")return n.validator;var r=Object.keys(n),i=r.indexOf("message");return i!==-1&&r.splice(i,1),r.length===1&&r[0]==="required"?of.required:of[this.getType(n)]||void 0}}]),t}();K(Kf,"register",function(e,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");of[e]=n});K(Kf,"warning",OB);K(Kf,"messages",x_);K(Kf,"validators",of);var ai="'${name}' is not a valid ${type}",Cx={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:ai,method:ai,array:ai,object:ai,number:ai,date:ai,boolean:ai,integer:ai,float:ai,regexp:ai,email:ai,url:ai,hex:ai},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},n2=Kf;function iU(t,e){return t.replace(/\\?\$\{\w+\}/g,function(n){if(n.startsWith("\\"))return n.slice(1);var r=n.slice(2,-1);return e[r]})}var r2="CODE_LOGIC_ERROR";function P_(t,e,n,r,i){return N_.apply(this,arguments)}function N_(){return N_=Yf(ns().mark(function t(e,n,r,i,s){var l,c,f,d,g,m,v,S,E;return ns().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return l=J({},r),delete l.ruleIndex,n2.warning=function(){},l.validator&&(c=l.validator,l.validator=function(){try{return c.apply(void 0,arguments)}catch(A){return console.error(A),Promise.reject(r2)}}),f=null,l&&l.type==="array"&&l.defaultField&&(f=l.defaultField,delete l.defaultField),d=new n2(K({},e,[l])),g=ql(Cx,i.validateMessages),d.messages(g),m=[],b.prev=10,b.next=13,Promise.resolve(d.validate(K({},e,n),J({},i)));case 13:b.next=18;break;case 15:b.prev=15,b.t0=b.catch(10),b.t0.errors&&(m=b.t0.errors.map(function(A,T){var C=A.message,M=C===r2?g.default:C;return _.isValidElement(M)?_.cloneElement(M,{key:"error_".concat(T)}):M}));case 18:if(!(!m.length&&f)){b.next=23;break}return b.next=21,Promise.all(n.map(function(A,T){return P_("".concat(e,".").concat(T),A,f,i,s)}));case 21:return v=b.sent,b.abrupt("return",v.reduce(function(A,T){return[].concat(ze(A),ze(T))},[]));case 23:return S=J(J({},r),{},{name:e,enum:(r.enum||[]).join(", ")},s),E=m.map(function(A){return typeof A=="string"?iU(A,S):A}),b.abrupt("return",E);case 26:case"end":return b.stop()}},t,null,[[10,15]])})),N_.apply(this,arguments)}function sU(t,e,n,r,i,s){var l=t.join("."),c=n.map(function(g,m){var v=g.validator,S=J(J({},g),{},{ruleIndex:m});return v&&(S.validator=function(E,w,b){var A=!1,T=function(){for(var x=arguments.length,N=new Array(x),F=0;F<x;F++)N[F]=arguments[F];Promise.resolve().then(function(){Ur(!A,"Your validator function has already return a promise. `callback` will be ignored."),A||b.apply(void 0,N)})},C=v(E,w,T);A=C&&typeof C.then=="function"&&typeof C.catch=="function",Ur(A,"`callback` is deprecated. Please return a promise instead."),A&&C.then(function(){b()}).catch(function(M){b(M||" ")})}),S}).sort(function(g,m){var v=g.warningOnly,S=g.ruleIndex,E=m.warningOnly,w=m.ruleIndex;return!!v==!!E?S-w:v?1:-1}),f;if(i===!0)f=new Promise(function(){var g=Yf(ns().mark(function m(v,S){var E,w,b;return ns().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:E=0;case 1:if(!(E<c.length)){T.next=12;break}return w=c[E],T.next=5,P_(l,e,w,r,s);case 5:if(b=T.sent,!b.length){T.next=9;break}return S([{errors:b,rule:w}]),T.abrupt("return");case 9:E+=1,T.next=1;break;case 12:v([]);case 13:case"end":return T.stop()}},m)}));return function(m,v){return g.apply(this,arguments)}}());else{var d=c.map(function(g){return P_(l,e,g,r,s).then(function(m){return{errors:m,rule:g}})});f=(i?oU(d):aU(d)).then(function(g){return Promise.reject(g)})}return f.catch(function(g){return g}),f}function aU(t){return I_.apply(this,arguments)}function I_(){return I_=Yf(ns().mark(function t(e){return ns().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.all(e).then(function(i){var s,l=(s=[]).concat.apply(s,ze(i));return l}));case 1:case"end":return r.stop()}},t)})),I_.apply(this,arguments)}function oU(t){return D_.apply(this,arguments)}function D_(){return D_=Yf(ns().mark(function t(e){var n;return ns().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return n=0,i.abrupt("return",new Promise(function(s){e.forEach(function(l){l.then(function(c){c.errors.length&&s([c]),n+=1,n===e.length&&s([])})})}));case 2:case"end":return i.stop()}},t)})),D_.apply(this,arguments)}function Jn(t){return C_(t)}function i2(t,e){var n={};return e.forEach(function(r){var i=_s(t,r);n=qi(n,r,i)}),n}function ic(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return t&&t.some(function(r){return Rx(e,r,n)})}function Rx(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!t||!e||!n&&t.length!==e.length?!1:e.every(function(r,i){return t[i]===r})}function lU(t,e){if(t===e)return!0;if(!t&&e||t&&!e||!t||!e||pt(t)!=="object"||pt(e)!=="object")return!1;var n=Object.keys(t),r=Object.keys(e),i=new Set([].concat(n,r));return ze(i).every(function(s){var l=t[s],c=e[s];return typeof l=="function"&&typeof c=="function"?!0:l===c})}function cU(t){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&pt(e.target)==="object"&&t in e.target?e.target[t]:e}function s2(t,e,n){var r=t.length;if(e<0||e>=r||n<0||n>=r)return t;var i=t[e],s=e-n;return s>0?[].concat(ze(t.slice(0,n)),[i],ze(t.slice(n,e)),ze(t.slice(e+1,r))):s<0?[].concat(ze(t.slice(0,e)),ze(t.slice(e+1,n+1)),[i],ze(t.slice(n+1,r))):t}var uU=["name"],Ci=[];function Yv(t,e,n,r,i,s){return typeof t=="function"?t(e,n,"source"in s?{source:s.source}:{}):r!==i}var pb=function(t){Zo(n,t);var e=Qo(n);function n(r){var i;if(Or(this,n),i=e.call(this,r),K(Nt(i),"state",{resetCount:0}),K(Nt(i),"cancelRegisterFunc",null),K(Nt(i),"mounted",!1),K(Nt(i),"touched",!1),K(Nt(i),"dirty",!1),K(Nt(i),"validatePromise",void 0),K(Nt(i),"prevValidating",void 0),K(Nt(i),"errors",Ci),K(Nt(i),"warnings",Ci),K(Nt(i),"cancelRegister",function(){var f=i.props,d=f.preserve,g=f.isListField,m=f.name;i.cancelRegisterFunc&&i.cancelRegisterFunc(g,d,Jn(m)),i.cancelRegisterFunc=null}),K(Nt(i),"getNamePath",function(){var f=i.props,d=f.name,g=f.fieldContext,m=g.prefixName,v=m===void 0?[]:m;return d!==void 0?[].concat(ze(v),ze(d)):[]}),K(Nt(i),"getRules",function(){var f=i.props,d=f.rules,g=d===void 0?[]:d,m=f.fieldContext;return g.map(function(v){return typeof v=="function"?v(m):v})}),K(Nt(i),"refresh",function(){i.mounted&&i.setState(function(f){var d=f.resetCount;return{resetCount:d+1}})}),K(Nt(i),"metaCache",null),K(Nt(i),"triggerMetaEvent",function(f){var d=i.props.onMetaChange;if(d){var g=J(J({},i.getMeta()),{},{destroy:f});ng(i.metaCache,g)||d(g),i.metaCache=g}else i.metaCache=null}),K(Nt(i),"onStoreChange",function(f,d,g){var m=i.props,v=m.shouldUpdate,S=m.dependencies,E=S===void 0?[]:S,w=m.onReset,b=g.store,A=i.getNamePath(),T=i.getValue(f),C=i.getValue(b),M=d&&ic(d,A);switch(g.type==="valueUpdate"&&g.source==="external"&&!ng(T,C)&&(i.touched=!0,i.dirty=!0,i.validatePromise=null,i.errors=Ci,i.warnings=Ci,i.triggerMetaEvent()),g.type){case"reset":if(!d||M){i.touched=!1,i.dirty=!1,i.validatePromise=void 0,i.errors=Ci,i.warnings=Ci,i.triggerMetaEvent(),w==null||w(),i.refresh();return}break;case"remove":{if(v&&Yv(v,f,b,T,C,g)){i.reRender();return}break}case"setField":{var x=g.data;if(M){"touched"in x&&(i.touched=x.touched),"validating"in x&&!("originRCField"in x)&&(i.validatePromise=x.validating?Promise.resolve([]):null),"errors"in x&&(i.errors=x.errors||Ci),"warnings"in x&&(i.warnings=x.warnings||Ci),i.dirty=!0,i.triggerMetaEvent(),i.reRender();return}else if("value"in x&&ic(d,A,!0)){i.reRender();return}if(v&&!A.length&&Yv(v,f,b,T,C,g)){i.reRender();return}break}case"dependenciesUpdate":{var N=E.map(Jn);if(N.some(function(F){return ic(g.relatedFields,F)})){i.reRender();return}break}default:if(M||(!E.length||A.length||v)&&Yv(v,f,b,T,C,g)){i.reRender();return}break}v===!0&&i.reRender()}),K(Nt(i),"validateRules",function(f){var d=i.getNamePath(),g=i.getValue(),m=f||{},v=m.triggerName,S=m.validateOnly,E=S===void 0?!1:S,w=Promise.resolve().then(Yf(ns().mark(function b(){var A,T,C,M,x,N,F;return ns().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(i.mounted){I.next=2;break}return I.abrupt("return",[]);case 2:if(A=i.props,T=A.validateFirst,C=T===void 0?!1:T,M=A.messageVariables,x=A.validateDebounce,N=i.getRules(),v&&(N=N.filter(function(V){return V}).filter(function(V){var B=V.validateTrigger;if(!B)return!0;var j=C_(B);return j.includes(v)})),!(x&&v)){I.next=10;break}return I.next=8,new Promise(function(V){setTimeout(V,x)});case 8:if(i.validatePromise===w){I.next=10;break}return I.abrupt("return",[]);case 10:return F=sU(d,g,N,f,C,M),F.catch(function(V){return V}).then(function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ci;if(i.validatePromise===w){var B;i.validatePromise=null;var j=[],X=[];(B=V.forEach)===null||B===void 0||B.call(V,function(Y){var ae=Y.rule.warningOnly,U=Y.errors,z=U===void 0?Ci:U;ae?X.push.apply(X,ze(z)):j.push.apply(j,ze(z))}),i.errors=j,i.warnings=X,i.triggerMetaEvent(),i.reRender()}}),I.abrupt("return",F);case 13:case"end":return I.stop()}},b)})));return E||(i.validatePromise=w,i.dirty=!0,i.errors=Ci,i.warnings=Ci,i.triggerMetaEvent(),i.reRender()),w}),K(Nt(i),"isFieldValidating",function(){return!!i.validatePromise}),K(Nt(i),"isFieldTouched",function(){return i.touched}),K(Nt(i),"isFieldDirty",function(){if(i.dirty||i.props.initialValue!==void 0)return!0;var f=i.props.fieldContext,d=f.getInternalHooks(Eo),g=d.getInitialValue;return g(i.getNamePath())!==void 0}),K(Nt(i),"getErrors",function(){return i.errors}),K(Nt(i),"getWarnings",function(){return i.warnings}),K(Nt(i),"isListField",function(){return i.props.isListField}),K(Nt(i),"isList",function(){return i.props.isList}),K(Nt(i),"isPreserve",function(){return i.props.preserve}),K(Nt(i),"getMeta",function(){i.prevValidating=i.isFieldValidating();var f={touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath(),validated:i.validatePromise===null};return f}),K(Nt(i),"getOnlyChild",function(f){if(typeof f=="function"){var d=i.getMeta();return J(J({},i.getOnlyChild(f(i.getControlled(),d,i.props.fieldContext))),{},{isFunction:!0})}var g=Ho(f);return g.length!==1||!_.isValidElement(g[0])?{child:g,isFunction:!1}:{child:g[0],isFunction:!1}}),K(Nt(i),"getValue",function(f){var d=i.props.fieldContext.getFieldsValue,g=i.getNamePath();return _s(f||d(!0),g)}),K(Nt(i),"getControlled",function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=i.props,g=d.name,m=d.trigger,v=d.validateTrigger,S=d.getValueFromEvent,E=d.normalize,w=d.valuePropName,b=d.getValueProps,A=d.fieldContext,T=v!==void 0?v:A.validateTrigger,C=i.getNamePath(),M=A.getInternalHooks,x=A.getFieldsValue,N=M(Eo),F=N.dispatch,L=i.getValue(),I=b||function(Y){return K({},w,Y)},V=f[m],B=g!==void 0?I(L):{},j=J(J({},f),B);j[m]=function(){i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var Y,ae=arguments.length,U=new Array(ae),z=0;z<ae;z++)U[z]=arguments[z];S?Y=S.apply(void 0,U):Y=cU.apply(void 0,[w].concat(U)),E&&(Y=E(Y,L,x(!0))),Y!==L&&F({type:"updateValue",namePath:C,value:Y}),V&&V.apply(void 0,U)};var X=C_(T||[]);return X.forEach(function(Y){var ae=j[Y];j[Y]=function(){ae&&ae.apply(void 0,arguments);var U=i.props.rules;U&&U.length&&F({type:"validateField",namePath:C,triggerName:Y})}}),j}),r.fieldContext){var s=r.fieldContext.getInternalHooks,l=s(Eo),c=l.initEntityValue;c(Nt(i))}return i}return Pr(n,[{key:"componentDidMount",value:function(){var i=this.props,s=i.shouldUpdate,l=i.fieldContext;if(this.mounted=!0,l){var c=l.getInternalHooks,f=c(Eo),d=f.registerField;this.cancelRegisterFunc=d(this)}s===!0&&this.reRender()}},{key:"componentWillUnmount",value:function(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}},{key:"reRender",value:function(){this.mounted&&this.forceUpdate()}},{key:"render",value:function(){var i=this.state.resetCount,s=this.props.children,l=this.getOnlyChild(s),c=l.child,f=l.isFunction,d;return f?d=c:_.isValidElement(c)?d=_.cloneElement(c,this.getControlled(c.props)):(Ur(!c,"`children` of Field is not validate ReactElement."),d=c),_.createElement(_.Fragment,{key:i},d)}}]),n}(_.Component);K(pb,"contextType",Mc);K(pb,"defaultProps",{trigger:"onChange",valuePropName:"value"});function xx(t){var e,n=t.name,r=Fn(t,uU),i=_.useContext(Mc),s=_.useContext(lg),l=n!==void 0?Jn(n):void 0,c=(e=r.isListField)!==null&&e!==void 0?e:!!s,f="keep";return c||(f="_".concat((l||[]).join("_"))),_.createElement(pb,kt({key:f,name:l,isListField:c},r,{fieldContext:i}))}function fU(t){var e=t.name,n=t.initialValue,r=t.children,i=t.rules,s=t.validateTrigger,l=t.isListField,c=_.useContext(Mc),f=_.useContext(lg),d=_.useRef({keys:[],id:0}),g=d.current,m=_.useMemo(function(){var w=Jn(c.prefixName)||[];return[].concat(ze(w),ze(Jn(e)))},[c.prefixName,e]),v=_.useMemo(function(){return J(J({},c),{},{prefixName:m})},[c,m]),S=_.useMemo(function(){return{getKey:function(b){var A=m.length,T=b[A];return[g.keys[T],b.slice(A+1)]}}},[m]);if(typeof r!="function")return Ur(!1,"Form.List only accepts function as children."),null;var E=function(b,A,T){var C=T.source;return C==="internal"?!1:b!==A};return _.createElement(lg.Provider,{value:S},_.createElement(Mc.Provider,{value:v},_.createElement(xx,{name:[],shouldUpdate:E,rules:i,validateTrigger:s,initialValue:n,isList:!0,isListField:l??!!f},function(w,b){var A=w.value,T=A===void 0?[]:A,C=w.onChange,M=c.getFieldValue,x=function(){var I=M(m||[]);return I||[]},N={add:function(I,V){var B=x();V>=0&&V<=B.length?(g.keys=[].concat(ze(g.keys.slice(0,V)),[g.id],ze(g.keys.slice(V))),C([].concat(ze(B.slice(0,V)),[I],ze(B.slice(V))))):(g.keys=[].concat(ze(g.keys),[g.id]),C([].concat(ze(B),[I]))),g.id+=1},remove:function(I){var V=x(),B=new Set(Array.isArray(I)?I:[I]);B.size<=0||(g.keys=g.keys.filter(function(j,X){return!B.has(X)}),C(V.filter(function(j,X){return!B.has(X)})))},move:function(I,V){if(I!==V){var B=x();I<0||I>=B.length||V<0||V>=B.length||(g.keys=s2(g.keys,I,V),C(s2(B,I,V)))}}},F=T||[];return Array.isArray(F)||(F=[]),r(F.map(function(L,I){var V=g.keys[I];return V===void 0&&(g.keys[I]=g.id,V=g.keys[I],g.id+=1),{name:I,key:V,isListField:!0}}),N,b)})))}function dU(t){var e=!1,n=t.length,r=[];return t.length?new Promise(function(i,s){t.forEach(function(l,c){l.catch(function(f){return e=!0,f}).then(function(f){n-=1,r[c]=f,!(n>0)&&(e&&s(r),i(r))})})}):Promise.resolve([])}var Mx="__@field_split__";function Kv(t){return t.map(function(e){return"".concat(pt(e),":").concat(e)}).join(Mx)}var Ll=function(){function t(){Or(this,t),K(this,"kvs",new Map)}return Pr(t,[{key:"set",value:function(n,r){this.kvs.set(Kv(n),r)}},{key:"get",value:function(n){return this.kvs.get(Kv(n))}},{key:"update",value:function(n,r){var i=this.get(n),s=r(i);s?this.set(n,s):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(Kv(n))}},{key:"map",value:function(n){return ze(this.kvs.entries()).map(function(r){var i=de(r,2),s=i[0],l=i[1],c=s.split(Mx);return n({key:c.map(function(f){var d=f.match(/^([^:]*):(.*)$/),g=de(d,3),m=g[1],v=g[2];return m==="number"?Number(v):v}),value:l})})}},{key:"toJSON",value:function(){var n={};return this.map(function(r){var i=r.key,s=r.value;return n[i.join(".")]=s,null}),n}}]),t}(),hU=["name"],gU=Pr(function t(e){var n=this;Or(this,t),K(this,"formHooked",!1),K(this,"forceRootUpdate",void 0),K(this,"subscribable",!0),K(this,"store",{}),K(this,"fieldEntities",[]),K(this,"initialValues",{}),K(this,"callbacks",{}),K(this,"validateMessages",null),K(this,"preserve",null),K(this,"lastValidatePromise",null),K(this,"getForm",function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}}),K(this,"getInternalHooks",function(r){return r===Eo?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(Ur(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),K(this,"useSubscribe",function(r){n.subscribable=r}),K(this,"prevWithoutPreserves",null),K(this,"setInitialValues",function(r,i){if(n.initialValues=r||{},i){var s,l=ql(r,n.store);(s=n.prevWithoutPreserves)===null||s===void 0||s.map(function(c){var f=c.key;l=qi(l,f,_s(r,f))}),n.prevWithoutPreserves=null,n.updateStore(l)}}),K(this,"destroyForm",function(r){if(r)n.updateStore({});else{var i=new Ll;n.getFieldEntities(!0).forEach(function(s){n.isMergedPreserve(s.isPreserve())||i.set(s.getNamePath(),!0)}),n.prevWithoutPreserves=i}}),K(this,"getInitialValue",function(r){var i=_s(n.initialValues,r);return r.length?ql(i):i}),K(this,"setCallbacks",function(r){n.callbacks=r}),K(this,"setValidateMessages",function(r){n.validateMessages=r}),K(this,"setPreserve",function(r){n.preserve=r}),K(this,"watchList",[]),K(this,"registerWatch",function(r){return n.watchList.push(r),function(){n.watchList=n.watchList.filter(function(i){return i!==r})}}),K(this,"notifyWatch",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var i=n.getFieldsValue(),s=n.getFieldsValue(!0);n.watchList.forEach(function(l){l(i,s,r)})}}),K(this,"timeoutId",null),K(this,"warningUnhooked",function(){}),K(this,"updateStore",function(r){n.store=r}),K(this,"getFieldEntities",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r?n.fieldEntities.filter(function(i){return i.getNamePath().length}):n.fieldEntities}),K(this,"getFieldsMap",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=new Ll;return n.getFieldEntities(r).forEach(function(s){var l=s.getNamePath();i.set(l,s)}),i}),K(this,"getFieldEntitiesForNamePathList",function(r){if(!r)return n.getFieldEntities(!0);var i=n.getFieldsMap(!0);return r.map(function(s){var l=Jn(s);return i.get(l)||{INVALIDATE_NAME_PATH:Jn(s)}})}),K(this,"getFieldsValue",function(r,i){n.warningUnhooked();var s,l,c;if(r===!0||Array.isArray(r)?(s=r,l=i):r&&pt(r)==="object"&&(c=r.strict,l=r.filter),s===!0&&!l)return n.store;var f=n.getFieldEntitiesForNamePathList(Array.isArray(s)?s:null),d=[];return f.forEach(function(g){var m,v,S="INVALIDATE_NAME_PATH"in g?g.INVALIDATE_NAME_PATH:g.getNamePath();if(c){var E,w;if((E=(w=g).isList)!==null&&E!==void 0&&E.call(w))return}else if(!s&&(m=(v=g).isListField)!==null&&m!==void 0&&m.call(v))return;if(!l)d.push(S);else{var b="getMeta"in g?g.getMeta():null;l(b)&&d.push(S)}}),i2(n.store,d.map(Jn))}),K(this,"getFieldValue",function(r){n.warningUnhooked();var i=Jn(r);return _s(n.store,i)}),K(this,"getFieldsError",function(r){n.warningUnhooked();var i=n.getFieldEntitiesForNamePathList(r);return i.map(function(s,l){return s&&!("INVALIDATE_NAME_PATH"in s)?{name:s.getNamePath(),errors:s.getErrors(),warnings:s.getWarnings()}:{name:Jn(r[l]),errors:[],warnings:[]}})}),K(this,"getFieldError",function(r){n.warningUnhooked();var i=Jn(r),s=n.getFieldsError([i])[0];return s.errors}),K(this,"getFieldWarning",function(r){n.warningUnhooked();var i=Jn(r),s=n.getFieldsError([i])[0];return s.warnings}),K(this,"isFieldsTouched",function(){n.warningUnhooked();for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];var l=i[0],c=i[1],f,d=!1;i.length===0?f=null:i.length===1?Array.isArray(l)?(f=l.map(Jn),d=!1):(f=null,d=l):(f=l.map(Jn),d=c);var g=n.getFieldEntities(!0),m=function(b){return b.isFieldTouched()};if(!f)return d?g.every(function(w){return m(w)||w.isList()}):g.some(m);var v=new Ll;f.forEach(function(w){v.set(w,[])}),g.forEach(function(w){var b=w.getNamePath();f.forEach(function(A){A.every(function(T,C){return b[C]===T})&&v.update(A,function(T){return[].concat(ze(T),[w])})})});var S=function(b){return b.some(m)},E=v.map(function(w){var b=w.value;return b});return d?E.every(S):E.some(S)}),K(this,"isFieldTouched",function(r){return n.warningUnhooked(),n.isFieldsTouched([r])}),K(this,"isFieldsValidating",function(r){n.warningUnhooked();var i=n.getFieldEntities();if(!r)return i.some(function(l){return l.isFieldValidating()});var s=r.map(Jn);return i.some(function(l){var c=l.getNamePath();return ic(s,c)&&l.isFieldValidating()})}),K(this,"isFieldValidating",function(r){return n.warningUnhooked(),n.isFieldsValidating([r])}),K(this,"resetWithFieldInitialValue",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=new Ll,s=n.getFieldEntities(!0);s.forEach(function(f){var d=f.props.initialValue,g=f.getNamePath();if(d!==void 0){var m=i.get(g)||new Set;m.add({entity:f,value:d}),i.set(g,m)}});var l=function(d){d.forEach(function(g){var m=g.props.initialValue;if(m!==void 0){var v=g.getNamePath(),S=n.getInitialValue(v);if(S!==void 0)Ur(!1,"Form already set 'initialValues' with path '".concat(v.join("."),"'. Field can not overwrite it."));else{var E=i.get(v);if(E&&E.size>1)Ur(!1,"Multiple Field with path '".concat(v.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(E){var w=n.getFieldValue(v),b=g.isListField();!b&&(!r.skipExist||w===void 0)&&n.updateStore(qi(n.store,v,ze(E)[0].value))}}}})},c;r.entities?c=r.entities:r.namePathList?(c=[],r.namePathList.forEach(function(f){var d=i.get(f);if(d){var g;(g=c).push.apply(g,ze(ze(d).map(function(m){return m.entity})))}})):c=s,l(c)}),K(this,"resetFields",function(r){n.warningUnhooked();var i=n.store;if(!r){n.updateStore(ql(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(i,null,{type:"reset"}),n.notifyWatch();return}var s=r.map(Jn);s.forEach(function(l){var c=n.getInitialValue(l);n.updateStore(qi(n.store,l,c))}),n.resetWithFieldInitialValue({namePathList:s}),n.notifyObservers(i,s,{type:"reset"}),n.notifyWatch(s)}),K(this,"setFields",function(r){n.warningUnhooked();var i=n.store,s=[];r.forEach(function(l){var c=l.name,f=Fn(l,hU),d=Jn(c);s.push(d),"value"in f&&n.updateStore(qi(n.store,d,f.value)),n.notifyObservers(i,[d],{type:"setField",data:l})}),n.notifyWatch(s)}),K(this,"getFields",function(){var r=n.getFieldEntities(!0),i=r.map(function(s){var l=s.getNamePath(),c=s.getMeta(),f=J(J({},c),{},{name:l,value:n.getFieldValue(l)});return Object.defineProperty(f,"originRCField",{value:!0}),f});return i}),K(this,"initEntityValue",function(r){var i=r.props.initialValue;if(i!==void 0){var s=r.getNamePath(),l=_s(n.store,s);l===void 0&&n.updateStore(qi(n.store,s,i))}}),K(this,"isMergedPreserve",function(r){var i=r!==void 0?r:n.preserve;return i??!0}),K(this,"registerField",function(r){n.fieldEntities.push(r);var i=r.getNamePath();if(n.notifyWatch([i]),r.props.initialValue!==void 0){var s=n.store;n.resetWithFieldInitialValue({entities:[r],skipExist:!0}),n.notifyObservers(s,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(l,c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(m){return m!==r}),!n.isMergedPreserve(c)&&(!l||f.length>1)){var d=l?void 0:n.getInitialValue(i);if(i.length&&n.getFieldValue(i)!==d&&n.fieldEntities.every(function(m){return!Rx(m.getNamePath(),i)})){var g=n.store;n.updateStore(qi(g,i,d,!0)),n.notifyObservers(g,[i],{type:"remove"}),n.triggerDependenciesUpdate(g,i)}}n.notifyWatch([i])}}),K(this,"dispatch",function(r){switch(r.type){case"updateValue":{var i=r.namePath,s=r.value;n.updateValue(i,s);break}case"validateField":{var l=r.namePath,c=r.triggerName;n.validateFields([l],{triggerName:c});break}}}),K(this,"notifyObservers",function(r,i,s){if(n.subscribable){var l=J(J({},s),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(c){var f=c.onStoreChange;f(r,i,l)})}else n.forceRootUpdate()}),K(this,"triggerDependenciesUpdate",function(r,i){var s=n.getDependencyChildrenFields(i);return s.length&&n.validateFields(s),n.notifyObservers(r,s,{type:"dependenciesUpdate",relatedFields:[i].concat(ze(s))}),s}),K(this,"updateValue",function(r,i){var s=Jn(r),l=n.store;n.updateStore(qi(n.store,s,i)),n.notifyObservers(l,[s],{type:"valueUpdate",source:"internal"}),n.notifyWatch([s]);var c=n.triggerDependenciesUpdate(l,s),f=n.callbacks.onValuesChange;if(f){var d=i2(n.store,[s]);f(d,n.getFieldsValue())}n.triggerOnFieldsChange([s].concat(ze(c)))}),K(this,"setFieldsValue",function(r){n.warningUnhooked();var i=n.store;if(r){var s=ql(n.store,r);n.updateStore(s)}n.notifyObservers(i,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),K(this,"setFieldValue",function(r,i){n.setFields([{name:r,value:i,errors:[],warnings:[]}])}),K(this,"getDependencyChildrenFields",function(r){var i=new Set,s=[],l=new Ll;n.getFieldEntities().forEach(function(f){var d=f.props.dependencies;(d||[]).forEach(function(g){var m=Jn(g);l.update(m,function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return v.add(f),v})})});var c=function f(d){var g=l.get(d)||new Set;g.forEach(function(m){if(!i.has(m)){i.add(m);var v=m.getNamePath();m.isFieldDirty()&&v.length&&(s.push(v),f(v))}})};return c(r),s}),K(this,"triggerOnFieldsChange",function(r,i){var s=n.callbacks.onFieldsChange;if(s){var l=n.getFields();if(i){var c=new Ll;i.forEach(function(d){var g=d.name,m=d.errors;c.set(g,m)}),l.forEach(function(d){d.errors=c.get(d.name)||d.errors})}var f=l.filter(function(d){var g=d.name;return ic(r,g)});f.length&&s(f,l)}}),K(this,"validateFields",function(r,i){n.warningUnhooked();var s,l;Array.isArray(r)||typeof r=="string"||typeof i=="string"?(s=r,l=i):l=r;var c=!!s,f=c?s.map(Jn):[],d=[],g=String(Date.now()),m=new Set,v=l||{},S=v.recursive,E=v.dirty;n.getFieldEntities(!0).forEach(function(T){if(c||f.push(T.getNamePath()),!(!T.props.rules||!T.props.rules.length)&&!(E&&!T.isFieldDirty())){var C=T.getNamePath();if(m.add(C.join(g)),!c||ic(f,C,S)){var M=T.validateRules(J({validateMessages:J(J({},Cx),n.validateMessages)},l));d.push(M.then(function(){return{name:C,errors:[],warnings:[]}}).catch(function(x){var N,F=[],L=[];return(N=x.forEach)===null||N===void 0||N.call(x,function(I){var V=I.rule.warningOnly,B=I.errors;V?L.push.apply(L,ze(B)):F.push.apply(F,ze(B))}),F.length?Promise.reject({name:C,errors:F,warnings:L}):{name:C,errors:F,warnings:L}}))}}});var w=dU(d);n.lastValidatePromise=w,w.catch(function(T){return T}).then(function(T){var C=T.map(function(M){var x=M.name;return x});n.notifyObservers(n.store,C,{type:"validateFinish"}),n.triggerOnFieldsChange(C,T)});var b=w.then(function(){return n.lastValidatePromise===w?Promise.resolve(n.getFieldsValue(f)):Promise.reject([])}).catch(function(T){var C=T.filter(function(M){return M&&M.errors.length});return Promise.reject({values:n.getFieldsValue(f),errorFields:C,outOfDate:n.lastValidatePromise!==w})});b.catch(function(T){return T});var A=f.filter(function(T){return m.has(T.join(g))});return n.triggerOnFieldsChange(A),b}),K(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(r){var i=n.callbacks.onFinish;if(i)try{i(r)}catch(s){console.error(s)}}).catch(function(r){var i=n.callbacks.onFinishFailed;i&&i(r)})}),this.forceRootUpdate=e});function Ox(t){var e=_.useRef(),n=_.useState({}),r=de(n,2),i=r[1];if(!e.current)if(t)e.current=t;else{var s=function(){i({})},l=new gU(s);e.current=l.getForm()}return[e.current]}var F_=_.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),pU=function(e){var n=e.validateMessages,r=e.onFormChange,i=e.onFormFinish,s=e.children,l=_.useContext(F_),c=_.useRef({});return _.createElement(F_.Provider,{value:J(J({},l),{},{validateMessages:J(J({},l.validateMessages),n),triggerFormChange:function(d,g){r&&r(d,{changedFields:g,forms:c.current}),l.triggerFormChange(d,g)},triggerFormFinish:function(d,g){i&&i(d,{values:g,forms:c.current}),l.triggerFormFinish(d,g)},registerForm:function(d,g){d&&(c.current=J(J({},c.current),{},K({},d,g))),l.registerForm(d,g)},unregisterForm:function(d){var g=J({},c.current);delete g[d],c.current=g,l.unregisterForm(d)}})},s)},mU=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],vU=function(e,n){var r=e.name,i=e.initialValues,s=e.fields,l=e.form,c=e.preserve,f=e.children,d=e.component,g=d===void 0?"form":d,m=e.validateMessages,v=e.validateTrigger,S=v===void 0?"onChange":v,E=e.onValuesChange,w=e.onFieldsChange,b=e.onFinish,A=e.onFinishFailed,T=e.clearOnDestroy,C=Fn(e,mU),M=_.useRef(null),x=_.useContext(F_),N=Ox(l),F=de(N,1),L=F[0],I=L.getInternalHooks(Eo),V=I.useSubscribe,B=I.setInitialValues,j=I.setCallbacks,X=I.setValidateMessages,Y=I.setPreserve,ae=I.destroyForm;_.useImperativeHandle(n,function(){return J(J({},L),{},{nativeElement:M.current})}),_.useEffect(function(){return x.registerForm(r,L),function(){x.unregisterForm(r)}},[x,L,r]),X(J(J({},x.validateMessages),m)),j({onValuesChange:E,onFieldsChange:function(q){if(x.triggerFormChange(r,q),w){for(var ce=arguments.length,fe=new Array(ce>1?ce-1:0),ye=1;ye<ce;ye++)fe[ye-1]=arguments[ye];w.apply(void 0,[q].concat(fe))}},onFinish:function(q){x.triggerFormFinish(r,q),b&&b(q)},onFinishFailed:A}),Y(c);var U=_.useRef(null);B(i,!U.current),U.current||(U.current=!0),_.useEffect(function(){return function(){return ae(T)}},[]);var z,W=typeof f=="function";if(W){var Z=L.getFieldsValue(!0);z=f(Z,L)}else z=f;V(!W);var P=_.useRef();_.useEffect(function(){lU(P.current||[],s||[])||L.setFields(s||[]),P.current=s},[s,L]);var $=_.useMemo(function(){return J(J({},L),{},{validateTrigger:S})},[L,S]),ie=_.createElement(lg.Provider,{value:null},_.createElement(Mc.Provider,{value:$},z));return g===!1?ie:_.createElement(g,kt({},C,{ref:M,onSubmit:function(q){q.preventDefault(),q.stopPropagation(),L.submit()},onReset:function(q){var ce;q.preventDefault(),L.resetFields(),(ce=C.onReset)===null||ce===void 0||ce.call(C,q)}}),ie)};function a2(t){try{return JSON.stringify(t)}catch{return Math.random()}}function _U(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e[0],i=e[1],s=i===void 0?{}:i,l=CB(s)?{form:s}:s,c=l.form,f=_.useState(),d=de(f,2),g=d[0],m=d[1],v=_.useMemo(function(){return a2(g)},[g]),S=_.useRef(v);S.current=v;var E=_.useContext(Mc),w=c||E,b=w&&w._init,A=Jn(r),T=_.useRef(A);return T.current=A,_.useEffect(function(){if(b){var C=w.getFieldsValue,M=w.getInternalHooks,x=M(Eo),N=x.registerWatch,F=function(B,j){var X=l.preserve?j:B;return typeof r=="function"?r(X):_s(X,T.current)},L=N(function(V,B){var j=F(V,B),X=a2(j);S.current!==X&&(S.current=X,m(j))}),I=F(C(),C(!0));return g!==I&&m(I),L}},[b]),g}var yU=_.forwardRef(vU),Zf=yU;Zf.FormProvider=pU;Zf.Field=xx;Zf.List=fU;Zf.useForm=Ox;Zf.useWatch=_U;const k_=_.createContext({}),bU=t=>{let{children:e,status:n,override:r}=t;const i=_.useContext(k_),s=_.useMemo(()=>{const l=Object.assign({},i);return r&&delete l.isFormItemInput,n&&(delete l.status,delete l.hasFeedback,delete l.feedbackIcon),l},[n,r,i]);return _.createElement(k_.Provider,{value:s},e)},SU=_.createContext(void 0),wU=t=>{const{space:e,form:n,children:r}=t;if(r==null)return null;let i=r;return n&&(i=Ft.createElement(bU,{override:!0,status:!0},i)),e&&(i=Ft.createElement(Bk,null,i)),i};function EU(t){return e=>_.createElement(Wc,{theme:{token:{motion:!1,zIndexPopupBase:0}}},_.createElement(t,Object.assign({},e)))}const TU=(t,e,n,r,i)=>EU(l=>{const{prefixCls:c,style:f}=l,d=_.useRef(null),[g,m]=_.useState(0),[v,S]=_.useState(0),[E,w]=xc(!1,{value:l.open}),{getPrefixCls:b}=_.useContext(ui),A=b("select",c);_.useEffect(()=>{if(w(!0),typeof ResizeObserver<"u"){const M=new ResizeObserver(N=>{const F=N[0].target;m(F.offsetHeight+8),S(F.offsetWidth)}),x=setInterval(()=>{var N;const F=`.${A}-dropdown`,L=(N=d.current)===null||N===void 0?void 0:N.querySelector(F);L&&(clearInterval(x),M.observe(L))},10);return()=>{clearInterval(x),M.disconnect()}}},[]);let T=Object.assign(Object.assign({},l),{style:Object.assign(Object.assign({},f),{margin:0}),open:E,visible:E,getPopupContainer:()=>d.current});Object.assign(T,{[e]:{overflow:{adjustX:!1,adjustY:!1}}});const C={paddingBottom:g,position:"relative",minWidth:v};return _.createElement("div",{ref:d,style:C},_.createElement(t,Object.assign({},T)))}),Px=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(t==null?void 0:t.substr(0,4))};var pp=function(e){var n=e.className,r=e.customizeIcon,i=e.customizeIconProps,s=e.children,l=e.onMouseDown,c=e.onClick,f=typeof r=="function"?r(i):r;return _.createElement("span",{className:n,onMouseDown:function(g){g.preventDefault(),l==null||l(g)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:c,"aria-hidden":!0},f!==void 0?f:_.createElement("span",{className:Ze(n.split(/\s+/).map(function(d){return"".concat(d,"-icon")}))},s))},AU=function(e,n,r,i,s){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,c=arguments.length>6?arguments[6]:void 0,f=arguments.length>7?arguments[7]:void 0,d=Ft.useMemo(function(){if(pt(i)==="object")return i.clearIcon;if(s)return s},[i,s]),g=Ft.useMemo(function(){return!!(!l&&i&&(r.length||c)&&!(f==="combobox"&&c===""))},[i,l,r.length,c,f]);return{allowClear:g,clearIcon:Ft.createElement(pp,{className:"".concat(e,"-clear"),onMouseDown:n,customizeIcon:d},"×")}},Nx=_.createContext(null);function CU(){return _.useContext(Nx)}function RU(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,e=_.useState(!1),n=de(e,2),r=n[0],i=n[1],s=_.useRef(null),l=function(){window.clearTimeout(s.current)};_.useEffect(function(){return l},[]);var c=function(d,g){l(),s.current=window.setTimeout(function(){i(d),g&&g()},t)};return[r,c,l]}function Ix(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,e=_.useRef(null),n=_.useRef(null);_.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]);function r(i){(i||e.current===null)&&(e.current=i),window.clearTimeout(n.current),n.current=window.setTimeout(function(){e.current=null},t)}return[function(){return e.current},r]}function xU(t,e,n,r){var i=_.useRef(null);i.current={open:e,triggerOpen:n,customizedTrigger:r},_.useEffect(function(){function s(l){var c;if(!((c=i.current)!==null&&c!==void 0&&c.customizedTrigger)){var f=l.target;f.shadowRoot&&l.composed&&(f=l.composedPath()[0]||f),i.current.open&&t().filter(function(d){return d}).every(function(d){return!d.contains(f)&&d!==f})&&i.current.triggerOpen(!1)}}return window.addEventListener("mousedown",s),function(){return window.removeEventListener("mousedown",s)}},[])}function MU(t){return t&&![et.ESC,et.SHIFT,et.BACKSPACE,et.TAB,et.WIN_KEY,et.ALT,et.META,et.WIN_KEY_RIGHT,et.CTRL,et.SEMICOLON,et.EQUALS,et.CAPS_LOCK,et.CONTEXT_MENU,et.F1,et.F2,et.F3,et.F4,et.F5,et.F6,et.F7,et.F8,et.F9,et.F10,et.F11,et.F12].includes(t)}var OU=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],zl=void 0;function PU(t,e){var n=t.prefixCls,r=t.invalidate,i=t.item,s=t.renderItem,l=t.responsive,c=t.responsiveDisabled,f=t.registerSize,d=t.itemKey,g=t.className,m=t.style,v=t.children,S=t.display,E=t.order,w=t.component,b=w===void 0?"div":w,A=Fn(t,OU),T=l&&!S;function C(L){f(d,L)}_.useEffect(function(){return function(){C(null)}},[]);var M=s&&i!==zl?s(i,{index:E}):v,x;r||(x={opacity:T?0:1,height:T?0:zl,overflowY:T?"hidden":zl,order:l?E:zl,pointerEvents:T?"none":zl,position:T?"absolute":zl});var N={};T&&(N["aria-hidden"]=!0);var F=_.createElement(b,kt({className:Ze(!r&&n,g),style:J(J({},x),m)},N,A,{ref:e}),M);return l&&(F=_.createElement(Go,{onResize:function(I){var V=I.offsetWidth;C(V)},disabled:c},F)),F}var lf=_.forwardRef(PU);lf.displayName="Item";function NU(t){if(typeof MessageChannel>"u")hr(t);else{var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(void 0)}}function IU(){var t=_.useRef(null),e=function(r){t.current||(t.current=[],NU(function(){$a.unstable_batchedUpdates(function(){t.current.forEach(function(i){i()}),t.current=null})})),t.current.push(r)};return e}function Hu(t,e){var n=_.useState(e),r=de(n,2),i=r[0],s=r[1],l=dr(function(c){t(function(){s(c)})});return[i,l]}var cg=Ft.createContext(null),DU=["component"],FU=["className"],kU=["className"],BU=function(e,n){var r=_.useContext(cg);if(!r){var i=e.component,s=i===void 0?"div":i,l=Fn(e,DU);return _.createElement(s,kt({},l,{ref:n}))}var c=r.className,f=Fn(r,FU),d=e.className,g=Fn(e,kU);return _.createElement(cg.Provider,{value:null},_.createElement(lf,kt({ref:n,className:Ze(c,d)},f,g)))},Dx=_.forwardRef(BU);Dx.displayName="RawItem";var UU=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Fx="responsive",kx="invalidate";function LU(t){return"+ ".concat(t.length," ...")}function zU(t,e){var n=t.prefixCls,r=n===void 0?"rc-overflow":n,i=t.data,s=i===void 0?[]:i,l=t.renderItem,c=t.renderRawItem,f=t.itemKey,d=t.itemWidth,g=d===void 0?10:d,m=t.ssr,v=t.style,S=t.className,E=t.maxCount,w=t.renderRest,b=t.renderRawRest,A=t.suffix,T=t.component,C=T===void 0?"div":T,M=t.itemComponent,x=t.onVisibleChange,N=Fn(t,UU),F=m==="full",L=IU(),I=Hu(L,null),V=de(I,2),B=V[0],j=V[1],X=B||0,Y=Hu(L,new Map),ae=de(Y,2),U=ae[0],z=ae[1],W=Hu(L,0),Z=de(W,2),P=Z[0],$=Z[1],ie=Hu(L,0),se=de(ie,2),q=se[0],ce=se[1],fe=Hu(L,0),ye=de(fe,2),we=ye[0],Ae=ye[1],Te=_.useState(null),ve=de(Te,2),ge=ve[0],_e=ve[1],Ie=_.useState(null),Ee=de(Ie,2),xe=Ee[0],Ve=Ee[1],Fe=_.useMemo(function(){return xe===null&&F?Number.MAX_SAFE_INTEGER:xe||0},[xe,B]),Be=_.useState(!1),nt=de(Be,2),He=nt[0],Ge=nt[1],Pe="".concat(r,"-item"),Me=Math.max(P,q),dt=E===Fx,rt=s.length&&dt,it=E===kx,st=rt||typeof E=="number"&&s.length>E,at=_.useMemo(function(){var qe=s;return rt?B===null&&F?qe=s:qe=s.slice(0,Math.min(s.length,X/g)):typeof E=="number"&&(qe=s.slice(0,E)),qe},[s,g,B,E,rt]),Je=_.useMemo(function(){return rt?s.slice(Fe+1):s.slice(at.length)},[s,at,rt,Fe]),lt=_.useCallback(function(qe,ke){var Ne;return typeof f=="function"?f(qe):(Ne=f&&(qe==null?void 0:qe[f]))!==null&&Ne!==void 0?Ne:ke},[f]),ft=_.useCallback(l||function(qe){return qe},[l]);function ct(qe,ke,Ne){xe===qe&&(ke===void 0||ke===ge)||(Ve(qe),Ne||(Ge(qe<s.length-1),x==null||x(qe)),ke!==void 0&&_e(ke))}function mt(qe,ke){j(ke.clientWidth)}function xt(qe,ke){z(function(Ne){var wt=new Map(Ne);return ke===null?wt.delete(qe):wt.set(qe,ke),wt})}function Bt(qe,ke){ce(ke),$(q)}function ht(qe,ke){Ae(ke)}function Vt(qe){return U.get(lt(at[qe],qe))}Dn(function(){if(X&&typeof Me=="number"&&at){var qe=we,ke=at.length,Ne=ke-1;if(!ke){ct(0,null);return}for(var wt=0;wt<ke;wt+=1){var en=Vt(wt);if(F&&(en=en||0),en===void 0){ct(wt-1,void 0,!0);break}if(qe+=en,Ne===0&&qe<=X||wt===Ne-1&&qe+Vt(Ne)<=X){ct(Ne,null);break}else if(qe+Me>X){ct(wt-1,qe-en-we+q);break}}A&&Vt(0)+we>X&&_e(null)}},[X,U,q,we,lt,at]);var qt=He&&!!Je.length,En={};ge!==null&&rt&&(En={position:"absolute",left:ge,top:0});var Mn={prefixCls:Pe,responsive:rt,component:M,invalidate:it},Ut=c?function(qe,ke){var Ne=lt(qe,ke);return _.createElement(cg.Provider,{key:Ne,value:J(J({},Mn),{},{order:ke,item:qe,itemKey:Ne,registerSize:xt,display:ke<=Fe})},c(qe,ke))}:function(qe,ke){var Ne=lt(qe,ke);return _.createElement(lf,kt({},Mn,{order:ke,key:Ne,item:qe,renderItem:ft,itemKey:Ne,registerSize:xt,display:ke<=Fe}))},It={order:qt?Fe:Number.MAX_SAFE_INTEGER,className:"".concat(Pe,"-rest"),registerSize:Bt,display:qt},Lt=w||LU,Jt=b?_.createElement(cg.Provider,{value:J(J({},Mn),It)},b(Je)):_.createElement(lf,kt({},Mn,It),typeof Lt=="function"?Lt(Je):Lt),Mt=_.createElement(C,kt({className:Ze(!it&&r,S),style:v,ref:e},N),at.map(Ut),st?Jt:null,A&&_.createElement(lf,kt({},Mn,{responsive:dt,responsiveDisabled:!rt,order:Fe,className:"".concat(Pe,"-suffix"),registerSize:ht,display:!0,style:En}),A));return dt?_.createElement(Go,{onResize:mt,disabled:!rt},Mt):Mt}var Qf=_.forwardRef(zU);Qf.displayName="Overflow";Qf.Item=Dx;Qf.RESPONSIVE=Fx;Qf.INVALIDATE=kx;var $U=function(e,n){var r,i=e.prefixCls,s=e.id,l=e.inputElement,c=e.disabled,f=e.tabIndex,d=e.autoFocus,g=e.autoComplete,m=e.editable,v=e.activeDescendantId,S=e.value,E=e.maxLength,w=e.onKeyDown,b=e.onMouseDown,A=e.onChange,T=e.onPaste,C=e.onCompositionStart,M=e.onCompositionEnd,x=e.onBlur,N=e.open,F=e.attrs,L=l||_.createElement("input",null),I=L,V=I.ref,B=I.props,j=B.onKeyDown,X=B.onChange,Y=B.onMouseDown,ae=B.onCompositionStart,U=B.onCompositionEnd,z=B.onBlur,W=B.style;return"maxLength"in L.props,L=_.cloneElement(L,J(J(J({type:"search"},B),{},{id:s,ref:op(n,V),disabled:c,tabIndex:f,autoComplete:g||"off",autoFocus:d,className:Ze("".concat(i,"-selection-search-input"),(r=L)===null||r===void 0||(r=r.props)===null||r===void 0?void 0:r.className),role:"combobox","aria-expanded":N||!1,"aria-haspopup":"listbox","aria-owns":"".concat(s,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(s,"_list"),"aria-activedescendant":N?v:void 0},F),{},{value:m?S:"",maxLength:E,readOnly:!m,unselectable:m?null:"on",style:J(J({},W),{},{opacity:m?null:0}),onKeyDown:function(P){w(P),j&&j(P)},onMouseDown:function(P){b(P),Y&&Y(P)},onChange:function(P){A(P),X&&X(P)},onCompositionStart:function(P){C(P),ae&&ae(P)},onCompositionEnd:function(P){M(P),U&&U(P)},onPaste:T,onBlur:function(P){x(P),z&&z(P)}})),L},Bx=_.forwardRef($U);function Ux(t){return Array.isArray(t)?t:t!==void 0?[t]:[]}var VU=typeof window<"u"&&window.document&&window.document.documentElement,HU=VU;function jU(t){return t!=null}function WU(t){return!t&&t!==0}function o2(t){return["string","number"].includes(pt(t))}function Lx(t){var e=void 0;return t&&(o2(t.title)?e=t.title.toString():o2(t.label)&&(e=t.label.toString())),e}function XU(t,e){HU?_.useLayoutEffect(t,e):_.useEffect(t,e)}function qU(t){var e;return(e=t.key)!==null&&e!==void 0?e:t.value}var l2=function(e){e.preventDefault(),e.stopPropagation()},YU=function(e){var n=e.id,r=e.prefixCls,i=e.values,s=e.open,l=e.searchValue,c=e.autoClearSearchValue,f=e.inputRef,d=e.placeholder,g=e.disabled,m=e.mode,v=e.showSearch,S=e.autoFocus,E=e.autoComplete,w=e.activeDescendantId,b=e.tabIndex,A=e.removeIcon,T=e.maxTagCount,C=e.maxTagTextLength,M=e.maxTagPlaceholder,x=M===void 0?function(Ie){return"+ ".concat(Ie.length," ...")}:M,N=e.tagRender,F=e.onToggleOpen,L=e.onRemove,I=e.onInputChange,V=e.onInputPaste,B=e.onInputKeyDown,j=e.onInputMouseDown,X=e.onInputCompositionStart,Y=e.onInputCompositionEnd,ae=e.onInputBlur,U=_.useRef(null),z=_.useState(0),W=de(z,2),Z=W[0],P=W[1],$=_.useState(!1),ie=de($,2),se=ie[0],q=ie[1],ce="".concat(r,"-selection"),fe=s||m==="multiple"&&c===!1||m==="tags"?l:"",ye=m==="tags"||m==="multiple"&&c===!1||v&&(s||se);XU(function(){P(U.current.scrollWidth)},[fe]);var we=function(Ee,xe,Ve,Fe,Be){return _.createElement("span",{title:Lx(Ee),className:Ze("".concat(ce,"-item"),K({},"".concat(ce,"-item-disabled"),Ve))},_.createElement("span",{className:"".concat(ce,"-item-content")},xe),Fe&&_.createElement(pp,{className:"".concat(ce,"-item-remove"),onMouseDown:l2,onClick:Be,customizeIcon:A},"×"))},Ae=function(Ee,xe,Ve,Fe,Be,nt){var He=function(Pe){l2(Pe),F(!s)};return _.createElement("span",{onMouseDown:He},N({label:xe,value:Ee,disabled:Ve,closable:Fe,onClose:Be,isMaxTag:!!nt}))},Te=function(Ee){var xe=Ee.disabled,Ve=Ee.label,Fe=Ee.value,Be=!g&&!xe,nt=Ve;if(typeof C=="number"&&(typeof Ve=="string"||typeof Ve=="number")){var He=String(nt);He.length>C&&(nt="".concat(He.slice(0,C),"..."))}var Ge=function(Me){Me&&Me.stopPropagation(),L(Ee)};return typeof N=="function"?Ae(Fe,nt,xe,Be,Ge):we(Ee,nt,xe,Be,Ge)},ve=function(Ee){if(!i.length)return null;var xe=typeof x=="function"?x(Ee):x;return typeof N=="function"?Ae(void 0,xe,!1,!1,void 0,!0):we({title:xe},xe,!1)},ge=_.createElement("div",{className:"".concat(ce,"-search"),style:{width:Z},onFocus:function(){q(!0)},onBlur:function(){q(!1)}},_.createElement(Bx,{ref:f,open:s,prefixCls:r,id:n,inputElement:null,disabled:g,autoFocus:S,autoComplete:E,editable:ye,activeDescendantId:w,value:fe,onKeyDown:B,onMouseDown:j,onChange:I,onPaste:V,onCompositionStart:X,onCompositionEnd:Y,onBlur:ae,tabIndex:b,attrs:og(e,!0)}),_.createElement("span",{ref:U,className:"".concat(ce,"-search-mirror"),"aria-hidden":!0},fe," ")),_e=_.createElement(Qf,{prefixCls:"".concat(ce,"-overflow"),data:i,renderItem:Te,renderRest:ve,suffix:ge,itemKey:qU,maxCount:T});return _.createElement("span",{className:"".concat(ce,"-wrap")},_e,!i.length&&!fe&&_.createElement("span",{className:"".concat(ce,"-placeholder")},d))},KU=function(e){var n=e.inputElement,r=e.prefixCls,i=e.id,s=e.inputRef,l=e.disabled,c=e.autoFocus,f=e.autoComplete,d=e.activeDescendantId,g=e.mode,m=e.open,v=e.values,S=e.placeholder,E=e.tabIndex,w=e.showSearch,b=e.searchValue,A=e.activeValue,T=e.maxLength,C=e.onInputKeyDown,M=e.onInputMouseDown,x=e.onInputChange,N=e.onInputPaste,F=e.onInputCompositionStart,L=e.onInputCompositionEnd,I=e.onInputBlur,V=e.title,B=_.useState(!1),j=de(B,2),X=j[0],Y=j[1],ae=g==="combobox",U=ae||w,z=v[0],W=b||"";ae&&A&&!X&&(W=A),_.useEffect(function(){ae&&Y(!1)},[ae,A]);var Z=g!=="combobox"&&!m&&!w?!1:!!W,P=V===void 0?Lx(z):V,$=_.useMemo(function(){return z?null:_.createElement("span",{className:"".concat(r,"-selection-placeholder"),style:Z?{visibility:"hidden"}:void 0},S)},[z,Z,S,r]);return _.createElement("span",{className:"".concat(r,"-selection-wrap")},_.createElement("span",{className:"".concat(r,"-selection-search")},_.createElement(Bx,{ref:s,prefixCls:r,id:i,open:m,inputElement:n,disabled:l,autoFocus:c,autoComplete:f,editable:U,activeDescendantId:d,value:W,onKeyDown:C,onMouseDown:M,onChange:function(se){Y(!0),x(se)},onPaste:N,onCompositionStart:F,onCompositionEnd:L,onBlur:I,tabIndex:E,attrs:og(e,!0),maxLength:ae?T:void 0})),!ae&&z?_.createElement("span",{className:"".concat(r,"-selection-item"),title:P,style:Z?{visibility:"hidden"}:void 0},z.label):null,$)},ZU=function(e,n){var r=_.useRef(null),i=_.useRef(!1),s=e.prefixCls,l=e.open,c=e.mode,f=e.showSearch,d=e.tokenWithEnter,g=e.disabled,m=e.prefix,v=e.autoClearSearchValue,S=e.onSearch,E=e.onSearchSubmit,w=e.onToggleOpen,b=e.onInputKeyDown,A=e.onInputBlur,T=e.domRef;_.useImperativeHandle(n,function(){return{focus:function(P){r.current.focus(P)},blur:function(){r.current.blur()}}});var C=Ix(0),M=de(C,2),x=M[0],N=M[1],F=function(P){var $=P.which,ie=r.current instanceof HTMLTextAreaElement;!ie&&l&&($===et.UP||$===et.DOWN)&&P.preventDefault(),b&&b(P),$===et.ENTER&&c==="tags"&&!i.current&&!l&&(E==null||E(P.target.value)),!(ie&&!l&&~[et.UP,et.DOWN,et.LEFT,et.RIGHT].indexOf($))&&MU($)&&w(!0)},L=function(){N(!0)},I=_.useRef(null),V=function(P){S(P,!0,i.current)!==!1&&w(!0)},B=function(){i.current=!0},j=function(P){i.current=!1,c!=="combobox"&&V(P.target.value)},X=function(P){var $=P.target.value;if(d&&I.current&&/[\r\n]/.test(I.current)){var ie=I.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");$=$.replace(ie,I.current)}I.current=null,V($)},Y=function(P){var $=P.clipboardData,ie=$==null?void 0:$.getData("text");I.current=ie||""},ae=function(P){var $=P.target;if($!==r.current){var ie=document.body.style.msTouchAction!==void 0;ie?setTimeout(function(){r.current.focus()}):r.current.focus()}},U=function(P){var $=x();P.target!==r.current&&!$&&!(c==="combobox"&&g)&&P.preventDefault(),(c!=="combobox"&&(!f||!$)||!l)&&(l&&v!==!1&&S("",!0,!1),w())},z={inputRef:r,onInputKeyDown:F,onInputMouseDown:L,onInputChange:X,onInputPaste:Y,onInputCompositionStart:B,onInputCompositionEnd:j,onInputBlur:A},W=c==="multiple"||c==="tags"?_.createElement(YU,kt({},e,z)):_.createElement(KU,kt({},e,z));return _.createElement("div",{ref:T,className:"".concat(s,"-selector"),onClick:ae,onMouseDown:U},m&&_.createElement("div",{className:"".concat(s,"-prefix")},m),W)},QU=_.forwardRef(ZU);function GU(t){var e=t.prefixCls,n=t.align,r=t.arrow,i=t.arrowPos,s=r||{},l=s.className,c=s.content,f=i.x,d=f===void 0?0:f,g=i.y,m=g===void 0?0:g,v=_.useRef();if(!n||!n.points)return null;var S={position:"absolute"};if(n.autoArrow!==!1){var E=n.points[0],w=n.points[1],b=E[0],A=E[1],T=w[0],C=w[1];b===T||!["t","b"].includes(b)?S.top=m:b==="t"?S.top=0:S.bottom=0,A===C||!["l","r"].includes(A)?S.left=d:A==="l"?S.left=0:S.right=0}return _.createElement("div",{ref:v,className:Ze("".concat(e,"-arrow"),l),style:S},c)}function JU(t){var e=t.prefixCls,n=t.open,r=t.zIndex,i=t.mask,s=t.motion;return i?_.createElement(hb,kt({},s,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(l){var c=l.className;return _.createElement("div",{style:{zIndex:r},className:Ze("".concat(e,"-mask"),c)})}):null}var eL=_.memo(function(t){var e=t.children;return e},function(t,e){return e.cache}),tL=_.forwardRef(function(t,e){var n=t.popup,r=t.className,i=t.prefixCls,s=t.style,l=t.target,c=t.onVisibleChanged,f=t.open,d=t.keepDom,g=t.fresh,m=t.onClick,v=t.mask,S=t.arrow,E=t.arrowPos,w=t.align,b=t.motion,A=t.maskMotion,T=t.forceRender,C=t.getPopupContainer,M=t.autoDestroy,x=t.portal,N=t.zIndex,F=t.onMouseEnter,L=t.onMouseLeave,I=t.onPointerEnter,V=t.onPointerDownCapture,B=t.ready,j=t.offsetX,X=t.offsetY,Y=t.offsetR,ae=t.offsetB,U=t.onAlign,z=t.onPrepare,W=t.stretch,Z=t.targetWidth,P=t.targetHeight,$=typeof n=="function"?n():n,ie=f||d,se=(C==null?void 0:C.length)>0,q=_.useState(!C||!se),ce=de(q,2),fe=ce[0],ye=ce[1];if(Dn(function(){!fe&&se&&l&&ye(!0)},[fe,se,l]),!fe)return null;var we="auto",Ae={left:"-1000vw",top:"-1000vh",right:we,bottom:we};if(B||!f){var Te,ve=w.points,ge=w.dynamicInset||((Te=w._experimental)===null||Te===void 0?void 0:Te.dynamicInset),_e=ge&&ve[0][1]==="r",Ie=ge&&ve[0][0]==="b";_e?(Ae.right=Y,Ae.left=we):(Ae.left=j,Ae.right=we),Ie?(Ae.bottom=ae,Ae.top=we):(Ae.top=X,Ae.bottom=we)}var Ee={};return W&&(W.includes("height")&&P?Ee.height=P:W.includes("minHeight")&&P&&(Ee.minHeight=P),W.includes("width")&&Z?Ee.width=Z:W.includes("minWidth")&&Z&&(Ee.minWidth=Z)),f||(Ee.pointerEvents="none"),_.createElement(x,{open:T||ie,getContainer:C&&function(){return C(l)},autoDestroy:M},_.createElement(JU,{prefixCls:i,open:f,zIndex:N,mask:v,motion:A}),_.createElement(Go,{onResize:U,disabled:!f},function(xe){return _.createElement(hb,kt({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:T,leavedClassName:"".concat(i,"-hidden")},b,{onAppearPrepare:z,onEnterPrepare:z,visible:f,onVisibleChanged:function(Fe){var Be;b==null||(Be=b.onVisibleChanged)===null||Be===void 0||Be.call(b,Fe),c(Fe)}}),function(Ve,Fe){var Be=Ve.className,nt=Ve.style,He=Ze(i,Be,r);return _.createElement("div",{ref:op(xe,e,Fe),className:He,style:J(J(J(J({"--arrow-x":"".concat(E.x||0,"px"),"--arrow-y":"".concat(E.y||0,"px")},Ae),Ee),nt),{},{boxSizing:"border-box",zIndex:N},s),onMouseEnter:F,onMouseLeave:L,onPointerEnter:I,onClick:m,onPointerDownCapture:V},S&&_.createElement(GU,{prefixCls:i,arrow:S,arrowPos:E,align:w}),_.createElement(eL,{cache:!f&&!g},$))})}))}),nL=_.forwardRef(function(t,e){var n=t.children,r=t.getTriggerDOMNode,i=cp(n),s=_.useCallback(function(c){Qy(e,r?r(c):c)},[r]),l=lp(s,Gy(n));return i?_.cloneElement(n,{ref:l}):n}),c2=_.createContext(null);function u2(t){return t?Array.isArray(t)?t:[t]:[]}function rL(t,e,n,r){return _.useMemo(function(){var i=u2(n??e),s=u2(r??e),l=new Set(i),c=new Set(s);return t&&(l.has("hover")&&(l.delete("hover"),l.add("click")),c.has("hover")&&(c.delete("hover"),c.add("click"))),[l,c]},[t,e,n,r])}function iL(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?t[0]===e[0]:t[0]===e[0]&&t[1]===e[1]}function sL(t,e,n,r){for(var i=n.points,s=Object.keys(t),l=0;l<s.length;l+=1){var c,f=s[l];if(iL((c=t[f])===null||c===void 0?void 0:c.points,i,r))return"".concat(e,"-placement-").concat(f)}return""}function f2(t,e,n,r){return e||(n?{motionName:"".concat(t,"-").concat(n)}:r?{motionName:r}:null)}function Gf(t){return t.ownerDocument.defaultView}function B_(t){for(var e=[],n=t==null?void 0:t.parentElement,r=["hidden","scroll","clip","auto"];n;){var i=Gf(n).getComputedStyle(n),s=i.overflowX,l=i.overflowY,c=i.overflow;[s,l,c].some(function(f){return r.includes(f)})&&e.push(n),n=n.parentElement}return e}function Of(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(t)?e:t}function ju(t){return Of(parseFloat(t),0)}function d2(t,e){var n=J({},t);return(e||[]).forEach(function(r){if(!(r instanceof HTMLBodyElement||r instanceof HTMLHtmlElement)){var i=Gf(r).getComputedStyle(r),s=i.overflow,l=i.overflowClipMargin,c=i.borderTopWidth,f=i.borderBottomWidth,d=i.borderLeftWidth,g=i.borderRightWidth,m=r.getBoundingClientRect(),v=r.offsetHeight,S=r.clientHeight,E=r.offsetWidth,w=r.clientWidth,b=ju(c),A=ju(f),T=ju(d),C=ju(g),M=Of(Math.round(m.width/E*1e3)/1e3),x=Of(Math.round(m.height/v*1e3)/1e3),N=(E-w-T-C)*M,F=(v-S-b-A)*x,L=b*x,I=A*x,V=T*M,B=C*M,j=0,X=0;if(s==="clip"){var Y=ju(l);j=Y*M,X=Y*x}var ae=m.x+V-j,U=m.y+L-X,z=ae+m.width+2*j-V-B-N,W=U+m.height+2*X-L-I-F;n.left=Math.max(n.left,ae),n.top=Math.max(n.top,U),n.right=Math.min(n.right,z),n.bottom=Math.min(n.bottom,W)}}),n}function h2(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n="".concat(e),r=n.match(/^(.*)\%$/);return r?t*(parseFloat(r[1])/100):parseFloat(n)}function g2(t,e){var n=e||[],r=de(n,2),i=r[0],s=r[1];return[h2(t.width,i),h2(t.height,s)]}function p2(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[t[0],t[1]]}function $l(t,e){var n=e[0],r=e[1],i,s;return n==="t"?s=t.y:n==="b"?s=t.y+t.height:s=t.y+t.height/2,r==="l"?i=t.x:r==="r"?i=t.x+t.width:i=t.x+t.width/2,{x:i,y:s}}function ma(t,e){var n={t:"b",b:"t",l:"r",r:"l"};return t.map(function(r,i){return i===e?n[r]||"c":r}).join("")}function aL(t,e,n,r,i,s,l){var c=_.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:i[r]||{}}),f=de(c,2),d=f[0],g=f[1],m=_.useRef(0),v=_.useMemo(function(){return e?B_(e):[]},[e]),S=_.useRef({}),E=function(){S.current={}};t||E();var w=dr(function(){if(e&&n&&t){let Xr=function(Bi,di){var hi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Me,gi=q.x+Bi,Ui=q.y+di,rl=gi+_e,ja=Ui+ge,il=Math.max(gi,hi.left),$e=Math.max(Ui,hi.top),gt=Math.min(rl,hi.right),sn=Math.min(ja,hi.bottom);return Math.max(0,(gt-il)*(sn-$e))},nl=function(){vn=q.y+Ne,On=vn+ge,_n=q.x+ke,Zn=_n+_e};var T,C,M,x,N=e,F=N.ownerDocument,L=Gf(N),I=L.getComputedStyle(N),V=I.width,B=I.height,j=I.position,X=N.style.left,Y=N.style.top,ae=N.style.right,U=N.style.bottom,z=N.style.overflow,W=J(J({},i[r]),s),Z=F.createElement("div");(T=N.parentElement)===null||T===void 0||T.appendChild(Z),Z.style.left="".concat(N.offsetLeft,"px"),Z.style.top="".concat(N.offsetTop,"px"),Z.style.position=j,Z.style.height="".concat(N.offsetHeight,"px"),Z.style.width="".concat(N.offsetWidth,"px"),N.style.left="0",N.style.top="0",N.style.right="auto",N.style.bottom="auto",N.style.overflow="hidden";var P;if(Array.isArray(n))P={x:n[0],y:n[1],width:0,height:0};else{var $,ie,se=n.getBoundingClientRect();se.x=($=se.x)!==null&&$!==void 0?$:se.left,se.y=(ie=se.y)!==null&&ie!==void 0?ie:se.top,P={x:se.x,y:se.y,width:se.width,height:se.height}}var q=N.getBoundingClientRect();q.x=(C=q.x)!==null&&C!==void 0?C:q.left,q.y=(M=q.y)!==null&&M!==void 0?M:q.top;var ce=F.documentElement,fe=ce.clientWidth,ye=ce.clientHeight,we=ce.scrollWidth,Ae=ce.scrollHeight,Te=ce.scrollTop,ve=ce.scrollLeft,ge=q.height,_e=q.width,Ie=P.height,Ee=P.width,xe={left:0,top:0,right:fe,bottom:ye},Ve={left:-ve,top:-Te,right:we-ve,bottom:Ae-Te},Fe=W.htmlRegion,Be="visible",nt="visibleFirst";Fe!=="scroll"&&Fe!==nt&&(Fe=Be);var He=Fe===nt,Ge=d2(Ve,v),Pe=d2(xe,v),Me=Fe===Be?Pe:Ge,dt=He?Pe:Me;N.style.left="auto",N.style.top="auto",N.style.right="0",N.style.bottom="0";var rt=N.getBoundingClientRect();N.style.left=X,N.style.top=Y,N.style.right=ae,N.style.bottom=U,N.style.overflow=z,(x=N.parentElement)===null||x===void 0||x.removeChild(Z);var it=Of(Math.round(_e/parseFloat(V)*1e3)/1e3),st=Of(Math.round(ge/parseFloat(B)*1e3)/1e3);if(it===0||st===0||bf(n)&&!Nk(n))return;var at=W.offset,Je=W.targetOffset,lt=g2(q,at),ft=de(lt,2),ct=ft[0],mt=ft[1],xt=g2(P,Je),Bt=de(xt,2),ht=Bt[0],Vt=Bt[1];P.x-=ht,P.y-=Vt;var qt=W.points||[],En=de(qt,2),Mn=En[0],Ut=En[1],It=p2(Ut),Lt=p2(Mn),Jt=$l(P,It),Mt=$l(q,Lt),qe=J({},W),ke=Jt.x-Mt.x+ct,Ne=Jt.y-Mt.y+mt,wt=Xr(ke,Ne),en=Xr(ke,Ne,Pe),Ue=$l(P,["t","l"]),Oe=$l(q,["t","l"]),je=$l(P,["b","r"]),Ye=$l(q,["b","r"]),We=W.overflow||{},Qe=We.adjustX,bt=We.adjustY,_t=We.shiftX,Zt=We.shiftY,Yt=function(di){return typeof di=="boolean"?di:di>=0},vn,On,_n,Zn;nl();var un=Yt(bt),rn=Lt[0]===It[0];if(un&&Lt[0]==="t"&&(On>dt.bottom||S.current.bt)){var Ce=Ne;rn?Ce-=ge-Ie:Ce=Ue.y-Ye.y-mt;var Le=Xr(ke,Ce),De=Xr(ke,Ce,Pe);Le>wt||Le===wt&&(!He||De>=en)?(S.current.bt=!0,Ne=Ce,mt=-mt,qe.points=[ma(Lt,0),ma(It,0)]):S.current.bt=!1}if(un&&Lt[0]==="b"&&(vn<dt.top||S.current.tb)){var be=Ne;rn?be+=ge-Ie:be=je.y-Oe.y-mt;var ut=Xr(ke,be),zt=Xr(ke,be,Pe);ut>wt||ut===wt&&(!He||zt>=en)?(S.current.tb=!0,Ne=be,mt=-mt,qe.points=[ma(Lt,0),ma(It,0)]):S.current.tb=!1}var Ot=Yt(Qe),In=Lt[1]===It[1];if(Ot&&Lt[1]==="l"&&(Zn>dt.right||S.current.rl)){var tn=ke;In?tn-=_e-Ee:tn=Ue.x-Ye.x-ct;var Vn=Xr(tn,Ne),Pn=Xr(tn,Ne,Pe);Vn>wt||Vn===wt&&(!He||Pn>=en)?(S.current.rl=!0,ke=tn,ct=-ct,qe.points=[ma(Lt,1),ma(It,1)]):S.current.rl=!1}if(Ot&&Lt[1]==="r"&&(_n<dt.left||S.current.lr)){var Bn=ke;In?Bn+=_e-Ee:Bn=je.x-Oe.x-ct;var Nr=Xr(Bn,Ne),er=Xr(Bn,Ne,Pe);Nr>wt||Nr===wt&&(!He||er>=en)?(S.current.lr=!0,ke=Bn,ct=-ct,qe.points=[ma(Lt,1),ma(It,1)]):S.current.lr=!1}nl();var Un=_t===!0?0:_t;typeof Un=="number"&&(_n<Pe.left&&(ke-=_n-Pe.left-ct,P.x+Ee<Pe.left+Un&&(ke+=P.x-Pe.left+Ee-Un)),Zn>Pe.right&&(ke-=Zn-Pe.right-ct,P.x>Pe.right-Un&&(ke+=P.x-Pe.right+Un)));var Tn=Zt===!0?0:Zt;typeof Tn=="number"&&(vn<Pe.top&&(Ne-=vn-Pe.top-mt,P.y+Ie<Pe.top+Tn&&(Ne+=P.y-Pe.top+Ie-Tn)),On>Pe.bottom&&(Ne-=On-Pe.bottom-mt,P.y>Pe.bottom-Tn&&(Ne+=P.y-Pe.bottom+Tn)));var Qn=q.x+ke,Di=Qn+_e,Wr=q.y+Ne,Fi=Wr+ge,ki=P.x,Tt=ki+Ee,yt=P.y,nn=yt+Ie,Hn=Math.max(Qn,ki),An=Math.min(Di,Tt),Nn=(Hn+An)/2,tr=Nn-Qn,Sr=Math.max(Wr,yt),Lr=Math.min(Fi,nn),wr=(Sr+Lr)/2,Gr=wr-Wr;l==null||l(e,qe);var Jr=rt.right-q.x-(ke+q.width),pr=rt.bottom-q.y-(Ne+q.height);it===1&&(ke=Math.round(ke),Jr=Math.round(Jr)),st===1&&(Ne=Math.round(Ne),pr=Math.round(pr));var Ha={ready:!0,offsetX:ke/it,offsetY:Ne/st,offsetR:Jr/it,offsetB:pr/st,arrowX:tr/it,arrowY:Gr/st,scaleX:it,scaleY:st,align:qe};g(Ha)}}),b=function(){m.current+=1;var C=m.current;Promise.resolve().then(function(){m.current===C&&w()})},A=function(){g(function(C){return J(J({},C),{},{ready:!1})})};return Dn(A,[r]),Dn(function(){t||A()},[t]),[d.ready,d.offsetX,d.offsetY,d.offsetR,d.offsetB,d.arrowX,d.arrowY,d.scaleX,d.scaleY,d.align,b]}function oL(t,e,n,r,i){Dn(function(){if(t&&e&&n){let m=function(){r(),i()};var s=e,l=n,c=B_(s),f=B_(l),d=Gf(l),g=new Set([d].concat(ze(c),ze(f)));return g.forEach(function(v){v.addEventListener("scroll",m,{passive:!0})}),d.addEventListener("resize",m,{passive:!0}),r(),function(){g.forEach(function(v){v.removeEventListener("scroll",m),d.removeEventListener("resize",m)})}}},[t,e,n])}function lL(t,e,n,r,i,s,l,c){var f=_.useRef(t);f.current=t;var d=_.useRef(!1);_.useEffect(function(){if(e&&r&&(!i||s)){var m=function(){d.current=!1},v=function(b){var A;f.current&&!l(((A=b.composedPath)===null||A===void 0||(A=A.call(b))===null||A===void 0?void 0:A[0])||b.target)&&!d.current&&c(!1)},S=Gf(r);S.addEventListener("pointerdown",m,!0),S.addEventListener("mousedown",v,!0),S.addEventListener("contextmenu",v,!0);var E=ag(n);return E&&(E.addEventListener("mousedown",v,!0),E.addEventListener("contextmenu",v,!0)),function(){S.removeEventListener("pointerdown",m,!0),S.removeEventListener("mousedown",v,!0),S.removeEventListener("contextmenu",v,!0),E&&(E.removeEventListener("mousedown",v,!0),E.removeEventListener("contextmenu",v,!0))}}},[e,n,r,i,s]);function g(){d.current=!0}return g}var cL=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function uL(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ex,e=_.forwardRef(function(n,r){var i=n.prefixCls,s=i===void 0?"rc-trigger-popup":i,l=n.children,c=n.action,f=c===void 0?"hover":c,d=n.showAction,g=n.hideAction,m=n.popupVisible,v=n.defaultPopupVisible,S=n.onPopupVisibleChange,E=n.afterPopupVisibleChange,w=n.mouseEnterDelay,b=n.mouseLeaveDelay,A=b===void 0?.1:b,T=n.focusDelay,C=n.blurDelay,M=n.mask,x=n.maskClosable,N=x===void 0?!0:x,F=n.getPopupContainer,L=n.forceRender,I=n.autoDestroy,V=n.destroyPopupOnHide,B=n.popup,j=n.popupClassName,X=n.popupStyle,Y=n.popupPlacement,ae=n.builtinPlacements,U=ae===void 0?{}:ae,z=n.popupAlign,W=n.zIndex,Z=n.stretch,P=n.getPopupClassNameFromAlign,$=n.fresh,ie=n.alignPoint,se=n.onPopupClick,q=n.onPopupAlign,ce=n.arrow,fe=n.popupMotion,ye=n.maskMotion,we=n.popupTransitionName,Ae=n.popupAnimation,Te=n.maskTransitionName,ve=n.maskAnimation,ge=n.className,_e=n.getTriggerDOMNode,Ie=Fn(n,cL),Ee=I||V||!1,xe=_.useState(!1),Ve=de(xe,2),Fe=Ve[0],Be=Ve[1];Dn(function(){Be(Px())},[]);var nt=_.useRef({}),He=_.useContext(c2),Ge=_.useMemo(function(){return{registerSubPopup:function(gt,sn){nt.current[gt]=sn,He==null||He.registerSubPopup(gt,sn)}}},[He]),Pe=Tx(),Me=_.useState(null),dt=de(Me,2),rt=dt[0],it=dt[1],st=_.useRef(null),at=dr(function($e){st.current=$e,bf($e)&&rt!==$e&&it($e),He==null||He.registerSubPopup(Pe,$e)}),Je=_.useState(null),lt=de(Je,2),ft=lt[0],ct=lt[1],mt=_.useRef(null),xt=dr(function($e){bf($e)&&ft!==$e&&(ct($e),mt.current=$e)}),Bt=_.Children.only(l),ht=(Bt==null?void 0:Bt.props)||{},Vt={},qt=dr(function($e){var gt,sn,fn=ft;return(fn==null?void 0:fn.contains($e))||((gt=ag(fn))===null||gt===void 0?void 0:gt.host)===$e||$e===fn||(rt==null?void 0:rt.contains($e))||((sn=ag(rt))===null||sn===void 0?void 0:sn.host)===$e||$e===rt||Object.values(nt.current).some(function(Cn){return(Cn==null?void 0:Cn.contains($e))||$e===Cn})}),En=f2(s,fe,Ae,we),Mn=f2(s,ye,ve,Te),Ut=_.useState(v||!1),It=de(Ut,2),Lt=It[0],Jt=It[1],Mt=m??Lt,qe=dr(function($e){m===void 0&&Jt($e)});Dn(function(){Jt(m||!1)},[m]);var ke=_.useRef(Mt);ke.current=Mt;var Ne=_.useRef([]);Ne.current=[];var wt=dr(function($e){var gt;qe($e),((gt=Ne.current[Ne.current.length-1])!==null&&gt!==void 0?gt:Mt)!==$e&&(Ne.current.push($e),S==null||S($e))}),en=_.useRef(),Ue=function(){clearTimeout(en.current)},Oe=function(gt){var sn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Ue(),sn===0?wt(gt):en.current=setTimeout(function(){wt(gt)},sn*1e3)};_.useEffect(function(){return Ue},[]);var je=_.useState(!1),Ye=de(je,2),We=Ye[0],Qe=Ye[1];Dn(function($e){(!$e||Mt)&&Qe(!0)},[Mt]);var bt=_.useState(null),_t=de(bt,2),Zt=_t[0],Yt=_t[1],vn=_.useState(null),On=de(vn,2),_n=On[0],Zn=On[1],un=function(gt){Zn([gt.clientX,gt.clientY])},rn=aL(Mt,rt,ie&&_n!==null?_n:ft,Y,U,z,q),Ce=de(rn,11),Le=Ce[0],De=Ce[1],be=Ce[2],ut=Ce[3],zt=Ce[4],Ot=Ce[5],In=Ce[6],tn=Ce[7],Vn=Ce[8],Pn=Ce[9],Bn=Ce[10],Nr=rL(Fe,f,d,g),er=de(Nr,2),Un=er[0],Tn=er[1],Qn=Un.has("click"),Di=Tn.has("click")||Tn.has("contextMenu"),Wr=dr(function(){We||Bn()}),Fi=function(){ke.current&&ie&&Di&&Oe(!1)};oL(Mt,ft,rt,Wr,Fi),Dn(function(){Wr()},[_n,Y]),Dn(function(){Mt&&!(U!=null&&U[Y])&&Wr()},[JSON.stringify(z)]);var ki=_.useMemo(function(){var $e=sL(U,s,Pn,ie);return Ze($e,P==null?void 0:P(Pn))},[Pn,P,U,s,ie]);_.useImperativeHandle(r,function(){return{nativeElement:mt.current,popupElement:st.current,forceAlign:Wr}});var Tt=_.useState(0),yt=de(Tt,2),nn=yt[0],Hn=yt[1],An=_.useState(0),Nn=de(An,2),tr=Nn[0],Sr=Nn[1],Lr=function(){if(Z&&ft){var gt=ft.getBoundingClientRect();Hn(gt.width),Sr(gt.height)}},wr=function(){Lr(),Wr()},Gr=function(gt){Qe(!1),Bn(),E==null||E(gt)},Jr=function(){return new Promise(function(gt){Lr(),Yt(function(){return gt})})};Dn(function(){Zt&&(Bn(),Zt(),Yt(null))},[Zt]);function pr($e,gt,sn,fn){Vt[$e]=function(Cn){var Ts;fn==null||fn(Cn),Oe(gt,sn);for(var sl=arguments.length,Wa=new Array(sl>1?sl-1:0),As=1;As<sl;As++)Wa[As-1]=arguments[As];(Ts=ht[$e])===null||Ts===void 0||Ts.call.apply(Ts,[ht,Cn].concat(Wa))}}(Qn||Di)&&(Vt.onClick=function($e){var gt;ke.current&&Di?Oe(!1):!ke.current&&Qn&&(un($e),Oe(!0));for(var sn=arguments.length,fn=new Array(sn>1?sn-1:0),Cn=1;Cn<sn;Cn++)fn[Cn-1]=arguments[Cn];(gt=ht.onClick)===null||gt===void 0||gt.call.apply(gt,[ht,$e].concat(fn))});var Ha=lL(Mt,Di,ft,rt,M,N,qt,Oe),Xr=Un.has("hover"),nl=Tn.has("hover"),Bi,di;Xr&&(pr("onMouseEnter",!0,w,function($e){un($e)}),pr("onPointerEnter",!0,w,function($e){un($e)}),Bi=function(gt){(Mt||We)&&rt!==null&&rt!==void 0&&rt.contains(gt.target)&&Oe(!0,w)},ie&&(Vt.onMouseMove=function($e){var gt;(gt=ht.onMouseMove)===null||gt===void 0||gt.call(ht,$e)})),nl&&(pr("onMouseLeave",!1,A),pr("onPointerLeave",!1,A),di=function(){Oe(!1,A)}),Un.has("focus")&&pr("onFocus",!0,T),Tn.has("focus")&&pr("onBlur",!1,C),Un.has("contextMenu")&&(Vt.onContextMenu=function($e){var gt;ke.current&&Tn.has("contextMenu")?Oe(!1):(un($e),Oe(!0)),$e.preventDefault();for(var sn=arguments.length,fn=new Array(sn>1?sn-1:0),Cn=1;Cn<sn;Cn++)fn[Cn-1]=arguments[Cn];(gt=ht.onContextMenu)===null||gt===void 0||gt.call.apply(gt,[ht,$e].concat(fn))}),ge&&(Vt.className=Ze(ht.className,ge));var hi=J(J({},ht),Vt),gi={},Ui=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Ui.forEach(function($e){Ie[$e]&&(gi[$e]=function(){for(var gt,sn=arguments.length,fn=new Array(sn),Cn=0;Cn<sn;Cn++)fn[Cn]=arguments[Cn];(gt=hi[$e])===null||gt===void 0||gt.call.apply(gt,[hi].concat(fn)),Ie[$e].apply(Ie,fn)})});var rl=_.cloneElement(Bt,J(J({},hi),gi)),ja={x:Ot,y:In},il=ce?J({},ce!==!0?ce:{}):null;return _.createElement(_.Fragment,null,_.createElement(Go,{disabled:!Mt,ref:xt,onResize:wr},_.createElement(nL,{getTriggerDOMNode:_e},rl)),_.createElement(c2.Provider,{value:Ge},_.createElement(tL,{portal:t,ref:at,prefixCls:s,popup:B,className:Ze(j,ki),style:X,target:ft,onMouseEnter:Bi,onMouseLeave:di,onPointerEnter:Bi,zIndex:W,open:Mt,keepDom:We,fresh:$,onClick:se,onPointerDownCapture:Ha,mask:M,motion:En,maskMotion:Mn,onVisibleChanged:Gr,onPrepare:Jr,forceRender:L,autoDestroy:Ee,getPopupContainer:F,align:Pn,arrow:il,arrowPos:ja,ready:Le,offsetX:De,offsetY:be,offsetR:ut,offsetB:zt,onAlign:Wr,stretch:Z,targetWidth:nn/tn,targetHeight:tr/Vn})))});return e}const zx=uL(Ex);var fL=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],dL=function(e){var n=e===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"}}},hL=function(e,n){var r=e.prefixCls;e.disabled;var i=e.visible,s=e.children,l=e.popupElement,c=e.animation,f=e.transitionName,d=e.dropdownStyle,g=e.dropdownClassName,m=e.direction,v=m===void 0?"ltr":m,S=e.placement,E=e.builtinPlacements,w=e.dropdownMatchSelectWidth,b=e.dropdownRender,A=e.dropdownAlign,T=e.getPopupContainer,C=e.empty,M=e.getTriggerDOMNode,x=e.onPopupVisibleChange,N=e.onPopupMouseEnter,F=Fn(e,fL),L="".concat(r,"-dropdown"),I=l;b&&(I=b(l));var V=_.useMemo(function(){return E||dL(w)},[E,w]),B=c?"".concat(L,"-").concat(c):f,j=typeof w=="number",X=_.useMemo(function(){return j?null:w===!1?"minWidth":"width"},[w,j]),Y=d;j&&(Y=J(J({},Y),{},{width:w}));var ae=_.useRef(null);return _.useImperativeHandle(n,function(){return{getPopupElement:function(){var z;return(z=ae.current)===null||z===void 0?void 0:z.popupElement}}}),_.createElement(zx,kt({},F,{showAction:x?["click"]:[],hideAction:x?["click"]:[],popupPlacement:S||(v==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:V,prefixCls:L,popupTransitionName:B,popup:_.createElement("div",{onMouseEnter:N},I),ref:ae,stretch:X,popupAlign:A,popupVisible:i,getPopupContainer:T,popupClassName:Ze(g,K({},"".concat(L,"-empty"),C)),popupStyle:Y,getTriggerDOMNode:M,onPopupVisibleChange:x}),s)},gL=_.forwardRef(hL);function m2(t,e){var n=t.key,r;return"value"in t&&(r=t.value),n??(r!==void 0?r:"rc-index-key-".concat(e))}function U_(t){return typeof t<"u"&&!Number.isNaN(t)}function $x(t,e){var n=t||{},r=n.label,i=n.value,s=n.options,l=n.groupLabel,c=r||(e?"children":"label");return{label:c,value:i||"value",options:s||"options",groupLabel:l||c}}function pL(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.fieldNames,r=e.childrenAsData,i=[],s=$x(n,!1),l=s.label,c=s.value,f=s.options,d=s.groupLabel;function g(m,v){Array.isArray(m)&&m.forEach(function(S){if(v||!(f in S)){var E=S[c];i.push({key:m2(S,i.length),groupOption:v,data:S,label:S[l],value:E})}else{var w=S[d];w===void 0&&r&&(w=S.label),i.push({key:m2(S,i.length),group:!0,data:S,label:w}),g(S[f],!0)}})}return g(t,!1),i}function L_(t){var e=J({},t);return"props"in e||Object.defineProperty(e,"props",{get:function(){return Ur(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}var mL=function(e,n,r){if(!n||!n.length)return null;var i=!1,s=function c(f,d){var g=N3(d),m=g[0],v=g.slice(1);if(!m)return[f];var S=f.split(m);return i=i||S.length>1,S.reduce(function(E,w){return[].concat(ze(E),ze(c(w,v)))},[]).filter(Boolean)},l=s(e,n);return i?typeof r<"u"?l.slice(0,r):l:null},mb=_.createContext(null);function vL(t){var e=t.visible,n=t.values;if(!e)return null;var r=50;return _.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(n.slice(0,r).map(function(i){var s=i.label,l=i.value;return["number","string"].includes(pt(s))?s:l}).join(", ")),n.length>r?", ...":null)}var _L=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],yL=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],z_=function(e){return e==="tags"||e==="multiple"},bL=_.forwardRef(function(t,e){var n,r=t.id,i=t.prefixCls,s=t.className,l=t.showSearch,c=t.tagRender,f=t.direction,d=t.omitDomProps,g=t.displayValues,m=t.onDisplayValuesChange,v=t.emptyOptions,S=t.notFoundContent,E=S===void 0?"Not Found":S,w=t.onClear,b=t.mode,A=t.disabled,T=t.loading,C=t.getInputElement,M=t.getRawInputElement,x=t.open,N=t.defaultOpen,F=t.onDropdownVisibleChange,L=t.activeValue,I=t.onActiveValueChange,V=t.activeDescendantId,B=t.searchValue,j=t.autoClearSearchValue,X=t.onSearch,Y=t.onSearchSplit,ae=t.tokenSeparators,U=t.allowClear,z=t.prefix,W=t.suffixIcon,Z=t.clearIcon,P=t.OptionList,$=t.animation,ie=t.transitionName,se=t.dropdownStyle,q=t.dropdownClassName,ce=t.dropdownMatchSelectWidth,fe=t.dropdownRender,ye=t.dropdownAlign,we=t.placement,Ae=t.builtinPlacements,Te=t.getPopupContainer,ve=t.showAction,ge=ve===void 0?[]:ve,_e=t.onFocus,Ie=t.onBlur,Ee=t.onKeyUp,xe=t.onKeyDown,Ve=t.onMouseDown,Fe=Fn(t,_L),Be=z_(b),nt=(l!==void 0?l:Be)||b==="combobox",He=J({},Fe);yL.forEach(function(Tt){delete He[Tt]}),d==null||d.forEach(function(Tt){delete He[Tt]});var Ge=_.useState(!1),Pe=de(Ge,2),Me=Pe[0],dt=Pe[1];_.useEffect(function(){dt(Px())},[]);var rt=_.useRef(null),it=_.useRef(null),st=_.useRef(null),at=_.useRef(null),Je=_.useRef(null),lt=_.useRef(!1),ft=RU(),ct=de(ft,3),mt=ct[0],xt=ct[1],Bt=ct[2];_.useImperativeHandle(e,function(){var Tt,yt;return{focus:(Tt=at.current)===null||Tt===void 0?void 0:Tt.focus,blur:(yt=at.current)===null||yt===void 0?void 0:yt.blur,scrollTo:function(Hn){var An;return(An=Je.current)===null||An===void 0?void 0:An.scrollTo(Hn)},nativeElement:rt.current||it.current}});var ht=_.useMemo(function(){var Tt;if(b!=="combobox")return B;var yt=(Tt=g[0])===null||Tt===void 0?void 0:Tt.value;return typeof yt=="string"||typeof yt=="number"?String(yt):""},[B,b,g]),Vt=b==="combobox"&&typeof C=="function"&&C()||null,qt=typeof M=="function"&&M(),En=lp(it,qt==null||(n=qt.props)===null||n===void 0?void 0:n.ref),Mn=_.useState(!1),Ut=de(Mn,2),It=Ut[0],Lt=Ut[1];Dn(function(){Lt(!0)},[]);var Jt=xc(!1,{defaultValue:N,value:x}),Mt=de(Jt,2),qe=Mt[0],ke=Mt[1],Ne=It?qe:!1,wt=!E&&v;(A||wt&&Ne&&b==="combobox")&&(Ne=!1);var en=wt?!1:Ne,Ue=_.useCallback(function(Tt){var yt=Tt!==void 0?Tt:!Ne;A||(ke(yt),Ne!==yt&&(F==null||F(yt)))},[A,Ne,ke,F]),Oe=_.useMemo(function(){return(ae||[]).some(function(Tt){return[`
`,`\r
`].includes(Tt)})},[ae]),je=_.useContext(mb)||{},Ye=je.maxCount,We=je.rawValues,Qe=function(yt,nn,Hn){if(!(Be&&U_(Ye)&&(We==null?void 0:We.size)>=Ye)){var An=!0,Nn=yt;I==null||I(null);var tr=mL(yt,ae,U_(Ye)?Ye-We.size:void 0),Sr=Hn?null:tr;return b!=="combobox"&&Sr&&(Nn="",Y==null||Y(Sr),Ue(!1),An=!1),X&&ht!==Nn&&X(Nn,{source:nn?"typing":"effect"}),An}},bt=function(yt){!yt||!yt.trim()||X(yt,{source:"submit"})};_.useEffect(function(){!Ne&&!Be&&b!=="combobox"&&Qe("",!1,!1)},[Ne]),_.useEffect(function(){qe&&A&&ke(!1),A&&!lt.current&&xt(!1)},[A]);var _t=Ix(),Zt=de(_t,2),Yt=Zt[0],vn=Zt[1],On=_.useRef(!1),_n=function(yt){var nn=Yt(),Hn=yt.key,An=Hn==="Enter";if(An&&(b!=="combobox"&&yt.preventDefault(),Ne||Ue(!0)),vn(!!ht),Hn==="Backspace"&&!nn&&Be&&!ht&&g.length){for(var Nn=ze(g),tr=null,Sr=Nn.length-1;Sr>=0;Sr-=1){var Lr=Nn[Sr];if(!Lr.disabled){Nn.splice(Sr,1),tr=Lr;break}}tr&&m(Nn,{type:"remove",values:[tr]})}for(var wr=arguments.length,Gr=new Array(wr>1?wr-1:0),Jr=1;Jr<wr;Jr++)Gr[Jr-1]=arguments[Jr];if(Ne&&(!An||!On.current)){var pr;An&&(On.current=!0),(pr=Je.current)===null||pr===void 0||pr.onKeyDown.apply(pr,[yt].concat(Gr))}xe==null||xe.apply(void 0,[yt].concat(Gr))},Zn=function(yt){for(var nn=arguments.length,Hn=new Array(nn>1?nn-1:0),An=1;An<nn;An++)Hn[An-1]=arguments[An];if(Ne){var Nn;(Nn=Je.current)===null||Nn===void 0||Nn.onKeyUp.apply(Nn,[yt].concat(Hn))}yt.key==="Enter"&&(On.current=!1),Ee==null||Ee.apply(void 0,[yt].concat(Hn))},un=function(yt){var nn=g.filter(function(Hn){return Hn!==yt});m(nn,{type:"remove",values:[yt]})},rn=function(){On.current=!1},Ce=_.useRef(!1),Le=function(){xt(!0),A||(_e&&!Ce.current&&_e.apply(void 0,arguments),ge.includes("focus")&&Ue(!0)),Ce.current=!0},De=function(){lt.current=!0,xt(!1,function(){Ce.current=!1,lt.current=!1,Ue(!1)}),!A&&(ht&&(b==="tags"?X(ht,{source:"submit"}):b==="multiple"&&X("",{source:"blur"})),Ie&&Ie.apply(void 0,arguments))},be=[];_.useEffect(function(){return function(){be.forEach(function(Tt){return clearTimeout(Tt)}),be.splice(0,be.length)}},[]);var ut=function(yt){var nn,Hn=yt.target,An=(nn=st.current)===null||nn===void 0?void 0:nn.getPopupElement();if(An&&An.contains(Hn)){var Nn=setTimeout(function(){var wr=be.indexOf(Nn);if(wr!==-1&&be.splice(wr,1),Bt(),!Me&&!An.contains(document.activeElement)){var Gr;(Gr=at.current)===null||Gr===void 0||Gr.focus()}});be.push(Nn)}for(var tr=arguments.length,Sr=new Array(tr>1?tr-1:0),Lr=1;Lr<tr;Lr++)Sr[Lr-1]=arguments[Lr];Ve==null||Ve.apply(void 0,[yt].concat(Sr))},zt=_.useState({}),Ot=de(zt,2),In=Ot[1];function tn(){In({})}var Vn;qt&&(Vn=function(yt){Ue(yt)}),xU(function(){var Tt;return[rt.current,(Tt=st.current)===null||Tt===void 0?void 0:Tt.getPopupElement()]},en,Ue,!!qt);var Pn=_.useMemo(function(){return J(J({},t),{},{notFoundContent:E,open:Ne,triggerOpen:en,id:r,showSearch:nt,multiple:Be,toggleOpen:Ue})},[t,E,en,Ne,r,nt,Be,Ue]),Bn=!!W||T,Nr;Bn&&(Nr=_.createElement(pp,{className:Ze("".concat(i,"-arrow"),K({},"".concat(i,"-arrow-loading"),T)),customizeIcon:W,customizeIconProps:{loading:T,searchValue:ht,open:Ne,focused:mt,showSearch:nt}}));var er=function(){var yt;w==null||w(),(yt=at.current)===null||yt===void 0||yt.focus(),m([],{type:"clear",values:g}),Qe("",!1,!1)},Un=AU(i,er,g,U,Z,A,ht,b),Tn=Un.allowClear,Qn=Un.clearIcon,Di=_.createElement(P,{ref:Je}),Wr=Ze(i,s,K(K(K(K(K(K(K(K(K(K({},"".concat(i,"-focused"),mt),"".concat(i,"-multiple"),Be),"".concat(i,"-single"),!Be),"".concat(i,"-allow-clear"),U),"".concat(i,"-show-arrow"),Bn),"".concat(i,"-disabled"),A),"".concat(i,"-loading"),T),"".concat(i,"-open"),Ne),"".concat(i,"-customize-input"),Vt),"".concat(i,"-show-search"),nt)),Fi=_.createElement(gL,{ref:st,disabled:A,prefixCls:i,visible:en,popupElement:Di,animation:$,transitionName:ie,dropdownStyle:se,dropdownClassName:q,direction:f,dropdownMatchSelectWidth:ce,dropdownRender:fe,dropdownAlign:ye,placement:we,builtinPlacements:Ae,getPopupContainer:Te,empty:v,getTriggerDOMNode:function(yt){return it.current||yt},onPopupVisibleChange:Vn,onPopupMouseEnter:tn},qt?_.cloneElement(qt,{ref:En}):_.createElement(QU,kt({},t,{domRef:it,prefixCls:i,inputElement:Vt,ref:at,id:r,prefix:z,showSearch:nt,autoClearSearchValue:j,mode:b,activeDescendantId:V,tagRender:c,values:g,open:Ne,onToggleOpen:Ue,activeValue:L,searchValue:ht,onSearch:Qe,onSearchSubmit:bt,onRemove:un,tokenWithEnter:Oe,onInputBlur:rn}))),ki;return qt?ki=Fi:ki=_.createElement("div",kt({className:Wr},He,{ref:rt,onMouseDown:ut,onKeyDown:_n,onKeyUp:Zn,onFocus:Le,onBlur:De}),_.createElement(vL,{visible:mt&&!Ne,values:g}),Fi,Nr,Tn&&Qn),_.createElement(Nx.Provider,{value:Pn},ki)}),vb=function(){return null};vb.isSelectOptGroup=!0;var _b=function(){return null};_b.isSelectOption=!0;var Vx=_.forwardRef(function(t,e){var n=t.height,r=t.offsetY,i=t.offsetX,s=t.children,l=t.prefixCls,c=t.onInnerResize,f=t.innerProps,d=t.rtl,g=t.extra,m={},v={display:"flex",flexDirection:"column"};return r!==void 0&&(m={height:n,position:"relative",overflow:"hidden"},v=J(J({},v),{},K(K(K(K(K({transform:"translateY(".concat(r,"px)")},d?"marginRight":"marginLeft",-i),"position","absolute"),"left",0),"right",0),"top",0))),_.createElement("div",{style:m},_.createElement(Go,{onResize:function(E){var w=E.offsetHeight;w&&c&&c()}},_.createElement("div",kt({style:v,className:Ze(K({},"".concat(l,"-holder-inner"),l)),ref:e},f),s,g)))});Vx.displayName="Filler";function SL(t){var e=t.children,n=t.setRef,r=_.useCallback(function(i){n(i)},[]);return _.cloneElement(e,{ref:r})}function wL(t,e,n,r,i,s,l,c){var f=c.getKey;return t.slice(e,n+1).map(function(d,g){var m=e+g,v=l(d,m,{style:{width:r},offsetX:i}),S=f(d);return _.createElement(SL,{key:S,setRef:function(w){return s(d,w)}},v)})}function EL(t,e,n){var r=t.length,i=e.length,s,l;if(r===0&&i===0)return null;r<i?(s=t,l=e):(s=e,l=t);var c={__EMPTY_ITEM__:!0};function f(E){return E!==void 0?n(E):c}for(var d=null,g=Math.abs(r-i)!==1,m=0;m<l.length;m+=1){var v=f(s[m]),S=f(l[m]);if(v!==S){d=m,g=g||v!==f(l[m+1]);break}}return d===null?null:{index:d,multiple:g}}function TL(t,e,n){var r=_.useState(t),i=de(r,2),s=i[0],l=i[1],c=_.useState(null),f=de(c,2),d=f[0],g=f[1];return _.useEffect(function(){var m=EL(s||[],t||[],e);(m==null?void 0:m.index)!==void 0&&g(t[m.index]),l(t)},[t]),[d]}var v2=(typeof navigator>"u"?"undefined":pt(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const Hx=function(t,e,n,r){var i=_.useRef(!1),s=_.useRef(null);function l(){clearTimeout(s.current),i.current=!0,s.current=setTimeout(function(){i.current=!1},50)}var c=_.useRef({top:t,bottom:e,left:n,right:r});return c.current.top=t,c.current.bottom=e,c.current.left=n,c.current.right=r,function(f,d){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,m=f?d<0&&c.current.left||d>0&&c.current.right:d<0&&c.current.top||d>0&&c.current.bottom;return g&&m?(clearTimeout(s.current),i.current=!1):(!m||i.current)&&l(),!i.current&&m}};function AL(t,e,n,r,i,s,l){var c=_.useRef(0),f=_.useRef(null),d=_.useRef(null),g=_.useRef(!1),m=Hx(e,n,r,i);function v(T,C){if(hr.cancel(f.current),!m(!1,C)){var M=T;if(!M._virtualHandled)M._virtualHandled=!0;else return;c.current+=C,d.current=C,v2||M.preventDefault(),f.current=hr(function(){var x=g.current?10:1;l(c.current*x,!1),c.current=0})}}function S(T,C){l(C,!0),v2||T.preventDefault()}var E=_.useRef(null),w=_.useRef(null);function b(T){if(t){hr.cancel(w.current),w.current=hr(function(){E.current=null},2);var C=T.deltaX,M=T.deltaY,x=T.shiftKey,N=C,F=M;(E.current==="sx"||!E.current&&x&&M&&!C)&&(N=M,F=0,E.current="sx");var L=Math.abs(N),I=Math.abs(F);E.current===null&&(E.current=s&&L>I?"x":"y"),E.current==="y"?v(T,F):S(T,N)}}function A(T){t&&(g.current=T.detail===d.current)}return[b,A]}function CL(t,e,n,r){var i=_.useMemo(function(){return[new Map,[]]},[t,n.id,r]),s=de(i,2),l=s[0],c=s[1],f=function(g){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,v=l.get(g),S=l.get(m);if(v===void 0||S===void 0)for(var E=t.length,w=c.length;w<E;w+=1){var b,A=t[w],T=e(A);l.set(T,w);var C=(b=n.get(T))!==null&&b!==void 0?b:r;if(c[w]=(c[w-1]||0)+C,T===g&&(v=w),T===m&&(S=w),v!==void 0&&S!==void 0)break}return{top:c[v-1]||0,bottom:c[S]}};return f}var RL=function(){function t(){Or(this,t),K(this,"maps",void 0),K(this,"id",0),K(this,"diffKeys",new Set),this.maps=Object.create(null)}return Pr(t,[{key:"set",value:function(n,r){this.maps[n]=r,this.id+=1,this.diffKeys.add(n)}},{key:"get",value:function(n){return this.maps[n]}},{key:"resetRecord",value:function(){this.diffKeys.clear()}},{key:"getRecord",value:function(){return this.diffKeys}}]),t}();function _2(t){var e=parseFloat(t);return isNaN(e)?0:e}function xL(t,e,n){var r=_.useState(0),i=de(r,2),s=i[0],l=i[1],c=_.useRef(new Map),f=_.useRef(new RL),d=_.useRef(0);function g(){d.current+=1}function m(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;g();var E=function(){var A=!1;c.current.forEach(function(T,C){if(T&&T.offsetParent){var M=rf(T),x=M.offsetHeight,N=getComputedStyle(M),F=N.marginTop,L=N.marginBottom,I=_2(F),V=_2(L),B=x+I+V;f.current.get(C)!==B&&(f.current.set(C,B),A=!0)}}),A&&l(function(T){return T+1})};if(S)E();else{d.current+=1;var w=d.current;Promise.resolve().then(function(){w===d.current&&E()})}}function v(S,E){var w=t(S);c.current.get(w),E?(c.current.set(w,E),m()):c.current.delete(w)}return _.useEffect(function(){return g},[]),[v,m,f.current,s]}var y2=14/15;function ML(t,e,n){var r=_.useRef(!1),i=_.useRef(0),s=_.useRef(0),l=_.useRef(null),c=_.useRef(null),f,d=function(S){if(r.current){var E=Math.ceil(S.touches[0].pageX),w=Math.ceil(S.touches[0].pageY),b=i.current-E,A=s.current-w,T=Math.abs(b)>Math.abs(A);T?i.current=E:s.current=w;var C=n(T,T?b:A,!1,S);C&&S.preventDefault(),clearInterval(c.current),C&&(c.current=setInterval(function(){T?b*=y2:A*=y2;var M=Math.floor(T?b:A);(!n(T,M,!0)||Math.abs(M)<=.1)&&clearInterval(c.current)},16))}},g=function(){r.current=!1,f()},m=function(S){f(),S.touches.length===1&&!r.current&&(r.current=!0,i.current=Math.ceil(S.touches[0].pageX),s.current=Math.ceil(S.touches[0].pageY),l.current=S.target,l.current.addEventListener("touchmove",d,{passive:!1}),l.current.addEventListener("touchend",g,{passive:!0}))};f=function(){l.current&&(l.current.removeEventListener("touchmove",d),l.current.removeEventListener("touchend",g))},Dn(function(){return t&&e.current.addEventListener("touchstart",m,{passive:!0}),function(){var v;(v=e.current)===null||v===void 0||v.removeEventListener("touchstart",m),f(),clearInterval(c.current)}},[t])}function b2(t){return Math.floor(Math.pow(t,.5))}function $_(t,e){var n="touches"in t?t.touches[0]:t;return n[e?"pageX":"pageY"]-window[e?"scrollX":"scrollY"]}function OL(t,e,n){_.useEffect(function(){var r=e.current;if(t&&r){var i=!1,s,l,c=function(){hr.cancel(s)},f=function v(){c(),s=hr(function(){n(l),v()})},d=function(S){if(!S.target.draggable){var E=S;E._virtualHandled||(E._virtualHandled=!0,i=!0)}},g=function(){i=!1,c()},m=function(S){if(i){var E=$_(S,!1),w=r.getBoundingClientRect(),b=w.top,A=w.bottom;if(E<=b){var T=b-E;l=-b2(T),f()}else if(E>=A){var C=E-A;l=b2(C),f()}else c()}};return r.addEventListener("mousedown",d),r.ownerDocument.addEventListener("mouseup",g),r.ownerDocument.addEventListener("mousemove",m),function(){r.removeEventListener("mousedown",d),r.ownerDocument.removeEventListener("mouseup",g),r.ownerDocument.removeEventListener("mousemove",m),c()}}},[t])}var PL=10;function NL(t,e,n,r,i,s,l,c){var f=_.useRef(),d=_.useState(null),g=de(d,2),m=g[0],v=g[1];return Dn(function(){if(m&&m.times<PL){if(!t.current){v(function(Z){return J({},Z)});return}s();var S=m.targetAlign,E=m.originAlign,w=m.index,b=m.offset,A=t.current.clientHeight,T=!1,C=S,M=null;if(A){for(var x=S||E,N=0,F=0,L=0,I=Math.min(e.length-1,w),V=0;V<=I;V+=1){var B=i(e[V]);F=N;var j=n.get(B);L=F+(j===void 0?r:j),N=L}for(var X=x==="top"?b:A-b,Y=I;Y>=0;Y-=1){var ae=i(e[Y]),U=n.get(ae);if(U===void 0){T=!0;break}if(X-=U,X<=0)break}switch(x){case"top":M=F-b;break;case"bottom":M=L-A+b;break;default:{var z=t.current.scrollTop,W=z+A;F<z?C="top":L>W&&(C="bottom")}}M!==null&&l(M),M!==m.lastTop&&(T=!0)}T&&v(J(J({},m),{},{times:m.times+1,targetAlign:C,lastTop:M}))}},[m,t.current]),function(S){if(S==null){c();return}if(hr.cancel(f.current),typeof S=="number")l(S);else if(S&&pt(S)==="object"){var E,w=S.align;"index"in S?E=S.index:E=e.findIndex(function(T){return i(T)===S.key});var b=S.offset,A=b===void 0?0:b;v({times:0,index:E,offset:A,originAlign:w})}}}var S2=_.forwardRef(function(t,e){var n=t.prefixCls,r=t.rtl,i=t.scrollOffset,s=t.scrollRange,l=t.onStartMove,c=t.onStopMove,f=t.onScroll,d=t.horizontal,g=t.spinSize,m=t.containerSize,v=t.style,S=t.thumbStyle,E=t.showScrollBar,w=_.useState(!1),b=de(w,2),A=b[0],T=b[1],C=_.useState(null),M=de(C,2),x=M[0],N=M[1],F=_.useState(null),L=de(F,2),I=L[0],V=L[1],B=!r,j=_.useRef(),X=_.useRef(),Y=_.useState(E),ae=de(Y,2),U=ae[0],z=ae[1],W=_.useRef(),Z=function(){E===!0||E===!1||(clearTimeout(W.current),z(!0),W.current=setTimeout(function(){z(!1)},3e3))},P=s-m||0,$=m-g||0,ie=_.useMemo(function(){if(i===0||P===0)return 0;var ve=i/P;return ve*$},[i,P,$]),se=function(ge){ge.stopPropagation(),ge.preventDefault()},q=_.useRef({top:ie,dragging:A,pageY:x,startTop:I});q.current={top:ie,dragging:A,pageY:x,startTop:I};var ce=function(ge){T(!0),N($_(ge,d)),V(q.current.top),l(),ge.stopPropagation(),ge.preventDefault()};_.useEffect(function(){var ve=function(Ee){Ee.preventDefault()},ge=j.current,_e=X.current;return ge.addEventListener("touchstart",ve,{passive:!1}),_e.addEventListener("touchstart",ce,{passive:!1}),function(){ge.removeEventListener("touchstart",ve),_e.removeEventListener("touchstart",ce)}},[]);var fe=_.useRef();fe.current=P;var ye=_.useRef();ye.current=$,_.useEffect(function(){if(A){var ve,ge=function(Ee){var xe=q.current,Ve=xe.dragging,Fe=xe.pageY,Be=xe.startTop;hr.cancel(ve);var nt=j.current.getBoundingClientRect(),He=m/(d?nt.width:nt.height);if(Ve){var Ge=($_(Ee,d)-Fe)*He,Pe=Be;!B&&d?Pe-=Ge:Pe+=Ge;var Me=fe.current,dt=ye.current,rt=dt?Pe/dt:0,it=Math.ceil(rt*Me);it=Math.max(it,0),it=Math.min(it,Me),ve=hr(function(){f(it,d)})}},_e=function(){T(!1),c()};return window.addEventListener("mousemove",ge,{passive:!0}),window.addEventListener("touchmove",ge,{passive:!0}),window.addEventListener("mouseup",_e,{passive:!0}),window.addEventListener("touchend",_e,{passive:!0}),function(){window.removeEventListener("mousemove",ge),window.removeEventListener("touchmove",ge),window.removeEventListener("mouseup",_e),window.removeEventListener("touchend",_e),hr.cancel(ve)}}},[A]),_.useEffect(function(){return Z(),function(){clearTimeout(W.current)}},[i]),_.useImperativeHandle(e,function(){return{delayHidden:Z}});var we="".concat(n,"-scrollbar"),Ae={position:"absolute",visibility:U?null:"hidden"},Te={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return d?(Ae.height=8,Ae.left=0,Ae.right=0,Ae.bottom=0,Te.height="100%",Te.width=g,B?Te.left=ie:Te.right=ie):(Ae.width=8,Ae.top=0,Ae.bottom=0,B?Ae.right=0:Ae.left=0,Te.width="100%",Te.height=g,Te.top=ie),_.createElement("div",{ref:j,className:Ze(we,K(K(K({},"".concat(we,"-horizontal"),d),"".concat(we,"-vertical"),!d),"".concat(we,"-visible"),U)),style:J(J({},Ae),v),onMouseDown:se,onMouseMove:Z},_.createElement("div",{ref:X,className:Ze("".concat(we,"-thumb"),K({},"".concat(we,"-thumb-moving"),A)),style:J(J({},Te),S),onMouseDown:ce}))}),IL=20;function w2(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=t/e*t;return isNaN(n)&&(n=0),n=Math.max(n,IL),Math.floor(n)}var DL=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],FL=[],kL={overflowY:"auto",overflowAnchor:"none"};function BL(t,e){var n=t.prefixCls,r=n===void 0?"rc-virtual-list":n,i=t.className,s=t.height,l=t.itemHeight,c=t.fullHeight,f=c===void 0?!0:c,d=t.style,g=t.data,m=t.children,v=t.itemKey,S=t.virtual,E=t.direction,w=t.scrollWidth,b=t.component,A=b===void 0?"div":b,T=t.onScroll,C=t.onVirtualScroll,M=t.onVisibleChange,x=t.innerProps,N=t.extraRender,F=t.styles,L=t.showScrollBar,I=L===void 0?"optional":L,V=Fn(t,DL),B=_.useCallback(function(Ce){return typeof v=="function"?v(Ce):Ce==null?void 0:Ce[v]},[v]),j=xL(B),X=de(j,4),Y=X[0],ae=X[1],U=X[2],z=X[3],W=!!(S!==!1&&s&&l),Z=_.useMemo(function(){return Object.values(U.maps).reduce(function(Ce,Le){return Ce+Le},0)},[U.id,U.maps]),P=W&&g&&(Math.max(l*g.length,Z)>s||!!w),$=E==="rtl",ie=Ze(r,K({},"".concat(r,"-rtl"),$),i),se=g||FL,q=_.useRef(),ce=_.useRef(),fe=_.useRef(),ye=_.useState(0),we=de(ye,2),Ae=we[0],Te=we[1],ve=_.useState(0),ge=de(ve,2),_e=ge[0],Ie=ge[1],Ee=_.useState(!1),xe=de(Ee,2),Ve=xe[0],Fe=xe[1],Be=function(){Fe(!0)},nt=function(){Fe(!1)},He={getKey:B};function Ge(Ce){Te(function(Le){var De;typeof Ce=="function"?De=Ce(Le):De=Ce;var be=Lt(De);return q.current.scrollTop=be,be})}var Pe=_.useRef({start:0,end:se.length}),Me=_.useRef(),dt=TL(se,B),rt=de(dt,1),it=rt[0];Me.current=it;var st=_.useMemo(function(){if(!W)return{scrollHeight:void 0,start:0,end:se.length-1,offset:void 0};if(!P){var Ce;return{scrollHeight:((Ce=ce.current)===null||Ce===void 0?void 0:Ce.offsetHeight)||0,start:0,end:se.length-1,offset:void 0}}for(var Le=0,De,be,ut,zt=se.length,Ot=0;Ot<zt;Ot+=1){var In=se[Ot],tn=B(In),Vn=U.get(tn),Pn=Le+(Vn===void 0?l:Vn);Pn>=Ae&&De===void 0&&(De=Ot,be=Le),Pn>Ae+s&&ut===void 0&&(ut=Ot),Le=Pn}return De===void 0&&(De=0,be=0,ut=Math.ceil(s/l)),ut===void 0&&(ut=se.length-1),ut=Math.min(ut+1,se.length-1),{scrollHeight:Le,start:De,end:ut,offset:be}},[P,W,Ae,se,z,s]),at=st.scrollHeight,Je=st.start,lt=st.end,ft=st.offset;Pe.current.start=Je,Pe.current.end=lt,_.useLayoutEffect(function(){var Ce=U.getRecord();if(Ce.size===1){var Le=Array.from(Ce)[0],De=B(se[Je]);if(De===Le){var be=U.get(Le),ut=be-l;Ge(function(zt){return zt+ut})}}U.resetRecord()},[at]);var ct=_.useState({width:0,height:s}),mt=de(ct,2),xt=mt[0],Bt=mt[1],ht=function(Le){Bt({width:Le.offsetWidth,height:Le.offsetHeight})},Vt=_.useRef(),qt=_.useRef(),En=_.useMemo(function(){return w2(xt.width,w)},[xt.width,w]),Mn=_.useMemo(function(){return w2(xt.height,at)},[xt.height,at]),Ut=at-s,It=_.useRef(Ut);It.current=Ut;function Lt(Ce){var Le=Ce;return Number.isNaN(It.current)||(Le=Math.min(Le,It.current)),Le=Math.max(Le,0),Le}var Jt=Ae<=0,Mt=Ae>=Ut,qe=_e<=0,ke=_e>=w,Ne=Hx(Jt,Mt,qe,ke),wt=function(){return{x:$?-_e:_e,y:Ae}},en=_.useRef(wt()),Ue=dr(function(Ce){if(C){var Le=J(J({},wt()),Ce);(en.current.x!==Le.x||en.current.y!==Le.y)&&(C(Le),en.current=Le)}});function Oe(Ce,Le){var De=Ce;Le?($a.flushSync(function(){Ie(De)}),Ue()):Ge(De)}function je(Ce){var Le=Ce.currentTarget.scrollTop;Le!==Ae&&Ge(Le),T==null||T(Ce),Ue()}var Ye=function(Le){var De=Le,be=w?w-xt.width:0;return De=Math.max(De,0),De=Math.min(De,be),De},We=dr(function(Ce,Le){Le?($a.flushSync(function(){Ie(function(De){var be=De+($?-Ce:Ce);return Ye(be)})}),Ue()):Ge(function(De){var be=De+Ce;return be})}),Qe=AL(W,Jt,Mt,qe,ke,!!w,We),bt=de(Qe,2),_t=bt[0],Zt=bt[1];ML(W,q,function(Ce,Le,De,be){var ut=be;return Ne(Ce,Le,De)?!1:!ut||!ut._virtualHandled?(ut&&(ut._virtualHandled=!0),_t({preventDefault:function(){},deltaX:Ce?Le:0,deltaY:Ce?0:Le}),!0):!1}),OL(P,q,function(Ce){Ge(function(Le){return Le+Ce})}),Dn(function(){function Ce(De){var be=Jt&&De.detail<0,ut=Mt&&De.detail>0;W&&!be&&!ut&&De.preventDefault()}var Le=q.current;return Le.addEventListener("wheel",_t,{passive:!1}),Le.addEventListener("DOMMouseScroll",Zt,{passive:!0}),Le.addEventListener("MozMousePixelScroll",Ce,{passive:!1}),function(){Le.removeEventListener("wheel",_t),Le.removeEventListener("DOMMouseScroll",Zt),Le.removeEventListener("MozMousePixelScroll",Ce)}},[W,Jt,Mt]),Dn(function(){if(w){var Ce=Ye(_e);Ie(Ce),Ue({x:Ce})}},[xt.width,w]);var Yt=function(){var Le,De;(Le=Vt.current)===null||Le===void 0||Le.delayHidden(),(De=qt.current)===null||De===void 0||De.delayHidden()},vn=NL(q,se,U,l,B,function(){return ae(!0)},Ge,Yt);_.useImperativeHandle(e,function(){return{nativeElement:fe.current,getScrollInfo:wt,scrollTo:function(Le){function De(be){return be&&pt(be)==="object"&&("left"in be||"top"in be)}De(Le)?(Le.left!==void 0&&Ie(Ye(Le.left)),vn(Le.top)):vn(Le)}}}),Dn(function(){if(M){var Ce=se.slice(Je,lt+1);M(Ce,se)}},[Je,lt,se]);var On=CL(se,B,U,l),_n=N==null?void 0:N({start:Je,end:lt,virtual:P,offsetX:_e,offsetY:ft,rtl:$,getSize:On}),Zn=wL(se,Je,lt,w,_e,Y,m,He),un=null;s&&(un=J(K({},f?"height":"maxHeight",s),kL),W&&(un.overflowY="hidden",w&&(un.overflowX="hidden"),Ve&&(un.pointerEvents="none")));var rn={};return $&&(rn.dir="rtl"),_.createElement("div",kt({ref:fe,style:J(J({},d),{},{position:"relative"}),className:ie},rn,V),_.createElement(Go,{onResize:ht},_.createElement(A,{className:"".concat(r,"-holder"),style:un,ref:q,onScroll:je,onMouseEnter:Yt},_.createElement(Vx,{prefixCls:r,height:at,offsetX:_e,offsetY:ft,scrollWidth:w,onInnerResize:ae,ref:ce,innerProps:x,rtl:$,extra:_n},Zn))),P&&at>s&&_.createElement(S2,{ref:Vt,prefixCls:r,scrollOffset:Ae,scrollRange:at,rtl:$,onScroll:Oe,onStartMove:Be,onStopMove:nt,spinSize:Mn,containerSize:xt.height,style:F==null?void 0:F.verticalScrollBar,thumbStyle:F==null?void 0:F.verticalScrollBarThumb,showScrollBar:I}),P&&w>xt.width&&_.createElement(S2,{ref:qt,prefixCls:r,scrollOffset:_e,scrollRange:w,rtl:$,onScroll:Oe,onStartMove:Be,onStopMove:nt,spinSize:En,containerSize:xt.width,horizontal:!0,style:F==null?void 0:F.horizontalScrollBar,thumbStyle:F==null?void 0:F.horizontalScrollBarThumb,showScrollBar:I}))}var jx=_.forwardRef(BL);jx.displayName="List";function UL(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var LL=["disabled","title","children","style","className"];function E2(t){return typeof t=="string"||typeof t=="number"}var zL=function(e,n){var r=CU(),i=r.prefixCls,s=r.id,l=r.open,c=r.multiple,f=r.mode,d=r.searchValue,g=r.toggleOpen,m=r.notFoundContent,v=r.onPopupScroll,S=_.useContext(mb),E=S.maxCount,w=S.flattenOptions,b=S.onActiveValue,A=S.defaultActiveFirstOption,T=S.onSelect,C=S.menuItemSelectedIcon,M=S.rawValues,x=S.fieldNames,N=S.virtual,F=S.direction,L=S.listHeight,I=S.listItemHeight,V=S.optionRender,B="".concat(i,"-item"),j=ap(function(){return w},[l,w],function(ve,ge){return ge[0]&&ve[1]!==ge[1]}),X=_.useRef(null),Y=_.useMemo(function(){return c&&U_(E)&&(M==null?void 0:M.size)>=E},[c,E,M==null?void 0:M.size]),ae=function(ge){ge.preventDefault()},U=function(ge){var _e;(_e=X.current)===null||_e===void 0||_e.scrollTo(typeof ge=="number"?{index:ge}:ge)},z=_.useCallback(function(ve){return f==="combobox"?!1:M.has(ve)},[f,ze(M).toString(),M.size]),W=function(ge){for(var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ie=j.length,Ee=0;Ee<Ie;Ee+=1){var xe=(ge+Ee*_e+Ie)%Ie,Ve=j[xe]||{},Fe=Ve.group,Be=Ve.data;if(!Fe&&!(Be!=null&&Be.disabled)&&(z(Be.value)||!Y))return xe}return-1},Z=_.useState(function(){return W(0)}),P=de(Z,2),$=P[0],ie=P[1],se=function(ge){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;ie(ge);var Ie={source:_e?"keyboard":"mouse"},Ee=j[ge];if(!Ee){b(null,-1,Ie);return}b(Ee.value,ge,Ie)};_.useEffect(function(){se(A!==!1?W(0):-1)},[j.length,d]);var q=_.useCallback(function(ve){return f==="combobox"?String(ve).toLowerCase()===d.toLowerCase():M.has(ve)},[f,d,ze(M).toString(),M.size]);_.useEffect(function(){var ve=setTimeout(function(){if(!c&&l&&M.size===1){var _e=Array.from(M)[0],Ie=j.findIndex(function(Ee){var xe=Ee.data;return xe.value===_e});Ie!==-1&&(se(Ie),U(Ie))}});if(l){var ge;(ge=X.current)===null||ge===void 0||ge.scrollTo(void 0)}return function(){return clearTimeout(ve)}},[l,d]);var ce=function(ge){ge!==void 0&&T(ge,{selected:!M.has(ge)}),c||g(!1)};if(_.useImperativeHandle(n,function(){return{onKeyDown:function(ge){var _e=ge.which,Ie=ge.ctrlKey;switch(_e){case et.N:case et.P:case et.UP:case et.DOWN:{var Ee=0;if(_e===et.UP?Ee=-1:_e===et.DOWN?Ee=1:UL()&&Ie&&(_e===et.N?Ee=1:_e===et.P&&(Ee=-1)),Ee!==0){var xe=W($+Ee,Ee);U(xe),se(xe,!0)}break}case et.TAB:case et.ENTER:{var Ve,Fe=j[$];Fe&&!(Fe!=null&&(Ve=Fe.data)!==null&&Ve!==void 0&&Ve.disabled)&&!Y?ce(Fe.value):ce(void 0),l&&ge.preventDefault();break}case et.ESC:g(!1),l&&ge.stopPropagation()}},onKeyUp:function(){},scrollTo:function(ge){U(ge)}}}),j.length===0)return _.createElement("div",{role:"listbox",id:"".concat(s,"_list"),className:"".concat(B,"-empty"),onMouseDown:ae},m);var fe=Object.keys(x).map(function(ve){return x[ve]}),ye=function(ge){return ge.label};function we(ve,ge){var _e=ve.group;return{role:_e?"presentation":"option",id:"".concat(s,"_list_").concat(ge)}}var Ae=function(ge){var _e=j[ge];if(!_e)return null;var Ie=_e.data||{},Ee=Ie.value,xe=_e.group,Ve=og(Ie,!0),Fe=ye(_e);return _e?_.createElement("div",kt({"aria-label":typeof Fe=="string"&&!xe?Fe:null},Ve,{key:ge},we(_e,ge),{"aria-selected":q(Ee)}),Ee):null},Te={role:"listbox",id:"".concat(s,"_list")};return _.createElement(_.Fragment,null,N&&_.createElement("div",kt({},Te,{style:{height:0,width:0,overflow:"hidden"}}),Ae($-1),Ae($),Ae($+1)),_.createElement(jx,{itemKey:"key",ref:X,data:j,height:L,itemHeight:I,fullHeight:!1,onMouseDown:ae,onScroll:v,virtual:N,direction:F,innerProps:N?null:Te},function(ve,ge){var _e=ve.group,Ie=ve.groupOption,Ee=ve.data,xe=ve.label,Ve=ve.value,Fe=Ee.key;if(_e){var Be,nt=(Be=Ee.title)!==null&&Be!==void 0?Be:E2(xe)?xe.toString():void 0;return _.createElement("div",{className:Ze(B,"".concat(B,"-group"),Ee.className),title:nt},xe!==void 0?xe:Fe)}var He=Ee.disabled,Ge=Ee.title;Ee.children;var Pe=Ee.style,Me=Ee.className,dt=Fn(Ee,LL),rt=gx(dt,fe),it=z(Ve),st=He||!it&&Y,at="".concat(B,"-option"),Je=Ze(B,at,Me,K(K(K(K({},"".concat(at,"-grouped"),Ie),"".concat(at,"-active"),$===ge&&!st),"".concat(at,"-disabled"),st),"".concat(at,"-selected"),it)),lt=ye(ve),ft=!C||typeof C=="function"||it,ct=typeof lt=="number"?lt:lt||Ve,mt=E2(ct)?ct.toString():void 0;return Ge!==void 0&&(mt=Ge),_.createElement("div",kt({},og(rt),N?{}:we(ve,ge),{"aria-selected":q(Ve),className:Je,title:mt,onMouseMove:function(){$===ge||st||se(ge)},onClick:function(){st||ce(Ve)},style:Pe}),_.createElement("div",{className:"".concat(at,"-content")},typeof V=="function"?V(ve,{index:ge}):ct),_.isValidElement(C)||it,ft&&_.createElement(pp,{className:"".concat(B,"-option-state"),customizeIcon:C,customizeIconProps:{value:Ve,disabled:st,isSelected:it}},it?"✓":null))}))},$L=_.forwardRef(zL);const VL=function(t,e){var n=_.useRef({values:new Map,options:new Map}),r=_.useMemo(function(){var s=n.current,l=s.values,c=s.options,f=t.map(function(m){if(m.label===void 0){var v;return J(J({},m),{},{label:(v=l.get(m.value))===null||v===void 0?void 0:v.label})}return m}),d=new Map,g=new Map;return f.forEach(function(m){d.set(m.value,m),g.set(m.value,e.get(m.value)||c.get(m.value))}),n.current.values=d,n.current.options=g,f},[t,e]),i=_.useCallback(function(s){return e.get(s)||n.current.options.get(s)},[e]);return[r,i]};function Zv(t,e){return Ux(t).join("").toUpperCase().includes(e)}const HL=function(t,e,n,r,i){return _.useMemo(function(){if(!n||r===!1)return t;var s=e.options,l=e.label,c=e.value,f=[],d=typeof r=="function",g=n.toUpperCase(),m=d?r:function(S,E){return i?Zv(E[i],g):E[s]?Zv(E[l!=="children"?l:"label"],g):Zv(E[c],g)},v=d?function(S){return L_(S)}:function(S){return S};return t.forEach(function(S){if(S[s]){var E=m(n,v(S));if(E)f.push(S);else{var w=S[s].filter(function(b){return m(n,v(b))});w.length&&f.push(J(J({},S),{},K({},s,w)))}return}m(n,v(S))&&f.push(S)}),f},[t,r,i,n,e])};var T2=0,jL=Qr();function WL(){var t;return jL?(t=T2,T2+=1):t="TEST_OR_SSR",t}function XL(t){var e=_.useState(),n=de(e,2),r=n[0],i=n[1];return _.useEffect(function(){i("rc_select_".concat(WL()))},[]),t||r}var qL=["children","value"],YL=["children"];function KL(t){var e=t,n=e.key,r=e.props,i=r.children,s=r.value,l=Fn(r,qL);return J({key:n,value:s!==void 0?s:n,children:i},l)}function Wx(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Ho(t).map(function(n,r){if(!_.isValidElement(n)||!n.type)return null;var i=n,s=i.type.isSelectOptGroup,l=i.key,c=i.props,f=c.children,d=Fn(c,YL);return e||!s?KL(n):J(J({key:"__RC_SELECT_GRP__".concat(l===null?r:l,"__"),label:l},d),{},{options:Wx(f)})}).filter(function(n){return n})}var ZL=function(e,n,r,i,s){return _.useMemo(function(){var l=e,c=!e;c&&(l=Wx(n));var f=new Map,d=new Map,g=function(S,E,w){w&&typeof w=="string"&&S.set(E[w],E)},m=function v(S){for(var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,w=0;w<S.length;w+=1){var b=S[w];!b[r.options]||E?(f.set(b[r.value],b),g(d,b,r.label),g(d,b,i),g(d,b,s)):v(b[r.options],!0)}};return m(l),{options:l,valueOptions:f,labelOptions:d}},[e,n,r,i,s])};function A2(t){var e=_.useRef();e.current=t;var n=_.useCallback(function(){return e.current.apply(e,arguments)},[]);return n}var QL=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],GL=["inputValue"];function JL(t){return!t||pt(t)!=="object"}var e7=_.forwardRef(function(t,e){var n=t.id,r=t.mode,i=t.prefixCls,s=i===void 0?"rc-select":i,l=t.backfill,c=t.fieldNames,f=t.inputValue,d=t.searchValue,g=t.onSearch,m=t.autoClearSearchValue,v=m===void 0?!0:m,S=t.onSelect,E=t.onDeselect,w=t.dropdownMatchSelectWidth,b=w===void 0?!0:w,A=t.filterOption,T=t.filterSort,C=t.optionFilterProp,M=t.optionLabelProp,x=t.options,N=t.optionRender,F=t.children,L=t.defaultActiveFirstOption,I=t.menuItemSelectedIcon,V=t.virtual,B=t.direction,j=t.listHeight,X=j===void 0?200:j,Y=t.listItemHeight,ae=Y===void 0?20:Y,U=t.labelRender,z=t.value,W=t.defaultValue,Z=t.labelInValue,P=t.onChange,$=t.maxCount,ie=Fn(t,QL),se=XL(n),q=z_(r),ce=!!(!x&&F),fe=_.useMemo(function(){return A===void 0&&r==="combobox"?!1:A},[A,r]),ye=_.useMemo(function(){return $x(c,ce)},[JSON.stringify(c),ce]),we=xc("",{value:d!==void 0?d:f,postState:function(Oe){return Oe||""}}),Ae=de(we,2),Te=Ae[0],ve=Ae[1],ge=ZL(x,F,ye,C,M),_e=ge.valueOptions,Ie=ge.labelOptions,Ee=ge.options,xe=_.useCallback(function(Ue){var Oe=Ux(Ue);return Oe.map(function(je){var Ye,We,Qe,bt,_t;if(JL(je))Ye=je;else{var Zt;Qe=je.key,We=je.label,Ye=(Zt=je.value)!==null&&Zt!==void 0?Zt:Qe}var Yt=_e.get(Ye);if(Yt){var vn;We===void 0&&(We=Yt==null?void 0:Yt[M||ye.label]),Qe===void 0&&(Qe=(vn=Yt==null?void 0:Yt.key)!==null&&vn!==void 0?vn:Ye),bt=Yt==null?void 0:Yt.disabled,_t=Yt==null?void 0:Yt.title}return{label:We,value:Ye,key:Qe,disabled:bt,title:_t}})},[ye,M,_e]),Ve=xc(W,{value:z}),Fe=de(Ve,2),Be=Fe[0],nt=Fe[1],He=_.useMemo(function(){var Ue,Oe=q&&Be===null?[]:Be,je=xe(Oe);return r==="combobox"&&WU((Ue=je[0])===null||Ue===void 0?void 0:Ue.value)?[]:je},[Be,xe,r,q]),Ge=VL(He,_e),Pe=de(Ge,2),Me=Pe[0],dt=Pe[1],rt=_.useMemo(function(){if(!r&&Me.length===1){var Ue=Me[0];if(Ue.value===null&&(Ue.label===null||Ue.label===void 0))return[]}return Me.map(function(Oe){var je;return J(J({},Oe),{},{label:(je=typeof U=="function"?U(Oe):Oe.label)!==null&&je!==void 0?je:Oe.value})})},[r,Me,U]),it=_.useMemo(function(){return new Set(Me.map(function(Ue){return Ue.value}))},[Me]);_.useEffect(function(){if(r==="combobox"){var Ue,Oe=(Ue=Me[0])===null||Ue===void 0?void 0:Ue.value;ve(jU(Oe)?String(Oe):"")}},[Me]);var st=A2(function(Ue,Oe){var je=Oe??Ue;return K(K({},ye.value,Ue),ye.label,je)}),at=_.useMemo(function(){if(r!=="tags")return Ee;var Ue=ze(Ee),Oe=function(Ye){return _e.has(Ye)};return ze(Me).sort(function(je,Ye){return je.value<Ye.value?-1:1}).forEach(function(je){var Ye=je.value;Oe(Ye)||Ue.push(st(Ye,je.label))}),Ue},[st,Ee,_e,Me,r]),Je=HL(at,ye,Te,fe,C),lt=_.useMemo(function(){return r!=="tags"||!Te||Je.some(function(Ue){return Ue[C||"value"]===Te})||Je.some(function(Ue){return Ue[ye.value]===Te})?Je:[st(Te)].concat(ze(Je))},[st,C,r,Je,Te,ye]),ft=function Ue(Oe){var je=ze(Oe).sort(function(Ye,We){return T(Ye,We,{searchValue:Te})});return je.map(function(Ye){return Array.isArray(Ye.options)?J(J({},Ye),{},{options:Ye.options.length>0?Ue(Ye.options):Ye.options}):Ye})},ct=_.useMemo(function(){return T?ft(lt):lt},[lt,T,Te]),mt=_.useMemo(function(){return pL(ct,{fieldNames:ye,childrenAsData:ce})},[ct,ye,ce]),xt=function(Oe){var je=xe(Oe);if(nt(je),P&&(je.length!==Me.length||je.some(function(Qe,bt){var _t;return((_t=Me[bt])===null||_t===void 0?void 0:_t.value)!==(Qe==null?void 0:Qe.value)}))){var Ye=Z?je:je.map(function(Qe){return Qe.value}),We=je.map(function(Qe){return L_(dt(Qe.value))});P(q?Ye:Ye[0],q?We:We[0])}},Bt=_.useState(null),ht=de(Bt,2),Vt=ht[0],qt=ht[1],En=_.useState(0),Mn=de(En,2),Ut=Mn[0],It=Mn[1],Lt=L!==void 0?L:r!=="combobox",Jt=_.useCallback(function(Ue,Oe){var je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ye=je.source,We=Ye===void 0?"keyboard":Ye;It(Oe),l&&r==="combobox"&&Ue!==null&&We==="keyboard"&&qt(String(Ue))},[l,r]),Mt=function(Oe,je,Ye){var We=function(){var un,rn=dt(Oe);return[Z?{label:rn==null?void 0:rn[ye.label],value:Oe,key:(un=rn==null?void 0:rn.key)!==null&&un!==void 0?un:Oe}:Oe,L_(rn)]};if(je&&S){var Qe=We(),bt=de(Qe,2),_t=bt[0],Zt=bt[1];S(_t,Zt)}else if(!je&&E&&Ye!=="clear"){var Yt=We(),vn=de(Yt,2),On=vn[0],_n=vn[1];E(On,_n)}},qe=A2(function(Ue,Oe){var je,Ye=q?Oe.selected:!0;Ye?je=q?[].concat(ze(Me),[Ue]):[Ue]:je=Me.filter(function(We){return We.value!==Ue}),xt(je),Mt(Ue,Ye),r==="combobox"?qt(""):(!z_||v)&&(ve(""),qt(""))}),ke=function(Oe,je){xt(Oe);var Ye=je.type,We=je.values;(Ye==="remove"||Ye==="clear")&&We.forEach(function(Qe){Mt(Qe.value,!1,Ye)})},Ne=function(Oe,je){if(ve(Oe),qt(null),je.source==="submit"){var Ye=(Oe||"").trim();if(Ye){var We=Array.from(new Set([].concat(ze(it),[Ye])));xt(We),Mt(Ye,!0),ve("")}return}je.source!=="blur"&&(r==="combobox"&&xt(Oe),g==null||g(Oe))},wt=function(Oe){var je=Oe;r!=="tags"&&(je=Oe.map(function(We){var Qe=Ie.get(We);return Qe==null?void 0:Qe.value}).filter(function(We){return We!==void 0}));var Ye=Array.from(new Set([].concat(ze(it),ze(je))));xt(Ye),Ye.forEach(function(We){Mt(We,!0)})},en=_.useMemo(function(){var Ue=V!==!1&&b!==!1;return J(J({},ge),{},{flattenOptions:mt,onActiveValue:Jt,defaultActiveFirstOption:Lt,onSelect:qe,menuItemSelectedIcon:I,rawValues:it,fieldNames:ye,virtual:Ue,direction:B,listHeight:X,listItemHeight:ae,childrenAsData:ce,maxCount:$,optionRender:N})},[$,ge,mt,Jt,Lt,qe,I,it,ye,V,b,B,X,ae,ce,N]);return _.createElement(mb.Provider,{value:en},_.createElement(bL,kt({},ie,{id:se,prefixCls:s,ref:e,omitDomProps:GL,mode:r,displayValues:rt,onDisplayValuesChange:ke,direction:B,searchValue:Te,onSearch:Ne,autoClearSearchValue:v,onSearchSplit:wt,dropdownMatchSelectWidth:b,OptionList:$L,emptyOptions:!mt.length,activeValue:Vt,activeDescendantId:"".concat(se,"_list_").concat(Ut)})))}),yb=e7;yb.Option=_b;yb.OptGroup=vb;function t7(t,e,n){return Ze({[`${t}-status-success`]:e==="success",[`${t}-status-warning`]:e==="warning",[`${t}-status-error`]:e==="error",[`${t}-status-validating`]:e==="validating",[`${t}-has-feedback`]:n})}const n7=(t,e)=>e||t,r7=()=>{const[,t]=Xs(),[e]=cb("Empty"),r=new wn(t.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return _.createElement("svg",{style:r,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,(e==null?void 0:e.description)||"Empty"),_.createElement("g",{fill:"none",fillRule:"evenodd"},_.createElement("g",{transform:"translate(24 31.67)"},_.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),_.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),_.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),_.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),_.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),_.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),_.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},_.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),_.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},i7=()=>{const[,t]=Xs(),[e]=cb("Empty"),{colorFill:n,colorFillTertiary:r,colorFillQuaternary:i,colorBgContainer:s}=t,{borderColor:l,shadowColor:c,contentColor:f}=_.useMemo(()=>({borderColor:new wn(n).onBackground(s).toHexString(),shadowColor:new wn(r).onBackground(s).toHexString(),contentColor:new wn(i).onBackground(s).toHexString()}),[n,r,i,s]);return _.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,(e==null?void 0:e.description)||"Empty"),_.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},_.createElement("ellipse",{fill:c,cx:"32",cy:"33",rx:"32",ry:"7"}),_.createElement("g",{fillRule:"nonzero",stroke:l},_.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),_.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:f}))))},s7=t=>{const{componentCls:e,margin:n,marginXS:r,marginXL:i,fontSize:s,lineHeight:l}=t;return{[e]:{marginInline:r,fontSize:s,lineHeight:l,textAlign:"center",[`${e}-image`]:{height:t.emptyImgHeight,marginBottom:r,opacity:t.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${e}-description`]:{color:t.colorTextDescription},[`${e}-footer`]:{marginTop:n},"&-normal":{marginBlock:i,color:t.colorTextDescription,[`${e}-description`]:{color:t.colorTextDescription},[`${e}-image`]:{height:t.emptyImgHeightMD}},"&-small":{marginBlock:r,color:t.colorTextDescription,[`${e}-image`]:{height:t.emptyImgHeightSM}}}}},a7=jc("Empty",t=>{const{componentCls:e,controlHeightLG:n,calc:r}=t,i=fi(t,{emptyImgCls:`${e}-img`,emptyImgHeight:r(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:r(n).mul(.875).equal()});return[s7(i)]});var o7=function(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};const Xx=_.createElement(r7,null),qx=_.createElement(i7,null),_o=t=>{const{className:e,rootClassName:n,prefixCls:r,image:i=Xx,description:s,children:l,imageStyle:c,style:f,classNames:d,styles:g}=t,m=o7(t,["className","rootClassName","prefixCls","image","description","children","imageStyle","style","classNames","styles"]),{getPrefixCls:v,direction:S,className:E,style:w,classNames:b,styles:A}=Vc("empty"),T=v("empty",r),[C,M,x]=a7(T),[N]=cb("Empty"),F=typeof s<"u"?s:N==null?void 0:N.description,L=typeof F=="string"?F:"empty";let I=null;return typeof i=="string"?I=_.createElement("img",{alt:L,src:i}):I=i,C(_.createElement("div",Object.assign({className:Ze(M,x,T,E,{[`${T}-normal`]:i===qx,[`${T}-rtl`]:S==="rtl"},e,n,b.root,d==null?void 0:d.root),style:Object.assign(Object.assign(Object.assign(Object.assign({},A.root),w),g==null?void 0:g.root),f)},m),_.createElement("div",{className:Ze(`${T}-image`,b.image,d==null?void 0:d.image),style:Object.assign(Object.assign(Object.assign({},c),A.image),g==null?void 0:g.image)},I),F&&_.createElement("div",{className:Ze(`${T}-description`,b.description,d==null?void 0:d.description),style:Object.assign(Object.assign({},A.description),g==null?void 0:g.description)},F),l&&_.createElement("div",{className:Ze(`${T}-footer`,b.footer,d==null?void 0:d.footer),style:Object.assign(Object.assign({},A.footer),g==null?void 0:g.footer)},l)))};_o.PRESENTED_IMAGE_DEFAULT=Xx;_o.PRESENTED_IMAGE_SIMPLE=qx;const l7=t=>{const{componentName:e}=t,{getPrefixCls:n}=_.useContext(ui),r=n("empty");switch(e){case"Table":case"List":return Ft.createElement(_o,{image:_o.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return Ft.createElement(_o,{image:_o.PRESENTED_IMAGE_SIMPLE,className:`${r}-small`});case"Table.filter":return null;default:return Ft.createElement(_o,null)}},c7=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;var r,i;const{variant:s,[t]:l}=_.useContext(ui),c=_.useContext(SU),f=l==null?void 0:l.variant;let d;typeof e<"u"?d=e:n===!1?d="borderless":d=(i=(r=c??f)!==null&&r!==void 0?r:s)!==null&&i!==void 0?i:"outlined";const g=ZF.includes(d);return[d,g]},u7=t=>{const n={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:t==="scroll"?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},n),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},n),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},n),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},n),{points:["br","tr"],offset:[0,-4]})}};function f7(t,e){return t||u7(e)}const C2=t=>{const{optionHeight:e,optionFontSize:n,optionLineHeight:r,optionPadding:i}=t;return{position:"relative",display:"block",minHeight:e,padding:i,color:t.colorText,fontWeight:"normal",fontSize:n,lineHeight:r,boxSizing:"border-box"}},d7=t=>{const{antCls:e,componentCls:n}=t,r=`${n}-item`,i=`&${e}-slide-up-enter${e}-slide-up-enter-active`,s=`&${e}-slide-up-appear${e}-slide-up-appear-active`,l=`&${e}-slide-up-leave${e}-slide-up-leave-active`,c=`${n}-dropdown-placement-`,f=`${r}-option-selected`;return[{[`${n}-dropdown`]:Object.assign(Object.assign({},Hc(t)),{position:"absolute",top:-9999,zIndex:t.zIndexPopup,boxSizing:"border-box",padding:t.paddingXXS,overflow:"hidden",fontSize:t.fontSize,fontVariant:"initial",backgroundColor:t.colorBgElevated,borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary,[`
${i}${c}bottomLeft,
${s}${c}bottomLeft
`]:{animationName:_x},[`
${i}${c}topLeft,
${s}${c}topLeft,
${i}${c}topRight,
${s}${c}topRight
`]:{animationName:bx},[`${l}${c}bottomLeft`]:{animationName:yx},[`
${l}${c}topLeft,
${l}${c}topRight
`]:{animationName:Sx},"&-hidden":{display:"none"},[r]:Object.assign(Object.assign({},C2(t)),{cursor:"pointer",transition:`background ${t.motionDurationSlow} ease`,borderRadius:t.borderRadiusSM,"&-group":{color:t.colorTextDescription,fontSize:t.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},b_),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${r}-option-disabled)`]:{backgroundColor:t.optionActiveBg},[`&-selected:not(${r}-option-disabled)`]:{color:t.optionSelectedColor,fontWeight:t.optionSelectedFontWeight,backgroundColor:t.optionSelectedBg,[`${r}-option-state`]:{color:t.colorPrimary}},"&-disabled":{[`&${r}-option-selected`]:{backgroundColor:t.colorBgContainerDisabled},color:t.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:t.calc(t.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},C2(t)),{color:t.colorTextDisabled})}),[`${f}:has(+ ${f})`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${f}`]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:"rtl"}})},HT(t,"slide-up"),HT(t,"slide-down"),VT(t,"move-up"),VT(t,"move-down")]},h7=t=>{const{multipleSelectItemHeight:e,paddingXXS:n,lineWidth:r,INTERNAL_FIXED_ITEM_MARGIN:i}=t,s=t.max(t.calc(n).sub(r).equal(),0),l=t.max(t.calc(s).sub(i).equal(),0);return{basePadding:s,containerPadding:l,itemHeight:Rt(e),itemLineHeight:Rt(t.calc(e).sub(t.calc(t.lineWidth).mul(2)).equal())}},g7=t=>{const{multipleSelectItemHeight:e,selectHeight:n,lineWidth:r}=t;return t.calc(n).sub(e).div(2).sub(r).equal()},p7=t=>{const{componentCls:e,iconCls:n,borderRadiusSM:r,motionDurationSlow:i,paddingXS:s,multipleItemColorDisabled:l,multipleItemBorderColorDisabled:c,colorIcon:f,colorIconHover:d,INTERNAL_FIXED_ITEM_MARGIN:g}=t;return{[`${e}-selection-overflow`]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"},[`${e}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",marginBlock:g,borderRadius:r,cursor:"default",transition:`font-size ${i}, line-height ${i}, height ${i}`,marginInlineEnd:t.calc(g).mul(2).equal(),paddingInlineStart:s,paddingInlineEnd:t.calc(s).div(2).equal(),[`${e}-disabled&`]:{color:l,borderColor:c,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:t.calc(s).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},fb()),{display:"inline-flex",alignItems:"center",color:f,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:d}})}}}},m7=(t,e)=>{const{componentCls:n,INTERNAL_FIXED_ITEM_MARGIN:r}=t,i=`${n}-selection-overflow`,s=t.multipleSelectItemHeight,l=g7(t),c=e?`${n}-${e}`:"",f=h7(t);return{[`${n}-multiple${c}`]:Object.assign(Object.assign({},p7(t)),{[`${n}-selector`]:{display:"flex",alignItems:"center",width:"100%",height:"100%",paddingInline:f.basePadding,paddingBlock:f.containerPadding,borderRadius:t.borderRadius,[`${n}-disabled&`]:{background:t.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Rt(r)} 0`,lineHeight:Rt(s),visibility:"hidden",content:'"\\a0"'}},[`${n}-selection-item`]:{height:f.itemHeight,lineHeight:Rt(f.itemLineHeight)},[`${n}-selection-wrap`]:{alignSelf:"flex-start","&:after":{lineHeight:Rt(s),marginBlock:r}},[`${n}-prefix`]:{marginInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(f.basePadding).equal()},[`${i}-item + ${i}-item,
${n}-prefix + ${n}-selection-wrap
`]:{[`${n}-selection-search`]:{marginInlineStart:0},[`${n}-selection-placeholder`]:{insetInlineStart:0}},[`${i}-item-suffix`]:{minHeight:f.itemHeight,marginBlock:r},[`${n}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(l).equal(),"\n &-input,\n &-mirror\n ":{height:s,fontFamily:t.fontFamily,lineHeight:Rt(s),transition:`all ${t.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${n}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(f.basePadding).equal(),insetInlineEnd:t.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${t.motionDurationSlow}`}})}};function Qv(t,e){const{componentCls:n}=t,r=e?`${n}-${e}`:"",i={[`${n}-multiple${r}`]:{fontSize:t.fontSize,[`${n}-selector`]:{[`${n}-show-search&`]:{cursor:"text"}},[`
&${n}-show-arrow ${n}-selector,
&${n}-allow-clear ${n}-selector
`]:{paddingInlineEnd:t.calc(t.fontSizeIcon).add(t.controlPaddingHorizontal).equal()}}};return[m7(t,e),i]}const v7=t=>{const{componentCls:e}=t,n=fi(t,{selectHeight:t.controlHeightSM,multipleSelectItemHeight:t.multipleItemHeightSM,borderRadius:t.borderRadiusSM,borderRadiusSM:t.borderRadiusXS}),r=fi(t,{fontSize:t.fontSizeLG,selectHeight:t.controlHeightLG,multipleSelectItemHeight:t.multipleItemHeightLG,borderRadius:t.borderRadiusLG,borderRadiusSM:t.borderRadius});return[Qv(t),Qv(n,"sm"),{[`${e}-multiple${e}-sm`]:{[`${e}-selection-placeholder`]:{insetInline:t.calc(t.controlPaddingHorizontalSM).sub(t.lineWidth).equal()},[`${e}-selection-search`]:{marginInlineStart:2}}},Qv(r,"lg")]};function Gv(t,e){const{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:i}=t,s=t.calc(t.controlHeight).sub(t.calc(t.lineWidth).mul(2)).equal(),l=e?`${n}-${e}`:"";return{[`${n}-single${l}`]:{fontSize:t.fontSize,height:t.controlHeight,[`${n}-selector`]:Object.assign(Object.assign({},Hc(t,!0)),{display:"flex",borderRadius:i,flex:"1 1 auto",[`${n}-selection-search`]:{position:"absolute",inset:0,width:"100%","&-input":{width:"100%",WebkitAppearance:"textfield"}},[`
${n}-selection-item,
${n}-selection-placeholder
`]:{display:"block",padding:0,lineHeight:Rt(s),transition:`all ${t.motionDurationSlow}, visibility 0s`,alignSelf:"center"},[`${n}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${n}-selection-item:empty:after`,`${n}-selection-placeholder:empty:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`
&${n}-show-arrow ${n}-selection-item,
&${n}-show-arrow ${n}-selection-search,
&${n}-show-arrow ${n}-selection-placeholder
`]:{paddingInlineEnd:t.showArrowPaddingInlineEnd},[`&${n}-open ${n}-selection-item`]:{color:t.colorTextPlaceholder},[`&:not(${n}-customize-input)`]:{[`${n}-selector`]:{width:"100%",height:"100%",alignItems:"center",padding:`0 ${Rt(r)}`,[`${n}-selection-search-input`]:{height:s},"&:after":{lineHeight:Rt(s)}}},[`&${n}-customize-input`]:{[`${n}-selector`]:{"&:after":{display:"none"},[`${n}-selection-search`]:{position:"static",width:"100%"},[`${n}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Rt(r)}`,"&:after":{display:"none"}}}}}}}function _7(t){const{componentCls:e}=t,n=t.calc(t.controlPaddingHorizontalSM).sub(t.lineWidth).equal();return[Gv(t),Gv(fi(t,{controlHeight:t.controlHeightSM,borderRadius:t.borderRadiusSM}),"sm"),{[`${e}-single${e}-sm`]:{[`&:not(${e}-customize-input)`]:{[`${e}-selector`]:{padding:`0 ${Rt(n)}`},[`&${e}-show-arrow ${e}-selection-search`]:{insetInlineEnd:t.calc(n).add(t.calc(t.fontSize).mul(1.5)).equal()},[`
&${e}-show-arrow ${e}-selection-item,
&${e}-show-arrow ${e}-selection-placeholder
`]:{paddingInlineEnd:t.calc(t.fontSize).mul(1.5).equal()}}}},Gv(fi(t,{controlHeight:t.singleItemHeightLG,fontSize:t.fontSizeLG,borderRadius:t.borderRadiusLG}),"lg")]}const y7=t=>{const{fontSize:e,lineHeight:n,lineWidth:r,controlHeight:i,controlHeightSM:s,controlHeightLG:l,paddingXXS:c,controlPaddingHorizontal:f,zIndexPopupBase:d,colorText:g,fontWeightStrong:m,controlItemBgActive:v,controlItemBgHover:S,colorBgContainer:E,colorFillSecondary:w,colorBgContainerDisabled:b,colorTextDisabled:A,colorPrimaryHover:T,colorPrimary:C,controlOutline:M}=t,x=c*2,N=r*2,F=Math.min(i-x,i-N),L=Math.min(s-x,s-N),I=Math.min(l-x,l-N);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(c/2),zIndexPopup:d+50,optionSelectedColor:g,optionSelectedFontWeight:m,optionSelectedBg:v,optionActiveBg:S,optionPadding:`${(i-e*n)/2}px ${f}px`,optionFontSize:e,optionLineHeight:n,optionHeight:i,selectorBg:E,clearBg:E,singleItemHeightLG:l,multipleItemBg:w,multipleItemBorderColor:"transparent",multipleItemHeight:F,multipleItemHeightSM:L,multipleItemHeightLG:I,multipleSelectorBgDisabled:b,multipleItemColorDisabled:A,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(t.fontSize*1.25),hoverBorderColor:T,activeBorderColor:C,activeOutlineColor:M,selectAffixPadding:c}},Yx=(t,e)=>{const{componentCls:n,antCls:r,controlOutlineWidth:i}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{border:`${Rt(t.lineWidth)} ${t.lineType} ${e.borderColor}`,background:t.selectorBg},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:e.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:e.activeBorderColor,boxShadow:`0 0 0 ${Rt(i)} ${e.activeOutlineColor}`,outline:0},[`${n}-prefix`]:{color:e.color}}}},R2=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},Yx(t,e))}),b7=t=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},Yx(t,{borderColor:t.colorBorder,hoverBorderHover:t.hoverBorderColor,activeBorderColor:t.activeBorderColor,activeOutlineColor:t.activeOutlineColor,color:t.colorText})),R2(t,{status:"error",borderColor:t.colorError,hoverBorderHover:t.colorErrorHover,activeBorderColor:t.colorError,activeOutlineColor:t.colorErrorOutline,color:t.colorError})),R2(t,{status:"warning",borderColor:t.colorWarning,hoverBorderHover:t.colorWarningHover,activeBorderColor:t.colorWarning,activeOutlineColor:t.colorWarningOutline,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{background:t.colorBgContainerDisabled,color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}})}),Kx=(t,e)=>{const{componentCls:n,antCls:r}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{background:e.bg,border:`${Rt(t.lineWidth)} ${t.lineType} transparent`,color:e.color},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{background:e.hoverBg},[`${n}-focused& ${n}-selector`]:{background:t.selectorBg,borderColor:e.activeBorderColor,outline:0}}}},x2=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},Kx(t,e))}),S7=t=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},Kx(t,{bg:t.colorFillTertiary,hoverBg:t.colorFillSecondary,activeBorderColor:t.activeBorderColor,color:t.colorText})),x2(t,{status:"error",bg:t.colorErrorBg,hoverBg:t.colorErrorBgHover,activeBorderColor:t.colorError,color:t.colorError})),x2(t,{status:"warning",bg:t.colorWarningBg,hoverBg:t.colorWarningBgHover,activeBorderColor:t.colorWarning,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{borderColor:t.colorBorder,background:t.colorBgContainerDisabled,color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.colorBgContainer,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`}})}),w7=t=>({"&-borderless":{[`${t.componentCls}-selector`]:{background:"transparent",border:`${Rt(t.lineWidth)} ${t.lineType} transparent`},[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`},[`&${t.componentCls}-status-error`]:{[`${t.componentCls}-prefix, ${t.componentCls}-selection-item`]:{color:t.colorError}},[`&${t.componentCls}-status-warning`]:{[`${t.componentCls}-prefix, ${t.componentCls}-selection-item`]:{color:t.colorWarning}}}}),Zx=(t,e)=>{const{componentCls:n,antCls:r}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{borderWidth:`0 0 ${Rt(t.lineWidth)} 0`,borderStyle:`none none ${t.lineType} none`,borderColor:e.borderColor,background:t.selectorBg,borderRadius:0},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:e.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:e.activeBorderColor,outline:0},[`${n}-prefix`]:{color:e.color}}}},M2=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},Zx(t,e))}),E7=t=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign({},Zx(t,{borderColor:t.colorBorder,hoverBorderHover:t.hoverBorderColor,activeBorderColor:t.activeBorderColor,activeOutlineColor:t.activeOutlineColor,color:t.colorText})),M2(t,{status:"error",borderColor:t.colorError,hoverBorderHover:t.colorErrorHover,activeBorderColor:t.colorError,activeOutlineColor:t.colorErrorOutline,color:t.colorError})),M2(t,{status:"warning",borderColor:t.colorWarning,hoverBorderHover:t.colorWarningHover,activeBorderColor:t.colorWarning,activeOutlineColor:t.colorWarningOutline,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}})}),T7=t=>({[t.componentCls]:Object.assign(Object.assign(Object.assign(Object.assign({},b7(t)),S7(t)),w7(t)),E7(t))}),A7=t=>{const{componentCls:e}=t;return{position:"relative",transition:`all ${t.motionDurationMid} ${t.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},[`${e}-disabled&`]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},C7=t=>{const{componentCls:e}=t;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},R7=t=>{const{antCls:e,componentCls:n,inputPaddingHorizontalBase:r,iconCls:i}=t;return{[n]:Object.assign(Object.assign({},Hc(t)),{position:"relative",display:"inline-flex",cursor:"pointer",[`&:not(${n}-customize-input) ${n}-selector`]:Object.assign(Object.assign({},A7(t)),C7(t)),[`${n}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},b_),{[`> ${e}-typography`]:{display:"inline"}}),[`${n}-selection-placeholder`]:Object.assign(Object.assign({},b_),{flex:1,color:t.colorTextPlaceholder,pointerEvents:"none"}),[`${n}-arrow`]:Object.assign(Object.assign({},fb()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,height:t.fontSizeIcon,marginTop:t.calc(t.fontSizeIcon).mul(-1).div(2).equal(),color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:`opacity ${t.motionDurationSlow} ease`,[i]:{verticalAlign:"top",transition:`transform ${t.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${n}-suffix)`]:{pointerEvents:"auto"}},[`${n}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${n}-selection-wrap`]:{display:"flex",width:"100%",position:"relative",minWidth:0,"&:after":{content:'"\\a0"',width:0,overflow:"hidden"}},[`${n}-prefix`]:{flex:"none",marginInlineEnd:t.selectAffixPadding},[`${n}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,zIndex:1,display:"inline-block",width:t.fontSizeIcon,height:t.fontSizeIcon,marginTop:t.calc(t.fontSizeIcon).mul(-1).div(2).equal(),color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${t.motionDurationMid} ease, opacity ${t.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:t.colorTextTertiary}},[`&:hover ${n}-clear`]:{opacity:1,background:t.colorBgBase,borderRadius:"50%"}}),[`${n}-status`]:{"&-error, &-warning, &-success, &-validating":{[`&${n}-has-feedback`]:{[`${n}-clear`]:{insetInlineEnd:t.calc(r).add(t.fontSize).add(t.paddingXS).equal()}}}}}},x7=t=>{const{componentCls:e}=t;return[{[e]:{[`&${e}-in-form-item`]:{width:"100%"}}},R7(t),_7(t),v7(t),d7(t),{[`${e}-rtl`]:{direction:"rtl"}},mB(t,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]},M7=jc("Select",(t,e)=>{let{rootPrefixCls:n}=e;const r=fi(t,{rootPrefixCls:n,inputPaddingHorizontalBase:t.calc(t.paddingSM).sub(1).equal(),multipleSelectItemHeight:t.multipleItemHeight,selectHeight:t.controlHeight});return[x7(r),T7(r)]},y7,{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}});var O7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},P7=function(e,n){return _.createElement(qs,kt({},e,{ref:n,icon:O7}))},N7=_.forwardRef(P7),I7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},D7=function(e,n){return _.createElement(qs,kt({},e,{ref:n,icon:I7}))},F7=_.forwardRef(D7),k7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},B7=function(e,n){return _.createElement(qs,kt({},e,{ref:n,icon:k7}))},U7=_.forwardRef(B7);function L7(t){let{suffixIcon:e,clearIcon:n,menuItemSelectedIcon:r,removeIcon:i,loading:s,multiple:l,hasFeedback:c,prefixCls:f,showSuffixIcon:d,feedbackIcon:g,showArrow:m,componentName:v}=t;const S=n??_.createElement(pk,null),E=T=>e===null&&!c&&!m?null:_.createElement(_.Fragment,null,d!==!1&&T,c&&g);let w=null;if(e!==void 0)w=E(e);else if(s)w=E(_.createElement(Mk,{spin:!0}));else{const T=`${f}-suffix`;w=C=>{let{open:M,showSearch:x}=C;return E(M&&x?_.createElement(U7,{className:T}):_.createElement(F7,{className:T}))}}let b=null;r!==void 0?b=r:l?b=_.createElement(N7,null):b=null;let A=null;return i!==void 0?A=i:A=_.createElement(_k,null),{clearIcon:S,suffixIcon:w,itemIcon:b,removeIcon:A}}function z7(t,e){return e!==void 0?e:t!==null}var $7=function(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};const Qx="SECRET_COMBOBOX_MODE_DO_NOT_USE",V7=(t,e)=>{var n;const{prefixCls:r,bordered:i,className:s,rootClassName:l,getPopupContainer:c,popupClassName:f,dropdownClassName:d,listHeight:g=256,placement:m,listItemHeight:v,size:S,disabled:E,notFoundContent:w,status:b,builtinPlacements:A,dropdownMatchSelectWidth:T,popupMatchSelectWidth:C,direction:M,style:x,allowClear:N,variant:F,dropdownStyle:L,transitionName:I,tagRender:V,maxCount:B,prefix:j}=t,X=$7(t,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount","prefix"]),{getPopupContainer:Y,getPrefixCls:ae,renderEmpty:U,direction:z,virtual:W,popupMatchSelectWidth:Z,popupOverflow:P}=_.useContext(ui),$=Vc("select"),[,ie]=Xs(),se=v??(ie==null?void 0:ie.controlHeight),q=ae("select",r),ce=ae(),fe=M??z,{compactSize:ye,compactItemClassnames:we}=kk(q,fe),[Ae,Te]=c7("select",F,i),ve=Ck(q),[ge,_e,Ie]=M7(q,ve),Ee=_.useMemo(()=>{const{mode:Vt}=t;if(Vt!=="combobox")return Vt===Qx?"combobox":Vt},[t.mode]),xe=Ee==="multiple"||Ee==="tags",Ve=z7(t.suffixIcon,t.showArrow),Fe=(n=C??T)!==null&&n!==void 0?n:Z,{status:Be,hasFeedback:nt,isFormItemInput:He,feedbackIcon:Ge}=_.useContext(k_),Pe=n7(Be,b);let Me;w!==void 0?Me=w:Ee==="combobox"?Me=null:Me=(U==null?void 0:U("Select"))||_.createElement(l7,{componentName:"Select"});const{suffixIcon:dt,itemIcon:rt,removeIcon:it,clearIcon:st}=L7(Object.assign(Object.assign({},X),{multiple:xe,hasFeedback:nt,feedbackIcon:Ge,showSuffixIcon:Ve,prefixCls:q,componentName:"Select"})),at=N===!0?{clearIcon:st}:N,Je=gx(X,["suffixIcon","itemIcon"]),lt=Ze(f||d,{[`${q}-dropdown-${fe}`]:fe==="rtl"},l,Ie,ve,_e),ft=px(Vt=>{var qt;return(qt=S??ye)!==null&&qt!==void 0?qt:Vt}),ct=_.useContext(xf),mt=E??ct,xt=Ze({[`${q}-lg`]:ft==="large",[`${q}-sm`]:ft==="small",[`${q}-rtl`]:fe==="rtl",[`${q}-${Ae}`]:Te,[`${q}-in-form-item`]:He},t7(q,Pe,nt),we,$.className,s,l,Ie,ve,_e),Bt=_.useMemo(()=>m!==void 0?m:fe==="rtl"?"bottomRight":"bottomLeft",[m,fe]),[ht]=dx("SelectLike",L==null?void 0:L.zIndex);return ge(_.createElement(yb,Object.assign({ref:e,virtual:W,showSearch:$.showSearch},Je,{style:Object.assign(Object.assign({},$.style),x),dropdownMatchSelectWidth:Fe,transitionName:hx(ce,"slide-up",I),builtinPlacements:f7(A,P),listHeight:g,listItemHeight:se,mode:Ee,prefixCls:q,placement:Bt,direction:fe,prefix:j,suffixIcon:dt,menuItemSelectedIcon:rt,removeIcon:it,allowClear:at,notFoundContent:Me,className:xt,getPopupContainer:c||Y,dropdownClassName:lt,disabled:mt,dropdownStyle:Object.assign(Object.assign({},L),{zIndex:ht}),maxCount:xe?B:void 0,tagRender:xe?V:void 0})))},qc=_.forwardRef(V7),H7=TU(qc,"dropdownAlign");qc.SECRET_COMBOBOX_MODE_DO_NOT_USE=Qx;qc.Option=_b;qc.OptGroup=vb;qc._InternalPanelDoNotUseOrYouWillBeFired=H7;function Gx(t){var e=t.children,n=t.prefixCls,r=t.id,i=t.overlayInnerStyle,s=t.bodyClassName,l=t.className,c=t.style;return _.createElement("div",{className:Ze("".concat(n,"-content"),l),style:c},_.createElement("div",{className:Ze("".concat(n,"-inner"),s),id:r,role:"tooltip",style:i},typeof e=="function"?e():e))}var Vl={shiftX:64,adjustY:1},Hl={adjustX:1,shiftY:!0},Ri=[0,0],j7={left:{points:["cr","cl"],overflow:Hl,offset:[-4,0],targetOffset:Ri},right:{points:["cl","cr"],overflow:Hl,offset:[4,0],targetOffset:Ri},top:{points:["bc","tc"],overflow:Vl,offset:[0,-4],targetOffset:Ri},bottom:{points:["tc","bc"],overflow:Vl,offset:[0,4],targetOffset:Ri},topLeft:{points:["bl","tl"],overflow:Vl,offset:[0,-4],targetOffset:Ri},leftTop:{points:["tr","tl"],overflow:Hl,offset:[-4,0],targetOffset:Ri},topRight:{points:["br","tr"],overflow:Vl,offset:[0,-4],targetOffset:Ri},rightTop:{points:["tl","tr"],overflow:Hl,offset:[4,0],targetOffset:Ri},bottomRight:{points:["tr","br"],overflow:Vl,offset:[0,4],targetOffset:Ri},rightBottom:{points:["bl","br"],overflow:Hl,offset:[4,0],targetOffset:Ri},bottomLeft:{points:["tl","bl"],overflow:Vl,offset:[0,4],targetOffset:Ri},leftBottom:{points:["br","bl"],overflow:Hl,offset:[-4,0],targetOffset:Ri}},W7=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],X7=function(e,n){var r=e.overlayClassName,i=e.trigger,s=i===void 0?["hover"]:i,l=e.mouseEnterDelay,c=l===void 0?0:l,f=e.mouseLeaveDelay,d=f===void 0?.1:f,g=e.overlayStyle,m=e.prefixCls,v=m===void 0?"rc-tooltip":m,S=e.children,E=e.onVisibleChange,w=e.afterVisibleChange,b=e.transitionName,A=e.animation,T=e.motion,C=e.placement,M=C===void 0?"right":C,x=e.align,N=x===void 0?{}:x,F=e.destroyTooltipOnHide,L=F===void 0?!1:F,I=e.defaultVisible,V=e.getTooltipContainer,B=e.overlayInnerStyle;e.arrowContent;var j=e.overlay,X=e.id,Y=e.showArrow,ae=Y===void 0?!0:Y,U=e.classNames,z=e.styles,W=Fn(e,W7),Z=Tx(X),P=_.useRef(null);_.useImperativeHandle(n,function(){return P.current});var $=J({},W);"visible"in e&&($.popupVisible=e.visible);var ie=function(){return _.createElement(Gx,{key:"content",prefixCls:v,id:Z,bodyClassName:U==null?void 0:U.body,overlayInnerStyle:J(J({},B),z==null?void 0:z.body)},j)},se=function(){var ce=_.Children.only(S),fe=(ce==null?void 0:ce.props)||{},ye=J(J({},fe),{},{"aria-describedby":j?Z:null});return _.cloneElement(S,ye)};return _.createElement(zx,kt({popupClassName:Ze(r,U==null?void 0:U.root),prefixCls:v,popup:ie,action:s,builtinPlacements:j7,popupPlacement:M,ref:P,popupAlign:N,getPopupContainer:V,onPopupVisibleChange:E,afterPopupVisibleChange:w,popupTransitionName:b,popupAnimation:A,popupMotion:T,defaultPopupVisible:I,autoDestroy:L,mouseLeaveDelay:d,popupStyle:J(J({},g),z==null?void 0:z.root),mouseEnterDelay:c,arrow:ae},$),se())};const q7=_.forwardRef(X7);function Y7(t){const{sizePopupArrow:e,borderRadiusXS:n,borderRadiusOuter:r}=t,i=e/2,s=0,l=i,c=r*1/Math.sqrt(2),f=i-r*(1-1/Math.sqrt(2)),d=i-n*(1/Math.sqrt(2)),g=r*(Math.sqrt(2)-1)+n*(1/Math.sqrt(2)),m=2*i-d,v=g,S=2*i-c,E=f,w=2*i-s,b=l,A=i*Math.sqrt(2)+r*(Math.sqrt(2)-2),T=r*(Math.sqrt(2)-1),C=`polygon(${T}px 100%, 50% ${T}px, ${2*i-T}px 100%, ${T}px 100%)`,M=`path('M ${s} ${l} A ${r} ${r} 0 0 0 ${c} ${f} L ${d} ${g} A ${n} ${n} 0 0 1 ${m} ${v} L ${S} ${E} A ${r} ${r} 0 0 0 ${w} ${b} Z')`;return{arrowShadowWidth:A,arrowPath:M,arrowPolygon:C}}const K7=(t,e,n)=>{const{sizePopupArrow:r,arrowPolygon:i,arrowPath:s,arrowShadowWidth:l,borderRadiusXS:c,calc:f}=t;return{pointerEvents:"none",width:r,height:r,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:r,height:f(r).div(2).equal(),background:e,clipPath:{_multi_value_:!0,value:[i,s]},content:'""'},"&::after":{content:'""',position:"absolute",width:l,height:l,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Rt(c)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}},Jx=8;function eM(t){const{contentRadius:e,limitVerticalRadius:n}=t,r=e>12?e+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?Jx:r}}function mh(t,e){return t?e:{}}function Z7(t,e,n){const{componentCls:r,boxShadowPopoverArrow:i,arrowOffsetVertical:s,arrowOffsetHorizontal:l}=t,{arrowDistance:c=0,arrowPlacement:f={left:!0,right:!0,top:!0,bottom:!0}}={};return{[r]:Object.assign(Object.assign(Object.assign(Object.assign({[`${r}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},K7(t,e,i)),{"&:before":{background:e}})]},mh(!!f.top,{[[`&-placement-top > ${r}-arrow`,`&-placement-topLeft > ${r}-arrow`,`&-placement-topRight > ${r}-arrow`].join(",")]:{bottom:c,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":l,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:l}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${Rt(l)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:l}}}})),mh(!!f.bottom,{[[`&-placement-bottom > ${r}-arrow`,`&-placement-bottomLeft > ${r}-arrow`,`&-placement-bottomRight > ${r}-arrow`].join(",")]:{top:c,transform:"translateY(-100%)"},[`&-placement-bottom > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":l,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:l}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${Rt(l)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:l}}}})),mh(!!f.left,{[[`&-placement-left > ${r}-arrow`,`&-placement-leftTop > ${r}-arrow`,`&-placement-leftBottom > ${r}-arrow`].join(",")]:{right:{_skip_check_:!0,value:c},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${r}-arrow`]:{top:s},[`&-placement-leftBottom > ${r}-arrow`]:{bottom:s}})),mh(!!f.right,{[[`&-placement-right > ${r}-arrow`,`&-placement-rightTop > ${r}-arrow`,`&-placement-rightBottom > ${r}-arrow`].join(",")]:{left:{_skip_check_:!0,value:c},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${r}-arrow`]:{top:s},[`&-placement-rightBottom > ${r}-arrow`]:{bottom:s}}))}}function Q7(t,e,n,r){if(r===!1)return{adjustX:!1,adjustY:!1};const i=r&&typeof r=="object"?r:{},s={};switch(t){case"top":case"bottom":s.shiftX=e.arrowOffsetHorizontal*2+n,s.shiftY=!0,s.adjustY=!0;break;case"left":case"right":s.shiftY=e.arrowOffsetVertical*2+n,s.shiftX=!0,s.adjustX=!0;break}const l=Object.assign(Object.assign({},s),i);return l.shiftX||(l.adjustX=!0),l.shiftY||(l.adjustY=!0),l}const O2={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},G7={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},J7=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function e9(t){const{arrowWidth:e,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:i,borderRadius:s}=t,l=e/2,c={};return Object.keys(O2).forEach(f=>{const d=r&&G7[f]||O2[f],g=Object.assign(Object.assign({},d),{offset:[0,0],dynamicInset:!0});switch(c[f]=g,J7.has(f)&&(g.autoArrow=!1),f){case"top":case"topLeft":case"topRight":g.offset[1]=-l-i;break;case"bottom":case"bottomLeft":case"bottomRight":g.offset[1]=l+i;break;case"left":case"leftTop":case"leftBottom":g.offset[0]=-l-i;break;case"right":case"rightTop":case"rightBottom":g.offset[0]=l+i;break}const m=eM({contentRadius:s,limitVerticalRadius:!0});if(r)switch(f){case"topLeft":case"bottomLeft":g.offset[0]=-m.arrowOffsetHorizontal-l;break;case"topRight":case"bottomRight":g.offset[0]=m.arrowOffsetHorizontal+l;break;case"leftTop":case"rightTop":g.offset[1]=-m.arrowOffsetHorizontal*2+l;break;case"leftBottom":case"rightBottom":g.offset[1]=m.arrowOffsetHorizontal*2-l;break}g.overflow=Q7(f,m,e,n),g.htmlRegion="visibleFirst"}),c}const t9=t=>{const{calc:e,componentCls:n,tooltipMaxWidth:r,tooltipColor:i,tooltipBg:s,tooltipBorderRadius:l,zIndexPopup:c,controlHeight:f,boxShadowSecondary:d,paddingSM:g,paddingXS:m,arrowOffsetHorizontal:v,sizePopupArrow:S}=t,E=e(l).add(S).add(v).equal(),w=e(l).mul(2).add(S).equal();return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},Hc(t)),{position:"absolute",zIndex:c,display:"block",width:"max-content",maxWidth:r,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":s,[`${n}-inner`]:{minWidth:w,minHeight:f,padding:`${Rt(t.calc(g).div(2).equal())} ${Rt(m)}`,color:i,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:s,borderRadius:l,boxShadow:d,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:E},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${n}-inner`]:{borderRadius:t.min(l,Jx)}},[`${n}-content`]:{position:"relative"}}),w8(t,(b,A)=>{let{darkColor:T}=A;return{[`&${n}-${b}`]:{[`${n}-inner`]:{backgroundColor:T},[`${n}-arrow`]:{"--antd-arrow-background-color":T}}}})),{"&-rtl":{direction:"rtl"}})},Z7(t,"var(--antd-arrow-background-color)"),{[`${n}-pure`]:{position:"relative",maxWidth:"none",margin:t.sizePopupArrow}}]},n9=t=>Object.assign(Object.assign({zIndexPopup:t.zIndexPopupBase+70},eM({contentRadius:t.borderRadius,limitVerticalRadius:!0})),Y7(fi(t,{borderRadiusOuter:Math.min(t.borderRadiusOuter,4)}))),tM=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return jc("Tooltip",r=>{const{borderRadius:i,colorTextLightSolid:s,colorBgSpotlight:l}=r,c=fi(r,{tooltipMaxWidth:250,tooltipColor:s,tooltipBorderRadius:i,tooltipBg:l});return[t9(c),hB(r,"zoom-big-fast")]},n9,{resetStyle:!1,injectStyle:e})(t)},r9=sg.map(t=>`${t}-inverse`);function i9(t){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat(ze(r9),ze(sg)).includes(t):sg.includes(t)}function nM(t,e){const n=i9(e),r=Ze({[`${t}-${e}`]:e&&n}),i={},s={};return e&&!n&&(i.background=e,s["--antd-arrow-background-color"]=e),{className:r,overlayStyle:i,arrowStyle:s}}const s9=t=>{const{prefixCls:e,className:n,placement:r="top",title:i,color:s,overlayInnerStyle:l}=t,{getPrefixCls:c}=_.useContext(ui),f=c("tooltip",e),[d,g,m]=tM(f),v=nM(f,s),S=v.arrowStyle,E=Object.assign(Object.assign({},l),v.overlayStyle),w=Ze(g,m,f,`${f}-pure`,`${f}-placement-${r}`,n,v.className);return d(_.createElement("div",{className:w,style:S},_.createElement("div",{className:`${f}-arrow`}),_.createElement(Gx,Object.assign({},t,{className:g,prefixCls:f,overlayInnerStyle:E}),i)))};var a9=function(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};const o9=_.forwardRef((t,e)=>{var n,r;const{prefixCls:i,openClassName:s,getTooltipContainer:l,color:c,overlayInnerStyle:f,children:d,afterOpenChange:g,afterVisibleChange:m,destroyTooltipOnHide:v,arrow:S=!0,title:E,overlay:w,builtinPlacements:b,arrowPointAtCenter:A=!1,autoAdjustOverflow:T=!0,motion:C,getPopupContainer:M,placement:x="top",mouseEnterDelay:N=.1,mouseLeaveDelay:F=.1,overlayStyle:L,rootClassName:I,overlayClassName:V,styles:B,classNames:j}=t,X=a9(t,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),Y=!!S,[,ae]=Xs(),{getPopupContainer:U,getPrefixCls:z,direction:W,className:Z,style:P,classNames:$,styles:ie}=Vc("tooltip"),se=D3(),q=_.useRef(null),ce=()=>{var Je;(Je=q.current)===null||Je===void 0||Je.forceAlign()};_.useImperativeHandle(e,()=>{var Je,lt;return{forceAlign:ce,forcePopupAlign:()=>{se.deprecated(!1,"forcePopupAlign","forceAlign"),ce()},nativeElement:(Je=q.current)===null||Je===void 0?void 0:Je.nativeElement,popupElement:(lt=q.current)===null||lt===void 0?void 0:lt.popupElement}});const[fe,ye]=xc(!1,{value:(n=t.open)!==null&&n!==void 0?n:t.visible,defaultValue:(r=t.defaultOpen)!==null&&r!==void 0?r:t.defaultVisible}),we=!E&&!w&&E!==0,Ae=Je=>{var lt,ft;ye(we?!1:Je),we||((lt=t.onOpenChange)===null||lt===void 0||lt.call(t,Je),(ft=t.onVisibleChange)===null||ft===void 0||ft.call(t,Je))},Te=_.useMemo(()=>{var Je,lt;let ft=A;return typeof S=="object"&&(ft=(lt=(Je=S.pointAtCenter)!==null&&Je!==void 0?Je:S.arrowPointAtCenter)!==null&&lt!==void 0?lt:A),b||e9({arrowPointAtCenter:ft,autoAdjustOverflow:T,arrowWidth:Y?ae.sizePopupArrow:0,borderRadius:ae.borderRadius,offset:ae.marginXXS})},[A,S,b,ae]),ve=_.useMemo(()=>E===0?E:w||E||"",[w,E]),ge=_.createElement(wU,{space:!0},typeof ve=="function"?ve():ve),_e=z("tooltip",i),Ie=z(),Ee=t["data-popover-inject"];let xe=fe;!("open"in t)&&!("visible"in t)&&we&&(xe=!1);const Ve=_.isValidElement(d)&&!Tk(d)?d:_.createElement("span",null,d),Fe=Ve.props,Be=!Fe.className||typeof Fe.className=="string"?Ze(Fe.className,s||`${_e}-open`):Fe.className,[nt,He,Ge]=tM(_e,!Ee),Pe=nM(_e,c),Me=Pe.arrowStyle,dt=Ze(V,{[`${_e}-rtl`]:W==="rtl"},Pe.className,I,He,Ge,Z,$.root,j==null?void 0:j.root),rt=Ze($.body,j==null?void 0:j.body),[it,st]=dx("Tooltip",X.zIndex),at=_.createElement(q7,Object.assign({},X,{zIndex:it,showArrow:Y,placement:x,mouseEnterDelay:N,mouseLeaveDelay:F,prefixCls:_e,classNames:{root:dt,body:rt},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Me),ie.root),P),L),B==null?void 0:B.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},ie.body),f),B==null?void 0:B.body),Pe.overlayStyle)},getTooltipContainer:M||l||U,ref:q,builtinPlacements:Te,overlay:ge,visible:xe,onVisibleChange:Ae,afterVisibleChange:g??m,arrowContent:_.createElement("span",{className:`${_e}-arrow-content`}),motion:{motionName:hx(Ie,"zoom-big-fast",t.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!v}),xe?cx(Ve,{className:Be}):Ve);return nt(_.createElement(ux.Provider,{value:st},at))}),rM=o9;rM._InternalPanelDoNotUseOrYouWillBeFired=s9;function l9(t,e,n){var r=n||{},i=r.noTrailing,s=i===void 0?!1:i,l=r.noLeading,c=l===void 0?!1:l,f=r.debounceMode,d=f===void 0?void 0:f,g,m=!1,v=0;function S(){g&&clearTimeout(g)}function E(b){var A=b||{},T=A.upcomingOnly,C=T===void 0?!1:T;S(),m=!C}function w(){for(var b=arguments.length,A=new Array(b),T=0;T<b;T++)A[T]=arguments[T];var C=this,M=Date.now()-v;if(m)return;function x(){v=Date.now(),e.apply(C,A)}function N(){g=void 0}!c&&d&&!g&&x(),S(),d===void 0&&M>t?c?(v=Date.now(),s||(g=setTimeout(d?N:x,t))):x():s!==!0&&(g=setTimeout(d?N:x,d===void 0?t-M:t))}return w.cancel=E,w}function c9(t,e,n){var r={},i=r.atBegin,s=i===void 0?!1:i;return l9(t,e,{debounceMode:s!==!1})}function V_(t,e,n){return(t-e)/(n-e)}function bb(t,e,n,r){var i=V_(e,n,r),s={};switch(t){case"rtl":s.right="".concat(i*100,"%"),s.transform="translateX(50%)";break;case"btt":s.bottom="".concat(i*100,"%"),s.transform="translateY(50%)";break;case"ttb":s.top="".concat(i*100,"%"),s.transform="translateY(-50%)";break;default:s.left="".concat(i*100,"%"),s.transform="translateX(-50%)";break}return s}function yo(t,e){return Array.isArray(t)?t[e]:t}var Jo=_.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0,styles:{},classNames:{}}),u9=_.createContext({}),f9=["prefixCls","value","valueIndex","onStartMove","onDelete","style","render","dragging","draggingDelete","onOffsetChange","onChangeComplete","onFocus","onMouseEnter"],P2=_.forwardRef(function(t,e){var n=t.prefixCls,r=t.value,i=t.valueIndex,s=t.onStartMove,l=t.onDelete,c=t.style,f=t.render,d=t.dragging,g=t.draggingDelete,m=t.onOffsetChange,v=t.onChangeComplete,S=t.onFocus,E=t.onMouseEnter,w=Fn(t,f9),b=_.useContext(Jo),A=b.min,T=b.max,C=b.direction,M=b.disabled,x=b.keyboard,N=b.range,F=b.tabIndex,L=b.ariaLabelForHandle,I=b.ariaLabelledByForHandle,V=b.ariaRequired,B=b.ariaValueTextFormatterForHandle,j=b.styles,X=b.classNames,Y="".concat(n,"-handle"),ae=function(ce){M||s(ce,i)},U=function(ce){S==null||S(ce,i)},z=function(ce){E(ce,i)},W=function(ce){if(!M&&x){var fe=null;switch(ce.which||ce.keyCode){case et.LEFT:fe=C==="ltr"||C==="btt"?-1:1;break;case et.RIGHT:fe=C==="ltr"||C==="btt"?1:-1;break;case et.UP:fe=C!=="ttb"?1:-1;break;case et.DOWN:fe=C!=="ttb"?-1:1;break;case et.HOME:fe="min";break;case et.END:fe="max";break;case et.PAGE_UP:fe=2;break;case et.PAGE_DOWN:fe=-2;break;case et.BACKSPACE:case et.DELETE:l(i);break}fe!==null&&(ce.preventDefault(),m(fe,i))}},Z=function(ce){switch(ce.which||ce.keyCode){case et.LEFT:case et.RIGHT:case et.UP:case et.DOWN:case et.HOME:case et.END:case et.PAGE_UP:case et.PAGE_DOWN:v==null||v();break}},P=bb(C,r,A,T),$={};if(i!==null){var ie;$={tabIndex:M?null:yo(F,i),role:"slider","aria-valuemin":A,"aria-valuemax":T,"aria-valuenow":r,"aria-disabled":M,"aria-label":yo(L,i),"aria-labelledby":yo(I,i),"aria-required":yo(V,i),"aria-valuetext":(ie=yo(B,i))===null||ie===void 0?void 0:ie(r),"aria-orientation":C==="ltr"||C==="rtl"?"horizontal":"vertical",onMouseDown:ae,onTouchStart:ae,onFocus:U,onMouseEnter:z,onKeyDown:W,onKeyUp:Z}}var se=_.createElement("div",kt({ref:e,className:Ze(Y,K(K(K({},"".concat(Y,"-").concat(i+1),i!==null&&N),"".concat(Y,"-dragging"),d),"".concat(Y,"-dragging-delete"),g),X.handle),style:J(J(J({},P),c),j.handle)},$,w));return f&&(se=f(se,{index:i,prefixCls:n,value:r,dragging:d,draggingDelete:g})),se}),d9=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","activeHandleRender","draggingIndex","draggingDelete","onFocus"],h9=_.forwardRef(function(t,e){var n=t.prefixCls,r=t.style,i=t.onStartMove,s=t.onOffsetChange,l=t.values,c=t.handleRender,f=t.activeHandleRender,d=t.draggingIndex,g=t.draggingDelete,m=t.onFocus,v=Fn(t,d9),S=_.useRef({}),E=_.useState(!1),w=de(E,2),b=w[0],A=w[1],T=_.useState(-1),C=de(T,2),M=C[0],x=C[1],N=function(B){x(B),A(!0)},F=function(B,j){N(j),m==null||m(B)},L=function(B,j){N(j)};_.useImperativeHandle(e,function(){return{focus:function(B){var j;(j=S.current[B])===null||j===void 0||j.focus()},hideHelp:function(){$a.flushSync(function(){A(!1)})}}});var I=J({prefixCls:n,onStartMove:i,onOffsetChange:s,render:c,onFocus:F,onMouseEnter:L},v);return _.createElement(_.Fragment,null,l.map(function(V,B){var j=d===B;return _.createElement(P2,kt({ref:function(Y){Y?S.current[B]=Y:delete S.current[B]},dragging:j,draggingDelete:j&&g,style:yo(r,B),key:B,value:V,valueIndex:B},I))}),f&&b&&_.createElement(P2,kt({key:"a11y"},I,{value:l[M],valueIndex:null,dragging:d!==-1,draggingDelete:g,render:f,style:{pointerEvents:"none"},tabIndex:null,"aria-hidden":!0})))}),g9=function(e){var n=e.prefixCls,r=e.style,i=e.children,s=e.value,l=e.onClick,c=_.useContext(Jo),f=c.min,d=c.max,g=c.direction,m=c.includedStart,v=c.includedEnd,S=c.included,E="".concat(n,"-text"),w=bb(g,s,f,d);return _.createElement("span",{className:Ze(E,K({},"".concat(E,"-active"),S&&m<=s&&s<=v)),style:J(J({},w),r),onMouseDown:function(A){A.stopPropagation()},onClick:function(){l(s)}},i)},p9=function(e){var n=e.prefixCls,r=e.marks,i=e.onClick,s="".concat(n,"-mark");return r.length?_.createElement("div",{className:s},r.map(function(l){var c=l.value,f=l.style,d=l.label;return _.createElement(g9,{key:c,prefixCls:s,style:f,value:c,onClick:i},d)})):null},m9=function(e){var n=e.prefixCls,r=e.value,i=e.style,s=e.activeStyle,l=_.useContext(Jo),c=l.min,f=l.max,d=l.direction,g=l.included,m=l.includedStart,v=l.includedEnd,S="".concat(n,"-dot"),E=g&&m<=r&&r<=v,w=J(J({},bb(d,r,c,f)),typeof i=="function"?i(r):i);return E&&(w=J(J({},w),typeof s=="function"?s(r):s)),_.createElement("span",{className:Ze(S,K({},"".concat(S,"-active"),E)),style:w})},v9=function(e){var n=e.prefixCls,r=e.marks,i=e.dots,s=e.style,l=e.activeStyle,c=_.useContext(Jo),f=c.min,d=c.max,g=c.step,m=_.useMemo(function(){var v=new Set;if(r.forEach(function(E){v.add(E.value)}),i&&g!==null)for(var S=f;S<=d;)v.add(S),S+=g;return Array.from(v)},[f,d,g,i,r]);return _.createElement("div",{className:"".concat(n,"-step")},m.map(function(v){return _.createElement(m9,{prefixCls:n,key:v,value:v,style:s,activeStyle:l})}))},N2=function(e){var n=e.prefixCls,r=e.style,i=e.start,s=e.end,l=e.index,c=e.onStartMove,f=e.replaceCls,d=_.useContext(Jo),g=d.direction,m=d.min,v=d.max,S=d.disabled,E=d.range,w=d.classNames,b="".concat(n,"-track"),A=V_(i,m,v),T=V_(s,m,v),C=function(F){!S&&c&&c(F,-1)},M={};switch(g){case"rtl":M.right="".concat(A*100,"%"),M.width="".concat(T*100-A*100,"%");break;case"btt":M.bottom="".concat(A*100,"%"),M.height="".concat(T*100-A*100,"%");break;case"ttb":M.top="".concat(A*100,"%"),M.height="".concat(T*100-A*100,"%");break;default:M.left="".concat(A*100,"%"),M.width="".concat(T*100-A*100,"%")}var x=f||Ze(b,K(K({},"".concat(b,"-").concat(l+1),l!==null&&E),"".concat(n,"-track-draggable"),c),w.track);return _.createElement("div",{className:x,style:J(J({},M),r),onMouseDown:C,onTouchStart:C})},_9=function(e){var n=e.prefixCls,r=e.style,i=e.values,s=e.startPoint,l=e.onStartMove,c=_.useContext(Jo),f=c.included,d=c.range,g=c.min,m=c.styles,v=c.classNames,S=_.useMemo(function(){if(!d){if(i.length===0)return[];var w=s??g,b=i[0];return[{start:Math.min(w,b),end:Math.max(w,b)}]}for(var A=[],T=0;T<i.length-1;T+=1)A.push({start:i[T],end:i[T+1]});return A},[i,d,s,g]);if(!f)return null;var E=S!=null&&S.length&&(v.tracks||m.tracks)?_.createElement(N2,{index:null,prefixCls:n,start:S[0].start,end:S[S.length-1].end,replaceCls:Ze(v.tracks,"".concat(n,"-tracks")),style:m.tracks}):null;return _.createElement(_.Fragment,null,E,S.map(function(w,b){var A=w.start,T=w.end;return _.createElement(N2,{index:b,prefixCls:n,style:J(J({},yo(r,b)),m.track),start:A,end:T,key:b,onStartMove:l})}))},y9=130;function I2(t){var e="targetTouches"in t?t.targetTouches[0]:t;return{pageX:e.pageX,pageY:e.pageY}}function b9(t,e,n,r,i,s,l,c,f,d,g){var m=_.useState(null),v=de(m,2),S=v[0],E=v[1],w=_.useState(-1),b=de(w,2),A=b[0],T=b[1],C=_.useState(!1),M=de(C,2),x=M[0],N=M[1],F=_.useState(n),L=de(F,2),I=L[0],V=L[1],B=_.useState(n),j=de(B,2),X=j[0],Y=j[1],ae=_.useRef(null),U=_.useRef(null),z=_.useRef(null),W=_.useContext(u9),Z=W.onDragStart,P=W.onDragChange;Dn(function(){A===-1&&V(n)},[n,A]),_.useEffect(function(){return function(){document.removeEventListener("mousemove",ae.current),document.removeEventListener("mouseup",U.current),z.current&&(z.current.removeEventListener("touchmove",ae.current),z.current.removeEventListener("touchend",U.current))}},[]);var $=function(fe,ye,we){ye!==void 0&&E(ye),V(fe);var Ae=fe;we&&(Ae=fe.filter(function(Te,ve){return ve!==A})),l(Ae),P&&P({rawValues:fe,deleteIndex:we?A:-1,draggingIndex:A,draggingValue:ye})},ie=dr(function(ce,fe,ye){if(ce===-1){var we=X[0],Ae=X[X.length-1],Te=r-we,ve=i-Ae,ge=fe*(i-r);ge=Math.max(ge,Te),ge=Math.min(ge,ve);var _e=s(we+ge);ge=_e-we;var Ie=X.map(function(Fe){return Fe+ge});$(Ie)}else{var Ee=(i-r)*fe,xe=ze(I);xe[ce]=X[ce];var Ve=f(xe,Ee,ce,"dist");$(Ve.values,Ve.value,ye)}}),se=function(fe,ye,we){fe.stopPropagation();var Ae=we||n,Te=Ae[ye];T(ye),E(Te),Y(Ae),V(Ae),N(!1);var ve=I2(fe),ge=ve.pageX,_e=ve.pageY,Ie=!1;Z&&Z({rawValues:Ae,draggingIndex:ye,draggingValue:Te});var Ee=function(Fe){Fe.preventDefault();var Be=I2(Fe),nt=Be.pageX,He=Be.pageY,Ge=nt-ge,Pe=He-_e,Me=t.current.getBoundingClientRect(),dt=Me.width,rt=Me.height,it,st;switch(e){case"btt":it=-Pe/rt,st=Ge;break;case"ttb":it=Pe/rt,st=Ge;break;case"rtl":it=-Ge/dt,st=Pe;break;default:it=Ge/dt,st=Pe}Ie=d?Math.abs(st)>y9&&g<I.length:!1,N(Ie),ie(ye,it,Ie)},xe=function Ve(Fe){Fe.preventDefault(),document.removeEventListener("mouseup",Ve),document.removeEventListener("mousemove",Ee),z.current&&(z.current.removeEventListener("touchmove",ae.current),z.current.removeEventListener("touchend",U.current)),ae.current=null,U.current=null,z.current=null,c(Ie),T(-1),N(!1)};document.addEventListener("mouseup",xe),document.addEventListener("mousemove",Ee),fe.currentTarget.addEventListener("touchend",xe),fe.currentTarget.addEventListener("touchmove",Ee),ae.current=Ee,U.current=xe,z.current=fe.currentTarget},q=_.useMemo(function(){var ce=ze(n).sort(function(Te,ve){return Te-ve}),fe=ze(I).sort(function(Te,ve){return Te-ve}),ye={};fe.forEach(function(Te){ye[Te]=(ye[Te]||0)+1}),ce.forEach(function(Te){ye[Te]=(ye[Te]||0)-1});var we=d?1:0,Ae=Object.values(ye).reduce(function(Te,ve){return Te+Math.abs(ve)},0);return Ae<=we?I:n},[n,I,d]);return[A,S,x,q,se]}function S9(t,e,n,r,i,s){var l=_.useCallback(function(S){return Math.max(t,Math.min(e,S))},[t,e]),c=_.useCallback(function(S){if(n!==null){var E=t+Math.round((l(S)-t)/n)*n,w=function(C){return(String(C).split(".")[1]||"").length},b=Math.max(w(n),w(e),w(t)),A=Number(E.toFixed(b));return t<=A&&A<=e?A:null}return null},[n,t,e,l]),f=_.useCallback(function(S){var E=l(S),w=r.map(function(T){return T.value});n!==null&&w.push(c(S)),w.push(t,e);var b=w[0],A=e-t;return w.forEach(function(T){var C=Math.abs(E-T);C<=A&&(b=T,A=C)}),b},[t,e,r,n,l,c]),d=function S(E,w,b){var A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit";if(typeof w=="number"){var T,C=E[b],M=C+w,x=[];r.forEach(function(V){x.push(V.value)}),x.push(t,e),x.push(c(C));var N=w>0?1:-1;A==="unit"?x.push(c(C+N*n)):x.push(c(M)),x=x.filter(function(V){return V!==null}).filter(function(V){return w<0?V<=C:V>=C}),A==="unit"&&(x=x.filter(function(V){return V!==C}));var F=A==="unit"?C:M;T=x[0];var L=Math.abs(T-F);if(x.forEach(function(V){var B=Math.abs(V-F);B<L&&(T=V,L=B)}),T===void 0)return w<0?t:e;if(A==="dist")return T;if(Math.abs(w)>1){var I=ze(E);return I[b]=T,S(I,w-N,b,A)}return T}else{if(w==="min")return t;if(w==="max")return e}},g=function(E,w,b){var A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",T=E[b],C=d(E,w,b,A);return{value:C,changed:C!==T}},m=function(E){return s===null&&E===0||typeof s=="number"&&E<s},v=function(E,w,b){var A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",T=E.map(f),C=T[b],M=d(T,w,b,A);if(T[b]=M,i===!1){var x=s||0;b>0&&T[b-1]!==C&&(T[b]=Math.max(T[b],T[b-1]+x)),b<T.length-1&&T[b+1]!==C&&(T[b]=Math.min(T[b],T[b+1]-x))}else if(typeof s=="number"||s===null){for(var N=b+1;N<T.length;N+=1)for(var F=!0;m(T[N]-T[N-1])&&F;){var L=g(T,1,N);T[N]=L.value,F=L.changed}for(var I=b;I>0;I-=1)for(var V=!0;m(T[I]-T[I-1])&&V;){var B=g(T,-1,I-1);T[I-1]=B.value,V=B.changed}for(var j=T.length-1;j>0;j-=1)for(var X=!0;m(T[j]-T[j-1])&&X;){var Y=g(T,-1,j-1);T[j-1]=Y.value,X=Y.changed}for(var ae=0;ae<T.length-1;ae+=1)for(var U=!0;m(T[ae+1]-T[ae])&&U;){var z=g(T,1,ae+1);T[ae+1]=z.value,U=z.changed}}return{value:T[b],values:T}};return[f,v]}function w9(t){return _.useMemo(function(){if(t===!0||!t)return[!!t,!1,!1,0];var e=t.editable,n=t.draggableTrack,r=t.minCount,i=t.maxCount;return[!0,e,!e&&n,r||0,i]},[t])}var E9=_.forwardRef(function(t,e){var n=t.prefixCls,r=n===void 0?"rc-slider":n,i=t.className,s=t.style,l=t.classNames,c=t.styles,f=t.id,d=t.disabled,g=d===void 0?!1:d,m=t.keyboard,v=m===void 0?!0:m,S=t.autoFocus,E=t.onFocus,w=t.onBlur,b=t.min,A=b===void 0?0:b,T=t.max,C=T===void 0?100:T,M=t.step,x=M===void 0?1:M,N=t.value,F=t.defaultValue,L=t.range,I=t.count,V=t.onChange,B=t.onBeforeChange,j=t.onAfterChange,X=t.onChangeComplete,Y=t.allowCross,ae=Y===void 0?!0:Y,U=t.pushable,z=U===void 0?!1:U,W=t.reverse,Z=t.vertical,P=t.included,$=P===void 0?!0:P,ie=t.startPoint,se=t.trackStyle,q=t.handleStyle,ce=t.railStyle,fe=t.dotStyle,ye=t.activeDotStyle,we=t.marks,Ae=t.dots,Te=t.handleRender,ve=t.activeHandleRender,ge=t.track,_e=t.tabIndex,Ie=_e===void 0?0:_e,Ee=t.ariaLabelForHandle,xe=t.ariaLabelledByForHandle,Ve=t.ariaRequired,Fe=t.ariaValueTextFormatterForHandle,Be=_.useRef(null),nt=_.useRef(null),He=_.useMemo(function(){return Z?W?"ttb":"btt":W?"rtl":"ltr"},[W,Z]),Ge=w9(L),Pe=de(Ge,5),Me=Pe[0],dt=Pe[1],rt=Pe[2],it=Pe[3],st=Pe[4],at=_.useMemo(function(){return isFinite(A)?A:0},[A]),Je=_.useMemo(function(){return isFinite(C)?C:100},[C]),lt=_.useMemo(function(){return x!==null&&x<=0?1:x},[x]),ft=_.useMemo(function(){return typeof z=="boolean"?z?lt:!1:z>=0?z:!1},[z,lt]),ct=_.useMemo(function(){return Object.keys(we||{}).map(function(De){var be=we[De],ut={value:Number(De)};return be&&pt(be)==="object"&&!_.isValidElement(be)&&("label"in be||"style"in be)?(ut.style=be.style,ut.label=be.label):ut.label=be,ut}).filter(function(De){var be=De.label;return be||typeof be=="number"}).sort(function(De,be){return De.value-be.value})},[we]),mt=S9(at,Je,lt,ct,ae,ft),xt=de(mt,2),Bt=xt[0],ht=xt[1],Vt=xc(F,{value:N}),qt=de(Vt,2),En=qt[0],Mn=qt[1],Ut=_.useMemo(function(){var De=En==null?[]:Array.isArray(En)?En:[En],be=de(De,1),ut=be[0],zt=ut===void 0?at:ut,Ot=En===null?[]:[zt];if(Me){if(Ot=ze(De),I||En===void 0){var In=I>=0?I+1:2;for(Ot=Ot.slice(0,In);Ot.length<In;){var tn;Ot.push((tn=Ot[Ot.length-1])!==null&&tn!==void 0?tn:at)}}Ot.sort(function(Vn,Pn){return Vn-Pn})}return Ot.forEach(function(Vn,Pn){Ot[Pn]=Bt(Vn)}),Ot},[En,Me,at,I,Bt]),It=function(be){return Me?be:be[0]},Lt=dr(function(De){var be=ze(De).sort(function(ut,zt){return ut-zt});V&&!ng(be,Ut,!0)&&V(It(be)),Mn(be)}),Jt=dr(function(De){De&&Be.current.hideHelp();var be=It(Ut);j==null||j(be),Ur(!j,"[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead."),X==null||X(be)}),Mt=function(be){if(!(g||!dt||Ut.length<=it)){var ut=ze(Ut);ut.splice(be,1),B==null||B(It(ut)),Lt(ut);var zt=Math.max(0,be-1);Be.current.hideHelp(),Be.current.focus(zt)}},qe=b9(nt,He,Ut,at,Je,Bt,Lt,Jt,ht,dt,it),ke=de(qe,5),Ne=ke[0],wt=ke[1],en=ke[2],Ue=ke[3],Oe=ke[4],je=function(be,ut){if(!g){var zt=ze(Ut),Ot=0,In=0,tn=Je-at;Ut.forEach(function(er,Un){var Tn=Math.abs(be-er);Tn<=tn&&(tn=Tn,Ot=Un),er<be&&(In=Un)});var Vn=Ot;dt&&tn!==0&&(!st||Ut.length<st)?(zt.splice(In+1,0,be),Vn=In+1):zt[Ot]=be,Me&&!Ut.length&&I===void 0&&zt.push(be);var Pn=It(zt);if(B==null||B(Pn),Lt(zt),ut){var Bn,Nr;(Bn=document.activeElement)===null||Bn===void 0||(Nr=Bn.blur)===null||Nr===void 0||Nr.call(Bn),Be.current.focus(Vn),Oe(ut,Vn,zt)}else j==null||j(Pn),Ur(!j,"[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead."),X==null||X(Pn)}},Ye=function(be){be.preventDefault();var ut=nt.current.getBoundingClientRect(),zt=ut.width,Ot=ut.height,In=ut.left,tn=ut.top,Vn=ut.bottom,Pn=ut.right,Bn=be.clientX,Nr=be.clientY,er;switch(He){case"btt":er=(Vn-Nr)/Ot;break;case"ttb":er=(Nr-tn)/Ot;break;case"rtl":er=(Pn-Bn)/zt;break;default:er=(Bn-In)/zt}var Un=at+er*(Je-at);je(Bt(Un),be)},We=_.useState(null),Qe=de(We,2),bt=Qe[0],_t=Qe[1],Zt=function(be,ut){if(!g){var zt=ht(Ut,be,ut);B==null||B(It(Ut)),Lt(zt.values),_t(zt.value)}};_.useEffect(function(){if(bt!==null){var De=Ut.indexOf(bt);De>=0&&Be.current.focus(De)}_t(null)},[bt]);var Yt=_.useMemo(function(){return rt&&lt===null?!1:rt},[rt,lt]),vn=dr(function(De,be){Oe(De,be),B==null||B(It(Ut))}),On=Ne!==-1;_.useEffect(function(){if(!On){var De=Ut.lastIndexOf(wt);Be.current.focus(De)}},[On]);var _n=_.useMemo(function(){return ze(Ue).sort(function(De,be){return De-be})},[Ue]),Zn=_.useMemo(function(){return Me?[_n[0],_n[_n.length-1]]:[at,_n[0]]},[_n,Me,at]),un=de(Zn,2),rn=un[0],Ce=un[1];_.useImperativeHandle(e,function(){return{focus:function(){Be.current.focus(0)},blur:function(){var be,ut=document,zt=ut.activeElement;(be=nt.current)!==null&&be!==void 0&&be.contains(zt)&&(zt==null||zt.blur())}}}),_.useEffect(function(){S&&Be.current.focus(0)},[]);var Le=_.useMemo(function(){return{min:at,max:Je,direction:He,disabled:g,keyboard:v,step:lt,included:$,includedStart:rn,includedEnd:Ce,range:Me,tabIndex:Ie,ariaLabelForHandle:Ee,ariaLabelledByForHandle:xe,ariaRequired:Ve,ariaValueTextFormatterForHandle:Fe,styles:c||{},classNames:l||{}}},[at,Je,He,g,v,lt,$,rn,Ce,Me,Ie,Ee,xe,Ve,Fe,c,l]);return _.createElement(Jo.Provider,{value:Le},_.createElement("div",{ref:nt,className:Ze(r,i,K(K(K(K({},"".concat(r,"-disabled"),g),"".concat(r,"-vertical"),Z),"".concat(r,"-horizontal"),!Z),"".concat(r,"-with-marks"),ct.length)),style:s,onMouseDown:Ye,id:f},_.createElement("div",{className:Ze("".concat(r,"-rail"),l==null?void 0:l.rail),style:J(J({},ce),c==null?void 0:c.rail)}),ge!==!1&&_.createElement(_9,{prefixCls:r,style:se,values:Ut,startPoint:ie,onStartMove:Yt?vn:void 0}),_.createElement(v9,{prefixCls:r,marks:ct,dots:Ae,style:fe,activeStyle:ye}),_.createElement(h9,{ref:Be,prefixCls:r,style:q,values:Ue,draggingIndex:Ne,draggingDelete:en,onStartMove:vn,onOffsetChange:Zt,onFocus:E,onBlur:w,handleRender:Te,activeHandleRender:ve,onChangeComplete:Jt,onDelete:dt?Mt:void 0}),_.createElement(p9,{prefixCls:r,marks:ct,onClick:je})))});const T9=_.createContext({}),D2=_.forwardRef((t,e)=>{const{open:n,draggingDelete:r}=t,i=_.useRef(null),s=n&&!r,l=_.useRef(null);function c(){hr.cancel(l.current),l.current=null}function f(){l.current=hr(()=>{var d;(d=i.current)===null||d===void 0||d.forceAlign(),l.current=null})}return _.useEffect(()=>(s?f():c(),c),[s,t.title]),_.createElement(rM,Object.assign({ref:op(i,e)},t,{open:s}))}),A9=t=>{const{componentCls:e,antCls:n,controlSize:r,dotSize:i,marginFull:s,marginPart:l,colorFillContentHover:c,handleColorDisabled:f,calc:d,handleSize:g,handleSizeHover:m,handleActiveColor:v,handleActiveOutlineColor:S,handleLineWidth:E,handleLineWidthHover:w,motionDurationMid:b}=t;return{[e]:Object.assign(Object.assign({},Hc(t)),{position:"relative",height:r,margin:`${Rt(l)} ${Rt(s)}`,padding:0,cursor:"pointer",touchAction:"none","&-vertical":{margin:`${Rt(s)} ${Rt(l)}`},[`${e}-rail`]:{position:"absolute",backgroundColor:t.railBg,borderRadius:t.borderRadiusXS,transition:`background-color ${b}`},[`${e}-track,${e}-tracks`]:{position:"absolute",transition:`background-color ${b}`},[`${e}-track`]:{backgroundColor:t.trackBg,borderRadius:t.borderRadiusXS},[`${e}-track-draggable`]:{boxSizing:"content-box",backgroundClip:"content-box",border:"solid rgba(0,0,0,0)"},"&:hover":{[`${e}-rail`]:{backgroundColor:t.railHoverBg},[`${e}-track`]:{backgroundColor:t.trackHoverBg},[`${e}-dot`]:{borderColor:c},[`${e}-handle::after`]:{boxShadow:`0 0 0 ${Rt(E)} ${t.colorPrimaryBorderHover}`},[`${e}-dot-active`]:{borderColor:t.dotActiveBorderColor}},[`${e}-handle`]:{position:"absolute",width:g,height:g,outline:"none",userSelect:"none","&-dragging-delete":{opacity:0},"&::before":{content:'""',position:"absolute",insetInlineStart:d(E).mul(-1).equal(),insetBlockStart:d(E).mul(-1).equal(),width:d(g).add(d(E).mul(2)).equal(),height:d(g).add(d(E).mul(2)).equal(),backgroundColor:"transparent"},"&::after":{content:'""',position:"absolute",insetBlockStart:0,insetInlineStart:0,width:g,height:g,backgroundColor:t.colorBgElevated,boxShadow:`0 0 0 ${Rt(E)} ${t.handleColor}`,outline:"0px solid transparent",borderRadius:"50%",cursor:"pointer",transition:`
inset-inline-start ${b},
inset-block-start ${b},
width ${b},
height ${b},
box-shadow ${b},
outline ${b}
`},"&:hover, &:active, &:focus":{"&::before":{insetInlineStart:d(m).sub(g).div(2).add(w).mul(-1).equal(),insetBlockStart:d(m).sub(g).div(2).add(w).mul(-1).equal(),width:d(m).add(d(w).mul(2)).equal(),height:d(m).add(d(w).mul(2)).equal()},"&::after":{boxShadow:`0 0 0 ${Rt(w)} ${v}`,outline:`6px solid ${S}`,width:m,height:m,insetInlineStart:t.calc(g).sub(m).div(2).equal(),insetBlockStart:t.calc(g).sub(m).div(2).equal()}}},[`&-lock ${e}-handle`]:{"&::before, &::after":{transition:"none"}},[`${e}-mark`]:{position:"absolute",fontSize:t.fontSize},[`${e}-mark-text`]:{position:"absolute",display:"inline-block",color:t.colorTextDescription,textAlign:"center",wordBreak:"keep-all",cursor:"pointer",userSelect:"none","&-active":{color:t.colorText}},[`${e}-step`]:{position:"absolute",background:"transparent",pointerEvents:"none"},[`${e}-dot`]:{position:"absolute",width:i,height:i,backgroundColor:t.colorBgElevated,border:`${Rt(E)} solid ${t.dotBorderColor}`,borderRadius:"50%",cursor:"pointer",transition:`border-color ${t.motionDurationSlow}`,pointerEvents:"auto","&-active":{borderColor:t.dotActiveBorderColor}},[`&${e}-disabled`]:{cursor:"not-allowed",[`${e}-rail`]:{backgroundColor:`${t.railBg} !important`},[`${e}-track`]:{backgroundColor:`${t.trackBgDisabled} !important`},[`
${e}-dot
`]:{backgroundColor:t.colorBgElevated,borderColor:t.trackBgDisabled,boxShadow:"none",cursor:"not-allowed"},[`${e}-handle::after`]:{backgroundColor:t.colorBgElevated,cursor:"not-allowed",width:g,height:g,boxShadow:`0 0 0 ${Rt(E)} ${f}`,insetInlineStart:0,insetBlockStart:0},[`
${e}-mark-text,
${e}-dot
`]:{cursor:"not-allowed !important"}},[`&-tooltip ${n}-tooltip-inner`]:{minWidth:"unset"}})}},iM=(t,e)=>{const{componentCls:n,railSize:r,handleSize:i,dotSize:s,marginFull:l,calc:c}=t,f=e?"paddingBlock":"paddingInline",d=e?"width":"height",g=e?"height":"width",m=e?"insetBlockStart":"insetInlineStart",v=e?"top":"insetInlineStart",S=c(r).mul(3).sub(i).div(2).equal(),E=c(i).sub(r).div(2).equal(),w=e?{borderWidth:`${Rt(E)} 0`,transform:`translateY(${Rt(c(E).mul(-1).equal())})`}:{borderWidth:`0 ${Rt(E)}`,transform:`translateX(${Rt(t.calc(E).mul(-1).equal())})`};return{[f]:r,[g]:c(r).mul(3).equal(),[`${n}-rail`]:{[d]:"100%",[g]:r},[`${n}-track,${n}-tracks`]:{[g]:r},[`${n}-track-draggable`]:Object.assign({},w),[`${n}-handle`]:{[m]:S},[`${n}-mark`]:{insetInlineStart:0,top:0,[v]:c(r).mul(3).add(e?0:l).equal(),[d]:"100%"},[`${n}-step`]:{insetInlineStart:0,top:0,[v]:r,[d]:"100%",[g]:r},[`${n}-dot`]:{position:"absolute",[m]:c(r).sub(s).div(2).equal()}}},C9=t=>{const{componentCls:e,marginPartWithMark:n}=t;return{[`${e}-horizontal`]:Object.assign(Object.assign({},iM(t,!0)),{[`&${e}-with-marks`]:{marginBottom:n}})}},R9=t=>{const{componentCls:e}=t;return{[`${e}-vertical`]:Object.assign(Object.assign({},iM(t,!1)),{height:"100%"})}},x9=t=>{const n=t.controlHeightLG/4,r=t.controlHeightSM/2,i=t.lineWidth+1,s=t.lineWidth+1*1.5,l=t.colorPrimary,c=new wn(l).setA(.2).toRgbString();return{controlSize:n,railSize:4,handleSize:n,handleSizeHover:r,dotSize:8,handleLineWidth:i,handleLineWidthHover:s,railBg:t.colorFillTertiary,railHoverBg:t.colorFillSecondary,trackBg:t.colorPrimaryBorder,trackHoverBg:t.colorPrimaryBorderHover,handleColor:t.colorPrimaryBorder,handleActiveColor:l,handleActiveOutlineColor:c,handleColorDisabled:new wn(t.colorTextDisabled).onBackground(t.colorBgContainer).toHexString(),dotBorderColor:t.colorBorderSecondary,dotActiveBorderColor:t.colorPrimaryBorder,trackBgDisabled:t.colorBgContainerDisabled}},M9=jc("Slider",t=>{const e=fi(t,{marginPart:t.calc(t.controlHeight).sub(t.controlSize).div(2).equal(),marginFull:t.calc(t.controlSize).div(2).equal(),marginPartWithMark:t.calc(t.controlHeightLG).sub(t.controlSize).equal()});return[A9(e),C9(e),R9(e)]},x9);function Jv(){const[t,e]=_.useState(!1),n=_.useRef(null),r=()=>{hr.cancel(n.current)},i=s=>{r(),s?e(s):n.current=hr(()=>{e(s)})};return _.useEffect(()=>r,[]),[t,i]}var O9=function(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 P9(t,e){return t||t===null?t:e||e===null?e:n=>typeof n=="number"?n.toString():""}const N9=Ft.forwardRef((t,e)=>{const{prefixCls:n,range:r,className:i,rootClassName:s,style:l,disabled:c,tooltipPrefixCls:f,tipFormatter:d,tooltipVisible:g,getTooltipPopupContainer:m,tooltipPlacement:v,tooltip:S={},onChangeComplete:E,classNames:w,styles:b}=t,A=O9(t,["prefixCls","range","className","rootClassName","style","disabled","tooltipPrefixCls","tipFormatter","tooltipVisible","getTooltipPopupContainer","tooltipPlacement","tooltip","onChangeComplete","classNames","styles"]),{vertical:T}=t,{getPrefixCls:C,direction:M,className:x,style:N,classNames:F,styles:L,getPopupContainer:I}=Vc("slider"),V=Ft.useContext(xf),B=c??V,{handleRender:j,direction:X}=Ft.useContext(T9),ae=(X||M)==="rtl",[U,z]=Jv(),[W,Z]=Jv(),P=Object.assign({},S),{open:$,placement:ie,getPopupContainer:se,prefixCls:q,formatter:ce}=P,fe=$??g,ye=(U||W)&&fe!==!1,we=P9(ce,d),[Ae,Te]=Jv(),ve=Me=>{E==null||E(Me),Te(!1)},ge=(Me,dt)=>Me||(dt?ae?"left":"right":"top"),_e=C("slider",n),[Ie,Ee,xe]=M9(_e),Ve=Ze(i,x,F.root,w==null?void 0:w.root,s,{[`${_e}-rtl`]:ae,[`${_e}-lock`]:Ae},Ee,xe);ae&&!A.vertical&&(A.reverse=!A.reverse),Ft.useEffect(()=>{const Me=()=>{hr(()=>{Z(!1)},1)};return document.addEventListener("mouseup",Me),()=>{document.removeEventListener("mouseup",Me)}},[]);const Fe=r&&!fe,Be=j||((Me,dt)=>{const{index:rt}=dt,it=Me.props;function st(ft,ct,mt){var xt,Bt,ht,Vt;mt&&((Bt=(xt=A)[ft])===null||Bt===void 0||Bt.call(xt,ct)),(Vt=(ht=it)[ft])===null||Vt===void 0||Vt.call(ht,ct)}const at=Object.assign(Object.assign({},it),{onMouseEnter:ft=>{z(!0),st("onMouseEnter",ft)},onMouseLeave:ft=>{z(!1),st("onMouseLeave",ft)},onMouseDown:ft=>{Z(!0),Te(!0),st("onMouseDown",ft)},onFocus:ft=>{var ct;Z(!0),(ct=A.onFocus)===null||ct===void 0||ct.call(A,ft),st("onFocus",ft,!0)},onBlur:ft=>{var ct;Z(!1),(ct=A.onBlur)===null||ct===void 0||ct.call(A,ft),st("onBlur",ft,!0)}}),Je=Ft.cloneElement(Me,at),lt=(!!fe||ye)&&we!==null;return Fe?Je:Ft.createElement(D2,Object.assign({},P,{prefixCls:C("tooltip",q??f),title:we?we(dt.value):"",open:lt,placement:ge(ie??v,T),key:rt,classNames:{root:`${_e}-tooltip`},getPopupContainer:se||m||I}),Je)}),nt=Fe?(Me,dt)=>{const rt=Ft.cloneElement(Me,{style:Object.assign(Object.assign({},Me.props.style),{visibility:"hidden"})});return Ft.createElement(D2,Object.assign({},P,{prefixCls:C("tooltip",q??f),title:we?we(dt.value):"",open:we!==null&&ye,placement:ge(ie??v,T),key:"tooltip",classNames:{root:`${_e}-tooltip`},getPopupContainer:se||m||I,draggingDelete:dt.draggingDelete}),rt)}:void 0,He=Object.assign(Object.assign(Object.assign(Object.assign({},L.root),N),b==null?void 0:b.root),l),Ge=Object.assign(Object.assign({},L.tracks),b==null?void 0:b.tracks),Pe=Ze(F.tracks,w==null?void 0:w.tracks);return Ie(Ft.createElement(E9,Object.assign({},A,{classNames:Object.assign({handle:Ze(F.handle,w==null?void 0:w.handle),rail:Ze(F.rail,w==null?void 0:w.rail),track:Ze(F.track,w==null?void 0:w.track)},Pe?{tracks:Pe}:{}),styles:Object.assign({handle:Object.assign(Object.assign({},L.handle),b==null?void 0:b.handle),rail:Object.assign(Object.assign({},L.rail),b==null?void 0:b.rail),track:Object.assign(Object.assign({},L.track),b==null?void 0:b.track)},Object.keys(Ge).length?{tracks:Ge}:{}),step:A.step,range:r,className:Ve,style:He,disabled:B,ref:e,prefixCls:_e,handleRender:Be,activeHandleRender:nt,onChangeComplete:ve})))});function F2(t){return["small","middle","large"].includes(t)}function k2(t){return t?typeof t=="number"&&!Number.isNaN(t):!1}const sM=Ft.createContext({latestIndex:0}),I9=sM.Provider,D9=t=>{let{className:e,index:n,children:r,split:i,style:s}=t;const{latestIndex:l}=_.useContext(sM);return r==null?null:_.createElement(_.Fragment,null,_.createElement("div",{className:e,style:s},r),n<l&&i&&_.createElement("span",{className:`${e}-split`},i))};var F9=function(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};const k9=_.forwardRef((t,e)=>{var n;const{getPrefixCls:r,direction:i,size:s,className:l,style:c,classNames:f,styles:d}=Vc("space"),{size:g=s??"small",align:m,className:v,rootClassName:S,children:E,direction:w="horizontal",prefixCls:b,split:A,style:T,wrap:C=!1,classNames:M,styles:x}=t,N=F9(t,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[F,L]=Array.isArray(g)?g:[g,g],I=F2(L),V=F2(F),B=k2(L),j=k2(F),X=Ho(E,{keepEmpty:!0}),Y=m===void 0&&w==="horizontal"?"center":m,ae=r("space",b),[U,z,W]=mx(ae),Z=Ze(ae,l,z,`${ae}-${w}`,{[`${ae}-rtl`]:i==="rtl",[`${ae}-align-${Y}`]:Y,[`${ae}-gap-row-${L}`]:I,[`${ae}-gap-col-${F}`]:V},v,S,W),P=Ze(`${ae}-item`,(n=M==null?void 0:M.item)!==null&&n!==void 0?n:f.item);let $=0;const ie=X.map((ce,fe)=>{var ye;ce!=null&&($=fe);const we=(ce==null?void 0:ce.key)||`${P}-${fe}`;return _.createElement(D9,{className:P,key:we,index:fe,split:A,style:(ye=x==null?void 0:x.item)!==null&&ye!==void 0?ye:d.item},ce)}),se=_.useMemo(()=>({latestIndex:$}),[$]);if(X.length===0)return null;const q={};return C&&(q.flexWrap="wrap"),!V&&j&&(q.columnGap=F),!I&&B&&(q.rowGap=L),U(_.createElement("div",Object.assign({ref:e,className:Z,style:Object.assign(Object.assign(Object.assign({},q),c),T)},N),_.createElement(I9,{value:se},ie)))}),aM=k9;aM.Compact=Lk;const ug=100,oM=ug/5,lM=ug/2-oM/2,e0=lM*2*Math.PI,B2=50,U2=t=>{const{dotClassName:e,style:n,hasCircleCls:r}=t;return _.createElement("circle",{className:Ze(`${e}-circle`,{[`${e}-circle-bg`]:r}),r:lM,cx:B2,cy:B2,strokeWidth:oM,style:n})},B9=t=>{let{percent:e,prefixCls:n}=t;const r=`${n}-dot`,i=`${r}-holder`,s=`${i}-hidden`,[l,c]=_.useState(!1);Dn(()=>{e!==0&&c(!0)},[e!==0]);const f=Math.max(Math.min(e,100),0);if(!l)return null;const d={strokeDashoffset:`${e0/4}`,strokeDasharray:`${e0*f/100} ${e0*(100-f)/100}`};return _.createElement("span",{className:Ze(i,`${r}-progress`,f<=0&&s)},_.createElement("svg",{viewBox:`0 0 ${ug} ${ug}`,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":f},_.createElement(U2,{dotClassName:r,hasCircleCls:!0}),_.createElement(U2,{dotClassName:r,style:d})))};function U9(t){const{prefixCls:e,percent:n=0}=t,r=`${e}-dot`,i=`${r}-holder`,s=`${i}-hidden`;return _.createElement(_.Fragment,null,_.createElement("span",{className:Ze(i,n>0&&s)},_.createElement("span",{className:Ze(r,`${e}-dot-spin`)},[1,2,3,4].map(l=>_.createElement("i",{className:`${e}-dot-item`,key:l})))),_.createElement(B9,{prefixCls:e,percent:n}))}function L9(t){const{prefixCls:e,indicator:n,percent:r}=t,i=`${e}-dot`;return n&&_.isValidElement(n)?cx(n,{className:Ze(n.props.className,i),percent:r}):_.createElement(U9,{prefixCls:e,percent:r})}const z9=new ln("antSpinMove",{to:{opacity:1}}),$9=new ln("antRotate",{to:{transform:"rotate(405deg)"}}),V9=t=>{const{componentCls:e,calc:n}=t;return{[e]:Object.assign(Object.assign({},Hc(t)),{position:"absolute",display:"none",color:t.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${t.motionDurationSlow} ${t.motionEaseInOutCirc}`,"&-spinning":{position:"relative",display:"inline-block",opacity:1},[`${e}-text`]:{fontSize:t.fontSize,paddingTop:n(n(t.dotSize).sub(t.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:t.colorBgMask,zIndex:t.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${t.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[e]:{[`${e}-dot-holder`]:{color:t.colorWhite},[`${e}-text`]:{color:t.colorTextLightSolid}}},"&-nested-loading":{position:"relative",[`> div > ${e}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:t.contentHeight,[`${e}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(t.dotSize).mul(-1).div(2).equal()},[`${e}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${t.colorBgContainer}`},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${e}-dot`]:{margin:n(t.dotSizeSM).mul(-1).div(2).equal()},[`${e}-text`]:{paddingTop:n(n(t.dotSizeSM).sub(t.fontSize)).div(2).add(2).equal()},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${e}-dot`]:{margin:n(t.dotSizeLG).mul(-1).div(2).equal()},[`${e}-text`]:{paddingTop:n(n(t.dotSizeLG).sub(t.fontSize)).div(2).add(2).equal()},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${e}-container`]:{position:"relative",transition:`opacity ${t.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:t.colorBgContainer,opacity:0,transition:`all ${t.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${e}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:t.spinDotDefault},[`${e}-dot-holder`]:{width:"1em",height:"1em",fontSize:t.dotSize,display:"inline-block",transition:`transform ${t.motionDurationSlow} ease, opacity ${t.motionDurationSlow} ease`,transformOrigin:"50% 50%",lineHeight:1,color:t.colorPrimary,"&-hidden":{transform:"scale(0.3)",opacity:0}},[`${e}-dot-progress`]:{position:"absolute",inset:0},[`${e}-dot`]:{position:"relative",display:"inline-block",fontSize:t.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(t.dotSize).sub(n(t.marginXXS).div(2)).div(2).equal(),height:n(t.dotSize).sub(n(t.marginXXS).div(2)).div(2).equal(),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:z9,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:$9,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(r=>`${r} ${t.motionDurationSlow} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:t.colorFillSecondary}},[`&-sm ${e}-dot`]:{"&, &-holder":{fontSize:t.dotSizeSM}},[`&-sm ${e}-dot-holder`]:{i:{width:n(n(t.dotSizeSM).sub(n(t.marginXXS).div(2))).div(2).equal(),height:n(n(t.dotSizeSM).sub(n(t.marginXXS).div(2))).div(2).equal()}},[`&-lg ${e}-dot`]:{"&, &-holder":{fontSize:t.dotSizeLG}},[`&-lg ${e}-dot-holder`]:{i:{width:n(n(t.dotSizeLG).sub(t.marginXXS)).div(2).equal(),height:n(n(t.dotSizeLG).sub(t.marginXXS)).div(2).equal()}},[`&${e}-show-text ${e}-text`]:{display:"block"}})}},H9=t=>{const{controlHeightLG:e,controlHeight:n}=t;return{contentHeight:400,dotSize:e/2,dotSizeSM:e*.35,dotSizeLG:n}},j9=jc("Spin",t=>{const e=fi(t,{spinDotDefault:t.colorTextDescription});return[V9(e)]},H9),W9=200,L2=[[30,.05],[70,.03],[96,.01]];function X9(t,e){const[n,r]=_.useState(0),i=_.useRef(null),s=e==="auto";return _.useEffect(()=>(s&&t&&(r(0),i.current=setInterval(()=>{r(l=>{const c=100-l;for(let f=0;f<L2.length;f+=1){const[d,g]=L2[f];if(l<=d)return l+c*g}return l})},W9)),()=>{clearInterval(i.current)}),[s,t]),s?n:e}var q9=function(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};let cM;function Y9(t,e){return!!t&&!!e&&!Number.isNaN(Number(e))}const uM=t=>{var e;const{prefixCls:n,spinning:r=!0,delay:i=0,className:s,rootClassName:l,size:c="default",tip:f,wrapperClassName:d,style:g,children:m,fullscreen:v=!1,indicator:S,percent:E}=t,w=q9(t,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen","indicator","percent"]),{getPrefixCls:b,direction:A,className:T,style:C,indicator:M}=Vc("spin"),x=b("spin",n),[N,F,L]=j9(x),[I,V]=_.useState(()=>r&&!Y9(r,i)),B=X9(I,E);_.useEffect(()=>{if(r){const W=c9(i,()=>{V(!0)});return W(),()=>{var Z;(Z=W==null?void 0:W.cancel)===null||Z===void 0||Z.call(W)}}V(!1)},[i,r]);const j=_.useMemo(()=>typeof m<"u"&&!v,[m,v]),X=Ze(x,T,{[`${x}-sm`]:c==="small",[`${x}-lg`]:c==="large",[`${x}-spinning`]:I,[`${x}-show-text`]:!!f,[`${x}-rtl`]:A==="rtl"},s,!v&&l,F,L),Y=Ze(`${x}-container`,{[`${x}-blur`]:I}),ae=(e=S??M)!==null&&e!==void 0?e:cM,U=Object.assign(Object.assign({},C),g),z=_.createElement("div",Object.assign({},w,{style:U,className:X,"aria-live":"polite","aria-busy":I}),_.createElement(L9,{prefixCls:x,indicator:ae,percent:B}),f&&(j||v)?_.createElement("div",{className:`${x}-text`},f):null);return N(j?_.createElement("div",Object.assign({},w,{className:Ze(`${x}-nested-loading`,d,F,L)}),I&&_.createElement("div",{key:"loading"},z),_.createElement("div",{className:Y,key:"container"},m)):v?_.createElement("div",{className:Ze(`${x}-fullscreen`,{[`${x}-fullscreen-show`]:I},l,F,L)},z):z)};uM.setDefaultIndicator=t=>{cM=t};function $h(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function K9(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function fM(t){let e,n,r;t.length!==2?(e=$h,n=(c,f)=>$h(t(c),f),r=(c,f)=>t(c)-f):(e=t===$h||t===K9?t:Z9,n=t,r=t);function i(c,f,d=0,g=c.length){if(d<g){if(e(f,f)!==0)return g;do{const m=d+g>>>1;n(c[m],f)<0?d=m+1:g=m}while(d<g)}return d}function s(c,f,d=0,g=c.length){if(d<g){if(e(f,f)!==0)return g;do{const m=d+g>>>1;n(c[m],f)<=0?d=m+1:g=m}while(d<g)}return d}function l(c,f,d=0,g=c.length){const m=i(c,f,d,g-1);return m>d&&r(c[m-1],f)>-r(c[m],f)?m-1:m}return{left:i,center:l,right:s}}function Z9(){return 0}function Q9(t){return t===null?NaN:+t}const G9=fM($h),J9=G9.right;fM(Q9).center;const ez=Math.sqrt(50),tz=Math.sqrt(10),nz=Math.sqrt(2);function fg(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),l=s>=ez?10:s>=tz?5:s>=nz?2:1;let c,f,d;return i<0?(d=Math.pow(10,-i)/l,c=Math.round(t*d),f=Math.round(e*d),c/d<t&&++c,f/d>e&&--f,d=-d):(d=Math.pow(10,i)*l,c=Math.round(t/d),f=Math.round(e/d),c*d<t&&++c,f*d>e&&--f),f<c&&.5<=n&&n<2?fg(t,e,n*2):[c,f,d]}function rz(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,s,l]=r?fg(e,t,n):fg(t,e,n);if(!(s>=i))return[];const c=s-i+1,f=new Array(c);if(r)if(l<0)for(let d=0;d<c;++d)f[d]=(s-d)/-l;else for(let d=0;d<c;++d)f[d]=(s-d)*l;else if(l<0)for(let d=0;d<c;++d)f[d]=(i+d)/-l;else for(let d=0;d<c;++d)f[d]=(i+d)*l;return f}function H_(t,e,n){return e=+e,t=+t,n=+n,fg(t,e,n)[2]}function iz(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?H_(e,t,n):H_(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function sz(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Sb(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function dM(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Jf(){}var Pf=.7,dg=1/Pf,sc="\\s*([+-]?\\d+)\\s*",Nf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",az=/^#([0-9a-f]{3,8})$/,oz=new RegExp(`^rgb\\(${sc},${sc},${sc}\\)$`),lz=new RegExp(`^rgb\\(${bs},${bs},${bs}\\)$`),cz=new RegExp(`^rgba\\(${sc},${sc},${sc},${Nf}\\)$`),uz=new RegExp(`^rgba\\(${bs},${bs},${bs},${Nf}\\)$`),fz=new RegExp(`^hsl\\(${Nf},${bs},${bs}\\)$`),dz=new RegExp(`^hsla\\(${Nf},${bs},${bs},${Nf}\\)$`),z2={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};Sb(Jf,If,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:$2,formatHex:$2,formatHex8:hz,formatHsl:gz,formatRgb:V2,toString:V2});function $2(){return this.rgb().formatHex()}function hz(){return this.rgb().formatHex8()}function gz(){return hM(this).formatHsl()}function V2(){return this.rgb().formatRgb()}function If(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=az.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?H2(e):n===3?new Zr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?vh(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?vh(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=oz.exec(t))?new Zr(e[1],e[2],e[3],1):(e=lz.exec(t))?new Zr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=cz.exec(t))?vh(e[1],e[2],e[3],e[4]):(e=uz.exec(t))?vh(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=fz.exec(t))?X2(e[1],e[2]/100,e[3]/100,1):(e=dz.exec(t))?X2(e[1],e[2]/100,e[3]/100,e[4]):z2.hasOwnProperty(t)?H2(z2[t]):t==="transparent"?new Zr(NaN,NaN,NaN,0):null}function H2(t){return new Zr(t>>16&255,t>>8&255,t&255,1)}function vh(t,e,n,r){return r<=0&&(t=e=n=NaN),new Zr(t,e,n,r)}function pz(t){return t instanceof Jf||(t=If(t)),t?(t=t.rgb(),new Zr(t.r,t.g,t.b,t.opacity)):new Zr}function j_(t,e,n,r){return arguments.length===1?pz(t):new Zr(t,e,n,r??1)}function Zr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Sb(Zr,j_,dM(Jf,{brighter(t){return t=t==null?dg:Math.pow(dg,t),new Zr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Pf:Math.pow(Pf,t),new Zr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Zr(ko(this.r),ko(this.g),ko(this.b),hg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:j2,formatHex:j2,formatHex8:mz,formatRgb:W2,toString:W2}));function j2(){return`#${To(this.r)}${To(this.g)}${To(this.b)}`}function mz(){return`#${To(this.r)}${To(this.g)}${To(this.b)}${To((isNaN(this.opacity)?1:this.opacity)*255)}`}function W2(){const t=hg(this.opacity);return`${t===1?"rgb(":"rgba("}${ko(this.r)}, ${ko(this.g)}, ${ko(this.b)}${t===1?")":`, ${t})`}`}function hg(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ko(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function To(t){return t=ko(t),(t<16?"0":"")+t.toString(16)}function X2(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Zi(t,e,n,r)}function hM(t){if(t instanceof Zi)return new Zi(t.h,t.s,t.l,t.opacity);if(t instanceof Jf||(t=If(t)),!t)return new Zi;if(t instanceof Zi)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),s=Math.max(e,n,r),l=NaN,c=s-i,f=(s+i)/2;return c?(e===s?l=(n-r)/c+(n<r)*6:n===s?l=(r-e)/c+2:l=(e-n)/c+4,c/=f<.5?s+i:2-s-i,l*=60):c=f>0&&f<1?0:l,new Zi(l,c,f,t.opacity)}function vz(t,e,n,r){return arguments.length===1?hM(t):new Zi(t,e,n,r??1)}function Zi(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Sb(Zi,vz,dM(Jf,{brighter(t){return t=t==null?dg:Math.pow(dg,t),new Zi(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Pf:Math.pow(Pf,t),new Zi(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Zr(t0(t>=240?t-240:t+120,i,r),t0(t,i,r),t0(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Zi(q2(this.h),_h(this.s),_h(this.l),hg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=hg(this.opacity);return`${t===1?"hsl(":"hsla("}${q2(this.h)}, ${_h(this.s)*100}%, ${_h(this.l)*100}%${t===1?")":`, ${t})`}`}}));function q2(t){return t=(t||0)%360,t<0?t+360:t}function _h(t){return Math.max(0,Math.min(1,t||0))}function t0(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const wb=t=>()=>t;function _z(t,e){return function(n){return t+n*e}}function yz(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function bz(t){return(t=+t)==1?gM:function(e,n){return n-e?yz(e,n,t):wb(isNaN(e)?n:e)}}function gM(t,e){var n=e-t;return n?_z(t,n):wb(isNaN(t)?e:t)}const Y2=function t(e){var n=bz(e);function r(i,s){var l=n((i=j_(i)).r,(s=j_(s)).r),c=n(i.g,s.g),f=n(i.b,s.b),d=gM(i.opacity,s.opacity);return function(g){return i.r=l(g),i.g=c(g),i.b=f(g),i.opacity=d(g),i+""}}return r.gamma=t,r}(1);function Sz(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=t[i]*(1-s)+e[i]*s;return r}}function wz(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Ez(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),s=new Array(n),l;for(l=0;l<r;++l)i[l]=Eb(t[l],e[l]);for(;l<n;++l)s[l]=e[l];return function(c){for(l=0;l<r;++l)s[l]=i[l](c);return s}}function Tz(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function gg(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Az(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=Eb(t[i],e[i]):r[i]=e[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var W_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,n0=new RegExp(W_.source,"g");function Cz(t){return function(){return t}}function Rz(t){return function(e){return t(e)+""}}function xz(t,e){var n=W_.lastIndex=n0.lastIndex=0,r,i,s,l=-1,c=[],f=[];for(t=t+"",e=e+"";(r=W_.exec(t))&&(i=n0.exec(e));)(s=i.index)>n&&(s=e.slice(n,s),c[l]?c[l]+=s:c[++l]=s),(r=r[0])===(i=i[0])?c[l]?c[l]+=i:c[++l]=i:(c[++l]=null,f.push({i:l,x:gg(r,i)})),n=n0.lastIndex;return n<e.length&&(s=e.slice(n),c[l]?c[l]+=s:c[++l]=s),c.length<2?f[0]?Rz(f[0].x):Cz(e):(e=f.length,function(d){for(var g=0,m;g<e;++g)c[(m=f[g]).i]=m.x(d);return c.join("")})}function Eb(t,e){var n=typeof e,r;return e==null||n==="boolean"?wb(e):(n==="number"?gg:n==="string"?(r=If(e))?(e=r,Y2):xz:e instanceof If?Y2:e instanceof Date?Tz:wz(e)?Sz:Array.isArray(e)?Ez:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Az:gg)(t,e)}function Mz(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Oz(t){return function(){return t}}function Pz(t){return+t}var K2=[0,1];function Zl(t){return t}function X_(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Oz(isNaN(e)?NaN:.5)}function Nz(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function Iz(t,e,n){var r=t[0],i=t[1],s=e[0],l=e[1];return i<r?(r=X_(i,r),s=n(l,s)):(r=X_(r,i),s=n(s,l)),function(c){return s(r(c))}}function Dz(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),s=new Array(r),l=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++l<r;)i[l]=X_(t[l],t[l+1]),s[l]=n(e[l],e[l+1]);return function(c){var f=J9(t,c,1,r)-1;return s[f](i[f](c))}}function Fz(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function kz(){var t=K2,e=K2,n=Eb,r,i,s,l=Zl,c,f,d;function g(){var v=Math.min(t.length,e.length);return l!==Zl&&(l=Nz(t[0],t[v-1])),c=v>2?Dz:Iz,f=d=null,m}function m(v){return v==null||isNaN(v=+v)?s:(f||(f=c(t.map(r),e,n)))(r(l(v)))}return m.invert=function(v){return l(i((d||(d=c(e,t.map(r),gg)))(v)))},m.domain=function(v){return arguments.length?(t=Array.from(v,Pz),g()):t.slice()},m.range=function(v){return arguments.length?(e=Array.from(v),g()):e.slice()},m.rangeRound=function(v){return e=Array.from(v),n=Mz,g()},m.clamp=function(v){return arguments.length?(l=v?!0:Zl,g()):l!==Zl},m.interpolate=function(v){return arguments.length?(n=v,g()):n},m.unknown=function(v){return arguments.length?(s=v,m):s},function(v,S){return r=v,i=S,g()}}function Bz(){return kz()(Zl,Zl)}function Uz(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function pg(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Oc(t){return t=pg(Math.abs(t)),t?t[1]:NaN}function Lz(t,e){return function(n,r){for(var i=n.length,s=[],l=0,c=t[0],f=0;i>0&&c>0&&(f+c+1>r&&(c=Math.max(1,r-f)),s.push(n.substring(i-=c,i+c)),!((f+=c+1)>r));)c=t[l=(l+1)%t.length];return s.reverse().join(e)}}function zz(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var $z=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function mg(t){if(!(e=$z.exec(t)))throw new Error("invalid format: "+t);var e;return new Tb({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}mg.prototype=Tb.prototype;function Tb(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Tb.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Vz(t){e:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break e;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var pM;function Hz(t,e){var n=pg(t,e);if(!n)return t+"";var r=n[0],i=n[1],s=i-(pM=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return s===l?r:s>l?r+new Array(s-l+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+pg(t,Math.max(0,e+s-1))[0]}function Z2(t,e){var n=pg(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Q2={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Uz,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Z2(t*100,e),r:Z2,s:Hz,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function G2(t){return t}var J2=Array.prototype.map,eA=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function jz(t){var e=t.grouping===void 0||t.thousands===void 0?G2:Lz(J2.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",s=t.numerals===void 0?G2:zz(J2.call(t.numerals,String)),l=t.percent===void 0?"%":t.percent+"",c=t.minus===void 0?"":t.minus+"",f=t.nan===void 0?"NaN":t.nan+"";function d(m){m=mg(m);var v=m.fill,S=m.align,E=m.sign,w=m.symbol,b=m.zero,A=m.width,T=m.comma,C=m.precision,M=m.trim,x=m.type;x==="n"?(T=!0,x="g"):Q2[x]||(C===void 0&&(C=12),M=!0,x="g"),(b||v==="0"&&S==="=")&&(b=!0,v="0",S="=");var N=w==="$"?n:w==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",F=w==="$"?r:/[%p]/.test(x)?l:"",L=Q2[x],I=/[defgprs%]/.test(x);C=C===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function V(B){var j=N,X=F,Y,ae,U;if(x==="c")X=L(B)+X,B="";else{B=+B;var z=B<0||1/B<0;if(B=isNaN(B)?f:L(Math.abs(B),C),M&&(B=Vz(B)),z&&+B==0&&E!=="+"&&(z=!1),j=(z?E==="("?E:c:E==="-"||E==="("?"":E)+j,X=(x==="s"?eA[8+pM/3]:"")+X+(z&&E==="("?")":""),I){for(Y=-1,ae=B.length;++Y<ae;)if(U=B.charCodeAt(Y),48>U||U>57){X=(U===46?i+B.slice(Y+1):B.slice(Y))+X,B=B.slice(0,Y);break}}}T&&!b&&(B=e(B,1/0));var W=j.length+B.length+X.length,Z=W<A?new Array(A-W+1).join(v):"";switch(T&&b&&(B=e(Z+B,Z.length?A-X.length:1/0),Z=""),S){case"<":B=j+B+X+Z;break;case"=":B=j+Z+B+X;break;case"^":B=Z.slice(0,W=Z.length>>1)+j+B+X+Z.slice(W);break;default:B=Z+j+B+X;break}return s(B)}return V.toString=function(){return m+""},V}function g(m,v){var S=d((m=mg(m),m.type="f",m)),E=Math.max(-8,Math.min(8,Math.floor(Oc(v)/3)))*3,w=Math.pow(10,-E),b=eA[8+E/3];return function(A){return S(w*A)+b}}return{format:d,formatPrefix:g}}var yh,mM,vM;Wz({thousands:",",grouping:[3],currency:["$",""]});function Wz(t){return yh=jz(t),mM=yh.format,vM=yh.formatPrefix,yh}function Xz(t){return Math.max(0,-Oc(Math.abs(t)))}function qz(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Oc(e)/3)))*3-Oc(Math.abs(t)))}function Yz(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Oc(e)-Oc(t))+1}function Kz(t,e,n,r){var i=iz(t,e,n),s;switch(r=mg(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(s=qz(i,l))&&(r.precision=s),vM(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=Yz(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=Xz(i))&&(r.precision=s-(r.type==="%")*2);break}}return mM(r)}function Zz(t){var e=t.domain;return t.ticks=function(n){var r=e();return rz(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Kz(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,s=r.length-1,l=r[i],c=r[s],f,d,g=10;for(c<l&&(d=l,l=c,c=d,d=i,i=s,s=d);g-- >0;){if(d=H_(l,c,n),d===f)return r[i]=l,r[s]=c,e(r);if(d>0)l=Math.floor(l/d)*d,c=Math.ceil(c/d)*d;else if(d<0)l=Math.ceil(l*d)/d,c=Math.floor(c*d)/d;else break;f=d}return t},t}function mp(){var t=Bz();return t.copy=function(){return Fz(t,mp())},sz.apply(t,arguments),Zz(t)}function vp(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(r*6,++r*6);return n}function _p(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const vg=_p(vp("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));_p(vp("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf"));_p(vp("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4"));_p(vp("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));const Qz="4.3.2";var fR;const Gz=(fR=globalThis.loaders)==null?void 0:fR.parseImageNode,q_=typeof Image<"u",Y_=typeof ImageBitmap<"u",Jz=!!Gz,K_=Hy?!0:Jz;function e$(t){switch(t){case"auto":return Y_||q_||K_;case"imagebitmap":return Y_;case"image":return q_;case"data":return K_;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function t$(){if(Y_)return"imagebitmap";if(q_)return"image";if(K_)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function n$(t){const e=i$(t);if(!e)throw new Error("Not an image");return e}function r$(t){switch(n$(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("getImageData");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),n.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function i$(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}const s$=/^data:image\/svg\+xml/,a$=/\.svg((\?|#).*)?$/;function Ab(t){return t&&(s$.test(t)||a$.test(t))}function o$(t,e){if(Ab(e)){let r=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(r=unescape(encodeURIComponent(r)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(r)}`}return _M(t,e)}function _M(t,e){if(Ab(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function yM(t,e,n){const r=o$(t,n),i=self.URL||self.webkitURL,s=typeof r!="string"&&i.createObjectURL(r);try{return await l$(s||r,e)}finally{s&&i.revokeObjectURL(s)}}async function l$(t,e){const n=new Image;return n.src=t,e.image&&e.image.decode&&n.decode?(await n.decode(),n):await new Promise((r,i)=>{try{n.onload=()=>r(n),n.onerror=s=>{const l=s instanceof Error?s.message:"error";i(new Error(l))}}catch(s){i(s)}})}const c$={};let tA=!0;async function u$(t,e,n){let r;Ab(n)?r=await yM(t,e,n):r=_M(t,n);const i=e&&e.imagebitmap;return await f$(r,i)}async function f$(t,e=null){if((d$(e)||!tA)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(n){console.warn(n),tA=!1}return await createImageBitmap(t)}function d$(t){for(const e in t||c$)return!1;return!0}function h$(t){return!v$(t,"ftyp",4)||!(t[8]&96)?null:g$(t)}function g$(t){switch(p$(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function p$(t,e,n){return String.fromCharCode(...t.slice(e,n))}function m$(t){return[...t].map(e=>e.charCodeAt(0))}function v$(t,e,n=0){const r=m$(e);for(let i=0;i<r.length;++i)if(r[i]!==t[i+n])return!1;return!0}const vs=!1,cf=!0;function bM(t){const e=ed(t);return y$(e)||w$(e)||b$(e)||S$(e)||_$(e)}function _$(t){const e=new Uint8Array(t instanceof DataView?t.buffer:t),n=h$(e);return n?{mimeType:n.mimeType,width:0,height:0}:null}function y$(t){const e=ed(t);return e.byteLength>=24&&e.getUint32(0,vs)===2303741511?{mimeType:"image/png",width:e.getUint32(16,vs),height:e.getUint32(20,vs)}:null}function b$(t){const e=ed(t);return e.byteLength>=10&&e.getUint32(0,vs)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,cf),height:e.getUint16(8,cf)}:null}function S$(t){const e=ed(t);return e.byteLength>=14&&e.getUint16(0,vs)===16973&&e.getUint32(2,cf)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,cf),height:e.getUint32(22,cf)}:null}function w$(t){const e=ed(t);if(!(e.byteLength>=3&&e.getUint16(0,vs)===65496&&e.getUint8(2)===255))return null;const{tableMarkers:r,sofMarkers:i}=E$();let s=2;for(;s+9<e.byteLength;){const l=e.getUint16(s,vs);if(i.has(l))return{mimeType:"image/jpeg",height:e.getUint16(s+5,vs),width:e.getUint16(s+7,vs)};if(!r.has(l))return null;s+=2,s+=e.getUint16(s,vs)}return null}function E$(){const t=new Set([65499,65476,65484,65501,65534]);for(let n=65504;n<65520;++n)t.add(n);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function ed(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function T$(t,e){var i;const{mimeType:n}=bM(t)||{},r=(i=globalThis.loaders)==null?void 0:i.parseImageNode;return Kh(r),await r(t,n)}async function A$(t,e,n){e=e||{};const i=(e.image||{}).type||"auto",{url:s}=n||{},l=C$(i);let c;switch(l){case"imagebitmap":c=await u$(t,e,s);break;case"image":c=await yM(t,e,s);break;case"data":c=await T$(t);break;default:Kh(!1)}return i==="data"&&(c=r$(c)),c}function C$(t){switch(t){case"auto":case"data":return t$();default:return e$(t),t}}const R$=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],x$=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],M$={image:{type:"auto",decode:!0}},O$={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Qz,mimeTypes:x$,extensions:R$,parse:A$,tests:[t=>!!bM(new DataView(t))],options:M$},Sn=new Wf({id:"deck"});let Z_={};function P$(t){Z_=t}function jr(t,e,n,r){Sn.level>0&&Z_[t]&&Z_[t].call(null,e,n,r)}function N$(t){const e=t[0],n=t[t.length-1];return e==="{"&&n==="}"||e==="["&&n==="]"}const I$={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:N$,parseTextSync:JSON.parse};function D$(){const t="9.1.1",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${t}`);return e||(Sn.log(1,`deck.gl ${t}`)(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:Sn,_registerLoggers:P$},BD([I$,[O$,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}const F$=D$();function Cb(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}const r0={number:{type:"number",validate(t,e){return Number.isFinite(t)&&typeof e=="object"&&(e.max===void 0||t<=e.max)&&(e.min===void 0||t>=e.min)}},array:{type:"array",validate(t,e){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function k$(t){const e={};for(const[n,r]of Object.entries(t))e[n]=B$(r);return e}function B$(t){let e=nA(t);if(e!=="object")return{value:t,...r0[e],type:e};if(typeof t=="object")return t?t.type!==void 0?{...t,...r0[t.type],type:t.type}:t.value===void 0?{type:"object",value:t}:(e=nA(t.value),{...t,...r0[e],type:e}):{type:"object",value:null};throw new Error("props")}function nA(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}const U$=`#ifdef MODULE_LOGDEPTH
logdepth_adjustPosition(gl_Position);
#endif
`,L$=`#ifdef MODULE_MATERIAL
fragColor = material_filterColor(fragColor);
#endif
#ifdef MODULE_LIGHTING
fragColor = lighting_filterColor(fragColor);
#endif
#ifdef MODULE_FOG
fragColor = fog_filterColor(fragColor);
#endif
#ifdef MODULE_PICKING
fragColor = picking_filterHighlightColor(fragColor);
fragColor = picking_filterPickingColor(fragColor);
#endif
#ifdef MODULE_LOGDEPTH
logdepth_setFragDepth();
#endif
`,z$={vertex:U$,fragment:L$},rA=/void\s+main\s*\([^)]*\)\s*\{\n?/,iA=/}\n?[^{}]*$/,i0=[],Vh="__LUMA_INJECT_DECLARATIONS__";function $$(t){const e={vertex:{},fragment:{}};for(const n in t){let r=t[n];const i=V$(n);typeof r=="string"&&(r={order:0,injection:r}),e[i][n]=r}return e}function V$(t){const e=t.slice(0,2);switch(e){case"vs":return"vertex";case"fs":return"fragment";default:throw new Error(e)}}function _g(t,e,n,r=!1){const i=e==="vertex";for(const s in n){const l=n[s];l.sort((f,d)=>f.order-d.order),i0.length=l.length;for(let f=0,d=l.length;f<d;++f)i0[f]=l[f].injection;const c=`${i0.join(`
`)}
`;switch(s){case"vs:#decl":i&&(t=t.replace(Vh,c));break;case"vs:#main-start":i&&(t=t.replace(rA,f=>f+c));break;case"vs:#main-end":i&&(t=t.replace(iA,f=>c+f));break;case"fs:#decl":i||(t=t.replace(Vh,c));break;case"fs:#main-start":i||(t=t.replace(rA,f=>f+c));break;case"fs:#main-end":i||(t=t.replace(iA,f=>c+f));break;default:t=t.replace(s,f=>f+c)}}return t=t.replace(Vh,""),r&&(t=t.replace(/\}\s*$/,s=>s+z$[e])),t}function yg(t){t.map(e=>H$(e))}function H$(t){if(t.instance)return;yg(t.dependencies||[]);const{propTypes:e={},deprecations:n=[],inject:r={}}=t,i={normalizedInjections:$$(r),parsedDeprecations:j$(n)};e&&(i.propValidators=k$(e)),t.instance=i;let s={};e&&(s=Object.entries(e).reduce((l,[c,f])=>{const d=f==null?void 0:f.value;return d&&(l[c]=d),l},{})),t.defaultUniforms={...t.defaultUniforms,...s}}function SM(t,e,n){var r;(r=t.deprecations)==null||r.forEach(i=>{var s;(s=i.regex)!=null&&s.test(e)&&(i.deprecated?n.deprecated(i.old,i.new)():n.removed(i.old,i.new)())})}function j$(t){return t.forEach(e=>{switch(e.type){case"function":e.regex=new RegExp(`\\b${e.old}\\(`);break;default:e.regex=new RegExp(`${e.type} ${e.old};`)}}),t}function Rb(t){yg(t);const e={},n={};wM({modules:t,level:0,moduleMap:e,moduleDepth:n});const r=Object.keys(n).sort((i,s)=>n[s]-n[i]).map(i=>e[i]);return yg(r),r}function wM(t){const{modules:e,level:n,moduleMap:r,moduleDepth:i}=t;if(n>=5)throw new Error("Possible loop in shader dependency graph");for(const s of e)r[s.name]=s,(i[s.name]===void 0||i[s.name]<n)&&(i[s.name]=n);for(const s of e)s.dependencies&&wM({modules:s.dependencies,level:n+1,moduleMap:r,moduleDepth:i})}function W$(t){switch(t==null?void 0:t.gpu.toLowerCase()){case"apple":return`#define APPLE_GPU
// Apple optimizes away the calculation necessary for emulated fp64
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
`;case"nvidia":return`#define NVIDIA_GPU
// Nvidia optimizes away the calculation necessary for emulated fp64
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
`;case"intel":return`#define INTEL_GPU
// Intel optimizes away the calculation necessary for emulated fp64
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
// Intel's built-in 'tan' function doesn't have acceptable precision
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
`;case"amd":return`#define AMD_GPU
`;default:return`#define DEFAULT_GPU
// Prevent driver from optimizing away the calculation necessary for emulated fp64
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
// Headless Chrome's software shader 'tan' function doesn't have acceptable precision
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
// If the GPU doesn't have full 32 bits precision, will causes overflow
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
`}}function X$(t,e){var r;if(Number(((r=t.match(/^#version[ \t]+(\d+)/m))==null?void 0:r[1])||100)!==300)throw new Error("luma.gl v9 only supports GLSL 3.00 shader sources");switch(e){case"vertex":return t=sA(t,q$),t;case"fragment":return t=sA(t,Y$),t;default:throw new Error(e)}}const EM=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,`#version 300 es
`],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],q$=[...EM,[Q_("attribute"),"in $1"],[Q_("varying"),"out $1"]],Y$=[...EM,[Q_("varying"),"in $1"]];function sA(t,e){for(const[n,r]of e)t=t.replace(n,r);return t}function Q_(t){return new RegExp(`\\b${t}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}function TM(t,e){let n="";for(const r in t){const i=t[r];if(n+=`void ${i.signature} {
`,i.header&&(n+=` ${i.header}`),e[r]){const s=e[r];s.sort((l,c)=>l.order-c.order);for(const l of s)n+=` ${l.injection}
`}i.footer&&(n+=` ${i.footer}`),n+=`}
`}return n}function AM(t){const e={vertex:{},fragment:{}};for(const n of t){let r,i;typeof n!="string"?(r=n,i=r.hook):(r={},i=n),i=i.trim();const[s,l]=i.split(":"),c=i.replace(/\(.+/,""),f=Object.assign(r,{signature:l});switch(s){case"vs":e.vertex[c]=f;break;case"fs":e.fragment[c]=f;break;default:throw new Error(s)}}return e}function K$(t,e){return{name:Z$(t,e),language:"glsl",version:Q$(t)}}function Z$(t,e="unnamed"){const r=/#define[^\S\r\n]*SHADER_NAME[^\S\r\n]*([A-Za-z0-9_-]+)\s*/.exec(t);return r?r[1]:e}function Q$(t){let e=100;const n=t.match(/[^\s]+/g);if(n&&n.length>=2&&n[0]==="#version"){const r=parseInt(n[1],10);Number.isFinite(r)&&(e=r)}if(e!==100&&e!==300)throw new Error(`Invalid GLSL version ${e}`);return e}const CM=`
${Vh}
`,G$=`precision highp float;
`;function J$(t){const e=Rb(t.modules||[]);return{source:tV(t.platformInfo,{...t,source:t.source,stage:"vertex",modules:e}),getUniforms:RM(e)}}function eV(t){const{vs:e,fs:n}=t,r=Rb(t.modules||[]);return{vs:aA(t.platformInfo,{...t,source:e,stage:"vertex",modules:r}),fs:aA(t.platformInfo,{...t,source:n,stage:"fragment",modules:r}),getUniforms:RM(r)}}function tV(t,e){var w;const{source:n,stage:r,modules:i,hookFunctions:s=[],inject:l={},log:c}=e;Cb(typeof n=="string","shader source must be a string");const f=n;let d="";const g=AM(s),m={},v={},S={};for(const b in l){const A=typeof l[b]=="string"?{injection:l[b],order:0}:l[b],T=/^(v|f)s:(#)?([\w-]+)$/.exec(b);if(T){const C=T[2],M=T[3];C?M==="decl"?v[b]=[A]:S[b]=[A]:m[b]=[A]}else S[b]=[A]}const E=i;for(const b of E){c&&SM(b,f,c);const A=xM(b,"wgsl");d+=A;const T=((w=b.injections)==null?void 0:w[r])||{};for(const C in T){const M=/^(v|f)s:#([\w-]+)$/.exec(C);if(M){const N=M[2]==="decl"?v:S;N[C]=N[C]||[],N[C].push(T[C])}else m[C]=m[C]||[],m[C].push(T[C])}}return d+=CM,d=_g(d,r,v),d+=TM(g[r],m),d+=f,d=_g(d,r,S),d}function aA(t,e){var F;const{id:n,source:r,stage:i,language:s="glsl",modules:l,defines:c={},hookFunctions:f=[],inject:d={},prologue:g=!0,log:m}=e;Cb(typeof r=="string","shader source must be a string");const v=s==="glsl"?K$(r).version:-1,S=t.shaderLanguageVersion,E=v===100?"#version 100":"#version 300 es",b=r.split(`
`).slice(1).join(`
`),A={};l.forEach(L=>{Object.assign(A,L.defines)}),Object.assign(A,c);let T="";switch(s){case"wgsl":break;case"glsl":T=g?`${E}
// ----- PROLOGUE -------------------------
${nV({id:n,source:r,stage:i})}
${`#define SHADER_TYPE_${i.toUpperCase()}`}
${W$(t)}
${i==="fragment"?G$:""}
// ----- APPLICATION DEFINES -------------------------
${rV(A)}
`:`${E}
`;break}const C=AM(f),M={},x={},N={};for(const L in d){const I=typeof d[L]=="string"?{injection:d[L],order:0}:d[L],V=/^(v|f)s:(#)?([\w-]+)$/.exec(L);if(V){const B=V[2],j=V[3];B?j==="decl"?x[L]=[I]:N[L]=[I]:M[L]=[I]}else N[L]=[I]}for(const L of l){m&&SM(L,b,m);const I=xM(L,i);T+=I;const V=((F=L.instance)==null?void 0:F.normalizedInjections[i])||{};for(const B in V){const j=/^(v|f)s:#([\w-]+)$/.exec(B);if(j){const Y=j[2]==="decl"?x:N;Y[B]=Y[B]||[],Y[B].push(V[B])}else M[B]=M[B]||[],M[B].push(V[B])}}return T+="// ----- MAIN SHADER SOURCE -------------------------",T+=CM,T=_g(T,i,x),T+=TM(C[i],M),T+=b,T=_g(T,i,N),s==="glsl"&&v!==S&&(T=X$(T,i)),T.trim()}function RM(t){return function(n){var i;const r={};for(const s of t){const l=(i=s.getUniforms)==null?void 0:i.call(s,n,r);Object.assign(r,l)}return r}}function nV(t){const{id:e,source:n,stage:r}=t;return e&&n.indexOf("SHADER_NAME")===-1?`
#define SHADER_NAME ${e}_${r}`:""}function rV(t={}){let e="";for(const n in t){const r=t[n];(r||Number.isFinite(r))&&(e+=`#define ${n.toUpperCase()} ${t[n]}
`)}return e}function xM(t,e){let n;switch(e){case"vertex":n=t.vs||"";break;case"fragment":n=t.fs||"";break;case"wgsl":n=t.source||"";break;default:Cb(!1)}if(!t.name)throw new Error("Shader module must have a name");const r=t.name.toUpperCase().replace(/[^0-9a-z]/gi,"_");let i=`// ----- MODULE ${t.name} ---------------
`;return e!=="wgsl"&&(i+=`#define MODULE_${r}
`),i+=`${n}
`,i}const iV=/^\s*\#\s*ifdef\s*([a-zA-Z_]+)\s*$/,sV=/^\s*\#\s*endif\s*$/;function aV(t,e){var l;const n=t.split(`
`),r=[];let i=!0,s=null;for(const c of n){const f=c.match(iV),d=c.match(sV);f?(s=f[1],i=!!((l=e==null?void 0:e.defines)!=null&&l[s])):d?i=!0:i&&r.push(c)}return r.join(`
`)}const wo=class wo{constructor(){O(this,"_hookFunctions",[]);O(this,"_defaultModules",[])}static getDefaultShaderAssembler(){return wo.defaultShaderAssembler=wo.defaultShaderAssembler||new wo,wo.defaultShaderAssembler}addDefaultModule(e){this._defaultModules.find(n=>n.name===(typeof e=="string"?e:e.name))||this._defaultModules.push(e)}removeDefaultModule(e){const n=typeof e=="string"?e:e.name;this._defaultModules=this._defaultModules.filter(r=>r.name!==n)}addShaderHook(e,n){n&&(e=Object.assign(n,{hook:e})),this._hookFunctions.push(e)}assembleWGSLShader(e){const n=this._getModuleList(e.modules),r=this._hookFunctions,{source:i,getUniforms:s}=J$({...e,source:e.source,modules:n,hookFunctions:r});return{source:e.platformInfo.shaderLanguage==="wgsl"?aV(i):i,getUniforms:s,modules:n}}assembleGLSLShaderPair(e){const n=this._getModuleList(e.modules),r=this._hookFunctions;return{...eV({...e,vs:e.vs,fs:e.fs,modules:n,hookFunctions:r}),modules:n}}_getModuleList(e=[]){const n=new Array(this._defaultModules.length+e.length),r={};let i=0;for(let s=0,l=this._defaultModules.length;s<l;++s){const c=this._defaultModules[s],f=c.name;n[i++]=c,r[f]=!0}for(let s=0,l=e.length;s<l;++s){const c=e[s],f=c.name;r[f]||(n[i++]=c,r[f]=!0)}return n.length=i,yg(n),n}};O(wo,"defaultShaderAssembler");let bg=wo;const oV=`out vec4 transform_output;
void main() {
transform_output = vec4(0);
}`,lV=`#version 300 es
${oV}`;function cV(t){const{input:e,inputChannels:n,output:r}={};if(!e)return lV;if(!n)throw new Error("inputChannels");const i=uV(n),s=fV(e,n);return`#version 300 es
in ${i} ${e};
out vec4 ${r};
void main() {
${r} = ${s};
}`}function uV(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error(`invalid channels: ${t}`)}}function fV(t,e){switch(e){case 1:return`vec4(${t}, 0.0, 0.0, 1.0)`;case 2:return`vec4(${t}, 0.0, 1.0)`;case 3:return`vec4(${t}, 1.0)`;case 4:return t;default:throw new Error(`invalid channels: ${e}`)}}class dV{constructor(){O(this,"stats",new Map)}getStats(e){return this.get(e)}get(e){return this.stats.has(e)||this.stats.set(e,new ip({id:e})),this.stats.get(e)}}const MM=new dV,Re=new Wf({id:"luma.gl"}),s0={};function yp(t="id"){s0[t]=s0[t]||1;const e=s0[t]++;return`${t}-${e}`}var O0;let mn=(O0=class{constructor(e,n,r){O(this,"id");O(this,"props");O(this,"userData",{});O(this,"_device");O(this,"destroyed",!1);O(this,"allocatedBytes",0);O(this,"_attachedResources",new Set);if(!e)throw new Error("no device");this._device=e,this.props=hV(n,r);const i=this.props.id!=="undefined"?this.props.id:yp(this[Symbol.toStringTag]);this.props.id=i,this.id=i,this.userData=this.props.userData||{},this.addStats()}toString(){return`${this[Symbol.toStringTag]||this.constructor.name}:"${this.id}"`}destroy(){this.destroyResource()}delete(){return this.destroy(),this}getProps(){return this.props}attachResource(e){this._attachedResources.add(e)}detachResource(e){this._attachedResources.delete(e)}destroyAttachedResource(e){this._attachedResources.delete(e)&&e.destroy()}destroyAttachedResources(){for(const e of Object.values(this._attachedResources))e.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){const e=this._device.statsManager.getStats("Resource Counts"),n=this[Symbol.toStringTag];e.get(`${n}s Active`).decrementCount()}trackAllocatedMemory(e,n=this[Symbol.toStringTag]){const r=this._device.statsManager.getStats("Resource Counts");r.get("GPU Memory").addCount(e),r.get(`${n} Memory`).addCount(e),this.allocatedBytes=e}trackDeallocatedMemory(e=this[Symbol.toStringTag]){const n=this._device.statsManager.getStats("Resource Counts");n.get("GPU Memory").subtractCount(this.allocatedBytes),n.get(`${e} Memory`).subtractCount(this.allocatedBytes),this.allocatedBytes=0}addStats(){const e=this._device.statsManager.getStats("Resource Counts"),n=this[Symbol.toStringTag];e.get("Resources Created").incrementCount(),e.get(`${n}s Created`).incrementCount(),e.get(`${n}s Active`).incrementCount()}},O(O0,"defaultProps",{id:"undefined",handle:void 0,userData:void 0}),O0);function hV(t,e){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}const Rr=class Rr extends mn{constructor(n,r){const i={...r};(r.usage||0)&Rr.INDEX&&!r.indexType&&(r.data instanceof Uint32Array?i.indexType="uint32":r.data instanceof Uint16Array&&(i.indexType="uint16")),delete i.data;super(n,i,Rr.defaultProps);O(this,"usage");O(this,"indexType");O(this,"updateTimestamp");O(this,"debugData",new ArrayBuffer(0));this.usage=i.usage||0,this.indexType=i.indexType,this.updateTimestamp=n.incrementTimestamp()}get[Symbol.toStringTag](){return"Buffer"}clone(n){return this.device.createBuffer({...this.props,...n})}readSyncWebGL(n,r){throw new Error("not implemented")}_setDebugData(n,r,i){const s=ArrayBuffer.isView(n)?n.buffer:n,l=Math.min(n?n.byteLength:i,Rr.DEBUG_DATA_MAX_LENGTH);s===null?this.debugData=new ArrayBuffer(l):r===0&&i===s.byteLength?this.debugData=s.slice(0,l):this.debugData=s.slice(r,r+l)}};O(Rr,"defaultProps",{...mn.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1}),O(Rr,"MAP_READ",1),O(Rr,"MAP_WRITE",2),O(Rr,"COPY_SRC",4),O(Rr,"COPY_DST",8),O(Rr,"INDEX",16),O(Rr,"VERTEX",32),O(Rr,"UNIFORM",64),O(Rr,"STORAGE",128),O(Rr,"INDIRECT",256),O(Rr,"QUERY_RESOLVE",512),O(Rr,"DEBUG_DATA_MAX_LENGTH",32);let $n=Rr;function OM(t){const e=oA[t],n=gV(e),r=t.includes("norm"),i=!r&&!t.startsWith("float"),s=t.startsWith("s");return{dataType:oA[t],byteLength:n,integer:i,signed:s,normalized:r}}function gV(t){return pV[t]}const oA={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},pV={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4},Fr="texture-compression-bc",pn="texture-compression-astc",ls="texture-compression-etc2",mV="texture-compression-etc1-webgl",bh="texture-compression-pvrtc-webgl",a0="texture-compression-atc-webgl",Sh="float32-renderable-webgl",o0="float16-renderable-webgl",vV="rgb9e5ufloat-renderable-webgl",l0="snorm8-renderable-webgl",Wu="norm16-renderable-webgl",c0="snorm16-renderable-webgl",wh="float32-filterable",lA="float16-filterable-webgl";function PM(t){const e=_V[t];if(!e)throw new Error(`Unsupported texture format ${t}`);return e}const _V={r8unorm:{},r8snorm:{render:l0},r8uint:{},r8sint:{},rg8unorm:{},rg8snorm:{render:l0},rg8uint:{},rg8sint:{},r16uint:{},r16sint:{},r16float:{render:o0,filter:"float16-filterable-webgl"},"r16unorm-webgl":{f:Wu},"r16snorm-webgl":{f:c0},"rgba4unorm-webgl":{channels:"rgba",bitsPerChannel:[4,4,4,4],packed:!0},"rgb565unorm-webgl":{channels:"rgb",bitsPerChannel:[5,6,5,0],packed:!0},"rgb5a1unorm-webgl":{channels:"rgba",bitsPerChannel:[5,5,5,1],packed:!0},"rgb8unorm-webgl":{},"rgb8snorm-webgl":{},rgba8unorm:{},"rgba8unorm-srgb":{},rgba8snorm:{render:l0},rgba8uint:{},rgba8sint:{},bgra8unorm:{},"bgra8unorm-srgb":{},rg16uint:{},rg16sint:{},rg16float:{render:o0,filter:lA},"rg16unorm-webgl":{render:Wu},"rg16snorm-webgl":{render:c0},r32uint:{},r32sint:{},r32float:{render:Sh,filter:wh},rgb9e5ufloat:{channels:"rgb",packed:!0,render:vV},rg11b10ufloat:{channels:"rgb",bitsPerChannel:[11,11,10,0],packed:!0,p:1,render:Sh},rgb10a2unorm:{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1},"rgb10a2uint-webgl":{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1,wgpu:!1},"rgb16unorm-webgl":{f:Wu},"rgb16snorm-webgl":{f:Wu},rg32uint:{},rg32sint:{},rg32float:{render:!1,filter:wh},rgba16uint:{},rgba16sint:{},rgba16float:{render:o0,filter:lA},"rgba16unorm-webgl":{render:Wu},"rgba16snorm-webgl":{render:c0},"rgb32float-webgl":{render:Sh,filter:wh},rgba32uint:{},rgba32sint:{},rgba32float:{render:Sh,filter:wh},stencil8:{attachment:"stencil",bitsPerChannel:[8,0,0,0],dataType:"uint8"},depth16unorm:{attachment:"depth",bitsPerChannel:[16,0,0,0],dataType:"uint16"},depth24plus:{attachment:"depth",bitsPerChannel:[24,0,0,0],dataType:"uint32"},depth32float:{attachment:"depth",bitsPerChannel:[32,0,0,0],dataType:"float32"},"depth24plus-stencil8":{attachment:"depth-stencil",bitsPerChannel:[24,8,0,0],packed:!0},"depth32float-stencil8":{attachment:"depth-stencil",bitsPerChannel:[32,8,0,0],packed:!0},"bc1-rgb-unorm-webgl":{f:Fr},"bc1-rgb-unorm-srgb-webgl":{f:Fr},"bc1-rgba-unorm":{f:Fr},"bc1-rgba-unorm-srgb":{f:Fr},"bc2-rgba-unorm":{f:Fr},"bc2-rgba-unorm-srgb":{f:Fr},"bc3-rgba-unorm":{f:Fr},"bc3-rgba-unorm-srgb":{f:Fr},"bc4-r-unorm":{f:Fr},"bc4-r-snorm":{f:Fr},"bc5-rg-unorm":{f:Fr},"bc5-rg-snorm":{f:Fr},"bc6h-rgb-ufloat":{f:Fr},"bc6h-rgb-float":{f:Fr},"bc7-rgba-unorm":{f:Fr},"bc7-rgba-unorm-srgb":{f:Fr},"etc2-rgb8unorm":{f:ls},"etc2-rgb8unorm-srgb":{f:ls},"etc2-rgb8a1unorm":{f:ls},"etc2-rgb8a1unorm-srgb":{f:ls},"etc2-rgba8unorm":{f:ls},"etc2-rgba8unorm-srgb":{f:ls},"eac-r11unorm":{f:ls},"eac-r11snorm":{f:ls},"eac-rg11unorm":{f:ls},"eac-rg11snorm":{f:ls},"astc-4x4-unorm":{f:pn},"astc-4x4-unorm-srgb":{f:pn},"astc-5x4-unorm":{f:pn},"astc-5x4-unorm-srgb":{f:pn},"astc-5x5-unorm":{f:pn},"astc-5x5-unorm-srgb":{f:pn},"astc-6x5-unorm":{f:pn},"astc-6x5-unorm-srgb":{f:pn},"astc-6x6-unorm":{f:pn},"astc-6x6-unorm-srgb":{f:pn},"astc-8x5-unorm":{f:pn},"astc-8x5-unorm-srgb":{f:pn},"astc-8x6-unorm":{f:pn},"astc-8x6-unorm-srgb":{f:pn},"astc-8x8-unorm":{f:pn},"astc-8x8-unorm-srgb":{f:pn},"astc-10x5-unorm":{f:pn},"astc-10x5-unorm-srgb":{f:pn},"astc-10x6-unorm":{f:pn},"astc-10x6-unorm-srgb":{f:pn},"astc-10x8-unorm":{f:pn},"astc-10x8-unorm-srgb":{f:pn},"astc-10x10-unorm":{f:pn},"astc-10x10-unorm-srgb":{f:pn},"astc-12x10-unorm":{f:pn},"astc-12x10-unorm-srgb":{f:pn},"astc-12x12-unorm":{f:pn},"astc-12x12-unorm-srgb":{f:pn},"pvrtc-rgb4unorm-webgl":{f:bh},"pvrtc-rgba4unorm-webgl":{f:bh},"pvrtc-rbg2unorm-webgl":{f:bh},"pvrtc-rgba2unorm-webgl":{f:bh},"etc1-rbg-unorm-webgl":{f:mV},"atc-rgb-unorm-webgl":{f:a0},"atc-rgba-unorm-webgl":{f:a0},"atc-rgbai-unorm-webgl":{f:a0}},yV=["bc1","bc2","bc3","bc4","bc5","bc6","bc7","etc1","etc2","eac","atc","astc","pvrtc"],bV=/^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/;function NM(t){return yV.some(e=>t.startsWith(e))}function xb(t){let e=SV(t);if(NM(t)){e.channels="rgb",e.components=3,e.bytesPerPixel=1,e.srgb=!1,e.compressed=!0;const r=wV(t);r&&(e.blockWidth=r.blockWidth,e.blockHeight=r.blockHeight)}const n=bV.exec(t);if(n){const[,r,i,s,l,c]=n,f=`${s}${i}`,d=OM(f),g=d.byteLength*8,m=r.length,v=[g,m>=2?g:0,m>=3?g:0,m>=4?g:0];e={format:t,attachment:e.attachment,dataType:d.dataType,components:m,channels:r,integer:d.integer,signed:d.signed,normalized:d.normalized,bitsPerChannel:v,bytesPerPixel:d.byteLength*r.length,packed:e.packed,srgb:e.srgb},c==="-webgl"&&(e.webgl=!0),l==="-srgb"&&(e.srgb=!0)}return t.endsWith("-webgl")&&(e.webgl=!0),t.endsWith("-srgb")&&(e.srgb=!0),e}function SV(t){var s;const e=PM(t),n=e.bytesPerPixel||1,r=e.bitsPerChannel||[8,8,8,8];return delete e.bitsPerChannel,delete e.bytesPerPixel,delete e.f,delete e.render,delete e.filter,delete e.blend,delete e.store,{...e,format:t,attachment:e.attachment||"color",channels:e.channels||"r",components:e.components||((s=e.channels)==null?void 0:s.length)||1,bytesPerPixel:n,bitsPerChannel:r,dataType:e.dataType||"uint8",srgb:e.srgb??!1,packed:e.packed??!1,webgl:e.webgl??!1,integer:e.integer??!1,signed:e.signed??!1,normalized:e.normalized??!1,compressed:e.compressed??!1}}function wV(t){const n=/.*-(\d+)x(\d+)-.*/.exec(t);if(n){const[,r,i]=n;return{blockWidth:Number(r),blockHeight:Number(i)}}return null}function EV(t){const e=PM(t),n={format:t,create:e.f??!0,render:e.render??!0,filter:e.filter??!0,blend:e.blend??!0,store:e.store??!0},r=xb(t),i=t.startsWith("depth")||t.startsWith("stencil"),s=r==null?void 0:r.signed,l=r==null?void 0:r.integer,c=r==null?void 0:r.webgl;return n.render&&(n.render=!s),n.filter&&(n.filter=!i&&!s&&!l&&!c),n}class TV{}class AV{constructor(e=[],n){O(this,"features");O(this,"disabledFeatures");this.features=new Set(e),this.disabledFeatures=n||{}}*[Symbol.iterator](){yield*this.features}has(e){var n;return!((n=this.disabledFeatures)!=null&&n[e])&&this.features.has(e)}}const Vg=class Vg{constructor(e){O(this,"id");O(this,"props");O(this,"userData",{});O(this,"statsManager",MM);O(this,"timestamp",0);O(this,"_reused",!1);O(this,"_lumaData",{});this.props={...Vg.defaultProps,...e},this.id=this.props.id||yp(this[Symbol.toStringTag].toLowerCase())}get[Symbol.toStringTag](){return"Device"}getTextureFormatCapabilities(e){const n=EV(e),r=l=>(typeof l=="string"?this.features.has(l):l)??!0,i=r(n.create),s={format:e,create:i,render:i&&r(n.render),filter:i&&r(n.filter),blend:i&&r(n.blend),store:i&&r(n.store)};return this._getDeviceSpecificTextureFormatCapabilities(s)}isTextureFormatSupported(e,n){return this.getTextureFormatCapabilities(e).create}isTextureFormatFilterable(e){return this.getTextureFormatCapabilities(e).filter}isTextureFormatRenderable(e){return this.getTextureFormatCapabilities(e).render}isTextureFormatCompressed(e){return NM(e)}loseDevice(){return!1}reportError(e){this.props.onError(e)}getDefaultCanvasContext(){if(!this.canvasContext)throw new Error("Device has no default CanvasContext. See props.createCanvasContext");return this.canvasContext}createCommandEncoder(e={}){throw new Error("not implemented")}incrementTimestamp(){return this.timestamp++}onError(e){this.props.onError(e)}getCanvasContext(){return this.getDefaultCanvasContext()}readPixelsToArrayWebGL(e,n){throw new Error("not implemented")}readPixelsToBufferWebGL(e,n){throw new Error("not implemented")}setParametersWebGL(e){throw new Error("not implemented")}getParametersWebGL(e){throw new Error("not implemented")}withParametersWebGL(e,n){throw new Error("not implemented")}clearWebGL(e){throw new Error("not implemented")}resetWebGL(){throw new Error("not implemented")}static _getCanvasContextProps(e){return e.createCanvasContext===!0?{}:e.createCanvasContext}_normalizeBufferProps(e){(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const n={...e};return(e.usage||0)&$n.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?n.indexType="uint32":e.data instanceof Uint16Array?n.indexType="uint16":Re.warn("indices buffer content must be of integer type")()),n}};O(Vg,"defaultProps",{id:null,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,createCanvasContext:void 0,onError:e=>Re.error(e.message)(),_reuseDevices:!1,_requestMaxLimits:!0,_factoryDestroyPolicy:"unused",_initializeFeatures:!0,_disabledFeatures:{"compilation-status-async-webgl":!0},_resourceDefaults:{},webgl:{},debug:Re.get("debug")||void 0,debugShaders:Re.get("debug-shaders")||void 0,debugFramebuffers:!!Re.get("debug-framebuffers"),debugWebGL:!!Re.get("debug-webgl"),debugSpectorJS:void 0,debugSpectorJSUrl:void 0,_handle:void 0});let La=Vg;const CV=qo()&&typeof document<"u",RV=()=>CV&&document.readyState==="complete",xV="set luma.log.level=1 (or higher) to trace rendering",cA="No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.",Aa=class Aa{constructor(){O(this,"stats",MM);O(this,"log",Re);O(this,"VERSION","9.1.2");O(this,"spector");O(this,"preregisteredAdapters",new Map);if(globalThis.luma){if(globalThis.luma.VERSION!==this.VERSION)throw Re.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)(),Re.error("'yarn why @luma.gl/core' can help identify the source of the conflict")(),new Error("luma.gl - multiple versions detected: see console log");Re.error("This version of luma.gl has already been initialized")()}Re.log(1,`${this.VERSION} - ${xV}`)(),globalThis.luma=this}registerAdapters(e){for(const n of e)this.preregisteredAdapters.set(n.type,n)}getSupportedAdapters(e=[]){const n=this.getAdapterMap(e);return Array.from(n).map(([,r])=>r).filter(r=>{var i;return(i=r.isSupported)==null?void 0:i.call(r)}).map(r=>r.type)}getBestAvailableAdapter(e=[]){var r,i,s,l;const n=this.getAdapterMap(e);return(i=(r=n.get("webgpu"))==null?void 0:r.isSupported)!=null&&i.call(r)?"webgpu":(l=(s=n.get("webgl"))==null?void 0:s.isSupported)!=null&&l.call(s)?"webgl":null}setDefaultDeviceProps(e){Object.assign(Aa.defaultProps,e)}async createDevice(e={}){var c;e={...Aa.defaultProps,...e},e.waitForPageLoad&&await Aa.pageLoaded;const n=this.getAdapterMap(e.adapters);let r=e.type||"";r==="best-available"&&(r=this.getBestAvailableAdapter(e.adapters)||r);const s=(this.getAdapterMap(e.adapters)||n).get(r),l=await((c=s==null?void 0:s.create)==null?void 0:c.call(s,e));if(l)return l;throw new Error(cA)}async attachDevice(e){var l;const n=this.getAdapterMap(e.adapters);let r="";e.handle instanceof WebGL2RenderingContext&&(r="webgl"),e.createCanvasContext&&await Aa.pageLoaded,e.handle===null&&(r="unknown");const i=n.get(r),s=await((l=i==null?void 0:i.attach)==null?void 0:l.call(i,null));if(s)return s;throw new Error(cA)}enforceWebGL2(e=!0,n=[]){var s;const i=this.getAdapterMap(n).get("webgl");i||Re.warn("enforceWebGL2: webgl adapter not found")(),(s=i==null?void 0:i.enforceWebGL2)==null||s.call(i,e)}getAdapterMap(e=[]){const n=new Map(this.preregisteredAdapters);for(const r of e)n.set(r.type,r);return n}registerDevices(e){Re.warn("luma.registerDevices() is deprecated, use luma.registerAdapters() instead");for(const n of e){const r=n.adapter;r&&this.preregisteredAdapters.set(r.type,r)}}};O(Aa,"defaultProps",{...La.defaultProps,type:"best-available",adapters:void 0,waitForPageLoad:!0}),O(Aa,"pageLoaded",MV().then(()=>{Re.probe(2,"DOM is loaded")()}));let G_=Aa;const J_=new G_;function MV(){return RV()||typeof window>"u"?Promise.resolve():new Promise(t=>{window.addEventListener("load",()=>t())})}class OV{}const Hg=class Hg{constructor(e){O(this,"id");O(this,"props");O(this,"canvas");O(this,"htmlCanvas");O(this,"offscreenCanvas");O(this,"type");O(this,"width",1);O(this,"height",1);O(this,"resizeObserver");O(this,"_canvasSizeInfo",{clientWidth:0,clientHeight:0,devicePixelRatio:1});if(this.props={...Hg.defaultProps,...e},e=this.props,!qo()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(e.canvas)typeof e.canvas=="string"?this.canvas=NV(e.canvas):this.canvas=e.canvas;else{const n=IV(e),r=PV((e==null?void 0:e.container)||null);r.insertBefore(n,r.firstChild),this.canvas=n,e!=null&&e.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&e.autoResize&&(this.resizeObserver=new ResizeObserver(n=>{for(const r of n)r.target===this.canvas&&this.update()}),this.resizeObserver.observe(this.canvas))}toString(){return`${this[Symbol.toStringTag]}(${this.id})`}getDevicePixelRatio(e){return typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(e=e===void 0?this.props.useDevicePixels:e,!e||e<=0)?1:e===!0?typeof window<"u"&&window.devicePixelRatio||1:e}getPixelSize(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":const e=this.getDevicePixelRatio(),n=this.canvas;return n.parentElement?[n.clientWidth*e,n.clientHeight*e]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}}getAspect(){const[e,n]=this.getPixelSize();return e/n}cssToDeviceRatio(){var e;try{const[n]=this.getDrawingBufferSize(),r=this._canvasSizeInfo.clientWidth||((e=this.htmlCanvas)==null?void 0:e.clientWidth);return r?n/r:1}catch{return 1}}cssToDevicePixels(e,n=!0){const r=this.cssToDeviceRatio(),[i,s]=this.getDrawingBufferSize();return DV(e,r,i,s,n)}setDevicePixelRatio(e,n={}){if(!this.htmlCanvas)return;let r="width"in n?n.width:this.htmlCanvas.clientWidth,i="height"in n?n.height:this.htmlCanvas.clientHeight;(!r||!i)&&(Re.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,r=this.htmlCanvas.width||1,i=this.htmlCanvas.height||1);const s=this._canvasSizeInfo;if(s.clientWidth!==r||s.clientHeight!==i||s.devicePixelRatio!==e){let l=e;const c=Math.floor(r*l),f=Math.floor(i*l);if(this.htmlCanvas.width=c,this.htmlCanvas.height=f,this.device.gl){const[g,m]=this.getDrawingBufferSize();(g!==c||m!==f)&&(l=Math.min(g/r,m/i),this.htmlCanvas.width=Math.floor(r*l),this.htmlCanvas.height=Math.floor(i*l),Re.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=r,this._canvasSizeInfo.clientHeight=i,this._canvasSizeInfo.devicePixelRatio=e}}}getDrawingBufferSize(){const e=this.device.gl;if(!e)throw new Error("canvas size");return[e.drawingBufferWidth,e.drawingBufferHeight]}_setAutoCreatedCanvasId(e){var n;((n=this.htmlCanvas)==null?void 0:n.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}};O(Hg,"defaultProps",{canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,alphaMode:"opaque",colorSpace:"srgb"});let ey=Hg;function PV(t){if(typeof t=="string"){const e=document.getElementById(t);if(!e)throw new Error(`${t} is not an HTML element`);return e}else if(t)return t;return document.body}function NV(t){const e=document.getElementById(t);if(!(e instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return e}function IV(t){const{width:e,height:n}=t,r=document.createElement("canvas");return r.id=yp("lumagl-auto-created-canvas"),r.width=e||1,r.height=n||1,r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(n)?`${n}px`:"100%",r}function DV(t,e,n,r,i){const s=t,l=uA(s[0],e,n);let c=fA(s[1],e,r,i),f=uA(s[0]+1,e,n);const d=f===n-1?f:f-1;f=fA(s[1]+1,e,r,i);let g;return i?(f=f===0?f:f+1,g=c,c=f):g=f===r-1?f:f-1,{x:l,y:c,width:Math.max(d-l+1,1),height:Math.max(g-c+1,1)}}function uA(t,e,n){return Math.min(Math.round(t*e),n-1)}function fA(t,e,n,r){return r?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}const xr=class xr extends mn{constructor(n,r){r=xr.normalizeProps(n,r);super(n,r,xr.defaultProps);O(this,"dimension");O(this,"format");O(this,"width");O(this,"height");O(this,"depth");O(this,"mipLevels");O(this,"updateTimestamp");if(this.dimension=this.props.dimension,this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.props.width===void 0||this.props.height===void 0){const i=xr.getTextureDataSize(this.props.data);this.width=(i==null?void 0:i.width)||1,this.height=(i==null?void 0:i.height)||1}this.props.mipmaps&&this.props.mipLevels===void 0&&(this.props.mipLevels="pyramid"),this.mipLevels=this.props.mipLevels==="pyramid"?xr.getMipLevelCount(this.width,this.height):this.props.mipLevels||1,this.updateTimestamp=n.incrementTimestamp()}get[Symbol.toStringTag](){return"Texture"}toString(){return`Texture(${this.id},${this.format},${this.width}x${this.height})`}clone(n){return this.device.createTexture({...this.props,...n})}static isExternalImage(n){return typeof ImageData<"u"&&n instanceof ImageData||typeof ImageBitmap<"u"&&n instanceof ImageBitmap||typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement||typeof VideoFrame<"u"&&n instanceof VideoFrame||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas}static getExternalImageSize(n){if(typeof ImageData<"u"&&n instanceof ImageData||typeof ImageBitmap<"u"&&n instanceof ImageBitmap||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height};if(typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement)return{width:n.naturalWidth,height:n.naturalHeight};if(typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement)return{width:n.videoWidth,height:n.videoHeight};if(typeof VideoFrame<"u"&&n instanceof VideoFrame)return{width:n.displayWidth,height:n.displayHeight};throw new Error("Unknown image type")}static isTextureLevelData(n){const r=n==null?void 0:n.data;return ArrayBuffer.isView(r)}static getTextureDataSize(n){if(!n||ArrayBuffer.isView(n))return null;if(Array.isArray(n))return xr.getTextureDataSize(n[0]);if(xr.isExternalImage(n))return xr.getExternalImageSize(n);if(n&&typeof n=="object"&&n.constructor===Object){const i=Object.values(n)[0];return{width:i.width,height:i.height}}throw new Error("texture size deduction failed")}static normalizeTextureData(n,r){let i;return ArrayBuffer.isView(n)?i=[{data:n,width:r.width,height:r.height}]:Array.isArray(n)?i=n:i=[n],i}static getMipLevelCount(n,r){return Math.floor(Math.log2(Math.max(n,r)))+1}static getCubeFaceDepth(n){switch(n){case"+X":return 0;case"-X":return 1;case"+Y":return 2;case"-Y":return 3;case"+Z":return 4;case"-Z":return 5;default:throw new Error(n)}}static normalizeProps(n,r){var f,d;const i={...r},s=((d=(f=n==null?void 0:n.props)==null?void 0:f._resourceDefaults)==null?void 0:d.texture)||{};Object.assign(i,s);const{width:l,height:c}=i;return typeof l=="number"&&(i.width=Math.max(1,Math.ceil(l))),typeof c=="number"&&(i.height=Math.max(1,Math.ceil(c))),i}};O(xr,"COPY_SRC",1),O(xr,"COPY_DST",2),O(xr,"TEXTURE",4),O(xr,"STORAGE",8),O(xr,"RENDER_ATTACHMENT",16),O(xr,"CubeFaces",["+X","-X","+Y","-Y","+Z","-Z"]),O(xr,"defaultProps",{...mn.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!1,compressed:!1,usage:0,mipLevels:void 0,samples:void 0,sampler:{},view:void 0,flipY:void 0}),O(xr,"defaultCopyExternalImageOptions",{image:void 0,sourceX:0,sourceY:0,width:void 0,height:void 0,depth:1,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1,flipY:!1});let Kn=xr;const jg=class jg extends mn{get[Symbol.toStringTag](){return"TextureView"}constructor(e,n){super(e,n,jg.defaultProps)}};O(jg,"defaultProps",{...mn.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0});let Sg=jg;function FV(t,e,n){let r="";const i=e.split(/\r?\n/),s=t.slice().sort((l,c)=>l.lineNum-c.lineNum);switch((n==null?void 0:n.showSourceCode)||"no"){case"all":let l=0;for(let c=1;c<=i.length;c++)for(r+=IM(i[c-1],c,n);s.length>l&&s[l].lineNum===c;){const f=s[l++];r+=dA(f,i,f.lineNum,{...n,inlineSource:!1})}return r;case"issues":case"no":for(const c of t)r+=dA(c,i,c.lineNum,{inlineSource:(n==null?void 0:n.showSourceCode)!=="no"});return r}}function dA(t,e,n,r){if(r!=null&&r.inlineSource){const s=kV(e,n),l=t.linePos>0?`${" ".repeat(t.linePos+5)}^^^
`:"";return`
${s}${l}${t.type.toUpperCase()}: ${t.message}
`}const i=t.type==="error"?"red":"#8B4000";return r!=null&&r.html?`<div class='luma-compiler-log-error' style="color:${i};"><b> ${t.type.toUpperCase()}: ${t.message}</b></div>`:`${t.type.toUpperCase()}: ${t.message}`}function kV(t,e,n){let r="";for(let i=e-2;i<=e;i++){const s=t[i-1];s!==void 0&&(r+=IM(s,e,n))}return r}function IM(t,e,n){const r=n!=null&&n.html?UV(t):t;return`${BV(String(e),4)}: ${r}${n!=null&&n.html?"<br/>":`
`}`}function BV(t,e){let n="";for(let r=t.length;r<e;++r)n+=" ";return n+t}function UV(t){return t.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;")}const Wg=class Wg extends mn{constructor(n,r){r={...r,debugShaders:r.debugShaders||n.props.debugShaders||"errors"};super(n,{id:LV(r),...r},Wg.defaultProps);O(this,"stage");O(this,"source");O(this,"compilationStatus","pending");this.stage=this.props.stage,this.source=this.props.source}get[Symbol.toStringTag](){return"Shader"}getCompilationInfoSync(){return null}getTranslatedSource(){return null}async debugShader(){const n=this.props.debugShaders;switch(n){case"never":return;case"errors":if(this.compilationStatus==="success")return;break}const r=await this.getCompilationInfo();n==="warnings"&&(r==null?void 0:r.length)===0||this._displayShaderLog(r)}_displayShaderLog(n){var d;if(typeof document>"u"||!(document!=null&&document.createElement))return;const r=DM(this.source),i=`${this.stage} ${r}`;let s=FV(n,this.source,{showSourceCode:"all",html:!0});const l=this.getTranslatedSource();l&&(s+=`<br /><br /><h1>Translated Source</h1><br /><br /><code style="user-select:text;"><pre>${l}</pre></code>`);const c=document.createElement("Button");c.innerHTML=`
<h1>Shader Compilation Error in ${i}</h1><br /><br />
<code style="user-select:text;"><pre>
${s}
</pre></code>`,c.style.top="10px",c.style.left="10px",c.style.position="absolute",c.style.zIndex="9999",c.style.width="100%",c.style.textAlign="left",document.body.appendChild(c),(d=document.getElementsByClassName("luma-compiler-log-error")[0])==null||d.scrollIntoView(),c.onclick=()=>{const g=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(g)}}};O(Wg,"defaultProps",{...mn.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});let wg=Wg;function LV(t){return DM(t.source)||t.id||yp(`unnamed ${t.stage}-shader`)}function DM(t,e="unnamed"){const r=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(t);return r?r[1]:e}const pf=class pf extends mn{get[Symbol.toStringTag](){return"Sampler"}constructor(e,n){n=pf.normalizeProps(e,n),super(e,n,pf.defaultProps)}static normalizeProps(e,n){var s,l;const r=((l=(s=e==null?void 0:e.props)==null?void 0:s._resourceDefaults)==null?void 0:l.sampler)||{};return{...n,...r}}};O(pf,"defaultProps",{...mn.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"none",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});let Eg=pf;const Xg=class Xg extends mn{constructor(n,r={}){super(n,r,Xg.defaultProps);O(this,"width");O(this,"height");this.width=this.props.width,this.height=this.props.height}get[Symbol.toStringTag](){return"Framebuffer"}clone(n){const r=this.colorAttachments.map(s=>s.texture.clone(n)),i=this.depthStencilAttachment&&this.depthStencilAttachment.texture.clone(n);return this.device.createFramebuffer({...this.props,colorAttachments:r,depthStencilAttachment:i})}resize(n){let r=!n;if(n){const[i,s]=Array.isArray(n)?n:[n.width,n.height];r=r||s!==this.height||i!==this.width,this.width=i,this.height=s}r&&(Re.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.props.colorAttachments.length===0&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map((r,i)=>{if(typeof r=="string"){const s=this.createColorTexture(r,i);return this.attachResource(s),s.view}return r instanceof Kn?r.view:r});const n=this.props.depthStencilAttachment;if(n)if(typeof n=="string"){const r=this.createDepthStencilTexture(n);this.attachResource(r),this.depthStencilAttachment=r.view}else n instanceof Kn?this.depthStencilAttachment=n.view:this.depthStencilAttachment=n}createColorTexture(n,r){return this.device.createTexture({id:`${this.id}-color-attachment-${r}`,usage:Kn.RENDER_ATTACHMENT,format:n,width:this.width,height:this.height,sampler:{magFilter:"linear",minFilter:"linear"}})}createDepthStencilTexture(n){return this.device.createTexture({id:`${this.id}-depth-stencil-attachment`,usage:Kn.RENDER_ATTACHMENT,format:n,width:this.width,height:this.height,mipmaps:!1})}resizeAttachments(n,r){for(let i=0;i<this.colorAttachments.length;++i)if(this.colorAttachments[i]){const s=this.colorAttachments[i].texture.clone({width:n,height:r});this.destroyAttachedResource(this.colorAttachments[i]),this.colorAttachments[i]=s.view,this.attachResource(s.view)}if(this.depthStencilAttachment){const i=this.depthStencilAttachment.texture.clone({width:n,height:r});this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=i.view,this.attachResource(i)}this.updateAttachments()}};O(Xg,"defaultProps",{...mn.defaultProps,width:1,height:1,colorAttachments:[],depthStencilAttachment:null});let Tg=Xg;const qg=class qg extends mn{constructor(n,r){super(n,r,qg.defaultProps);O(this,"shaderLayout");O(this,"bufferLayout");O(this,"linkStatus","pending");O(this,"hash","");this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}get[Symbol.toStringTag](){return"RenderPipeline"}setUniformsWebGL(n){throw new Error("Use uniform blocks")}};O(qg,"defaultProps",{...mn.defaultProps,vs:null,vertexEntryPoint:"vertexMain",vsConstants:{},fs:null,fragmentEntryPoint:"fragmentMain",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},bindings:{},uniforms:{}});let Pc=qg;const ji=class ji extends mn{get[Symbol.toStringTag](){return"RenderPass"}constructor(e,n){n=ji.normalizeProps(e,n),super(e,n,ji.defaultProps)}static normalizeProps(e,n){var s;return{...(s=e.props._resourceDefaults)==null?void 0:s.renderPass,...n}}};O(ji,"defaultClearColor",[0,0,0,1]),O(ji,"defaultClearDepth",1),O(ji,"defaultClearStencil",0),O(ji,"defaultProps",{...mn.defaultProps,framebuffer:null,parameters:void 0,clearColor:ji.defaultClearColor,clearColors:void 0,clearDepth:ji.defaultClearDepth,clearStencil:ji.defaultClearStencil,depthReadOnly:!1,stencilReadOnly:!1,discard:!1,occlusionQuerySet:void 0,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0});let ty=ji;const Yg=class Yg extends mn{constructor(n,r){super(n,r,Yg.defaultProps);O(this,"hash","");O(this,"shaderLayout");this.shaderLayout=r.shaderLayout}get[Symbol.toStringTag](){return"ComputePipeline"}};O(Yg,"defaultProps",{...mn.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});let Ag=Yg;const Kg=class Kg extends mn{get[Symbol.toStringTag](){return"CommandEncoder"}constructor(e,n){super(e,n,Kg.defaultProps)}};O(Kg,"defaultProps",{...mn.defaultProps,measureExecutionTime:void 0});let ny=Kg;const Zg=class Zg extends mn{get[Symbol.toStringTag](){return"CommandBuffer"}constructor(e,n){super(e,n,Zg.defaultProps)}};O(Zg,"defaultProps",{...mn.defaultProps});let ry=Zg;function zV(t){const[e,n]=VV[t],r=e==="i32"||e==="u32",i=e!=="u32",s=HV[e]*n,l=$V(e,n);return{dataType:e,components:n,defaultVertexFormat:l,byteLength:s,integer:r,signed:i}}function $V(t,e){let n;switch(t){case"f32":n="float32";break;case"i32":n="sint32";break;case"u32":n="uint32";break;case"f16":return e<=2?"float16x2":"float16x4"}return e===1?n:`${n}x${e}`}const VV={f32:["f32",1],"vec2<f32>":["f32",2],"vec3<f32>":["f32",3],"vec4<f32>":["f32",4],f16:["f16",1],"vec2<f16>":["f16",2],"vec3<f16>":["f16",3],"vec4<f16>":["f16",4],i32:["i32",1],"vec2<i32>":["i32",2],"vec3<i32>":["i32",3],"vec4<i32>":["i32",4],u32:["u32",1],"vec2<u32>":["u32",2],"vec3<u32>":["u32",3],"vec4<u32>":["u32",4]},HV={f32:4,f16:2,i32:4,u32:4};function FM(t){let e;t.endsWith("-webgl")&&(t.replace("-webgl",""),e=!0);const[n,r]=t.split("x"),i=n,s=r?parseInt(r):1,l=OM(i),c={type:i,components:s,byteLength:l.byteLength*s,integer:l.integer,signed:l.signed,normalized:l.normalized};return e&&(c.webglOnly=!0),c}function kM(t,e){const n={};for(const r of t.attributes){const i=WV(t,e,r.name);i&&(n[r.name]=i)}return n}function jV(t,e,n=16){const r=kM(t,e),i=new Array(n).fill(null);for(const s of Object.values(r))i[s.location]=s;return i}function WV(t,e,n){const r=XV(t,n),i=qV(e,n);if(!r)return null;const s=zV(r.type),l=(i==null?void 0:i.vertexFormat)||s.defaultVertexFormat,c=FM(l);return{attributeName:(i==null?void 0:i.attributeName)||r.name,bufferName:(i==null?void 0:i.bufferName)||r.name,location:r.location,shaderType:r.type,shaderDataType:s.dataType,shaderComponents:s.components,vertexFormat:l,bufferDataType:c.type,bufferComponents:c.components,normalized:c.normalized,integer:s.integer,stepMode:(i==null?void 0:i.stepMode)||r.stepMode||"vertex",byteOffset:(i==null?void 0:i.byteOffset)||0,byteStride:(i==null?void 0:i.byteStride)||0}}function XV(t,e){const n=t.attributes.find(r=>r.name===e);return n||Re.warn(`shader layout attribute "${e}" not present in shader`),n||null}function qV(t,e){YV(t);let n=KV(t,e);return n||(n=ZV(t,e),n)?n:(Re.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function YV(t){for(const e of t)(e.attributes&&e.format||!e.attributes&&!e.format)&&Re.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function KV(t,e){for(const n of t)if(n.format&&n.name===e)return{attributeName:n.name,bufferName:e,stepMode:n.stepMode,vertexFormat:n.format,byteOffset:0,byteStride:n.byteStride||0};return null}function ZV(t,e){var n;for(const r of t){let i=r.byteStride;if(typeof r.byteStride!="number")for(const l of r.attributes||[]){const c=FM(l.format);i+=c.byteLength}const s=(n=r.attributes)==null?void 0:n.find(l=>l.attribute===e);if(s)return{attributeName:s.attribute,bufferName:r.name,stepMode:r.stepMode,vertexFormat:s.format,byteOffset:s.byteOffset,byteStride:i}}return null}const Qg=class Qg extends mn{constructor(n,r){super(n,r,Qg.defaultProps);O(this,"maxVertexAttributes");O(this,"attributeInfos");O(this,"indexBuffer",null);O(this,"attributes");this.maxVertexAttributes=n.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null);const{shaderLayout:i,bufferLayout:s}=r.renderPipeline||{};if(!i||!s)throw new Error("VertexArray");this.attributeInfos=jV(i,s,this.maxVertexAttributes)}get[Symbol.toStringTag](){return"VertexArray"}setConstantWebGL(n,r){throw new Error("constant attributes not supported")}};O(Qg,"defaultProps",{...mn.defaultProps,renderPipeline:null});let iy=Qg;const Gg=class Gg extends mn{get[Symbol.toStringTag](){return"TransformFeedback"}constructor(e,n){super(e,n,Gg.defaultProps)}};O(Gg,"defaultProps",{...mn.defaultProps,layout:void 0,buffers:{}});let sy=Gg;const Jg=class Jg extends mn{get[Symbol.toStringTag](){return"QuerySet"}constructor(e,n){super(e,n,Jg.defaultProps)}};O(Jg,"defaultProps",{...mn.defaultProps,type:void 0,count:void 0});let ay=Jg;const QV={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2<f32>":{type:"f32",components:2},"vec3<f32>":{type:"f32",components:3},"vec4<f32>":{type:"f32",components:4},"vec2<i32>":{type:"i32",components:2},"vec3<i32>":{type:"i32",components:3},"vec4<i32>":{type:"i32",components:4},"vec2<u32>":{type:"u32",components:2},"vec3<u32>":{type:"u32",components:3},"vec4<u32>":{type:"u32",components:4},"mat2x2<f32>":{type:"f32",components:4},"mat2x3<f32>":{type:"f32",components:6},"mat2x4<f32>":{type:"f32",components:8},"mat3x2<f32>":{type:"f32",components:6},"mat3x3<f32>":{type:"f32",components:9},"mat3x4<f32>":{type:"f32",components:12},"mat4x2<f32>":{type:"f32",components:8},"mat4x3<f32>":{type:"f32",components:12},"mat4x4<f32>":{type:"f32",components:16}};function GV(t){return QV[t]}function JV(t,e){switch(e){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}let Eh;function BM(t){return(!Eh||Eh.byteLength<t)&&(Eh=new ArrayBuffer(t)),Eh}function eH(t,e){const n=BM(t.BYTES_PER_ELEMENT*e);return new t(n,0,e)}function tH(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Cg(t){return Array.isArray(t)?t.length===0||typeof t[0]=="number":tH(t)}const hA=1024;class nH{constructor(e){O(this,"layout",{});O(this,"byteLength");let n=0;for(const[i,s]of Object.entries(e)){const l=GV(s),{type:c,components:f}=l;n=JV(n,f);const d=n;n+=f,this.layout[i]={type:c,size:f,offset:d}}n+=(4-n%4)%4;const r=n*4;this.byteLength=Math.max(r,hA)}getData(e){const n=Math.max(this.byteLength,hA),r=BM(n),i={i32:new Int32Array(r),u32:new Uint32Array(r),f32:new Float32Array(r),f16:new Uint16Array(r)};for(const[s,l]of Object.entries(e)){const c=this.layout[s];if(!c){Re.warn(`Supplied uniform value ${s} not present in uniform block layout`)();continue}const{type:f,size:d,offset:g}=c,m=i[f];if(d===1){if(typeof l!="number"&&typeof l!="boolean"){Re.warn(`Supplied value for single component uniform ${s} is not a number: ${l}`)();continue}m[g]=Number(l)}else{if(!Cg(l)){Re.warn(`Supplied value for multi component / array uniform ${s} is not a numeric array: ${l}`)();continue}m.set(l,g)}}return new Uint8Array(r)}has(e){return!!this.layout[e]}get(e){return this.layout[e]}}function rH(t,e,n=16){if(t!==e)return!1;const r=t,i=e;if(!Cg(r))return!1;if(Cg(i)&&r.length===i.length){for(let s=0;s<r.length;++s)if(i[s]!==r[s])return!1}return!0}function iH(t){return Cg(t)?t.slice():t}class sH{constructor(e){O(this,"name");O(this,"uniforms",{});O(this,"modifiedUniforms",{});O(this,"modified",!0);O(this,"bindingLayout",{});O(this,"needsRedraw","initialized");var n;if(this.name=(e==null?void 0:e.name)||"unnamed",e!=null&&e.name&&(e!=null&&e.shaderLayout)){const r=(n=e==null?void 0:e.shaderLayout.bindings)==null?void 0:n.find(s=>s.type==="uniform"&&s.name===(e==null?void 0:e.name));if(!r)throw new Error(e==null?void 0:e.name);const i=r;for(const s of i.uniforms||[])this.bindingLayout[s.name]=s}}setUniforms(e){for(const[n,r]of Object.entries(e))this._setUniform(n,r),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${n}=${r}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,n){rH(this.uniforms[e],n)||(this.uniforms[e]=iH(n),this.modifiedUniforms[e]=!0,this.modified=!0)}}class aH{constructor(e){O(this,"uniformBlocks",new Map);O(this,"uniformBufferLayouts",new Map);O(this,"uniformBuffers",new Map);for(const[n,r]of Object.entries(e)){const i=n,s=new nH(r.uniformTypes||{});this.uniformBufferLayouts.set(i,s);const l=new sH({name:n});l.setUniforms(r.defaultUniforms||{}),this.uniformBlocks.set(i,l)}}destroy(){for(const e of this.uniformBuffers.values())e.destroy()}setUniforms(e){var n;for(const[r,i]of Object.entries(e))(n=this.uniformBlocks.get(r))==null||n.setUniforms(i);this.updateUniformBuffers()}getUniformBufferByteLength(e){var n;return((n=this.uniformBufferLayouts.get(e))==null?void 0:n.byteLength)||0}getUniformBufferData(e){var r,i;const n=((r=this.uniformBlocks.get(e))==null?void 0:r.getAllUniforms())||{};return(i=this.uniformBufferLayouts.get(e))==null?void 0:i.getData(n)}createUniformBuffer(e,n,r){r&&this.setUniforms(r);const i=this.getUniformBufferByteLength(n),s=e.createBuffer({usage:$n.UNIFORM|$n.COPY_DST,byteLength:i}),l=this.getUniformBufferData(n);return s.write(l),s}getManagedUniformBuffer(e,n){if(!this.uniformBuffers.get(n)){const r=this.getUniformBufferByteLength(n),i=e.createBuffer({usage:$n.UNIFORM|$n.COPY_DST,byteLength:r});this.uniformBuffers.set(n,i)}return this.uniformBuffers.get(n)}updateUniformBuffers(){let e=!1;for(const n of this.uniformBlocks.keys()){const r=this.updateUniformBuffer(n);e||(e=r)}return e&&Re.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){var s;const n=this.uniformBlocks.get(e);let r=this.uniformBuffers.get(e),i=!1;if(r&&(n!=null&&n.needsRedraw)){i||(i=n.needsRedraw);const l=this.getUniformBufferData(e);r=this.uniformBuffers.get(e),r==null||r.write(l);const c=(s=this.uniformBlocks.get(e))==null?void 0:s.getAllUniforms();Re.log(4,`Writing to uniform buffer ${String(e)}`,l,c)()}return i}}function UM(t){const e=ArrayBuffer.isView(t)?t.constructor:t;switch(e){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(e.constructor.name)}}function LM(t){switch(t){case"float32":return Float32Array;case"uint32":return Uint32Array;case"sint32":return Int32Array;case"uint16":case"unorm16":return Uint16Array;case"sint16":case"snorm16":return Int16Array;case"uint8":case"unorm8":return Uint8Array;case"sint8":case"snorm8":return Int8Array;default:throw new Error(t)}}function oH(t,e,n){if(!e||e>4)throw new Error(`size ${e}`);const r=e;let i=UM(t);if(i==="uint8"&&n&&r===1)return"unorm8-webgl";if(i==="uint8"&&n&&r===3)return"unorm8x3-webgl";if(i==="uint8"||i==="sint8"){if(r===1||r===3)throw new Error(`size: ${e}`);return n&&(i=i.replace("int","norm")),`${i}x${r}`}if(i==="uint16"||i==="sint16"){if(r===1||r===3)throw new Error(`size: ${e}`);return n&&(i=i.replace("int","norm")),`${i}x${r}`}return r===1?i:`${i}x${r}`}class u0{constructor(e){O(this,"bufferLayouts");this.bufferLayouts=e}getBufferLayout(e){return this.bufferLayouts.find(n=>n.name===e)||null}getAttributeNamesForBuffer(e){var n;return e.attributes?(n=e.attributes)==null?void 0:n.map(r=>r.attribute):[e.name]}mergeBufferLayouts(e,n){const r=[...e];for(const i of n){const s=r.findIndex(l=>l.name===i.name);s<0?r.push(i):r[s]=i}return r}}class lH{constructor(){this.constants=new Map,this.aliases=new Map,this.structs=new Map}}class Ys{constructor(){}get isAstNode(){return!0}get astNodeType(){return""}evaluate(e){throw new Error("Cannot evaluate node")}evaluateString(e){return this.evaluate(e).toString()}search(e){}searchBlock(e,n){if(e){n(Rg.instance);for(const r of e)r instanceof Array?this.searchBlock(r,n):r.search(n);n(xg.instance)}}}class Rg extends Ys{}Rg.instance=new Rg;class xg extends Ys{}xg.instance=new xg;class kn extends Ys{constructor(){super()}}let oy=class extends kn{constructor(e,n,r,i,s,l){super(),this.calls=new Set,this.name=e,this.args=n,this.returnType=r,this.body=i,this.startLine=s,this.endLine=l}get astNodeType(){return"function"}search(e){this.searchBlock(this.body,e)}};class cH extends kn{constructor(e){super(),this.expression=e}get astNodeType(){return"staticAssert"}search(e){this.expression.search(e)}}class uH extends kn{constructor(e,n){super(),this.condition=e,this.body=n}get astNodeType(){return"while"}search(e){this.condition.search(e),this.searchBlock(this.body,e)}}class fH extends kn{constructor(e){super(),this.body=e}get astNodeType(){return"continuing"}search(e){this.searchBlock(this.body,e)}}class dH extends kn{constructor(e,n,r,i){super(),this.init=e,this.condition=n,this.increment=r,this.body=i}get astNodeType(){return"for"}search(e){var n,r,i;(n=this.init)===null||n===void 0||n.search(e),(r=this.condition)===null||r===void 0||r.search(e),(i=this.increment)===null||i===void 0||i.search(e),this.searchBlock(this.body,e)}}class bo extends kn{constructor(e,n,r,i,s){super(),this.name=e,this.type=n,this.storage=r,this.access=i,this.value=s}get astNodeType(){return"var"}search(e){var n;e(this),(n=this.value)===null||n===void 0||n.search(e)}}class zM extends kn{constructor(e,n,r){super(),this.name=e,this.type=n,this.value=r}get astNodeType(){return"override"}search(e){var n;(n=this.value)===null||n===void 0||n.search(e)}}class ly extends kn{constructor(e,n,r,i,s){super(),this.name=e,this.type=n,this.storage=r,this.access=i,this.value=s}get astNodeType(){return"let"}search(e){var n;e(this),(n=this.value)===null||n===void 0||n.search(e)}}class gA extends kn{constructor(e,n,r,i,s){super(),this.name=e,this.type=n,this.storage=r,this.access=i,this.value=s}get astNodeType(){return"const"}evaluate(e){return this.value.evaluate(e)}search(e){var n;e(this),(n=this.value)===null||n===void 0||n.search(e)}}var Nc;(function(t){t.increment="++",t.decrement="--"})(Nc||(Nc={}));(function(t){function e(n){const r=n;if(r=="parse")throw new Error("Invalid value for IncrementOperator");return t[r]}t.parse=e})(Nc||(Nc={}));class hH extends kn{constructor(e,n){super(),this.operator=e,this.variable=n}get astNodeType(){return"increment"}search(e){this.variable.search(e)}}var Df;(function(t){t.assign="=",t.addAssign="+=",t.subtractAssin="-=",t.multiplyAssign="*=",t.divideAssign="/=",t.moduloAssign="%=",t.andAssign="&=",t.orAssign="|=",t.xorAssign="^=",t.shiftLeftAssign="<<=",t.shiftRightAssign=">>="})(Df||(Df={}));(function(t){function e(n){const r=n;if(r=="parse")throw new Error("Invalid value for AssignOperator");return r}t.parse=e})(Df||(Df={}));class gH extends kn{constructor(e,n,r){super(),this.operator=e,this.variable=n,this.value=r}get astNodeType(){return"assign"}search(e){this.variable.search(e),this.value.search(e)}}class $M extends kn{constructor(e,n){super(),this.name=e,this.args=n}get astNodeType(){return"call"}search(e){for(const n of this.args)n.search(e);e(this)}}class pH extends kn{constructor(e,n){super(),this.body=e,this.continuing=n}get astNodeType(){return"loop"}}class mH extends kn{constructor(e,n){super(),this.condition=e,this.body=n}get astNodeType(){return"body"}}class vH extends kn{constructor(e,n,r,i){super(),this.condition=e,this.body=n,this.elseif=r,this.else=i}get astNodeType(){return"if"}search(e){this.condition.search(e),this.searchBlock(this.body,e),this.searchBlock(this.elseif,e),this.searchBlock(this.else,e)}}class _H extends kn{constructor(e){super(),this.value=e}get astNodeType(){return"return"}search(e){var n;(n=this.value)===null||n===void 0||n.search(e)}}class yH extends kn{constructor(e){super(),this.name=e}get astNodeType(){return"enable"}}class bH extends kn{constructor(e){super(),this.extensions=e}get astNodeType(){return"requires"}}class SH extends kn{constructor(e,n){super(),this.severity=e,this.rule=n}get astNodeType(){return"diagnostic"}}class VM extends kn{constructor(e,n){super(),this.name=e,this.type=n}get astNodeType(){return"alias"}}class wH extends kn{constructor(){super()}get astNodeType(){return"discard"}}class EH extends kn{constructor(){super()}get astNodeType(){return"break"}}class TH extends kn{constructor(){super()}get astNodeType(){return"continue"}}class el extends kn{constructor(e){super(),this.name=e}get astNodeType(){return"type"}get isStruct(){return!1}get isArray(){return!1}}class mo extends el{constructor(e,n,r,i){super(e),this.members=n,this.startLine=r,this.endLine=i}get astNodeType(){return"struct"}get isStruct(){return!0}getMemberIndex(e){for(let n=0;n<this.members.length;n++)if(this.members[n].name==e)return n;return-1}}class HM extends el{constructor(e,n,r){super(e),this.format=n,this.access=r}get astNodeType(){return"template"}}class AH extends el{constructor(e,n,r,i){super(e),this.storage=n,this.type=r,this.access=i}get astNodeType(){return"pointer"}}class jM extends el{constructor(e,n,r,i){super(e),this.attributes=n,this.format=r,this.count=i}get astNodeType(){return"array"}get isArray(){return!0}}class Qu extends el{constructor(e,n,r){super(e),this.format=n,this.access=r}get astNodeType(){return"sampler"}}class Es extends Ys{constructor(){super()}}class CH extends Es{constructor(e){super(),this.value=e}get astNodeType(){return"stringExpr"}toString(){return this.value}evaluateString(){return this.value}}class Ql extends Es{constructor(e,n){super(),this.type=e,this.args=n}get astNodeType(){return"createExpr"}search(e){if(e(this),this.args)for(const n of this.args)n.search(e)}evaluate(e){return this.args[0].evaluate(e)}}class WM extends Es{constructor(e,n){super(),this.name=e,this.args=n}get astNodeType(){return"callExpr"}evaluate(e){switch(this.name){case"abs":return Math.abs(this.args[0].evaluate(e));case"acos":return Math.acos(this.args[0].evaluate(e));case"acosh":return Math.acosh(this.args[0].evaluate(e));case"asin":return Math.asin(this.args[0].evaluate(e));case"asinh":return Math.asinh(this.args[0].evaluate(e));case"atan":return Math.atan(this.args[0].evaluate(e));case"atan2":return Math.atan2(this.args[0].evaluate(e),this.args[1].evaluate(e));case"atanh":return Math.atanh(this.args[0].evaluate(e));case"ceil":return Math.ceil(this.args[0].evaluate(e));case"clamp":return Math.min(Math.max(this.args[0].evaluate(e),this.args[1].evaluate(e)),this.args[2].evaluate(e));case"cos":return Math.cos(this.args[0].evaluate(e));case"degrees":return this.args[0].evaluate(e)*180/Math.PI;case"distance":return Math.sqrt(Math.pow(this.args[0].evaluate(e)-this.args[1].evaluate(e),2));case"dot":case"exp":return Math.exp(this.args[0].evaluate(e));case"exp2":return Math.pow(2,this.args[0].evaluate(e));case"floor":return Math.floor(this.args[0].evaluate(e));case"fma":return this.args[0].evaluate(e)*this.args[1].evaluate(e)+this.args[2].evaluate(e);case"fract":return this.args[0].evaluate(e)-Math.floor(this.args[0].evaluate(e));case"inverseSqrt":return 1/Math.sqrt(this.args[0].evaluate(e));case"log":return Math.log(this.args[0].evaluate(e));case"log2":return Math.log2(this.args[0].evaluate(e));case"max":return Math.max(this.args[0].evaluate(e),this.args[1].evaluate(e));case"min":return Math.min(this.args[0].evaluate(e),this.args[1].evaluate(e));case"mix":return this.args[0].evaluate(e)*(1-this.args[2].evaluate(e))+this.args[1].evaluate(e)*this.args[2].evaluate(e);case"modf":return this.args[0].evaluate(e)-Math.floor(this.args[0].evaluate(e));case"pow":return Math.pow(this.args[0].evaluate(e),this.args[1].evaluate(e));case"radians":return this.args[0].evaluate(e)*Math.PI/180;case"round":return Math.round(this.args[0].evaluate(e));case"sign":return Math.sign(this.args[0].evaluate(e));case"sin":return Math.sin(this.args[0].evaluate(e));case"sinh":return Math.sinh(this.args[0].evaluate(e));case"saturate":return Math.min(Math.max(this.args[0].evaluate(e),0),1);case"smoothstep":return this.args[0].evaluate(e)*this.args[0].evaluate(e)*(3-2*this.args[0].evaluate(e));case"sqrt":return Math.sqrt(this.args[0].evaluate(e));case"step":return this.args[0].evaluate(e)<this.args[1].evaluate(e)?0:1;case"tan":return Math.tan(this.args[0].evaluate(e));case"tanh":return Math.tanh(this.args[0].evaluate(e));case"trunc":return Math.trunc(this.args[0].evaluate(e));default:throw new Error("Non const function: "+this.name)}}search(e){for(const n of this.args)n.search(e);e(this)}}class cy extends Es{constructor(e){super(),this.name=e}get astNodeType(){return"varExpr"}search(e){e(this),this.postfix&&this.postfix.search(e)}evaluate(e){const n=e.constants.get(this.name);if(!n)throw new Error("Cannot evaluate node");return n.evaluate(e)}}class pA extends Es{constructor(e,n){super(),this.name=e,this.initializer=n}get astNodeType(){return"constExpr"}evaluate(e){var n,r;if(this.initializer instanceof Ql){const i=(n=this.postfix)===null||n===void 0?void 0:n.evaluateString(e),s=(r=this.initializer.type)===null||r===void 0?void 0:r.name,l=e.structs.get(s),c=l==null?void 0:l.getMemberIndex(i);return c!==void 0&&c!=-1?this.initializer.args[c].evaluate(e):this.initializer.evaluate(e)}return this.initializer.evaluate(e)}search(e){this.initializer.search(e)}}class mA extends Es{constructor(e){super(),this.value=e}get astNodeType(){return"literalExpr"}evaluate(){return this.value}}class RH extends Es{constructor(e,n){super(),this.type=e,this.value=n}get astNodeType(){return"bitcastExpr"}search(e){this.value.search(e)}}class vA extends Es{constructor(e){super(),this.contents=e}get astNodeType(){return"groupExpr"}evaluate(e){return this.contents[0].evaluate(e)}search(e){this.searchBlock(this.contents,e)}}class xH extends Es{constructor(e){super(),this.index=e}search(e){this.index.search(e)}}class XM extends Es{constructor(){super()}}class MH extends XM{constructor(e,n){super(),this.operator=e,this.right=n}get astNodeType(){return"unaryOp"}evaluate(e){switch(this.operator){case"+":return this.right.evaluate(e);case"-":return-this.right.evaluate(e);case"!":return this.right.evaluate(e)?0:1;case"~":return~this.right.evaluate(e);default:throw new Error("Unknown unary operator: "+this.operator)}}search(e){this.right.search(e)}}class cs extends XM{constructor(e,n,r){super(),this.operator=e,this.left=n,this.right=r}get astNodeType(){return"binaryOp"}evaluate(e){switch(this.operator){case"+":return this.left.evaluate(e)+this.right.evaluate(e);case"-":return this.left.evaluate(e)-this.right.evaluate(e);case"*":return this.left.evaluate(e)*this.right.evaluate(e);case"/":return this.left.evaluate(e)/this.right.evaluate(e);case"%":return this.left.evaluate(e)%this.right.evaluate(e);case"==":return this.left.evaluate(e)==this.right.evaluate(e)?1:0;case"!=":return this.left.evaluate(e)!=this.right.evaluate(e)?1:0;case"<":return this.left.evaluate(e)<this.right.evaluate(e)?1:0;case">":return this.left.evaluate(e)>this.right.evaluate(e)?1:0;case"<=":return this.left.evaluate(e)<=this.right.evaluate(e)?1:0;case">=":return this.left.evaluate(e)>=this.right.evaluate(e)?1:0;case"&&":return this.left.evaluate(e)&&this.right.evaluate(e)?1:0;case"||":return this.left.evaluate(e)||this.right.evaluate(e)?1:0;default:throw new Error(`Unknown operator ${this.operator}`)}}search(e){this.left.search(e),this.right.search(e)}}class qM extends Ys{constructor(){super()}}class OH extends qM{constructor(e,n){super(),this.selector=e,this.body=n}get astNodeType(){return"case"}search(e){this.searchBlock(this.body,e)}}class PH extends qM{constructor(e){super(),this.body=e}get astNodeType(){return"default"}search(e){this.searchBlock(this.body,e)}}class NH extends Ys{constructor(e,n,r){super(),this.name=e,this.type=n,this.attributes=r}get astNodeType(){return"argument"}}class IH extends Ys{constructor(e,n){super(),this.condition=e,this.body=n}get astNodeType(){return"elseif"}search(e){this.condition.search(e),this.searchBlock(this.body,e)}}class DH extends Ys{constructor(e,n,r){super(),this.name=e,this.type=n,this.attributes=r}get astNodeType(){return"member"}}let FH=class extends Ys{constructor(e,n){super(),this.name=e,this.value=n}get astNodeType(){return"attribute"}};var oe,te;(function(t){t[t.token=0]="token",t[t.keyword=1]="keyword",t[t.reserved=2]="reserved"})(te||(te={}));class ne{constructor(e,n,r){this.name=e,this.type=n,this.rule=r}toString(){return this.name}}class k{}oe=k;k.none=new ne("",te.reserved,"");k.eof=new ne("EOF",te.token,"");k.reserved={asm:new ne("asm",te.reserved,"asm"),bf16:new ne("bf16",te.reserved,"bf16"),do:new ne("do",te.reserved,"do"),enum:new ne("enum",te.reserved,"enum"),f16:new ne("f16",te.reserved,"f16"),f64:new ne("f64",te.reserved,"f64"),handle:new ne("handle",te.reserved,"handle"),i8:new ne("i8",te.reserved,"i8"),i16:new ne("i16",te.reserved,"i16"),i64:new ne("i64",te.reserved,"i64"),mat:new ne("mat",te.reserved,"mat"),premerge:new ne("premerge",te.reserved,"premerge"),regardless:new ne("regardless",te.reserved,"regardless"),typedef:new ne("typedef",te.reserved,"typedef"),u8:new ne("u8",te.reserved,"u8"),u16:new ne("u16",te.reserved,"u16"),u64:new ne("u64",te.reserved,"u64"),unless:new ne("unless",te.reserved,"unless"),using:new ne("using",te.reserved,"using"),vec:new ne("vec",te.reserved,"vec"),void:new ne("void",te.reserved,"void")};k.keywords={array:new ne("array",te.keyword,"array"),atomic:new ne("atomic",te.keyword,"atomic"),bool:new ne("bool",te.keyword,"bool"),f32:new ne("f32",te.keyword,"f32"),i32:new ne("i32",te.keyword,"i32"),mat2x2:new ne("mat2x2",te.keyword,"mat2x2"),mat2x3:new ne("mat2x3",te.keyword,"mat2x3"),mat2x4:new ne("mat2x4",te.keyword,"mat2x4"),mat3x2:new ne("mat3x2",te.keyword,"mat3x2"),mat3x3:new ne("mat3x3",te.keyword,"mat3x3"),mat3x4:new ne("mat3x4",te.keyword,"mat3x4"),mat4x2:new ne("mat4x2",te.keyword,"mat4x2"),mat4x3:new ne("mat4x3",te.keyword,"mat4x3"),mat4x4:new ne("mat4x4",te.keyword,"mat4x4"),ptr:new ne("ptr",te.keyword,"ptr"),sampler:new ne("sampler",te.keyword,"sampler"),sampler_comparison:new ne("sampler_comparison",te.keyword,"sampler_comparison"),struct:new ne("struct",te.keyword,"struct"),texture_1d:new ne("texture_1d",te.keyword,"texture_1d"),texture_2d:new ne("texture_2d",te.keyword,"texture_2d"),texture_2d_array:new ne("texture_2d_array",te.keyword,"texture_2d_array"),texture_3d:new ne("texture_3d",te.keyword,"texture_3d"),texture_cube:new ne("texture_cube",te.keyword,"texture_cube"),texture_cube_array:new ne("texture_cube_array",te.keyword,"texture_cube_array"),texture_multisampled_2d:new ne("texture_multisampled_2d",te.keyword,"texture_multisampled_2d"),texture_storage_1d:new ne("texture_storage_1d",te.keyword,"texture_storage_1d"),texture_storage_2d:new ne("texture_storage_2d",te.keyword,"texture_storage_2d"),texture_storage_2d_array:new ne("texture_storage_2d_array",te.keyword,"texture_storage_2d_array"),texture_storage_3d:new ne("texture_storage_3d",te.keyword,"texture_storage_3d"),texture_depth_2d:new ne("texture_depth_2d",te.keyword,"texture_depth_2d"),texture_depth_2d_array:new ne("texture_depth_2d_array",te.keyword,"texture_depth_2d_array"),texture_depth_cube:new ne("texture_depth_cube",te.keyword,"texture_depth_cube"),texture_depth_cube_array:new ne("texture_depth_cube_array",te.keyword,"texture_depth_cube_array"),texture_depth_multisampled_2d:new ne("texture_depth_multisampled_2d",te.keyword,"texture_depth_multisampled_2d"),texture_external:new ne("texture_external",te.keyword,"texture_external"),u32:new ne("u32",te.keyword,"u32"),vec2:new ne("vec2",te.keyword,"vec2"),vec3:new ne("vec3",te.keyword,"vec3"),vec4:new ne("vec4",te.keyword,"vec4"),bitcast:new ne("bitcast",te.keyword,"bitcast"),block:new ne("block",te.keyword,"block"),break:new ne("break",te.keyword,"break"),case:new ne("case",te.keyword,"case"),continue:new ne("continue",te.keyword,"continue"),continuing:new ne("continuing",te.keyword,"continuing"),default:new ne("default",te.keyword,"default"),diagnostic:new ne("diagnostic",te.keyword,"diagnostic"),discard:new ne("discard",te.keyword,"discard"),else:new ne("else",te.keyword,"else"),enable:new ne("enable",te.keyword,"enable"),fallthrough:new ne("fallthrough",te.keyword,"fallthrough"),false:new ne("false",te.keyword,"false"),fn:new ne("fn",te.keyword,"fn"),for:new ne("for",te.keyword,"for"),function:new ne("function",te.keyword,"function"),if:new ne("if",te.keyword,"if"),let:new ne("let",te.keyword,"let"),const:new ne("const",te.keyword,"const"),loop:new ne("loop",te.keyword,"loop"),while:new ne("while",te.keyword,"while"),private:new ne("private",te.keyword,"private"),read:new ne("read",te.keyword,"read"),read_write:new ne("read_write",te.keyword,"read_write"),return:new ne("return",te.keyword,"return"),requires:new ne("requires",te.keyword,"requires"),storage:new ne("storage",te.keyword,"storage"),switch:new ne("switch",te.keyword,"switch"),true:new ne("true",te.keyword,"true"),alias:new ne("alias",te.keyword,"alias"),type:new ne("type",te.keyword,"type"),uniform:new ne("uniform",te.keyword,"uniform"),var:new ne("var",te.keyword,"var"),override:new ne("override",te.keyword,"override"),workgroup:new ne("workgroup",te.keyword,"workgroup"),write:new ne("write",te.keyword,"write"),r8unorm:new ne("r8unorm",te.keyword,"r8unorm"),r8snorm:new ne("r8snorm",te.keyword,"r8snorm"),r8uint:new ne("r8uint",te.keyword,"r8uint"),r8sint:new ne("r8sint",te.keyword,"r8sint"),r16uint:new ne("r16uint",te.keyword,"r16uint"),r16sint:new ne("r16sint",te.keyword,"r16sint"),r16float:new ne("r16float",te.keyword,"r16float"),rg8unorm:new ne("rg8unorm",te.keyword,"rg8unorm"),rg8snorm:new ne("rg8snorm",te.keyword,"rg8snorm"),rg8uint:new ne("rg8uint",te.keyword,"rg8uint"),rg8sint:new ne("rg8sint",te.keyword,"rg8sint"),r32uint:new ne("r32uint",te.keyword,"r32uint"),r32sint:new ne("r32sint",te.keyword,"r32sint"),r32float:new ne("r32float",te.keyword,"r32float"),rg16uint:new ne("rg16uint",te.keyword,"rg16uint"),rg16sint:new ne("rg16sint",te.keyword,"rg16sint"),rg16float:new ne("rg16float",te.keyword,"rg16float"),rgba8unorm:new ne("rgba8unorm",te.keyword,"rgba8unorm"),rgba8unorm_srgb:new ne("rgba8unorm_srgb",te.keyword,"rgba8unorm_srgb"),rgba8snorm:new ne("rgba8snorm",te.keyword,"rgba8snorm"),rgba8uint:new ne("rgba8uint",te.keyword,"rgba8uint"),rgba8sint:new ne("rgba8sint",te.keyword,"rgba8sint"),bgra8unorm:new ne("bgra8unorm",te.keyword,"bgra8unorm"),bgra8unorm_srgb:new ne("bgra8unorm_srgb",te.keyword,"bgra8unorm_srgb"),rgb10a2unorm:new ne("rgb10a2unorm",te.keyword,"rgb10a2unorm"),rg11b10float:new ne("rg11b10float",te.keyword,"rg11b10float"),rg32uint:new ne("rg32uint",te.keyword,"rg32uint"),rg32sint:new ne("rg32sint",te.keyword,"rg32sint"),rg32float:new ne("rg32float",te.keyword,"rg32float"),rgba16uint:new ne("rgba16uint",te.keyword,"rgba16uint"),rgba16sint:new ne("rgba16sint",te.keyword,"rgba16sint"),rgba16float:new ne("rgba16float",te.keyword,"rgba16float"),rgba32uint:new ne("rgba32uint",te.keyword,"rgba32uint"),rgba32sint:new ne("rgba32sint",te.keyword,"rgba32sint"),rgba32float:new ne("rgba32float",te.keyword,"rgba32float"),static_assert:new ne("static_assert",te.keyword,"static_assert")};k.tokens={decimal_float_literal:new ne("decimal_float_literal",te.token,/((-?[0-9]*\.[0-9]+|-?[0-9]+\.[0-9]*)((e|E)(\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\+|-)?[0-9]+f?)|(-?[0-9]+f)/),hex_float_literal:new ne("hex_float_literal",te.token,/-?0x((([0-9a-fA-F]*\.[0-9a-fA-F]+|[0-9a-fA-F]+\.[0-9a-fA-F]*)((p|P)(\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\+|-)?[0-9]+f?))/),int_literal:new ne("int_literal",te.token,/-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),uint_literal:new ne("uint_literal",te.token,/0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),ident:new ne("ident",te.token,/[_a-zA-Z][0-9a-zA-Z_]*/),and:new ne("and",te.token,"&"),and_and:new ne("and_and",te.token,"&&"),arrow:new ne("arrow ",te.token,"->"),attr:new ne("attr",te.token,"@"),forward_slash:new ne("forward_slash",te.token,"/"),bang:new ne("bang",te.token,"!"),bracket_left:new ne("bracket_left",te.token,"["),bracket_right:new ne("bracket_right",te.token,"]"),brace_left:new ne("brace_left",te.token,"{"),brace_right:new ne("brace_right",te.token,"}"),colon:new ne("colon",te.token,":"),comma:new ne("comma",te.token,","),equal:new ne("equal",te.token,"="),equal_equal:new ne("equal_equal",te.token,"=="),not_equal:new ne("not_equal",te.token,"!="),greater_than:new ne("greater_than",te.token,">"),greater_than_equal:new ne("greater_than_equal",te.token,">="),shift_right:new ne("shift_right",te.token,">>"),less_than:new ne("less_than",te.token,"<"),less_than_equal:new ne("less_than_equal",te.token,"<="),shift_left:new ne("shift_left",te.token,"<<"),modulo:new ne("modulo",te.token,"%"),minus:new ne("minus",te.token,"-"),minus_minus:new ne("minus_minus",te.token,"--"),period:new ne("period",te.token,"."),plus:new ne("plus",te.token,"+"),plus_plus:new ne("plus_plus",te.token,"++"),or:new ne("or",te.token,"|"),or_or:new ne("or_or",te.token,"||"),paren_left:new ne("paren_left",te.token,"("),paren_right:new ne("paren_right",te.token,")"),semicolon:new ne("semicolon",te.token,";"),star:new ne("star",te.token,"*"),tilde:new ne("tilde",te.token,"~"),underscore:new ne("underscore",te.token,"_"),xor:new ne("xor",te.token,"^"),plus_equal:new ne("plus_equal",te.token,"+="),minus_equal:new ne("minus_equal",te.token,"-="),times_equal:new ne("times_equal",te.token,"*="),division_equal:new ne("division_equal",te.token,"/="),modulo_equal:new ne("modulo_equal",te.token,"%="),and_equal:new ne("and_equal",te.token,"&="),or_equal:new ne("or_equal",te.token,"|="),xor_equal:new ne("xor_equal",te.token,"^="),shift_right_equal:new ne("shift_right_equal",te.token,">>="),shift_left_equal:new ne("shift_left_equal",te.token,"<<=")};k.simpleTokens={"@":oe.tokens.attr,"{":oe.tokens.brace_left,"}":oe.tokens.brace_right,":":oe.tokens.colon,",":oe.tokens.comma,"(":oe.tokens.paren_left,")":oe.tokens.paren_right,";":oe.tokens.semicolon};k.literalTokens={"&":oe.tokens.and,"&&":oe.tokens.and_and,"->":oe.tokens.arrow,"/":oe.tokens.forward_slash,"!":oe.tokens.bang,"[":oe.tokens.bracket_left,"]":oe.tokens.bracket_right,"=":oe.tokens.equal,"==":oe.tokens.equal_equal,"!=":oe.tokens.not_equal,">":oe.tokens.greater_than,">=":oe.tokens.greater_than_equal,">>":oe.tokens.shift_right,"<":oe.tokens.less_than,"<=":oe.tokens.less_than_equal,"<<":oe.tokens.shift_left,"%":oe.tokens.modulo,"-":oe.tokens.minus,"--":oe.tokens.minus_minus,".":oe.tokens.period,"+":oe.tokens.plus,"++":oe.tokens.plus_plus,"|":oe.tokens.or,"||":oe.tokens.or_or,"*":oe.tokens.star,"~":oe.tokens.tilde,_:oe.tokens.underscore,"^":oe.tokens.xor,"+=":oe.tokens.plus_equal,"-=":oe.tokens.minus_equal,"*=":oe.tokens.times_equal,"/=":oe.tokens.division_equal,"%=":oe.tokens.modulo_equal,"&=":oe.tokens.and_equal,"|=":oe.tokens.or_equal,"^=":oe.tokens.xor_equal,">>=":oe.tokens.shift_right_equal,"<<=":oe.tokens.shift_left_equal};k.regexTokens={decimal_float_literal:oe.tokens.decimal_float_literal,hex_float_literal:oe.tokens.hex_float_literal,int_literal:oe.tokens.int_literal,uint_literal:oe.tokens.uint_literal,ident:oe.tokens.ident};k.storage_class=[oe.keywords.function,oe.keywords.private,oe.keywords.workgroup,oe.keywords.uniform,oe.keywords.storage];k.access_mode=[oe.keywords.read,oe.keywords.write,oe.keywords.read_write];k.sampler_type=[oe.keywords.sampler,oe.keywords.sampler_comparison];k.sampled_texture_type=[oe.keywords.texture_1d,oe.keywords.texture_2d,oe.keywords.texture_2d_array,oe.keywords.texture_3d,oe.keywords.texture_cube,oe.keywords.texture_cube_array];k.multisampled_texture_type=[oe.keywords.texture_multisampled_2d];k.storage_texture_type=[oe.keywords.texture_storage_1d,oe.keywords.texture_storage_2d,oe.keywords.texture_storage_2d_array,oe.keywords.texture_storage_3d];k.depth_texture_type=[oe.keywords.texture_depth_2d,oe.keywords.texture_depth_2d_array,oe.keywords.texture_depth_cube,oe.keywords.texture_depth_cube_array,oe.keywords.texture_depth_multisampled_2d];k.texture_external_type=[oe.keywords.texture_external];k.any_texture_type=[...oe.sampled_texture_type,...oe.multisampled_texture_type,...oe.storage_texture_type,...oe.depth_texture_type,...oe.texture_external_type];k.texel_format=[oe.keywords.r8unorm,oe.keywords.r8snorm,oe.keywords.r8uint,oe.keywords.r8sint,oe.keywords.r16uint,oe.keywords.r16sint,oe.keywords.r16float,oe.keywords.rg8unorm,oe.keywords.rg8snorm,oe.keywords.rg8uint,oe.keywords.rg8sint,oe.keywords.r32uint,oe.keywords.r32sint,oe.keywords.r32float,oe.keywords.rg16uint,oe.keywords.rg16sint,oe.keywords.rg16float,oe.keywords.rgba8unorm,oe.keywords.rgba8unorm_srgb,oe.keywords.rgba8snorm,oe.keywords.rgba8uint,oe.keywords.rgba8sint,oe.keywords.bgra8unorm,oe.keywords.bgra8unorm_srgb,oe.keywords.rgb10a2unorm,oe.keywords.rg11b10float,oe.keywords.rg32uint,oe.keywords.rg32sint,oe.keywords.rg32float,oe.keywords.rgba16uint,oe.keywords.rgba16sint,oe.keywords.rgba16float,oe.keywords.rgba32uint,oe.keywords.rgba32sint,oe.keywords.rgba32float];k.const_literal=[oe.tokens.int_literal,oe.tokens.uint_literal,oe.tokens.decimal_float_literal,oe.tokens.hex_float_literal,oe.keywords.true,oe.keywords.false];k.literal_or_ident=[oe.tokens.ident,oe.tokens.int_literal,oe.tokens.uint_literal,oe.tokens.decimal_float_literal,oe.tokens.hex_float_literal];k.element_count_expression=[oe.tokens.int_literal,oe.tokens.uint_literal,oe.tokens.ident];k.template_types=[oe.keywords.vec2,oe.keywords.vec3,oe.keywords.vec4,oe.keywords.mat2x2,oe.keywords.mat2x3,oe.keywords.mat2x4,oe.keywords.mat3x2,oe.keywords.mat3x3,oe.keywords.mat3x4,oe.keywords.mat4x2,oe.keywords.mat4x3,oe.keywords.mat4x4,oe.keywords.atomic,oe.keywords.bitcast,...oe.any_texture_type];k.attribute_name=[oe.tokens.ident,oe.keywords.block,oe.keywords.diagnostic];k.assignment_operators=[oe.tokens.equal,oe.tokens.plus_equal,oe.tokens.minus_equal,oe.tokens.times_equal,oe.tokens.division_equal,oe.tokens.modulo_equal,oe.tokens.and_equal,oe.tokens.or_equal,oe.tokens.xor_equal,oe.tokens.shift_right_equal,oe.tokens.shift_left_equal];k.increment_operators=[oe.tokens.plus_plus,oe.tokens.minus_minus];class _A{constructor(e,n,r){this.type=e,this.lexeme=n,this.line=r}toString(){return this.lexeme}isTemplateType(){return k.template_types.indexOf(this.type)!=-1}isArrayType(){return this.type==k.keywords.array}isArrayOrTemplateType(){return this.isArrayType()||this.isTemplateType()}}class kH{constructor(e){this._tokens=[],this._start=0,this._current=0,this._line=1,this._source=e??""}scanTokens(){for(;!this._isAtEnd();)if(this._start=this._current,!this.scanToken())throw`Invalid syntax at line ${this._line}`;return this._tokens.push(new _A(k.eof,"",this._line)),this._tokens}scanToken(){let e=this._advance();if(e==`
`)return this._line++,!0;if(this._isWhitespace(e))return!0;if(e=="/"){if(this._peekAhead()=="/"){for(;e!=`
`;){if(this._isAtEnd())return!0;e=this._advance()}return this._line++,!0}else if(this._peekAhead()=="*"){this._advance();let l=1;for(;l>0;){if(this._isAtEnd())return!0;if(e=this._advance(),e==`
`)this._line++;else if(e=="*"){if(this._peekAhead()=="/"&&(this._advance(),l--,l==0))return!0}else e=="/"&&this._peekAhead()=="*"&&(this._advance(),l++)}return!0}}const n=k.simpleTokens[e];if(n)return this._addToken(n),!0;let r=k.none;const i=this._isAlpha(e),s=e==="_";if(this._isAlphaNumeric(e)){let l=this._peekAhead();for(;this._isAlphaNumeric(l);)e+=this._advance(),l=this._peekAhead()}if(i){const l=k.keywords[e];if(l)return this._addToken(l),!0}if(i||s)return this._addToken(k.tokens.ident),!0;for(;;){let l=this._findType(e);const c=this._peekAhead();if(e=="-"&&this._tokens.length>0){if(c=="=")return this._current++,e+=c,this._addToken(k.tokens.minus_equal),!0;if(c=="-")return this._current++,e+=c,this._addToken(k.tokens.minus_minus),!0;const f=this._tokens.length-1;if((k.literal_or_ident.indexOf(this._tokens[f].type)!=-1||this._tokens[f].type==k.tokens.paren_right)&&c!=">")return this._addToken(l),!0}if(e==">"&&(c==">"||c=="=")){let f=!1,d=this._tokens.length-1;for(let g=0;g<5&&d>=0&&k.assignment_operators.indexOf(this._tokens[d].type)===-1;++g,--d)if(this._tokens[d].type===k.tokens.less_than){d>0&&this._tokens[d-1].isArrayOrTemplateType()&&(f=!0);break}if(f)return this._addToken(l),!0}if(l===k.none){let f=e,d=0;const g=2;for(let m=0;m<g;++m)if(f+=this._peekAhead(m),l=this._findType(f),l!==k.none){d=m;break}if(l===k.none)return r===k.none?!1:(this._current--,this._addToken(r),!0);e=f,this._current+=d+1}if(r=l,this._isAtEnd())break;e+=this._advance()}return r===k.none?!1:(this._addToken(r),!0)}_findType(e){for(const r in k.regexTokens){const i=k.regexTokens[r];if(this._match(e,i.rule))return i}const n=k.literalTokens[e];return n||k.none}_match(e,n){const r=n.exec(e);return r&&r.index==0&&r[0]==e}_isAtEnd(){return this._current>=this._source.length}_isAlpha(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}_isAlphaNumeric(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e=="_"||e>="0"&&e<="9"}_isWhitespace(e){return e==" "||e==" "||e=="\r"}_advance(e=0){let n=this._source[this._current];return e=e||0,e++,this._current+=e,n}_peekAhead(e=0){return e=e||0,this._current+e>=this._source.length?"\0":this._source[this._current+e]}_addToken(e){const n=this._source.substring(this._start,this._current);this._tokens.push(new _A(e,n,this._line))}}class BH{constructor(){this._tokens=[],this._current=0,this._currentLine=0,this._context=new lH,this._deferArrayCountEval=[]}parse(e){this._initialize(e),this._deferArrayCountEval.length=0;const n=[];for(;!this._isAtEnd();){const r=this._global_decl_or_directive();if(!r)break;n.push(r)}if(this._deferArrayCountEval.length>0){for(const r of this._deferArrayCountEval){const i=r.arrayType,s=r.countNode;if(s instanceof cy){const c=s.name,f=this._context.constants.get(c);if(f)try{const d=f.evaluate(this._context);i.count=d}catch{}}}this._deferArrayCountEval.length=0}return n}_initialize(e){if(e)if(typeof e=="string"){const n=new kH(e);this._tokens=n.scanTokens()}else this._tokens=e;else this._tokens=[];this._current=0}_error(e,n){return{token:e,message:n,toString:function(){return`${n}`}}}_isAtEnd(){return this._current>=this._tokens.length||this._peek().type==k.eof}_match(e){if(e instanceof ne)return this._check(e)?(this._advance(),!0):!1;for(let n=0,r=e.length;n<r;++n){const i=e[n];if(this._check(i))return this._advance(),!0}return!1}_consume(e,n){if(this._check(e))return this._advance();throw this._error(this._peek(),n)}_check(e){if(this._isAtEnd())return!1;const n=this._peek();if(e instanceof Array){const r=n.type;return e.indexOf(r)!=-1}return n.type==e}_advance(){var e,n;return this._currentLine=(n=(e=this._peek())===null||e===void 0?void 0:e.line)!==null&&n!==void 0?n:-1,this._isAtEnd()||this._current++,this._previous()}_peek(){return this._tokens[this._current]}_previous(){return this._tokens[this._current-1]}_global_decl_or_directive(){for(;this._match(k.tokens.semicolon)&&!this._isAtEnd(););if(this._match(k.keywords.alias)){const n=this._type_alias();return this._consume(k.tokens.semicolon,"Expected ';'"),n}if(this._match(k.keywords.diagnostic)){const n=this._diagnostic();return this._consume(k.tokens.semicolon,"Expected ';'"),n}if(this._match(k.keywords.requires)){const n=this._requires_directive();return this._consume(k.tokens.semicolon,"Expected ';'"),n}if(this._match(k.keywords.enable)){const n=this._enable_directive();return this._consume(k.tokens.semicolon,"Expected ';'"),n}const e=this._attribute();if(this._check(k.keywords.var)){const n=this._global_variable_decl();return n!=null&&(n.attributes=e),this._consume(k.tokens.semicolon,"Expected ';'."),n}if(this._check(k.keywords.override)){const n=this._override_variable_decl();return n!=null&&(n.attributes=e),this._consume(k.tokens.semicolon,"Expected ';'."),n}if(this._check(k.keywords.let)){const n=this._global_let_decl();return n!=null&&(n.attributes=e),this._consume(k.tokens.semicolon,"Expected ';'."),n}if(this._check(k.keywords.const)){const n=this._global_const_decl();return n!=null&&(n.attributes=e),this._consume(k.tokens.semicolon,"Expected ';'."),n}if(this._check(k.keywords.struct)){const n=this._struct_decl();return n!=null&&(n.attributes=e),n}if(this._check(k.keywords.fn)){const n=this._function_decl();return n!=null&&(n.attributes=e),n}return null}_function_decl(){if(!this._match(k.keywords.fn))return null;const e=this._currentLine,n=this._consume(k.tokens.ident,"Expected function name.").toString();this._consume(k.tokens.paren_left,"Expected '(' for function arguments.");const r=[];if(!this._check(k.tokens.paren_right))do{if(this._check(k.tokens.paren_right))break;const c=this._attribute(),f=this._consume(k.tokens.ident,"Expected argument name.").toString();this._consume(k.tokens.colon,"Expected ':' for argument type.");const d=this._attribute(),g=this._type_decl();g!=null&&(g.attributes=d,r.push(new NH(f,g,c)))}while(this._match(k.tokens.comma));this._consume(k.tokens.paren_right,"Expected ')' after function arguments.");let i=null;if(this._match(k.tokens.arrow)){const c=this._attribute();i=this._type_decl(),i!=null&&(i.attributes=c)}const s=this._compound_statement(),l=this._currentLine;return new oy(n,r,i,s,e,l)}_compound_statement(){const e=[];for(this._consume(k.tokens.brace_left,"Expected '{' for block.");!this._check(k.tokens.brace_right);){const n=this._statement();n!==null&&e.push(n)}return this._consume(k.tokens.brace_right,"Expected '}' for block."),e}_statement(){for(;this._match(k.tokens.semicolon)&&!this._isAtEnd(););if(this._check(k.tokens.attr)&&this._attribute(),this._check(k.keywords.if))return this._if_statement();if(this._check(k.keywords.switch))return this._switch_statement();if(this._check(k.keywords.loop))return this._loop_statement();if(this._check(k.keywords.for))return this._for_statement();if(this._check(k.keywords.while))return this._while_statement();if(this._check(k.keywords.continuing))return this._continuing_statement();if(this._check(k.keywords.static_assert))return this._static_assert_statement();if(this._check(k.tokens.brace_left))return this._compound_statement();let e=null;return this._check(k.keywords.return)?e=this._return_statement():this._check([k.keywords.var,k.keywords.let,k.keywords.const])?e=this._variable_statement():this._match(k.keywords.discard)?e=new wH:this._match(k.keywords.break)?e=new EH:this._match(k.keywords.continue)?e=new TH:e=this._increment_decrement_statement()||this._func_call_statement()||this._assignment_statement(),e!=null&&this._consume(k.tokens.semicolon,"Expected ';' after statement."),e}_static_assert_statement(){if(!this._match(k.keywords.static_assert))return null;const e=this._optional_paren_expression();return new cH(e)}_while_statement(){if(!this._match(k.keywords.while))return null;const e=this._optional_paren_expression();this._check(k.tokens.attr)&&this._attribute();const n=this._compound_statement();return new uH(e,n)}_continuing_statement(){if(!this._match(k.keywords.continuing))return null;const e=this._compound_statement();return new fH(e)}_for_statement(){if(!this._match(k.keywords.for))return null;this._consume(k.tokens.paren_left,"Expected '('.");const e=this._check(k.tokens.semicolon)?null:this._for_init();this._consume(k.tokens.semicolon,"Expected ';'.");const n=this._check(k.tokens.semicolon)?null:this._short_circuit_or_expression();this._consume(k.tokens.semicolon,"Expected ';'.");const r=this._check(k.tokens.paren_right)?null:this._for_increment();this._consume(k.tokens.paren_right,"Expected ')'."),this._check(k.tokens.attr)&&this._attribute();const i=this._compound_statement();return new dH(e,n,r,i)}_for_init(){return this._variable_statement()||this._func_call_statement()||this._assignment_statement()}_for_increment(){return this._func_call_statement()||this._increment_decrement_statement()||this._assignment_statement()}_variable_statement(){if(this._check(k.keywords.var)){const e=this._variable_decl();if(e===null)throw this._error(this._peek(),"Variable declaration expected.");let n=null;return this._match(k.tokens.equal)&&(n=this._short_circuit_or_expression()),new bo(e.name,e.type,e.storage,e.access,n)}if(this._match(k.keywords.let)){const e=this._consume(k.tokens.ident,"Expected name for let.").toString();let n=null;if(this._match(k.tokens.colon)){const i=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=i)}this._consume(k.tokens.equal,"Expected '=' for let.");const r=this._short_circuit_or_expression();return new ly(e,n,null,null,r)}if(this._match(k.keywords.const)){const e=this._consume(k.tokens.ident,"Expected name for const.").toString();let n=null;if(this._match(k.tokens.colon)){const i=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=i)}this._consume(k.tokens.equal,"Expected '=' for const.");const r=this._short_circuit_or_expression();return new gA(e,n,null,null,r)}return null}_increment_decrement_statement(){const e=this._current,n=this._unary_expression();if(n==null)return null;if(!this._check(k.increment_operators))return this._current=e,null;const r=this._consume(k.increment_operators,"Expected increment operator");return new hH(r.type===k.tokens.plus_plus?Nc.increment:Nc.decrement,n)}_assignment_statement(){let e=null;if(this._check(k.tokens.brace_right))return null;let n=this._match(k.tokens.underscore);if(n||(e=this._unary_expression()),!n&&e==null)return null;const r=this._consume(k.assignment_operators,"Expected assignment operator."),i=this._short_circuit_or_expression();return new gH(Df.parse(r.lexeme),e,i)}_func_call_statement(){if(!this._check(k.tokens.ident))return null;const e=this._current,n=this._consume(k.tokens.ident,"Expected function name."),r=this._argument_expression_list();return r===null?(this._current=e,null):new $M(n.lexeme,r)}_loop_statement(){if(!this._match(k.keywords.loop))return null;this._check(k.tokens.attr)&&this._attribute(),this._consume(k.tokens.brace_left,"Expected '{' for loop.");const e=[];let n=this._statement();for(;n!==null;){if(Array.isArray(n))for(let i of n)e.push(i);else e.push(n);n=this._statement()}let r=null;return this._match(k.keywords.continuing)&&(r=this._compound_statement()),this._consume(k.tokens.brace_right,"Expected '}' for loop."),new pH(e,r)}_switch_statement(){if(!this._match(k.keywords.switch))return null;const e=this._optional_paren_expression();this._check(k.tokens.attr)&&this._attribute(),this._consume(k.tokens.brace_left,"Expected '{' for switch.");const n=this._switch_body();if(n==null||n.length==0)throw this._error(this._previous(),"Expected 'case' or 'default'.");return this._consume(k.tokens.brace_right,"Expected '}' for switch."),new mH(e,n)}_switch_body(){const e=[];if(this._match(k.keywords.case)){const n=this._case_selectors();this._match(k.tokens.colon),this._check(k.tokens.attr)&&this._attribute(),this._consume(k.tokens.brace_left,"Exected '{' for switch case.");const r=this._case_body();this._consume(k.tokens.brace_right,"Exected '}' for switch case."),e.push(new OH(n,r))}if(this._match(k.keywords.default)){this._match(k.tokens.colon),this._check(k.tokens.attr)&&this._attribute(),this._consume(k.tokens.brace_left,"Exected '{' for switch default.");const n=this._case_body();this._consume(k.tokens.brace_right,"Exected '}' for switch default."),e.push(new PH(n))}if(this._check([k.keywords.default,k.keywords.case])){const n=this._switch_body();e.push(n[0])}return e}_case_selectors(){const e=[this._shift_expression()];for(;this._match(k.tokens.comma);)e.push(this._shift_expression());return e}_case_body(){if(this._match(k.keywords.fallthrough))return this._consume(k.tokens.semicolon,"Expected ';'"),[];let e=this._statement();if(e==null)return[];e instanceof Array||(e=[e]);const n=this._case_body();return n.length==0?e:[...e,n[0]]}_if_statement(){if(!this._match(k.keywords.if))return null;const e=this._optional_paren_expression();this._check(k.tokens.attr)&&this._attribute();const n=this._compound_statement();let r=[];this._match_elseif()&&(this._check(k.tokens.attr)&&this._attribute(),r=this._elseif_statement(r));let i=null;return this._match(k.keywords.else)&&(this._check(k.tokens.attr)&&this._attribute(),i=this._compound_statement()),new vH(e,n,r,i)}_match_elseif(){return this._tokens[this._current].type===k.keywords.else&&this._tokens[this._current+1].type===k.keywords.if?(this._advance(),this._advance(),!0):!1}_elseif_statement(e=[]){const n=this._optional_paren_expression(),r=this._compound_statement();return e.push(new IH(n,r)),this._match_elseif()&&(this._check(k.tokens.attr)&&this._attribute(),this._elseif_statement(e)),e}_return_statement(){if(!this._match(k.keywords.return))return null;const e=this._short_circuit_or_expression();return new _H(e)}_short_circuit_or_expression(){let e=this._short_circuit_and_expr();for(;this._match(k.tokens.or_or);)e=new cs(this._previous().toString(),e,this._short_circuit_and_expr());return e}_short_circuit_and_expr(){let e=this._inclusive_or_expression();for(;this._match(k.tokens.and_and);)e=new cs(this._previous().toString(),e,this._inclusive_or_expression());return e}_inclusive_or_expression(){let e=this._exclusive_or_expression();for(;this._match(k.tokens.or);)e=new cs(this._previous().toString(),e,this._exclusive_or_expression());return e}_exclusive_or_expression(){let e=this._and_expression();for(;this._match(k.tokens.xor);)e=new cs(this._previous().toString(),e,this._and_expression());return e}_and_expression(){let e=this._equality_expression();for(;this._match(k.tokens.and);)e=new cs(this._previous().toString(),e,this._equality_expression());return e}_equality_expression(){const e=this._relational_expression();return this._match([k.tokens.equal_equal,k.tokens.not_equal])?new cs(this._previous().toString(),e,this._relational_expression()):e}_relational_expression(){let e=this._shift_expression();for(;this._match([k.tokens.less_than,k.tokens.greater_than,k.tokens.less_than_equal,k.tokens.greater_than_equal]);)e=new cs(this._previous().toString(),e,this._shift_expression());return e}_shift_expression(){let e=this._additive_expression();for(;this._match([k.tokens.shift_left,k.tokens.shift_right]);)e=new cs(this._previous().toString(),e,this._additive_expression());return e}_additive_expression(){let e=this._multiplicative_expression();for(;this._match([k.tokens.plus,k.tokens.minus]);)e=new cs(this._previous().toString(),e,this._multiplicative_expression());return e}_multiplicative_expression(){let e=this._unary_expression();for(;this._match([k.tokens.star,k.tokens.forward_slash,k.tokens.modulo]);)e=new cs(this._previous().toString(),e,this._unary_expression());return e}_unary_expression(){return this._match([k.tokens.minus,k.tokens.bang,k.tokens.tilde,k.tokens.star,k.tokens.and])?new MH(this._previous().toString(),this._unary_expression()):this._singular_expression()}_singular_expression(){const e=this._primary_expression(),n=this._postfix_expression();return n&&(e.postfix=n),e}_postfix_expression(){if(this._match(k.tokens.bracket_left)){const e=this._short_circuit_or_expression();this._consume(k.tokens.bracket_right,"Expected ']'.");const n=new xH(e),r=this._postfix_expression();return r&&(n.postfix=r),n}if(this._match(k.tokens.period)){const e=this._consume(k.tokens.ident,"Expected member name."),n=this._postfix_expression(),r=new CH(e.lexeme);return n&&(r.postfix=n),r}return null}_getStruct(e){return this._context.aliases.has(e)?this._context.aliases.get(e).type:this._context.structs.has(e)?this._context.structs.get(e):null}_primary_expression(){if(this._match(k.tokens.ident)){const r=this._previous().toString();if(this._check(k.tokens.paren_left)){const i=this._argument_expression_list(),s=this._getStruct(r);return s!=null?new Ql(s,i):new WM(r,i)}if(this._context.constants.has(r)){const i=this._context.constants.get(r);return new pA(r,i.value)}return new cy(r)}if(this._match(k.const_literal))return new mA(parseFloat(this._previous().toString()));if(this._check(k.tokens.paren_left))return this._paren_expression();if(this._match(k.keywords.bitcast)){this._consume(k.tokens.less_than,"Expected '<'.");const r=this._type_decl();this._consume(k.tokens.greater_than,"Expected '>'.");const i=this._paren_expression();return new RH(r,i)}const e=this._type_decl(),n=this._argument_expression_list();return new Ql(e,n)}_argument_expression_list(){if(!this._match(k.tokens.paren_left))return null;const e=[];do{if(this._check(k.tokens.paren_right))break;const n=this._short_circuit_or_expression();e.push(n)}while(this._match(k.tokens.comma));return this._consume(k.tokens.paren_right,"Expected ')' for agument list"),e}_optional_paren_expression(){this._match(k.tokens.paren_left);const e=this._short_circuit_or_expression();return this._match(k.tokens.paren_right),new vA([e])}_paren_expression(){this._consume(k.tokens.paren_left,"Expected '('.");const e=this._short_circuit_or_expression();return this._consume(k.tokens.paren_right,"Expected ')'."),new vA([e])}_struct_decl(){if(!this._match(k.keywords.struct))return null;const e=this._currentLine,n=this._consume(k.tokens.ident,"Expected name for struct.").toString();this._consume(k.tokens.brace_left,"Expected '{' for struct body.");const r=[];for(;!this._check(k.tokens.brace_right);){const l=this._attribute(),c=this._consume(k.tokens.ident,"Expected variable name.").toString();this._consume(k.tokens.colon,"Expected ':' for struct member type.");const f=this._attribute(),d=this._type_decl();d!=null&&(d.attributes=f),this._check(k.tokens.brace_right)?this._match(k.tokens.comma):this._consume(k.tokens.comma,"Expected ',' for struct member."),r.push(new DH(c,d,l))}this._consume(k.tokens.brace_right,"Expected '}' after struct body.");const i=this._currentLine,s=new mo(n,r,e,i);return this._context.structs.set(n,s),s}_global_variable_decl(){const e=this._variable_decl();return e&&this._match(k.tokens.equal)&&(e.value=this._const_expression()),e}_override_variable_decl(){const e=this._override_decl();return e&&this._match(k.tokens.equal)&&(e.value=this._const_expression()),e}_global_const_decl(){if(!this._match(k.keywords.const))return null;const e=this._consume(k.tokens.ident,"Expected variable name");let n=null;if(this._match(k.tokens.colon)){const s=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=s)}let r=null;if(this._match(k.tokens.equal)){const s=this._short_circuit_or_expression();if(s instanceof Ql)r=s;else if(s instanceof pA&&s.initializer instanceof Ql)r=s.initializer;else try{const l=s.evaluate(this._context);r=new mA(l)}catch{r=s}}const i=new gA(e.toString(),n,"","",r);return this._context.constants.set(i.name,i),i}_global_let_decl(){if(!this._match(k.keywords.let))return null;const e=this._consume(k.tokens.ident,"Expected variable name");let n=null;if(this._match(k.tokens.colon)){const i=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=i)}let r=null;return this._match(k.tokens.equal)&&(r=this._const_expression()),new ly(e.toString(),n,"","",r)}_const_expression(){return this._short_circuit_or_expression()}_variable_decl(){if(!this._match(k.keywords.var))return null;let e="",n="";this._match(k.tokens.less_than)&&(e=this._consume(k.storage_class,"Expected storage_class.").toString(),this._match(k.tokens.comma)&&(n=this._consume(k.access_mode,"Expected access_mode.").toString()),this._consume(k.tokens.greater_than,"Expected '>'."));const r=this._consume(k.tokens.ident,"Expected variable name");let i=null;if(this._match(k.tokens.colon)){const s=this._attribute();i=this._type_decl(),i!=null&&(i.attributes=s)}return new bo(r.toString(),i,e,n,null)}_override_decl(){if(!this._match(k.keywords.override))return null;const e=this._consume(k.tokens.ident,"Expected variable name");let n=null;if(this._match(k.tokens.colon)){const r=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=r)}return new zM(e.toString(),n,null)}_diagnostic(){this._consume(k.tokens.paren_left,"Expected '('");const e=this._consume(k.tokens.ident,"Expected severity control name.");this._consume(k.tokens.comma,"Expected ','");const n=this._consume(k.tokens.ident,"Expected diagnostic rule name.");return this._consume(k.tokens.paren_right,"Expected ')'"),new SH(e.toString(),n.toString())}_enable_directive(){const e=this._consume(k.tokens.ident,"identity expected.");return new yH(e.toString())}_requires_directive(){const e=[this._consume(k.tokens.ident,"identity expected.").toString()];for(;this._match(k.tokens.comma);){const n=this._consume(k.tokens.ident,"identity expected.");e.push(n.toString())}return new bH(e)}_type_alias(){const e=this._consume(k.tokens.ident,"identity expected.");this._consume(k.tokens.equal,"Expected '=' for type alias.");let n=this._type_decl();if(n===null)throw this._error(this._peek(),"Expected Type for Alias.");this._context.aliases.has(n.name)&&(n=this._context.aliases.get(n.name).type);const r=new VM(e.toString(),n);return this._context.aliases.set(r.name,r),r}_type_decl(){if(this._check([k.tokens.ident,...k.texel_format,k.keywords.bool,k.keywords.f32,k.keywords.i32,k.keywords.u32])){const r=this._advance(),i=r.toString();return this._context.structs.has(i)?this._context.structs.get(i):this._context.aliases.has(i)?this._context.aliases.get(i).type:new el(r.toString())}let e=this._texture_sampler_types();if(e)return e;if(this._check(k.template_types)){let r=this._advance().toString(),i=null,s=null;return this._match(k.tokens.less_than)&&(i=this._type_decl(),s=null,this._match(k.tokens.comma)&&(s=this._consume(k.access_mode,"Expected access_mode for pointer").toString()),this._consume(k.tokens.greater_than,"Expected '>' for type.")),new HM(r,i,s)}if(this._match(k.keywords.ptr)){let r=this._previous().toString();this._consume(k.tokens.less_than,"Expected '<' for pointer.");const i=this._consume(k.storage_class,"Expected storage_class for pointer");this._consume(k.tokens.comma,"Expected ',' for pointer.");const s=this._type_decl();let l=null;return this._match(k.tokens.comma)&&(l=this._consume(k.access_mode,"Expected access_mode for pointer").toString()),this._consume(k.tokens.greater_than,"Expected '>' for pointer."),new AH(r,i.toString(),s,l)}const n=this._attribute();if(this._match(k.keywords.array)){let r=null,i=-1;const s=this._previous();let l=null;if(this._match(k.tokens.less_than)){r=this._type_decl(),this._context.aliases.has(r.name)&&(r=this._context.aliases.get(r.name).type);let f="";if(this._match(k.tokens.comma)){l=this._shift_expression();try{f=l.evaluate(this._context).toString(),l=null}catch{f="1"}}this._consume(k.tokens.greater_than,"Expected '>' for array."),i=f?parseInt(f):0}const c=new jM(s.toString(),n,r,i);return l&&this._deferArrayCountEval.push({arrayType:c,countNode:l}),c}return null}_texture_sampler_types(){if(this._match(k.sampler_type))return new Qu(this._previous().toString(),null,null);if(this._match(k.depth_texture_type))return new Qu(this._previous().toString(),null,null);if(this._match(k.sampled_texture_type)||this._match(k.multisampled_texture_type)){const e=this._previous();this._consume(k.tokens.less_than,"Expected '<' for sampler type.");const n=this._type_decl();return this._consume(k.tokens.greater_than,"Expected '>' for sampler type."),new Qu(e.toString(),n,null)}if(this._match(k.storage_texture_type)){const e=this._previous();this._consume(k.tokens.less_than,"Expected '<' for sampler type.");const n=this._consume(k.texel_format,"Invalid texel format.").toString();this._consume(k.tokens.comma,"Expected ',' after texel format.");const r=this._consume(k.access_mode,"Expected access mode for storage texture type.").toString();return this._consume(k.tokens.greater_than,"Expected '>' for sampler type."),new Qu(e.toString(),n,r)}return null}_attribute(){let e=[];for(;this._match(k.tokens.attr);){const n=this._consume(k.attribute_name,"Expected attribute name"),r=new FH(n.toString(),null);if(this._match(k.tokens.paren_left)){if(r.value=this._consume(k.literal_or_ident,"Expected attribute value").toString(),this._check(k.tokens.comma)){this._advance();do{const i=this._consume(k.literal_or_ident,"Expected attribute value").toString();r.value instanceof Array||(r.value=[r.value]),r.value.push(i)}while(this._match(k.tokens.comma))}this._consume(k.tokens.paren_right,"Expected ')'")}e.push(r)}return e.length==0?null:e}}class ac{constructor(e,n){this.name=e,this.attributes=n,this.size=0}get isArray(){return!1}get isStruct(){return!1}get isTemplate(){return!1}}class yA{constructor(e,n,r){this.name=e,this.type=n,this.attributes=r,this.offset=0,this.size=0}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray?this.type.format:this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class Th extends ac{constructor(e,n){super(e,n),this.members=[],this.align=0,this.startLine=-1,this.endLine=-1,this.inUse=!1}get isStruct(){return!0}}class f0 extends ac{constructor(e,n){super(e,n),this.count=0,this.stride=0}get isArray(){return!0}}class bA extends ac{constructor(e,n,r,i){super(e,r),this.format=n,this.access=i}get isTemplate(){return!0}}var Ea;(function(t){t[t.Uniform=0]="Uniform",t[t.Storage=1]="Storage",t[t.Texture=2]="Texture",t[t.Sampler=3]="Sampler",t[t.StorageTexture=4]="StorageTexture"})(Ea||(Ea={}));class Ah{constructor(e,n,r,i,s,l,c){this.name=e,this.type=n,this.group=r,this.binding=i,this.attributes=s,this.resourceType=l,this.access=c}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get size(){return this.type.size}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray?this.type.format:this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class UH{constructor(e,n){this.name=e,this.type=n}}class Ch{constructor(e,n){this.align=e,this.size=n}}class LH{constructor(e,n,r,i){this.name=e,this.type=n,this.locationType=r,this.location=i,this.interpolation=null}}class SA{constructor(e,n,r,i){this.name=e,this.type=n,this.locationType=r,this.location=i}}class zH{constructor(e,n,r,i){this.name=e,this.type=n,this.attributes=r,this.id=i}}class $H{constructor(e,n){this.name=e,this.type=n}}class VH{constructor(e,n=null){this.stage=null,this.inputs=[],this.outputs=[],this.arguments=[],this.returnType=null,this.resources=[],this.overrides=[],this.startLine=-1,this.endLine=-1,this.inUse=!1,this.calls=new Set,this.name=e,this.stage=n}}class HH{constructor(){this.vertex=[],this.fragment=[],this.compute=[]}}class jH{constructor(e){this.resources=null,this.inUse=!1,this.info=null,this.node=e}}class Hs{constructor(e){this.uniforms=[],this.storage=[],this.textures=[],this.samplers=[],this.aliases=[],this.overrides=[],this.structs=[],this.entry=new HH,this.functions=[],this._types=new Map,this._functions=new Map,e&&this.update(e)}_isStorageTexture(e){return e.name=="texture_storage_1d"||e.name=="texture_storage_2d"||e.name=="texture_storage_2d_array"||e.name=="texture_storage_3d"}update(e){const r=new BH().parse(e);for(const i of r)i instanceof oy&&this._functions.set(i.name,new jH(i));for(const i of r)if(i instanceof mo){const s=this._getTypeInfo(i,null);s instanceof Th&&this.structs.push(s)}for(const i of r){if(i instanceof VM){this.aliases.push(this._getAliasInfo(i));continue}if(i instanceof zM){const s=i,l=this._getAttributeNum(s.attributes,"id",0),c=s.type!=null?this._getTypeInfo(s.type,s.attributes):null;this.overrides.push(new zH(s.name,c,s.attributes,l));continue}if(this._isUniformVar(i)){const s=i,l=this._getAttributeNum(s.attributes,"group",0),c=this._getAttributeNum(s.attributes,"binding",0),f=this._getTypeInfo(s.type,s.attributes),d=new Ah(s.name,f,l,c,s.attributes,Ea.Uniform,s.access);this.uniforms.push(d);continue}if(this._isStorageVar(i)){const s=i,l=this._getAttributeNum(s.attributes,"group",0),c=this._getAttributeNum(s.attributes,"binding",0),f=this._getTypeInfo(s.type,s.attributes),d=this._isStorageTexture(f),g=new Ah(s.name,f,l,c,s.attributes,d?Ea.StorageTexture:Ea.Storage,s.access);this.storage.push(g);continue}if(this._isTextureVar(i)){const s=i,l=this._getAttributeNum(s.attributes,"group",0),c=this._getAttributeNum(s.attributes,"binding",0),f=this._getTypeInfo(s.type,s.attributes),d=this._isStorageTexture(f),g=new Ah(s.name,f,l,c,s.attributes,d?Ea.StorageTexture:Ea.Texture,s.access);d?this.storage.push(g):this.textures.push(g);continue}if(this._isSamplerVar(i)){const s=i,l=this._getAttributeNum(s.attributes,"group",0),c=this._getAttributeNum(s.attributes,"binding",0),f=this._getTypeInfo(s.type,s.attributes),d=new Ah(s.name,f,l,c,s.attributes,Ea.Sampler,s.access);this.samplers.push(d);continue}if(i instanceof oy){const s=this._getAttribute(i,"vertex"),l=this._getAttribute(i,"fragment"),c=this._getAttribute(i,"compute"),f=s||l||c,d=new VH(i.name,f==null?void 0:f.name);d.startLine=i.startLine,d.endLine=i.endLine,this.functions.push(d),this._functions.get(i.name).info=d,f&&(this._functions.get(i.name).inUse=!0,d.inUse=!0,d.resources=this._findResources(i,!!f),d.inputs=this._getInputs(i.args),d.outputs=this._getOutputs(i.returnType),this.entry[f.name].push(d)),d.arguments=i.args.map(g=>new $H(g.name,this._getTypeInfo(g.type,g.attributes))),d.returnType=i.returnType?this._getTypeInfo(i.returnType,i.attributes):null;continue}}for(const i of this._functions.values())i.info&&(i.info.inUse=i.inUse,this._addCalls(i.node,i.info.calls));for(const i of this._functions.values())i.node.search(s=>{var l;if(s.astNodeType==="varExpr"){const c=s;for(const f of this.overrides)c.name==f.name&&((l=i.info)===null||l===void 0||l.overrides.push(f))}});for(const i of this.uniforms)this._markStructsInUse(i.type);for(const i of this.storage)this._markStructsInUse(i.type)}_markStructsInUse(e){if(e)if(e.isStruct){if(e.inUse=!0,e.members)for(const n of e.members)this._markStructsInUse(n.type)}else if(e.isArray)this._markStructsInUse(e.format);else if(e.isTemplate)e.format&&this._markStructsInUse(e.format);else{const n=this._getAlias(e.name);n&&this._markStructsInUse(n)}}_addCalls(e,n){var r;for(const i of e.calls){const s=(r=this._functions.get(i.name))===null||r===void 0?void 0:r.info;s&&n.add(s)}}findResource(e,n){for(const r of this.uniforms)if(r.group==e&&r.binding==n)return r;for(const r of this.storage)if(r.group==e&&r.binding==n)return r;for(const r of this.textures)if(r.group==e&&r.binding==n)return r;for(const r of this.samplers)if(r.group==e&&r.binding==n)return r;return null}_findResource(e){for(const n of this.uniforms)if(n.name==e)return n;for(const n of this.storage)if(n.name==e)return n;for(const n of this.textures)if(n.name==e)return n;for(const n of this.samplers)if(n.name==e)return n;return null}_markStructsFromAST(e){const n=this._getTypeInfo(e,null);this._markStructsInUse(n)}_findResources(e,n){const r=[],i=this,s=[];return e.search(l=>{if(l instanceof Rg)s.push({});else if(l instanceof xg)s.pop();else if(l instanceof bo){const c=l;n&&c.type!==null&&this._markStructsFromAST(c.type),s.length>0&&(s[s.length-1][c.name]=c)}else if(l instanceof Ql){const c=l;n&&c.type!==null&&this._markStructsFromAST(c.type)}else if(l instanceof ly){const c=l;n&&c.type!==null&&this._markStructsFromAST(c.type),s.length>0&&(s[s.length-1][c.name]=c)}else if(l instanceof cy){const c=l;if(s.length>0&&s[s.length-1][c.name])return;const f=i._findResource(c.name);f&&r.push(f)}else if(l instanceof WM){const c=l,f=i._functions.get(c.name);f&&(n&&(f.inUse=!0),e.calls.add(f.node),f.resources===null&&(f.resources=i._findResources(f.node,n)),r.push(...f.resources))}else if(l instanceof $M){const c=l,f=i._functions.get(c.name);f&&(n&&(f.inUse=!0),e.calls.add(f.node),f.resources===null&&(f.resources=i._findResources(f.node,n)),r.push(...f.resources))}}),[...new Map(r.map(l=>[l.name,l])).values()]}getBindGroups(){const e=[];function n(r,i){r>=e.length&&(e.length=r+1),e[r]===void 0&&(e[r]=[]),i>=e[r].length&&(e[r].length=i+1)}for(const r of this.uniforms){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}for(const r of this.storage){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}for(const r of this.textures){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}for(const r of this.samplers){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}return e}_getOutputs(e,n=void 0){if(n===void 0&&(n=[]),e instanceof mo)this._getStructOutputs(e,n);else{const r=this._getOutputInfo(e);r!==null&&n.push(r)}return n}_getStructOutputs(e,n){for(const r of e.members)if(r.type instanceof mo)this._getStructOutputs(r.type,n);else{const i=this._getAttribute(r,"location")||this._getAttribute(r,"builtin");if(i!==null){const s=this._getTypeInfo(r.type,r.type.attributes),l=this._parseInt(i.value),c=new SA(r.name,s,i.name,l);n.push(c)}}}_getOutputInfo(e){const n=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(n!==null){const r=this._getTypeInfo(e,e.attributes),i=this._parseInt(n.value);return new SA("",r,n.name,i)}return null}_getInputs(e,n=void 0){n===void 0&&(n=[]);for(const r of e)if(r.type instanceof mo)this._getStructInputs(r.type,n);else{const i=this._getInputInfo(r);i!==null&&n.push(i)}return n}_getStructInputs(e,n){for(const r of e.members)if(r.type instanceof mo)this._getStructInputs(r.type,n);else{const i=this._getInputInfo(r);i!==null&&n.push(i)}}_getInputInfo(e){const n=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(n!==null){const r=this._getAttribute(e,"interpolation"),i=this._getTypeInfo(e.type,e.attributes),s=this._parseInt(n.value),l=new LH(e.name,i,n.name,s);return r!==null&&(l.interpolation=this._parseString(r.value)),l}return null}_parseString(e){return e instanceof Array&&(e=e[0]),e}_parseInt(e){e instanceof Array&&(e=e[0]);const n=parseInt(e);return isNaN(n)?e:n}_getAlias(e){for(const n of this.aliases)if(n.name==e)return n.type;return null}_getAliasInfo(e){return new UH(e.name,this._getTypeInfo(e.type,null))}_getTypeInfo(e,n){if(this._types.has(e))return this._types.get(e);if(e instanceof jM){const i=e,s=i.format?this._getTypeInfo(i.format,i.attributes):null,l=new f0(i.name,n);return l.format=s,l.count=i.count,this._types.set(e,l),this._updateTypeInfo(l),l}if(e instanceof mo){const i=e,s=new Th(i.name,n);s.startLine=i.startLine,s.endLine=i.endLine;for(const l of i.members){const c=this._getTypeInfo(l.type,l.attributes);s.members.push(new yA(l.name,c,l.attributes))}return this._types.set(e,s),this._updateTypeInfo(s),s}if(e instanceof Qu){const i=e,s=i.format instanceof el,l=i.format?s?this._getTypeInfo(i.format,null):new ac(i.format,null):null,c=new bA(i.name,l,n,i.access);return this._types.set(e,c),this._updateTypeInfo(c),c}if(e instanceof HM){const i=e,s=i.format?this._getTypeInfo(i.format,null):null,l=new bA(i.name,s,n,i.access);return this._types.set(e,l),this._updateTypeInfo(l),l}const r=new ac(e.name,n);return this._types.set(e,r),this._updateTypeInfo(r),r}_updateTypeInfo(e){var n,r;const i=this._getTypeSize(e);if(e.size=(n=i==null?void 0:i.size)!==null&&n!==void 0?n:0,e instanceof f0&&e.format){const s=this._getTypeSize(e.format);e.stride=(r=s==null?void 0:s.size)!==null&&r!==void 0?r:0,this._updateTypeInfo(e.format)}e instanceof Th&&this._updateStructInfo(e)}_updateStructInfo(e){var n;let r=0,i=0,s=0,l=0;for(let c=0,f=e.members.length;c<f;++c){const d=e.members[c],g=this._getTypeSize(d);if(!g)continue;(n=this._getAlias(d.type.name))!==null&&n!==void 0||d.type;const m=g.align,v=g.size;r=this._roundUp(m,r+i),i=v,s=r,l=Math.max(l,m),d.offset=r,d.size=v,this._updateTypeInfo(d.type)}e.size=this._roundUp(l,s+i),e.align=l}_getTypeSize(e){var n,r;if(e==null)return null;const i=this._getAttributeNum(e.attributes,"size",0),s=this._getAttributeNum(e.attributes,"align",0);if(e instanceof yA&&(e=e.type),e instanceof ac){const l=this._getAlias(e.name);l!==null&&(e=l)}{const l=Hs._typeInfo[e.name];if(l!==void 0){const c=((n=e.format)===null||n===void 0?void 0:n.name)==="f16"?2:1;return new Ch(Math.max(s,l.align/c),Math.max(i,l.size/c))}}{const l=Hs._typeInfo[e.name.substring(0,e.name.length-1)];if(l){const c=e.name[e.name.length-1]==="h"?2:1;return new Ch(Math.max(s,l.align/c),Math.max(i,l.size/c))}}if(e instanceof f0){let l=e,c=8,f=8;const d=this._getTypeSize(l.format);d!==null&&(f=d.size,c=d.align);const g=l.count,m=this._getAttributeNum((r=e==null?void 0:e.attributes)!==null&&r!==void 0?r:null,"stride",this._roundUp(c,f));return f=g*m,i&&(f=i),new Ch(Math.max(s,c),Math.max(i,f))}if(e instanceof Th){let l=0,c=0,f=0,d=0,g=0;for(const m of e.members){const v=this._getTypeSize(m.type);v!==null&&(l=Math.max(v.align,l),f=this._roundUp(v.align,f+d),d=v.size,g=f)}return c=this._roundUp(l,g+d),new Ch(Math.max(s,l),Math.max(i,c))}return null}_isUniformVar(e){return e instanceof bo&&e.storage=="uniform"}_isStorageVar(e){return e instanceof bo&&e.storage=="storage"}_isTextureVar(e){return e instanceof bo&&e.type!==null&&Hs._textureTypes.indexOf(e.type.name)!=-1}_isSamplerVar(e){return e instanceof bo&&e.type!==null&&Hs._samplerTypes.indexOf(e.type.name)!=-1}_getAttribute(e,n){const r=e;if(!r||!r.attributes)return null;const i=r.attributes;for(let s of i)if(s.name==n)return s;return null}_getAttributeNum(e,n,r){if(e===null)return r;for(let i of e)if(i.name==n){let s=i!==null&&i.value!==null?i.value:r;return s instanceof Array&&(s=s[0]),typeof s=="number"?s:typeof s=="string"?parseInt(s):r}return r}_roundUp(e,n){return Math.ceil(n/e)*e}}Hs._typeInfo={f16:{align:2,size:2},i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},atomic:{align:4,size:4},vec2:{align:8,size:8},vec3:{align:16,size:12},vec4:{align:16,size:16},mat2x2:{align:8,size:16},mat3x2:{align:8,size:24},mat4x2:{align:8,size:32},mat2x3:{align:16,size:32},mat3x3:{align:16,size:48},mat4x3:{align:16,size:64},mat2x4:{align:16,size:32},mat3x4:{align:16,size:48},mat4x4:{align:16,size:64}};Hs._textureTypes=k.any_texture_type.map(t=>t.name);Hs._samplerTypes=k.sampler_type.map(t=>t.name);function WH(t){var s;const e={attributes:[],bindings:[]};let n;try{n=XH(t)}catch(l){return Re.error(l.message)(),e}for(const l of n.uniforms){const c=[];for(const f of((s=l.type)==null?void 0:s.members)||[])c.push({name:f.name,type:wA(f.type)});e.bindings.push({type:"uniform",name:l.name,group:l.group,location:l.binding,members:c})}for(const l of n.textures)e.bindings.push({type:"texture",name:l.name,group:l.group,location:l.binding});for(const l of n.samplers)e.bindings.push({type:"sampler",name:l.name,group:l.group,location:l.binding});const r=n.entry.vertex[0],i=(r==null?void 0:r.inputs.length)||0;for(let l=0;l<i;l++){const c=r.inputs[l];if(c.locationType==="location"){const f=wA(c.type);e.attributes.push({name:c.name,location:Number(c.location),type:f})}}return e}function wA(t){return t.format?`${t.name}<${t.format.name}>`:t.name}function XH(t){try{return new Hs(t)}catch(e){if(e instanceof Error)throw e;let n="WGSL parse error";throw typeof e=="object"&&(e!=null&&e.message)&&(n+=`: ${e.message} `),typeof e=="object"&&(e!=null&&e.token)&&(n+=e.token.line||""),new Error(n,{cause:e})}}const qH={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...qH}};const Pi=globalThis.mathgl.config;function YH(t,{precision:e=Pi.precision}={}){return t=KH(t),`${parseFloat(t.toPrecision(e))}`}function Ic(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ka(t,e,n){return QH(t,r=>Math.max(e,Math.min(n,r)))}function Mg(t,e,n){return Ic(t)?t.map((r,i)=>Mg(r,e[i],n)):n*e+(1-n)*t}function Ff(t,e,n){const r=Pi.EPSILON;try{if(t===e)return!0;if(Ic(t)&&Ic(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(!Ff(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=Pi.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{Pi.EPSILON=r}}function KH(t){return Math.round(t/Pi.EPSILON)*Pi.EPSILON}function ZH(t){return t.clone?t.clone():new Array(t.length)}function QH(t,e,n){if(Ic(t)){const r=t;n=n||ZH(r);for(let i=0;i<n.length&&i<r.length;++i){const s=typeof t=="number"?t:t[i];n[i]=e(s,i,n)}return n}return e(t)}class YM extends Array{clone(){return new this.constructor().copy(this)}fromArray(e,n=0){for(let r=0;r<this.ELEMENTS;++r)this[r]=e[r+n];return this.check()}toArray(e=[],n=0){for(let r=0;r<this.ELEMENTS;++r)e[n+r]=this[r];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:Ic(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Pi)}formatString(e){let n="";for(let r=0;r<this.ELEMENTS;++r)n+=(r>0?", ":"")+YH(this[r],e);return`${e.printTypes?this.constructor.name:""}[${n}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let n=0;n<this.ELEMENTS;++n)if(!Ff(this[n],e[n]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let n=0;n<this.ELEMENTS;++n)if(this[n]!==e[n])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,n,r){if(r===void 0)return this.lerp(this,e,n);for(let i=0;i<this.ELEMENTS;++i){const s=e[i],l=typeof n=="number"?n:n[i];this[i]=s+r*(l-s)}return this.check()}min(e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(e[n],this[n]);return this.check()}max(e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.max(e[n],this[n]);return this.check()}clamp(e,n){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e[r]),n[r]);return this.check()}add(...e){for(const n of e)for(let r=0;r<this.ELEMENTS;++r)this[r]+=n[r];return this.check()}subtract(...e){for(const n of e)for(let r=0;r<this.ELEMENTS;++r)this[r]-=n[r];return this.check()}scale(e){if(typeof e=="number")for(let n=0;n<this.ELEMENTS;++n)this[n]*=e;else for(let n=0;n<this.ELEMENTS&&n<e.length;++n)this[n]*=e[n];return this.check()}multiplyByScalar(e){for(let n=0;n<this.ELEMENTS;++n)this[n]*=e;return this.check()}check(){if(Pi.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let e=this.length===this.ELEMENTS;for(let n=0;n<this.ELEMENTS;++n)e=e&&Number.isFinite(this[n]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let n=0;n<this.ELEMENTS;++n)this[n]=e;return this.check()}addScalar(e){for(let n=0;n<this.ELEMENTS;++n)this[n]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let n=0;n<this.ELEMENTS;++n)this[n]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,n){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e),n);return this.check()}get elements(){return this}}function GH(t,e){if(t.length!==e)return!1;for(let n=0;n<t.length;++n)if(!Number.isFinite(t[n]))return!1;return!0}function li(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function d0(t,e,n=""){if(Pi.debug&&!GH(t,e))throw new Error(`math.gl: ${n} some fields set to invalid numbers'`);return t}function EA(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}class JH extends YM{get x(){return this[0]}set x(e){this[0]=li(e)}get y(){return this[1]}set y(e){this[1]=li(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let n=0;n<this.ELEMENTS;++n)e+=this[n]*this[n];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let n=0;for(let r=0;r<this.ELEMENTS;++r){const i=this[r]-e[r];n+=i*i}return li(n)}dot(e){let n=0;for(let r=0;r<this.ELEMENTS;++r)n+=this[r]*e[r];return li(n)}normalize(){const e=this.magnitude();if(e!==0)for(let n=0;n<this.ELEMENTS;++n)this[n]/=e;return this.check()}multiply(...e){for(const n of e)for(let r=0;r<this.ELEMENTS;++r)this[r]*=n[r];return this.check()}divide(...e){for(const n of e)for(let r=0;r<this.ELEMENTS;++r)this[r]/=n[r];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return EA(e>=0&&e<this.ELEMENTS,"index is out of range"),li(this[e])}setComponent(e,n){return EA(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=n,this.check()}addVectors(e,n){return this.copy(e).add(n)}subVectors(e,n){return this.copy(e).subtract(n)}multiplyVectors(e,n){return this.copy(e).multiply(n)}addScaledVector(e,n){return this.add(new this.constructor(e).multiplyScalar(n))}}const Hh=1e-6;let Dc=typeof Float32Array<"u"?Float32Array:Array;function ej(){const t=new Dc(2);return Dc!=Float32Array&&(t[0]=0,t[1]=0),t}function TA(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function tj(t,e){return t[0]=-e[0],t[1]=-e[1],t}function KM(t,e,n,r){const i=e[0],s=e[1];return t[0]=i+r*(n[0]-i),t[1]=s+r*(n[1]-s),t}function nj(t,e,n){const r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}(function(){const t=ej();return function(e,n,r,i,s,l){let c,f;for(n||(n=2),r||(r=0),i?f=Math.min(i*n+r,e.length):f=e.length,c=r;c<f;c+=n)t[0]=e[c],t[1]=e[c+1],s(t,t,l),e[c]=t[0],e[c+1]=t[1];return e}})();function rj(t,e,n){const r=e[0],i=e[1],s=n[3]*r+n[7]*i||1;return t[0]=(n[0]*r+n[4]*i)/s,t[1]=(n[1]*r+n[5]*i)/s,t}function ZM(t,e,n){const r=e[0],i=e[1],s=e[2],l=n[3]*r+n[7]*i+n[11]*s||1;return t[0]=(n[0]*r+n[4]*i+n[8]*s)/l,t[1]=(n[1]*r+n[5]*i+n[9]*s)/l,t[2]=(n[2]*r+n[6]*i+n[10]*s)/l,t}function ij(t,e,n){const r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2],t}function sj(){const t=new Dc(3);return Dc!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function aj(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function oj(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function lj(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function cj(t,e,n){const r=e[0],i=e[1],s=e[2],l=n[0],c=n[1],f=n[2];return t[0]=i*f-s*c,t[1]=s*l-r*f,t[2]=r*c-i*l,t}function QM(t,e,n){const r=e[0],i=e[1],s=e[2];let l=n[3]*r+n[7]*i+n[11]*s+n[15];return l=l||1,t[0]=(n[0]*r+n[4]*i+n[8]*s+n[12])/l,t[1]=(n[1]*r+n[5]*i+n[9]*s+n[13])/l,t[2]=(n[2]*r+n[6]*i+n[10]*s+n[14])/l,t}function uj(t,e,n){const r=e[0],i=e[1],s=e[2];return t[0]=r*n[0]+i*n[3]+s*n[6],t[1]=r*n[1]+i*n[4]+s*n[7],t[2]=r*n[2]+i*n[5]+s*n[8],t}function fj(t,e,n){const r=n[0],i=n[1],s=n[2],l=n[3],c=e[0],f=e[1],d=e[2];let g=i*d-s*f,m=s*c-r*d,v=r*f-i*c,S=i*v-s*m,E=s*g-r*v,w=r*m-i*g;const b=l*2;return g*=b,m*=b,v*=b,S*=2,E*=2,w*=2,t[0]=c+g+S,t[1]=f+m+E,t[2]=d+v+w,t}function dj(t,e,n,r){const i=[],s=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],s[0]=i[0],s[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),s[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=s[0]+n[0],t[1]=s[1]+n[1],t[2]=s[2]+n[2],t}function hj(t,e,n,r){const i=[],s=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],s[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),s[1]=i[1],s[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=s[0]+n[0],t[1]=s[1]+n[1],t[2]=s[2]+n[2],t}function gj(t,e,n,r){const i=[],s=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],s[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),s[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),s[2]=i[2],t[0]=s[0]+n[0],t[1]=s[1]+n[1],t[2]=s[2]+n[2],t}function pj(t,e){const n=t[0],r=t[1],i=t[2],s=e[0],l=e[1],c=e[2],f=Math.sqrt((n*n+r*r+i*i)*(s*s+l*l+c*c)),d=f&&lj(t,e)/f;return Math.acos(Math.min(Math.max(d,-1),1))}const mj=aj;(function(){const t=sj();return function(e,n,r,i,s,l){let c,f;for(n||(n=3),r||(r=0),i?f=Math.min(i*n+r,e.length):f=e.length,c=r;c<f;c+=n)t[0]=e[c],t[1]=e[c+1],t[2]=e[c+2],s(t,t,l),e[c]=t[0],e[c+1]=t[1],e[c+2]=t[2];return e}})();const h0=[0,0,0];let Rh;class Ss extends JH{static get ZERO(){return Rh||(Rh=new Ss(0,0,0),Object.freeze(Rh)),Rh}constructor(e=0,n=0,r=0){super(-0,-0,-0),arguments.length===1&&Ic(e)?this.copy(e):(Pi.debug&&(li(e),li(n),li(r)),this[0]=e,this[1]=n,this[2]=r)}set(e,n,r){return this[0]=e,this[1]=n,this[2]=r,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return Pi.debug&&(li(e.x),li(e.y),li(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=li(e)}angle(e){return pj(this,e)}cross(e){return cj(this,this,e),this.check()}rotateX({radians:e,origin:n=h0}){return dj(this,this,n,e),this.check()}rotateY({radians:e,origin:n=h0}){return hj(this,this,n,e),this.check()}rotateZ({radians:e,origin:n=h0}){return gj(this,this,n,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return QM(this,this,e),this.check()}transformAsVector(e){return ZM(this,this,e),this.check()}transformByMatrix3(e){return uj(this,this,e),this.check()}transformByMatrix2(e){return ij(this,this,e),this.check()}transformByQuaternion(e){return fj(this,this,e),this.check()}}class vj extends YM{toString(){let e="[";if(Pi.printRowMajor){e+="row-major:";for(let n=0;n<this.RANK;++n)for(let r=0;r<this.RANK;++r)e+=` ${this[r*this.RANK+n]}`}else{e+="column-major:";for(let n=0;n<this.ELEMENTS;++n)e+=` ${this[n]}`}return e+="]",e}getElementIndex(e,n){return n*this.RANK+e}getElement(e,n){return this[n*this.RANK+e]}setElement(e,n,r){return this[n*this.RANK+e]=li(r),this}getColumn(e,n=new Array(this.RANK).fill(-0)){const r=e*this.RANK;for(let i=0;i<this.RANK;++i)n[i]=this[r+i];return n}setColumn(e,n){const r=e*this.RANK;for(let i=0;i<this.RANK;++i)this[r+i]=n[i];return this}}function _j(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function yj(t,e){if(t===e){const n=e[1],r=e[2],i=e[3],s=e[6],l=e[7],c=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=s,t[11]=e[14],t[12]=i,t[13]=l,t[14]=c}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function uy(t,e){const n=e[0],r=e[1],i=e[2],s=e[3],l=e[4],c=e[5],f=e[6],d=e[7],g=e[8],m=e[9],v=e[10],S=e[11],E=e[12],w=e[13],b=e[14],A=e[15],T=n*c-r*l,C=n*f-i*l,M=n*d-s*l,x=r*f-i*c,N=r*d-s*c,F=i*d-s*f,L=g*w-m*E,I=g*b-v*E,V=g*A-S*E,B=m*b-v*w,j=m*A-S*w,X=v*A-S*b;let Y=T*X-C*j+M*B+x*V-N*I+F*L;return Y?(Y=1/Y,t[0]=(c*X-f*j+d*B)*Y,t[1]=(i*j-r*X-s*B)*Y,t[2]=(w*F-b*N+A*x)*Y,t[3]=(v*N-m*F-S*x)*Y,t[4]=(f*V-l*X-d*I)*Y,t[5]=(n*X-i*V+s*I)*Y,t[6]=(b*M-E*F-A*C)*Y,t[7]=(g*F-v*M+S*C)*Y,t[8]=(l*j-c*V+d*L)*Y,t[9]=(r*V-n*j-s*L)*Y,t[10]=(E*N-w*M+A*T)*Y,t[11]=(m*M-g*N-S*T)*Y,t[12]=(c*I-l*B-f*L)*Y,t[13]=(n*B-r*I+i*L)*Y,t[14]=(w*C-E*x-b*T)*Y,t[15]=(g*x-m*C+v*T)*Y,t):null}function bj(t){const e=t[0],n=t[1],r=t[2],i=t[3],s=t[4],l=t[5],c=t[6],f=t[7],d=t[8],g=t[9],m=t[10],v=t[11],S=t[12],E=t[13],w=t[14],b=t[15],A=e*l-n*s,T=e*c-r*s,C=n*c-r*l,M=d*E-g*S,x=d*w-m*S,N=g*w-m*E,F=e*N-n*x+r*M,L=s*N-l*x+c*M,I=d*C-g*T+m*A,V=S*C-E*T+w*A;return f*F-i*L+b*I-v*V}function Bo(t,e,n){const r=e[0],i=e[1],s=e[2],l=e[3],c=e[4],f=e[5],d=e[6],g=e[7],m=e[8],v=e[9],S=e[10],E=e[11],w=e[12],b=e[13],A=e[14],T=e[15];let C=n[0],M=n[1],x=n[2],N=n[3];return t[0]=C*r+M*c+x*m+N*w,t[1]=C*i+M*f+x*v+N*b,t[2]=C*s+M*d+x*S+N*A,t[3]=C*l+M*g+x*E+N*T,C=n[4],M=n[5],x=n[6],N=n[7],t[4]=C*r+M*c+x*m+N*w,t[5]=C*i+M*f+x*v+N*b,t[6]=C*s+M*d+x*S+N*A,t[7]=C*l+M*g+x*E+N*T,C=n[8],M=n[9],x=n[10],N=n[11],t[8]=C*r+M*c+x*m+N*w,t[9]=C*i+M*f+x*v+N*b,t[10]=C*s+M*d+x*S+N*A,t[11]=C*l+M*g+x*E+N*T,C=n[12],M=n[13],x=n[14],N=n[15],t[12]=C*r+M*c+x*m+N*w,t[13]=C*i+M*f+x*v+N*b,t[14]=C*s+M*d+x*S+N*A,t[15]=C*l+M*g+x*E+N*T,t}function Og(t,e,n){const r=n[0],i=n[1],s=n[2];let l,c,f,d,g,m,v,S,E,w,b,A;return e===t?(t[12]=e[0]*r+e[4]*i+e[8]*s+e[12],t[13]=e[1]*r+e[5]*i+e[9]*s+e[13],t[14]=e[2]*r+e[6]*i+e[10]*s+e[14],t[15]=e[3]*r+e[7]*i+e[11]*s+e[15]):(l=e[0],c=e[1],f=e[2],d=e[3],g=e[4],m=e[5],v=e[6],S=e[7],E=e[8],w=e[9],b=e[10],A=e[11],t[0]=l,t[1]=c,t[2]=f,t[3]=d,t[4]=g,t[5]=m,t[6]=v,t[7]=S,t[8]=E,t[9]=w,t[10]=b,t[11]=A,t[12]=l*r+g*i+E*s+e[12],t[13]=c*r+m*i+w*s+e[13],t[14]=f*r+v*i+b*s+e[14],t[15]=d*r+S*i+A*s+e[15]),t}function Mb(t,e,n){const r=n[0],i=n[1],s=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Sj(t,e,n,r){let i=r[0],s=r[1],l=r[2],c=Math.sqrt(i*i+s*s+l*l),f,d,g,m,v,S,E,w,b,A,T,C,M,x,N,F,L,I,V,B,j,X,Y,ae;return c<Hh?null:(c=1/c,i*=c,s*=c,l*=c,d=Math.sin(n),f=Math.cos(n),g=1-f,m=e[0],v=e[1],S=e[2],E=e[3],w=e[4],b=e[5],A=e[6],T=e[7],C=e[8],M=e[9],x=e[10],N=e[11],F=i*i*g+f,L=s*i*g+l*d,I=l*i*g-s*d,V=i*s*g-l*d,B=s*s*g+f,j=l*s*g+i*d,X=i*l*g+s*d,Y=s*l*g-i*d,ae=l*l*g+f,t[0]=m*F+w*L+C*I,t[1]=v*F+b*L+M*I,t[2]=S*F+A*L+x*I,t[3]=E*F+T*L+N*I,t[4]=m*V+w*B+C*j,t[5]=v*V+b*B+M*j,t[6]=S*V+A*B+x*j,t[7]=E*V+T*B+N*j,t[8]=m*X+w*Y+C*ae,t[9]=v*X+b*Y+M*ae,t[10]=S*X+A*Y+x*ae,t[11]=E*X+T*Y+N*ae,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function GM(t,e,n){const r=Math.sin(n),i=Math.cos(n),s=e[4],l=e[5],c=e[6],f=e[7],d=e[8],g=e[9],m=e[10],v=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*i+d*r,t[5]=l*i+g*r,t[6]=c*i+m*r,t[7]=f*i+v*r,t[8]=d*i-s*r,t[9]=g*i-l*r,t[10]=m*i-c*r,t[11]=v*i-f*r,t}function wj(t,e,n){const r=Math.sin(n),i=Math.cos(n),s=e[0],l=e[1],c=e[2],f=e[3],d=e[8],g=e[9],m=e[10],v=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*i-d*r,t[1]=l*i-g*r,t[2]=c*i-m*r,t[3]=f*i-v*r,t[8]=s*r+d*i,t[9]=l*r+g*i,t[10]=c*r+m*i,t[11]=f*r+v*i,t}function JM(t,e,n){const r=Math.sin(n),i=Math.cos(n),s=e[0],l=e[1],c=e[2],f=e[3],d=e[4],g=e[5],m=e[6],v=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*i+d*r,t[1]=l*i+g*r,t[2]=c*i+m*r,t[3]=f*i+v*r,t[4]=d*i-s*r,t[5]=g*i-l*r,t[6]=m*i-c*r,t[7]=v*i-f*r,t}function Ej(t,e){const n=e[0],r=e[1],i=e[2],s=e[3],l=n+n,c=r+r,f=i+i,d=n*l,g=r*l,m=r*c,v=i*l,S=i*c,E=i*f,w=s*l,b=s*c,A=s*f;return t[0]=1-m-E,t[1]=g+A,t[2]=v-b,t[3]=0,t[4]=g-A,t[5]=1-d-E,t[6]=S+w,t[7]=0,t[8]=v+b,t[9]=S-w,t[10]=1-d-m,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Tj(t,e,n,r,i,s,l){const c=1/(n-e),f=1/(i-r),d=1/(s-l);return t[0]=s*2*c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s*2*f,t[6]=0,t[7]=0,t[8]=(n+e)*c,t[9]=(i+r)*f,t[10]=(l+s)*d,t[11]=-1,t[12]=0,t[13]=0,t[14]=l*s*2*d,t[15]=0,t}function Aj(t,e,n,r,i){const s=1/Math.tan(e/2);if(t[0]=s/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0){const l=1/(r-i);t[10]=(i+r)*l,t[14]=2*i*r*l}else t[10]=-1,t[14]=-2*r;return t}const Cj=Aj;function Rj(t,e,n,r,i,s,l){const c=1/(e-n),f=1/(r-i),d=1/(s-l);return t[0]=-2*c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*d,t[11]=0,t[12]=(e+n)*c,t[13]=(i+r)*f,t[14]=(l+s)*d,t[15]=1,t}const xj=Rj;function Mj(t,e,n,r){let i,s,l,c,f,d,g,m,v,S;const E=e[0],w=e[1],b=e[2],A=r[0],T=r[1],C=r[2],M=n[0],x=n[1],N=n[2];return Math.abs(E-M)<Hh&&Math.abs(w-x)<Hh&&Math.abs(b-N)<Hh?_j(t):(m=E-M,v=w-x,S=b-N,i=1/Math.sqrt(m*m+v*v+S*S),m*=i,v*=i,S*=i,s=T*S-C*v,l=C*m-A*S,c=A*v-T*m,i=Math.sqrt(s*s+l*l+c*c),i?(i=1/i,s*=i,l*=i,c*=i):(s=0,l=0,c=0),f=v*c-S*l,d=S*s-m*c,g=m*l-v*s,i=Math.sqrt(f*f+d*d+g*g),i?(i=1/i,f*=i,d*=i,g*=i):(f=0,d=0,g=0),t[0]=s,t[1]=f,t[2]=m,t[3]=0,t[4]=l,t[5]=d,t[6]=v,t[7]=0,t[8]=c,t[9]=g,t[10]=S,t[11]=0,t[12]=-(s*E+l*w+c*b),t[13]=-(f*E+d*w+g*b),t[14]=-(m*E+v*w+S*b),t[15]=1,t)}function Oj(){const t=new Dc(4);return Dc!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Pj(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function td(t,e,n){const r=e[0],i=e[1],s=e[2],l=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*s+n[12]*l,t[1]=n[1]*r+n[5]*i+n[9]*s+n[13]*l,t[2]=n[2]*r+n[6]*i+n[10]*s+n[14]*l,t[3]=n[3]*r+n[7]*i+n[11]*s+n[15]*l,t}(function(){const t=Oj();return function(e,n,r,i,s,l){let c,f;for(n||(n=4),r||(r=0),i?f=Math.min(i*n+r,e.length):f=e.length,c=r;c<f;c+=n)t[0]=e[c],t[1]=e[c+1],t[2]=e[c+2],t[3]=e[c+3],s(t,t,l),e[c]=t[0],e[c+1]=t[1],e[c+2]=t[2],e[c+3]=t[3];return e}})();var fy;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"})(fy||(fy={}));const Nj=45*Math.PI/180,Ij=1,g0=.1,p0=500,Dj=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class ws extends vj{static get IDENTITY(){return kj()}static get ZERO(){return Fj()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return fy}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,n,r,i,s,l,c,f,d,g,m,v,S,E,w,b){return this[0]=e,this[1]=n,this[2]=r,this[3]=i,this[4]=s,this[5]=l,this[6]=c,this[7]=f,this[8]=d,this[9]=g,this[10]=m,this[11]=v,this[12]=S,this[13]=E,this[14]=w,this[15]=b,this.check()}setRowMajor(e,n,r,i,s,l,c,f,d,g,m,v,S,E,w,b){return this[0]=e,this[1]=s,this[2]=d,this[3]=S,this[4]=n,this[5]=l,this[6]=g,this[7]=E,this[8]=r,this[9]=c,this[10]=m,this[11]=w,this[12]=i,this[13]=f,this[14]=v,this[15]=b,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(Dj)}fromObject(e){return this.check()}fromQuaternion(e){return Ej(this,e),this.check()}frustum(e){const{left:n,right:r,bottom:i,top:s,near:l=g0,far:c=p0}=e;return c===1/0?Bj(this,n,r,i,s,l):Tj(this,n,r,i,s,l,c),this.check()}lookAt(e){const{eye:n,center:r=[0,0,0],up:i=[0,1,0]}=e;return Mj(this,n,r,i),this.check()}ortho(e){const{left:n,right:r,bottom:i,top:s,near:l=g0,far:c=p0}=e;return xj(this,n,r,i,s,l,c),this.check()}orthographic(e){const{fovy:n=Nj,aspect:r=Ij,focalDistance:i=1,near:s=g0,far:l=p0}=e;AA(n);const c=n/2,f=i*Math.tan(c),d=f*r;return this.ortho({left:-d,right:d,bottom:-f,top:f,near:s,far:l})}perspective(e){const{fovy:n=45*Math.PI/180,aspect:r=1,near:i=.1,far:s=500}=e;return AA(n),Cj(this,n,r,i,s),this.check()}determinant(){return bj(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,n){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],n=n||[-0,-0,-0];const r=this.getScale(n),i=1/r[0],s=1/r[1],l=1/r[2];return e[0]=this[0]*i,e[1]=this[1]*s,e[2]=this[2]*l,e[3]=0,e[4]=this[4]*i,e[5]=this[5]*s,e[6]=this[6]*l,e[7]=0,e[8]=this[8]*i,e[9]=this[9]*s,e[10]=this[10]*l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,n){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],n=n||[-0,-0,-0];const r=this.getScale(n),i=1/r[0],s=1/r[1],l=1/r[2];return e[0]=this[0]*i,e[1]=this[1]*s,e[2]=this[2]*l,e[3]=this[4]*i,e[4]=this[5]*s,e[5]=this[6]*l,e[6]=this[8]*i,e[7]=this[9]*s,e[8]=this[10]*l,e}transpose(){return yj(this,this),this.check()}invert(){return uy(this,this),this.check()}multiplyLeft(e){return Bo(this,e,this),this.check()}multiplyRight(e){return Bo(this,this,e),this.check()}rotateX(e){return GM(this,this,e),this.check()}rotateY(e){return wj(this,this,e),this.check()}rotateZ(e){return JM(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,n){return Sj(this,this,e,n),this.check()}scale(e){return Mb(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return Og(this,this,e),this.check()}transform(e,n){return e.length===4?(n=td(n||[-0,-0,-0,-0],e,this),d0(n,4),n):this.transformAsPoint(e,n)}transformAsPoint(e,n){const{length:r}=e;let i;switch(r){case 2:i=nj(n||[-0,-0],e,this);break;case 3:i=QM(n||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return d0(i,e.length),i}transformAsVector(e,n){let r;switch(e.length){case 2:r=rj(n||[-0,-0],e,this);break;case 3:r=ZM(n||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return d0(r,e.length),r}transformPoint(e,n){return this.transformAsPoint(e,n)}transformVector(e,n){return this.transformAsPoint(e,n)}transformDirection(e,n){return this.transformAsVector(e,n)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,n,r){return this.identity().translate([e,n,r])}}let xh,Mh;function Fj(){return xh||(xh=new ws([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(xh)),xh}function kj(){return Mh||(Mh=new ws,Object.freeze(Mh)),Mh}function AA(t){if(t>Math.PI*2)throw Error("expected radians")}function Bj(t,e,n,r,i,s){const l=2*s/(n-e),c=2*s/(i-r),f=(n+e)/(n-e),d=(i+r)/(i-r),g=-1,m=-1,v=-2*s;return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=f,t[9]=d,t[10]=g,t[11]=m,t[12]=0,t[13]=0,t[14]=v,t[15]=0,t}function eO(t,e=[],n=0){const r=Math.fround(t),i=t-r;return e[n]=r,e[n+1]=i,e}function Uj(t){return t-Math.fround(t)}function Lj(t){const e=new Float32Array(32);for(let n=0;n<4;++n)for(let r=0;r<4;++r){const i=n*4+r;eO(t[r*4+n],e,i*2)}return e}const zj=`#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND
// All these functions are for substituting tan() function from Intel GPU only
const float TWO_PI = 6.2831854820251465;
const float PI_2 = 1.5707963705062866;
const float PI_16 = 0.1963495463132858;
const float SIN_TABLE_0 = 0.19509032368659973;
const float SIN_TABLE_1 = 0.3826834261417389;
const float SIN_TABLE_2 = 0.5555702447891235;
const float SIN_TABLE_3 = 0.7071067690849304;
const float COS_TABLE_0 = 0.9807852506637573;
const float COS_TABLE_1 = 0.9238795042037964;
const float COS_TABLE_2 = 0.8314695954322815;
const float COS_TABLE_3 = 0.7071067690849304;
const float INVERSE_FACTORIAL_3 = 1.666666716337204e-01; // 1/3!
const float INVERSE_FACTORIAL_5 = 8.333333767950535e-03; // 1/5!
const float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04; // 1/7!
const float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06; // 1/9!
float sin_taylor_fp32(float a) {
float r, s, t, x;
if (a == 0.0) {
return 0.0;
}
x = -a * a;
s = a;
r = a;
r = r * x;
t = r * INVERSE_FACTORIAL_3;
s = s + t;
r = r * x;
t = r * INVERSE_FACTORIAL_5;
s = s + t;
r = r * x;
t = r * INVERSE_FACTORIAL_7;
s = s + t;
r = r * x;
t = r * INVERSE_FACTORIAL_9;
s = s + t;
return s;
}
void sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {
if (a == 0.0) {
sin_t = 0.0;
cos_t = 1.0;
}
sin_t = sin_taylor_fp32(a);
cos_t = sqrt(1.0 - sin_t * sin_t);
}
float tan_taylor_fp32(float a) {
float sin_a;
float cos_a;
if (a == 0.0) {
return 0.0;
}
// 2pi range reduction
float z = floor(a / TWO_PI);
float r = a - TWO_PI * z;
float t;
float q = floor(r / PI_2 + 0.5);
int j = int(q);
if (j < -2 || j > 2) {
return 1.0 / 0.0;
}
t = r - PI_2 * q;
q = floor(t / PI_16 + 0.5);
int k = int(q);
int abs_k = int(abs(float(k)));
if (abs_k > 4) {
return 1.0 / 0.0;
} else {
t = t - PI_16 * q;
}
float u = 0.0;
float v = 0.0;
float sin_t, cos_t;
float s, c;
sincos_taylor_fp32(t, sin_t, cos_t);
if (k == 0) {
s = sin_t;
c = cos_t;
} else {
if (abs(float(abs_k) - 1.0) < 0.5) {
u = COS_TABLE_0;
v = SIN_TABLE_0;
} else if (abs(float(abs_k) - 2.0) < 0.5) {
u = COS_TABLE_1;
v = SIN_TABLE_1;
} else if (abs(float(abs_k) - 3.0) < 0.5) {
u = COS_TABLE_2;
v = SIN_TABLE_2;
} else if (abs(float(abs_k) - 4.0) < 0.5) {
u = COS_TABLE_3;
v = SIN_TABLE_3;
}
if (k > 0) {
s = u * sin_t + v * cos_t;
c = u * cos_t - v * sin_t;
} else {
s = u * sin_t - v * cos_t;
c = u * cos_t + v * sin_t;
}
}
if (j == 0) {
sin_a = s;
cos_a = c;
} else if (j == 1) {
sin_a = c;
cos_a = -s;
} else if (j == -1) {
sin_a = -c;
cos_a = s;
} else {
sin_a = -s;
cos_a = -c;
}
return sin_a / cos_a;
}
#endif
float tan_fp32(float a) {
#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND
return tan_taylor_fp32(a);
#else
return tan(a);
#endif
}
`,$j={name:"fp32",vs:zj},Vj=`
uniform fp64arithmeticUniforms {
uniform float ONE;
} fp64;
/*
About LUMA_FP64_CODE_ELIMINATION_WORKAROUND
The purpose of this workaround is to prevent shader compilers from
optimizing away necessary arithmetic operations by swapping their sequences
or transform the equation to some 'equivalent' form.
The method is to multiply an artifical variable, ONE, which will be known to
the compiler to be 1 only at runtime. The whole expression is then represented
as a polynomial with respective to ONE. In the coefficients of all terms, only one a
and one b should appear
err = (a + b) * ONE^6 - a * ONE^5 - (a + b) * ONE^4 + a * ONE^3 - b - (a + b) * ONE^2 + a * ONE
*/
// Divide float number to high and low floats to extend fraction bits
vec2 split(float a) {
const float SPLIT = 4097.0;
float t = a * SPLIT;
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
float a_hi = t * fp64.ONE - (t - a);
float a_lo = a * fp64.ONE - a_hi;
#else
float a_hi = t - (t - a);
float a_lo = a - a_hi;
#endif
return vec2(a_hi, a_lo);
}
// Divide float number again when high float uses too many fraction bits
vec2 split2(vec2 a) {
vec2 b = split(a.x);
b.y += a.y;
return b;
}
// Special sum operation when a > b
vec2 quickTwoSum(float a, float b) {
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
float sum = (a + b) * fp64.ONE;
float err = b - (sum - a) * fp64.ONE;
#else
float sum = a + b;
float err = b - (sum - a);
#endif
return vec2(sum, err);
}
// General sum operation
vec2 twoSum(float a, float b) {
float s = (a + b);
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
float v = (s * fp64.ONE - a) * fp64.ONE;
float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE + (b - v);
#else
float v = s - a;
float err = (a - (s - v)) + (b - v);
#endif
return vec2(s, err);
}
vec2 twoSub(float a, float b) {
float s = (a - b);
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
float v = (s * fp64.ONE - a) * fp64.ONE;
float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE - (b + v);
#else
float v = s - a;
float err = (a - (s - v)) - (b + v);
#endif
return vec2(s, err);
}
vec2 twoSqr(float a) {
float prod = a * a;
vec2 a_fp64 = split(a);
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
float err = ((a_fp64.x * a_fp64.x - prod) * fp64.ONE + 2.0 * a_fp64.x *
a_fp64.y * fp64.ONE * fp64.ONE) + a_fp64.y * a_fp64.y * fp64.ONE * fp64.ONE * fp64.ONE;
#else
float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;
#endif
return vec2(prod, err);
}
vec2 twoProd(float a, float b) {
float prod = a * b;
vec2 a_fp64 = split(a);
vec2 b_fp64 = split(b);
float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +
a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;
return vec2(prod, err);
}
vec2 sum_fp64(vec2 a, vec2 b) {
vec2 s, t;
s = twoSum(a.x, b.x);
t = twoSum(a.y, b.y);
s.y += t.x;
s = quickTwoSum(s.x, s.y);
s.y += t.y;
s = quickTwoSum(s.x, s.y);
return s;
}
vec2 sub_fp64(vec2 a, vec2 b) {
vec2 s, t;
s = twoSub(a.x, b.x);
t = twoSub(a.y, b.y);
s.y += t.x;
s = quickTwoSum(s.x, s.y);
s.y += t.y;
s = quickTwoSum(s.x, s.y);
return s;
}
vec2 mul_fp64(vec2 a, vec2 b) {
vec2 prod = twoProd(a.x, b.x);
// y component is for the error
prod.y += a.x * b.y;
#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
prod = split2(prod);
#endif
prod = quickTwoSum(prod.x, prod.y);
prod.y += a.y * b.x;
#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
prod = split2(prod);
#endif
prod = quickTwoSum(prod.x, prod.y);
return prod;
}
vec2 div_fp64(vec2 a, vec2 b) {
float xn = 1.0 / b.x;
#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
vec2 yn = mul_fp64(a, vec2(xn, 0));
#else
vec2 yn = a * xn;
#endif
float diff = (sub_fp64(a, mul_fp64(b, yn))).x;
vec2 prod = twoProd(xn, diff);
return sum_fp64(yn, prod);
}
vec2 sqrt_fp64(vec2 a) {
if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);
if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);
float x = 1.0 / sqrt(a.x);
float yn = a.x * x;
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
vec2 yn_sqr = twoSqr(yn) * fp64.ONE;
#else
vec2 yn_sqr = twoSqr(yn);
#endif
float diff = sub_fp64(a, yn_sqr).x;
vec2 prod = twoProd(x * 0.5, diff);
#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
return sum_fp64(split(yn), prod);
#else
return sum_fp64(vec2(yn, 0.0), prod);
#endif
}
`,Hj={ONE:1},jj={name:"fp64arithmetic",vs:Vj,defaultUniforms:Hj,uniformTypes:{ONE:"f32"},fp64ify:eO,fp64LowPart:Uj,fp64ifyMatrix4:Lj},Wj=[0,1,1,1],Xj=`uniform pickingUniforms {
float isActive;
float isAttribute;
float isHighlightActive;
float useFloatColors;
vec3 highlightedObjectColor;
vec4 highlightColor;
} picking;
out vec4 picking_vRGBcolor_Avalid;
// Normalize unsigned byte color to 0-1 range
vec3 picking_normalizeColor(vec3 color) {
return picking.useFloatColors > 0.5 ? color : color / 255.0;
}
// Normalize unsigned byte color to 0-1 range
vec4 picking_normalizeColor(vec4 color) {
return picking.useFloatColors > 0.5 ? color : color / 255.0;
}
bool picking_isColorZero(vec3 color) {
return dot(color, vec3(1.0)) < 0.00001;
}
bool picking_isColorValid(vec3 color) {
return dot(color, vec3(1.0)) > 0.00001;
}
// Check if this vertex is highlighted
bool isVertexHighlighted(vec3 vertexColor) {
vec3 highlightedObjectColor = picking_normalizeColor(picking.highlightedObjectColor);
return
bool(picking.isHighlightActive) && picking_isColorZero(abs(vertexColor - highlightedObjectColor));
}
// Set the current picking color
void picking_setPickingColor(vec3 pickingColor) {
pickingColor = picking_normalizeColor(pickingColor);
if (bool(picking.isActive)) {
// Use alpha as the validity flag. If pickingColor is [0, 0, 0] fragment is non-pickable
picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));
if (!bool(picking.isAttribute)) {
// Stores the picking color so that the fragment shader can render it during picking
picking_vRGBcolor_Avalid.rgb = pickingColor;
}
} else {
// Do the comparison with selected item color in vertex shader as it should mean fewer compares
picking_vRGBcolor_Avalid.a = float(isVertexHighlighted(pickingColor));
}
}
void picking_setPickingAttribute(float value) {
if (bool(picking.isAttribute)) {
picking_vRGBcolor_Avalid.r = value;
}
}
void picking_setPickingAttribute(vec2 value) {
if (bool(picking.isAttribute)) {
picking_vRGBcolor_Avalid.rg = value;
}
}
void picking_setPickingAttribute(vec3 value) {
if (bool(picking.isAttribute)) {
picking_vRGBcolor_Avalid.rgb = value;
}
}
`,qj=`uniform pickingUniforms {
float isActive;
float isAttribute;
float isHighlightActive;
float useFloatColors;
vec3 highlightedObjectColor;
vec4 highlightColor;
} picking;
in vec4 picking_vRGBcolor_Avalid;
/*
* Returns highlight color if this item is selected.
*/
vec4 picking_filterHighlightColor(vec4 color) {
// If we are still picking, we don't highlight
if (picking.isActive > 0.5) {
return color;
}
bool selected = bool(picking_vRGBcolor_Avalid.a);
if (selected) {
// Blend in highlight color based on its alpha value
float highLightAlpha = picking.highlightColor.a;
float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);
float highLightRatio = highLightAlpha / blendedAlpha;
vec3 blendedRGB = mix(color.rgb, picking.highlightColor.rgb, highLightRatio);
return vec4(blendedRGB, blendedAlpha);
} else {
return color;
}
}
/*
* Returns picking color if picking enabled else unmodified argument.
*/
vec4 picking_filterPickingColor(vec4 color) {
if (bool(picking.isActive)) {
if (picking_vRGBcolor_Avalid.a == 0.0) {
discard;
}
return picking_vRGBcolor_Avalid;
}
return color;
}
/*
* Returns picking color if picking is enabled if not
* highlight color if this item is selected, otherwise unmodified argument.
*/
vec4 picking_filterColor(vec4 color) {
vec4 highlightColor = picking_filterHighlightColor(color);
return picking_filterPickingColor(highlightColor);
}
`,CA={props:{},uniforms:{},name:"picking",uniformTypes:{isActive:"f32",isAttribute:"f32",isHighlightActive:"f32",useFloatColors:"f32",highlightedObjectColor:"vec3<f32>",highlightColor:"vec4<f32>"},defaultUniforms:{isActive:!1,isAttribute:!1,isHighlightActive:!1,useFloatColors:!0,highlightedObjectColor:[0,0,0],highlightColor:Wj},vs:Xj,fs:qj,getUniforms:Yj};function Yj(t={},e){const n={};if(t.highlightedObjectColor!==void 0)if(t.highlightedObjectColor===null)n.isHighlightActive=!1;else{n.isHighlightActive=!0;const r=t.highlightedObjectColor.slice(0,3);n.highlightedObjectColor=r}if(t.highlightColor){const r=Array.from(t.highlightColor,i=>i/255);Number.isFinite(r[3])||(r[3]=1),n.highlightColor=r}return t.isActive!==void 0&&(n.isActive=!!t.isActive,n.isAttribute=!!t.isAttribute),t.useFloatColors!==void 0&&(n.useFloatColors=!!t.useFloatColors),n}const RA=`precision highp int;
// #if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))
struct AmbientLight {
vec3 color;
};
struct PointLight {
vec3 color;
vec3 position;
vec3 attenuation; // 2nd order x:Constant-y:Linear-z:Exponential
};
struct DirectionalLight {
vec3 color;
vec3 direction;
};
uniform lightingUniforms {
int enabled;
int lightType;
int directionalLightCount;
int pointLightCount;
vec3 ambientColor;
vec3 lightColor0;
vec3 lightPosition0;
vec3 lightDirection0;
vec3 lightAttenuation0;
vec3 lightColor1;
vec3 lightPosition1;
vec3 lightDirection1;
vec3 lightAttenuation1;
vec3 lightColor2;
vec3 lightPosition2;
vec3 lightDirection2;
vec3 lightAttenuation2;
} lighting;
PointLight lighting_getPointLight(int index) {
switch (index) {
case 0:
return PointLight(lighting.lightColor0, lighting.lightPosition0, lighting.lightAttenuation0);
case 1:
return PointLight(lighting.lightColor1, lighting.lightPosition1, lighting.lightAttenuation1);
case 2:
default:
return PointLight(lighting.lightColor2, lighting.lightPosition2, lighting.lightAttenuation2);
}
}
DirectionalLight lighting_getDirectionalLight(int index) {
switch (index) {
case 0:
return DirectionalLight(lighting.lightColor0, lighting.lightDirection0);
case 1:
return DirectionalLight(lighting.lightColor1, lighting.lightDirection1);
case 2:
default:
return DirectionalLight(lighting.lightColor2, lighting.lightDirection2);
}
}
float getPointLightAttenuation(PointLight pointLight, float distance) {
return pointLight.attenuation.x
+ pointLight.attenuation.y * distance
+ pointLight.attenuation.z * distance * distance;
}
// #endif
`,Kj=`// #if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))
struct AmbientLight {
color: vec3<f32>,
};
struct PointLight {
color: vec3<f32>,
position: vec3<f32>,
attenuation: vec3<f32>, // 2nd order x:Constant-y:Linear-z:Exponential
};
struct DirectionalLight {
color: vec3<f32>,
direction: vec3<f32>,
};
struct lightingUniforms {
enabled: i32,
poightCount: i32,
directionalLightCount: i32,
ambientColor: vec3<f32>,
// TODO - support multiple lights by uncommenting arrays below
lightType: i32,
lightColor: vec3<f32>,
lightDirection: vec3<f32>,
lightPosition: vec3<f32>,
lightAttenuation: vec3<f32>,
// AmbientLight ambientLight;
// PointLight pointLight[MAX_LIGHTS];
// DirectionalLight directionalLight[MAX_LIGHTS];
};
// Binding 0:1 is reserved for lighting (Note: could go into separate bind group as it is stable across draw calls)
@binding(1) @group(0) var<uniform> lighting : lightingUniforms;
fn lighting_getPointLight(index: i32) -> PointLight {
return PointLight(lighting.lightColor, lighting.lightPosition, lighting.lightAttenuation);
}
fn lighting_getDirectionalLight(index: i32) -> DirectionalLight {
return DirectionalLight(lighting.lightColor, lighting.lightDirection);
}
fn getPointLightAttenuation(pointLight: PointLight, distance: f32) -> f32 {
return pointLight.attenuation.x
+ pointLight.attenuation.y * distance
+ pointLight.attenuation.z * distance * distance;
}
`,tO=3,Zj=255;var kf;(function(t){t[t.POINT=0]="POINT",t[t.DIRECTIONAL=1]="DIRECTIONAL"})(kf||(kf={}));const uf={props:{},uniforms:{},name:"lighting",defines:{MAX_LIGHTS:tO},uniformTypes:{enabled:"i32",lightType:"i32",directionalLightCount:"i32",pointLightCount:"i32",ambientLightColor:"vec3<f32>",lightColor0:"vec3<f32>",lightPosition0:"vec3<f32>",lightDirection0:"vec3<f32>",lightAttenuation0:"vec3<f32>",lightColor1:"vec3<f32>",lightPosition1:"vec3<f32>",lightDirection1:"vec3<f32>",lightAttenuation1:"vec3<f32>",lightColor2:"vec3<f32>",lightPosition2:"vec3<f32>",lightDirection2:"vec3<f32>",lightAttenuation2:"vec3<f32>"},defaultUniforms:{enabled:1,lightType:kf.POINT,directionalLightCount:0,pointLightCount:0,ambientLightColor:[.1,.1,.1],lightColor0:[1,1,1],lightPosition0:[1,1,2],lightDirection0:[1,1,1],lightAttenuation0:[1,0,0],lightColor1:[1,1,1],lightPosition1:[1,1,2],lightDirection1:[1,1,1],lightAttenuation1:[1,0,0],lightColor2:[1,1,1],lightPosition2:[1,1,2],lightDirection2:[1,1,1],lightAttenuation2:[1,0,0]},source:Kj,vs:RA,fs:RA,getUniforms:Qj};function Qj(t,e={}){if(t=t&&{...t},!t)return{...uf.defaultUniforms};t.lights&&(t={...t,...Jj(t.lights),lights:void 0});const{ambientLight:n,pointLights:r,directionalLights:i}=t||{};if(!(n||r&&r.length>0||i&&i.length>0))return{...uf.defaultUniforms,enabled:0};const l={...uf.defaultUniforms,...e,...Gj({ambientLight:n,pointLights:r,directionalLights:i})};return t.enabled!==void 0&&(l.enabled=t.enabled?1:0),l}function Gj({ambientLight:t,pointLights:e=[],directionalLights:n=[]}){const r={};r.ambientLightColor=m0(t);let i=0;for(const s of e){r.lightType=kf.POINT;const l=i;r[`lightColor${l}`]=m0(s),r[`lightPosition${l}`]=s.position,r[`lightAttenuation${l}`]=s.attenuation||[1,0,0],i++}for(const s of n){r.lightType=kf.DIRECTIONAL;const l=i;r[`lightColor${l}`]=m0(s),r[`lightDirection${l}`]=s.direction,i++}return i>tO&&Re.warn("MAX_LIGHTS exceeded")(),r.directionalLightCount=n.length,r.pointLightCount=e.length,r}function Jj(t){var n,r;const e={pointLights:[],directionalLights:[]};for(const i of t||[])switch(i.type){case"ambient":e.ambientLight=i;break;case"directional":(n=e.directionalLights)==null||n.push(i);break;case"point":(r=e.pointLights)==null||r.push(i);break}return e}function m0(t={}){const{color:e=[0,0,0],intensity:n=1}=t;return e.map(r=>r*n/Zj)}const nO=`uniform phongMaterialUniforms {
uniform float ambient;
uniform float diffuse;
uniform float shininess;
uniform vec3 specularColor;
} material;
`,rO=`uniform phongMaterialUniforms {
uniform float ambient;
uniform float diffuse;
uniform float shininess;
uniform vec3 specularColor;
} material;
vec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {
vec3 halfway_direction = normalize(light_direction + view_direction);
float lambertian = dot(light_direction, normal_worldspace);
float specular = 0.0;
if (lambertian > 0.0) {
float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);
specular = pow(specular_angle, material.shininess);
}
lambertian = max(lambertian, 0.0);
return (lambertian * material.diffuse * surfaceColor + specular * material.specularColor) * color;
}
vec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {
vec3 lightColor = surfaceColor;
if (lighting.enabled == 0) {
return lightColor;
}
vec3 view_direction = normalize(cameraPosition - position_worldspace);
lightColor = material.ambient * surfaceColor * lighting.ambientColor;
for (int i = 0; i < lighting.pointLightCount; i++) {
PointLight pointLight = lighting_getPointLight(i);
vec3 light_position_worldspace = pointLight.position;
vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
float light_attenuation = getPointLightAttenuation(pointLight, distance(light_position_worldspace, position_worldspace));
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color / light_attenuation);
}
int totalLights = min(MAX_LIGHTS, lighting.pointLightCount + lighting.directionalLightCount);
for (int i = lighting.pointLightCount; i < totalLights; i++) {
DirectionalLight directionalLight = lighting_getDirectionalLight(i);
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
}
return lightColor;
}
`,iO={props:{},name:"gouraudMaterial",vs:rO.replace("phongMaterial","gouraudMaterial"),fs:nO.replace("phongMaterial","gouraudMaterial"),defines:{LIGHTING_VERTEX:1},dependencies:[uf],uniformTypes:{ambient:"f32",diffuse:"f32",shininess:"f32",specularColor:"vec3<f32>"},defaultUniforms:{ambient:.35,diffuse:.6,shininess:32,specularColor:[.15,.15,.15]},getUniforms(t){const e={...t};return e.specularColor&&(e.specularColor=e.specularColor.map(n=>n/255)),{...iO.defaultUniforms,...e}}},eW=`struct phongMaterialUniforms {
ambient: f32,
diffuse: f32,
shininess: f32,
specularColor: vec3<f32>,
};
@binding(2) @group(0) var<uniform> material : phongMaterialUniforms;
fn lighting_getLightColor(surfaceColor: vec3<f32>, light_direction: vec3<f32>, view_direction: vec3<f32>, normal_worldspace: vec3<f32>, color: vec3<f32>) -> vec3<f32> {
let halfway_direction: vec3<f32> = normalize(light_direction + view_direction);
var lambertian: f32 = dot(light_direction, normal_worldspace);
var specular: f32 = 0.0;
if (lambertian > 0.0) {
let specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);
specular = pow(specular_angle, material.shininess);
}
lambertian = max(lambertian, 0.0);
return (lambertian * material.diffuse * surfaceColor + specular * material.specularColor) * color;
}
fn lighting_getLightColor2(surfaceColor: vec3<f32>, cameraPosition: vec3<f32>, position_worldspace: vec3<f32>, normal_worldspace: vec3<f32>) -> vec3<f32> {
var lightColor: vec3<f32> = surfaceColor;
if (lighting.enabled == 0) {
return lightColor;
}
let view_direction: vec3<f32> = normalize(cameraPosition - position_worldspace);
lightColor = material.ambient * surfaceColor * lighting.ambientColor;
if (lighting.lightType == 0) {
let pointLight: PointLight = lighting_getPointLight(0);
let light_position_worldspace: vec3<f32> = pointLight.position;
let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
} else if (lighting.lightType == 1) {
var directionalLight: DirectionalLight = lighting_getDirectionalLight(0);
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
}
return lightColor;
/*
for (int i = 0; i < MAX_LIGHTS; i++) {
if (i >= lighting.pointLightCount) {
break;
}
PointLight pointLight = lighting.pointLight[i];
vec3 light_position_worldspace = pointLight.position;
vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
}
for (int i = 0; i < MAX_LIGHTS; i++) {
if (i >= lighting.directionalLightCount) {
break;
}
DirectionalLight directionalLight = lighting.directionalLight[i];
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
}
*/
}
fn lighting_getSpecularLightColor(cameraPosition: vec3<f32>, position_worldspace: vec3<f32>, normal_worldspace: vec3<f32>) -> vec3<f32>{
var lightColor = vec3<f32>(0, 0, 0);
let surfaceColor = vec3<f32>(0, 0, 0);
if (lighting.enabled == 0) {
let view_direction = normalize(cameraPosition - position_worldspace);
switch (lighting.lightType) {
case 0, default: {
let pointLight: PointLight = lighting_getPointLight(0);
let light_position_worldspace: vec3<f32> = pointLight.position;
let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
}
case 1: {
let directionalLight: DirectionalLight = lighting_getDirectionalLight(0);
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
}
}
}
return lightColor;
}
`,sO={name:"phongMaterial",dependencies:[uf],source:eW,vs:nO,fs:rO,defines:{LIGHTING_FRAGMENT:1},uniformTypes:{ambient:"f32",diffuse:"f32",shininess:"f32",specularColor:"vec3<f32>"},defaultUniforms:{ambient:.35,diffuse:.6,shininess:32,specularColor:[.15,.15,.15]},getUniforms(t){const e={...t};return e.specularColor&&(e.specularColor=e.specularColor.map(n=>n/255)),{...sO.defaultUniforms,...e}}},xA=`uniform layerUniforms {
uniform float opacity;
} layer;
`,tW={name:"layer",vs:xA,fs:xA,getUniforms:t=>({opacity:Math.pow(t.opacity,1/2.2)}),uniformTypes:{opacity:"f32"}},aO="#define SMOOTH_EDGE_RADIUS 0.5",nW=`
${aO}
struct VertexGeometry {
vec4 position;
vec3 worldPosition;
vec3 worldPositionAlt;
vec3 normal;
vec2 uv;
vec3 pickingColor;
} geometry = VertexGeometry(
vec4(0.0, 0.0, 1.0, 0.0),
vec3(0.0),
vec3(0.0),
vec3(0.0),
vec2(0.0),
vec3(0.0)
);
`,rW=`
${aO}
struct FragmentGeometry {
vec2 uv;
} geometry;
float smoothedge(float edge, float x) {
return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);
}
`,oO={name:"geometry",vs:nW,fs:rW},iW=25;var lr;(function(t){t[t.Start=1]="Start",t[t.Move=2]="Move",t[t.End=4]="End",t[t.Cancel=8]="Cancel"})(lr||(lr={}));var fr;(function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.Up=4]="Up",t[t.Down=8]="Down",t[t.Horizontal=3]="Horizontal",t[t.Vertical=12]="Vertical",t[t.All=15]="All"})(fr||(fr={}));var At;(function(t){t[t.Possible=1]="Possible",t[t.Began=2]="Began",t[t.Changed=4]="Changed",t[t.Ended=8]="Ended",t[t.Recognized=8]="Recognized",t[t.Cancelled=16]="Cancelled",t[t.Failed=32]="Failed"})(At||(At={}));const sW="compute",aW="auto",dy="manipulation",jh="none",hy="pan-x",gy="pan-y";function oW(t){if(t.includes(jh))return jh;const e=t.includes(hy),n=t.includes(gy);return e&&n?jh:e||n?e?hy:gy:t.includes(dy)?dy:aW}class lW{constructor(e,n){this.actions="",this.manager=e,this.set(n)}set(e){e===sW&&(e=this.compute()),this.manager.element&&(this.manager.element.style.touchAction=e,this.actions=e)}update(){this.set(this.manager.options.touchAction)}compute(){let e=[];for(const n of this.manager.recognizers)n.options.enable&&(e=e.concat(n.getTouchAction()));return oW(e.join(" "))}}function Pg(t){return t.trim().split(/\s+/g)}function v0(t,e,n){if(t)for(const r of Pg(e))t.addEventListener(r,n,!1)}function _0(t,e,n){if(t)for(const r of Pg(e))t.removeEventListener(r,n,!1)}function MA(t){return(t.ownerDocument||t).defaultView}function cW(t,e){let n=t;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function lO(t){const e=t.length;if(e===1)return{x:Math.round(t[0].clientX),y:Math.round(t[0].clientY)};let n=0,r=0,i=0;for(;i<e;)n+=t[i].clientX,r+=t[i].clientY,i++;return{x:Math.round(n/e),y:Math.round(r/e)}}function OA(t){const e=[];let n=0;for(;n<t.pointers.length;)e[n]={clientX:Math.round(t.pointers[n].clientX),clientY:Math.round(t.pointers[n].clientY)},n++;return{timeStamp:Date.now(),pointers:e,center:lO(e),deltaX:t.deltaX,deltaY:t.deltaY}}function cO(t,e){const n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}function PA(t,e){const n=e.clientX-t.clientX,r=e.clientY-t.clientY;return Math.sqrt(n*n+r*r)}function uW(t,e){const n=e.x-t.x,r=e.y-t.y;return Math.atan2(r,n)*180/Math.PI}function NA(t,e){const n=e.clientX-t.clientX,r=e.clientY-t.clientY;return Math.atan2(r,n)*180/Math.PI}function uO(t,e){return t===e?fr.None:Math.abs(t)>=Math.abs(e)?t<0?fr.Left:fr.Right:e<0?fr.Up:fr.Down}function fW(t,e){const n=e.center;let r=t.offsetDelta,i=t.prevDelta;const s=t.prevInput;return(e.eventType===lr.Start||(s==null?void 0:s.eventType)===lr.End)&&(i=t.prevDelta={x:(s==null?void 0:s.deltaX)||0,y:(s==null?void 0:s.deltaY)||0},r=t.offsetDelta={x:n.x,y:n.y}),{deltaX:i.x+(n.x-r.x),deltaY:i.y+(n.y-r.y)}}function fO(t,e,n){return{x:e/t||0,y:n/t||0}}function dW(t,e){return PA(e[0],e[1])/PA(t[0],t[1])}function hW(t,e){return NA(e[1],e[0])-NA(t[1],t[0])}function gW(t,e){const n=t.lastInterval||e,r=e.timeStamp-n.timeStamp;let i,s,l,c;if(e.eventType!==lr.Cancel&&(r>iW||n.velocity===void 0)){const f=e.deltaX-n.deltaX,d=e.deltaY-n.deltaY,g=fO(r,f,d);s=g.x,l=g.y,i=Math.abs(g.x)>Math.abs(g.y)?g.x:g.y,c=uO(f,d),t.lastInterval=e}else i=n.velocity,s=n.velocityX,l=n.velocityY,c=n.direction;e.velocity=i,e.velocityX=s,e.velocityY=l,e.direction=c}function pW(t,e){const{session:n}=t,{pointers:r}=e,{length:i}=r;n.firstInput||(n.firstInput=OA(e)),i>1&&!n.firstMultiple?n.firstMultiple=OA(e):i===1&&(n.firstMultiple=!1);const{firstInput:s,firstMultiple:l}=n,c=l?l.center:s.center,f=e.center=lO(r);e.timeStamp=Date.now(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=uW(c,f),e.distance=cO(c,f);const{deltaX:d,deltaY:g}=fW(n,e);e.deltaX=d,e.deltaY=g,e.offsetDirection=uO(e.deltaX,e.deltaY);const m=fO(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=m.x,e.overallVelocityY=m.y,e.overallVelocity=Math.abs(m.x)>Math.abs(m.y)?m.x:m.y,e.scale=l?dW(l.pointers,r):1,e.rotation=l?hW(l.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length;let v=t.element;return cW(e.srcEvent.target,v)&&(v=e.srcEvent.target),e.target=v,gW(n,e),e}function mW(t,e,n){const r=n.pointers.length,i=n.changedPointers.length,s=e&lr.Start&&r-i===0,l=e&(lr.End|lr.Cancel)&&r-i===0;n.isFirst=!!s,n.isFinal=!!l,s&&(t.session={}),n.eventType=e;const c=pW(t,n);t.emit("hammer.input",c),t.recognize(c),t.session.prevInput=c}let vW=class{constructor(e){this.evEl="",this.evWin="",this.evTarget="",this.domHandler=n=>{this.manager.options.enable&&this.handler(n)},this.manager=e,this.element=e.element,this.target=e.options.inputTarget||e.element}callback(e,n){mW(this.manager,e,n)}init(){v0(this.element,this.evEl,this.domHandler),v0(this.target,this.evTarget,this.domHandler),v0(MA(this.element),this.evWin,this.domHandler)}destroy(){_0(this.element,this.evEl,this.domHandler),_0(this.target,this.evTarget,this.domHandler),_0(MA(this.element),this.evWin,this.domHandler)}};const _W={pointerdown:lr.Start,pointermove:lr.Move,pointerup:lr.End,pointercancel:lr.Cancel,pointerout:lr.Cancel},yW="pointerdown",bW="pointermove pointerup pointercancel";class SW extends vW{constructor(e){super(e),this.evEl=yW,this.evWin=bW,this.store=this.manager.session.pointerEvents=[],this.init()}handler(e){const{store:n}=this;let r=!1;const i=_W[e.type],s=e.pointerType,l=s==="touch";let c=n.findIndex(f=>f.pointerId===e.pointerId);i&lr.Start&&(e.buttons||l)?c<0&&(n.push(e),c=n.length-1):i&(lr.End|lr.Cancel)&&(r=!0),!(c<0)&&(n[c]=e,this.callback(i,{pointers:n,changedPointers:[e],eventType:i,pointerType:s,srcEvent:e}),r&&n.splice(c,1))}}const wW=["","webkit","Moz","MS","ms","o"];function EW(t,e){const n=e[0].toUpperCase()+e.slice(1);for(const r of wW){const i=r?r+n:e;if(i in t)return i}}const TW=1,IA=2,DA={touchAction:"compute",enable:!0,inputTarget:null,cssProps:{userSelect:"none",userDrag:"none",touchCallout:"none",tapHighlightColor:"rgba(0,0,0,0)"}};class AW{constructor(e,n){this.options={...DA,...n,cssProps:{...DA.cssProps,...n.cssProps},inputTarget:n.inputTarget||e},this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new SW(this),this.touchAction=new lW(this,this.options.touchAction),this.toggleCssProps(!0)}set(e){return Object.assign(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this}stop(e){this.session.stopped=e?IA:TW}recognize(e){const{session:n}=this;if(n.stopped)return;this.session.prevented&&e.srcEvent.preventDefault();let r;const{recognizers:i}=this;let{curRecognizer:s}=n;(!s||s&&s.state&At.Recognized)&&(s=n.curRecognizer=null);let l=0;for(;l<i.length;)r=i[l],n.stopped!==IA&&(!s||r===s||r.canRecognizeWith(s))?r.recognize(e):r.reset(),!s&&r.state&(At.Began|At.Changed|At.Ended)&&(s=n.curRecognizer=r),l++}get(e){const{recognizers:n}=this;for(let r=0;r<n.length;r++)if(n[r].options.event===e)return n[r];return null}add(e){if(Array.isArray(e)){for(const r of e)this.add(r);return this}const n=this.get(e.options.event);return n&&this.remove(n),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e}remove(e){if(Array.isArray(e)){for(const r of e)this.remove(r);return this}const n=typeof e=="string"?this.get(e):e;if(n){const{recognizers:r}=this,i=r.indexOf(n);i!==-1&&(r.splice(i,1),this.touchAction.update())}return this}on(e,n){if(!e||!n)return;const{handlers:r}=this;for(const i of Pg(e))r[i]=r[i]||[],r[i].push(n)}off(e,n){if(!e)return;const{handlers:r}=this;for(const i of Pg(e))n?r[i]&&r[i].splice(r[i].indexOf(n),1):delete r[i]}emit(e,n){const r=this.handlers[e]&&this.handlers[e].slice();if(!r||!r.length)return;const i=n;i.type=e,i.preventDefault=function(){n.srcEvent.preventDefault()};let s=0;for(;s<r.length;)r[s](i),s++}destroy(){this.toggleCssProps(!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}toggleCssProps(e){const{element:n}=this;if(n){for(const[r,i]of Object.entries(this.options.cssProps)){const s=EW(n.style,r);e?(this.oldCssProps[s]=n.style[s],n.style[s]=i):n.style[s]=this.oldCssProps[s]||""}e||(this.oldCssProps={})}}}let CW=1;function RW(){return CW++}function FA(t){return t&At.Cancelled?"cancel":t&At.Ended?"end":t&At.Changed?"move":t&At.Began?"start":""}class dO{constructor(e){this.options=e,this.id=RW(),this.state=At.Possible,this.simultaneous={},this.requireFail=[]}set(e){return Object.assign(this.options,e),this.manager.touchAction.update(),this}recognizeWith(e){if(Array.isArray(e)){for(const i of e)this.recognizeWith(i);return this}let n;if(typeof e=="string"){if(n=this.manager.get(e),!n)throw new Error(`Cannot find recognizer ${e}`)}else n=e;const{simultaneous:r}=this;return r[n.id]||(r[n.id]=n,n.recognizeWith(this)),this}dropRecognizeWith(e){if(Array.isArray(e)){for(const r of e)this.dropRecognizeWith(r);return this}let n;return typeof e=="string"?n=this.manager.get(e):n=e,n&&delete this.simultaneous[n.id],this}requireFailure(e){if(Array.isArray(e)){for(const i of e)this.requireFailure(i);return this}let n;if(typeof e=="string"){if(n=this.manager.get(e),!n)throw new Error(`Cannot find recognizer ${e}`)}else n=e;const{requireFail:r}=this;return r.indexOf(n)===-1&&(r.push(n),n.requireFailure(this)),this}dropRequireFailure(e){if(Array.isArray(e)){for(const r of e)this.dropRequireFailure(r);return this}let n;if(typeof e=="string"?n=this.manager.get(e):n=e,n){const r=this.requireFail.indexOf(n);r>-1&&this.requireFail.splice(r,1)}return this}hasRequireFailures(){return!!this.requireFail.find(e=>e.options.enable)}canRecognizeWith(e){return!!this.simultaneous[e.id]}emit(e){if(!e)return;const{state:n}=this;n<At.Ended&&this.manager.emit(this.options.event+FA(n),e),this.manager.emit(this.options.event,e),e.additionalEvent&&this.manager.emit(e.additionalEvent,e),n>=At.Ended&&this.manager.emit(this.options.event+FA(n),e)}tryEmit(e){this.canEmit()?this.emit(e):this.state=At.Failed}canEmit(){let e=0;for(;e<this.requireFail.length;){if(!(this.requireFail[e].state&(At.Failed|At.Possible)))return!1;e++}return!0}recognize(e){const n={...e};if(!this.options.enable){this.reset(),this.state=At.Failed;return}this.state&(At.Recognized|At.Cancelled|At.Failed)&&(this.state=At.Possible),this.state=this.process(n),this.state&(At.Began|At.Changed|At.Ended|At.Cancelled)&&this.tryEmit(n)}getEventNames(){return[this.options.event]}reset(){}}class hO extends dO{attrTest(e){const n=this.options.pointers;return n===0||e.pointers.length===n}process(e){const{state:n}=this,{eventType:r}=e,i=n&(At.Began|At.Changed),s=this.attrTest(e);return i&&(r&lr.Cancel||!s)?n|At.Cancelled:i||s?r&lr.End?n|At.Ended:n&At.Began?n|At.Changed:At.Began:At.Failed}}class kA extends dO{constructor(e={}){super({enable:!0,event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10,...e}),this.pTime=null,this.pCenter=null,this._timer=null,this._input=null,this.count=0}getTouchAction(){return[dy]}process(e){const{options:n}=this,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,s=e.deltaTime<n.time;if(this.reset(),e.eventType&lr.Start&&this.count===0)return this.failTimeout();if(i&&s&&r){if(e.eventType!==lr.End)return this.failTimeout();const l=this.pTime?e.timeStamp-this.pTime<n.interval:!0,c=!this.pCenter||cO(this.pCenter,e.center)<n.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,!c||!l?this.count=1:this.count+=1,this._input=e,this.count%n.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(()=>{this.state=At.Recognized,this.tryEmit(this._input)},n.interval),At.Began):At.Recognized}return At.Failed}failTimeout(){return this._timer=setTimeout(()=>{this.state=At.Failed},this.options.interval),At.Failed}reset(){clearTimeout(this._timer)}emit(e){this.state===At.Recognized&&(e.tapCount=this.count,this.manager.emit(this.options.event,e))}}const xW=["","start","move","end","cancel","up","down","left","right"];class BA extends hO{constructor(e={}){super({enable:!0,pointers:1,event:"pan",threshold:10,direction:fr.All,...e}),this.pX=null,this.pY=null}getTouchAction(){const{options:{direction:e}}=this,n=[];return e&fr.Horizontal&&n.push(gy),e&fr.Vertical&&n.push(hy),n}getEventNames(){return xW.map(e=>this.options.event+e)}directionTest(e){const{options:n}=this;let r=!0,{distance:i}=e,{direction:s}=e;const l=e.deltaX,c=e.deltaY;return s&n.direction||(n.direction&fr.Horizontal?(s=l===0?fr.None:l<0?fr.Left:fr.Right,r=l!==this.pX,i=Math.abs(e.deltaX)):(s=c===0?fr.None:c<0?fr.Up:fr.Down,r=c!==this.pY,i=Math.abs(e.deltaY))),e.direction=s,r&&i>n.threshold&&!!(s&n.direction)}attrTest(e){return super.attrTest(e)&&(!!(this.state&At.Began)||!(this.state&At.Began)&&this.directionTest(e))}emit(e){this.pX=e.deltaX,this.pY=e.deltaY;const n=fr[e.direction].toLowerCase();n&&(e.additionalEvent=this.options.event+n),super.emit(e)}}const MW=["","start","move","end","cancel","in","out"];class OW extends hO{constructor(e={}){super({enable:!0,event:"pinch",threshold:0,pointers:2,...e})}getTouchAction(){return[jh]}getEventNames(){return MW.map(e=>this.options.event+e)}attrTest(e){return super.attrTest(e)&&(Math.abs(e.scale-1)>this.options.threshold||!!(this.state&At.Began))}emit(e){if(e.scale!==1){const n=e.scale<1?"in":"out";e.additionalEvent=this.options.event+n}super.emit(e)}}class bp{constructor(e,n,r){this.element=e,this.callback=n,this.options=r}}const PW=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",NW=PW.indexOf("firefox")!==-1,UA=4.000244140625,IW=40,DW=.25;class FW extends bp{constructor(e,n,r){super(e,n,{enable:!0,...r}),this.handleEvent=i=>{if(!this.options.enable)return;let s=i.deltaY;globalThis.WheelEvent&&(NW&&i.deltaMode===globalThis.WheelEvent.DOM_DELTA_PIXEL&&(s/=globalThis.devicePixelRatio),i.deltaMode===globalThis.WheelEvent.DOM_DELTA_LINE&&(s*=IW)),s!==0&&s%UA===0&&(s=Math.floor(s/UA)),i.shiftKey&&s&&(s=s*DW),this.callback({type:"wheel",center:{x:i.clientX,y:i.clientY},delta:-s,srcEvent:i,pointerType:"mouse",target:i.target})},e.addEventListener("wheel",this.handleEvent,{passive:!1})}destroy(){this.element.removeEventListener("wheel",this.handleEvent)}enableEventType(e,n){e==="wheel"&&(this.options.enable=n)}}const LA=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"];class kW extends bp{constructor(e,n,r){super(e,n,{enable:!0,...r}),this.handleEvent=s=>{this.handleOverEvent(s),this.handleOutEvent(s),this.handleEnterEvent(s),this.handleLeaveEvent(s),this.handleMoveEvent(s)},this.pressed=!1;const{enable:i}=this.options;this.enableMoveEvent=i,this.enableLeaveEvent=i,this.enableEnterEvent=i,this.enableOutEvent=i,this.enableOverEvent=i,LA.forEach(s=>e.addEventListener(s,this.handleEvent))}destroy(){LA.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,n){switch(e){case"pointermove":this.enableMoveEvent=n;break;case"pointerover":this.enableOverEvent=n;break;case"pointerout":this.enableOutEvent=n;break;case"pointerenter":this.enableEnterEvent=n;break;case"pointerleave":this.enableLeaveEvent=n;break}}handleOverEvent(e){this.enableOverEvent&&e.type==="mouseover"&&this._emit("pointerover",e)}handleOutEvent(e){this.enableOutEvent&&e.type==="mouseout"&&this._emit("pointerout",e)}handleEnterEvent(e){this.enableEnterEvent&&e.type==="mouseenter"&&this._emit("pointerenter",e)}handleLeaveEvent(e){this.enableLeaveEvent&&e.type==="mouseleave"&&this._emit("pointerleave",e)}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":e.buttons===0&&(this.pressed=!1),this.pressed||this._emit("pointermove",e);break;case"mouseup":this.pressed=!1;break}}_emit(e,n){this.callback({type:e,center:{x:n.clientX,y:n.clientY},srcEvent:n,pointerType:"mouse",target:n.target})}}const zA=["keydown","keyup"];class BW extends bp{constructor(e,n,r){super(e,n,{enable:!0,tabIndex:0,...r}),this.handleEvent=i=>{const s=i.target||i.srcElement;s.tagName==="INPUT"&&s.type==="text"||s.tagName==="TEXTAREA"||(this.enableDownEvent&&i.type==="keydown"&&this.callback({type:"keydown",srcEvent:i,key:i.key,target:i.target}),this.enableUpEvent&&i.type==="keyup"&&this.callback({type:"keyup",srcEvent:i,key:i.key,target:i.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,e.tabIndex=this.options.tabIndex,e.style.outline="none",zA.forEach(i=>e.addEventListener(i,this.handleEvent))}destroy(){zA.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,n){e==="keydown"&&(this.enableDownEvent=n),e==="keyup"&&(this.enableUpEvent=n)}}class UW extends bp{constructor(e,n,r){super(e,n,r),this.handleEvent=i=>{this.options.enable&&this.callback({type:"contextmenu",center:{x:i.clientX,y:i.clientY},srcEvent:i,pointerType:"mouse",target:i.target})},e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,n){e==="contextmenu"&&(this.options.enable=n)}}const $A=1,py=2,VA=4,LW={pointerdown:$A,pointermove:py,pointerup:VA,mousedown:$A,mousemove:py,mouseup:VA},zW=0,$W=1,VW=2,HW=1,jW=2,WW=4;function XW(t){const e=LW[t.srcEvent.type];if(!e)return null;const{buttons:n,button:r}=t.srcEvent;let i=!1,s=!1,l=!1;return e===py?(i=!!(n&HW),s=!!(n&WW),l=!!(n&jW)):(i=r===zW,s=r===$W,l=r===VW),{leftButton:i,middleButton:s,rightButton:l}}function qW(t,e){const n=t.center;if(!n)return null;const r=e.getBoundingClientRect(),i=r.width/e.offsetWidth||1,s=r.height/e.offsetHeight||1,l={x:(n.x-r.left-e.clientLeft)/i,y:(n.y-r.top-e.clientTop)/s};return{center:n,offsetCenter:l}}const YW={srcElement:"root",priority:0};class KW{constructor(e,n){this.handleEvent=r=>{if(this.isEmpty())return;const i=this._normalizeEvent(r);let s=r.srcEvent.target;for(;s&&s!==i.rootElement;){if(this._emit(i,s),i.handled)return;s=s.parentNode}this._emit(i,"root")},this.eventManager=e,this.recognizerName=n,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(e,n,r,i=!1,s=!1){const{handlers:l,handlersByElement:c}=this,f={...YW,...r};let d=c.get(f.srcElement);d||(d=[],c.set(f.srcElement,d));const g={type:e,handler:n,srcElement:f.srcElement,priority:f.priority};i&&(g.once=!0),s&&(g.passive=!0),l.push(g),this._active=this._active||!g.passive;let m=d.length-1;for(;m>=0&&!(d[m].priority>=g.priority);)m--;d.splice(m+1,0,g)}remove(e,n){const{handlers:r,handlersByElement:i}=this;for(let s=r.length-1;s>=0;s--){const l=r[s];if(l.type===e&&l.handler===n){r.splice(s,1);const c=i.get(l.srcElement);c.splice(c.indexOf(l),1),c.length===0&&i.delete(l.srcElement)}}this._active=r.some(s=>!s.passive)}_emit(e,n){const r=this.handlersByElement.get(n);if(r){let i=!1;const s=()=>{e.handled=!0},l=()=>{e.handled=!0,i=!0},c=[];for(let f=0;f<r.length;f++){const{type:d,handler:g,once:m}=r[f];if(g({...e,type:d,stopPropagation:s,stopImmediatePropagation:l}),m&&c.push(r[f]),i)break}for(let f=0;f<c.length;f++){const{type:d,handler:g}=c[f];this.remove(d,g)}}}_normalizeEvent(e){const n=this.eventManager.getElement();return{...e,...XW(e),...qW(e,n),preventDefault:()=>{e.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:n}}}function ZW(t){if("recognizer"in t)return t;let e;const n=Array.isArray(t)?[...t]:[t];if(typeof n[0]=="function"){const r=n.shift(),i=n.shift()||{};e=new r(i)}else e=n.shift();return{recognizer:e,recognizeWith:typeof n[0]=="string"?[n[0]]:n[0],requireFailure:typeof n[1]=="string"?[n[1]]:n[1]}}class QW{constructor(e=null,n={}){if(this._onBasicInput=r=>{this.manager.emit(r.srcEvent.type,r)},this._onOtherEvent=r=>{this.manager.emit(r.type,r)},this.options={recognizers:[],events:{},touchAction:"compute",tabIndex:0,cssProps:{},...n},this.events=new Map,this.element=e,!!e){this.manager=new AW(e,this.options);for(const r of this.options.recognizers){const{recognizer:i,recognizeWith:s,requireFailure:l}=ZW(r);this.manager.add(i),s&&i.recognizeWith(s),l&&i.requireFailure(l)}this.manager.on("hammer.input",this._onBasicInput),this.wheelInput=new FW(e,this._onOtherEvent,{enable:!1}),this.moveInput=new kW(e,this._onOtherEvent,{enable:!1}),this.keyInput=new BW(e,this._onOtherEvent,{enable:!1,tabIndex:n.tabIndex}),this.contextmenuInput=new UW(e,this._onOtherEvent,{enable:!1}),this.on(this.options.events)}}getElement(){return this.element}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy())}on(e,n,r){this._addEventHandler(e,n,r,!1)}once(e,n,r){this._addEventHandler(e,n,r,!0)}watch(e,n,r){this._addEventHandler(e,n,r,!1,!0)}off(e,n){this._removeEventHandler(e,n)}_toggleRecognizer(e,n){var s,l,c,f;const{manager:r}=this;if(!r)return;const i=r.get(e);i&&(i.set({enable:n}),r.touchAction.update()),(s=this.wheelInput)==null||s.enableEventType(e,n),(l=this.moveInput)==null||l.enableEventType(e,n),(c=this.keyInput)==null||c.enableEventType(e,n),(f=this.contextmenuInput)==null||f.enableEventType(e,n)}_addEventHandler(e,n,r,i,s){if(typeof e!="string"){r=n;for(const[d,g]of Object.entries(e))this._addEventHandler(d,g,r,i,s);return}const{manager:l,events:c}=this;if(!l)return;let f=c.get(e);if(!f){const d=this._getRecognizerName(e)||e;f=new KW(this,d),c.set(e,f),l&&l.on(e,f.handleEvent)}f.add(e,n,r,i,s),f.isEmpty()||this._toggleRecognizer(f.recognizerName,!0)}_removeEventHandler(e,n){if(typeof e!="string"){for(const[s,l]of Object.entries(e))this._removeEventHandler(s,l);return}const{events:r}=this,i=r.get(e);if(i&&(i.remove(e,n),i.isEmpty())){const{recognizerName:s}=i;let l=!1;for(const c of r.values())if(c.recognizerName===s&&!c.isEmpty()){l=!0;break}l||this._toggleRecognizer(s,!1)}}_getRecognizerName(e){var n;return(n=this.manager.recognizers.find(r=>r.getEventNames().includes(e)))==null?void 0:n.options.event}}const cn={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(cn,"IDENTITY",{get:()=>(Sn.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});const ys={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},jo={common:0,meters:1,pixels:2},my={click:"onClick",panstart:"onDragStart",panmove:"onDrag",panend:"onDragEnd"},HA={multipan:[BA,{threshold:10,direction:fr.Vertical,pointers:2}],pinch:[OW,{},null,["multipan"]],pan:[BA,{threshold:1},["pinch"],["multipan"]],dblclick:[kA,{event:"dblclick",taps:2}],click:[kA,{event:"click"},null,["dblclick"]]},GW=Object.keys(cn).map(t=>`const int COORDINATE_SYSTEM_${t} = ${cn[t]};`).join(""),JW=Object.keys(ys).map(t=>`const int PROJECTION_MODE_${t} = ${ys[t]};`).join(""),eX=Object.keys(jo).map(t=>`const int UNIT_${t.toUpperCase()} = ${jo[t]};`).join(""),tX=`${GW}
${JW}
${eX}
uniform projectUniforms {
bool wrapLongitude;
int coordinateSystem;
vec3 commonUnitsPerMeter;
int projectionMode;
float scale;
vec3 commonUnitsPerWorldUnit;
vec3 commonUnitsPerWorldUnit2;
vec4 center;
mat4 modelMatrix;
mat4 viewProjectionMatrix;
vec2 viewportSize;
float devicePixelRatio;
float focalDistance;
vec3 cameraPosition;
vec3 coordinateOrigin;
vec3 commonOrigin;
bool pseudoMeters;
} project;
const float TILE_SIZE = 512.0;
const float PI = 3.1415926536;
const float WORLD_SCALE = TILE_SIZE / (PI * 2.0);
const vec3 ZERO_64_LOW = vec3(0.0);
const float EARTH_RADIUS = 6370972.0;
const float GLOBE_RADIUS = 256.0;
float project_size_at_latitude(float lat) {
float y = clamp(lat, -89.9, 89.9);
return 1.0 / cos(radians(y));
}
float project_size() {
if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR &&
project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT &&
project.pseudoMeters == false) {
if (geometry.position.w == 0.0) {
return project_size_at_latitude(geometry.worldPosition.y);
}
float y = geometry.position.y / TILE_SIZE * 2.0 - 1.0;
float y2 = y * y;
float y4 = y2 * y2;
float y6 = y4 * y2;
return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;
}
return 1.0;
}
float project_size_at_latitude(float meters, float lat) {
return meters * project.commonUnitsPerMeter.z * project_size_at_latitude(lat);
}
float project_size(float meters) {
return meters * project.commonUnitsPerMeter.z * project_size();
}
vec2 project_size(vec2 meters) {
return meters * project.commonUnitsPerMeter.xy * project_size();
}
vec3 project_size(vec3 meters) {
return meters * project.commonUnitsPerMeter * project_size();
}
vec4 project_size(vec4 meters) {
return vec4(meters.xyz * project.commonUnitsPerMeter, meters.w);
}
mat3 project_get_orientation_matrix(vec3 up) {
vec3 uz = normalize(up);
vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));
vec3 uy = cross(uz, ux);
return mat3(ux, uy, uz);
}
bool project_needs_rotation(vec3 commonPosition, out mat3 transform) {
if (project.projectionMode == PROJECTION_MODE_GLOBE) {
transform = project_get_orientation_matrix(commonPosition);
return true;
}
return false;
}
vec3 project_normal(vec3 vector) {
vec4 normal_modelspace = project.modelMatrix * vec4(vector, 0.0);
vec3 n = normalize(normal_modelspace.xyz * project.commonUnitsPerMeter);
mat3 rotation;
if (project_needs_rotation(geometry.position.xyz, rotation)) {
n = rotation * n;
}
return n;
}
vec4 project_offset_(vec4 offset) {
float dy = offset.y;
vec3 commonUnitsPerWorldUnit = project.commonUnitsPerWorldUnit + project.commonUnitsPerWorldUnit2 * dy;
return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);
}
vec2 project_mercator_(vec2 lnglat) {
float x = lnglat.x;
if (project.wrapLongitude) {
x = mod(x + 180., 360.0) - 180.;
}
float y = clamp(lnglat.y, -89.9, 89.9);
return vec2(
radians(x) + PI,
PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))
) * WORLD_SCALE;
}
vec3 project_globe_(vec3 lnglatz) {
float lambda = radians(lnglatz.x);
float phi = radians(lnglatz.y);
float cosPhi = cos(phi);
float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;
return vec3(
sin(lambda) * cosPhi,
-cos(lambda) * cosPhi,
sin(phi)
) * D;
}
vec4 project_position(vec4 position, vec3 position64Low) {
vec4 position_world = project.modelMatrix * position;
if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR) {
if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {
return vec4(
project_mercator_(position_world.xy),
project_size_at_latitude(position_world.z, position_world.y),
position_world.w
);
}
if (project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {
position_world.xyz += project.coordinateOrigin;
}
}
if (project.projectionMode == PROJECTION_MODE_GLOBE) {
if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {
return vec4(
project_globe_(position_world.xyz),
position_world.w
);
}
}
if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {
if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {
if (abs(position_world.y - project.coordinateOrigin.y) > 0.25) {
return vec4(
project_mercator_(position_world.xy) - project.commonOrigin.xy,
project_size(position_world.z),
position_world.w
);
}
}
}
if (project.projectionMode == PROJECTION_MODE_IDENTITY ||
(project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&
(project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT ||
project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {
position_world.xyz -= project.coordinateOrigin;
}
return project_offset_(position_world) + project_offset_(project.modelMatrix * vec4(position64Low, 0.0));
}
vec4 project_position(vec4 position) {
return project_position(position, ZERO_64_LOW);
}
vec3 project_position(vec3 position, vec3 position64Low) {
vec4 projected_position = project_position(vec4(position, 1.0), position64Low);
return projected_position.xyz;
}
vec3 project_position(vec3 position) {
vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);
return projected_position.xyz;
}
vec2 project_position(vec2 position) {
vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);
return projected_position.xy;
}
vec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {
return viewProjectionMatrix * position + center;
}
vec4 project_common_position_to_clipspace(vec4 position) {
return project_common_position_to_clipspace(position, project.viewProjectionMatrix, project.center);
}
vec2 project_pixel_size_to_clipspace(vec2 pixels) {
vec2 offset = pixels / project.viewportSize * project.devicePixelRatio * 2.0;
return offset * project.focalDistance;
}
float project_size_to_pixel(float meters) {
return project_size(meters) * project.scale;
}
float project_size_to_pixel(float size, int unit) {
if (unit == UNIT_METERS) return project_size_to_pixel(size);
if (unit == UNIT_COMMON) return size * project.scale;
return size;
}
float project_pixel_size(float pixels) {
return pixels / project.scale;
}
vec2 project_pixel_size(vec2 pixels) {
return pixels / project.scale;
}
`;function nX(t,e){if(t===e)return!0;if(Array.isArray(t)){const n=t.length;if(!e||e.length!==n)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}return!1}function nd(t){let e={},n;return r=>{for(const i in r)if(!nX(r[i],e[i])){n=t(r),e=r;break}return n}}const jA=[0,0,0,0],rX=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],gO=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],iX=[0,0,0],pO=[0,0,0],sX=nd(lX);function mO(t,e,n=pO){n.length<3&&(n=[n[0],n[1],0]);let r=n,i,s=!0;switch(e===cn.LNGLAT_OFFSETS||e===cn.METER_OFFSETS?i=n:i=t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case ys.WEB_MERCATOR:(e===cn.LNGLAT||e===cn.CARTESIAN)&&(i=[0,0,0],s=!1);break;case ys.WEB_MERCATOR_AUTO_OFFSET:e===cn.LNGLAT?r=i:e===cn.CARTESIAN&&(r=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],i=t.unprojectPosition(r),r[0]-=n[0],r[1]-=n[1],r[2]-=n[2]);break;case ys.IDENTITY:r=t.position.map(Math.fround),r[2]=r[2]||0;break;case ys.GLOBE:s=!1,i=null;break;default:s=!1}return{geospatialOrigin:i,shaderCoordinateOrigin:r,offsetMode:s}}function aX(t,e,n){const{viewMatrixUncentered:r,projectionMatrix:i}=t;let{viewMatrix:s,viewProjectionMatrix:l}=t,c=jA,f=jA,d=t.cameraPosition;const{geospatialOrigin:g,shaderCoordinateOrigin:m,offsetMode:v}=mO(t,e,n);return v&&(f=t.projectPosition(g||m),d=[d[0]-f[0],d[1]-f[1],d[2]-f[2]],f[3]=1,c=td([],f,l),s=r||s,l=Bo([],i,s),l=Bo([],l,rX)),{viewMatrix:s,viewProjectionMatrix:l,projectionCenter:c,originCommon:f,cameraPosCommon:d,shaderCoordinateOrigin:m,geospatialOrigin:g}}function oX({viewport:t,devicePixelRatio:e=1,modelMatrix:n=null,coordinateSystem:r=cn.DEFAULT,coordinateOrigin:i=pO,autoWrapLongitude:s=!1}){r===cn.DEFAULT&&(r=t.isGeospatial?cn.LNGLAT:cn.CARTESIAN);const l=sX({viewport:t,devicePixelRatio:e,coordinateSystem:r,coordinateOrigin:i});return l.wrapLongitude=s,l.modelMatrix=n||gO,l}function lX({viewport:t,devicePixelRatio:e,coordinateSystem:n,coordinateOrigin:r}){const{projectionCenter:i,viewProjectionMatrix:s,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:d}=aX(t,n,r),g=t.getDistanceScales(),m=[t.width*e,t.height*e],v=td([],[0,0,-t.focalDistance,1],t.projectionMatrix)[3]||1,S={coordinateSystem:n,projectionMode:t.projectionMode,coordinateOrigin:f,commonOrigin:l.slice(0,3),center:i,pseudoMeters:!!t._pseudoMeters,viewportSize:m,devicePixelRatio:e,focalDistance:v,commonUnitsPerMeter:g.unitsPerMeter,commonUnitsPerWorldUnit:g.unitsPerMeter,commonUnitsPerWorldUnit2:iX,scale:t.scale,wrapLongitude:!1,viewProjectionMatrix:s,modelMatrix:gO,cameraPosition:c};if(d){const E=t.getDistanceScales(d);switch(n){case cn.METER_OFFSETS:S.commonUnitsPerWorldUnit=E.unitsPerMeter,S.commonUnitsPerWorldUnit2=E.unitsPerMeter2;break;case cn.LNGLAT:case cn.LNGLAT_OFFSETS:t._pseudoMeters||(S.commonUnitsPerMeter=E.unitsPerMeter),S.commonUnitsPerWorldUnit=E.unitsPerDegree,S.commonUnitsPerWorldUnit2=E.unitsPerDegree2;break;case cn.CARTESIAN:S.commonUnitsPerWorldUnit=[1,1,E.unitsPerMeter[2]],S.commonUnitsPerWorldUnit2=[0,0,E.unitsPerMeter2[2]];break}}return S}const cX={};function uX(t=cX){return"viewport"in t?oX(t):{}}const Ob={name:"project",dependencies:[$j,oO],vs:tX,getUniforms:uX,uniformTypes:{wrapLongitude:"f32",coordinateSystem:"i32",commonUnitsPerMeter:"vec3<f32>",projectionMode:"i32",scale:"f32",commonUnitsPerWorldUnit:"vec3<f32>",commonUnitsPerWorldUnit2:"vec3<f32>",center:"vec4<f32>",modelMatrix:"mat4x4<f32>",viewProjectionMatrix:"mat4x4<f32>",viewportSize:"vec2<f32>",devicePixelRatio:"f32",focalDistance:"f32",cameraPosition:"vec3<f32>",coordinateOrigin:"vec3<f32>",commonOrigin:"vec3<f32>",pseudoMeters:"f32"}},fX=`
vec4 project_position_to_clipspace(
vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition
) {
vec3 projectedPosition = project_position(position, position64Low);
mat3 rotation;
if (project_needs_rotation(projectedPosition, rotation)) {
// offset is specified as ENU
// when in globe projection, rotate offset so that the ground alighs with the surface of the globe
offset = rotation * offset;
}
commonPosition = vec4(projectedPosition + offset, 1.0);
return project_common_position_to_clipspace(commonPosition);
}
vec4 project_position_to_clipspace(
vec3 position, vec3 position64Low, vec3 offset
) {
vec4 commonPosition;
return project_position_to_clipspace(position, position64Low, offset, commonPosition);
}
`,vO={name:"project32",dependencies:[Ob],vs:fX};function dX(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function oc(t,e){const n=td([],e,t);return Pj(n,n,1/n[3]),n}function WA(t,e){const n=t%e;return n<0?e+n:n}function vy(t,e,n){return t<e?e:t>n?n:t}function hX(t){return Math.log(t)*Math.LOG2E}const Pb=Math.log2||hX;function Ws(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const Gi=Math.PI,_O=Gi/4,Ni=Gi/180,_y=180/Gi,Fc=512,Ng=4003e4,XA=85.051129,gX=1.5;function pX(t){return Pb(t)}function Ig(t){const[e,n]=t;Ws(Number.isFinite(e)),Ws(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");const r=e*Ni,i=n*Ni,s=Fc*(r+Gi)/(2*Gi),l=Fc*(Gi+Math.log(Math.tan(_O+i*.5)))/(2*Gi);return[s,l]}function kc(t){const[e,n]=t,r=e/Fc*(2*Gi)-Gi,i=2*(Math.atan(Math.exp(n/Fc*(2*Gi)-Gi))-_O);return[r*_y,i*_y]}function mX(t){const{latitude:e}=t;Ws(Number.isFinite(e));const n=Math.cos(e*Ni);return pX(Ng*n)-9}function y0(t){const e=Math.cos(t*Ni);return Fc/Ng/e}function yy(t){const{latitude:e,longitude:n,highPrecision:r=!1}=t;Ws(Number.isFinite(e)&&Number.isFinite(n));const i=Fc,s=Math.cos(e*Ni),l=i/360,c=l/s,f=i/Ng/s,d={unitsPerMeter:[f,f,f],metersPerUnit:[1/f,1/f,1/f],unitsPerDegree:[l,c,f],degreesPerUnit:[1/l,1/c,1/f]};if(r){const g=Ni*Math.tan(e*Ni)/s,m=l*g/2,v=i/Ng*g,S=v/c*f;d.unitsPerDegree2=[0,m,v],d.unitsPerMeter2=[S,0,S]}return d}function yO(t,e){const[n,r,i]=t,[s,l,c]=e,{unitsPerMeter:f,unitsPerMeter2:d}=yy({longitude:n,latitude:r,highPrecision:!0}),g=Ig(t);g[0]+=s*(f[0]+d[0]*l),g[1]+=l*(f[1]+d[1]*l);const m=kc(g),v=(i||0)+(c||0);return Number.isFinite(i)||Number.isFinite(c)?[m[0],m[1],v]:m}function vX(t){const{height:e,pitch:n,bearing:r,altitude:i,scale:s,center:l}=t,c=dX();Og(c,c,[0,0,-i]),GM(c,c,-n*Ni),JM(c,c,r*Ni);const f=s/e;return Mb(c,c,[f,f,f]),l&&Og(c,c,oj([],l)),c}function _X(t){const{width:e,height:n,altitude:r,pitch:i=0,offset:s,center:l,scale:c,nearZMultiplier:f=1,farZMultiplier:d=1}=t;let{fovy:g=Dg(gX)}=t;r!==void 0&&(g=Dg(r));const m=g*Ni,v=i*Ni,S=bO(g);let E=S;l&&(E+=l[2]*c/Math.cos(v)/n);const w=m*(.5+(s?s[1]:0)/n),b=Math.sin(w)*E/Math.sin(vy(Math.PI/2-v-w,.01,Math.PI-.01)),A=Math.sin(v)*b+E,T=E*10,C=Math.min(A*d,T);return{fov:m,aspect:e/n,focalDistance:S,near:f,far:C}}function Dg(t){return 2*Math.atan(.5/t)*_y}function bO(t){return .5/Math.tan(.5*t*Ni)}function SO(t,e){const[n,r,i=0]=t;return Ws(Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(i)),oc(e,[n,r,i,1])}function Nb(t,e,n=0){const[r,i,s]=t;if(Ws(Number.isFinite(r)&&Number.isFinite(i),"invalid pixel coordinate"),Number.isFinite(s))return oc(e,[r,i,s,1]);const l=oc(e,[r,i,0,1]),c=oc(e,[r,i,1,1]),f=l[2],d=c[2],g=f===d?0:((n||0)-f)/(d-f);return KM([],l,c,g)}function yX(t){const{width:e,height:n,bounds:r,minExtent:i=0,maxZoom:s=24,offset:l=[0,0]}=t,[[c,f],[d,g]]=r,m=bX(t.padding),v=Ig([c,vy(g,-85.051129,XA)]),S=Ig([d,vy(f,-85.051129,XA)]),E=[Math.max(Math.abs(S[0]-v[0]),i),Math.max(Math.abs(S[1]-v[1]),i)],w=[e-m.left-m.right-Math.abs(l[0])*2,n-m.top-m.bottom-Math.abs(l[1])*2];Ws(w[0]>0&&w[1]>0);const b=w[0]/E[0],A=w[1]/E[1],T=(m.right-m.left)/2/b,C=(m.top-m.bottom)/2/A,M=[(S[0]+v[0])/2+T,(S[1]+v[1])/2+C],x=kc(M),N=Math.min(s,Pb(Math.abs(Math.min(b,A))));return Ws(Number.isFinite(N)),{longitude:x[0],latitude:x[1],zoom:N}}function bX(t=0){return typeof t=="number"?{top:t,bottom:t,left:t,right:t}:(Ws(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t)}const qA=Math.PI/180;function SX(t,e=0){const{width:n,height:r,unproject:i}=t,s={targetZ:e},l=i([0,r],s),c=i([n,r],s);let f,d;const g=t.fovy?.5*t.fovy*qA:Math.atan(.5/t.altitude),m=(90-t.pitch)*qA;return g>m-.01?(f=YA(t,0,e),d=YA(t,n,e)):(f=i([0,0],s),d=i([n,0],s)),[l,c,d,f]}function YA(t,e,n){const{pixelUnprojectionMatrix:r}=t,i=oc(r,[e,0,1,1]),s=oc(r,[e,t.height,1,1]),c=(n*t.distanceScales.unitsPerMeter[2]-i[2])/(s[2]-i[2]),f=KM([],i,s,c),d=kc(f);return d.push(n),d}const KA=512;function wX(t){const{width:e,height:n,pitch:r=0}=t;let{longitude:i,latitude:s,zoom:l,bearing:c=0}=t;(i<-180||i>180)&&(i=WA(i+180,360)-180),(c<-180||c>180)&&(c=WA(c+180,360)-180);const f=Pb(n/KA);if(l<=f)l=f,s=0;else{const d=n/2/Math.pow(2,l),g=kc([0,d])[1];if(s<g)s=g;else{const m=kc([0,KA-d])[1];s>m&&(s=m)}}return{width:e,height:n,longitude:i,latitude:s,zoom:l,pitch:r,bearing:c}}const wO=`
uniform shadowUniforms {
bool drawShadowMap;
bool useShadowMap;
vec4 color;
highp int lightId;
float lightCount;
mat4 viewProjectionMatrix0;
mat4 viewProjectionMatrix1;
vec4 projectCenter0;
vec4 projectCenter1;
} shadow;
`,EX=`
const int max_lights = 2;
out vec3 shadow_vPosition[max_lights];
vec4 shadow_setVertexPosition(vec4 position_commonspace) {
mat4 viewProjectionMatrices[max_lights];
viewProjectionMatrices[0] = shadow.viewProjectionMatrix0;
viewProjectionMatrices[1] = shadow.viewProjectionMatrix1;
vec4 projectCenters[max_lights];
projectCenters[0] = shadow.projectCenter0;
projectCenters[1] = shadow.projectCenter1;
if (shadow.drawShadowMap) {
return project_common_position_to_clipspace(position_commonspace, viewProjectionMatrices[shadow.lightId], projectCenters[shadow.lightId]);
}
if (shadow.useShadowMap) {
for (int i = 0; i < max_lights; i++) {
if(i < int(shadow.lightCount)) {
vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, viewProjectionMatrices[i], projectCenters[i]);
shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;
}
}
}
return gl_Position;
}
`,TX=`
${wO}
${EX}
`,AX=`
const int max_lights = 2;
uniform sampler2D shadow_uShadowMap0;
uniform sampler2D shadow_uShadowMap1;
in vec3 shadow_vPosition[max_lights];
const vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);
const vec4 bitUnpackShift = 1.0 / bitPackShift;
const vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
float shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {
vec4 rgbaDepth = texture(shadowMap, position.xy);
float z = dot(rgbaDepth, bitUnpackShift);
return smoothstep(0.001, 0.01, position.z - z);
}
vec4 shadow_filterShadowColor(vec4 color) {
if (shadow.drawShadowMap) {
vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);
rgbaDepth -= rgbaDepth.gbaa * bitMask;
return rgbaDepth;
}
if (shadow.useShadowMap) {
float shadowAlpha = 0.0;
shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);
if(shadow.lightCount > 1.0) {
shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);
}
shadowAlpha *= shadow.color.a / shadow.lightCount;
float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);
return vec4(
mix(color.rgb, shadow.color.rgb, shadowAlpha / blendedAlpha),
blendedAlpha
);
}
return color;
}
`,CX=`
${wO}
${AX}
`,RX=nd(NX),xX=nd(IX),MX=[0,0,0,1],OX=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];function PX(t,e){const[n,r,i]=t,s=Nb([n,r,i],e);return Number.isFinite(i)?s:[s[0],s[1],0]}function NX({viewport:t,center:e}){return new ws(t.viewProjectionMatrix).invert().transform(e)}function IX({viewport:t,shadowMatrices:e}){const n=[],r=t.pixelUnprojectionMatrix,i=t.isGeospatial?void 0:1,s=[[0,0,i],[t.width,0,i],[0,t.height,i],[t.width,t.height,i],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(l=>PX(l,r));for(const l of e){const c=l.clone().translate(new Ss(t.center).negate()),f=s.map(g=>c.transform(g)),d=new ws().ortho({left:Math.min(...f.map(g=>g[0])),right:Math.max(...f.map(g=>g[0])),bottom:Math.min(...f.map(g=>g[1])),top:Math.max(...f.map(g=>g[1])),near:Math.min(...f.map(g=>-g[2])),far:Math.max(...f.map(g=>-g[2]))});n.push(d.multiplyRight(l))}return n}function DX(t){const{shadowEnabled:e=!0,project:n}=t;if(!e||!n||!t.shadowMatrices||!t.shadowMatrices.length)return{drawShadowMap:!1,useShadowMap:!1,shadow_uShadowMap0:t.dummyShadowMap,shadow_uShadowMap1:t.dummyShadowMap};const r=Ob.getUniforms(n),i=RX({viewport:n.viewport,center:r.center}),s=[],l=xX({shadowMatrices:t.shadowMatrices,viewport:n.viewport}).slice();for(let f=0;f<t.shadowMatrices.length;f++){const d=l[f],g=d.clone().translate(new Ss(n.viewport.center).negate());r.coordinateSystem===cn.LNGLAT&&r.projectionMode===ys.WEB_MERCATOR?(l[f]=g,s[f]=i):(l[f]=d.clone().multiplyRight(OX),s[f]=g.transform(i))}const c={drawShadowMap:!!t.drawToShadowMap,useShadowMap:t.shadowMaps?t.shadowMaps.length>0:!1,color:t.shadowColor||MX,lightId:t.shadowLightId||0,lightCount:t.shadowMatrices.length,shadow_uShadowMap0:t.dummyShadowMap,shadow_uShadowMap1:t.dummyShadowMap};for(let f=0;f<l.length;f++)c[`viewProjectionMatrix${f}`]=l[f],c[`projectCenter${f}`]=s[f];for(let f=0;f<2;f++)c[`shadow_uShadowMap${f}`]=t.shadowMaps&&t.shadowMaps[f]||t.dummyShadowMap;return c}const ZA={name:"shadow",dependencies:[Ob],vs:TX,fs:CX,inject:{"vs:DECKGL_FILTER_GL_POSITION":`
position = shadow_setVertexPosition(geometry.position);
`,"fs:DECKGL_FILTER_COLOR":`
color = shadow_filterShadowColor(color);
`},getUniforms:DX,uniformTypes:{drawShadowMap:"f32",useShadowMap:"f32",color:"vec4<f32>",lightId:"i32",lightCount:"f32",viewProjectionMatrix0:"mat4x4<f32>",viewProjectionMatrix1:"mat4x4<f32>",projectCenter0:"vec4<f32>",projectCenter1:"vec4<f32>"}},EO={...CA,defaultUniforms:{...CA.defaultUniforms,useFloatColors:!1},inject:{"vs:DECKGL_FILTER_GL_POSITION":`
// for picking depth values
picking_setPickingAttribute(position.z / position.w);
`,"vs:DECKGL_FILTER_COLOR":`
picking_setPickingColor(geometry.pickingColor);
`,"fs:DECKGL_FILTER_COLOR":{order:99,injection:`
// use highlight color if this fragment belongs to the selected object.
color = picking_filterHighlightColor(color);
// use picking color if rendering to picking FBO.
color = picking_filterPickingColor(color);
`}}},FX=[oO],kX=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function BX(){const t=bg.getDefaultShaderAssembler();for(const e of FX)t.addDefaultModule(e);for(const e of kX)t.addShaderHook(e);return t}const UX=[255,255,255],LX=1;let zX=0;class $X{constructor(e={}){this.type="ambient";const{color:n=UX}=e,{intensity:r=LX}=e;this.id=e.id||`ambient-${zX++}`,this.color=n,this.intensity=r}}const VX=[255,255,255],HX=1,jX=[0,0,-1];let WX=0;class QA{constructor(e={}){this.type="directional";const{color:n=VX}=e,{intensity:r=HX}=e,{direction:i=jX}=e,{_shadow:s=!1}=e;this.id=e.id||`directional-${WX++}`,this.color=n,this.intensity=r,this.type="directional",this.direction=new Ss(i).normalize().toArray(),this.shadow=s}getProjectedLight(e){return this}}class XX{constructor(e,n={id:"pass"}){const{id:r}=n;this.id=r,this.device=e,this.props={...n}}setProps(e){Object.assign(this.props,e)}render(e){}cleanup(){}}class Ib extends XX{constructor(){super(...arguments),this._lastRenderIndex=-1}render(e){const[n,r]=this.device.canvasContext.getDrawingBufferSize(),i=e.clearCanvas??!0,s=e.clearColor??(i?[0,0,0,0]:!1),l=i?1:!1,c=i?0:!1,f=e.colorMask??15,d={viewport:[0,0,n,r]};e.colorMask&&(d.colorMask=f),e.scissorRect&&(d.scissorRect=e.scissorRect);const g=this.device.beginRenderPass({framebuffer:e.target,parameters:d,clearColor:s,clearDepth:l,clearStencil:c});try{return this._drawLayers(g,e)}finally{g.end()}}_drawLayers(e,n){const{target:r,shaderModuleProps:i,viewports:s,views:l,onViewportActive:c,clearStack:f=!0}=n;n.pass=n.pass||"unknown",f&&(this._lastRenderIndex=-1);const d=[];for(const g of s){const m=l&&l[g.id];c==null||c(g);const v=this._getDrawLayerParams(g,n),S=g.subViewports||[g];for(const E of S){const w=this._drawLayersInViewport(e,{target:r,shaderModuleProps:i,viewport:E,view:m,pass:n.pass,layers:n.layers},v);d.push(w)}}return d}_getDrawLayerParams(e,{layers:n,pass:r,isPicking:i=!1,layerFilter:s,cullRect:l,effects:c,shaderModuleProps:f},d=!1){var E;const g=[],m=TO(this._lastRenderIndex+1),v={layer:n[0],viewport:e,isPicking:i,renderPass:r,cullRect:l},S={};for(let w=0;w<n.length;w++){const b=n[w],A=this._shouldDrawLayer(b,v,s,S),T={shouldDrawLayer:A};A&&!d&&(T.shouldDrawLayer=!0,T.layerRenderIndex=m(b,A),T.shaderModuleProps=this._getShaderModuleProps(b,c,r,f),T.layerParameters={...(E=b.context.deck)==null?void 0:E.props.parameters,...this.getLayerParameters(b,w,e)}),g[w]=T}return g}_drawLayersInViewport(e,{layers:n,shaderModuleProps:r,pass:i,target:s,viewport:l,view:c},f){const d=qX(this.device,{shaderModuleProps:r,target:s,viewport:l});if(c&&c.props.clear){const m=c.props.clear===!0?{color:!0,depth:!0}:c.props.clear;this.device.beginRenderPass({framebuffer:s,parameters:{viewport:d,scissorRect:d},clearColor:m.color?[0,0,0,0]:!1,clearDepth:m.depth?1:!1}).end()}const g={totalCount:n.length,visibleCount:0,compositeCount:0,pickableCount:0};e.setParameters({viewport:d});for(let m=0;m<n.length;m++){const v=n[m],S=f[m],{shouldDrawLayer:E}=S;if(E&&v.props.pickable&&g.pickableCount++,v.isComposite&&g.compositeCount++,v.isDrawable&&S.shouldDrawLayer){const{layerRenderIndex:w,shaderModuleProps:b,layerParameters:A}=S;g.visibleCount++,this._lastRenderIndex=Math.max(this._lastRenderIndex,w),b.project&&(b.project.viewport=l),v.context.renderPass=e;try{v._drawLayer({renderPass:e,shaderModuleProps:b,uniforms:{layerIndex:w},parameters:A})}catch(T){v.raiseError(T,`drawing ${v} to ${i}`)}}}return g}shouldDrawLayer(e){return!0}getShaderModuleProps(e,n,r){return null}getLayerParameters(e,n,r){return e.props.parameters}_shouldDrawLayer(e,n,r,i){if(!(e.props.visible&&this.shouldDrawLayer(e)))return!1;n.layer=e;let l=e.parent;for(;l;){if(!l.props.visible||!l.filterSubLayer(n))return!1;n.layer=l,l=l.parent}if(r){const c=n.layer.id;if(c in i||(i[c]=r(n)),!i[c])return!1}return e.activateViewport(n.viewport),!0}_getShaderModuleProps(e,n,r,i){var f,d;const s=this.device.canvasContext.cssToDeviceRatio(),l=((f=e.internalState)==null?void 0:f.propsInTransition)||e.props,c={layer:l,picking:{isActive:!1},project:{viewport:e.context.viewport,devicePixelRatio:s,modelMatrix:l.modelMatrix,coordinateSystem:l.coordinateSystem,coordinateOrigin:l.coordinateOrigin,autoWrapLongitude:e.wrapLongitude}};if(n)for(const g of n)GA(c,(d=g.getShaderModuleProps)==null?void 0:d.call(g,e,c));return GA(c,this.getShaderModuleProps(e,n,c),i)}}function TO(t=0,e={}){const n={},r=(i,s)=>{const l=i.props._offset,c=i.id,f=i.parent&&i.parent.id;let d;if(f&&!(f in e)&&r(i.parent,!1),f in n){const g=n[f]=n[f]||TO(e[f],e);d=g(i,s),n[c]=g}else Number.isFinite(l)?(d=l+(e[f]||0),n[c]=null):d=t;return s&&d>=t&&(t=d+1),e[c]=d,d};return r}function qX(t,{shaderModuleProps:e,target:n,viewport:r}){var f;const i=((f=e==null?void 0:e.project)==null?void 0:f.devicePixelRatio)??t.canvasContext.cssToDeviceRatio(),[,s]=t.canvasContext.getDrawingBufferSize(),l=n?n.height:s,c=r;return[c.x*i,l-(c.y+c.height)*i,c.width*i,c.height*i]}function GA(t,...e){for(const n of e)if(n)for(const r in n)t[r]?Object.assign(t[r],n[r]):t[r]=n[r];return t}class YX extends Ib{constructor(e,n){super(e,n);const r=e.createTexture({format:"rgba8unorm",width:1,height:1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},mipmaps:!0}),i=e.createTexture({format:"depth16unorm",width:1,height:1,mipmaps:!1});this.fbo=e.createFramebuffer({id:"shadowmap",width:1,height:1,colorAttachments:[r],depthStencilAttachment:i})}delete(){this.fbo&&(this.fbo.destroy(),this.fbo=null)}getShadowMap(){return this.fbo.colorAttachments[0].texture}render(e){const n=this.fbo,r=this.device.canvasContext.cssToDeviceRatio(),i=e.viewports[0],s=i.width*r,l=i.height*r,c=[1,1,1,1];(s!==n.width||l!==n.height)&&n.resize({width:s,height:l}),super.render({...e,clearColor:c,target:n,pass:"shadow"})}getLayerParameters(e,n,r){return{...e.props.parameters,blend:!1,depthWriteEnabled:!0,depthCompare:"less-equal"}}shouldDrawLayer(e){return e.props.shadowEnabled!==!1}getShaderModuleProps(e,n,r){return{shadow:{project:r.project,drawToShadowMap:!0}}}}const KX={color:[255,255,255],intensity:1},JA=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],ZX=[0,0,0,200/255];class AO{constructor(e={}){this.id="lighting-effect",this.shadowColor=ZX,this.shadow=!1,this.directionalLights=[],this.pointLights=[],this.shadowPasses=[],this.dummyShadowMap=null,this.setProps(e)}setup(e){this.context=e;const{device:n,deck:r}=e;this.shadow&&!this.dummyShadowMap&&(this._createShadowPasses(n),r._addDefaultShaderModule(ZA),this.dummyShadowMap=n.createTexture({width:1,height:1}))}setProps(e){this.ambientLight=void 0,this.directionalLights=[],this.pointLights=[];for(const n in e){const r=e[n];switch(r.type){case"ambient":this.ambientLight=r;break;case"directional":this.directionalLights.push(r);break;case"point":this.pointLights.push(r);break}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(n=>n.shadow),this.context&&this.setup(this.context),this.props=e}preRender({layers:e,layerFilter:n,viewports:r,onViewportActive:i,views:s}){if(this.shadow){this.shadowMatrices=this._calculateMatrices();for(let l=0;l<this.shadowPasses.length;l++)this.shadowPasses[l].render({layers:e,layerFilter:n,viewports:r,onViewportActive:i,views:s,shaderModuleProps:{shadow:{shadowLightId:l,dummyShadowMap:this.dummyShadowMap,shadowMatrices:this.shadowMatrices}}})}}getShaderModuleProps(e,n){const r=this.shadow?{project:n.project,shadowMaps:this.shadowPasses.map(l=>l.getShadowMap()),dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{},i={enabled:!0,ambientLight:this.ambientLight,directionalLights:this.directionalLights.map(l=>l.getProjectedLight({layer:e})),pointLights:this.pointLights.map(l=>l.getProjectedLight({layer:e}))},s=e.props.material;return{shadow:r,lighting:i,phongMaterial:s,gouraudMaterial:s}}cleanup(e){for(const n of this.shadowPasses)n.delete();this.shadowPasses.length=0,this.dummyShadowMap&&(this.dummyShadowMap.destroy(),this.dummyShadowMap=null,e.deck._removeDefaultShaderModule(ZA))}_calculateMatrices(){const e=[];for(const n of this.directionalLights){const r=new ws().lookAt({eye:new Ss(n.direction).negate()});e.push(r)}return e}_createShadowPasses(e){for(let n=0;n<this.directionalLights.length;n++){const r=new YX(e);this.shadowPasses[n]=r}}_applyDefaultLights(){const{ambientLight:e,pointLights:n,directionalLights:r}=this;!e&&n.length===0&&r.length===0&&(this.ambientLight=new $X(KX),this.directionalLights.push(new QA(JA[0]),new QA(JA[1])))}}class QX{constructor(e={}){this._pool=[],this.opts={overAlloc:2,poolSize:100},this.setOptions(e)}setOptions(e){Object.assign(this.opts,e)}allocate(e,n,{size:r=1,type:i,padding:s=0,copy:l=!1,initialize:c=!1,maxCount:f}){const d=i||e&&e.constructor||Float32Array,g=n*r+s;if(ArrayBuffer.isView(e)){if(g<=e.length)return e;if(g*e.BYTES_PER_ELEMENT<=e.buffer.byteLength)return new d(e.buffer,0,g)}let m=1/0;f&&(m=f*r+s);const v=this._allocate(d,g,c,m);return e&&l?v.set(e):c||v.fill(0,0,4),this._release(e),v}release(e){this._release(e)}_allocate(e,n,r,i){let s=Math.max(Math.ceil(n*this.opts.overAlloc),1);s>i&&(s=i);const l=this._pool,c=e.BYTES_PER_ELEMENT*s,f=l.findIndex(d=>d.byteLength>=c);if(f>=0){const d=new e(l.splice(f,1)[0],0,s);return r&&d.fill(0),d}return new e(s)}_release(e){if(!ArrayBuffer.isView(e))return;const n=this._pool,{buffer:r}=e,{byteLength:i}=r,s=n.findIndex(l=>l.byteLength>=i);s<0?n.push(r):(s>0||n.length<this.opts.poolSize)&&n.splice(s,0,r),n.length>this.opts.poolSize&&n.shift()}}const Bf=new QX;function Gu(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function GX(t){return[t[12],t[13],t[14]]}function JX(t){return{left:jl(t[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:jl(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:jl(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:jl(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:jl(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),far:jl(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}}const eC=new Ss;function jl(t,e,n,r){eC.set(t,e,n);const i=eC.len();return{distance:r/i,normal:new Ss(-t/i,-e/i,-n/i)}}function eq(t){return t-Math.fround(t)}let Xu;function b0(t,e){const{size:n=1,startIndex:r=0}=e,i=e.endIndex!==void 0?e.endIndex:t.length,s=(i-r)/n;Xu=Bf.allocate(Xu,s,{type:Float32Array,size:n*2});let l=r,c=0;for(;l<i;){for(let f=0;f<n;f++){const d=t[l++];Xu[c+f]=d,Xu[c+f+n]=eq(d)}c+=n*2}return Xu.subarray(0,s*n*2)}function tq(t){let e=null,n=!1;for(const r of t)r&&(e?(n||(e=[[e[0][0],e[0][1]],[e[1][0],e[1][1]]],n=!0),e[0][0]=Math.min(e[0][0],r[0][0]),e[0][1]=Math.min(e[0][1],r[0][1]),e[1][0]=Math.max(e[1][0],r[1][0]),e[1][1]=Math.max(e[1][1],r[1][1])):e=r);return e}const nq=Math.PI/180,rq=Gu(),tC=[0,0,0],iq={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};function sq({width:t,height:e,orthographic:n,fovyRadians:r,focalDistance:i,padding:s,near:l,far:c}){const f=t/e,d=n?new ws().orthographic({fovy:r,aspect:f,focalDistance:i,near:l,far:c}):new ws().perspective({fovy:r,aspect:f,near:l,far:c});if(s){const{left:g=0,right:m=0,top:v=0,bottom:S=0}=s,E=ka((g+t-m)/2,0,t)-t/2,w=ka((v+e-S)/2,0,e)-e/2;d[8]-=E*2/t,d[9]+=w*2/e}return d}class rd{constructor(e={}){this._frustumPlanes={},this.id=e.id||this.constructor.displayName||"viewport",this.x=e.x||0,this.y=e.y||0,this.width=e.width||1,this.height=e.height||1,this.zoom=e.zoom||0,this.padding=e.padding,this.distanceScales=e.distanceScales||iq,this.focalDistance=e.focalDistance||1,this.position=e.position||tC,this.modelMatrix=e.modelMatrix||null;const{longitude:n,latitude:r}=e;this.isGeospatial=Number.isFinite(r)&&Number.isFinite(n),this._initProps(e),this._initMatrices(e),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get subViewports(){return null}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?ys.WEB_MERCATOR:ys.WEB_MERCATOR_AUTO_OFFSET:ys.IDENTITY}equals(e){return e instanceof rd?this===e?!0:e.width===this.width&&e.height===this.height&&e.scale===this.scale&&Ff(e.projectionMatrix,this.projectionMatrix)&&Ff(e.viewMatrix,this.viewMatrix):!1}project(e,{topLeft:n=!0}={}){const r=this.projectPosition(e),i=SO(r,this.pixelProjectionMatrix),[s,l]=i,c=n?l:this.height-l;return e.length===2?[s,c]:[s,c,i[2]]}unproject(e,{topLeft:n=!0,targetZ:r}={}){const[i,s,l]=e,c=n?s:this.height-s,f=r&&r*this.distanceScales.unitsPerMeter[2],d=Nb([i,c,l],this.pixelUnprojectionMatrix,f),[g,m,v]=this.unprojectPosition(d);return Number.isFinite(l)?[g,m,v]:Number.isFinite(r)?[g,m,r]:[g,m]}projectPosition(e){const[n,r]=this.projectFlat(e),i=(e[2]||0)*this.distanceScales.unitsPerMeter[2];return[n,r,i]}unprojectPosition(e){const[n,r]=this.unprojectFlat(e),i=(e[2]||0)*this.distanceScales.metersPerUnit[2];return[n,r,i]}projectFlat(e){if(this.isGeospatial){const n=Ig(e);return n[1]=ka(n[1],-318,830),n}return e}unprojectFlat(e){return this.isGeospatial?kc(e):e}getBounds(e={}){const n={targetZ:e.z||0},r=this.unproject([0,0],n),i=this.unproject([this.width,0],n),s=this.unproject([0,this.height],n),l=this.unproject([this.width,this.height],n);return[Math.min(r[0],i[0],s[0],l[0]),Math.min(r[1],i[1],s[1],l[1]),Math.max(r[0],i[0],s[0],l[0]),Math.max(r[1],i[1],s[1],l[1])]}getDistanceScales(e){return e&&this.isGeospatial?yy({longitude:e[0],latitude:e[1],highPrecision:!0}):this.distanceScales}containsPixel({x:e,y:n,width:r=1,height:i=1}){return e<this.x+this.width&&this.x<e+r&&n<this.y+this.height&&this.y<n+i}getFrustumPlanes(){return this._frustumPlanes.near?this._frustumPlanes:(Object.assign(this._frustumPlanes,JX(this.viewProjectionMatrix)),this._frustumPlanes)}panByPosition(e,n){return null}_initProps(e){const n=e.longitude,r=e.latitude;this.isGeospatial&&(Number.isFinite(e.zoom)||(this.zoom=mX({latitude:r})+Math.log2(this.focalDistance)),this.distanceScales=e.distanceScales||yy({latitude:r,longitude:n}));const i=Math.pow(2,this.zoom);this.scale=i;const{position:s,modelMatrix:l}=e;let c=tC;if(s&&(c=l?new ws(l).transformAsVector(s,[]):s),this.isGeospatial){const f=this.projectPosition([n,r,0]);this.center=new Ss(c).scale(this.distanceScales.unitsPerMeter).add(f)}else this.center=this.projectPosition(c)}_initMatrices(e){const{viewMatrix:n=rq,projectionMatrix:r=null,orthographic:i=!1,fovyRadians:s,fovy:l=75,near:c=.1,far:f=1e3,padding:d=null,focalDistance:g=1}=e;this.viewMatrixUncentered=n,this.viewMatrix=new ws().multiplyRight(n).translate(new Ss(this.center).negate()),this.projectionMatrix=r||sq({width:this.width,height:this.height,orthographic:i,fovyRadians:s||l*nq,focalDistance:g,padding:d,near:c,far:f});const m=Gu();Bo(m,m,this.projectionMatrix),Bo(m,m,this.viewMatrix),this.viewProjectionMatrix=m,this.viewMatrixInverse=uy([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=GX(this.viewMatrixInverse);const v=Gu(),S=Gu();Mb(v,v,[this.width/2,-this.height/2,1]),Og(v,v,[1,-1,0]),Bo(S,v,this.viewProjectionMatrix),this.pixelProjectionMatrix=S,this.pixelUnprojectionMatrix=uy(Gu(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||Sn.warn("Pixel project matrix not invertible")()}}rd.displayName="Viewport";class Bc extends rd{constructor(e={}){const{latitude:n=0,longitude:r=0,zoom:i=0,pitch:s=0,bearing:l=0,nearZMultiplier:c=.1,farZMultiplier:f=1.01,nearZ:d,farZ:g,orthographic:m=!1,projectionMatrix:v,repeat:S=!1,worldOffset:E=0,position:w,padding:b,legacyMeterSizes:A=!1}=e;let{width:T,height:C,altitude:M=1.5}=e;const x=Math.pow(2,i);T=T||1,C=C||1;let N,F=null;if(v)M=v[5]/2,N=Dg(M);else{e.fovy?(N=e.fovy,M=bO(N)):N=Dg(M);let I;if(b){const{top:V=0,bottom:B=0}=b;I=[0,ka((V+C-B)/2,0,C)-C/2]}F=_X({width:T,height:C,scale:x,center:w&&[0,0,w[2]*y0(n)],offset:I,pitch:s,fovy:N,nearZMultiplier:c,farZMultiplier:f}),Number.isFinite(d)&&(F.near=d),Number.isFinite(g)&&(F.far=g)}let L=vX({height:C,pitch:s,bearing:l,scale:x,altitude:M});E&&(L=new ws().translate([512*E,0,0]).multiplyLeft(L)),super({...e,width:T,height:C,viewMatrix:L,longitude:r,latitude:n,zoom:i,...F,fovy:N,focalDistance:M}),this.latitude=n,this.longitude=r,this.zoom=i,this.pitch=s,this.bearing=l,this.altitude=M,this.fovy=N,this.orthographic=m,this._subViewports=S?[]:null,this._pseudoMeters=A,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const e=this.getBounds(),n=Math.floor((e[0]+180)/360),r=Math.ceil((e[2]-180)/360);for(let i=n;i<=r;i++){const s=i?new Bc({...this,worldOffset:i}):this;this._subViewports.push(s)}}return this._subViewports}projectPosition(e){if(this._pseudoMeters)return super.projectPosition(e);const[n,r]=this.projectFlat(e),i=(e[2]||0)*y0(e[1]);return[n,r,i]}unprojectPosition(e){if(this._pseudoMeters)return super.unprojectPosition(e);const[n,r]=this.unprojectFlat(e),i=(e[2]||0)/y0(r);return[n,r,i]}addMetersToLngLat(e,n){return yO(e,n)}panByPosition(e,n){const r=Nb(n,this.pixelUnprojectionMatrix),i=this.projectFlat(e),s=TA([],i,tj([],r)),l=TA([],this.center,s),[c,f]=this.unprojectFlat(l);return{longitude:c,latitude:f}}getBounds(e={}){const n=SX(this,e.z||0);return[Math.min(n[0][0],n[1][0],n[2][0],n[3][0]),Math.min(n[0][1],n[1][1],n[2][1],n[3][1]),Math.max(n[0][0],n[1][0],n[2][0],n[3][0]),Math.max(n[0][1],n[1][1],n[2][1],n[3][1])]}fitBounds(e,n={}){const{width:r,height:i}=this,{longitude:s,latitude:l,zoom:c}=yX({width:r,height:i,bounds:e,...n});return new Bc({width:r,height:i,longitude:s,latitude:l,zoom:c})}}Bc.displayName="WebMercatorViewport";const nC=[0,0,0];function S0(t,e,n=!1){const r=e.projectPosition(t);if(n&&e instanceof Bc){const[i,s,l=0]=t,c=e.getDistanceScales([i,s]);r[2]=l*c.unitsPerMeter[2]}return r}function aq(t){const{viewport:e,modelMatrix:n,coordinateOrigin:r}=t;let{coordinateSystem:i,fromCoordinateSystem:s,fromCoordinateOrigin:l}=t;return i===cn.DEFAULT&&(i=e.isGeospatial?cn.LNGLAT:cn.CARTESIAN),s===void 0&&(s=i),l===void 0&&(l=r),{viewport:e,coordinateSystem:i,coordinateOrigin:r,modelMatrix:n,fromCoordinateSystem:s,fromCoordinateOrigin:l}}function CO(t,{viewport:e,modelMatrix:n,coordinateSystem:r,coordinateOrigin:i,offsetMode:s}){let[l,c,f=0]=t;switch(n&&([l,c,f]=td([],[l,c,f,1],n)),r){case cn.LNGLAT:return S0([l,c,f],e,s);case cn.LNGLAT_OFFSETS:return S0([l+i[0],c+i[1],f+(i[2]||0)],e,s);case cn.METER_OFFSETS:return S0(yO(i,[l,c,f]),e,s);case cn.CARTESIAN:default:return e.isGeospatial?[l+i[0],c+i[1],f+i[2]]:e.projectPosition([l,c,f])}}function oq(t,e){const{viewport:n,coordinateSystem:r,coordinateOrigin:i,modelMatrix:s,fromCoordinateSystem:l,fromCoordinateOrigin:c}=aq(e),{autoOffset:f=!0}=e,{geospatialOrigin:d=nC,shaderCoordinateOrigin:g=nC,offsetMode:m=!1}=f?mO(n,r,i):{},v=CO(t,{viewport:n,modelMatrix:s,coordinateSystem:l,coordinateOrigin:c,offsetMode:m});if(m){const S=n.projectPosition(d||g);mj(v,v,S)}return v}let lq=1,cq=1;class RO{constructor(){O(this,"time",0);O(this,"channels",new Map);O(this,"animations",new Map);O(this,"playing",!1);O(this,"lastEngineTime",-1)}addChannel(e){const{delay:n=0,duration:r=Number.POSITIVE_INFINITY,rate:i=1,repeat:s=1}=e,l=lq++,c={time:0,delay:n,duration:r,rate:i,repeat:s};return this._setChannelTime(c,this.time),this.channels.set(l,c),l}removeChannel(e){this.channels.delete(e);for(const[n,r]of this.animations)r.channel===e&&this.detachAnimation(n)}isFinished(e){const n=this.channels.get(e);return n===void 0?!1:this.time>=n.delay+n.duration*n.repeat}getTime(e){if(e===void 0)return this.time;const n=this.channels.get(e);return n===void 0?-1:n.time}setTime(e){this.time=Math.max(0,e);const n=this.channels.values();for(const i of n)this._setChannelTime(i,this.time);const r=this.animations.values();for(const i of r){const{animation:s,channel:l}=i;s.setTime(this.getTime(l))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,n){const r=cq++;return this.animations.set(r,{animation:e,channel:n}),e.setTime(this.getTime(n)),r}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(this.lastEngineTime===-1&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,n){const r=n-e.delay,i=e.duration*e.repeat;r>=i?e.time=e.duration*e.rate:(e.time=Math.max(0,r)%e.duration,e.time*=e.rate)}}function uq(t){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}function fq(t){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}let dq=0;const hq={device:null,onAddHTML:()=>"",onInitialize:async()=>null,onRender:()=>{},onFinalize:()=>{},onError:t=>console.error(t),stats:J_.stats.get(`animation-loop-${dq++}`),useDevicePixels:!0,autoResizeViewport:!1,autoResizeDrawingBuffer:!1};class gq{constructor(e){O(this,"device",null);O(this,"canvas",null);O(this,"props");O(this,"animationProps",null);O(this,"timeline",null);O(this,"stats");O(this,"cpuTime");O(this,"gpuTime");O(this,"frameRate");O(this,"display");O(this,"needsRedraw","initialized");O(this,"_initialized",!1);O(this,"_running",!1);O(this,"_animationFrameId",null);O(this,"_nextFramePromise",null);O(this,"_resolveNextFrame",null);O(this,"_cpuStartTime",0);O(this,"_error",null);if(this.props={...hq,...e},e=this.props,!e.device)throw new Error("No device provided");const{useDevicePixels:n=!0}=this.props;this.stats=e.stats||new ip({id:"animation-loop-stats"}),this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this.setProps({autoResizeViewport:e.autoResizeViewport,autoResizeDrawingBuffer:e.autoResizeDrawingBuffer,useDevicePixels:n}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}destroy(){this.stop(),this._setDisplay(null)}delete(){this.destroy()}setError(e){var r,i;if(this.props.onError(e),this._error=Error(),((i=(r=this.device)==null?void 0:r.canvasContext)==null?void 0:i.canvas)instanceof HTMLCanvasElement){const s=document.createElement("h1");s.innerHTML=e.message,s.style.position="absolute",s.style.top="20%",s.style.left="10px",s.style.color="black",s.style.backgroundColor="red",document.body.appendChild(s)}}setNeedsRedraw(e){return this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.props.autoResizeViewport=e.autoResizeViewport||!1),"autoResizeDrawingBuffer"in e&&(this.props.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer||!1),"useDevicePixels"in e&&(this.props.useDevicePixels=e.useDevicePixels||!1),this}async start(){if(this._running)return this;this._running=!0;try{let e;return this._initialized||(this._initialized=!0,await this._initDevice(),this._initialize(),await this.props.onInitialize(this._getAnimationProps())),this._running?(e!==!1&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),this):null}catch(e){const n=e instanceof Error?e:new Error("Unknown error");throw this.props.onError(n),n}}stop(){return this._running&&(this.animationProps&&!this._error&&this.props.onFinalize(this.animationProps),this._cancelAnimationFrame(),this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1),this}redraw(){var e;return(e=this.device)!=null&&e.isLost||this._error?this:(this._beginFrameTimers(),this._setupFrame(),this._updateAnimationProps(),this._renderFrame(this._getAnimationProps()),this._clearNeedsRedraw(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endFrameTimers(),this)}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}async toDataURL(){if(this.setNeedsRedraw("toDataURL"),await this.waitForRender(),this.canvas instanceof HTMLCanvasElement)return this.canvas.toDataURL();throw new Error("OffscreenCanvas")}_initialize(){this._startEventHandling(),this._initializeAnimationProps(),this._updateAnimationProps(),this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_setDisplay(e){this.display&&(this.display.destroy(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_requestAnimationFrame(){this._running&&(this._animationFrameId=uq(this._animationFrame.bind(this)))}_cancelAnimationFrame(){this._animationFrameId!==null&&(fq(this._animationFrameId),this._animationFrameId=null)}_animationFrame(){this._running&&(this.redraw(),this._requestAnimationFrame())}_renderFrame(e){var n;if(this.display){this.display._renderFrame(e);return}this.props.onRender(this._getAnimationProps()),(n=this.device)==null||n.submit()}_clearNeedsRedraw(){this.needsRedraw=!1}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_initializeAnimationProps(){var n,r;const e=(r=(n=this.device)==null?void 0:n.canvasContext)==null?void 0:r.canvas;if(!this.device||!e)throw new Error("loop");this.animationProps={animationLoop:this,device:this.device,canvas:e,timeline:this.timeline,useDevicePixels:this.props.useDevicePixels,needsRedraw:!1,width:1,height:1,aspect:1,time:0,startTime:Date.now(),engineTime:0,tick:0,tock:0,_mousePosition:null}}_getAnimationProps(){if(!this.animationProps)throw new Error("animationProps");return this.animationProps}_updateAnimationProps(){if(!this.animationProps)return;const{width:e,height:n,aspect:r}=this._getSizeAndAspect();(e!==this.animationProps.width||n!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),r!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=n,this.animationProps.aspect=r,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime}async _initDevice(){var e;if(this.device=await this.props.device,!this.device)throw new Error("No device provided");this.canvas=((e=this.device.canvasContext)==null?void 0:e.canvas)||null}_createInfoDiv(){if(this.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const n=document.createElement("div");n.style.position="absolute",n.style.left="10px",n.style.bottom="10px",n.style.width="300px",n.style.background="white",this.canvas instanceof HTMLCanvasElement&&e.appendChild(this.canvas),e.appendChild(n);const r=this.props.onAddHTML(n);r&&(n.innerHTML=r)}}_getSizeAndAspect(){var s,l,c,f;if(!this.device)return{width:1,height:1,aspect:1};const[e,n]=((l=(s=this.device)==null?void 0:s.canvasContext)==null?void 0:l.getPixelSize())||[1,1];let r=1;const i=(f=(c=this.device)==null?void 0:c.canvasContext)==null?void 0:f.canvas;return i&&i.clientHeight?r=i.clientWidth/i.clientHeight:e>0&&n>0&&(r=e/n),{width:e,height:n,aspect:r}}_resizeViewport(){this.props.autoResizeViewport&&this.device.gl&&this.device.gl.viewport(0,0,this.device.gl.drawingBufferWidth,this.device.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){var e,n;this.props.autoResizeDrawingBuffer&&((n=(e=this.device)==null?void 0:e.canvasContext)==null||n.resize({useDevicePixels:this.props.useDevicePixels}))}_beginFrameTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this.cpuTime.timeStart()}_endFrameTimers(){this.cpuTime.timeEnd()}_startEventHandling(){this.canvas&&(this.canvas.addEventListener("mousemove",this._onMousemove.bind(this)),this.canvas.addEventListener("mouseleave",this._onMouseleave.bind(this)))}_onMousemove(e){e instanceof MouseEvent&&(this._getAnimationProps()._mousePosition=[e.offsetX,e.offsetY])}_onMouseleave(e){this._getAnimationProps()._mousePosition=null}}const w0={};function id(t="id"){w0[t]=w0[t]||1;const e=w0[t]++;return`${t}-${e}`}class rC{constructor(e){O(this,"id");O(this,"userData",{});O(this,"topology");O(this,"bufferLayout",[]);O(this,"vertexCount");O(this,"indices");O(this,"attributes");if(this.id=e.id||id("geometry"),this.topology=e.topology,this.indices=e.indices||null,this.attributes=e.attributes,this.vertexCount=e.vertexCount,this.bufferLayout=e.bufferLayout||[],this.indices&&!(this.indices.usage&$n.INDEX))throw new Error("Index buffer must have INDEX usage")}destroy(){var e;(e=this.indices)==null||e.destroy();for(const n of Object.values(this.attributes))n.destroy()}getVertexCount(){return this.vertexCount}getAttributes(){return this.attributes}getIndexes(){return this.indices||null}_calculateVertexCount(e){return e.byteLength/12}}function pq(t,e){if(e instanceof rC)return e;const n=mq(t,e),{attributes:r,bufferLayout:i}=vq(t,e);return new rC({topology:e.topology||"triangle-list",bufferLayout:i,vertexCount:e.vertexCount,indices:n,attributes:r})}function mq(t,e){if(!e.indices)return;const n=e.indices.value;return t.createBuffer({usage:$n.INDEX,data:n})}function vq(t,e){const n=[],r={};for(const[s,l]of Object.entries(e.attributes)){let c=s;switch(s){case"POSITION":c="positions";break;case"NORMAL":c="normals";break;case"TEXCOORD_0":c="texCoords";break;case"COLOR_0":c="colors";break}if(l){r[c]=t.createBuffer({data:l.value,id:`${s}-buffer`});const{value:f,size:d,normalized:g}=l;n.push({name:c,format:oH(f,d,g)})}}const i=e._calculateVertexCount(e.attributes,e.indices);return{attributes:r,bufferLayout:n,vertexCount:i}}const ep=class ep{constructor(e){O(this,"device");O(this,"destroyPolicy");O(this,"_hashCounter",0);O(this,"_hashes",{});O(this,"_renderPipelineCache",{});O(this,"_computePipelineCache",{});this.device=e,this.destroyPolicy=e.props._factoryDestroyPolicy}static getDefaultPipelineFactory(e){return e._lumaData.defaultPipelineFactory=e._lumaData.defaultPipelineFactory||new ep(e),e._lumaData.defaultPipelineFactory}createRenderPipeline(e){const n={...Pc.defaultProps,...e},r=this._hashRenderPipeline(n);if(!this._renderPipelineCache[r]){const i=this.device.createRenderPipeline({...n,id:n.id?`${n.id}-cached`:void 0});i.hash=r,this._renderPipelineCache[r]={pipeline:i,useCount:0}}return this._renderPipelineCache[r].useCount++,this._renderPipelineCache[r].pipeline}createComputePipeline(e){const n={...Ag.defaultProps,...e},r=this._hashComputePipeline(n);if(!this._computePipelineCache[r]){const i=this.device.createComputePipeline({...n,id:n.id?`${n.id}-cached`:void 0});i.hash=r,this._computePipelineCache[r]={pipeline:i,useCount:0}}return this._computePipelineCache[r].useCount++,this._computePipelineCache[r].pipeline}release(e){const n=e.hash,r=e instanceof Ag?this._computePipelineCache:this._renderPipelineCache;r[n].useCount--,r[n].useCount===0&&this.destroyPolicy==="unused"&&(r[n].pipeline.destroy(),delete r[n])}_hashComputePipeline(e){return`${this._getHash(e.shader.source)}`}_hashRenderPipeline(e){const n=e.vs?this._getHash(e.vs.source):0,r=e.fs?this._getHash(e.fs.source):0,i="-",s=this._getHash(JSON.stringify(e.bufferLayout));switch(this.device.type){case"webgl":return`${n}/${r}V${i}BL${s}`;default:const l=this._getHash(JSON.stringify(e.parameters));return`${n}/${r}V${i}T${e.topology}P${l}BL${s}`}}_getHash(e){return this._hashes[e]===void 0&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}};O(ep,"defaultProps",{...Pc.defaultProps});let by=ep;const tp=class tp{constructor(e){O(this,"device");O(this,"destroyPolicy");O(this,"_cache",{});this.device=e,this.destroyPolicy=e.props._factoryDestroyPolicy}static getDefaultShaderFactory(e){var n;return(n=e._lumaData).defaultShaderFactory||(n.defaultShaderFactory=new tp(e)),e._lumaData.defaultShaderFactory}createShader(e){const n=this._hashShader(e);let r=this._cache[n];if(!r){const i=this.device.createShader({...e,id:e.id?`${e.id}-cached`:void 0});this._cache[n]=r={shader:i,useCount:0}}return r.useCount++,r.shader}release(e){const n=this._hashShader(e),r=this._cache[n];r&&(r.useCount--,r.useCount===0&&this.destroyPolicy==="unused"&&(delete this._cache[n],r.shader.destroy()))}_hashShader(e){return`${e.stage}:${e.source}`}};O(tp,"defaultProps",{...wg.defaultProps});let Sy=tp;function _q(t,e){var i;const n={},r="Values";if(t.attributes.length===0&&!((i=t.varyings)!=null&&i.length))return{"No attributes or varyings":{[r]:"N/A"}};for(const s of t.attributes)if(s){const l=`${s.location} ${s.name}: ${s.type}`;n[`in ${l}`]={[r]:s.stepMode||"vertex"}}for(const s of t.varyings||[]){const l=`${s.location} ${s.name}`;n[`out ${l}`]={[r]:JSON.stringify(s)}}return n}let br=null,ho=null;function yq(t,{id:e,minimap:n,opaque:r,top:i="0",left:s="0",rgbaScale:l=1}){br||(br=document.createElement("canvas"),br.id=e,br.title=e,br.style.zIndex="100",br.style.position="absolute",br.style.top=i,br.style.left=s,br.style.border="blue 5px solid",br.style.transform="scaleY(-1)",document.body.appendChild(br),ho=br.getContext("2d")),(br.width!==t.width||br.height!==t.height)&&(br.width=t.width/2,br.height=t.height/2,br.style.width="400px",br.style.height="400px");const c=t.device.readPixelsToArrayWebGL(t),f=ho==null?void 0:ho.createImageData(t.width,t.height);if(f){for(let g=0;g<c.length;g+=4)f.data[0+g+0]=c[g+0]*l,f.data[0+g+1]=c[g+1]*l,f.data[0+g+2]=c[g+2]*l,f.data[0+g+3]=r?255:c[g+3]*l;ho==null||ho.putImageData(f,0,0)}}function wy(t,e,n){if(t===e)return!0;if(!n||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!wy(t[r],e[r],n-1))return!1;return!0}if(Array.isArray(e))return!1;if(typeof t=="object"&&typeof e=="object"){const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(const s of r)if(!e.hasOwnProperty(s)||!wy(t[s],e[s],n-1))return!1;return!0}return!1}function bq(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Sq(t){return Array.isArray(t)?t.length===0||typeof t[0]=="number":!1}function xO(t){return bq(t)||Sq(t)}function wq(t){return xO(t)||typeof t=="number"||typeof t=="boolean"}function MO(t){const e={bindings:{},uniforms:{}};return Object.keys(t).forEach(n=>{const r=t[n];wq(r)?e.uniforms[n]=r:e.bindings[n]=r}),e}class Eq{constructor(e,n){O(this,"options",{disableWarnings:!1});O(this,"modules");O(this,"moduleUniforms");O(this,"moduleBindings");Object.assign(this.options,n);const r=Rb(Object.values(e).filter(i=>i.dependencies));for(const i of r)e[i.name]=i;Re.log(1,"Creating ShaderInputs with modules",Object.keys(e))(),this.modules=e,this.moduleUniforms={},this.moduleBindings={};for(const[i,s]of Object.entries(e))this._addModule(s),s.name&&i!==s.name&&!this.options.disableWarnings&&Re.warn(`Module name: ${i} vs ${s.name}`)()}destroy(){}setProps(e){var n;for(const r of Object.keys(e)){const i=r,s=e[i]||{},l=this.modules[i];if(!l){this.options.disableWarnings||Re.warn(`Module ${r} not found`)();continue}const c=this.moduleUniforms[i],f=this.moduleBindings[i],d=((n=l.getUniforms)==null?void 0:n.call(l,s,c))||s,{uniforms:g,bindings:m}=MO(d);this.moduleUniforms[i]={...c,...g},this.moduleBindings[i]={...f,...m}}}getModules(){return Object.values(this.modules)}getUniformValues(){return this.moduleUniforms}getBindingValues(){const e={};for(const n of Object.values(this.moduleBindings))Object.assign(e,n);return e}getDebugTable(){var n;const e={};for(const[r,i]of Object.entries(this.moduleUniforms))for(const[s,l]of Object.entries(i))e[`${r}.${s}`]={type:(n=this.modules[r].uniformTypes)==null?void 0:n[s],value:String(l)};return e}_addModule(e){const n=e.name;this.moduleUniforms[n]=e.defaultUniforms||{},this.moduleBindings[n]={}}}let Tq="";async function Aq(t,e){const n=new Image;return n.crossOrigin="anonymous",n.src=t.startsWith("http")?t:Tq+t,await n.decode(),e?await createImageBitmap(n,e):await createImageBitmap(n)}class E0{constructor(e,n){O(this,"device");O(this,"id");O(this,"texture");O(this,"sampler");O(this,"view");O(this,"ready");O(this,"isReady",!1);O(this,"destroyed",!1);O(this,"resolveReady",()=>{});O(this,"rejectReady",()=>{});this.device=e,this.id=n.id||id("async-texture"),typeof(n==null?void 0:n.data)=="string"&&n.dimension==="2d"&&(n={...n,data:Aq(n.data)}),this.ready=new Promise((r,i)=>{this.resolveReady=()=>{this.isReady=!0,r()},this.rejectReady=i}),this.initAsync(n)}get[Symbol.toStringTag](){return"AsyncTexture"}toString(){return`AsyncTexture:"${this.id}"(${this.isReady?"ready":"loading"})`}async initAsync(e){let n,r;const i=e.data,s=await OO(i).then(n,r);if(this.destroyed)return;const l={...e,data:s};this.texture=this.device.createTexture(l),this.sampler=this.texture.sampler,this.view=this.texture.view,this.isReady=!0}destroy(){this.texture&&(this.texture.destroy(),this.texture=null),this.destroyed=!0}resize(e){if(!this.isReady)throw new Error("Cannot resize texture before it is ready");if(e.width===this.texture.width&&e.height===this.texture.height)return!1;if(this.texture){const n=this.texture;this.texture=n.clone(e),n.destroy()}return!0}}async function OO(t){if(t=await t,Array.isArray(t))return await Promise.all(t.map(OO));if(t&&typeof t=="object"&&t.constructor===Object){const e=t,n=await Promise.all(Object.values(e)),r=Object.keys(e),i={};for(let s=0;s<r.length;s++)i[r[s]]=n[s];return i}return t}const go=2,Cq=1e4,np=class np{constructor(e,n){O(this,"device");O(this,"id");O(this,"source");O(this,"vs");O(this,"fs");O(this,"pipelineFactory");O(this,"shaderFactory");O(this,"userData",{});O(this,"parameters");O(this,"topology");O(this,"bufferLayout");O(this,"isInstanced");O(this,"instanceCount",0);O(this,"vertexCount");O(this,"indexBuffer",null);O(this,"bufferAttributes",{});O(this,"constantAttributes",{});O(this,"bindings",{});O(this,"uniforms",{});O(this,"vertexArray");O(this,"transformFeedback",null);O(this,"pipeline");O(this,"shaderInputs");O(this,"_uniformStore");O(this,"_attributeInfos",{});O(this,"_gpuGeometry",null);O(this,"_getModuleUniforms");O(this,"props");O(this,"_pipelineNeedsUpdate","newly created");O(this,"_needsRedraw","initializing");O(this,"_destroyed",!1);O(this,"_lastDrawTimestamp",-1);O(this,"_lastLogTime",0);O(this,"_logOpen",!1);O(this,"_drawCount",0);var f,d,g,m;this.props={...np.defaultProps,...n},n=this.props,this.id=n.id||id("model"),this.device=e,Object.assign(this.userData,n.userData);const r=Object.fromEntries(((f=this.props.modules)==null?void 0:f.map(v=>[v.name,v]))||[]),i=n.shaderInputs||new Eq(r,{disableWarnings:this.props.disableWarnings});this.setShaderInputs(i);const s=xq(e),l=(((d=this.props.modules)==null?void 0:d.length)>0?this.props.modules:(g=this.shaderInputs)==null?void 0:g.getModules())||[];if(this.device.type==="webgpu"&&this.props.source){(m=this.props).shaderLayout||(m.shaderLayout=WH(this.props.source));const{source:v,getUniforms:S}=this.props.shaderAssembler.assembleWGSLShader({platformInfo:s,...this.props,modules:l});this.source=v,this._getModuleUniforms=S}else{const{vs:v,fs:S,getUniforms:E}=this.props.shaderAssembler.assembleGLSLShaderPair({platformInfo:s,...this.props,modules:l});this.vs=v,this.fs=S,this._getModuleUniforms=E}this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,n.geometry&&this.setGeometry(n.geometry),this.pipelineFactory=n.pipelineFactory||by.getDefaultPipelineFactory(this.device),this.shaderFactory=n.shaderFactory||Sy.getDefaultShaderFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=e.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),"isInstanced"in n&&(this.isInstanced=n.isInstanced),n.instanceCount&&this.setInstanceCount(n.instanceCount),n.vertexCount&&this.setVertexCount(n.vertexCount),n.indexBuffer&&this.setIndexBuffer(n.indexBuffer),n.attributes&&this.setAttributes(n.attributes),n.constantAttributes&&this.setConstantAttributes(n.constantAttributes),n.bindings&&this.setBindings(n.bindings),n.uniforms&&this.setUniformsWebGL(n.uniforms),n.moduleSettings&&this.updateModuleSettingsWebGL(n.moduleSettings),n.transformFeedback&&(this.transformFeedback=n.transformFeedback),Object.seal(this)}get[Symbol.toStringTag](){return"Model"}toString(){return`Model(${this.id})`}destroy(){var e;this._destroyed||(this.pipelineFactory.release(this.pipeline),this.shaderFactory.release(this.pipeline.vs),this.pipeline.fs&&this.shaderFactory.release(this.pipeline.fs),this._uniformStore.destroy(),(e=this._gpuGeometry)==null||e.destroy(),this._destroyed=!0)}needsRedraw(){this._getBindingsUpdateTimestamp()>this._lastDrawTimestamp&&this.setNeedsRedraw("contents of bound textures or buffers updated");const e=this._needsRedraw;return this._needsRedraw=!1,e}setNeedsRedraw(e){this._needsRedraw||(this._needsRedraw=e)}predraw(){this.updateShaderInputs(),this.pipeline=this._updatePipeline()}draw(e){const n=this._areBindingsLoading();if(n)return Re.info(go,`>>> DRAWING ABORTED ${this.id}: ${n} not loaded`)(),!1;try{e.pushDebugGroup(`${this}.predraw(${e})`),this.predraw()}finally{e.popDebugGroup()}let r;try{e.pushDebugGroup(`${this}.draw(${e})`),this._logDrawCallStart(),this.pipeline=this._updatePipeline();const i=this._getBindings();this.pipeline.setBindings(i,{disableWarnings:this.props.disableWarnings}),Ey(this.uniforms)||this.pipeline.setUniformsWebGL(this.uniforms);const{indexBuffer:s}=this.vertexArray,l=s?s.byteLength/(s.indexType==="uint32"?4:2):void 0;r=this.pipeline.draw({renderPass:e,vertexArray:this.vertexArray,isInstanced:this.isInstanced,vertexCount:this.vertexCount,instanceCount:this.instanceCount,indexCount:l,transformFeedback:this.transformFeedback||void 0,parameters:this.parameters,topology:this.topology})}finally{e.popDebugGroup(),this._logDrawCallEnd()}return this._logFramebuffer(e),r?(this._lastDrawTimestamp=this.device.timestamp,this._needsRedraw=!1):this._needsRedraw="waiting for resource initialization",r}setGeometry(e){var r;(r=this._gpuGeometry)==null||r.destroy();const n=e&&pq(this.device,e);if(n){this.setTopology(n.topology||"triangle-list");const i=new u0(this.bufferLayout);this.bufferLayout=i.mergeBufferLayouts(n.bufferLayout,this.bufferLayout),this.vertexArray&&this._setGeometryAttributes(n)}this._gpuGeometry=n}setTopology(e){e!==this.topology&&(this.topology=e,this._setPipelineNeedsUpdate("topology"))}setBufferLayout(e){const n=new u0(this.bufferLayout);this.bufferLayout=this._gpuGeometry?n.mergeBufferLayouts(e,this._gpuGeometry.bufferLayout):e,this._setPipelineNeedsUpdate("bufferLayout"),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)}setParameters(e){wy(e,this.parameters,2)||(this.parameters=e,this._setPipelineNeedsUpdate("parameters"))}setInstanceCount(e){this.instanceCount=e,this.isInstanced===void 0&&e>0&&(this.isInstanced=!0),this.setNeedsRedraw("instanceCount")}setVertexCount(e){this.vertexCount=e,this.setNeedsRedraw("vertexCount")}setShaderInputs(e){this.shaderInputs=e,this._uniformStore=new aH(this.shaderInputs.modules);for(const[n,r]of Object.entries(this.shaderInputs.modules))if(Rq(r)){const i=this._uniformStore.getManagedUniformBuffer(this.device,n);this.bindings[`${n}Uniforms`]=i}this.setNeedsRedraw("shaderInputs")}updateShaderInputs(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues()),this.setBindings(this.shaderInputs.getBindingValues()),this.setNeedsRedraw("shaderInputs")}setBindings(e){Object.assign(this.bindings,e),this.setNeedsRedraw("bindings")}setTransformFeedback(e){this.transformFeedback=e,this.setNeedsRedraw("transformFeedback")}setIndexBuffer(e){this.vertexArray.setIndexBuffer(e),this.setNeedsRedraw("indexBuffer")}setAttributes(e,n){const r=(n==null?void 0:n.disableWarnings)??this.props.disableWarnings;e.indices&&Re.warn(`Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`)();const i=new u0(this.bufferLayout);for(const[s,l]of Object.entries(e)){const c=i.getBufferLayout(s);if(!c){r||Re.warn(`Model(${this.id}): Missing layout for buffer "${s}".`)();continue}const f=i.getAttributeNamesForBuffer(c);let d=!1;for(const g of f){const m=this._attributeInfos[g];m&&(this.vertexArray.setBuffer(m.location,l),d=!0)}!d&&!r&&Re.warn(`Model(${this.id}): Ignoring buffer "${l.id}" for unknown attribute "${s}"`)()}this.setNeedsRedraw("attributes")}setConstantAttributes(e,n){for(const[r,i]of Object.entries(e)){const s=this._attributeInfos[r];s?this.vertexArray.setConstantWebGL(s.location,i):((n==null?void 0:n.disableWarnings)??this.props.disableWarnings)||Re.warn(`Model "${this.id}: Ignoring constant supplied for unknown attribute "${r}"`)()}this.setNeedsRedraw("constants")}setUniforms(e){this.setUniformsWebGL(e)}setUniformsWebGL(e){Ey(e)||(this.pipeline.setUniformsWebGL(e),Object.assign(this.uniforms,e)),this.setNeedsRedraw("uniforms")}updateModuleSettingsWebGL(e){const{bindings:n,uniforms:r}=MO(this._getModuleUniforms(e));Object.assign(this.bindings,n),Object.assign(this.uniforms,r),this.setNeedsRedraw("moduleSettings")}_areBindingsLoading(){for(const e of Object.values(this.bindings))if(e instanceof E0&&!e.isReady)return e.id;return!1}_getBindings(){const e={};for(const[n,r]of Object.entries(this.bindings))r instanceof E0?r.isReady&&(e[n]=r.texture):e[n]=r;return e}_getBindingsUpdateTimestamp(){let e=0;for(const n of Object.values(this.bindings))n instanceof Sg?e=Math.max(e,n.texture.updateTimestamp):n instanceof $n||n instanceof Kn?e=Math.max(e,n.updateTimestamp):n instanceof E0?e=n.texture?Math.max(e,n.texture.updateTimestamp):1/0:n instanceof Eg||(e=Math.max(e,n.buffer.updateTimestamp));return e}_setGeometryAttributes(e){const n={...e.attributes};for(const[r]of Object.entries(n))!this.pipeline.shaderLayout.attributes.find(i=>i.name===r)&&r!=="positions"&&delete n[r];this.vertexCount=e.vertexCount,this.setIndexBuffer(e.indices||null),this.setAttributes(e.attributes,{disableWarnings:!0}),this.setAttributes(n,{disableWarnings:this.props.disableWarnings}),this.setNeedsRedraw("geometry attributes")}_setPipelineNeedsUpdate(e){this._pipelineNeedsUpdate||(this._pipelineNeedsUpdate=e),this.setNeedsRedraw(e)}_updatePipeline(){if(this._pipelineNeedsUpdate){let e=null,n=null;this.pipeline&&(Re.log(1,`Model ${this.id}: Recreating pipeline because "${this._pipelineNeedsUpdate}".`)(),e=this.pipeline.vs,n=this.pipeline.fs),this._pipelineNeedsUpdate=!1;const r=this.shaderFactory.createShader({id:`${this.id}-vertex`,stage:"vertex",source:this.source||this.vs,debugShaders:this.props.debugShaders});let i=null;this.source?i=r:this.fs&&(i=this.shaderFactory.createShader({id:`${this.id}-fragment`,stage:"fragment",source:this.source||this.fs,debugShaders:this.props.debugShaders})),this.pipeline=this.pipelineFactory.createRenderPipeline({...this.props,bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,bindings:this._getBindings(),vs:r,fs:i}),this._attributeInfos=kM(this.pipeline.shaderLayout,this.bufferLayout),e&&this.shaderFactory.release(e),n&&this.shaderFactory.release(n)}return this.pipeline}_logDrawCallStart(){const e=Re.level>3?0:Cq;Re.level<2||Date.now()-this._lastLogTime<e||(this._lastLogTime=Date.now(),this._logOpen=!0,Re.group(go,`>>> DRAWING MODEL ${this.id}`,{collapsed:Re.level<=2})())}_logDrawCallEnd(){if(this._logOpen){const e=_q(this.pipeline.shaderLayout,this.id);Re.table(go,e)();const n=this.shaderInputs.getDebugTable();for(const[i,s]of Object.entries(this.uniforms))n[i]={value:s};Re.table(go,n)();const r=this._getAttributeDebugTable();Re.table(go,this._attributeInfos)(),Re.table(go,r)(),Re.groupEnd(go)(),this._logOpen=!1}}_logFramebuffer(e){const n=this.device.props.debugFramebuffers;if(this._drawCount++,!n)return;const r=e.props.framebuffer;r&&yq(r,{id:r.id,minimap:!0})}_getAttributeDebugTable(){const e={};for(const[n,r]of Object.entries(this._attributeInfos)){const i=this.vertexArray.attributes[r.location];e[r.location]={name:n,type:r.shaderType,values:i?this._getBufferOrConstantValues(i,r.bufferDataType):"null"}}if(this.vertexArray.indexBuffer){const{indexBuffer:n}=this.vertexArray,r=n.indexType==="uint32"?new Uint32Array(n.debugData):new Uint16Array(n.debugData);e.indices={name:"indices",type:n.indexType,values:r.toString()}}return e}_getBufferOrConstantValues(e,n){const r=LM(n);return(e instanceof $n?new r(e.debugData):e).toString()}};O(np,"defaultProps",{...Pc.defaultProps,source:void 0,vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:void 0,geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],isInstanced:void 0,instanceCount:0,vertexCount:0,shaderInputs:void 0,pipelineFactory:void 0,shaderFactory:void 0,transformFeedback:void 0,shaderAssembler:bg.getDefaultShaderAssembler(),debugShaders:void 0,disableWarnings:void 0});let Wo=np;function Rq(t){return!!(t.uniformTypes&&!Ey(t.uniformTypes))}function xq(t){return{type:t.type,shaderLanguage:t.info.shadingLanguage,shaderLanguageVersion:t.info.shadingLanguageVersion,gpu:t.info.gpu,features:t.features}}function Ey(t){for(const e in t)return!1;return!0}const mf=class mf{constructor(e,n=mf.defaultProps){O(this,"device");O(this,"model");O(this,"transformFeedback");if(!mf.isSupported(e))throw new Error("BufferTransform not yet implemented on WebGPU");this.device=e,this.model=new Wo(this.device,{id:n.id||"buffer-transform-model",fs:n.fs||cV(),topology:n.topology||"point-list",varyings:n.outputs||n.varyings,...n}),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:n.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}static isSupported(e){var n;return((n=e==null?void 0:e.info)==null?void 0:n.type)==="webgl"}destroy(){this.model&&this.model.destroy()}delete(){this.destroy()}run(e){e!=null&&e.inputBuffers&&this.model.setAttributes(e.inputBuffers),e!=null&&e.outputBuffers&&this.transformFeedback.setBuffers(e.outputBuffers);const n=this.device.beginRenderPass(e);this.model.draw(n),n.end()}getBuffer(e){return this.transformFeedback.getBuffer(e)}readAsync(e){const n=this.getBuffer(e);if(!n)throw new Error("BufferTransform#getBuffer");if(n instanceof $n)return n.readAsync();const{buffer:r,byteOffset:i=0,byteLength:s=r.byteLength}=n;return r.readAsync(i,s)}};O(mf,"defaultProps",{...Wo.defaultProps,outputs:void 0,feedbackBuffers:void 0});let Uf=mf;class Db{constructor(e){O(this,"id");O(this,"topology");O(this,"vertexCount");O(this,"indices");O(this,"attributes");O(this,"userData",{});const{attributes:n={},indices:r=null,vertexCount:i=null}=e;this.id=e.id||id("geometry"),this.topology=e.topology,r&&(this.indices=ArrayBuffer.isView(r)?{value:r,size:1}:r),this.attributes={};for(const[s,l]of Object.entries(n)){const c=ArrayBuffer.isView(l)?{value:l}:l;if(!ArrayBuffer.isView(c.value))throw new Error(`${this._print(s)}: must be typed array or object with value as typed array`);if((s==="POSITION"||s==="positions")&&!c.size&&(c.size=3),s==="indices"){if(this.indices)throw new Error("Multiple indices detected");this.indices=c}else this.attributes[s]=c}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=i||this._calculateVertexCount(this.attributes,this.indices)}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,n){return this}_calculateVertexCount(e,n){if(n)return n.value.length;let r=1/0;for(const i of Object.values(e)){const{value:s,size:l,constant:c}=i;!c&&s&&l!==void 0&&l>=1&&(r=Math.min(r,s.length/l))}return r}}class Mq extends Db{constructor(e={}){const{id:n=id("cube-geometry"),indices:r=!0}=e;super(r?{...e,id:n,topology:"triangle-list",indices:{size:1,value:Oq},attributes:{...Bq,...e.attributes}}:{...e,id:n,topology:"triangle-list",indices:void 0,attributes:{...Uq,...e.attributes}})}}const Oq=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Pq=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),Nq=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),Iq=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),Dq=new Float32Array([1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,1,1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1]),Fq=new Float32Array([1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0]),kq=new Float32Array([1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,1,0,1,0,1]),Bq={POSITION:{size:3,value:Pq},NORMAL:{size:3,value:Nq},TEXCOORD_0:{size:2,value:Iq}},Uq={POSITION:{size:3,value:Dq},TEXCOORD_0:{size:2,value:Fq},COLOR_0:{size:3,value:kq}},Lq={blendColorOperation:"add",blendColorSrcFactor:"one",blendColorDstFactor:"zero",blendAlphaOperation:"add",blendAlphaSrcFactor:"constant-alpha",blendAlphaDstFactor:"zero"};class PO extends Ib{constructor(){super(...arguments),this._colorEncoderState=null}render(e){return"pickingFBO"in e?this._drawPickingBuffer(e):super.render(e)}_drawPickingBuffer({layers:e,layerFilter:n,views:r,viewports:i,onViewportActive:s,pickingFBO:l,deviceRect:{x:c,y:f,width:d,height:g},cullRect:m,effects:v,pass:S="picking",pickZ:E,shaderModuleProps:w}){this.pickZ=E;const b=this._resetColorEncoder(E),A=[c,f,d,g],T=super.render({target:l,layers:e,layerFilter:n,views:r,viewports:i,onViewportActive:s,cullRect:m,effects:v==null?void 0:v.filter(M=>M.useInPicking),pass:S,isPicking:!0,shaderModuleProps:w,clearColor:[0,0,0,0],colorMask:15,scissorRect:A});return this._colorEncoderState=null,{decodePickingColor:b&&$q.bind(null,b),stats:T}}shouldDrawLayer(e){const{pickable:n,operation:r}=e.props;return n&&r.includes("draw")||r.includes("terrain")||r.includes("mask")}getShaderModuleProps(e,n,r){return{picking:{isActive:1,isAttribute:this.pickZ},lighting:{enabled:!1}}}getLayerParameters(e,n,r){const i={...e.props.parameters},{pickable:s,operation:l}=e.props;return!this._colorEncoderState||l.includes("terrain")?i.blend=!1:s&&l.includes("draw")&&(Object.assign(i,Lq),i.blend=!0,i.blendColor=zq(this._colorEncoderState,e,r)),i}_resetColorEncoder(e){return this._colorEncoderState=e?null:{byLayer:new Map,byAlpha:[]},this._colorEncoderState}}function zq(t,e,n){const{byLayer:r,byAlpha:i}=t;let s,l=r.get(e);return l?(l.viewports.push(n),s=l.a):(s=r.size+1,s<=255?(l={a:s,layer:e,viewports:[n]},r.set(e,l),i[s]=l):(Sn.warn("Too many pickable layers, only picking the first 255")(),s=0)),[0,0,0,s/255]}function $q(t,e){const n=t.byAlpha[e[3]];return n&&{pickedLayer:n.layer,pickedViewports:n.viewports,pickedObjectIndex:n.layer.decodePickingColor(e)}}const Xl={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"},Fg=Symbol.for("component"),Uo=Symbol.for("propTypes"),T0=Symbol.for("deprecatedProps"),lc=Symbol.for("asyncPropDefaults"),Xo=Symbol.for("asyncPropOriginal"),Ba=Symbol.for("asyncPropResolved");function NO(t,e=()=>!0){return Array.isArray(t)?IO(t,e,[]):e(t)?[t]:[]}function IO(t,e,n){let r=-1;for(;++r<t.length;){const i=t[r];Array.isArray(i)?IO(i,e,n):e(i)&&n.push(i)}return n}function Vq({target:t,source:e,start:n=0,count:r=1}){const i=e.length,s=r*i;let l=0;for(let c=n;l<i;l++)t[c++]=e[l];for(;l<s;)l<s-l?(t.copyWithin(n+l,n,n+l),l*=2):(t.copyWithin(n+l,n,n+s-l),l=s);return t}class Hq{constructor(e,n,r){this._loadCount=0,this._subscribers=new Set,this.id=e,this.context=r,this.setData(n)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,n){if(e===this._data&&!n)return;this._data=e;const r=++this._loadCount;let i=e;typeof e=="string"&&(i=Jh(e)),i instanceof Promise?(this.isLoaded=!1,this._loader=i.then(s=>{this._loadCount===r&&(this.isLoaded=!0,this._error=void 0,this._content=s)}).catch(s=>{this._loadCount===r&&(this.isLoaded=!0,this._error=s||!0)})):(this.isLoaded=!0,this._error=void 0,this._content=e);for(const s of this._subscribers)s.onChange(this.getData())}}class jq{constructor(e){var n;this.protocol=e.protocol||"resource://",this._context={device:e.device,gl:(n=e.device)==null?void 0:n.gl,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return e.startsWith(this.protocol)?!0:e in this._resources}add({resourceId:e,data:n,forceUpdate:r=!1,persistent:i=!0}){let s=this._resources[e];s?s.setData(n,r):(s=new Hq(e,n,this._context),this._resources[e]=s),s.persistent=i}remove(e){const n=this._resources[e];n&&(n.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const n=this._consumers[e];if(n){for(const r in n){const i=n[r],s=this._resources[i.resourceId];s&&s.unsubscribe(i)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:n,consumerId:r,requestId:i="default"}){const{_resources:s,protocol:l}=this;e.startsWith(l)&&(e=e.replace(l,""),s[e]||this.add({resourceId:e,data:null,persistent:!1}));const c=s[e];if(this._track(r,i,c,n),c)return c.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,n,r,i){const s=this._consumers,l=s[e]=s[e]||{};let c=l[n];const f=c&&c.resourceId&&this._resources[c.resourceId];f&&(f.unsubscribe(c),this.prune()),r&&(c?(c.onChange=i,c.resourceId=r.id):c={onChange:i,resourceId:r.id},l[n]=c,r.subscribe(c))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const n=this._resources[e];!n.persistent&&!n.inUse()&&(n.delete(),delete this._resources[e])}}}const Wq="layerManager.setLayers",Xq="layerManager.activateViewport";class qq{constructor(e,n){this._lastRenderedLayers=[],this._needsRedraw=!1,this._needsUpdate=!1,this._nextLayers=null,this._debug=!1,this._defaultShaderModulesChanged=!1,this.activateViewport=c=>{jr(Xq,this,c),c&&(this.context.viewport=c)};const{deck:r,stats:i,viewport:s,timeline:l}=n||{};this.layers=[],this.resourceManager=new jq({device:e,protocol:"deck://"}),this.context={mousePosition:null,userData:{},layerManager:this,device:e,gl:e==null?void 0:e.gl,deck:r,shaderAssembler:BX(),defaultShaderModules:[tW],renderPass:void 0,stats:i||new ip({id:"deck.gl"}),viewport:s||new rd({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:l||new RO,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let n=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const r of this.layers){const i=r.getNeedsRedraw(e);n=n||i}return n}needsUpdate(){return this._nextLayers&&this._nextLayers!==this._lastRenderedLayers?"layers changed":this._defaultShaderModulesChanged?"shader modules changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e}={}){return e?this.layers.filter(n=>e.find(r=>n.id.indexOf(r)===0)):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,n){jr(Wq,this,n,e),this._lastRenderedLayers=e;const r=NO(e,Boolean);for(const i of r)i.context=this.context;this._updateLayers(this.layers,r)}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw(`updating layers: ${e}`),this.setLayers(this._nextLayers||this._lastRenderedLayers,e)),this._nextLayers=null}addDefaultShaderModule(e){const{defaultShaderModules:n}=this.context;n.find(r=>r.name===e.name)||(n.push(e),this._defaultShaderModulesChanged=!0)}removeDefaultShaderModule(e){const{defaultShaderModules:n}=this.context,r=n.findIndex(i=>i.name===e.name);r>=0&&(n.splice(r,1),this._defaultShaderModulesChanged=!0)}_handleError(e,n,r){r.raiseError(n,`${e} of ${r}`)}_updateLayers(e,n){const r={};for(const l of e)r[l.id]?Sn.warn(`Multiple old layers with same id ${l.id}`)():r[l.id]=l;if(this._defaultShaderModulesChanged){for(const l of e)l.setNeedsUpdate(),l.setChangeFlags({extensionsChanged:!0});this._defaultShaderModulesChanged=!1}const i=[];this._updateSublayersRecursively(n,r,i),this._finalizeOldLayers(r);let s=!1;for(const l of i)if(l.hasUniformTransition()){s=`Uniform transition in ${l}`;break}this._needsUpdate=s,this.layers=i}_updateSublayersRecursively(e,n,r){for(const i of e){i.context=this.context;const s=n[i.id];s===null&&Sn.warn(`Multiple new layers with same id ${i.id}`)(),n[i.id]=null;let l=null;try{this._debug&&s!==i&&i.validateProps(),s?(this._transferLayerState(s,i),this._updateLayer(i)):this._initializeLayer(i),r.push(i),l=i.isComposite?i.getSubLayers():null}catch(c){this._handleError("matching",c,i)}l&&this._updateSublayersRecursively(l,n,r)}}_finalizeOldLayers(e){for(const n in e){const r=e[n];r&&this._finalizeLayer(r)}}_initializeLayer(e){try{e._initialize(),e.lifecycle=Xl.INITIALIZED}catch(n){this._handleError("initialization",n,e)}}_transferLayerState(e,n){n._transferState(e),n.lifecycle=Xl.MATCHED,n!==e&&(e.lifecycle=Xl.AWAITING_GC)}_updateLayer(e){try{e._update()}catch(n){this._handleError("update",n,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||`finalized ${e}`,e.lifecycle=Xl.AWAITING_FINALIZATION;try{e._finalize(),e.lifecycle=Xl.FINALIZED}catch(n){this._handleError("finalization",n,e)}}}function Ji(t,e,n){if(t===e)return!0;if(!n||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!Ji(t[r],e[r],n-1))return!1;return!0}if(Array.isArray(e))return!1;if(typeof t=="object"&&typeof e=="object"){const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(const s of r)if(!e.hasOwnProperty(s)||!Ji(t[s],e[s],n-1))return!1;return!0}return!1}class Yq{constructor(e){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="First render",this._needsUpdate="Initialize",this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers){const n=this.controllers[e];n&&n.finalize()}this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){const n=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),n}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const n=this.controllers[e];n&&n.updateTransition()}}getViewports(e){return e?this._viewports.filter(n=>n.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(n=>{e[n.id]=n}),e}getView(e){return this.views.find(n=>n.id===e)}getViewState(e){const n=typeof e=="string"?this.getView(e):e,r=n&&this.viewState[n.getViewStateId()]||this.viewState;return n?n.filterViewState(r):r}getViewport(e){return this._viewportMap[e]}unproject(e,n){const r=this.getViewports(),i={x:e[0],y:e[1]};for(let s=r.length-1;s>=0;--s){const l=r[s];if(l.containsPixel(i)){const c=e.slice();return c[0]-=l.x,c[1]-=l.y,l.unproject(c,n)}}return null}setProps(e){e.views&&this._setViews(e.views),e.viewState&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,n){(e!==this.width||n!==this.height)&&(this.width=e,this.height=n,this.setNeedsUpdate("Size changed"))}_setViews(e){e=NO(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!Ji(e,this.viewState,3)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Sn.warn("missing `viewState` or `initialViewState`")()}_createController(e,n){const r=n.type;return new r({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._eventCallbacks.onViewStateChange,onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:s=>{var l;return(l=this.getView(e.id))==null?void 0:l.makeViewport({viewState:s,width:this.width,height:this.height})}})}_updateController(e,n,r,i){const s=e.controller;if(s&&r){const l={...n,...s,id:e.id,x:r.x,y:r.y,width:r.width,height:r.height};return(!i||i.constructor!==s.type)&&(i=this._createController(e,l)),i&&i.setProps(l),i}return null}_rebuildViewports(){const{views:e}=this,n=this.controllers;this._viewports=[],this.controllers={};let r=!1;for(let i=e.length;i--;){const s=e[i],l=this.getViewState(s),c=s.makeViewport({viewState:l,width:this.width,height:this.height});let f=n[s.id];const d=!!s.controller;d&&!f&&(r=!0),(r||!d)&&f&&(f.finalize(),f=null),this.controllers[s.id]=this._updateController(s,l,c,f),c&&this._viewports.unshift(c)}for(const i in n){const s=n[i];s&&!this.controllers[i]&&s.finalize()}this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,n){return e.length!==n.length?!0:e.some((r,i)=>!e[i].equals(n[i]))}}const Kq=/([0-9]+\.?[0-9]*)(%|px)/;function va(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=Kq.exec(t);if(e&&e.length>=3){const n=e[2]==="%",r=parseFloat(e[1]);return{position:n?r/100:r,relative:n}}default:throw new Error(`Could not parse position string ${t}`)}}function _a(t,e){return t.relative?Math.round(t.position*e):t.position}class Uc{constructor(e){const{id:n,x:r=0,y:i=0,width:s="100%",height:l="100%",padding:c=null}=e;this.id=n||this.constructor.displayName||"view",this.props={...e,id:this.id},this._x=va(r),this._y=va(i),this._width=va(s),this._height=va(l),this._padding=c&&{left:va(c.left||0),right:va(c.right||0),top:va(c.top||0),bottom:va(c.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e?!0:this.constructor===e.constructor&&Ji(this.props,e.props,2)}makeViewport({width:e,height:n,viewState:r}){r=this.filterViewState(r);const i=this.getDimensions({width:e,height:n});if(!i.height||!i.width)return null;const s=this.getViewportType(r);return new s({...r,...this.props,...i})}getViewStateId(){const{viewState:e}=this.props;return typeof e=="string"?e:(e==null?void 0:e.id)||this.id}filterViewState(e){if(this.props.viewState&&typeof this.props.viewState=="object"){if(!this.props.viewState.id)return this.props.viewState;const n={...e};for(const r in this.props.viewState)r!=="id"&&(n[r]=this.props.viewState[r]);return n}return e}getDimensions({width:e,height:n}){const r={x:_a(this._x,e),y:_a(this._y,n),width:_a(this._width,e),height:_a(this._height,n)};return this._padding&&(r.padding={left:_a(this._padding.left,e),top:_a(this._padding.top,n),right:_a(this._padding.right,e),bottom:_a(this._padding.bottom,n)}),r}get controller(){const e=this.props.controller;return e?e===!0?{type:this.ControllerType}:typeof e=="function"?{type:e}:{type:this.ControllerType,...e}:null}}class Sp{constructor(e){this._inProgress=!1,this._handle=null,this.time=0,this.settings={duration:0},this._timeline=e}get inProgress(){return this._inProgress}start(e){var n,r;this.cancel(),this.settings=e,this._inProgress=!0,(r=(n=this.settings).onStart)==null||r.call(n,this)}end(){var e,n;this._inProgress&&(this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,(n=(e=this.settings).onEnd)==null||n.call(e,this))}cancel(){var e,n;this._inProgress&&((n=(e=this.settings).onInterrupt)==null||n.call(e,this),this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){var e,n;if(!this._inProgress)return!1;if(this._handle===null){const{_timeline:r,settings:i}=this;this._handle=r.addChannel({delay:r.getTime(),duration:i.duration})}return this.time=this._timeline.getTime(this._handle),this._onUpdate(),(n=(e=this.settings).onUpdate)==null||n.call(e,this),this._timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const iC=()=>{},Ty={BREAK:1,SNAP_TO_END:2,IGNORE:3},Zq=t=>t,Qq=Ty.BREAK;class Gq{constructor(e){this._onTransitionUpdate=n=>{const{time:r,settings:{interpolator:i,startProps:s,endProps:l,duration:c,easing:f}}=n,d=f(r/c),g=i.interpolateProps(s,l,d);this.propsInTransition=this.getControllerState({...this.props,...g}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})},this.getControllerState=e.getControllerState,this.propsInTransition=null,this.transition=new Sp(e.timeline),this.onViewStateChange=e.onViewStateChange||iC,this.onStateChange=e.onStateChange||iC}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let n=!1;const r=this.props;if(this.props=e,!r||this._shouldIgnoreViewportChange(r,e))return!1;if(this._isTransitionEnabled(e)){let i=r;if(this.transition.inProgress){const{interruption:s,endProps:l}=this.transition.settings;i={...r,...s===Ty.SNAP_TO_END?l:this.propsInTransition||r}}this._triggerTransition(i,e),n=!0}else this.transition.cancel();return n}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:n,transitionInterpolator:r}=e;return(n>0||n==="auto")&&!!r}_isUpdateDueToCurrentTransition(e){return this.transition.inProgress&&this.propsInTransition?this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition):!1}_shouldIgnoreViewportChange(e,n){return this.transition.inProgress?this.transition.settings.interruption===Ty.IGNORE||this._isUpdateDueToCurrentTransition(n):this._isTransitionEnabled(n)?n.transitionInterpolator.arePropsEqual(e,n):!0}_triggerTransition(e,n){const r=this.getControllerState(e),i=this.getControllerState(n).shortestPathFrom(r),s=n.transitionInterpolator,l=s.getDuration?s.getDuration(e,n):n.transitionDuration;if(l===0)return;const c=s.initializeProps(e,i);this.propsInTransition={};const f={duration:l,easing:n.transitionEasing||Zq,interpolator:s,interruption:n.transitionInterruption||Qq,startProps:c.start,endProps:c.end,onStart:n.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(n.onTransitionInterrupt),onEnd:this._onTransitionEnd(n.onTransitionEnd)};this.transition.start(f),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return n=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e==null||e(n)}}}function Br(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}class Jq{constructor(e){const{compare:n,extract:r,required:i}=e;this._propsToCompare=n,this._propsToExtract=r||n,this._requiredProps=i}arePropsEqual(e,n){for(const r of this._propsToCompare)if(!(r in e)||!(r in n)||!Ff(e[r],n[r]))return!1;return!0}initializeProps(e,n){const r={},i={};for(const s of this._propsToExtract)(s in e||s in n)&&(r[s]=e[s],i[s]=n[s]);return this._checkRequiredProps(r),this._checkRequiredProps(i),{start:r,end:i}}getDuration(e,n){return n.transitionDuration}_checkRequiredProps(e){this._requiredProps&&this._requiredProps.forEach(n=>{const r=e[n];Br(Number.isFinite(r)||Array.isArray(r),`${n} is required for transition`)})}}const eY=["longitude","latitude","zoom","bearing","pitch"],tY=["longitude","latitude","zoom"];class DO extends Jq{constructor(e={}){const n=Array.isArray(e)?e:e.transitionProps,r=Array.isArray(e)?{}:e;r.transitionProps=Array.isArray(n)?{compare:n,required:n}:n||{compare:eY,required:tY},super(r.transitionProps),this.opts=r}initializeProps(e,n){const r=super.initializeProps(e,n),{makeViewport:i,around:s}=this.opts;if(i&&s){const l=i(e),c=i(n),f=l.unproject(s);r.start.around=s,Object.assign(r.end,{around:c.project(f),aroundPosition:f,width:n.width,height:n.height})}return r}interpolateProps(e,n,r){const i={};for(const s of this._propsToExtract)i[s]=Mg(e[s]||0,n[s]||0,r);if(n.aroundPosition&&this.opts.makeViewport){const s=this.opts.makeViewport({...n,...i});Object.assign(i,s.panByPosition(n.aroundPosition,Mg(e.around,n.around,r)))}return i}}const ya={transitionDuration:0},nY=300,Oh=t=>1-(1-t)*(1-t),Wl={WHEEL:["wheel"],PAN:["panstart","panmove","panend"],PINCH:["pinchstart","pinchmove","pinchend"],MULTI_PAN:["multipanstart","multipanmove","multipanend"],DOUBLE_CLICK:["dblclick"],KEYBOARD:["keydown"]},po={};class rY{constructor(e){this.state={},this._events={},this._interactionState={isDragging:!1},this._customEvents=[],this._eventStartBlocked=null,this._panMove=!1,this.invertPan=!1,this.dragMode="rotate",this.inertia=0,this.scrollZoom=!0,this.dragPan=!0,this.dragRotate=!0,this.doubleClickZoom=!0,this.touchZoom=!0,this.touchRotate=!1,this.keyboard=!0,this.transitionManager=new Gq({...e,getControllerState:n=>new this.ControllerState(n),onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}),this.handleEvent=this.handleEvent.bind(this),this.eventManager=e.eventManager,this.onViewStateChange=e.onViewStateChange||(()=>{}),this.onStateChange=e.onStateChange||(()=>{}),this.makeViewport=e.makeViewport}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.props&&this.setProps(this.props)}finalize(){var e;for(const n in this._events)this._events[n]&&((e=this.eventManager)==null||e.off(n,this.handleEvent));this.transitionManager.finalize()}handleEvent(e){this._controllerState=void 0;const n=this._eventStartBlocked;switch(e.type){case"panstart":return n?!1:this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return n?!1:this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"multipanstart":return n?!1:this._onMultiPanStart(e);case"multipanmove":return this._onMultiPan(e);case"multipanend":return this._onMultiPanEnd(e);case"dblclick":return this._onDoubleClick(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}get controllerState(){return this._controllerState=this._controllerState||new this.ControllerState({makeViewport:this.makeViewport,...this.props,...this.state}),this._controllerState}getCenter(e){const{x:n,y:r}=this.props,{offsetCenter:i}=e;return[i.x-n,i.y-r]}isPointInBounds(e,n){const{width:r,height:i}=this.props;if(n&&n.handled)return!1;const s=e[0]>=0&&e[0]<=r&&e[1]>=0&&e[1]<=i;return s&&n&&n.stopPropagation(),s}isFunctionKeyPressed(e){const{srcEvent:n}=e;return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}isDragging(){return this._interactionState.isDragging||!1}blockEvents(e){const n=setTimeout(()=>{this._eventStartBlocked===n&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=n}setProps(e){e.dragMode&&(this.dragMode=e.dragMode),this.props=e,"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);const{inertia:n}=e;this.inertia=Number.isFinite(n)?n:n===!0?nY:0;const{scrollZoom:r=!0,dragPan:i=!0,dragRotate:s=!0,doubleClickZoom:l=!0,touchZoom:c=!0,touchRotate:f=!1,keyboard:d=!0}=e,g=!!this.onViewStateChange;this.toggleEvents(Wl.WHEEL,g&&r),this.toggleEvents(Wl.PAN,g),this.toggleEvents(Wl.PINCH,g&&(c||f)),this.toggleEvents(Wl.MULTI_PAN,g&&f),this.toggleEvents(Wl.DOUBLE_CLICK,g&&l),this.toggleEvents(Wl.KEYBOARD,g&&d),this.scrollZoom=r,this.dragPan=i,this.dragRotate=s,this.doubleClickZoom=l,this.touchZoom=c,this.touchRotate=f,this.keyboard=d}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,n){this.eventManager&&e.forEach(r=>{this._events[r]!==n&&(this._events[r]=n,n?this.eventManager.on(r,this.handleEvent):this.eventManager.off(r,this.handleEvent))})}updateViewport(e,n=null,r={}){const i={...e.getViewportProps(),...n},s=this.controllerState!==e;if(this.state=e.getState(),this._setInteractionState(r),s){const l=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:this._interactionState,oldViewState:l,viewId:this.props.id})}}_onTransition(e){this.onViewStateChange({...e,interactionState:this._interactionState,viewId:this.props.id})}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange(this._interactionState)}_onPanStart(e){const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;let r=this.isFunctionKeyPressed(e)||e.rightButton||!1;(this.invertPan||this.dragMode==="pan")&&(r=!r);const i=this.controllerState[r?"panStart":"rotateStart"]({pos:n});return this._panMove=r,this.updateViewport(i,ya,{isDragging:!0}),!0}_onPan(e){return this.isDragging()?this._panMove?this._onPanMove(e):this._onPanRotate(e):!1}_onPanEnd(e){return this.isDragging()?this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e):!1}_onPanMove(e){if(!this.dragPan)return!1;const n=this.getCenter(e),r=this.controllerState.pan({pos:n});return this.updateViewport(r,ya,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:n}=this;if(this.dragPan&&n&&e.velocity){const r=this.getCenter(e),i=[r[0]+e.velocityX*n/2,r[1]+e.velocityY*n/2],s=this.controllerState.pan({pos:i}).panEnd();this.updateViewport(s,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:Oh},{isDragging:!1,isPanning:!0})}else{const r=this.controllerState.panEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const n=this.getCenter(e),r=this.controllerState.rotate({pos:n});return this.updateViewport(r,ya,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:n}=this;if(this.dragRotate&&n&&e.velocity){const r=this.getCenter(e),i=[r[0]+e.velocityX*n/2,r[1]+e.velocityY*n/2],s=this.controllerState.rotate({pos:i}).rotateEnd();this.updateViewport(s,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:Oh},{isDragging:!1,isRotating:!0})}else{const r=this.controllerState.rotateEnd();this.updateViewport(r,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;e.srcEvent.preventDefault();const{speed:r=.01,smooth:i=!1}=this.scrollZoom===!0?{}:this.scrollZoom,{delta:s}=e;let l=2/(1+Math.exp(-Math.abs(s*r)));s<0&&l!==0&&(l=1/l);const c=this.controllerState.zoom({pos:n,scale:l});return this.updateViewport(c,{...this._getTransitionProps({around:n}),transitionDuration:i?250:1},{isZooming:!0,isPanning:!0}),!0}_onMultiPanStart(e){const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;const r=this.controllerState.rotateStart({pos:n});return this.updateViewport(r,ya,{isDragging:!0}),!0}_onMultiPan(e){if(!this.touchRotate||!this.isDragging())return!1;const n=this.getCenter(e);n[0]-=e.deltaX;const r=this.controllerState.rotate({pos:n});return this.updateViewport(r,ya,{isDragging:!0,isRotating:!0}),!0}_onMultiPanEnd(e){if(!this.isDragging())return!1;const{inertia:n}=this;if(this.touchRotate&&n&&e.velocityY){const r=this.getCenter(e),i=[r[0],r[1]+=e.velocityY*n/2],s=this.controllerState.rotate({pos:i});this.updateViewport(s,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:Oh},{isDragging:!1,isRotating:!0}),this.blockEvents(n)}else{const r=this.controllerState.rotateEnd();this.updateViewport(r,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;const r=this.controllerState.zoomStart({pos:n}).rotateStart({pos:n});return po._startPinchRotation=e.rotation,po._lastPinchEvent=e,this.updateViewport(r,ya,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let n=this.controllerState;if(this.touchZoom){const{scale:r}=e,i=this.getCenter(e);n=n.zoom({pos:i,scale:r})}if(this.touchRotate){const{rotation:r}=e;n=n.rotate({deltaAngleX:po._startPinchRotation-r})}return this.updateViewport(n,ya,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),po._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:n}=this,{_lastPinchEvent:r}=po;if(this.touchZoom&&n&&r&&e.scale!==r.scale){const i=this.getCenter(e);let s=this.controllerState.rotateEnd();const l=Math.log2(e.scale),c=(l-Math.log2(r.scale))/(e.deltaTime-r.deltaTime),f=Math.pow(2,l+c*n/2);s=s.zoom({pos:i,scale:f}).zoomEnd(),this.updateViewport(s,{...this._getTransitionProps({around:i}),transitionDuration:n,transitionEasing:Oh},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(n)}else{const i=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return po._startPinchRotation=null,po._lastPinchEvent=null,!0}_onDoubleClick(e){if(!this.doubleClickZoom)return!1;const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;const r=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:n,scale:r?.5:2});return this.updateViewport(i,this._getTransitionProps({around:n}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const n=this.isFunctionKeyPressed(e),{zoomSpeed:r,moveSpeed:i,rotateSpeedX:s,rotateSpeedY:l}=this.keyboard===!0?{}:this.keyboard,{controllerState:c}=this;let f;const d={};switch(e.srcEvent.code){case"Minus":f=n?c.zoomOut(r).zoomOut(r):c.zoomOut(r),d.isZooming=!0;break;case"Equal":f=n?c.zoomIn(r).zoomIn(r):c.zoomIn(r),d.isZooming=!0;break;case"ArrowLeft":n?(f=c.rotateLeft(s),d.isRotating=!0):(f=c.moveLeft(i),d.isPanning=!0);break;case"ArrowRight":n?(f=c.rotateRight(s),d.isRotating=!0):(f=c.moveRight(i),d.isPanning=!0);break;case"ArrowUp":n?(f=c.rotateUp(l),d.isRotating=!0):(f=c.moveUp(i),d.isPanning=!0);break;case"ArrowDown":n?(f=c.rotateDown(l),d.isRotating=!0):(f=c.moveDown(i),d.isPanning=!0);break;default:return!1}return this.updateViewport(f,this._getTransitionProps(),d),!0}_getTransitionProps(e){const{transition:n}=this;return!n||!n.transitionInterpolator?ya:e?{...n,transitionInterpolator:new DO({...e,...n.transitionInterpolator.opts,makeViewport:this.controllerState.makeViewport})}:n}}class iY{constructor(e,n){this._viewportProps=this.applyConstraints(e),this._state=n}getViewportProps(){return this._viewportProps}getState(){return this._state}}const sC=5,sY=1.2;class aY extends iY{constructor(e){const{width:n,height:r,latitude:i,longitude:s,zoom:l,bearing:c=0,pitch:f=0,altitude:d=1.5,position:g=[0,0,0],maxZoom:m=20,minZoom:v=0,maxPitch:S=60,minPitch:E=0,startPanLngLat:w,startZoomLngLat:b,startRotatePos:A,startBearing:T,startPitch:C,startZoom:M,normalize:x=!0}=e;Br(Number.isFinite(s)),Br(Number.isFinite(i)),Br(Number.isFinite(l)),super({width:n,height:r,latitude:i,longitude:s,zoom:l,bearing:c,pitch:f,altitude:d,maxZoom:m,minZoom:v,maxPitch:S,minPitch:E,normalize:x,position:g},{startPanLngLat:w,startZoomLngLat:b,startRotatePos:A,startBearing:T,startPitch:C,startZoom:M}),this.makeViewport=e.makeViewport}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:n}){const r=this.getState().startPanLngLat||this._unproject(n);if(!r)return this;const s=this.makeViewport(this.getViewportProps()).panByPosition(r,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate({pos:e,deltaAngleX:n=0,deltaAngleY:r=0}){const{startRotatePos:i,startBearing:s,startPitch:l}=this.getState();if(!i||s===void 0||l===void 0)return this;let c;return e?c=this._getNewRotation(e,i,l,s):c={bearing:s+n,pitch:l+r},this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this.getViewportProps().zoom})}zoom({pos:e,startPos:n,scale:r}){let{startZoom:i,startZoomLngLat:s}=this.getState();if(s||(i=this.getViewportProps().zoom,s=this._unproject(n)||this._unproject(e)),!s)return this;const{maxZoom:l,minZoom:c}=this.getViewportProps();let f=i+Math.log2(r);f=ka(f,c,l);const d=this.makeViewport({...this.getViewportProps(),zoom:f});return this._getUpdatedState({zoom:f,...d.panByPosition(s,e)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch-e})}shortestPathFrom(e){const n=e.getViewportProps(),r={...this.getViewportProps()},{bearing:i,longitude:s}=r;return Math.abs(i-n.bearing)>180&&(r.bearing=i<0?i+360:i-360),Math.abs(s-n.longitude)>180&&(r.longitude=s<0?s+360:s-360),r}applyConstraints(e){const{maxZoom:n,minZoom:r,zoom:i}=e;e.zoom=ka(i,r,n);const{maxPitch:s,minPitch:l,pitch:c}=e;e.pitch=ka(c,l,s);const{normalize:f=!0}=e;return f&&Object.assign(e,wX(e)),e}_zoomFromCenter(e){const{width:n,height:r}=this.getViewportProps();return this.zoom({pos:[n/2,r/2],scale:e})}_panFromCenter(e){const{width:n,height:r}=this.getViewportProps();return this.pan({startPos:[n/2,r/2],pos:[n/2+e[0],r/2+e[1]]})}_getUpdatedState(e){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...e})}_unproject(e){const n=this.makeViewport(this.getViewportProps());return e&&n.unproject(e)}_getNewRotation(e,n,r,i){const s=e[0]-n[0],l=e[1]-n[1],c=e[1],f=n[1],{width:d,height:g}=this.getViewportProps(),m=s/d;let v=0;l>0?Math.abs(g-f)>sC&&(v=l/(f-g)*sY):l<0&&f>sC&&(v=1-c/f),v=ka(v,-1,1);const{minPitch:S,maxPitch:E}=this.getViewportProps(),w=i+180*m;let b=r;return v>0?b=r+v*(E-r):v<0&&(b=r-v*(S-r)),{pitch:b,bearing:w}}}class oY extends rY{constructor(){super(...arguments),this.ControllerState=aY,this.transition={transitionDuration:300,transitionInterpolator:new DO({transitionProps:{compare:["longitude","latitude","zoom","bearing","pitch","position"],required:["longitude","latitude","zoom"]}})},this.dragMode="pan"}setProps(e){e.position=e.position||[0,0,0];const n=this.props;super.setProps(e),(!n||n.height!==e.height)&&this.updateViewport(new this.ControllerState({makeViewport:this.makeViewport,...e,...this.state}))}}class FO extends Uc{constructor(e={}){super(e)}getViewportType(){return Bc}get ControllerType(){return oY}}FO.displayName="MapView";const lY=new AO;function cY(t,e){const n=t.order??1/0,r=e.order??1/0;return n-r}class uY{constructor(e){this._resolvedEffects=[],this._defaultEffects=[],this.effects=[],this._context=e,this._needsRedraw="Initial render",this._setEffects([])}addDefaultEffect(e){const n=this._defaultEffects;if(!n.find(r=>r.id===e.id)){const r=n.findIndex(i=>cY(i,e)>0);r<0?n.push(e):n.splice(r,0,e),e.setup(this._context),this._setEffects(this.effects)}}setProps(e){"effects"in e&&(Ji(e.effects,this.effects,1)||this._setEffects(e.effects))}needsRedraw(e={clearRedrawFlags:!1}){const n=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),n}getEffects(){return this._resolvedEffects}_setEffects(e){const n={};for(const i of this.effects)n[i.id]=i;const r=[];for(const i of e){const s=n[i.id];let l=i;s&&s!==i?s.setProps?(s.setProps(i.props),l=s):s.cleanup(this._context):s||i.setup(this._context),r.push(l),delete n[i.id]}for(const i in n)n[i].cleanup(this._context);this.effects=r,this._resolvedEffects=r.concat(this._defaultEffects),e.some(i=>i instanceof AO)||this._resolvedEffects.push(lY),this._needsRedraw="effects changed"}finalize(){for(const e of this._resolvedEffects)e.cleanup(this._context);this.effects.length=0,this._resolvedEffects.length=0,this._defaultEffects.length=0}}class fY extends Ib{shouldDrawLayer(e){const{operation:n}=e.props;return n.includes("draw")||n.includes("terrain")}}const dY="deckRenderer.renderLayers";class hY{constructor(e){this.device=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new fY(e),this.pickLayersPass=new PO(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){if(!e.viewports.length)return;const n=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,r={layerFilter:this.layerFilter,isPicking:this.drawPickingColors,...e};r.effects&&this._preRender(r.effects,r);const i=this.lastPostProcessEffect?this.renderBuffers[0]:r.target;this.lastPostProcessEffect&&(r.clearColor=[0,0,0,0],r.clearCanvas=!0);const s=n.render({...r,target:i});r.effects&&this._postRender(r.effects,r),this.renderCount++,jr(dY,this,s,e)}needsRedraw(e={clearRedrawFlags:!1}){const n=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),n}finalize(){const{renderBuffers:e}=this;for(const n of e)n.delete();e.length=0}_preRender(e,n){this.lastPostProcessEffect=null,n.preRenderStats=n.preRenderStats||{};for(const r of e)n.preRenderStats[r.id]=r.preRender(n),r.postRender&&(this.lastPostProcessEffect=r.id);this.lastPostProcessEffect&&this._resizeRenderBuffers()}_resizeRenderBuffers(){const{renderBuffers:e}=this,n=this.device.canvasContext.getDrawingBufferSize();e.length===0&&[0,1].map(r=>{const i=this.device.createTexture({sampler:{minFilter:"linear",magFilter:"linear"}});e.push(this.device.createFramebuffer({id:`deck-renderbuffer-${r}`,colorAttachments:[i]}))});for(const r of e)r.resize(n)}_postRender(e,n){const{renderBuffers:r}=this,i={...n,inputBuffer:r[0],swapBuffer:r[1]};for(const s of e)if(s.postRender){i.target=s.id===this.lastPostProcessEffect?n.target:void 0;const l=s.postRender(i);i.inputBuffer=l,i.swapBuffer=l===r[0]?r[1]:r[0]}}}const gY={pickedColor:null,pickedObjectIndex:-1};function pY({pickedColors:t,decodePickingColor:e,deviceX:n,deviceY:r,deviceRadius:i,deviceRect:s}){const{x:l,y:c,width:f,height:d}=s;let g=i*i,m=-1,v=0;for(let S=0;S<d;S++){const E=S+c-r,w=E*E;if(w>g)v+=4*f;else for(let b=0;b<f;b++){if(t[v+3]-1>=0){const T=b+l-n,C=T*T+w;C<=g&&(g=C,m=v)}v+=4}}if(m>=0){const S=t.slice(m,m+4),E=e(S);if(E){const w=Math.floor(m/4/f),b=m/4-w*f;return{...E,pickedColor:S,pickedX:l+b,pickedY:c+w}}Sn.error("Picked non-existent layer. Is picking buffer corrupt?")()}return gY}function mY({pickedColors:t,decodePickingColor:e}){const n=new Map;if(t){for(let r=0;r<t.length;r+=4)if(t[r+3]-1>=0){const s=t.slice(r,r+4),l=s.join(",");if(!n.has(l)){const c=e(s);c?n.set(l,{...c,color:s}):Sn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(n.values())}function kO({pickInfo:t,viewports:e,pixelRatio:n,x:r,y:i,z:s}){let l=e[0];e.length>1&&(l=_Y((t==null?void 0:t.pickedViewports)||e,{x:r,y:i}));let c;if(l){const f=[r-l.x,i-l.y];s!==void 0&&(f[2]=s),c=l.unproject(f)}return{color:null,layer:null,viewport:l,index:-1,picked:!1,x:r,y:i,pixel:[r,i],coordinate:c,devicePixel:t&&"pickedX"in t?[t.pickedX,t.pickedY]:void 0,pixelRatio:n}}function vY(t){const{pickInfo:e,lastPickedInfo:n,mode:r,layers:i}=t,{pickedColor:s,pickedLayer:l,pickedObjectIndex:c}=e,f=l?[l]:[];if(r==="hover"){const m=n.index,v=n.layerId,S=l?l.props.id:null;if(S!==v||c!==m){if(S!==v){const E=i.find(w=>w.props.id===v);E&&f.unshift(E)}n.layerId=S,n.index=c,n.info=null}}const d=kO(t),g=new Map;return g.set(null,d),f.forEach(m=>{let v={...d};m===l&&(v.color=s,v.index=c,v.picked=!0),v=BO({layer:m,info:v,mode:r});const S=v.layer;m===l&&r==="hover"&&(n.info=v),g.set(S.id,v),r==="hover"&&S.updateAutoHighlight(v)}),g}function BO({layer:t,info:e,mode:n}){for(;t&&e;){const r=e.layer||null;e.sourceLayer=r,e.layer=t,e=t.getPickingInfo({info:e,mode:n,sourceLayer:r}),t=t.parent}return e}function _Y(t,e){for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.containsPixel(e))return r}return t[0]}class yY{constructor(e){this._pickable=!0,this.device=e,this.pickLayersPass=new PO(e),this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.destroy(),this.depthFBO&&this.depthFBO.destroy()}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:n,layers:r,viewports:i},s=this.lastPickedInfo.info){const l=s&&s.layer&&s.layer.id,c=s&&s.viewport&&s.viewport.id,f=l?r.find(v=>v.id===l):null,d=c&&i.find(v=>v.id===c)||i[0],g=d&&d.unproject([e-d.x,n-d.y]);return{...s,...{x:e,y:n,viewport:d,coordinate:g,layer:f}}}_resizeBuffer(){var n,r;if(!this.pickingFBO&&(this.pickingFBO=this.device.createFramebuffer({colorAttachments:["rgba8unorm"],depthStencilAttachment:"depth16unorm"}),this.device.isTextureFormatRenderable("rgba32float"))){const i=this.device.createFramebuffer({colorAttachments:["rgba32float"],depthStencilAttachment:"depth16unorm"});this.depthFBO=i}const{canvas:e}=this.device.getDefaultCanvasContext();(n=this.pickingFBO)==null||n.resize({width:e.width,height:e.height}),(r=this.depthFBO)==null||r.resize({width:e.width,height:e.height})}_getPickable(e){if(this._pickable===!1)return null;const n=e.filter(r=>this.pickLayersPass.shouldDrawLayer(r)&&!r.isComposite);return n.length?n:null}_pickClosestObject({layers:e,views:n,viewports:r,x:i,y:s,radius:l=0,depth:c=1,mode:f="query",unproject3D:d,onViewportActive:g,effects:m}){const v=this.device.canvasContext.cssToDeviceRatio(),S=this._getPickable(e);if(!S||r.length===0)return{result:[],emptyInfo:kO({viewports:r,x:i,y:s,pixelRatio:v})};this._resizeBuffer();const E=this.device.canvasContext.cssToDevicePixels([i,s],!0),w=[E.x+Math.floor(E.width/2),E.y+Math.floor(E.height/2)],b=Math.round(l*v),{width:A,height:T}=this.pickingFBO,C=this._getPickingRect({deviceX:w[0],deviceY:w[1],deviceRadius:b,deviceWidth:A,deviceHeight:T}),M={x:i-l,y:s-l,width:l*2+1,height:l*2+1};let x;const N=[],F=new Set;for(let L=0;L<c;L++){let I;if(C){const B=this._drawAndSample({layers:S,views:n,viewports:r,onViewportActive:g,deviceRect:C,cullRect:M,effects:m,pass:`picking:${f}`});I=pY({...B,deviceX:w[0],deviceY:w[1],deviceRadius:b,deviceRect:C})}else I={pickedColor:null,pickedObjectIndex:-1};let V;if(I.pickedLayer&&d&&this.depthFBO){const{pickedColors:B}=this._drawAndSample({layers:[I.pickedLayer],views:n,viewports:r,onViewportActive:g,deviceRect:{x:I.pickedX,y:I.pickedY,width:1,height:1},cullRect:M,effects:m,pass:`picking:${f}:z`},!0);B[3]&&(V=B[0])}I.pickedLayer&&L+1<c&&(F.add(I.pickedLayer),I.pickedLayer.disablePickingIndex(I.pickedObjectIndex)),x=vY({pickInfo:I,lastPickedInfo:this.lastPickedInfo,mode:f,layers:S,viewports:r,x:i,y:s,z:V,pixelRatio:v});for(const B of x.values())B.layer&&N.push(B);if(!I.pickedColor)break}for(const L of F)L.restorePickingColors();return{result:N,emptyInfo:x.get(null)}}_pickVisibleObjects({layers:e,views:n,viewports:r,x:i,y:s,width:l=1,height:c=1,mode:f="query",maxObjects:d=null,onViewportActive:g,effects:m}){const v=this._getPickable(e);if(!v||r.length===0)return[];this._resizeBuffer();const S=this.device.canvasContext.cssToDeviceRatio(),E=this.device.canvasContext.cssToDevicePixels([i,s],!0),w=E.x,b=E.y+E.height,A=this.device.canvasContext.cssToDevicePixels([i+l,s+c],!0),T=A.x+A.width,C=A.y,M={x:w,y:C,width:T-w,height:b-C},x=this._drawAndSample({layers:v,views:n,viewports:r,onViewportActive:g,deviceRect:M,cullRect:{x:i,y:s,width:l,height:c},effects:m,pass:`picking:${f}`}),N=mY(x),F=new Map,L=[],I=Number.isFinite(d);for(let V=0;V<N.length&&!(I&&L.length>=d);V++){const B=N[V];let j={color:B.pickedColor,layer:null,index:B.pickedObjectIndex,picked:!0,x:i,y:s,pixelRatio:S};j=BO({layer:B.pickedLayer,info:j,mode:f});const X=j.layer.id;F.has(X)||F.set(X,new Set);const Y=F.get(X),ae=j.object??j.index;Y.has(ae)||(Y.add(ae),L.push(j))}return L}_drawAndSample({layers:e,views:n,viewports:r,onViewportActive:i,deviceRect:s,cullRect:l,effects:c,pass:f},d=!1){const g=d?this.depthFBO:this.pickingFBO,m={layers:e,layerFilter:this.layerFilter,views:n,viewports:r,onViewportActive:i,pickingFBO:g,deviceRect:s,cullRect:l,effects:c,pass:f,pickZ:d,preRenderStats:{},isPicking:!0};for(const T of c)T.useInPicking&&(m.preRenderStats[T.id]=T.preRender(m));const{decodePickingColor:v}=this.pickLayersPass.render(m),{x:S,y:E,width:w,height:b}=s,A=new(d?Float32Array:Uint8Array)(w*b*4);return this.device.readPixelsToArrayWebGL(g,{sourceX:S,sourceY:E,sourceWidth:w,sourceHeight:b,target:A}),{pickedColors:A,decodePickingColor:v}}_getPickingRect({deviceX:e,deviceY:n,deviceRadius:r,deviceWidth:i,deviceHeight:s}){const l=Math.max(0,e-r),c=Math.max(0,n-r),f=Math.min(i,e+r+1)-l,d=Math.min(s,n+r+1)-c;return f<=0||d<=0?null:{x:l,y:c,width:f,height:d}}}const bY={"top-left":{top:0,left:0},"top-right":{top:0,right:0},"bottom-left":{bottom:0,left:0},"bottom-right":{bottom:0,right:0},fill:{top:0,left:0,bottom:0,right:0}},SY="top-left",aC="__root";class wY{constructor({deck:e,parentElement:n}){this.defaultWidgets=[],this.widgets=[],this.resolvedWidgets=[],this.containers={},this.lastViewports={},this.deck=e,this.parentElement=n}getWidgets(){return this.resolvedWidgets}setProps(e){e.widgets&&!Ji(e.widgets,this.widgets,1)&&this._setWidgets(e.widgets)}finalize(){for(const e of this.getWidgets())this._remove(e);this.defaultWidgets.length=0,this.resolvedWidgets.length=0;for(const e in this.containers)this.containers[e].remove()}addDefault(e){this.defaultWidgets.find(n=>n.id===e.id)||(this._add(e),this.defaultWidgets.push(e),this._setWidgets(this.widgets))}_setWidgets(e){const n={};for(const r of this.resolvedWidgets)n[r.id]=r;this.resolvedWidgets.length=0;for(const r of this.defaultWidgets)n[r.id]=null,this.resolvedWidgets.push(r);for(let r of e){const i=n[r.id];i?i.viewId!==r.viewId||i.placement!==r.placement?(this._remove(i),this._add(r)):r!==i&&(i.setProps(r.props),r=i):this._add(r),n[r.id]=null,this.resolvedWidgets.push(r)}for(const r in n){const i=n[r];i&&this._remove(i)}this.widgets=e}_add(e){const{viewId:n=null,placement:r=SY}=e,i=e.onAdd({deck:this.deck,viewId:n});i&&this._getContainer(n,r).append(i),e._element=i}_remove(e){var n;(n=e.onRemove)==null||n.call(e),e._element&&e._element.remove(),e._element=void 0}_getContainer(e,n){var l;const r=e||aC;let i=this.containers[r];i||(i=document.createElement("div"),i.style.pointerEvents="none",i.style.position="absolute",i.style.overflow="hidden",(l=this.parentElement)==null||l.append(i),this.containers[r]=i);let s=i.querySelector(`.${n}`);return s||(s=document.createElement("div"),s.className=n,s.style.position="absolute",s.style.zIndex="2",Object.assign(s.style,bY[n]),i.append(s)),s}_updateContainers(){const e=this.deck.width,n=this.deck.height;for(const r in this.containers){const i=this.lastViewports[r]||null,s=r===aC||i,l=this.containers[r];s?(l.style.display="block",l.style.left=`${i?i.x:0}px`,l.style.top=`${i?i.y:0}px`,l.style.width=`${i?i.width:e}px`,l.style.height=`${i?i.height:n}px`):l.style.display="none"}}onRedraw({viewports:e,layers:n}){var i,s;const r=e.reduce((l,c)=>(l[c.id]=c,l),{});for(const l of this.getWidgets()){const{viewId:c}=l;if(c){const f=r[c];f&&(l.onViewportChange&&l.onViewportChange(f),(i=l.onRedraw)==null||i.call(l,{viewports:[f],layers:n}))}else{if(l.onViewportChange)for(const f of e)l.onViewportChange(f);(s=l.onRedraw)==null||s.call(l,{viewports:e,layers:n})}}this.lastViewports=r,this._updateContainers()}onHover(e,n){var r,i;for(const s of this.getWidgets()){const{viewId:l}=s;(!l||l===((r=e.viewport)==null?void 0:r.id))&&((i=s.onHover)==null||i.call(s,e,n))}}onEvent(e,n){var i,s;const r=my[n.type];if(r)for(const l of this.getWidgets()){const{viewId:c}=l;(!c||c===((i=e.viewport)==null?void 0:i.id))&&((s=l[r])==null||s.call(l,e,n))}}}const EY={zIndex:"1",position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:"0",left:"0",display:"none"};class TY{constructor(){this.id="default-tooltip",this.placement="fill",this.props={},this.isVisible=!1}onAdd({deck:e}){const n=document.createElement("div");return n.className="deck-tooltip",Object.assign(n.style,EY),this.deck=e,this.element=n,n}onRemove(){this.deck=void 0,this.element=void 0}setProps(){}onViewportChange(e){var n;this.isVisible&&e.id===((n=this.lastViewport)==null?void 0:n.id)&&e!==this.lastViewport&&this.setTooltip(null)}onHover(e){const{deck:n}=this,r=n&&n.props.getTooltip;if(!r)return;const i=r(e);this.lastViewport=e.viewport,this.setTooltip(i,e.x,e.y)}setTooltip(e,n,r){const i=this.element;if(i){if(typeof e=="string")i.innerText=e;else if(e)e.text&&(i.innerText=e.text),e.html&&(i.innerHTML=e.html),e.className&&(i.className=e.className);else{this.isVisible=!1,i.style.display="none";return}this.isVisible=!0,i.style.display="block",i.style.transform=`translate(${n}px, ${r}px)`,e&&typeof e=="object"&&"style"in e&&Object.assign(i.style,e.style)}}}var Gl;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",t[t.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.CULL_FACE=2884]="CULL_FACE",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.BLEND=3042]="BLEND",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.DITHER=3024]="DITHER",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DOUBLE=5130]="DOUBLE",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",t[t.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.READ_BUFFER=3074]="READ_BUFFER",t[t.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",t[t.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",t[t.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",t[t.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",t[t.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",t[t.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",t[t.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",t[t.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",t[t.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",t[t.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",t[t.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",t[t.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",t[t.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",t[t.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",t[t.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",t[t.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",t[t.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",t[t.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",t[t.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",t[t.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",t[t.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",t[t.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",t[t.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",t[t.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",t[t.RED=6403]="RED",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB10_A2=32857]="RGB10_A2",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",t[t.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",t[t.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",t[t.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",t[t.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",t[t.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",t[t.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",t[t.SRGB=35904]="SRGB",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",t[t.RGBA32F=34836]="RGBA32F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.RGB16F=34843]="RGB16F",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R16F=33325]="R16F",t[t.R32F=33326]="R32F",t[t.RG16F=33327]="RG16F",t[t.RG32F=33328]="RG32F",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2UI=36975]="RGB10_A2UI",t[t.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",t[t.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.RG=33319]="RG",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",t[t.CURRENT_QUERY=34917]="CURRENT_QUERY",t[t.QUERY_RESULT=34918]="QUERY_RESULT",t[t.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",t[t.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",t[t.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",t[t.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",t[t.DRAW_BUFFER0=34853]="DRAW_BUFFER0",t[t.DRAW_BUFFER1=34854]="DRAW_BUFFER1",t[t.DRAW_BUFFER2=34855]="DRAW_BUFFER2",t[t.DRAW_BUFFER3=34856]="DRAW_BUFFER3",t[t.DRAW_BUFFER4=34857]="DRAW_BUFFER4",t[t.DRAW_BUFFER5=34858]="DRAW_BUFFER5",t[t.DRAW_BUFFER6=34859]="DRAW_BUFFER6",t[t.DRAW_BUFFER7=34860]="DRAW_BUFFER7",t[t.DRAW_BUFFER8=34861]="DRAW_BUFFER8",t[t.DRAW_BUFFER9=34862]="DRAW_BUFFER9",t[t.DRAW_BUFFER10=34863]="DRAW_BUFFER10",t[t.DRAW_BUFFER11=34864]="DRAW_BUFFER11",t[t.DRAW_BUFFER12=34865]="DRAW_BUFFER12",t[t.DRAW_BUFFER13=34866]="DRAW_BUFFER13",t[t.DRAW_BUFFER14=34867]="DRAW_BUFFER14",t[t.DRAW_BUFFER15=34868]="DRAW_BUFFER15",t[t.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",t[t.MAX_SAMPLES=36183]="MAX_SAMPLES",t[t.SAMPLER_BINDING=35097]="SAMPLER_BINDING",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",t[t.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",t[t.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",t[t.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",t[t.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",t[t.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",t[t.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",t[t.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",t[t.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",t[t.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",t[t.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",t[t.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",t[t.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",t[t.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",t[t.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",t[t.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",t[t.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",t[t.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",t[t.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",t[t.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",t[t.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",t[t.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",t[t.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",t[t.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",t[t.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",t[t.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",t[t.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",t[t.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",t[t.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",t[t.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",t[t.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",t[t.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",t[t.UNIFORM_TYPE=35383]="UNIFORM_TYPE",t[t.UNIFORM_SIZE=35384]="UNIFORM_SIZE",t[t.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",t[t.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",t[t.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",t[t.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",t[t.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",t[t.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",t[t.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",t[t.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",t[t.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS",t[t.SYNC_FENCE=37142]="SYNC_FENCE",t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED",t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED",t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",t[t.COLOR=6144]="COLOR",t[t.DEPTH=6145]="DEPTH",t[t.STENCIL=6146]="STENCIL",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STREAM_COPY=35042]="STREAM_COPY",t[t.STATIC_READ=35045]="STATIC_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",t[t.INVALID_INDEX=4294967295]="INVALID_INDEX",t[t.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",t[t.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",t[t.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",t[t.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",t[t.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",t[t.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",t[t.R16_EXT=33322]="R16_EXT",t[t.RG16_EXT=33324]="RG16_EXT",t[t.RGB16_EXT=32852]="RGB16_EXT",t[t.RGBA16_EXT=32859]="RGBA16_EXT",t[t.R16_SNORM_EXT=36760]="R16_SNORM_EXT",t[t.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",t[t.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",t[t.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",t[t.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",t[t.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",t[t.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",t[t.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",t[t.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",t[t.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",t[t.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",t[t.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",t[t.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",t[t.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",t[t.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",t[t.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",t[t.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",t[t.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR",t[t.DEPTH_CLAMP_EXT=34383]="DEPTH_CLAMP_EXT",t[t.FIRST_VERTEX_CONVENTION_WEBGL=36429]="FIRST_VERTEX_CONVENTION_WEBGL",t[t.LAST_VERTEX_CONVENTION_WEBGL=36430]="LAST_VERTEX_CONVENTION_WEBGL",t[t.PROVOKING_VERTEX_WEBL=36431]="PROVOKING_VERTEX_WEBL",t[t.POLYGON_MODE_WEBGL=2880]="POLYGON_MODE_WEBGL",t[t.POLYGON_OFFSET_LINE_WEBGL=10754]="POLYGON_OFFSET_LINE_WEBGL",t[t.LINE_WEBGL=6913]="LINE_WEBGL",t[t.FILL_WEBGL=6914]="FILL_WEBGL",t[t.MAX_CLIP_DISTANCES_WEBGL=3378]="MAX_CLIP_DISTANCES_WEBGL",t[t.MAX_CULL_DISTANCES_WEBGL=33529]="MAX_CULL_DISTANCES_WEBGL",t[t.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL=33530]="MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL",t[t.CLIP_DISTANCE0_WEBGL=12288]="CLIP_DISTANCE0_WEBGL",t[t.CLIP_DISTANCE1_WEBGL=12289]="CLIP_DISTANCE1_WEBGL",t[t.CLIP_DISTANCE2_WEBGL=12290]="CLIP_DISTANCE2_WEBGL",t[t.CLIP_DISTANCE3_WEBGL=12291]="CLIP_DISTANCE3_WEBGL",t[t.CLIP_DISTANCE4_WEBGL=12292]="CLIP_DISTANCE4_WEBGL",t[t.CLIP_DISTANCE5_WEBGL=12293]="CLIP_DISTANCE5_WEBGL",t[t.CLIP_DISTANCE6_WEBGL=12294]="CLIP_DISTANCE6_WEBGL",t[t.CLIP_DISTANCE7_WEBGL=12295]="CLIP_DISTANCE7_WEBGL",t[t.POLYGON_OFFSET_CLAMP_EXT=36379]="POLYGON_OFFSET_CLAMP_EXT",t[t.LOWER_LEFT_EXT=36001]="LOWER_LEFT_EXT",t[t.UPPER_LEFT_EXT=36002]="UPPER_LEFT_EXT",t[t.NEGATIVE_ONE_TO_ONE_EXT=37726]="NEGATIVE_ONE_TO_ONE_EXT",t[t.ZERO_TO_ONE_EXT=37727]="ZERO_TO_ONE_EXT",t[t.CLIP_ORIGIN_EXT=37724]="CLIP_ORIGIN_EXT",t[t.CLIP_DEPTH_MODE_EXT=37725]="CLIP_DEPTH_MODE_EXT",t[t.SRC1_COLOR_WEBGL=35065]="SRC1_COLOR_WEBGL",t[t.SRC1_ALPHA_WEBGL=34185]="SRC1_ALPHA_WEBGL",t[t.ONE_MINUS_SRC1_COLOR_WEBGL=35066]="ONE_MINUS_SRC1_COLOR_WEBGL",t[t.ONE_MINUS_SRC1_ALPHA_WEBGL=35067]="ONE_MINUS_SRC1_ALPHA_WEBGL",t[t.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL=35068]="MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL",t[t.MIRROR_CLAMP_TO_EDGE_EXT=34627]="MIRROR_CLAMP_TO_EDGE_EXT"})(Gl||(Gl={}));const Fb={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,35725:null,36006:null,36007:null,34229:null,34964:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32926:!1,32928:!1,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],36389:null,36662:null,36663:null,35053:null,35055:null,35723:4352,36010:null,35977:!1,3333:4,3317:4,37440:!1,37441:!1,37443:37444,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},sr=(t,e,n)=>e?t.enable(n):t.disable(n),oC=(t,e,n)=>t.hint(n,e),oi=(t,e,n)=>t.pixelStorei(n,e),lC=(t,e,n)=>{const r=n===36006?36009:36008;return t.bindFramebuffer(r,e)},qu=(t,e,n)=>{const i={34964:34962,36662:36662,36663:36663,35053:35051,35055:35052}[n];t.bindBuffer(i,e)};function A0(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}const AY={3042:sr,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:sr,2885:(t,e)=>t.cullFace(e),2929:sr,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:sr,35723:oC,35725:(t,e)=>t.useProgram(e),36007:(t,e)=>t.bindRenderbuffer(36161,e),36389:(t,e)=>{var n;return(n=t.bindTransformFeedback)==null?void 0:n.call(t,36386,e)},34229:(t,e)=>t.bindVertexArray(e),36006:lC,36010:lC,34964:qu,36662:qu,36663:qu,35053:qu,35055:qu,2886:(t,e)=>t.frontFace(e),33170:oC,2849:(t,e)=>t.lineWidth(e),32823:sr,32824:"polygonOffset",10752:"polygonOffset",35977:sr,32926:sr,32928:sr,32938:"sampleCoverage",32939:"sampleCoverage",3089:sr,3088:(t,e)=>t.scissor(...e),2960:sr,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),34383:sr,10754:sr,12288:sr,12289:sr,12290:sr,12291:sr,12292:sr,12293:sr,12294:sr,12295:sr,3333:oi,3317:oi,37440:oi,37441:oi,37443:oi,3330:oi,3332:oi,3331:oi,3314:oi,32878:oi,3316:oi,3315:oi,32877:oi,framebuffer:(t,e)=>{const n=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,n)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{const n=typeof e=="number"?[e,e]:e;t.blendEquationSeparate(...n)},blendFunc:(t,e)=>{const n=(e==null?void 0:e.length)===2?[...e,...e]:e;t.blendFuncSeparate(...n)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(e[0],e[1]||!1),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=A0(e)?e:[e,e];const[n,r]=e;t.stencilMaskSeparate(1028,n),t.stencilMaskSeparate(1029,r)},stencilFunc:(t,e)=>{e=A0(e)&&e.length===3?[...e,...e]:e;const[n,r,i,s,l,c]=e;t.stencilFuncSeparate(1028,n,r,i),t.stencilFuncSeparate(1029,s,l,c)},stencilOp:(t,e)=>{e=A0(e)&&e.length===3?[...e,...e]:e;const[n,r,i,s,l,c]=e;t.stencilOpSeparate(1028,n,r,i),t.stencilOpSeparate(1029,s,l,c)},viewport:(t,e)=>t.viewport(...e)};function qn(t,e,n){return e[t]!==void 0?e[t]:n[t]}const CY={blendEquation:(t,e,n)=>t.blendEquationSeparate(qn(32777,e,n),qn(34877,e,n)),blendFunc:(t,e,n)=>t.blendFuncSeparate(qn(32969,e,n),qn(32968,e,n),qn(32971,e,n),qn(32970,e,n)),polygonOffset:(t,e,n)=>t.polygonOffset(qn(32824,e,n),qn(10752,e,n)),sampleCoverage:(t,e,n)=>t.sampleCoverage(qn(32938,e,n),qn(32939,e,n)),stencilFuncFront:(t,e,n)=>t.stencilFuncSeparate(1028,qn(2962,e,n),qn(2967,e,n),qn(2963,e,n)),stencilFuncBack:(t,e,n)=>t.stencilFuncSeparate(1029,qn(34816,e,n),qn(36003,e,n),qn(36004,e,n)),stencilOpFront:(t,e,n)=>t.stencilOpSeparate(1028,qn(2964,e,n),qn(2965,e,n),qn(2966,e,n)),stencilOpBack:(t,e,n)=>t.stencilOpSeparate(1029,qn(34817,e,n),qn(34818,e,n),qn(34819,e,n))},cC={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,n)=>t({[e]:n}),hint:(t,e,n)=>t({[e]:n}),useProgram:(t,e)=>t({35725:e}),bindRenderbuffer:(t,e,n)=>t({36007:n}),bindTransformFeedback:(t,e,n)=>t({36389:n}),bindVertexArray:(t,e)=>t({34229:e}),bindFramebuffer:(t,e,n)=>{switch(e){case 36160:return t({36006:n,36010:n});case 36009:return t({36006:n});case 36008:return t({36010:n});default:return null}},bindBuffer:(t,e,n)=>{const r={34962:[34964],36662:[36662],36663:[36663],35051:[35053],35052:[35055]}[e];return r?t({[r]:n}):{valueChanged:!0}},blendColor:(t,e,n,r,i)=>t({32773:new Float32Array([e,n,r,i])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,n)=>t({32777:e,34877:n}),blendFunc:(t,e,n)=>t({32969:e,32968:n,32971:e,32970:n}),blendFuncSeparate:(t,e,n,r,i)=>t({32969:e,32968:n,32971:r,32970:i}),clearColor:(t,e,n,r,i)=>t({3106:new Float32Array([e,n,r,i])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,n,r,i)=>t({3107:[e,n,r,i]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,n)=>t({2928:new Float32Array([e,n])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,n)=>t({32824:e,10752:n}),sampleCoverage:(t,e,n)=>t({32938:e,32939:n}),scissor:(t,e,n,r,i)=>t({3088:new Int32Array([e,n,r,i])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,n)=>t({[e===1028?2968:36005]:n}),stencilFunc:(t,e,n,r)=>t({2962:e,2967:n,2963:r,34816:e,36003:n,36004:r}),stencilFuncSeparate:(t,e,n,r,i)=>t({[e===1028?2962:34816]:n,[e===1028?2967:36003]:r,[e===1028?2963:36004]:i}),stencilOp:(t,e,n,r)=>t({2964:e,2965:n,2966:r,34817:e,34818:n,34819:r}),stencilOpSeparate:(t,e,n,r,i)=>t({[e===1028?2964:34817]:n,[e===1028?2965:34818]:r,[e===1028?2966:34819]:i}),viewport:(t,e,n,r,i)=>t({2978:[e,n,r,i]})},us=(t,e)=>t.isEnabled(e),uC={3042:us,2884:us,2929:us,3024:us,32823:us,32926:us,32928:us,3089:us,2960:us,35977:us},RY=new Set([34016,36388,36387,35983,35368,34965,35739,35738,3074,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34866,34867,34868,35097,32873,35869,32874,34068]);function Yc(t,e){if(MY(e))return;const n={};for(const i in e){const s=Number(i),l=AY[i];l&&(typeof l=="string"?n[l]=!0:l(t,e[i],s))}const r=t.state&&t.state.cache;if(r)for(const i in n){const s=CY[i];s(t,e,r)}}function UO(t,e=Fb){if(typeof e=="number"){const i=e,s=uC[i];return s?s(t,i):t.getParameter(i)}const n=Array.isArray(e)?e:Object.keys(e),r={};for(const i of n){const s=uC[i];r[i]=s?s(t,Number(i)):t.getParameter(Number(i))}return r}function xY(t){Yc(t,Fb)}function MY(t){for(const e in t)return!1;return!0}function OY(t,e){if(t===e)return!0;const n=Array.isArray(t)||ArrayBuffer.isView(t),r=Array.isArray(e)||ArrayBuffer.isView(e);if(n&&r&&t.length===e.length){for(let i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}return!1}class Lo{constructor(e,n){O(this,"gl");O(this,"program",null);O(this,"stateStack",[]);O(this,"enable",!0);O(this,"cache",null);O(this,"log");O(this,"initialized",!1);this.gl=e,this.log=(n==null?void 0:n.log)||(()=>{}),this._updateCache=this._updateCache.bind(this),Object.seal(this)}static get(e){return e.state}push(e={}){this.stateStack.push({})}pop(){const e=this.stateStack[this.stateStack.length-1];Yc(this.gl,e),this.stateStack.pop()}trackState(e,n){if(this.cache=n.copyState?UO(e):Object.assign({},Fb),this.initialized)throw new Error("WebGLStateTracker");this.initialized=!0,this.gl.state=this,NY(e);for(const r in cC){const i=cC[r];PY(e,r,i)}fC(e,"getParameter"),fC(e,"isEnabled")}_updateCache(e){let n=!1,r;const i=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(const s in e){const l=e[s],c=this.cache[s];OY(l,c)||(n=!0,r=c,i&&!(s in i)&&(i[s]=c),this.cache[s]=l)}return{valueChanged:n,oldValue:r}}}function fC(t,e){const n=t[e].bind(t);t[e]=function(i){if(i===void 0||RY.has(i))return n(i);const s=Lo.get(t);return i in s.cache||(s.cache[i]=n(i)),s.enable?s.cache[i]:n(i)},Object.defineProperty(t[e],"name",{value:`${e}-from-cache`,configurable:!1})}function PY(t,e,n){if(!t[e])return;const r=t[e].bind(t);t[e]=function(...s){const l=Lo.get(t),{valueChanged:c,oldValue:f}=n(l._updateCache,...s);return c&&r(...s),f},Object.defineProperty(t[e],"name",{value:`${e}-to-cache`,configurable:!1})}function NY(t){const e=t.useProgram.bind(t);t.useProgram=function(r){const i=Lo.get(t);i.program!==r&&(e(r),i.program=r)}}function IY(t,e,n){let r="";const i={preserveDrawingBuffer:!0,...n};let s=null;if(s||(s=t.getContext("webgl2",i)),i.failIfMajorPerformanceCaveat&&(r||(r="Only software GPU is available. Set `failIfMajorPerformanceCaveat: false` to allow.")),!s&&!n.failIfMajorPerformanceCaveat&&(i.failIfMajorPerformanceCaveat=!1,s=t.getContext("webgl2",i),s.luma||(s.luma={}),s.luma.softwareRenderer=!0),s||(s=t.getContext("webgl",{}),s&&(s=null,r||(r="Your browser only supports WebGL1"))),!s)throw r||(r="Your browser does not support WebGL"),new Error(`Failed to create WebGL context: ${r}`);const{onContextLost:l,onContextRestored:c}=e;return t.addEventListener("webglcontextlost",f=>l(f),!1),t.addEventListener("webglcontextrestored",f=>c(f),!1),s.luma||(s.luma={}),s}function Lc(t,e,n){return n[e]===void 0&&(n[e]=t.getExtension(e)||null),n[e]}function DY(t,e){const n=t.getParameter(7936),r=t.getParameter(7937);Lc(t,"WEBGL_debug_renderer_info",e);const i=e.WEBGL_debug_renderer_info,s=t.getParameter(i?i.UNMASKED_VENDOR_WEBGL:7936),l=t.getParameter(i?i.UNMASKED_RENDERER_WEBGL:7937),c=s||n,f=l||r,d=t.getParameter(7938),g=LO(c,f),m=FY(c,f),v=kY(c,f);return{type:"webgl",gpu:g,gpuType:v,gpuBackend:m,vendor:c,renderer:f,version:d,shadingLanguage:"glsl",shadingLanguageVersion:300}}function LO(t,e){return/NVIDIA/i.exec(t)||/NVIDIA/i.exec(e)?"nvidia":/INTEL/i.exec(t)||/INTEL/i.exec(e)?"intel":/Apple/i.exec(t)||/Apple/i.exec(e)?"apple":/AMD/i.exec(t)||/AMD/i.exec(e)||/ATI/i.exec(t)||/ATI/i.exec(e)?"amd":/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e)?"software":"unknown"}function FY(t,e){return/Metal/i.exec(t)||/Metal/i.exec(e)?"metal":/ANGLE/i.exec(t)||/ANGLE/i.exec(e)?"opengl":"unknown"}function kY(t,e){if(/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e))return"cpu";switch(LO(t,e)){case"intel":return"integrated";case"software":return"cpu";case"unknown":return"unknown";default:return"discrete"}}function zO(t){switch(t){case"uint8":return 5121;case"sint8":return 5120;case"unorm8":return 5121;case"snorm8":return 5120;case"uint16":return 5123;case"sint16":return 5122;case"unorm16":return 5123;case"snorm16":return 5122;case"uint32":return 5125;case"sint32":return 5124;case"float16":return 5131;case"float32":return 5126}throw new Error(String(t))}const Ju="WEBGL_compressed_texture_s3tc",ef="WEBGL_compressed_texture_s3tc_srgb",Jl="EXT_texture_compression_rgtc",ec="EXT_texture_compression_bptc",BY="WEBGL_compressed_texture_etc",UY="WEBGL_compressed_texture_astc",LY="WEBGL_compressed_texture_etc1",zY="WEBGL_compressed_texture_pvrtc",$Y="WEBGL_compressed_texture_atc",dC="EXT_texture_norm16",hC="EXT_render_snorm",VY="EXT_color_buffer_float",kb={"float32-renderable-webgl":["EXT_color_buffer_float"],"float16-renderable-webgl":["EXT_color_buffer_half_float"],"rgb9e5ufloat-renderable-webgl":["WEBGL_render_shared_exponent"],"snorm8-renderable-webgl":[hC],"norm16-renderable-webgl":[dC],"snorm16-renderable-webgl":[dC,hC],"float32-filterable":["OES_texture_float_linear"],"float16-filterable-webgl":["OES_texture_half_float_linear"],"texture-filterable-anisotropic-webgl":["EXT_texture_filter_anisotropic"],"texture-blend-float-webgl":["EXT_float_blend"],"texture-compression-bc":[Ju,ef,Jl,ec],"texture-compression-bc5-webgl":[Jl],"texture-compression-bc7-webgl":[ec],"texture-compression-etc2":[BY],"texture-compression-astc":[UY],"texture-compression-etc1-webgl":[LY],"texture-compression-pvrtc-webgl":[zY],"texture-compression-atc-webgl":[$Y]};function HY(t){return t in kb}function jY(t,e,n){return(kb[e]||[]).every(i=>Lc(t,i,n))}const Bb={r8unorm:{gl:33321,rb:!0},r8snorm:{gl:36756},r8uint:{gl:33330,rb:!0},r8sint:{gl:33329,rb:!0},rg8unorm:{gl:33323,rb:!0},rg8snorm:{gl:36757},rg8uint:{gl:33336,rb:!0},rg8sint:{gl:33335,rb:!0},r16uint:{gl:33332,rb:!0},r16sint:{gl:33331,rb:!0},r16float:{gl:33325,rb:!0},"r16unorm-webgl":{gl:33322,rb:!0},"r16snorm-webgl":{gl:36760},"rgba4unorm-webgl":{gl:32854,rb:!0},"rgb565unorm-webgl":{gl:36194,rb:!0},"rgb5a1unorm-webgl":{gl:32855,rb:!0},"rgb8unorm-webgl":{gl:32849},"rgb8snorm-webgl":{gl:36758},rgba8unorm:{gl:32856},"rgba8unorm-srgb":{gl:35907},rgba8snorm:{gl:36759},rgba8uint:{gl:36220},rgba8sint:{gl:36238},bgra8unorm:{},"bgra8unorm-srgb":{},rg16uint:{gl:33338},rg16sint:{gl:33337},rg16float:{gl:33327,rb:!0},"rg16unorm-webgl":{gl:33324},"rg16snorm-webgl":{gl:36761},r32uint:{gl:33334,rb:!0},r32sint:{gl:33333,rb:!0},r32float:{gl:33326},rgb9e5ufloat:{gl:35901},rg11b10ufloat:{gl:35898,rb:!0},rgb10a2unorm:{gl:32857,rb:!0},"rgb10a2uint-webgl":{gl:36975,rb:!0},"rgb16unorm-webgl":{gl:32852},"rgb16snorm-webgl":{gl:36762},rg32uint:{gl:33340,rb:!0},rg32sint:{gl:33339,rb:!0},rg32float:{gl:33328,rb:!0},rgba16uint:{gl:36214,rb:!0},rgba16sint:{gl:36232,rb:!0},rgba16float:{gl:34842},"rgba16unorm-webgl":{gl:32859,rb:!0},"rgba16snorm-webgl":{gl:36763},"rgb32float-webgl":{gl:34837,x:VY,dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,rb:!0},rgba32sint:{gl:36226,rb:!0},rgba32float:{gl:34836,rb:!0},stencil8:{gl:36168,rb:!0},depth16unorm:{gl:33189,dataFormat:6402,types:[5123],rb:!0},depth24plus:{gl:33190,dataFormat:6402,types:[5125]},depth32float:{gl:36012,dataFormat:6402,types:[5126],rb:!0},"depth24plus-stencil8":{gl:35056,rb:!0,depthTexture:!0,dataFormat:34041,types:[34042]},"depth32float-stencil8":{gl:36013,dataFormat:34041,types:[36269],rb:!0},"bc1-rgb-unorm-webgl":{gl:33776,x:Ju},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:ef},"bc1-rgba-unorm":{gl:33777,x:Ju},"bc1-rgba-unorm-srgb":{gl:35916,x:ef},"bc2-rgba-unorm":{gl:33778,x:Ju},"bc2-rgba-unorm-srgb":{gl:35918,x:ef},"bc3-rgba-unorm":{gl:33779,x:Ju},"bc3-rgba-unorm-srgb":{gl:35919,x:ef},"bc4-r-unorm":{gl:36283,x:Jl},"bc4-r-snorm":{gl:36284,x:Jl},"bc5-rg-unorm":{gl:36285,x:Jl},"bc5-rg-snorm":{gl:36286,x:Jl},"bc6h-rgb-ufloat":{gl:36495,x:ec},"bc6h-rgb-float":{gl:36494,x:ec},"bc7-rgba-unorm":{gl:36492,x:ec},"bc7-rgba-unorm-srgb":{gl:36493,x:ec},"etc2-rgb8unorm":{gl:37492},"etc2-rgb8unorm-srgb":{gl:37494},"etc2-rgb8a1unorm":{gl:37496},"etc2-rgb8a1unorm-srgb":{gl:37497},"etc2-rgba8unorm":{gl:37493},"etc2-rgba8unorm-srgb":{gl:37495},"eac-r11unorm":{gl:37488},"eac-r11snorm":{gl:37489},"eac-rg11unorm":{gl:37490},"eac-rg11snorm":{gl:37491},"astc-4x4-unorm":{gl:37808},"astc-4x4-unorm-srgb":{gl:37840},"astc-5x4-unorm":{gl:37809},"astc-5x4-unorm-srgb":{gl:37841},"astc-5x5-unorm":{gl:37810},"astc-5x5-unorm-srgb":{gl:37842},"astc-6x5-unorm":{gl:37811},"astc-6x5-unorm-srgb":{gl:37843},"astc-6x6-unorm":{gl:37812},"astc-6x6-unorm-srgb":{gl:37844},"astc-8x5-unorm":{gl:37813},"astc-8x5-unorm-srgb":{gl:37845},"astc-8x6-unorm":{gl:37814},"astc-8x6-unorm-srgb":{gl:37846},"astc-8x8-unorm":{gl:37815},"astc-8x8-unorm-srgb":{gl:37847},"astc-10x5-unorm":{gl:37819},"astc-10x5-unorm-srgb":{gl:37851},"astc-10x6-unorm":{gl:37817},"astc-10x6-unorm-srgb":{gl:37849},"astc-10x8-unorm":{gl:37818},"astc-10x8-unorm-srgb":{gl:37850},"astc-10x10-unorm":{gl:37819},"astc-10x10-unorm-srgb":{gl:37851},"astc-12x10-unorm":{gl:37820},"astc-12x10-unorm-srgb":{gl:37852},"astc-12x12-unorm":{gl:37821},"astc-12x12-unorm-srgb":{gl:37853},"pvrtc-rgb4unorm-webgl":{gl:35840},"pvrtc-rgba4unorm-webgl":{gl:35842},"pvrtc-rbg2unorm-webgl":{gl:35841},"pvrtc-rgba2unorm-webgl":{gl:35843},"etc1-rbg-unorm-webgl":{gl:36196},"atc-rgb-unorm-webgl":{gl:35986},"atc-rgba-unorm-webgl":{gl:35986},"atc-rgbai-unorm-webgl":{gl:34798}};function WY(t,e,n){let r=e.create;const i=Bb[e.format];return(i==null?void 0:i.gl)===void 0&&(r=!1),i!=null&&i.x&&(r=r&&!!Lc(t,i.x,n)),{format:e.format,create:r&&e.create,render:r&&e.render,filter:r&&e.filter,blend:r&&e.blend,store:r&&e.store}}function $O(t){var i;const e=Bb[t],n=YY(t),r=xb(t);return{internalFormat:n,format:(e==null?void 0:e.dataFormat)||qY(r.channels,r.integer,r.normalized,n),type:r.dataType?zO(r.dataType):((i=e==null?void 0:e.types)==null?void 0:i[0])||5121,compressed:r.compressed||!1}}function XY(t){switch(xb(t).attachment){case"depth":return 36096;case"stencil":return 36128;case"depth-stencil":return 33306;default:throw new Error(`Not a depth stencil format: ${t}`)}}function qY(t,e,n,r){if(r===6408||r===6407)return r;switch(t){case"r":return e&&!n?36244:6403;case"rg":return e&&!n?33320:33319;case"rgb":return e&&!n?36248:6407;case"rgba":return e&&!n?36249:6408;case"bgra":throw new Error("bgra pixels not supported by WebGL");default:return 6408}}function YY(t){const e=Bb[t],n=e==null?void 0:e.gl;if(n===void 0)throw new Error(`Unsupported texture format ${t}`);return n}const gC={"depth-clip-control":"EXT_depth_clamp","timer-query-webgl":"EXT_disjoint_timer_query_webgl2","compilation-status-async-webgl":"KHR_parallel_shader_compile","polygon-mode-webgl":"WEBGL_polygon_mode","provoking-vertex-webgl":"WEBGL_provoking_vertex","shader-clip-cull-distance-webgl":"WEBGL_clip_cull_distance","shader-noperspective-interpolation-webgl":"NV_shader_noperspective_interpolation","shader-conservative-depth-webgl":"EXT_conservative_depth"};class KY extends AV{constructor(n,r,i){super([],i);O(this,"gl");O(this,"extensions");O(this,"testedFeatures",new Set);this.gl=n,this.extensions=r,Lc(n,"EXT_color_buffer_float",r)}*[Symbol.iterator](){const n=this.getFeatures();for(const r of n)this.has(r)&&(yield r);return[]}has(n){var r;return(r=this.disabledFeatures)!=null&&r[n]?!1:(this.testedFeatures.has(n)||(this.testedFeatures.add(n),HY(n)&&jY(this.gl,n,this.extensions)&&this.features.add(n),this.getWebGLFeature(n)&&this.features.add(n)),this.features.has(n))}initializeFeatures(){const n=this.getFeatures().filter(r=>r!=="polygon-mode-webgl");for(const r of n)this.has(r)}getFeatures(){return[...Object.keys(gC),...Object.keys(kb)]}getWebGLFeature(n){const r=gC[n];return typeof r=="string"?!!Lc(this.gl,r,this.extensions):!!r}}class ZY extends TV{constructor(n){super();O(this,"gl");O(this,"limits",{});this.gl=n}get maxTextureDimension1D(){return 0}get maxTextureDimension2D(){return this.getParameter(3379)}get maxTextureDimension3D(){return this.getParameter(32883)}get maxTextureArrayLayers(){return this.getParameter(35071)}get maxBindGroups(){return 0}get maxDynamicUniformBuffersPerPipelineLayout(){return 0}get maxDynamicStorageBuffersPerPipelineLayout(){return 0}get maxSampledTexturesPerShaderStage(){return this.getParameter(35660)}get maxSamplersPerShaderStage(){return this.getParameter(35661)}get maxStorageBuffersPerShaderStage(){return 0}get maxStorageTexturesPerShaderStage(){return 0}get maxUniformBuffersPerShaderStage(){return this.getParameter(35375)}get maxUniformBufferBindingSize(){return this.getParameter(35376)}get maxStorageBufferBindingSize(){return 0}get minUniformBufferOffsetAlignment(){return this.getParameter(35380)}get minStorageBufferOffsetAlignment(){return 0}get maxVertexBuffers(){return 16}get maxVertexAttributes(){return this.getParameter(34921)}get maxVertexBufferArrayStride(){return 2048}get maxInterStageShaderComponents(){return this.getParameter(35659)}get maxComputeWorkgroupStorageSize(){return 0}get maxComputeInvocationsPerWorkgroup(){return 0}get maxComputeWorkgroupSizeX(){return 0}get maxComputeWorkgroupSizeY(){return 0}get maxComputeWorkgroupSizeZ(){return 0}get maxComputeWorkgroupsPerDimension(){return 0}getParameter(n){return this.limits[n]===void 0&&(this.limits[n]=this.gl.getParameter(n)),this.limits[n]||0}}class ff extends Tg{constructor(n,r){super(n,r);O(this,"device");O(this,"gl");O(this,"handle");O(this,"colorAttachments",[]);O(this,"depthStencilAttachment",null);const i=r.handle===null;this.device=n,this.gl=n.gl,this.handle=this.props.handle||i?this.props.handle:this.gl.createFramebuffer(),i||(n.setSpectorMetadata(this.handle,{id:this.props.id,props:this.props}),this.autoCreateAttachmentTextures(),this.updateAttachments())}destroy(){super.destroy(),!this.destroyed&&this.handle!==null&&this.gl.deleteFramebuffer(this.handle)}updateAttachments(){const n=this.gl.bindFramebuffer(36160,this.handle);for(let r=0;r<this.colorAttachments.length;++r){const i=this.colorAttachments[r];if(i){const s=36064+r;this._attachTextureView(s,i)}}if(this.depthStencilAttachment){const r=XY(this.depthStencilAttachment.props.format);this._attachTextureView(r,this.depthStencilAttachment)}if(this.device.props.debug){const r=this.gl.checkFramebufferStatus(36160);if(r!==36053)throw new Error(`Framebuffer ${GY(r)}`)}this.gl.bindFramebuffer(36160,n)}_attachTextureView(n,r){const{gl:i}=this.device,{texture:s}=r,l=r.props.baseMipLevel,c=r.props.baseArrayLayer;switch(i.bindTexture(s.glTarget,s.handle),s.glTarget){case 35866:case 32879:i.framebufferTextureLayer(36160,n,s.handle,l,c);break;case 34067:const f=QY(c);i.framebufferTexture2D(36160,n,f,s.handle,l);break;case 3553:i.framebufferTexture2D(36160,n,3553,s.handle,l);break;default:throw new Error("Illegal texture type")}i.bindTexture(s.glTarget,null)}}function QY(t){return t<34069?t+34069:t}function GY(t){switch(t){case 36053:return"success";case 36054:return"Mismatched attachments";case 36055:return"No attachments";case 36057:return"Height/width mismatch";case 36061:return"Unsupported or split attachments";case 36182:return"Samples mismatch";default:return`${t}`}}class JY extends ey{constructor(n,r){super(r);O(this,"device");O(this,"format","rgba8unorm");O(this,"depthStencilFormat","depth24plus");O(this,"presentationSize");O(this,"_framebuffer",null);this.device=n,this.presentationSize=[-1,-1],this._setAutoCreatedCanvasId(`${this.device.id}-canvas`),this.update()}get[Symbol.toStringTag](){return"WebGLCanvasContext"}getCurrentFramebuffer(){return this.update(),this._framebuffer=this._framebuffer||new ff(this.device,{handle:null}),this._framebuffer}update(){const n=this.getPixelSize();(n[0]!==this.presentationSize[0]||n[1]!==this.presentationSize[1])&&(this.presentationSize=n,this.resize())}resize(n){if(this.device.gl&&this.canvas){const r=this.getDevicePixelRatio(n==null?void 0:n.useDevicePixels);this.setDevicePixelRatio(r,n);return}}commit(){}}async function VO(t,e){const n=document.getElementsByTagName("head")[0];if(!n)throw new Error("loadScript");const r=document.createElement("script");return r.setAttribute("type","text/javascript"),r.setAttribute("src",t),new Promise((i,s)=>{r.onload=i,r.onerror=l=>s(new Error(`Unable to load script '${t}': ${l}`)),n.appendChild(r)})}const eK=1;let bn=null,pC=!1;const Ub={debugSpectorJS:Re.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function tK(t){if(!globalThis.SPECTOR)try{await VO(t.debugSpectorJSUrl||Ub.debugSpectorJSUrl)}catch(e){Re.warn(String(e))}}function nK(t){var e;if(t={...Ub,...t},!t.debugSpectorJS)return null;if(!bn&&globalThis.SPECTOR&&!((e=globalThis.luma)!=null&&e.spector)){Re.probe(eK,"SPECTOR found and initialized. Start with `luma.spector.displayUI()`")();const{Spector:n}=globalThis.SPECTOR;bn=new n,globalThis.luma&&(globalThis.luma.spector=bn)}if(!bn)return null;if(pC||(pC=!0,bn.spyCanvases(),bn==null||bn.onCaptureStarted.add(n=>Re.info("Spector capture started:",n)()),bn==null||bn.onCapture.add(n=>{Re.info("Spector capture complete:",n)(),bn==null||bn.getResultUI(),bn==null||bn.resultView.display(),bn==null||bn.resultView.addCapture(n)})),t.gl){const n=t.gl,r=n.device;bn==null||bn.startCapture(t.gl,500),n.device=r,new Promise(i=>setTimeout(i,2e3)).then(i=>{Re.info("Spector capture stopped after 2 seconds")(),bn==null||bn.stopCapture()})}return bn}const rK="https://unpkg.com/webgl-debug@2.0.1/index.js";function HO(t){return t.luma=t.luma||{},t.luma}async function iK(){qo()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await VO(rK))}function sK(t,e={}){return e.debugWebGL||e.traceWebGL?oK(t,e):aK(t)}function aK(t){const e=HO(t);return e.realContext?e.realContext:t}function oK(t,e){if(!globalThis.WebGLDebugUtils)return Re.warn("webgl-debug not loaded")(),t;const n=HO(t);if(n.debugContext)return n.debugContext;globalThis.WebGLDebugUtils.init({...Gl,...t});const r=globalThis.WebGLDebugUtils.makeDebugContext(t,lK.bind(null,e),cK.bind(null,e));for(const l in Gl)!(l in r)&&typeof Gl[l]=="number"&&(r[l]=Gl[l]);class i{}Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.setPrototypeOf(i,r);const s=Object.create(i);return n.realContext=t,n.debugContext=s,s.debug=!0,s}function mC(t,e){e=Array.from(e).map(r=>r===void 0?"undefined":r);let n=globalThis.WebGLDebugUtils.glFunctionArgsToString(t,e);return n=`${n.slice(0,100)}${n.length>100?"...":""}`,`gl.${t}(${n})`}function lK(t,e,n,r){r=Array.from(r).map(c=>c===void 0?"undefined":c);const i=globalThis.WebGLDebugUtils.glEnumToString(e),s=globalThis.WebGLDebugUtils.glFunctionArgsToString(n,r),l=`${i} in gl.${n}(${s})`;Re.error(l)();debugger}function cK(t,e,n){let r="";Re.level>=1&&(r=mC(e,n),t.traceWebGL&&Re.log(1,r)());for(const i of n)if(i===void 0){r=r||mC(e,n);debugger}}const C0={};function uK(t="id"){C0[t]=C0[t]||1;const e=C0[t]++;return`${t}-${e}`}class df extends $n{constructor(n,r={}){super(n,r);O(this,"device");O(this,"gl");O(this,"handle");O(this,"glTarget");O(this,"glUsage");O(this,"glIndexType",5123);O(this,"byteLength");O(this,"bytesUsed");this.device=n,this.gl=this.device.gl;const i=typeof r=="object"?r.handle:void 0;this.handle=i||this.gl.createBuffer(),n.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glTarget=fK(this.props.usage),this.glUsage=dK(this.props.usage),this.glIndexType=this.props.indexType==="uint32"?5125:5123,r.data?this._initWithData(r.data,r.byteOffset,r.byteLength):this._initWithByteLength(r.byteLength||0)}_initWithData(n,r=0,i=n.byteLength+r){const s=this.glTarget;this.gl.bindBuffer(s,this.handle),this.gl.bufferData(s,i,this.glUsage),this.gl.bufferSubData(s,r,n),this.gl.bindBuffer(s,null),this.bytesUsed=i,this.byteLength=i,this._setDebugData(n,r,i),this.trackAllocatedMemory(i)}_initWithByteLength(n){let r=n;n===0&&(r=new Float32Array(0));const i=this.glTarget;return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,r,this.glUsage),this.gl.bindBuffer(i,null),this.bytesUsed=n,this.byteLength=n,this._setDebugData(null,0,n),this.trackAllocatedMemory(n),this}destroy(){!this.destroyed&&this.handle&&(this.removeStats(),this.trackDeallocatedMemory(),this.gl.deleteBuffer(this.handle),this.destroyed=!0,this.handle=null)}write(n,r=0){this.gl.bindBuffer(36663,this.handle),this.gl.bufferSubData(36663,r,n),this.gl.bindBuffer(36663,null),this._setDebugData(n,r,n.byteLength)}async readAsync(n=0,r){return this.readSyncWebGL(n,r)}readSyncWebGL(n=0,r){r=r??this.byteLength-n;const i=new Uint8Array(r),s=0;return this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,n,i,s,r),this.gl.bindBuffer(36662,null),this._setDebugData(i,n,r),i}}function fK(t){return t&$n.INDEX?34963:t&$n.VERTEX?34962:t&$n.UNIFORM?35345:34962}function dK(t){return t&$n.INDEX||t&$n.VERTEX?35044:t&$n.UNIFORM?35048:35044}function hK(t){const e=t.split(/\r?\n/),n=[];for(const r of e){if(r.length<=1)continue;const i=r.split(":");if(i.length===2){const[m,v]=i;n.push({message:v.trim(),type:vC(m),lineNum:0,linePos:0});continue}const[s,l,c,...f]=i;let d=parseInt(c,10);isNaN(d)&&(d=0);let g=parseInt(l,10);isNaN(g)&&(g=0),n.push({message:f.join(":").trim(),type:vC(s),lineNum:d,linePos:g})}return n}function vC(t){const e=["warning","error","info"],n=t.toLowerCase();return e.includes(n)?n:"info"}class gK extends wg{constructor(n,r){super(n,r);O(this,"device");O(this,"handle");switch(this.device=n,this.props.stage){case"vertex":this.handle=this.props.handle||this.device.gl.createShader(35633);break;case"fragment":this.handle=this.props.handle||this.device.gl.createShader(35632);break;default:throw new Error(this.props.stage)}this._compile(this.source)}destroy(){this.handle&&(this.removeStats(),this.device.gl.deleteShader(this.handle),this.destroyed=!0)}get asyncCompilationStatus(){return this._waitForCompilationComplete().then(()=>this.compilationStatus)}async getCompilationInfo(){return await this._waitForCompilationComplete(),this.getCompilationInfoSync()}getCompilationInfoSync(){const n=this.device.gl.getShaderInfoLog(this.handle);return n?hK(n):[]}getTranslatedSource(){const r=this.device.getExtension("WEBGL_debug_shaders").WEBGL_debug_shaders;return(r==null?void 0:r.getTranslatedShaderSource(this.handle))||null}async _compile(n){n=n.startsWith("#version ")?n:`#version 300 es
${n}`;const{gl:r}=this.device;if(r.shaderSource(this.handle,n),r.compileShader(this.handle),!this.device.props.debug){this.compilationStatus="pending";return}if(!this.device.features.has("compilation-status-async-webgl")){if(this._getCompilationStatus(),this.debugShader(),this.compilationStatus==="error")throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`);return}Re.once(1,"Shader compilation is asynchronous")(),await this._waitForCompilationComplete(),Re.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader()}async _waitForCompilationComplete(){const n=async s=>await new Promise(l=>setTimeout(l,s));if(!this.device.features.has("compilation-status-async-webgl")){await n(10);return}const{gl:i}=this.device;for(;;){if(i.getShaderParameter(this.handle,37297))return;await n(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?"success":"error"}}function pK(t,e,n,r){if(yK(e))return r(t);const i=t;i.pushState();try{return mK(t,e),Yc(i.gl,n),r(t)}finally{i.popState()}}function mK(t,e){const n=t,{gl:r}=n;if(e.cullMode)switch(e.cullMode){case"none":r.disable(2884);break;case"front":r.enable(2884),r.cullFace(1028);break;case"back":r.enable(2884),r.cullFace(1029);break}if(e.frontFace&&r.frontFace(zo("frontFace",e.frontFace,{ccw:2305,cw:2304})),e.unclippedDepth&&t.features.has("depth-clip-control")&&r.enable(34383),e.depthBias!==void 0&&(r.enable(32823),r.polygonOffset(e.depthBias,e.depthBiasSlopeScale||0)),e.provokingVertex&&t.features.has("provoking-vertex-webgl")){const s=n.getExtension("WEBGL_provoking_vertex").WEBGL_provoking_vertex,l=zo("provokingVertex",e.provokingVertex,{first:36429,last:36430});s==null||s.provokingVertexWEBGL(l)}if((e.polygonMode||e.polygonOffsetLine)&&t.features.has("polygon-mode-webgl")){if(e.polygonMode){const s=n.getExtension("WEBGL_polygon_mode").WEBGL_polygon_mode,l=zo("polygonMode",e.polygonMode,{fill:6914,line:6913});s==null||s.polygonModeWEBGL(1028,l),s==null||s.polygonModeWEBGL(1029,l)}e.polygonOffsetLine&&r.enable(10754)}if(t.features.has("shader-clip-cull-distance-webgl")&&(e.clipDistance0&&r.enable(12288),e.clipDistance1&&r.enable(12289),e.clipDistance2&&r.enable(12290),e.clipDistance3&&r.enable(12291),e.clipDistance4&&r.enable(12292),e.clipDistance5&&r.enable(12293),e.clipDistance6&&r.enable(12294),e.clipDistance7&&r.enable(12295)),e.depthWriteEnabled!==void 0&&r.depthMask(_K("depthWriteEnabled",e.depthWriteEnabled)),e.depthCompare&&(e.depthCompare!=="always"?r.enable(2929):r.disable(2929),r.depthFunc(Ay("depthCompare",e.depthCompare))),e.stencilWriteMask){const i=e.stencilWriteMask;r.stencilMaskSeparate(1028,i),r.stencilMaskSeparate(1029,i)}if(e.stencilReadMask&&Re.warn("stencilReadMask not supported under WebGL"),e.stencilCompare){const i=e.stencilReadMask||4294967295,s=Ay("depthCompare",e.stencilCompare);e.stencilCompare!=="always"?r.enable(2960):r.disable(2960),r.stencilFuncSeparate(1028,s,0,i),r.stencilFuncSeparate(1029,s,0,i)}if(e.stencilPassOperation&&e.stencilFailOperation&&e.stencilDepthFailOperation){const i=R0("stencilPassOperation",e.stencilPassOperation),s=R0("stencilFailOperation",e.stencilFailOperation),l=R0("stencilDepthFailOperation",e.stencilDepthFailOperation);r.stencilOpSeparate(1028,s,l,i),r.stencilOpSeparate(1029,s,l,i)}switch(e.blend){case!0:r.enable(3042);break;case!1:r.disable(3042);break}if(e.blendColorOperation||e.blendAlphaOperation){const i=_C("blendColorOperation",e.blendColorOperation||"add"),s=_C("blendAlphaOperation",e.blendAlphaOperation||"add");r.blendEquationSeparate(i,s);const l=Ph("blendColorSrcFactor",e.blendColorSrcFactor||"one"),c=Ph("blendColorDstFactor",e.blendColorDstFactor||"zero"),f=Ph("blendAlphaSrcFactor",e.blendAlphaSrcFactor||"one"),d=Ph("blendAlphaDstFactor",e.blendAlphaDstFactor||"zero");r.blendFuncSeparate(l,c,f,d)}}function Ay(t,e){return zo(t,e,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function R0(t,e){return zo(t,e,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function _C(t,e){return zo(t,e,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function Ph(t,e){return zo(t,e,{one:1,zero:0,"src-color":768,"one-minus-src-color":769,"dst-color":774,"one-minus-dst-color":775,"src-alpha":770,"one-minus-src-alpha":771,"dst-alpha":772,"one-minus-dst-alpha":773,"src-alpha-saturated":776,"constant-color":32769,"one-minus-constant-color":32770,"constant-alpha":32771,"one-minus-constant-alpha":32772})}function vK(t,e){return`Illegal parameter ${e} for ${t}`}function zo(t,e,n){if(!(e in n))throw new Error(vK(t,e));return n[e]}function _K(t,e){return e}function yK(t){let e=!0;for(const n in t){e=!1;break}return e}function jO(t){const e={};return t.addressModeU&&(e[10242]=x0(t.addressModeU)),t.addressModeV&&(e[10243]=x0(t.addressModeV)),t.addressModeW&&(e[32882]=x0(t.addressModeW)),t.magFilter&&(e[10240]=Cy(t.magFilter)),(t.minFilter||t.mipmapFilter)&&(e[10241]=bK(t.minFilter||"linear",t.mipmapFilter)),t.lodMinClamp!==void 0&&(e[33082]=t.lodMinClamp),t.lodMaxClamp!==void 0&&(e[33083]=t.lodMaxClamp),t.type==="comparison-sampler"&&(e[34892]=34894),t.compare&&(e[34893]=Ay("compare",t.compare)),t.maxAnisotropy&&(e[34046]=t.maxAnisotropy),e}function x0(t){switch(t){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function Cy(t){switch(t){case"nearest":return 9728;case"linear":return 9729}}function bK(t,e="none"){if(!e)return Cy(t);switch(e){case"none":return Cy(t);case"nearest":return t==="nearest"?9984:9986;case"linear":return t==="nearest"?9985:9987}}class Ry extends Eg{constructor(n,r){super(n,r);O(this,"device");O(this,"handle");O(this,"parameters");this.device=n,this.parameters=jO(r),this.handle=this.handle||this.device.gl.createSampler(),this._setSamplerParameters(this.parameters)}destroy(){this.handle&&(this.device.gl.deleteSampler(this.handle),this.handle=void 0)}toString(){return`Sampler(${this.id},${JSON.stringify(this.props)})`}_setSamplerParameters(n){for(const[r,i]of Object.entries(n)){const s=Number(r);switch(s){case 33082:case 33083:this.device.gl.samplerParameterf(this.handle,s,i);break;default:this.device.gl.samplerParameteri(this.handle,s,i);break}}}}class tc extends Sg{constructor(n,r){super(n,{...Kn.defaultProps,...r});O(this,"device");O(this,"gl");O(this,"handle");O(this,"texture");this.device=n,this.gl=this.device.gl,this.handle=null,this.texture=r.texture}}const SK="Failed to deduce GL constant from typed array";function wK(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(SK)}}function EK(t,e){const{clamped:n=!0}=e||{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return n?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function WO(t){switch(t){case 6406:case 33326:case 6403:case 36244:return 1;case 33339:case 33340:case 33328:case 33320:case 33319:return 2;case 6407:case 36248:case 34837:return 3;case 6408:case 36249:case 34836:return 4;default:return 0}}function TK(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return 0}}function kg(t,e,n){if(AK(e))return n(t);const{nocatch:r=!0}=e,i=Lo.get(t);i.push(),Yc(t,e);let s;if(r)s=n(t),i.pop();else try{s=n(t)}finally{i.pop()}return s}function AK(t){for(const e in t)return!1;return!0}function CK(t,e,n){const{dimension:r,width:i,height:s,depth:l=0}=n,{glInternalFormat:c}=n,f=n.glTarget;switch(r){case"2d-array":case"3d":t.texStorage3D(f,e,c,i,s,l);break;default:t.texStorage2D(f,e,c,i,s)}}function yC(t,e,n,r){const{width:i,height:s}=r,{dimension:l,depth:c=0,mipLevel:f=0}=r,{x:d=0,y:g=0,z:m=0}=r,{glFormat:v,glType:S}=r,E=XO(r.glTarget,l,c),w=r.flipY?{37440:!0}:{};kg(t,w,()=>{switch(l){case"2d-array":case"3d":t.bindTexture(E,e),t.texSubImage3D(E,f,d,g,m,i,s,c,v,S,n),t.bindTexture(E,null);break;case"2d":case"cube":t.bindTexture(E,e),t.texSubImage2D(E,f,d,g,i,s,v,S,n),t.bindTexture(E,null);break;default:throw new Error(l)}})}function bC(t,e,n){const{dimension:r,width:i,height:s,depth:l=0,mipLevel:c=0,byteOffset:f=0}=n,{x:d=0,y:g=0,z:m=0}=n,{glFormat:v,glType:S,compressed:E}=n,w=XO(n.glTarget,r,l);switch(r){case"2d-array":case"3d":E?t.compressedTexSubImage3D(w,c,d,g,m,i,s,l,v,e,f):t.texSubImage3D(w,c,d,g,m,i,s,l,v,S,e,f);break;case"2d":case"cube":E?t.compressedTexSubImage2D(w,c,d,g,i,s,v,e,f):t.texSubImage2D(w,c,d,g,i,s,v,S,e,f);break;default:throw new Error(r)}}function RK(t){switch(t){case"1d":break;case"2d":return 3553;case"3d":return 32879;case"cube":return 34067;case"2d-array":return 35866}throw new Error(t)}function XO(t,e,n){return e==="cube"?34069+n:t}function xK(t,e){var A;const{sourceX:n=0,sourceY:r=0,sourceAttachment:i=0}=e||{};let{target:s=null,sourceWidth:l,sourceHeight:c,sourceDepth:f,sourceFormat:d,sourceType:g}=e||{};const{framebuffer:m,deleteFramebuffer:v}=qO(t),{gl:S,handle:E}=m;l||(l=m.width),c||(c=m.height);const w=(A=m.colorAttachments[i])==null?void 0:A.texture;if(!w)throw new Error(`Invalid framebuffer attachment ${i}`);f=(w==null?void 0:w.depth)||1,d||(d=(w==null?void 0:w.glFormat)||6408),g||(g=(w==null?void 0:w.glType)||5121),s=PK(s,g,d,l,c),g=g||wK(s);const b=S.bindFramebuffer(36160,E);return S.readBuffer(36064+i),S.readPixels(n,r,l,c,d,g,s),S.readBuffer(36064),S.bindFramebuffer(36160,b||null),v&&m.destroy(),s}function MK(t,e){const{target:n,sourceX:r=0,sourceY:i=0,sourceFormat:s=6408,targetByteOffset:l=0}=e||{};let{sourceWidth:c,sourceHeight:f,sourceType:d}=e||{};const{framebuffer:g,deleteFramebuffer:m}=qO(t);c=c||g.width,f=f||g.height;const v=g;d=d||5121;let S=n;if(!S){const w=WO(s),b=TK(d),A=l+c*f*w*b;S=v.device.createBuffer({byteLength:A})}const E=t.device.createCommandEncoder();return E.copyTextureToBuffer({sourceTexture:t,width:c,height:f,origin:[r,i],destinationBuffer:S,byteOffset:l}),E.destroy(),m&&g.destroy(),S}function qO(t){return t instanceof Tg?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:OK(t),deleteFramebuffer:!0}}function OK(t,e){const{device:n,width:r,height:i,id:s}=t;return n.createFramebuffer({...e,id:`framebuffer-for-${s}`,width:r,height:i,colorAttachments:[t]})}function PK(t,e,n,r,i,s){if(t)return t;e||(e=5121);const l=EK(e,{clamped:!1}),c=WO(n);return new l(r*i*c)}class hf extends Kn{constructor(n,r){super(n,r);O(this,"device");O(this,"gl");O(this,"handle");O(this,"sampler");O(this,"view");O(this,"mipmaps");O(this,"compressed");O(this,"glTarget");O(this,"glFormat");O(this,"glType");O(this,"glInternalFormat");O(this,"textureUnit",0);const i={...this.props};i.data=r.data,this.device=n,this.gl=this.device.gl,this.glTarget=RK(this.props.dimension);const s=$O(this.props.format);this.glInternalFormat=s.internalFormat,this.glFormat=s.format,this.glType=s.type,this.compressed=s.compressed,this.mipmaps=!!this.props.mipmaps,this._initialize(i),Object.seal(this)}_initialize(n){this.handle=this.props.handle||this.gl.createTexture(),this.device.setSpectorMetadata(this.handle,{...this.props,data:n.data});let{width:r,height:i}=n;if(!r||!i){const s=Kn.getTextureDataSize(n.data);r=(s==null?void 0:s.width)||1,i=(s==null?void 0:s.height)||1}if(this.width=r,this.height=i,this.depth=n.depth,this.setSampler(n.sampler),this.view=new tc(this.device,{...this.props,texture:this}),this.bind(),CK(this.gl,this.mipLevels,this),n.data)switch(n.dimension){case"1d":this.setTexture1DData(n.data);break;case"2d":this.setTexture2DData(n.data);break;case"3d":this.setTexture3DData(n.data);break;case"cube":this.setTextureCubeData(n.data);break;case"2d-array":this.setTextureArrayData(n.data);break;case"cube-array":this.setTextureCubeArrayData(n.data);break;default:throw new Error(n.dimension)}this.mipmaps&&this.generateMipmap()}destroy(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)}createView(n){return new tc(this.device,{...n,texture:this})}setSampler(n={}){let r;n instanceof Ry?(this.sampler=n,r=n.props):(this.sampler=new Ry(this.device,n),r=n);const i=jO(r);this._setSamplerParameters(i)}generateMipmap(n){if(!(!(this.device.isTextureFormatRenderable(this.props.format)&&this.device.isTextureFormatFilterable(this.props.format))&&(Re.warn(`${this} is not renderable or filterable, may not be able to generate mipmaps`)(),!(n!=null&&n.force))))try{this.gl.bindTexture(this.glTarget,this.handle),this.gl.generateMipmap(this.glTarget)}catch(i){Re.warn(`Error generating mipmap for ${this}: ${i.message}`)()}finally{this.gl.bindTexture(this.glTarget,null)}}copyExternalImage(n){const r=Kn.getExternalImageSize(n.image),i={...Kn.defaultCopyExternalImageOptions,...r,...n},{image:s,depth:l,mipLevel:c,x:f,y:d,z:g,flipY:m}=i;let{width:v,height:S}=i;const{dimension:E,glTarget:w,glFormat:b,glInternalFormat:A,glType:T}=this;if(v=Math.min(v,this.width-f),S=Math.min(S,this.height-d),n.sourceX||n.sourceY)throw new Error("WebGL does not support sourceX/sourceY)");return yC(this.device.gl,this.handle,s,{dimension:E,mipLevel:c,x:f,y:d,z:g,width:v,height:S,depth:l,glFormat:b,glType:T,glTarget:w,flipY:m}),{width:i.width,height:i.height}}setTexture1DData(n){throw new Error("setTexture1DData not supported in WebGL.")}setTexture2DData(n,r=0){this.bind();const i=Kn.normalizeTextureData(n,this);i.length>1&&this.props.mipmaps!==!1&&Re.warn(`Texture ${this.id} mipmap and multiple LODs.`)();for(let s=0;s<i.length;s++){const l=i[s];this._setMipLevel(r,s,l)}this.unbind()}setTexture3DData(n){if(this.props.dimension!=="3d")throw new Error(this.id);ArrayBuffer.isView(n)&&(this.bind(),bC(this.device.gl,n,this),this.unbind())}setTextureCubeData(n,r=0){if(this.props.dimension!=="cube")throw new Error(this.id);for(const i of Kn.CubeFaces)this.setTextureCubeFaceData(n[i],i)}setTextureArrayData(n){throw this.props.dimension!=="2d-array"?new Error(this.id):new Error("setTextureArrayData not implemented.")}setTextureCubeArrayData(n){throw new Error("setTextureCubeArrayData not supported in WebGL2.")}setTextureCubeFaceData(n,r,i=0){Array.isArray(n)&&n.length>1&&this.props.mipmaps!==!1&&Re.warn(`${this.id} has mipmap and multiple LODs.`)();const s=Kn.CubeFaces.indexOf(r);this.setTexture2DData(n,s)}update(){throw new Error("Texture.update() not implemented. Use ExternalTexture")}setImageDataForFace(n){const{face:r,width:i,height:s,pixels:l,data:c,format:f=6408,type:d=5121}=n,{gl:g}=this,m=l||c;this.bind(),m instanceof Promise?m.then(v=>this.setImageDataForFace(Object.assign({},n,{face:r,data:v,pixels:v}))):this.width||this.height?g.texImage2D(r,0,f,i,s,0,f,d,m):g.texImage2D(r,0,f,f,d,m)}_getImageDataMap(n){for(let r=0;r<Kn.CubeFaces.length;++r){const i=Kn.CubeFaces[r];n[i]&&(n[34069+r]=n[i],delete n[i])}return n}_setSamplerParameters(n){Re.log(1,`${this.id} sampler parameters`,this.device.getGLKeys(n))(),this.gl.bindTexture(this.glTarget,this.handle);for(const[r,i]of Object.entries(n)){const s=Number(r),l=i;switch(s){case 33082:case 33083:this.gl.texParameterf(this.glTarget,s,l);break;case 10241:this.gl.texParameteri(this.glTarget,s,l);break;case 10242:case 10243:this.gl.texParameteri(this.glTarget,s,l);break;case 34046:this.device.features.has("texture-filterable-anisotropic-webgl")&&this.gl.texParameteri(this.glTarget,s,l);break;default:this.gl.texParameteri(this.glTarget,s,l);break}}this.gl.bindTexture(this.glTarget,null)}_setMipLevel(n,r,i,s=this.glTarget){if(Kn.isExternalImage(i)){yC(this.device.gl,this.handle,i,{...this,depth:n,mipLevel:r,glTarget:s,flipY:this.props.flipY});return}if(Kn.isTextureLevelData(i)){bC(this.device.gl,i.data,{...this,depth:n,mipLevel:r,glTarget:s});return}throw new Error("Texture: invalid image data")}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(n){const{gl:r}=this;return n!==void 0&&(this.textureUnit=n,r.activeTexture(33984+n)),r.bindTexture(this.glTarget,this.handle),n}unbind(n){const{gl:r}=this;return n!==void 0&&(this.textureUnit=n,r.activeTexture(33984+n)),r.bindTexture(this.glTarget,null),n}}const NK=[1,2,4,8];class IK extends ty{constructor(n,r){var s;super(n,r);O(this,"device");O(this,"glParameters");this.device=n;let i;if(!((s=r==null?void 0:r.parameters)!=null&&s.viewport))if(r!=null&&r.framebuffer){const{width:l,height:c}=r.framebuffer;i=[0,0,l,c]}else{const[l,c]=n.getCanvasContext().getDrawingBufferSize();i=[0,0,l,c]}if(this.device.pushState(),this.setParameters({viewport:i,...this.props.parameters}),this.props.framebuffer){const l=this.props.framebuffer.colorAttachments.map((c,f)=>36064+f);this.device.gl.drawBuffers(l)}else this.device.gl.drawBuffers([1029]);this.clear()}end(){this.device.popState()}pushDebugGroup(n){}popDebugGroup(){}insertDebugMarker(n){}setParameters(n={}){const r={...this.glParameters};r.framebuffer=this.props.framebuffer||null,this.props.depthReadOnly&&(r.depthMask=!this.props.depthReadOnly),r.stencilMask=this.props.stencilReadOnly?0:1,r[35977]=this.props.discard,n.viewport&&(n.viewport.length>=6?(r.viewport=n.viewport.slice(0,4),r.depthRange=[n.viewport[4],n.viewport[5]]):r.viewport=n.viewport),n.scissorRect&&(r.scissorTest=!0,r.scissor=n.scissorRect),n.blendConstant&&(r.blendColor=n.blendConstant),n.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),n[2967]=n.stencilReference),n.colorMask&&(r.colorMask=NK.map(i=>!!(i&n.colorMask))),this.glParameters=r,Yc(this.device.gl,r)}beginOcclusionQuery(n){const r=this.props.occlusionQuerySet;r==null||r.beginOcclusionQuery()}endOcclusionQuery(){const n=this.props.occlusionQuerySet;n==null||n.endOcclusionQuery()}clear(){const n={...this.glParameters};let r=0;this.props.clearColors&&this.props.clearColors.forEach((i,s)=>{i&&this.clearColorBuffer(s,i)}),this.props.clearColor!==!1&&this.props.clearColors===void 0&&(r|=16384,n.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(r|=256,n.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(r|=1024,n.clearStencil=this.props.clearStencil),r!==0&&kg(this.device.gl,n,()=>{this.device.gl.clear(r)})}clearColorBuffer(n=0,r=[0,0,0,0]){kg(this.device.gl,{framebuffer:this.props.framebuffer},()=>{switch(r.constructor){case Int8Array:case Int16Array:case Int32Array:this.device.gl.clearBufferiv(6144,n,r);break;case Uint8Array:case Uint8ClampedArray:case Uint16Array:case Uint32Array:this.device.gl.clearBufferuiv(6144,n,r);break;case Float32Array:this.device.gl.clearBufferfv(6144,n,r);break;default:throw new Error("clearColorBuffer: color must be typed array")}})}}function DK(t){return FK.includes(t)}const FK=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],YO={5126:[5126,1,"float","f32","float32"],35664:[5126,2,"vec2","vec2<f32>","float32x2"],35665:[5126,3,"vec3","vec3<f32>","float32x3"],35666:[5126,4,"vec4","vec4<f32>","float32x4"],5124:[5124,1,"int","i32","sint32"],35667:[5124,2,"ivec2","vec2<i32>","sint32x2"],35668:[5124,3,"ivec3","vec3<i32>","sint32x3"],35669:[5124,4,"ivec4","vec4<i32>","sint32x4"],5125:[5125,1,"uint","u32","uint32"],36294:[5125,2,"uvec2","vec2<u32>","uint32x2"],36295:[5125,3,"uvec3","vec3<u32>","uint32x3"],36296:[5125,4,"uvec4","vec4<u32>","uint32x4"],35670:[5126,1,"bool","f32","float32"],35671:[5126,2,"bvec2","vec2<f32>","float32x2"],35672:[5126,3,"bvec3","vec3<f32>","float32x3"],35673:[5126,4,"bvec4","vec4<f32>","float32x4"],35674:[5126,8,"mat2","mat2x2<f32>"],35685:[5126,8,"mat2x3","mat2x3<f32>"],35686:[5126,8,"mat2x4","mat2x4<f32>"],35687:[5126,12,"mat3x2","mat3x2<f32>"],35675:[5126,12,"mat3","mat3x3<f32>"],35688:[5126,12,"mat3x4","mat3x4<f32>"],35689:[5126,16,"mat4x2","mat4x2<f32>"],35690:[5126,16,"mat4x3","mat4x3<f32>"],35676:[5126,16,"mat4","mat4x4<f32>"]};function KO(t){const e=YO[t];if(!e)throw new Error("uniform");const[n,r,,i]=e;return{format:i,components:r,glType:n}}function kK(t){const e=YO[t];if(!e)throw new Error("attribute");const[,n,,r,i]=e;return{attributeType:r,vertexFormat:i,components:n}}function BK(t,e){const n={attributes:[],bindings:[]};n.attributes=UK(t,e);const r=$K(t,e);for(const c of r){const f=c.uniforms.map(d=>({name:d.name,format:d.format,byteOffset:d.byteOffset,byteStride:d.byteStride,arrayLength:d.arrayLength}));n.bindings.push({type:"uniform",name:c.name,group:0,location:c.location,visibility:(c.vertex?1:0)&(c.fragment?2:0),minBindingSize:c.byteLength,uniforms:f})}const i=zK(t,e);let s=0;for(const c of i)if(DK(c.type)){const{viewDimension:f,sampleType:d}=HK(c.type);n.bindings.push({type:"texture",name:c.name,group:0,location:s,viewDimension:f,sampleType:d}),c.textureUnit=s,s+=1}i.length&&(n.uniforms=i);const l=LK(t,e);return l!=null&&l.length&&(n.varyings=l),n}function UK(t,e){const n=[],r=t.getProgramParameter(e,35721);for(let i=0;i<r;i++){const s=t.getActiveAttrib(e,i);if(!s)throw new Error("activeInfo");const{name:l,type:c}=s,f=t.getAttribLocation(e,l);if(f>=0){const{attributeType:d}=kK(c),g=/instance/i.test(l)?"instance":"vertex";n.push({name:l,location:f,stepMode:g,type:d})}}return n.sort((i,s)=>i.location-s.location),n}function LK(t,e){const n=[],r=t.getProgramParameter(e,35971);for(let i=0;i<r;i++){const s=t.getTransformFeedbackVarying(e,i);if(!s)throw new Error("activeInfo");const{name:l,type:c,size:f}=s,{glType:d,components:g}=KO(c),m={location:i,name:l,type:d,size:f*g};n.push(m)}return n.sort((i,s)=>i.location-s.location),n}function zK(t,e){const n=[],r=t.getProgramParameter(e,35718);for(let i=0;i<r;i++){const s=t.getActiveUniform(e,i);if(!s)throw new Error("activeInfo");const{name:l,size:c,type:f}=s,{name:d,isArray:g}=jK(l);let m=t.getUniformLocation(e,d);const v={location:m,name:d,size:c,type:f,isArray:g};if(n.push(v),v.size>1)for(let S=0;S<v.size;S++){const E=`${d}[${S}]`;m=t.getUniformLocation(e,E);const w={...v,name:E,location:m};n.push(w)}}return n}function $K(t,e){const n=(s,l)=>t.getActiveUniformBlockParameter(e,s,l),r=[],i=t.getProgramParameter(e,35382);for(let s=0;s<i;s++){const l={name:t.getActiveUniformBlockName(e,s)||"",location:n(s,35391),byteLength:n(s,35392),vertex:n(s,35396),fragment:n(s,35398),uniformCount:n(s,35394),uniforms:[]},c=n(s,35395)||[],f=t.getActiveUniforms(e,c,35383),d=t.getActiveUniforms(e,c,35384),g=t.getActiveUniforms(e,c,35387),m=t.getActiveUniforms(e,c,35388);for(let v=0;v<l.uniformCount;++v){const S=t.getActiveUniform(e,c[v]);if(!S)throw new Error("activeInfo");l.uniforms.push({name:S.name,format:KO(f[v]).format,type:f[v],arrayLength:d[v],byteOffset:g[v],byteStride:m[v]})}r.push(l)}return r.sort((s,l)=>s.location-l.location),r}const VK={35678:["2d","float"],35680:["cube","float"],35679:["3d","float"],35682:["3d","depth"],36289:["2d-array","float"],36292:["2d-array","depth"],36293:["cube","float"],36298:["2d","sint"],36299:["3d","sint"],36300:["cube","sint"],36303:["2d-array","uint"],36306:["2d","uint"],36307:["3d","uint"],36308:["cube","uint"],36311:["2d-array","uint"]};function HK(t){const e=VK[t];if(!e)throw new Error("sampler");const[n,r]=e;return{viewDimension:n,sampleType:r}}function jK(t){if(t[t.length-1]!=="]")return{name:t,length:1,isArray:!1};const n=/([^[]*)(\[[0-9]+\])?/.exec(t);if(!n||n.length<2)throw new Error(`Failed to parse GLSL uniform name ${t}`);return{name:n[1],length:n[2]?1:0,isArray:!!n[2]}}function WK(t,e,n,r){const i=t;let s=r;s===!0&&(s=1),s===!1&&(s=0);const l=typeof s=="number"?[s]:s;switch(n){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof r!="number")throw new Error("samplers must be set to integers");return t.uniform1i(e,r);case 5126:return t.uniform1fv(e,l);case 35664:return t.uniform2fv(e,l);case 35665:return t.uniform3fv(e,l);case 35666:return t.uniform4fv(e,l);case 5124:return t.uniform1iv(e,l);case 35667:return t.uniform2iv(e,l);case 35668:return t.uniform3iv(e,l);case 35669:return t.uniform4iv(e,l);case 35670:return t.uniform1iv(e,l);case 35671:return t.uniform2iv(e,l);case 35672:return t.uniform3iv(e,l);case 35673:return t.uniform4iv(e,l);case 5125:return i.uniform1uiv(e,l,1);case 36294:return i.uniform2uiv(e,l,2);case 36295:return i.uniform3uiv(e,l,3);case 36296:return i.uniform4uiv(e,l,4);case 35674:return t.uniformMatrix2fv(e,!1,l);case 35675:return t.uniformMatrix3fv(e,!1,l);case 35676:return t.uniformMatrix4fv(e,!1,l);case 35685:return i.uniformMatrix2x3fv(e,!1,l);case 35686:return i.uniformMatrix2x4fv(e,!1,l);case 35687:return i.uniformMatrix3x2fv(e,!1,l);case 35688:return i.uniformMatrix3x4fv(e,!1,l);case 35689:return i.uniformMatrix4x2fv(e,!1,l);case 35690:return i.uniformMatrix4x3fv(e,!1,l)}throw new Error("Illegal uniform")}function XK(t){return xO(t)!==null||typeof t=="number"||typeof t=="boolean"}function qK(t){const e={bindings:{},uniforms:{}};return Object.keys(t).forEach(n=>{const r=t[n];XK(r)?e.uniforms[n]=r:e.bindings[n]=r}),e}function YK(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"triangle-list":return 4;case"triangle-strip":return 5;default:throw new Error(t)}}function KK(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;default:throw new Error(t)}}const SC=4;class ZK extends Pc{constructor(n,r){super(n,r);O(this,"device");O(this,"handle");O(this,"vs");O(this,"fs");O(this,"introspectedLayout");O(this,"uniforms",{});O(this,"bindings",{});O(this,"varyings",null);O(this,"_uniformCount",0);O(this,"_uniformSetters",{});this.device=n,this.handle=this.props.handle||this.device.gl.createProgram(),this.device.setSpectorMetadata(this.handle,{id:this.props.id}),this.vs=r.vs,this.fs=r.fs;const{varyings:i,bufferMode:s=35981}=r;i&&i.length>0&&(this.varyings=i,this.device.gl.transformFeedbackVaryings(this.handle,i,s)),this._linkShaders(),Re.time(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=BK(this.device.gl,this.handle),Re.timeEnd(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=QK(this.introspectedLayout,r.shaderLayout)}destroy(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)}setBindings(n,r){for(const[i,s]of Object.entries(n)){const l=this.shaderLayout.bindings.find(c=>c.name===i)||this.shaderLayout.bindings.find(c=>c.name===`${i}Uniforms`);if(!l){const c=this.shaderLayout.bindings.map(f=>`"${f.name}"`).join(", ");r!=null&&r.disableWarnings||Re.warn(`No binding "${i}" in render pipeline "${this.id}", expected one of ${c}`,s)();continue}switch(s||Re.warn(`Unsetting binding "${i}" in render pipeline "${this.id}"`)(),l.type){case"uniform":if(!(s instanceof df)&&!(s.buffer instanceof df))throw new Error("buffer value");break;case"texture":if(!(s instanceof tc||s instanceof hf||s instanceof ff))throw new Error("texture value");break;case"sampler":Re.warn(`Ignoring sampler ${i}`)();break;default:throw new Error(l.type)}this.bindings[i]=s}}draw(n){var b;const{renderPass:r,parameters:i=this.props.parameters,topology:s=this.props.topology,vertexArray:l,vertexCount:c,instanceCount:f,isInstanced:d=!1,firstVertex:g=0,transformFeedback:m}=n,v=YK(s),S=!!l.indexBuffer,E=(b=l.indexBuffer)==null?void 0:b.glIndexType;if(this.linkStatus!=="success")return Re.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable())return Re.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;this.device.gl.useProgram(this.handle),l.bindBeforeRender(r),m&&m.begin(this.props.topology),this._applyBindings(),this._applyUniforms();const w=r;return pK(this.device,i,w.glParameters,()=>{S&&d?this.device.gl.drawElementsInstanced(v,c||0,E,g,f||0):S?this.device.gl.drawElements(v,c||0,E,g):d?this.device.gl.drawArraysInstanced(v,g,c||0,f||0):this.device.gl.drawArrays(v,g,c||0),m&&m.end()}),l.unbindAfterRender(r),!0}setUniformsWebGL(n){const{bindings:r}=qK(n);Object.keys(r).forEach(i=>{Re.warn(`Unsupported value "${JSON.stringify(r[i])}" used in setUniforms() for key ${i}. Use setBindings() instead?`)()}),Object.assign(this.uniforms,n)}async _linkShaders(){const{gl:n}=this.device;if(n.attachShader(this.handle,this.vs.handle),n.attachShader(this.handle,this.fs.handle),Re.time(SC,`linkProgram for ${this.id}`)(),n.linkProgram(this.handle),Re.timeEnd(SC,`linkProgram for ${this.id}`)(),Re.level,!this.device.features.has("compilation-status-async-webgl")){const i=this._getLinkStatus();this._reportLinkStatus(i);return}Re.once(1,"RenderPipeline linking is asynchronous")(),await this._waitForLinkComplete(),Re.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();const r=this._getLinkStatus();this._reportLinkStatus(r)}async _reportLinkStatus(n){var r;switch(n){case"success":return;default:switch(this.vs.compilationStatus){case"error":throw this.vs.debugShader(),new Error(`Error during compilation of shader ${this.vs.id}`);case"pending":this.vs.asyncCompilationStatus.then(()=>this.vs.debugShader());break}switch((r=this.fs)==null?void 0:r.compilationStatus){case"error":throw this.fs.debugShader(),new Error(`Error during compilation of shader ${this.fs.id}`);case"pending":this.fs.asyncCompilationStatus.then(()=>this.fs.debugShader());break}const i=this.device.gl.getProgramInfoLog(this.handle);throw new Error(`Error during ${n}: ${i}`)}}_getLinkStatus(){const{gl:n}=this.device;return n.getProgramParameter(this.handle,35714)?(n.validateProgram(this.handle),n.getProgramParameter(this.handle,35715)?(this.linkStatus="success","success"):(this.linkStatus="error","validation")):(this.linkStatus="error","linking")}async _waitForLinkComplete(){const n=async s=>await new Promise(l=>setTimeout(l,s));if(!this.device.features.has("compilation-status-async-webgl")){await n(10);return}const{gl:i}=this.device;for(;;){if(i.getProgramParameter(this.handle,37297))return;await n(10)}}_areTexturesRenderable(){let n=!0;for(const r of this.shaderLayout.bindings)!this.bindings[r.name]&&!this.bindings[r.name.replace(/Uniforms$/,"")]&&(Re.warn(`Binding ${r.name} not found in ${this.id}`)(),n=!1);return n}_applyBindings(){if(this.linkStatus!=="success")return;const{gl:n}=this.device;n.useProgram(this.handle);let r=0,i=0;for(const s of this.shaderLayout.bindings){const l=this.bindings[s.name]||this.bindings[s.name.replace(/Uniforms$/,"")];if(!l)throw new Error(`No value for binding ${s.name} in ${this.id}`);switch(s.type){case"uniform":const{name:c}=s,f=n.getUniformBlockIndex(this.handle,c);if(f===4294967295)throw new Error(`Invalid uniform block name ${c}`);n.uniformBlockBinding(this.handle,i,f),l instanceof df?n.bindBufferBase(35345,i,l.handle):n.bindBufferRange(35345,i,l.buffer.handle,l.offset||0,l.size||l.buffer.byteLength-l.offset),i+=1;break;case"texture":if(!(l instanceof tc||l instanceof hf||l instanceof ff))throw new Error("texture");let d;if(l instanceof tc)d=l.texture;else if(l instanceof hf)d=l;else if(l instanceof ff&&l.colorAttachments[0]instanceof tc)Re.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),d=l.colorAttachments[0].texture;else throw new Error("No texture");n.activeTexture(33984+r),n.bindTexture(d.glTarget,d.handle),r+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${s.type}' not supported in WebGL`)}}}_applyUniforms(){for(const n of this.shaderLayout.uniforms||[]){const{name:r,location:i,type:s,textureUnit:l}=n,c=this.uniforms[r]??l;c!==void 0&&WK(this.device.gl,i,s,c)}}}function QK(t,e){const n={...t,attributes:t.attributes.map(r=>({...r}))};for(const r of(e==null?void 0:e.attributes)||[]){const i=n.attributes.find(s=>s.name===r.name);i?(i.type=r.type||i.type,i.stepMode=r.stepMode||i.stepMode):Re.warn(`shader layout attribute ${r.name} not present in shader`)}return n}class GK extends ry{constructor(n){super(n,{});O(this,"device");O(this,"commands",[]);this.device=n}submitCommands(n=this.commands){for(const r of n)switch(r.name){case"copy-buffer-to-buffer":JK(this.device,r.options);break;case"copy-buffer-to-texture":eZ(this.device,r.options);break;case"copy-texture-to-buffer":tZ(this.device,r.options);break;case"copy-texture-to-texture":nZ(this.device,r.options);break;default:throw new Error(r.name)}}}function JK(t,e){const n=e.sourceBuffer,r=e.destinationBuffer;t.gl.bindBuffer(36662,n.handle),t.gl.bindBuffer(36663,r.handle),t.gl.copyBufferSubData(36662,36663,e.sourceOffset??0,e.destinationOffset??0,e.size),t.gl.bindBuffer(36662,null),t.gl.bindBuffer(36663,null)}function eZ(t,e){throw new Error("Not implemented")}function tZ(t,e){const{sourceTexture:n,mipLevel:r=0,aspect:i="all",width:s=e.sourceTexture.width,height:l=e.sourceTexture.height,depthOrArrayLayers:c=0,origin:f=[0,0],destinationBuffer:d,byteOffset:g=0,bytesPerRow:m,rowsPerImage:v}=e;if(i!=="all")throw new Error("aspect not supported in WebGL");if(r!==0||c!==0||m||v)throw new Error("not implemented");const{framebuffer:S,destroyFramebuffer:E}=ZO(n);let w;try{const b=d,A=s||S.width,T=l||S.height,C=$O(S.colorAttachments[0].texture.props.format),M=C.format,x=C.type;t.gl.bindBuffer(35051,b.handle),w=t.gl.bindFramebuffer(36160,S.handle),t.gl.readPixels(f[0],f[1],A,T,M,x,g)}finally{t.gl.bindBuffer(35051,null),w!==void 0&&t.gl.bindFramebuffer(36160,w),E&&S.destroy()}}function nZ(t,e){const{sourceTexture:n,destinationMipLevel:r=0,origin:i=[0,0],destinationOrigin:s=[0,0],destinationTexture:l}=e;let{width:c=e.destinationTexture.width,height:f=e.destinationTexture.height}=e;const{framebuffer:d,destroyFramebuffer:g}=ZO(n),[m,v]=i,[S,E,w]=s,b=t.gl.bindFramebuffer(36160,d.handle);let A=null,T;if(l instanceof hf)A=l,c=Number.isFinite(c)?c:A.width,f=Number.isFinite(f)?f:A.height,A.bind(0),T=A.glTarget;else throw new Error("invalid destination");switch(T){case 3553:case 34067:t.gl.copyTexSubImage2D(T,r,S,E,m,v,c,f);break;case 35866:case 32879:t.gl.copyTexSubImage3D(T,r,S,E,w,m,v,c,f);break}A&&A.unbind(),t.gl.bindFramebuffer(36160,b),g&&d.destroy()}function ZO(t){if(t instanceof Kn){const{width:e,height:n,id:r}=t;return{framebuffer:t.device.createFramebuffer({id:`framebuffer-for-${r}`,width:e,height:n,colorAttachments:[t]}),destroyFramebuffer:!0}}return{framebuffer:t,destroyFramebuffer:!1}}class rZ extends ny{constructor(n,r){super(n,r);O(this,"device");O(this,"commandBuffer");this.device=n,this.commandBuffer=new GK(n)}destroy(){}finish(){this.commandBuffer.submitCommands()}copyBufferToBuffer(n){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:n})}copyBufferToTexture(n){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:n})}copyTextureToBuffer(n){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:n})}copyTextureToTexture(n){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:n})}pushDebugGroup(n){}popDebugGroup(){}insertDebugMarker(n){}resolveQuerySet(n,r,i){}}function iZ(t){const{target:e,source:n,start:r=0,count:i=1}=t,s=n.length,l=i*s;let c=0;for(let f=r;c<s;c++)e[f++]=n[c];for(;c<l;)c<l-c?(e.copyWithin(r+c,r,r+c),c*=2):(e.copyWithin(r+c,r,r+l-c),c=l);return t.target}class Lb extends iy{constructor(n,r){super(n,r);O(this,"device");O(this,"handle");O(this,"buffer",null);O(this,"bufferValue",null);this.device=n,this.handle=this.device.gl.createVertexArray()}get[Symbol.toStringTag](){return"VertexArray"}static isConstantAttributeZeroSupported(n){return A6()==="Chrome"}destroy(){var n;super.destroy(),this.buffer&&((n=this.buffer)==null||n.destroy()),this.handle&&(this.device.gl.deleteVertexArray(this.handle),this.handle=void 0)}setIndexBuffer(n){const r=n;if(r&&r.glTarget!==34963)throw new Error("Use .setBuffer()");this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34963,r?r.handle:null),this.indexBuffer=r,this.device.gl.bindVertexArray(null)}setBuffer(n,r){const i=r;if(i.glTarget===34963)throw new Error("Use .setIndexBuffer()");const{size:s,type:l,stride:c,offset:f,normalized:d,integer:g,divisor:m}=this._getAccessor(n);this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,i.handle),g?this.device.gl.vertexAttribIPointer(n,s,l,c,f):this.device.gl.vertexAttribPointer(n,s,l,d,c,f),this.device.gl.bindBuffer(34962,null),this.device.gl.enableVertexAttribArray(n),this.device.gl.vertexAttribDivisor(n,m||0),this.attributes[n]=i,this.device.gl.bindVertexArray(null)}setConstantWebGL(n,r){this._enable(n,!1),this.attributes[n]=r}bindBeforeRender(){this.device.gl.bindVertexArray(this.handle),this._applyConstantAttributes()}unbindAfterRender(){this.device.gl.bindVertexArray(null)}_applyConstantAttributes(){for(let n=0;n<this.maxVertexAttributes;++n){const r=this.attributes[n];ArrayBuffer.isView(r)&&this.device.setConstantAttributeWebGL(n,r)}}_getAccessor(n){const r=this.attributeInfos[n];if(!r)throw new Error(`Unknown attribute location ${n}`);const i=zO(r.bufferDataType);return{size:r.bufferComponents,type:i,stride:r.byteStride,offset:r.byteOffset,normalized:r.normalized,integer:r.integer,divisor:r.stepMode==="instance"?1:0}}_enable(n,r=!0){const s=Lb.isConstantAttributeZeroSupported(this.device)||n!==0;(r||s)&&(n=Number(n),this.device.gl.bindVertexArray(this.handle),r?this.device.gl.enableVertexAttribArray(n):this.device.gl.disableVertexAttribArray(n),this.device.gl.bindVertexArray(null))}getConstantBuffer(n,r){const i=sZ(r),s=i.byteLength*n,l=i.length*n;if(this.buffer&&s!==this.buffer.byteLength)throw new Error(`Buffer size is immutable, byte length ${s} !== ${this.buffer.byteLength}.`);let c=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:s}),c=c||!aZ(i,this.bufferValue),c){const f=eH(r.constructor,l);iZ({target:f,source:i,start:0,count:l}),this.buffer.write(f),this.bufferValue=r}return this.buffer}}function sZ(t){return Array.isArray(t)?new Float32Array(t):t}function aZ(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}class oZ extends sy{constructor(n,r){super(n,r);O(this,"device");O(this,"gl");O(this,"handle");O(this,"layout");O(this,"buffers",{});O(this,"unusedBuffers",{});O(this,"bindOnUse",!0);O(this,"_bound",!1);this.device=n,this.gl=n.gl,this.handle=this.props.handle||this.gl.createTransformFeedback(),this.layout=this.props.layout,r.buffers&&this.setBuffers(r.buffers),Object.seal(this)}destroy(){this.gl.deleteTransformFeedback(this.handle),super.destroy()}begin(n="point-list"){this.gl.bindTransformFeedback(36386,this.handle),this.bindOnUse&&this._bindBuffers(),this.gl.beginTransformFeedback(KK(n))}end(){this.gl.endTransformFeedback(),this.bindOnUse&&this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null)}setBuffers(n){this.buffers={},this.unusedBuffers={},this.bind(()=>{for(const r in n)this.setBuffer(r,n[r])})}setBuffer(n,r){const i=this._getVaryingIndex(n),{buffer:s,byteLength:l,byteOffset:c}=this._getBufferRange(r);if(i<0){this.unusedBuffers[n]=s,Re.warn(`${this.id} unusedBuffers varying buffer ${n}`)();return}this.buffers[i]={buffer:s,byteLength:l,byteOffset:c},this.bindOnUse||this._bindBuffer(i,s,c,l)}getBuffer(n){if(wC(n))return this.buffers[n]||null;const r=this._getVaryingIndex(n);return r>=0?this.buffers[r]:null}bind(n=this.handle){if(typeof n!="function")return this.gl.bindTransformFeedback(36386,n),this;let r;return this._bound?r=n():(this.gl.bindTransformFeedback(36386,this.handle),this._bound=!0,r=n(),this._bound=!1,this.gl.bindTransformFeedback(36386,null)),r}unbind(){this.bind(null)}_getBufferRange(n){if(n instanceof df)return{buffer:n,byteOffset:0,byteLength:n.byteLength};const{buffer:r,byteOffset:i=0,byteLength:s=n.buffer.byteLength}=n;return{buffer:r,byteOffset:i,byteLength:s}}_getVaryingIndex(n){if(wC(n))return Number(n);for(const r of this.layout.varyings)if(n===r.name)return r.location;return-1}_bindBuffers(){for(const n in this.buffers){const{buffer:r,byteLength:i,byteOffset:s}=this._getBufferRange(this.buffers[n]);this._bindBuffer(Number(n),r,s,i)}}_unbindBuffers(){for(const n in this.buffers)this.gl.bindBufferBase(35982,Number(n),null)}_bindBuffer(n,r,i=0,s){const l=r&&r.handle;!l||s===void 0?this.gl.bindBufferBase(35982,n,l):this.gl.bindBufferRange(35982,n,l,i,s)}}function wC(t){return typeof t=="number"?Number.isInteger(t):/^\d+$/.test(t)}class lZ extends ay{constructor(n,r){super(n,r);O(this,"device");O(this,"handle");O(this,"target",null);O(this,"_queryPending",!1);O(this,"_pollingPromise",null);if(this.device=n,r.count>1)throw new Error("WebGL QuerySet can only have one value");this.handle=this.device.gl.createQuery(),Object.seal(this)}get[Symbol.toStringTag](){return"Query"}destroy(){this.device.gl.deleteQuery(this.handle)}beginTimestampQuery(){return this._begin(35007)}endTimestampQuery(){this._end()}beginOcclusionQuery(n){return this._begin(n!=null&&n.conservative?36202:35887)}endOcclusionQuery(){this._end()}beginTransformFeedbackQuery(){return this._begin(35976)}endTransformFeedbackQuery(){this._end()}async resolveQuery(){return[await this.pollQuery()]}_begin(n){this._queryPending||(this.target=n,this.device.gl.beginQuery(this.target,this.handle))}_end(){this._queryPending||this.target&&(this.device.gl.endQuery(this.target),this.target=null,this._queryPending=!0)}isResultAvailable(){if(!this._queryPending)return!1;const n=this.device.gl.getQueryParameter(this.handle,34919);return n&&(this._queryPending=!1),n}isTimerDisjoint(){return this.device.gl.getParameter(36795)}getResult(){return this.device.gl.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}pollQuery(n=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let r=0;return this._pollingPromise=new Promise((i,s)=>{const l=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):r++>n?(s("Timed out"),this._pollingPromise=null):requestAnimationFrame(l)};requestAnimationFrame(l)}),this._pollingPromise}}class Ua extends La{constructor(n){var m,v;super({...n,id:n.id||uK("webgl-device")});O(this,"type","webgl");O(this,"handle");O(this,"features");O(this,"limits");O(this,"info");O(this,"canvasContext");O(this,"lost");O(this,"_resolveContextLost");O(this,"gl");O(this,"debug",!1);O(this,"_canvasSizeInfo",{clientWidth:0,clientHeight:0,devicePixelRatio:1});O(this,"_extensions",{});O(this,"_polyfilled",!1);O(this,"spectorJS");O(this,"renderPass",null);O(this,"_constants");const r=La._getCanvasContextProps(n);if(!r)throw new Error("WebGLDevice requires props.createCanvasContext to be set");let i=(v=(m=r.canvas)==null?void 0:m.gl)==null?void 0:v.device;if(i)throw new Error(`WebGL context already attached to device ${i.id}`);this.canvasContext=new JY(this,r),this.lost=new Promise(S=>{this._resolveContextLost=S});const s={...n.webgl};r.alphaMode==="premultiplied"&&(s.premultipliedAlpha=!0),n.powerPreference!==void 0&&(s.powerPreference=n.powerPreference);const c=this.props._handle||IY(this.canvasContext.canvas,{onContextLost:S=>{var E;return(E=this._resolveContextLost)==null?void 0:E.call(this,{reason:"destroyed",message:"Entered sleep mode, or too many apps or browser tabs are using the GPU."})},onContextRestored:S=>console.log("WebGL context restored")},s);if(!c)throw new Error("WebGL context creation failed");if(i=c.device,i){if(n._reuseDevices)return Re.log(1,`Not creating a new Device, instead returning a reference to Device ${i.id} already attached to WebGL context`,i)(),i._reused=!0,i;throw new Error(`WebGL context already attached to device ${i.id}`)}this.handle=c,this.gl=c,this.spectorJS=nK({...this.props,gl:this.handle}),this.gl.device=this,this.gl._version=2,this.info=DY(this.gl,this._extensions),this.limits=new ZY(this.gl),this.features=new KY(this.gl,this._extensions,this.props._disabledFeatures),this.props._initializeFeatures&&this.features.initializeFeatures(),r.autoResize!==!1&&this.canvasContext.resize(),new Lo(this.gl,{log:(...S)=>Re.log(1,...S)()}).trackState(this.gl,{copyState:!1});const d=n.debugWebGL||n.debug,g=n.debugWebGL;d&&(this.gl=sK(this.gl,{debugWebGL:d,traceWebGL:g}),Re.warn("WebGL debug mode activated. Performance reduced.")(),n.debugWebGL&&(Re.level=Math.max(Re.level,1)))}destroy(){!this.props._reuseDevices&&!this._reused&&delete this.gl.device}get isLost(){return this.gl.isContextLost()}createCanvasContext(n){throw new Error("WebGL only supports a single canvas")}createBuffer(n){const r=this._normalizeBufferProps(n);return new df(this,r)}createTexture(n){return new hf(this,n)}createExternalTexture(n){throw new Error("createExternalTexture() not implemented")}createSampler(n){return new Ry(this,n)}createShader(n){return new gK(this,n)}createFramebuffer(n){return new ff(this,n)}createVertexArray(n){return new Lb(this,n)}createTransformFeedback(n){return new oZ(this,n)}createQuerySet(n){return new lZ(this,n)}createRenderPipeline(n){return new ZK(this,n)}beginRenderPass(n){return new IK(this,n)}createComputePipeline(n){throw new Error("ComputePipeline not supported in WebGL")}beginComputePass(n){throw new Error("ComputePass not supported in WebGL")}createCommandEncoder(n={}){return new rZ(this,n)}submit(){var n;(n=this.renderPass)==null||n.end(),this.renderPass=null}readPixelsToArrayWebGL(n,r){return xK(n,r)}readPixelsToBufferWebGL(n,r){return MK(n,r)}setParametersWebGL(n){Yc(this.gl,n)}getParametersWebGL(n){return UO(this.gl,n)}withParametersWebGL(n,r){return kg(this.gl,n,r)}resetWebGL(){Re.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")(),xY(this.gl)}_getDeviceSpecificTextureFormatCapabilities(n){return WY(this.gl,n,this._extensions)}loseDevice(){var s;let n=!1;const i=this.getExtension("WEBGL_lose_context").WEBGL_lose_context;return i&&(n=!0,i.loseContext()),(s=this._resolveContextLost)==null||s.call(this,{reason:"destroyed",message:"Application triggered context loss"}),n}pushState(){Lo.get(this.gl).push()}popState(){Lo.get(this.gl).pop()}setSpectorMetadata(n,r){n.__SPECTOR_Metadata=r}getGLKey(n,r){const i=Number(n);for(const s in this.gl)if(this.gl[s]===i)return`GL.${s}`;return r!=null&&r.emptyIfUnknown?"":String(n)}getGLKeys(n){const r={emptyIfUnknown:!0};return Object.entries(n).reduce((i,[s,l])=>(i[`${s}:${this.getGLKey(s,r)}`]=`${l}:${this.getGLKey(l,r)}`,i),{})}setConstantAttributeWebGL(n,r){const i=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(i).fill(null);const s=this._constants[n];switch(s&&dZ(s,r)&&Re.info(1,`setConstantAttributeWebGL(${n}) could have been skipped, value unchanged`)(),this._constants[n]=r,r.constructor){case Float32Array:cZ(this,n,r);break;case Int32Array:uZ(this,n,r);break;case Uint32Array:fZ(this,n,r);break;default:throw new Error("constant")}}getExtension(n){return Lc(this.gl,n,this._extensions),this._extensions}}function cZ(t,e,n){switch(n.length){case 1:t.gl.vertexAttrib1fv(e,n);break;case 2:t.gl.vertexAttrib2fv(e,n);break;case 3:t.gl.vertexAttrib3fv(e,n);break;case 4:t.gl.vertexAttrib4fv(e,n);break}}function uZ(t,e,n){t.gl.vertexAttribI4iv(e,n)}function fZ(t,e,n){t.gl.vertexAttribI4uiv(e,n)}function dZ(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}const hZ={WEBGL_depth_texture:{UNSIGNED_INT_24_8_WEBGL:34042},OES_element_index_uint:{},OES_texture_float:{},OES_texture_half_float:{HALF_FLOAT_OES:5131},EXT_color_buffer_float:{},OES_standard_derivatives:{FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723},EXT_frag_depth:{},EXT_blend_minmax:{MIN_EXT:32775,MAX_EXT:32776},EXT_shader_texture_lod:{}},gZ=t=>({drawBuffersWEBGL(e){return t.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),pZ=t=>({VERTEX_ARRAY_BINDING_OES:34229,createVertexArrayOES(){return t.createVertexArray()},deleteVertexArrayOES(e){return t.deleteVertexArray(e)},isVertexArrayOES(e){return t.isVertexArray(e)},bindVertexArrayOES(e){return t.bindVertexArray(e)}}),mZ=t=>({VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,drawArraysInstancedANGLE(...e){return t.drawArraysInstanced(...e)},drawElementsInstancedANGLE(...e){return t.drawElementsInstanced(...e)},vertexAttribDivisorANGLE(...e){return t.vertexAttribDivisor(...e)}});function vZ(t=!0){const e=HTMLCanvasElement.prototype;if(!t&&e.originalGetContext){e.getContext=e.originalGetContext,e.originalGetContext=void 0;return}e.originalGetContext=e.getContext,e.getContext=function(n,r){if(n==="webgl"||n==="experimental-webgl"){const i=this.originalGetContext("webgl2",r);return i instanceof HTMLElement&&_Z(i),i}return this.originalGetContext(n,r)}}function _Z(t){t.getExtension("EXT_color_buffer_float");const e={...hZ,WEBGL_disjoint_timer_query:t.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:gZ(t),OES_vertex_array_object:pZ(t),ANGLE_instanced_arrays:mZ(t)},n=t.getExtension;t.getExtension=function(i){const s=n.call(t,i);return s||(i in e?e[i]:null)};const r=t.getSupportedExtensions;t.getSupportedExtensions=function(){const i=r.apply(t)||[];return i==null?void 0:i.concat(Object.keys(e))}}const Nh=1;class yZ extends OV{constructor(){super();O(this,"type","webgl");La.defaultProps={...La.defaultProps,...Ub},Ua.adapter=this}isSupported(){return typeof WebGL2RenderingContext<"u"}enforceWebGL2(n){vZ(n)}async attach(n){if(n instanceof Ua)return n;if((n==null?void 0:n.device)instanceof La)return n.device;if(!bZ(n))throw new Error("Invalid WebGL2RenderingContext");return new Ua({_handle:n,createCanvasContext:{canvas:n.canvas,autoResize:!1}})}async create(n={}){Re.groupCollapsed(Nh,"WebGLDevice created")();const r=[];(n.debugWebGL||n.debug)&&r.push(iK()),n.debugSpectorJS&&r.push(tK(n));const i=await Promise.allSettled(r);for(const c of i)c.status==="rejected"&&Re.error(`Failed to initialize debug libraries ${c.reason}`)();const s=new Ua(n),l=`${s._reused?"Reusing":"Created"} device with WebGL2 ${s.debug?"debug ":""}context: ${s.info.vendor}, ${s.info.renderer} for canvas: ${s.canvasContext.id}`;return Re.probe(Nh,l)(),Re.table(Nh,s.info)(),Re.groupEnd(Nh)(),s}}function bZ(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:!!(t&&Number.isFinite(t._version))}const EC=new yZ;function ba(){}const SZ=({isDragging:t})=>t?"grabbing":"grab",QO={id:"",width:"100%",height:"100%",style:null,viewState:null,initialViewState:null,pickingRadius:0,layerFilter:null,parameters:{},parent:null,device:null,deviceProps:{type:"webgl"},gl:null,canvas:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},_customRender:null,widgets:[],onDeviceInitialized:ba,onWebGLInitialized:ba,onResize:ba,onViewStateChange:ba,onInteractionStateChange:ba,onBeforeRender:ba,onAfterRender:ba,onLoad:ba,onError:t=>Sn.error(t.message,t.cause)(),onHover:null,onClick:null,onDragStart:null,onDrag:null,onDragEnd:null,_onMetrics:null,getCursor:SZ,getTooltip:null,debug:!1,drawPickingColors:!1};class zb{constructor(e){this.width=0,this.height=0,this.userData={},this.device=null,this.canvas=null,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this.eventManager=null,this.widgetManager=null,this.tooltip=null,this.animationLoop=null,this.cursorState={isHovering:!1,isDragging:!1},this.stats=new ip({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this._needsRedraw="Initial render",this._pickRequest={mode:"hover",x:-1,y:-1,radius:0,event:null},this._lastPointerDownInfo=null,this._onPointerMove=r=>{const{_pickRequest:i}=this;if(r.type==="pointerleave")i.x=-1,i.y=-1,i.radius=0;else{if(r.leftButton||r.rightButton)return;{const s=r.offsetCenter;if(!s)return;i.x=s.x,i.y=s.y,i.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:i.x,y:i.y}),i.event=r},this._onEvent=r=>{const i=my[r.type],s=r.offsetCenter;if(!i||!s||!this.layerManager)return;const l=this.layerManager.getLayers(),c=this.deckPicker.getLastPickedObject({x:s.x,y:s.y,layers:l,viewports:this.getViewports(s)},this._lastPointerDownInfo),{layer:f}=c,d=f&&(f[i]||f.props[i]),g=this.props[i];let m=!1;d&&(m=d.call(f,c,r)),m||(g==null||g(c,r),this.widgetManager.onEvent(c,r))},this._onPointerDown=r=>{const i=r.offsetCenter,s=this._pick("pickObject","pickObject Time",{x:i.x,y:i.y,radius:this.props.pickingRadius});this._lastPointerDownInfo=s.result[0]||s.emptyInfo},this.props={...QO,...e},e=this.props,e.viewState&&e.initialViewState&&Sn.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),this.viewState=this.props.initialViewState,e.device&&(this.device=e.device);let n=this.device;!n&&e.gl&&(e.gl instanceof WebGLRenderingContext&&Sn.error("WebGL1 context not supported.")(),n=EC.attach(e.gl)),n||(n=J_.createDevice({type:"best-available",_reuseDevices:!0,adapters:[EC],...e.deviceProps,createCanvasContext:{canvas:this._createCanvas(e),useDevicePixels:this.props.useDevicePixels,autoResize:!1}})),this.animationLoop=this._createAnimationLoop(n,e),this.setProps(e),e._typedArrayManagerProps&&Bf.setOptions(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){var e,n,r,i,s,l,c,f,d,g;(e=this.animationLoop)==null||e.stop(),(n=this.animationLoop)==null||n.destroy(),this.animationLoop=null,this._lastPointerDownInfo=null,(r=this.layerManager)==null||r.finalize(),this.layerManager=null,(i=this.viewManager)==null||i.finalize(),this.viewManager=null,(s=this.effectManager)==null||s.finalize(),this.effectManager=null,(l=this.deckRenderer)==null||l.finalize(),this.deckRenderer=null,(c=this.deckPicker)==null||c.finalize(),this.deckPicker=null,(f=this.eventManager)==null||f.destroy(),this.eventManager=null,(d=this.widgetManager)==null||d.finalize(),this.widgetManager=null,!this.props.canvas&&!this.props.device&&!this.props.gl&&this.canvas&&((g=this.canvas.parentElement)==null||g.removeChild(this.canvas),this.canvas=null)}setProps(e){var r;this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Sn.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Sn.removed("onLayerClick","onClick")(),e.initialViewState&&!Ji(this.props.initialViewState,e.initialViewState,3)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const n=Object.create(this.props);Object.assign(n,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),(r=this.animationLoop)==null||r.setProps(n),this.layerManager&&(this.viewManager.setProps(n),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(n),this.effectManager.setProps(n),this.deckRenderer.setProps(n),this.deckPicker.setProps(n),this.widgetManager.setProps(n)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(!this.layerManager)return!1;if(this.props._animate)return"Deck._animate";let n=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const r=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),s=this.effectManager.needsRedraw(e),l=this.deckRenderer.needsRedraw(e);return n=n||r||i||s||l,n}redraw(e){if(!this.layerManager)return;let n=this.needsRedraw({clearRedrawFlags:!0});n=e||n,n&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(n):this._drawLayers(n))}get isInitialized(){return this.viewManager!==null}getViews(){return Br(this.viewManager),this.viewManager.views}getViewports(e){return Br(this.viewManager),this.viewManager.getViewports(e)}getCanvas(){return this.canvas}pickObject(e){const n=this._pick("pickObject","pickObject Time",e).result;return n.length?n[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,n=!1){for(const r in e)this.layerManager.resourceManager.add({resourceId:r,data:e[r],forceUpdate:n})}_removeResources(e){for(const n of e)this.layerManager.resourceManager.remove(n)}_addDefaultEffect(e){this.effectManager.addDefaultEffect(e)}_addDefaultShaderModule(e){this.layerManager.addDefaultShaderModule(e)}_removeDefaultShaderModule(e){var n;(n=this.layerManager)==null||n.removeDefaultShaderModule(e)}_pick(e,n,r){Br(this.deckPicker);const{stats:i}=this;i.get("Pick Count").incrementCount(),i.get(n).timeStart();const s=this.deckPicker[e]({layers:this.layerManager.getLayers(r),views:this.viewManager.getViews(),viewports:this.getViewports(r),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects(),...r});return i.get(n).timeEnd(),s}_createCanvas(e){let n=e.canvas;return typeof n=="string"&&(n=document.getElementById(n),Br(n)),n||(n=document.createElement("canvas"),n.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(n)),Object.assign(n.style,e.style),n}_setCanvasSize(e){var i;if(!this.canvas)return;const{width:n,height:r}=e;if(n||n===0){const s=Number.isFinite(n)?`${n}px`:n;this.canvas.style.width=s}if(r||r===0){const s=Number.isFinite(r)?`${r}px`:r;this.canvas.style.position=((i=e.style)==null?void 0:i.position)||"absolute",this.canvas.style.height=s}}_updateCanvasSize(){var i,s;const{canvas:e}=this;if(!e)return;const n=e.clientWidth??e.width,r=e.clientHeight??e.height;(n!==this.width||r!==this.height)&&(this.width=n,this.height=r,(i=this.viewManager)==null||i.setProps({width:n,height:r}),(s=this.layerManager)==null||s.activateViewport(this.getViewports()[0]),this.props.onResize({width:n,height:r}))}_createAnimationLoop(e,n){const{gl:r,onError:i,useDevicePixels:s}=n;return new gq({device:e,useDevicePixels:s,autoResizeDrawingBuffer:!r,autoResizeViewport:!1,onInitialize:l=>this._setDevice(l.device),onRender:this._onRenderFrame.bind(this),onError:i})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){const{views:e}=this.props,n=Array.isArray(e)?e:e?[e]:[new FO({id:"default-view"})];return n.length&&this.props.controller&&(n[0].props.controller=this.props.controller),n}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_pickAndCallback(){var n,r,i;const{_pickRequest:e}=this;if(e.event){const{result:s,emptyInfo:l}=this._pick("pickObject","pickObject Time",e);this.cursorState.isHovering=s.length>0;let c=l,f=!1;for(const d of s)c=d,f=((n=d.layer)==null?void 0:n.onHover(d,e.event))||f;f||((i=(r=this.props).onHover)==null||i.call(r,c,e.event),this.widgetManager.onHover(c,e.event)),e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.cursorState))}_setDevice(e){var i,s;if(this.device=e,!this.animationLoop)return;this.canvas||(this.canvas=(i=this.device.canvasContext)==null?void 0:i.canvas),this.device instanceof Ua&&this.device.setParametersWebGL({blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onDeviceInitialized(this.device),this.device instanceof Ua&&this.props.onWebGLInitialized(this.device.gl);const n=new RO;n.play(),this.animationLoop.attachTimeline(n),this.eventManager=new QW(this.props.parent||this.canvas,{touchAction:this.props.touchAction,recognizers:Object.keys(HA).map(l=>{var S;const[c,f,d,g]=HA[l],m=(S=this.props.eventRecognizerOptions)==null?void 0:S[l],v={...f,...m,event:l};return{recognizer:new c(v),recognizeWith:d,requestFailure:g}}),events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const l in my)this.eventManager.on(l,this._onEvent);this.viewManager=new Yq({timeline:n,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const r=this.viewManager.getViewports()[0];this.layerManager=new qq(this.device,{deck:this,stats:this.stats,viewport:r,timeline:n}),this.effectManager=new uY({deck:this,device:this.device}),this.deckRenderer=new hY(this.device),this.deckPicker=new yY(this.device),this.widgetManager=new wY({deck:this,parentElement:(s=this.canvas)==null?void 0:s.parentElement}),this.widgetManager.addDefault(new TY),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,n){var l;const{device:r,gl:i}=this.layerManager.context;this.props.onBeforeRender({device:r,gl:i});const s={target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",effects:this.effectManager.getEffects(),...n};(l=this.deckRenderer)==null||l.renderLayers(s),s.pass==="screen"&&this.widgetManager.onRedraw({viewports:s.viewports,layers:s.layers}),this.props.onAfterRender({device:r,gl:i})}_onRenderFrame(){this._getFrameStats(),this._metricsCounter++%60===0&&(this._getMetrics(),this.stats.reset(),Sn.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const n=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState={...this.viewState,[e.viewId]:n},this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.cursorState.isDragging=e.isDragging||!1,this.props.onInteractionStateChange(e)}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const n=this.animationLoop.stats;e.get("GPU Time").addTime(n.get("GPU Time").lastTiming),e.get("CPU Time").addTime(n.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:n}=this;e.fps=n.get("frameRate").getHz(),e.setPropsTime=n.get("setProps Time").time,e.updateAttributesTime=n.get("Update Attributes").time,e.framesRedrawn=n.get("Redraw Count").count,e.pickTime=n.get("pickObject Time").time+n.get("pickMultipleObjects Time").time+n.get("pickObjects Time").time,e.pickCount=n.get("Pick Count").count,e.gpuTime=n.get("GPU Time").time,e.cpuTime=n.get("CPU Time").time,e.gpuTimePerFrame=n.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=n.get("CPU Time").getAverageTime();const r=J_.stats.get("Memory Usage");e.bufferMemory=r.get("Buffer Memory").count,e.textureMemory=r.get("Texture Memory").count,e.renderbufferMemory=r.get("Renderbuffer Memory").count,e.gpuMemory=r.get("GPU Memory").count}}zb.defaultProps=QO;zb.VERSION=F$;function wZ(t){switch(t){case"float64":return Float64Array;case"uint8":case"unorm8":return Uint8ClampedArray;default:return LM(t)}}const EZ=UM;function Ih(t,e){return{attribute:t,format:e.size>1?`${e.type}x${e.size}`:e.type,byteOffset:e.offset||0}}function Ao(t){return t.stride||t.size*t.bytesPerElement}function TZ(t,e){return t.type===e.type&&t.size===e.size&&Ao(t)===Ao(e)&&(t.offset||0)===(e.offset||0)}function xy(t,e){e.offset&&Sn.removed("shaderAttribute.offset","vertexOffset, elementOffset")();const n=Ao(t),r=e.vertexOffset!==void 0?e.vertexOffset:t.vertexOffset||0,i=e.elementOffset||0,s=r*n+i*t.bytesPerElement+(t.offset||0);return{...e,offset:s,stride:n}}function AZ(t,e){const n=xy(t,e);return{high:n,low:{...n,offset:n.offset+t.size*4}}}class CZ{constructor(e,n,r){this._buffer=null,this.device=e,this.id=n.id||"",this.size=n.size||1;const i=n.logicalType||n.type,s=i==="float64";let{defaultValue:l}=n;l=Number.isFinite(l)?[l]:l||new Array(this.size).fill(0);let c;s?c="float32":!i&&n.isIndexed?c="uint32":c=i||"float32";let f=wZ(i||c);this.doublePrecision=s,s&&n.fp64===!1&&(f=Float32Array),this.value=null,this.settings={...n,defaultType:f,defaultValue:l,logicalType:i,type:c,normalized:c.includes("norm"),size:this.size,bytesPerElement:f.BYTES_PER_ELEMENT},this.state={...r,externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1}}get isConstant(){return this.state.constant}get buffer(){return this._buffer}get byteOffset(){const e=this.getAccessor();return e.vertexOffset?e.vertexOffset*Ao(e):0}get numInstances(){return this.state.numInstances}set numInstances(e){this.state.numInstances=e}delete(){this._buffer&&(this._buffer.delete(),this._buffer=null),Bf.release(this.state.allocatedValue)}getBuffer(){return this.state.constant?null:this.state.externalBuffer||this._buffer}getValue(e=this.id,n=null){const r={};if(this.state.constant){const i=this.value;if(n){const s=xy(this.getAccessor(),n),l=s.offset/i.BYTES_PER_ELEMENT,c=s.size||this.size;r[e]=i.subarray(l,l+c)}else r[e]=i}else r[e]=this.getBuffer();return this.doublePrecision&&(this.value instanceof Float64Array?r[`${e}64Low`]=r[e]:r[`${e}64Low`]=new Float32Array(this.size)),r}_getBufferLayout(e=this.id,n=null){const r=this.getAccessor(),i=[],s={name:this.id,byteStride:Ao(r),attributes:i};if(this.doublePrecision){const l=AZ(r,n||{});i.push(Ih(e,{...r,...l.high}),Ih(`${e}64Low`,{...r,...l.low}))}else if(n){const l=xy(r,n);i.push(Ih(e,{...r,...l}))}else i.push(Ih(e,r));return s}setAccessor(e){this.state.bufferAccessor=e}getAccessor(){return this.state.bufferAccessor}getBounds(){if(this.state.bounds)return this.state.bounds;let e=null;if(this.state.constant&&this.value){const n=Array.from(this.value);e=[n,n]}else{const{value:n,numInstances:r,size:i}=this,s=r*i;if(n&&s&&n.length>=s){const l=new Array(i).fill(1/0),c=new Array(i).fill(-1/0);for(let f=0;f<s;)for(let d=0;d<i;d++){const g=n[f++];g<l[d]&&(l[d]=g),g>c[d]&&(c[d]=g)}e=[l,c]}}return this.state.bounds=e,e}setData(e){const{state:n}=this;let r;ArrayBuffer.isView(e)?r={value:e}:e instanceof $n?r={buffer:e}:r=e;const i={...this.settings,...r};if(ArrayBuffer.isView(r.value)){if(!r.type)if(this.doublePrecision&&r.value instanceof Float64Array)i.type="float32";else{const l=EZ(r.value);i.type=i.normalized?l.replace("int","norm"):l}i.bytesPerElement=r.value.BYTES_PER_ELEMENT,i.stride=Ao(i)}if(n.bounds=null,r.constant){let s=r.value;if(s=this._normalizeValue(s,[],0),this.settings.normalized&&(s=this.normalizeConstant(s)),!(!n.constant||!this._areValuesEqual(s,this.value)))return!1;n.externalBuffer=null,n.constant=!0,this.value=ArrayBuffer.isView(s)?s:new Float32Array(s)}else if(r.buffer){const s=r.buffer;n.externalBuffer=s,n.constant=!1,this.value=r.value||null}else if(r.value){this._checkExternalBuffer(r);let s=r.value;n.externalBuffer=null,n.constant=!1,this.value=s;let{buffer:l}=this;const c=Ao(i),f=(i.vertexOffset||0)*c;if(this.doublePrecision&&s instanceof Float64Array&&(s=b0(s,i)),this.settings.isIndexed){const g=this.settings.defaultType;s.constructor!==g&&(s=new g(s))}const d=s.byteLength+f+c*2;(!l||l.byteLength<d)&&(l=this._createBuffer(d)),l.write(s,f)}return this.setAccessor(i),!0}updateSubBuffer(e={}){this.state.bounds=null;const n=this.value,{startOffset:r=0,endOffset:i}=e;this.buffer.write(this.doublePrecision&&n instanceof Float64Array?b0(n,{size:this.size,startIndex:r,endIndex:i}):n.subarray(r,i),r*n.BYTES_PER_ELEMENT+this.byteOffset)}allocate(e,n=!1){const{state:r}=this,i=r.allocatedValue,s=Bf.allocate(i,e+1,{size:this.size,type:this.settings.defaultType,copy:n});this.value=s;const{byteOffset:l}=this;let{buffer:c}=this;return(!c||c.byteLength<s.byteLength+l)&&(c=this._createBuffer(s.byteLength+l),n&&i&&c.write(i instanceof Float64Array?b0(i,this):i,l)),r.allocatedValue=s,r.constant=!1,r.externalBuffer=null,this.setAccessor(this.settings),!0}_checkExternalBuffer(e){const{value:n}=e;if(!ArrayBuffer.isView(n))throw new Error(`Attribute ${this.id} value is not TypedArray`);const r=this.settings.defaultType;let i=!1;if(this.doublePrecision&&(i=n.BYTES_PER_ELEMENT<4),i)throw new Error(`Attribute ${this.id} does not support ${n.constructor.name}`);!(n instanceof r)&&this.settings.normalized&&!("normalized"in e)&&Sn.warn(`Attribute ${this.id} is normalized`)()}normalizeConstant(e){switch(this.settings.type){case"snorm8":return new Float32Array(e).map(n=>(n+128)/255*2-1);case"snorm16":return new Float32Array(e).map(n=>(n+32768)/65535*2-1);case"unorm8":return new Float32Array(e).map(n=>n/255);case"unorm16":return new Float32Array(e).map(n=>n/65535);default:return e}}_normalizeValue(e,n,r){const{defaultValue:i,size:s}=this.settings;if(Number.isFinite(e))return n[r]=e,n;if(!e){let l=s;for(;--l>=0;)n[r+l]=i[l];return n}switch(s){case 4:n[r+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:n[r+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:n[r+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:n[r+0]=Number.isFinite(e[0])?e[0]:i[0];break;default:let l=s;for(;--l>=0;)n[r+l]=Number.isFinite(e[l])?e[l]:i[l]}return n}_areValuesEqual(e,n){if(!e||!n)return!1;const{size:r}=this;for(let i=0;i<r;i++)if(e[i]!==n[i])return!1;return!0}_createBuffer(e){var i;this._buffer&&this._buffer.destroy();const{isIndexed:n,type:r}=this.settings;return this._buffer=this.device.createBuffer({...(i=this._buffer)==null?void 0:i.props,id:this.id,usage:n?$n.INDEX:$n.VERTEX,indexType:n?r:void 0,byteLength:e}),this._buffer}}const TC=[],AC=[];function RZ(t,e=0,n=1/0){let r=TC;const i={index:-1,data:t,target:[]};return t?typeof t[Symbol.iterator]=="function"?r=t:t.length>0&&(AC.length=t.length,r=AC):r=TC,(e>0||Number.isFinite(n))&&(r=(Array.isArray(r)?r:Array.from(r)).slice(e,n),i.index=e-1),{iterable:r,objectInfo:i}}function GO(t){return t&&t[Symbol.asyncIterator]}function xZ(t,e){const{size:n,stride:r,offset:i,startIndices:s,nested:l}=e,c=t.BYTES_PER_ELEMENT,f=r?r/c:n,d=i?i/c:0,g=Math.floor((t.length-d)/f);return(m,{index:v,target:S})=>{if(!s){const A=v*f+d;for(let T=0;T<n;T++)S[T]=t[A+T];return S}const E=s[v],w=s[v+1]||g;let b;if(l){b=new Array(w-E);for(let A=E;A<w;A++){const T=A*f+d;S=new Array(n);for(let C=0;C<n;C++)S[C]=t[T+C];b[A-E]=S}}else if(f===n)b=t.subarray(E*n+d,w*n+d);else{b=new t.constructor((w-E)*n);let A=0;for(let T=E;T<w;T++){const C=T*f+d;for(let M=0;M<n;M++)b[A++]=t[C+M]}}return b}}const MZ=[],Wh=[[0,1/0]];function OZ(t,e){if(t===Wh||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return t;const n=[],r=t.length;let i=0;for(let s=0;s<r;s++){const l=t[s];l[1]<e[0]?(n.push(l),i=s+1):l[0]>e[1]?n.push(l):e=[Math.min(l[0],e[0]),Math.max(l[1],e[1])]}return n.splice(i,0,e),n}const PZ={interpolation:{duration:0,easing:t=>t},spring:{stiffness:.05,damping:.5}};function JO(t,e){if(!t)return null;Number.isFinite(t)&&(t={type:"interpolation",duration:t});const n=t.type||"interpolation";return{...PZ[n],...e,...t,type:n}}class eP extends CZ{constructor(e,n){super(e,n,{startIndices:null,lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,layoutChanged:!1,updateRanges:Wh}),this.constant=!1,this.settings.update=n.update||(n.accessor?this._autoUpdater:void 0),Object.seal(this.settings),Object.seal(this.state),this._validateAttributeUpdaters()}get startIndices(){return this.state.startIndices}set startIndices(e){this.state.startIndices=e}needsUpdate(){return this.state.needsUpdate}needsRedraw({clearChangedFlags:e=!1}={}){const n=this.state.needsRedraw;return this.state.needsRedraw=n&&!e,n}layoutChanged(){return this.state.layoutChanged}setAccessor(e){var n;(n=this.state).layoutChanged||(n.layoutChanged=!TZ(e,this.getAccessor())),super.setAccessor(e)}getUpdateTriggers(){const{accessor:e}=this.settings;return[this.id].concat(typeof e!="function"&&e||[])}supportsTransition(){return!!this.settings.transition}getTransitionSetting(e){if(!e||!this.supportsTransition())return null;const{accessor:n}=this.settings,r=this.settings.transition,i=Array.isArray(n)?e[n.find(s=>e[s])]:e[n];return JO(i,r)}setNeedsUpdate(e=this.id,n){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),n){const{startRow:r=0,endRow:i=1/0}=n;this.state.updateRanges=OZ(this.state.updateRanges,[r,i])}else this.state.updateRanges=Wh}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=MZ}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}allocate(e){const{state:n,settings:r}=this;return r.noAlloc?!1:r.update?(super.allocate(e,n.updateRanges!==Wh),!0):!1}updateBuffer({numInstances:e,data:n,props:r,context:i}){if(!this.needsUpdate())return!1;const{state:{updateRanges:s},settings:{update:l,noAlloc:c}}=this;let f=!0;if(l){for(const[d,g]of s)l.call(i,this,{data:n,startRow:d,endRow:g,props:r,numInstances:e});if(this.value)if(this.constant||!this.buffer||this.buffer.byteLength<this.value.byteLength+this.byteOffset)this.setData({value:this.value,constant:this.constant}),this.constant=!1;else for(const[d,g]of s){const m=Number.isFinite(d)?this.getVertexOffset(d):0,v=Number.isFinite(g)?this.getVertexOffset(g):c||!Number.isFinite(e)?this.value.length:e*this.size;super.updateSubBuffer({startOffset:m,endOffset:v})}this._checkAttributeArray()}else f=!1;return this.clearNeedsUpdate(),this.setNeedsRedraw(),f}setConstantValue(e){return e===void 0||typeof e=="function"?!1:(this.setData({constant:!0,value:e})&&this.setNeedsRedraw(),this.clearNeedsUpdate(),!0)}setExternalBuffer(e){const{state:n}=this;return e?(this.clearNeedsUpdate(),n.lastExternalBuffer===e||(n.lastExternalBuffer=e,this.setNeedsRedraw(),this.setData(e)),!0):(n.lastExternalBuffer=null,!1)}setBinaryValue(e,n=null){const{state:r,settings:i}=this;if(!e)return r.binaryValue=null,r.binaryAccessor=null,!1;if(i.noAlloc)return!1;if(r.binaryValue===e)return this.clearNeedsUpdate(),!0;if(r.binaryValue=e,this.setNeedsRedraw(),i.transform||n!==this.startIndices){ArrayBuffer.isView(e)&&(e={value:e});const l=e;Br(ArrayBuffer.isView(l.value),`invalid ${i.accessor}`);const c=!!l.size&&l.size!==this.size;return r.binaryAccessor=xZ(l.value,{size:l.size||this.size,stride:l.stride,offset:l.offset,startIndices:n,nested:c}),!1}return this.clearNeedsUpdate(),this.setData(e),!0}getVertexOffset(e){const{startIndices:n}=this;return(n?e<n.length?n[e]:this.numInstances:e)*this.size}getValue(){const e=this.settings.shaderAttributes,n=super.getValue();if(!e)return n;for(const r in e)Object.assign(n,super.getValue(r,e[r]));return n}getBufferLayout(e){this.state.layoutChanged=!1;const n=this.settings.shaderAttributes,r=super._getBufferLayout(),{stepMode:i}=this.settings;if(i==="dynamic"?r.stepMode=e?e.isInstanced?"instance":"vertex":"instance":r.stepMode=i??"vertex",!n)return r;for(const s in n){const l=super._getBufferLayout(s,n[s]);r.attributes.push(...l.attributes)}return r}_autoUpdater(e,{data:n,startRow:r,endRow:i,props:s,numInstances:l}){if(e.constant)return;const{settings:c,state:f,value:d,size:g,startIndices:m}=e,{accessor:v,transform:S}=c,E=f.binaryAccessor||(typeof v=="function"?v:s[v]);Br(typeof E=="function",`accessor "${v}" is not a function`);let w=e.getVertexOffset(r);const{iterable:b,objectInfo:A}=RZ(n,r,i);for(const T of b){A.index++;let C=E(T,A);if(S&&(C=S.call(this,C)),m){const M=(A.index<m.length-1?m[A.index+1]:l)-m[A.index];if(C&&Array.isArray(C[0])){let x=w;for(const N of C)e._normalizeValue(N,d,x),x+=g}else C&&C.length>g?d.set(C,w):(e._normalizeValue(C,A.target,0),Vq({target:d,source:A.target,start:w,count:M}));w+=M*g}else e._normalizeValue(C,d,w),w+=g}}_validateAttributeUpdaters(){const{settings:e}=this;if(!(e.noAlloc||typeof e.update=="function"))throw new Error(`Attribute ${this.id} missing update or accessor`)}_checkAttributeArray(){const{value:e}=this,n=Math.min(4,this.size);if(e&&e.length>=n){let r=!0;switch(n){case 4:r=r&&Number.isFinite(e[3]);case 3:r=r&&Number.isFinite(e[2]);case 2:r=r&&Number.isFinite(e[1]);case 1:r=r&&Number.isFinite(e[0]);break;default:r=!1}if(!r)throw new Error(`Illegal attribute generated for ${this.id}`)}}}function M0(t){const{source:e,target:n,start:r=0,size:i,getData:s}=t,l=t.end||n.length,c=e.length,f=l-r;if(c>f){n.set(e.subarray(0,f),r);return}if(n.set(e,r),!s)return;let d=c;for(;d<f;){const g=s(d,e);for(let m=0;m<i;m++)n[r+d]=g[m]||0,d++}}function NZ({source:t,target:e,size:n,getData:r,sourceStartIndices:i,targetStartIndices:s}){if(!i||!s)return M0({source:t,target:e,size:n,getData:r}),e;let l=0,c=0;const f=r&&((g,m)=>r(g+c,m)),d=Math.min(i.length,s.length);for(let g=1;g<d;g++){const m=i[g]*n,v=s[g]*n;M0({source:t.subarray(l,m),target:e,start:c,end:v,size:n,getData:f}),l=m,c=v}return c<e.length&&M0({source:[],target:e,start:c,size:n,getData:f}),e}function IZ(t){const{device:e,settings:n,value:r}=t,i=new eP(e,n);return i.setData({value:r instanceof Float64Array?new Float64Array(0):new Float32Array(0),normalized:n.normalized}),i}function tP(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error(`No defined attribute type for size "${t}"`)}}function nP(t){switch(t){case 1:return"float32";case 2:return"float32x2";case 3:return"float32x3";case 4:return"float32x4";default:throw new Error("invalid type size")}}function rP(t){t.push(t.shift())}function DZ(t,e){const{doublePrecision:n,settings:r,value:i,size:s}=t,l=n&&i instanceof Float64Array?2:1;let c=0;const{shaderAttributes:f}=t.settings;if(f)for(const d of Object.values(f))c=Math.max(c,d.vertexOffset??0);return(r.noAlloc?i.length:(e+c)*s)*l}function iP({device:t,source:e,target:n}){return(!n||n.byteLength<e.byteLength)&&(n==null||n.destroy(),n=t.createBuffer({byteLength:e.byteLength,usage:e.usage})),n}function sP({device:t,buffer:e,attribute:n,fromLength:r,toLength:i,fromStartIndices:s,getData:l=c=>c}){const c=n.doublePrecision&&n.value instanceof Float64Array?2:1,f=n.size*c,d=n.byteOffset,g=n.settings.bytesPerElement<4?d/n.settings.bytesPerElement*4:d,m=n.startIndices,v=s&&m,S=n.isConstant;if(!v&&e&&r>=i)return e;const E=n.value instanceof Float64Array?Float32Array:n.value.constructor,w=S?n.value:new E(n.getBuffer().readSyncWebGL(d,i*E.BYTES_PER_ELEMENT).buffer);if(n.settings.normalized&&!S){const C=l;l=(M,x)=>n.normalizeConstant(C(M,x))}const b=S?(C,M)=>l(w,M):(C,M)=>l(w.subarray(C+d,C+d+f),M),A=e?new Float32Array(e.readSyncWebGL(g,r*4).buffer):new Float32Array(0),T=new Float32Array(i);return NZ({source:A,target:T,sourceStartIndices:s,targetStartIndices:m,size:f,getData:b}),(!e||e.byteLength<T.byteLength+g)&&(e==null||e.destroy(),e=t.createBuffer({byteLength:T.byteLength+g,usage:35050})),e.write(T,g),e}class aP{constructor({device:e,attribute:n,timeline:r}){this.buffers=[],this.currentLength=0,this.device=e,this.transition=new Sp(r),this.attribute=n,this.attributeInTransition=IZ(n),this.currentStartIndices=n.startIndices}get inProgress(){return this.transition.inProgress}start(e,n,r=1/0){this.settings=e,this.currentStartIndices=this.attribute.startIndices,this.currentLength=DZ(this.attribute,n),this.transition.start({...e,duration:r})}update(){const e=this.transition.update();return e&&this.onUpdate(),e}setBuffer(e){this.attributeInTransition.setData({buffer:e,normalized:this.attribute.settings.normalized,value:this.attributeInTransition.value})}cancel(){this.transition.cancel()}delete(){this.cancel();for(const e of this.buffers)e.destroy();this.buffers.length=0}}class FZ extends aP{constructor({device:e,attribute:n,timeline:r}){super({device:e,attribute:n,timeline:r}),this.type="interpolation",this.transform=LZ(e,n)}start(e,n){const r=this.currentLength,i=this.currentStartIndices;if(super.start(e,n,e.duration),e.duration<=0){this.transition.cancel();return}const{buffers:s,attribute:l}=this;rP(s),s[0]=sP({device:this.device,buffer:s[0],attribute:l,fromLength:r,toLength:this.currentLength,fromStartIndices:i,getData:e.enter}),s[1]=iP({device:this.device,source:s[0],target:s[1]}),this.setBuffer(s[1]);const{transform:c}=this,f=c.model;let d=Math.floor(this.currentLength/l.size);oP(l)&&(d/=2),f.setVertexCount(d),l.isConstant?(f.setAttributes({aFrom:s[0]}),f.setConstantAttributes({aTo:l.value})):f.setAttributes({aFrom:s[0],aTo:l.getBuffer()}),c.transformFeedback.setBuffers({vCurrent:s[1]})}onUpdate(){const{duration:e,easing:n}=this.settings,{time:r}=this.transition;let i=r/e;n&&(i=n(i));const{model:s}=this.transform,l={time:i};s.shaderInputs.setProps({interpolation:l}),this.transform.run({discard:!0})}delete(){super.delete(),this.transform.destroy()}}const kZ=`uniform interpolationUniforms {
float time;
} interpolation;
`,CC={name:"interpolation",vs:kZ,uniformTypes:{time:"f32"}},BZ=`#version 300 es
#define SHADER_NAME interpolation-transition-vertex-shader
in ATTRIBUTE_TYPE aFrom;
in ATTRIBUTE_TYPE aTo;
out ATTRIBUTE_TYPE vCurrent;
void main(void) {
vCurrent = mix(aFrom, aTo, interpolation.time);
gl_Position = vec4(0.0);
}
`,UZ=`#version 300 es
#define SHADER_NAME interpolation-transition-vertex-shader
in ATTRIBUTE_TYPE aFrom;
in ATTRIBUTE_TYPE aFrom64Low;
in ATTRIBUTE_TYPE aTo;
in ATTRIBUTE_TYPE aTo64Low;
out ATTRIBUTE_TYPE vCurrent;
out ATTRIBUTE_TYPE vCurrent64Low;
vec2 mix_fp64(vec2 a, vec2 b, float x) {
vec2 range = sub_fp64(b, a);
return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));
}
void main(void) {
for (int i=0; i<ATTRIBUTE_SIZE; i++) {
vec2 value = mix_fp64(vec2(aFrom[i], aFrom64Low[i]), vec2(aTo[i], aTo64Low[i]), interpolation.time);
vCurrent[i] = value.x;
vCurrent64Low[i] = value.y;
}
gl_Position = vec4(0.0);
}
`;function oP(t){return t.doublePrecision&&t.value instanceof Float64Array}function LZ(t,e){const n=e.size,r=tP(n),i=nP(n),s=e.getBufferLayout();return oP(e)?new Uf(t,{vs:UZ,bufferLayout:[{name:"aFrom",byteStride:8*n,attributes:[{attribute:"aFrom",format:i,byteOffset:0},{attribute:"aFrom64Low",format:i,byteOffset:4*n}]},{name:"aTo",byteStride:8*n,attributes:[{attribute:"aTo",format:i,byteOffset:0},{attribute:"aTo64Low",format:i,byteOffset:4*n}]}],modules:[jj,CC],defines:{ATTRIBUTE_TYPE:r,ATTRIBUTE_SIZE:n},moduleSettings:{},varyings:["vCurrent","vCurrent64Low"],bufferMode:35980,disableWarnings:!0}):new Uf(t,{vs:BZ,bufferLayout:[{name:"aFrom",format:i},{name:"aTo",format:s.attributes[0].format}],modules:[CC],defines:{ATTRIBUTE_TYPE:r},varyings:["vCurrent"],disableWarnings:!0})}class zZ extends aP{constructor({device:e,attribute:n,timeline:r}){super({device:e,attribute:n,timeline:r}),this.type="spring",this.texture=XZ(e),this.framebuffer=qZ(e,this.texture),this.transform=WZ(e,n)}start(e,n){const r=this.currentLength,i=this.currentStartIndices;super.start(e,n);const{buffers:s,attribute:l}=this;for(let f=0;f<2;f++)s[f]=sP({device:this.device,buffer:s[f],attribute:l,fromLength:r,toLength:this.currentLength,fromStartIndices:i,getData:e.enter});s[2]=iP({device:this.device,source:s[0],target:s[2]}),this.setBuffer(s[1]);const{model:c}=this.transform;c.setVertexCount(Math.floor(this.currentLength/l.size)),l.isConstant?c.setConstantAttributes({aTo:l.value}):c.setAttributes({aTo:l.getBuffer()})}onUpdate(){const{buffers:e,transform:n,framebuffer:r,transition:i}=this,s=this.settings;n.model.setAttributes({aPrev:e[0],aCur:e[1]}),n.transformFeedback.setBuffers({vNext:e[2]});const l={stiffness:s.stiffness,damping:s.damping};n.model.shaderInputs.setProps({spring:l}),n.run({framebuffer:r,discard:!1,parameters:{viewport:[0,0,1,1]},clearColor:[0,0,0,0]}),rP(e),this.setBuffer(e[1]),this.device.readPixelsToArrayWebGL(r)[0]>0||i.end()}delete(){super.delete(),this.transform.destroy(),this.texture.destroy(),this.framebuffer.destroy()}}const $Z=`uniform springUniforms {
float damping;
float stiffness;
} spring;
`,VZ={name:"spring",vs:$Z,uniformTypes:{damping:"f32",stiffness:"f32"}},HZ=`#version 300 es
#define SHADER_NAME spring-transition-vertex-shader
#define EPSILON 0.00001
in ATTRIBUTE_TYPE aPrev;
in ATTRIBUTE_TYPE aCur;
in ATTRIBUTE_TYPE aTo;
out ATTRIBUTE_TYPE vNext;
out float vIsTransitioningFlag;
ATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {
ATTRIBUTE_TYPE velocity = cur - prev;
ATTRIBUTE_TYPE delta = dest - cur;
ATTRIBUTE_TYPE force = delta * spring.stiffness;
ATTRIBUTE_TYPE resistance = velocity * spring.damping;
return force - resistance + velocity + cur;
}
void main(void) {
bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;
vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;
vNext = getNextValue(aCur, aPrev, aTo);
gl_Position = vec4(0, 0, 0, 1);
gl_PointSize = 100.0;
}
`,jZ=`#version 300 es
#define SHADER_NAME spring-transition-is-transitioning-fragment-shader
in float vIsTransitioningFlag;
out vec4 fragColor;
void main(void) {
if (vIsTransitioningFlag == 0.0) {
discard;
}
fragColor = vec4(1.0);
}`;function WZ(t,e){const n=tP(e.size),r=nP(e.size);return new Uf(t,{vs:HZ,fs:jZ,bufferLayout:[{name:"aPrev",format:r},{name:"aCur",format:r},{name:"aTo",format:e.getBufferLayout().attributes[0].format}],varyings:["vNext"],modules:[VZ],defines:{ATTRIBUTE_TYPE:n},parameters:{depthCompare:"always",blendColorOperation:"max",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaOperation:"max",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"}})}function XZ(t){return t.createTexture({data:new Uint8Array(4),format:"rgba8unorm",mipmaps:!1,width:1,height:1})}function qZ(t,e){return t.createFramebuffer({id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,colorAttachments:[e]})}const YZ={interpolation:FZ,spring:zZ};class KZ{constructor(e,{id:n,timeline:r}){if(!e)throw new Error("AttributeTransitionManager is constructed without device");this.id=n,this.device=e,this.timeline=r,this.transitions={},this.needsRedraw=!1,this.numInstances=1}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:n,numInstances:r}){this.numInstances=r||1;for(const i in e){const s=e[i],l=s.getTransitionSetting(n);l&&this._updateAttribute(i,s,l)}for(const i in this.transitions){const s=e[i];(!s||!s.getTransitionSetting(n))&&this._removeTransition(i)}}hasAttribute(e){const n=this.transitions[e];return n&&n.inProgress}getAttributes(){const e={};for(const n in this.transitions){const r=this.transitions[n];r.inProgress&&(e[n]=r.attributeInTransition)}return e}run(){if(this.numInstances===0)return!1;for(const n in this.transitions)this.transitions[n].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].delete(),delete this.transitions[e]}_updateAttribute(e,n,r){const i=this.transitions[e];let s=!i||i.type!==r.type;if(s){i&&this._removeTransition(e);const l=YZ[r.type];l?this.transitions[e]=new l({attribute:n,timeline:this.timeline,device:this.device}):(Sn.error(`unsupported transition type '${r.type}'`)(),s=!1)}(s||n.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(r,this.numInstances))}}const RC="attributeManager.invalidate",ZZ="attributeManager.updateStart",QZ="attributeManager.updateEnd",GZ="attribute.updateStart",JZ="attribute.allocate",eQ="attribute.updateEnd";class tQ{constructor(e,{id:n="attribute-manager",stats:r,timeline:i}={}){this.mergeBoundsMemoized=nd(tq),this.id=n,this.device=e,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=r,this.attributeTransitionManager=new KZ(e,{id:`${n}-transitions`,timeline:i}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const n=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,n&&this.id}setNeedsRedraw(){this.needsRedraw=!0}add(e){this._add(e)}addInstanced(e){this._add(e,{stepMode:"instance"})}remove(e){for(const n of e)this.attributes[n]!==void 0&&(this.attributes[n].delete(),delete this.attributes[n])}invalidate(e,n){const r=this._invalidateTrigger(e,n);jr(RC,this,e,r)}invalidateAll(e){for(const n in this.attributes)this.attributes[n].setNeedsUpdate(n,e);jr(RC,this,"all")}update({data:e,numInstances:n,startIndices:r=null,transitions:i,props:s={},buffers:l={},context:c={}}){let f=!1;jr(ZZ,this),this.stats&&this.stats.get("Update Attributes").timeStart();for(const d in this.attributes){const g=this.attributes[d],m=g.settings.accessor;g.startIndices=r,g.numInstances=n,s[d]&&Sn.removed(`props.${d}`,`data.attributes.${d}`)(),g.setExternalBuffer(l[d])||g.setBinaryValue(typeof m=="string"?l[m]:void 0,e.startIndices)||typeof m=="string"&&!l[m]&&g.setConstantValue(s[m])||g.needsUpdate()&&(f=!0,this._updateAttribute({attribute:g,numInstances:n,data:e,props:s,context:c})),this.needsRedraw=this.needsRedraw||g.needsRedraw()}f&&jr(QZ,this,n),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:i})}updateTransition(){const{attributeTransitionManager:e}=this,n=e.run();return this.needsRedraw=this.needsRedraw||n,n}getAttributes(){return{...this.attributes,...this.attributeTransitionManager.getAttributes()}}getBounds(e){const n=e.map(r=>{var i;return(i=this.attributes[r])==null?void 0:i.getBounds()});return this.mergeBoundsMemoized(n)}getChangedAttributes(e={clearChangedFlags:!1}){const{attributes:n,attributeTransitionManager:r}=this,i={...r.getAttributes()};for(const s in n){const l=n[s];l.needsRedraw(e)&&!r.hasAttribute(s)&&(i[s]=l)}return i}getBufferLayouts(e){return Object.values(this.getAttributes()).map(n=>n.getBufferLayout(e))}_add(e,n){for(const r in e){const i=e[r],s={...i,id:r,size:i.isIndexed&&1||i.size||1,...n};this.attributes[r]=new eP(this.device,s)}this._mapUpdateTriggersToAttributes()}_mapUpdateTriggersToAttributes(){const e={};for(const n in this.attributes)this.attributes[n].getUpdateTriggers().forEach(i=>{e[i]||(e[i]=[]),e[i].push(n)});this.updateTriggers=e}_invalidateTrigger(e,n){const{attributes:r,updateTriggers:i}=this,s=i[e];return s&&s.forEach(l=>{const c=r[l];c&&c.setNeedsUpdate(c.id,n)}),s}_updateAttribute(e){const{attribute:n,numInstances:r}=e;if(jr(GZ,n),n.constant){n.setConstantValue(n.value);return}n.allocate(r)&&jr(JZ,n,r),n.updateBuffer(e)&&(this.needsRedraw=!0,jr(eQ,n,r))}}class nQ extends Sp{get value(){return this._value}_onUpdate(){const{time:e,settings:{fromValue:n,toValue:r,duration:i,easing:s}}=this,l=s(e/i);this._value=Mg(n,r,l)}}const xC=1e-5;function MC(t,e,n,r,i){const s=e-t,c=(n-e)*i,f=-s*r;return c+f+s+e}function rQ(t,e,n,r,i){if(Array.isArray(n)){const s=[];for(let l=0;l<n.length;l++)s[l]=MC(t[l],e[l],n[l],r,i);return s}return MC(t,e,n,r,i)}function OC(t,e){if(Array.isArray(t)){let n=0;for(let r=0;r<t.length;r++){const i=t[r]-e[r];n+=i*i}return Math.sqrt(n)}return Math.abs(t-e)}class iQ extends Sp{get value(){return this._currValue}_onUpdate(){const{fromValue:e,toValue:n,damping:r,stiffness:i}=this.settings,{_prevValue:s=e,_currValue:l=e}=this;let c=rQ(s,l,n,r,i);const f=OC(c,n),d=OC(c,l);f<xC&&d<xC&&(c=n,this.end()),this._prevValue=l,this._currValue=c}}const sQ={interpolation:nQ,spring:iQ};class aQ{constructor(e){this.transitions=new Map,this.timeline=e}get active(){return this.transitions.size>0}add(e,n,r,i){const{transitions:s}=this;if(s.has(e)){const f=s.get(e),{value:d=f.settings.fromValue}=f;n=d,this.remove(e)}if(i=JO(i),!i)return;const l=sQ[i.type];if(!l){Sn.error(`unsupported transition type '${i.type}'`)();return}const c=new l(this.timeline);c.start({...i,fromValue:n,toValue:r}),s.set(e,c)}remove(e){const{transitions:n}=this;n.has(e)&&(n.get(e).cancel(),n.delete(e))}update(){const e={};for(const[n,r]of this.transitions)r.update(),e[n]=r.value,r.inProgress||this.remove(n);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}function oQ(t){const e=t[Uo];for(const n in e){const r=e[n],{validate:i}=r;if(i&&!i(t[n],r))throw new Error(`Invalid prop ${n}: ${t[n]}`)}}function lQ(t,e){const n=lP({newProps:t,oldProps:e,propTypes:t[Uo],ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),r=uQ(t,e);let i=!1;return r||(i=fQ(t,e)),{dataChanged:r,propsChanged:n,updateTriggersChanged:i,extensionsChanged:dQ(t,e),transitionsChanged:cQ(t,e)}}function cQ(t,e){if(!t.transitions)return!1;const n={},r=t[Uo];let i=!1;for(const s in t.transitions){const l=r[s],c=l&&l.type;(c==="number"||c==="color"||c==="array")&&My(t[s],e[s],l)&&(n[s]=!0,i=!0)}return i?n:!1}function lP({newProps:t,oldProps:e,ignoreProps:n={},propTypes:r={},triggerName:i="props"}){if(e===t)return!1;if(typeof t!="object"||t===null)return`${i} changed shallowly`;if(typeof e!="object"||e===null)return`${i} changed shallowly`;for(const s of Object.keys(t))if(!(s in n)){if(!(s in e))return`${i}.${s} added`;const l=My(t[s],e[s],r[s]);if(l)return`${i}.${s} ${l}`}for(const s of Object.keys(e))if(!(s in n)){if(!(s in t))return`${i}.${s} dropped`;if(!Object.hasOwnProperty.call(t,s)){const l=My(t[s],e[s],r[s]);if(l)return`${i}.${s} ${l}`}}return!1}function My(t,e,n){let r=n&&n.equal;return r&&!r(t,e,n)||!r&&(r=t&&e&&t.equals,r&&!r.call(t,e))?"changed deeply":!r&&e!==t?"changed shallowly":null}function uQ(t,e){if(e===null)return"oldProps is null, initial diff";let n=!1;const{dataComparator:r,_dataDiff:i}=t;return r?r(t.data,e.data)||(n="Data comparator detected a change"):t.data!==e.data&&(n="A new data container was supplied"),n&&i&&(n=i(t.data,e.data)||n),n}function fQ(t,e){if(e===null)return{all:!0};if("all"in t.updateTriggers&&PC(t,e,"all"))return{all:!0};const n={};let r=!1;for(const i in t.updateTriggers)i!=="all"&&PC(t,e,i)&&(n[i]=!0,r=!0);return r?n:!1}function dQ(t,e){if(e===null)return!0;const n=e.extensions,{extensions:r}=t;if(r===n)return!1;if(!n||!r||r.length!==n.length)return!0;for(let i=0;i<r.length;i++)if(!r[i].equals(n[i]))return!0;return!1}function PC(t,e,n){let r=t.updateTriggers[n];r=r??{};let i=e.updateTriggers[n];return i=i??{},lP({oldProps:i,newProps:r,triggerName:n})}const hQ="count(): argument not an object",gQ="count(): argument not a container";function pQ(t){if(!vQ(t))throw new Error(hQ);if(typeof t.count=="function")return t.count();if(Number.isFinite(t.size))return t.size;if(Number.isFinite(t.length))return t.length;if(mQ(t))return Object.keys(t).length;throw new Error(gQ)}function mQ(t){return t!==null&&typeof t=="object"&&t.constructor===Object}function vQ(t){return t!==null&&typeof t=="object"}function NC(t,e){if(!e)return t;const n={...t,...e};if("defines"in e&&(n.defines={...t.defines,...e.defines}),"modules"in e&&(n.modules=(t.modules||[]).concat(e.modules),e.modules.some(r=>r.name==="project64"))){const r=n.modules.findIndex(i=>i.name==="project32");r>=0&&n.modules.splice(r,1)}if("inject"in e)if(!t.inject)n.inject=e.inject;else{const r={...t.inject};for(const i in e.inject)r[i]=(r[i]||"")+e.inject[i];n.inject=r}return n}const _Q={minFilter:"linear",mipmapFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},Oy={};function yQ(t,e,n,r){if(n instanceof Kn)return n;n.constructor&&n.constructor.name!=="Object"&&(n={data:n});let i=null;n.compressed&&(i={minFilter:"linear",mipmapFilter:n.data.length>1?"nearest":"linear"});const s=e.createTexture({...n,sampler:{..._Q,...i,...r},mipmaps:!0});return Oy[s.id]=t,s}function bQ(t,e){!e||!(e instanceof Kn)||Oy[e.id]===t&&(e.delete(),delete Oy[e.id])}const SQ={boolean:{validate(t,e){return!0},equal(t,e,n){return!!t==!!e}},number:{validate(t,e){return Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)}},color:{validate(t,e){return e.optional&&!t||Py(t)&&(t.length===3||t.length===4)},equal(t,e,n){return Ji(t,e,1)}},accessor:{validate(t,e){const n=Bg(t);return n==="function"||n===Bg(e.value)},equal(t,e,n){return typeof e=="function"?!0:Ji(t,e,1)}},array:{validate(t,e){return e.optional&&!t||Py(t)},equal(t,e,n){const{compare:r}=n,i=Number.isInteger(r)?r:r?1:0;return r?Ji(t,e,i):t===e}},object:{equal(t,e,n){if(n.ignore)return!0;const{compare:r}=n,i=Number.isInteger(r)?r:r?1:0;return r?Ji(t,e,i):t===e}},function:{validate(t,e){return e.optional&&!t||typeof t=="function"},equal(t,e,n){return!n.compare&&n.ignore!==!1||t===e}},data:{transform:(t,e,n)=>{if(!t)return t;const{dataTransform:r}=n.props;return r?r(t):typeof t.shape=="string"&&t.shape.endsWith("-table")&&Array.isArray(t.data)?t.data:t}},image:{transform:(t,e,n)=>{const r=n.context;return!r||!r.device?null:yQ(n.id,r.device,t,{...e.parameters,...n.props.textureParameters})},release:(t,e,n)=>{bQ(n.id,t)}}};function wQ(t){const e={},n={},r={};for(const[i,s]of Object.entries(t)){const l=s==null?void 0:s.deprecatedFor;if(l)r[i]=Array.isArray(l)?l:[l];else{const c=EQ(i,s);e[i]=c,n[i]=c.value}}return{propTypes:e,defaultProps:n,deprecatedProps:r}}function EQ(t,e){switch(Bg(e)){case"object":return Yu(t,e);case"array":return Yu(t,{type:"array",value:e,compare:!1});case"boolean":return Yu(t,{type:"boolean",value:e});case"number":return Yu(t,{type:"number",value:e});case"function":return Yu(t,{type:"function",value:e,compare:!0});default:return{name:t,type:"unknown",value:e}}}function Yu(t,e){return"type"in e?{name:t,...SQ[e.type],...e}:"value"in e?{name:t,type:Bg(e.value),...e}:{name:t,type:"object",value:e}}function Py(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function Bg(t){return Py(t)?"array":t===null?"null":typeof t}function TQ(t,e){let n;for(let s=e.length-1;s>=0;s--){const l=e[s];"extensions"in l&&(n=l.extensions)}const r=Ny(t.constructor,n),i=Object.create(r);i[Fg]=t,i[Xo]={},i[Ba]={};for(let s=0;s<e.length;++s){const l=e[s];for(const c in l)i[c]=l[c]}return Object.freeze(i),i}const AQ="_mergedDefaultProps";function Ny(t,e){if(!(t instanceof wp.constructor))return{};let n=AQ;if(e)for(const i of e){const s=i.constructor;s&&(n+=`:${s.extensionName||s.name}`)}const r=cP(t,n);return r||(t[n]=CQ(t,e||[]))}function CQ(t,e){if(!t.prototype)return null;const r=Object.getPrototypeOf(t),i=Ny(r),s=cP(t,"defaultProps")||{},l=wQ(s),c=Object.assign(Object.create(null),i,l.defaultProps),f=Object.assign(Object.create(null),i==null?void 0:i[Uo],l.propTypes),d=Object.assign(Object.create(null),i==null?void 0:i[T0],l.deprecatedProps);for(const g of e){const m=Ny(g.constructor);m&&(Object.assign(c,m),Object.assign(f,m[Uo]),Object.assign(d,m[T0]))}return RQ(c,t),MQ(c,f),xQ(c,d),c[Uo]=f,c[T0]=d,e.length===0&&!$b(t,"_propTypes")&&(t._propTypes=f),c}function RQ(t,e){const n=PQ(e);Object.defineProperties(t,{id:{writable:!0,value:n}})}function xQ(t,e){for(const n in e)Object.defineProperty(t,n,{enumerable:!1,set(r){const i=`${this.id}: ${n}`;for(const s of e[n])$b(this,s)||(this[s]=r);Sn.deprecated(i,e[n].join("/"))()}})}function MQ(t,e){const n={},r={};for(const i in e){const s=e[i],{name:l,value:c}=s;s.async&&(n[l]=c,r[l]=OQ(l))}t[lc]=n,t[Xo]={},Object.defineProperties(t,r)}function OQ(t){return{enumerable:!0,set(e){typeof e=="string"||e instanceof Promise||GO(e)?this[Xo][t]=e:this[Ba][t]=e},get(){if(this[Ba]){if(t in this[Ba])return this[Ba][t]||this[lc][t];if(t in this[Xo]){const e=this[Fg]&&this[Fg].internalState;if(e&&e.hasAsyncProp(t))return e.getAsyncProp(t)||this[lc][t]}}return this[lc][t]}}}function $b(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function cP(t,e){return $b(t,e)&&t[e]}function PQ(t){const e=t.componentName;return e||Sn.warn(`${t.name}.componentName not specified`)(),e||t.name}let NQ=0;class wp{constructor(...e){this.props=TQ(this,e),this.id=this.props.id,this.count=NQ++}clone(e){const{props:n}=this,r={};for(const i in n[lc])i in n[Ba]?r[i]=n[Ba][i]:i in n[Xo]&&(r[i]=n[Xo][i]);return new this.constructor({...n,...r,...e})}}wp.componentName="Component";wp.defaultProps={};const IQ=Object.freeze({});class DQ{constructor(e){this.component=e,this.asyncProps={},this.onAsyncPropUpdated=()=>{},this.oldProps=null,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const n=this.asyncProps[e];n&&n.type&&n.type.release&&n.type.release(n.resolvedValue,n.type,this.component)}this.asyncProps={},this.component=null,this.resetOldProps()}getOldProps(){return this.oldAsyncProps||this.oldProps||IQ}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component?this.component.props:null}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const n=this.asyncProps[e];return n&&n.resolvedValue}isAsyncPropLoading(e){if(e){const n=this.asyncProps[e];return!!(n&&n.pendingLoadCount>0&&n.pendingLoadCount!==n.resolvedLoadCount)}for(const n in this.asyncProps)if(this.isAsyncPropLoading(n))return!0;return!1}reloadAsyncProp(e,n){this._watchPromise(e,Promise.resolve(n))}setAsyncProps(e){this.component=e[Fg]||this.component;const n=e[Ba]||{},r=e[Xo]||e,i=e[lc]||{};for(const s in n){const l=n[s];this._createAsyncPropData(s,i[s]),this._updateAsyncProp(s,l),n[s]=this.getAsyncProp(s)}for(const s in r){const l=r[s];this._createAsyncPropData(s,i[s]),this._updateAsyncProp(s,l)}}_fetch(e,n){return null}_onResolve(e,n){}_onError(e,n){}_updateAsyncProp(e,n){if(this._didAsyncInputValueChange(e,n)){if(typeof n=="string"&&(n=this._fetch(e,n)),n instanceof Promise){this._watchPromise(e,n);return}if(GO(n)){this._resolveAsyncIterable(e,n);return}this._setPropValue(e,n)}}_freezeAsyncOldProps(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}_didAsyncInputValueChange(e,n){const r=this.asyncProps[e];return n===r.resolvedValue||n===r.lastValue?!1:(r.lastValue=n,!0)}_setPropValue(e,n){this._freezeAsyncOldProps();const r=this.asyncProps[e];r&&(n=this._postProcessValue(r,n),r.resolvedValue=n,r.pendingLoadCount++,r.resolvedLoadCount=r.pendingLoadCount)}_setAsyncPropValue(e,n,r){const i=this.asyncProps[e];i&&r>=i.resolvedLoadCount&&n!==void 0&&(this._freezeAsyncOldProps(),i.resolvedValue=n,i.resolvedLoadCount=r,this.onAsyncPropUpdated(e,n))}_watchPromise(e,n){const r=this.asyncProps[e];if(r){r.pendingLoadCount++;const i=r.pendingLoadCount;n.then(s=>{this.component&&(s=this._postProcessValue(r,s),this._setAsyncPropValue(e,s,i),this._onResolve(e,s))}).catch(s=>{this._onError(e,s)})}}async _resolveAsyncIterable(e,n){if(e!=="data"){this._setPropValue(e,n);return}const r=this.asyncProps[e];if(!r)return;r.pendingLoadCount++;const i=r.pendingLoadCount;let s=[],l=0;for await(const c of n){if(!this.component)return;const{dataTransform:f}=this.component.props;f?s=f(c,s):s=s.concat(c),Object.defineProperty(s,"__diff",{enumerable:!1,value:[{startRow:l,endRow:s.length}]}),l=s.length,this._setAsyncPropValue(e,s,i)}this._onResolve(e,s)}_postProcessValue(e,n){const r=e.type;return r&&this.component&&(r.release&&r.release(e.resolvedValue,r,this.component),r.transform)?r.transform(n,r,this.component):n}_createAsyncPropData(e,n){if(!this.asyncProps[e]){const i=this.component&&this.component.props[Uo];this.asyncProps[e]={type:i&&i[e],lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0}}}}class FQ extends DQ{constructor({attributeManager:e,layer:n}){super(n),this.attributeManager=e,this.needsRedraw=!0,this.needsUpdate=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}_fetch(e,n){const r=this.layer,i=r==null?void 0:r.props.fetch;return i?i(n,{propName:e,layer:r}):super._fetch(e,n)}_onResolve(e,n){const r=this.layer;if(r){const i=r.props.onDataLoad;e==="data"&&i&&i(n,{propName:e,layer:r})}}_onError(e,n){const r=this.layer;r&&r.raiseError(n,`loading ${e} of ${this.layer}`)}}const kQ="layer.changeFlag",BQ="layer.initialize",UQ="layer.update",LQ="layer.finalize",zQ="layer.matched",IC=2**24-1,$Q=Object.freeze([]),VQ=nd(({oldViewport:t,viewport:e})=>t.equals(e));let Hi=new Uint8ClampedArray(0);const HQ={data:{type:"data",value:$Q,async:!0},dataComparator:{type:"function",value:null,optional:!0},_dataDiff:{type:"function",value:t=>t&&t.__diff,optional:!0},dataTransform:{type:"function",value:null,optional:!0},onDataLoad:{type:"function",value:null,optional:!0},onError:{type:"function",value:null,optional:!0},fetch:{type:"function",value:(t,{propName:e,layer:n,loaders:r,loadOptions:i,signal:s})=>{const{resourceManager:l}=n.context;i=i||n.getLoadOptions(),r=r||n.props.loaders,s&&(i={...i,fetch:{...i==null?void 0:i.fetch,signal:s}});let c=l.contains(t);return!c&&!i&&(l.add({resourceId:t,data:Jh(t,r),persistent:!1}),c=!0),c?l.subscribe({resourceId:t,onChange:f=>{var d;return(d=n.internalState)==null?void 0:d.reloadAsyncProp(e,f)},consumerId:n.id,requestId:e}):Jh(t,r,i)}},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:"draw",onHover:{type:"function",value:null,optional:!0},onClick:{type:"function",value:null,optional:!0},onDragStart:{type:"function",value:null,optional:!0},onDrag:{type:"function",value:null,optional:!0},onDragEnd:{type:"function",value:null,optional:!0},coordinateSystem:cn.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{type:"object",value:{},optional:!0,compare:2},loadOptions:{type:"object",value:null,optional:!0,ignore:!0},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,ignore:!0},getPolygonOffset:{type:"function",value:({layerIndex:t})=>[0,-t*100]},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};class sd extends wp{constructor(){super(...arguments),this.internalState=null,this.lifecycle=Xl.NO_STATE,this.parent=null}static get componentName(){return Object.prototype.hasOwnProperty.call(this,"layerName")?this.layerName:""}get root(){let e=this;for(;e.parent;)e=e.parent;return e}toString(){return`${this.constructor.layerName||this.constructor.name}({id: '${this.props.id}'})`}project(e){Br(this.internalState);const n=this.internalState.viewport||this.context.viewport,r=CO(e,{viewport:n,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[i,s,l]=SO(r,n.pixelProjectionMatrix);return e.length===2?[i,s]:[i,s,l]}unproject(e){return Br(this.internalState),(this.internalState.viewport||this.context.viewport).unproject(e)}projectPosition(e,n){Br(this.internalState);const r=this.internalState.viewport||this.context.viewport;return oq(e,{viewport:r,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem,...n})}get isComposite(){return!1}get isDrawable(){return!0}setState(e){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,e),this.setNeedsRedraw()}setNeedsRedraw(){this.internalState&&(this.internalState.needsRedraw=!0)}setNeedsUpdate(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}get isLoaded(){return this.internalState?!this.internalState.isAsyncPropLoading():!1}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){const e=this.state;return e&&(e.models||e.model&&[e.model])||[]}setShaderModuleProps(...e){for(const n of this.getModels())n.shaderInputs.setProps(...e)}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}use64bitPositions(){const{coordinateSystem:e}=this.props;return e===cn.DEFAULT||e===cn.LNGLAT||e===cn.CARTESIAN}onHover(e,n){return this.props.onHover&&this.props.onHover(e,n)||!1}onClick(e,n){return this.props.onClick&&this.props.onClick(e,n)||!1}nullPickingColor(){return[0,0,0]}encodePickingColor(e,n=[]){return n[0]=e+1&255,n[1]=e+1>>8&255,n[2]=e+1>>8>>8&255,n}decodePickingColor(e){Br(e instanceof Uint8Array);const[n,r,i]=e;return n+r*256+i*65536-1}getNumInstances(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&this.state.numInstances!==void 0?this.state.numInstances:pQ(this.props.data)}getStartIndices(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}getBounds(){var e;return(e=this.getAttributeManager())==null?void 0:e.getBounds(["positions","instancePositions"])}getShaders(e){e=NC(e,{disableWarnings:!0,modules:this.context.defaultShaderModules});for(const n of this.props.extensions)e=NC(e,n.getShaders.call(this,n));return e}shouldUpdateState(e){return e.changeFlags.propsOrDataChanged}updateState(e){const n=this.getAttributeManager(),{dataChanged:r}=e.changeFlags;if(r&&n)if(Array.isArray(r))for(const i of r)n.invalidateAll(i);else n.invalidateAll();if(n){const{props:i}=e,s=this.internalState.hasPickingBuffer,l=Number.isInteger(i.highlightedObjectIndex)||i.pickable||i.extensions.some(c=>c.getNeedsPickingBuffer.call(this,c));if(s!==l){this.internalState.hasPickingBuffer=l;const{pickingColors:c,instancePickingColors:f}=n.attributes,d=c||f;d&&(l&&d.constant&&(d.constant=!1,n.invalidate(d.id)),!d.value&&!l&&(d.constant=!0,d.value=[0,0,0]))}}}finalizeState(e){for(const r of this.getModels())r.destroy();const n=this.getAttributeManager();n&&n.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}draw(e){for(const n of this.getModels())n.draw(e.renderPass)}getPickingInfo({info:e,mode:n,sourceLayer:r}){const{index:i}=e;return i>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[i]),e}raiseError(e,n){var r,i,s,l;n&&(e=new Error(`${n}: ${e.message}`,{cause:e})),(i=(r=this.props).onError)!=null&&i.call(r,e)||(l=(s=this.context)==null?void 0:s.onError)==null||l.call(s,e,this)}getNeedsRedraw(e={clearRedrawFlags:!1}){return this._getNeedsRedraw(e)}needsUpdate(){return this.internalState?this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()):!1}hasUniformTransition(){var e;return((e=this.internalState)==null?void 0:e.uniformTransitions.active)||!1}activateViewport(e){if(!this.internalState)return;const n=this.internalState.viewport;this.internalState.viewport=e,(!n||!VQ({oldViewport:n,viewport:e}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(e="all"){const n=this.getAttributeManager();n&&(e==="all"?n.invalidateAll():n.invalidate(e))}updateAttributes(e){let n=!1;for(const r in e)e[r].layoutChanged()&&(n=!0);for(const r of this.getModels())this._setModelAttributes(r,e,n)}_updateAttributes(){const e=this.getAttributeManager();if(!e)return;const n=this.props,r=this.getNumInstances(),i=this.getStartIndices();e.update({data:n.data,numInstances:r,startIndices:i,props:n,transitions:n.transitions,buffers:n.data.attributes,context:this});const s=e.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(s)}_updateAttributeTransition(){const e=this.getAttributeManager();e&&e.updateTransition()}_updateUniformTransition(){const{uniformTransitions:e}=this.internalState;if(e.active){const n=e.update(),r=Object.create(this.props);for(const i in n)Object.defineProperty(r,i,{value:n[i]});return r}return this.props}calculateInstancePickingColors(e,{numInstances:n}){if(e.constant)return;const r=Math.floor(Hi.length/4);if(this.internalState.usesPickingColorCache=!0,r<n){n>IC&&Sn.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Hi=Bf.allocate(Hi,n,{size:4,copy:!0,maxCount:Math.max(n,IC)});const i=Math.floor(Hi.length/4),s=[0,0,0];for(let l=r;l<i;l++)this.encodePickingColor(l,s),Hi[l*4+0]=s[0],Hi[l*4+1]=s[1],Hi[l*4+2]=s[2],Hi[l*4+3]=0}e.value=Hi.subarray(0,n*4)}_setModelAttributes(e,n,r=!1){var c;if(!Object.keys(n).length)return;if(r){const f=this.getAttributeManager();e.setBufferLayout(f.getBufferLayouts(e)),n=f.getAttributes()}const i=((c=e.userData)==null?void 0:c.excludeAttributes)||{},s={},l={};for(const f in n){if(i[f])continue;const d=n[f].getValue();for(const g in d){const m=d[g];m instanceof $n?n[f].settings.isIndexed?e.setIndexBuffer(m):s[g]=m:m&&(l[g]=m)}}e.setAttributes(s),e.setConstantAttributes(l)}disablePickingIndex(e){const n=this.props.data;if(!("attributes"in n)){this._disablePickingIndex(e);return}const{pickingColors:r,instancePickingColors:i}=this.getAttributeManager().attributes,s=r||i,l=s&&n.attributes&&n.attributes[s.id];if(l&&l.value){const c=l.value,f=this.encodePickingColor(e);for(let d=0;d<n.length;d++){const g=s.getVertexOffset(d);c[g]===f[0]&&c[g+1]===f[1]&&c[g+2]===f[2]&&this._disablePickingIndex(d)}}else this._disablePickingIndex(e)}_disablePickingIndex(e){const{pickingColors:n,instancePickingColors:r}=this.getAttributeManager().attributes,i=n||r;if(!i)return;const s=i.getVertexOffset(e),l=i.getVertexOffset(e+1);i.buffer.write(new Uint8Array(l-s),s)}restorePickingColors(){const{pickingColors:e,instancePickingColors:n}=this.getAttributeManager().attributes,r=e||n;r&&(this.internalState.usesPickingColorCache&&r.value.buffer!==Hi.buffer&&(r.value=Hi.subarray(0,r.value.length)),r.updateSubBuffer({startOffset:0}))}_initialize(){Br(!this.internalState),Br(Number.isFinite(this.props.coordinateSystem)),jr(BQ,this);const e=this._getAttributeManager();e&&e.addInstanced({instancePickingColors:{type:"uint8",size:4,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new FQ({attributeManager:e,layer:this}),this._clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Sn.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),e)}),this.internalState.uniformTransitions=new aQ(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);for(const n of this.props.extensions)n.initializeState.call(this,this.context,n);this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}_transferState(e){jr(zQ,this,this===e);const{state:n,internalState:r}=e;this!==e&&(this.internalState=r,this.state=n,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}_update(){const e=this.needsUpdate();if(jr(UQ,this,e),!e)return;const n=this.props,r=this.context,i=this.internalState,s=r.viewport,l=this._updateUniformTransition();i.propsInTransition=l,r.viewport=i.viewport||s,this.props=l;try{const c=this._getUpdateParams(),f=this.getModels();if(r.device)this.updateState(c);else try{this.updateState(c)}catch{}for(const g of this.props.extensions)g.updateState.call(this,c,g);this.setNeedsRedraw(),this._updateAttributes();const d=this.getModels()[0]!==f[0];this._postUpdate(c,d)}finally{r.viewport=s,this.props=n,this._clearChangeFlags(),i.needsUpdate=!1,i.resetOldProps()}}_finalize(){jr(LQ,this),this.finalizeState(this.context);for(const e of this.props.extensions)e.finalizeState.call(this,this.context,e)}_drawLayer({renderPass:e,shaderModuleProps:n=null,uniforms:r={},parameters:i={}}){this._updateAttributeTransition();const s=this.props,l=this.context;this.props=this.internalState.propsInTransition||s;try{n&&this.setShaderModuleProps(n);const{getPolygonOffset:c}=this.props,f=c&&c(r)||[0,0];l.device instanceof Ua&&l.device.setParametersWebGL({polygonOffset:f});for(const d of this.getModels())d.setParameters(i);if(l.device instanceof Ua)l.device.withParametersWebGL(i,()=>{const d={renderPass:e,shaderModuleProps:n,uniforms:r,parameters:i,context:l};for(const g of this.props.extensions)g.draw.call(this,d,g);this.draw(d)});else{const d={renderPass:e,shaderModuleProps:n,uniforms:r,parameters:i,context:l};for(const g of this.props.extensions)g.draw.call(this,d,g);this.draw(d)}}finally{this.props=s}}getChangeFlags(){var e;return(e=this.internalState)==null?void 0:e.changeFlags}setChangeFlags(e){if(!this.internalState)return;const{changeFlags:n}=this.internalState;for(const i in e)if(e[i]){let s=!1;switch(i){case"dataChanged":const l=e[i],c=n[i];l&&Array.isArray(c)&&(n.dataChanged=Array.isArray(l)?c.concat(l):l,s=!0);default:n[i]||(n[i]=e[i],s=!0)}s&&jr(kQ,this,i,e)}const r=!!(n.dataChanged||n.updateTriggersChanged||n.propsChanged||n.extensionsChanged);n.propsOrDataChanged=r,n.somethingChanged=r||n.viewportChanged||n.stateChanged}_clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}_diffProps(e,n){var i;const r=lQ(e,n);if(r.updateTriggersChanged)for(const s in r.updateTriggersChanged)r.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(r.transitionsChanged)for(const s in r.transitionsChanged)this.internalState.uniformTransitions.add(s,n[s],e[s],(i=e.transitions)==null?void 0:i[s]);return this.setChangeFlags(r)}validateProps(){oQ(this.props)}updateAutoHighlight(e){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(e)}_updateAutoHighlight(e){const n={highlightedObjectColor:e.picked?e.color:null},{highlightColor:r}=this.props;e.picked&&typeof r=="function"&&(n.highlightColor=r(e)),this.setShaderModuleProps({picking:n}),this.setNeedsRedraw()}_getAttributeManager(){const e=this.context;return new tQ(e.device,{id:this.props.id,stats:e.stats,timeline:e.timeline})}_postUpdate(e,n){const{props:r,oldProps:i}=e,s=this.state.model;s!=null&&s.isInstanced&&s.setInstanceCount(this.getNumInstances());const{autoHighlight:l,highlightedObjectIndex:c,highlightColor:f}=r;if(n||i.autoHighlight!==l||i.highlightedObjectIndex!==c||i.highlightColor!==f){const d={};Array.isArray(f)&&(d.highlightColor=f),(n||i.autoHighlight!==l||c!==i.highlightedObjectIndex)&&(d.highlightedObjectColor=Number.isFinite(c)&&c>=0?this.encodePickingColor(c):null),this.setShaderModuleProps({picking:d})}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(e){if(!this.internalState)return!1;let n=!1;n=n||this.internalState.needsRedraw&&this.id;const r=this.getAttributeManager(),i=r?r.getNeedsRedraw(e):!1;if(n=n||i,n)for(const s of this.props.extensions)s.onNeedsRedraw.call(this,s);return this.internalState.needsRedraw=this.internalState.needsRedraw&&!e.clearRedrawFlags,n}_onAsyncPropUpdated(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}sd.defaultProps=HQ;sd.layerName="Layer";const DC=`uniform scatterplotUniforms {
float radiusScale;
float radiusMinPixels;
float radiusMaxPixels;
float lineWidthScale;
float lineWidthMinPixels;
float lineWidthMaxPixels;
float stroked;
bool filled;
bool antialiasing;
bool billboard;
highp int radiusUnits;
highp int lineWidthUnits;
} scatterplot;
`,jQ={name:"scatterplot",vs:DC,fs:DC,uniformTypes:{radiusScale:"f32",radiusMinPixels:"f32",radiusMaxPixels:"f32",lineWidthScale:"f32",lineWidthMinPixels:"f32",lineWidthMaxPixels:"f32",stroked:"f32",filled:"f32",antialiasing:"f32",billboard:"f32",radiusUnits:"i32",lineWidthUnits:"i32"}},WQ=`#version 300 es
#define SHADER_NAME scatterplot-layer-vertex-shader
in vec3 positions;
in vec3 instancePositions;
in vec3 instancePositions64Low;
in float instanceRadius;
in float instanceLineWidths;
in vec4 instanceFillColors;
in vec4 instanceLineColors;
in vec3 instancePickingColors;
out vec4 vFillColor;
out vec4 vLineColor;
out vec2 unitPosition;
out float innerUnitRadius;
out float outerRadiusPixels;
void main(void) {
geometry.worldPosition = instancePositions;
outerRadiusPixels = clamp(
project_size_to_pixel(scatterplot.radiusScale * instanceRadius, scatterplot.radiusUnits),
scatterplot.radiusMinPixels, scatterplot.radiusMaxPixels
);
float lineWidthPixels = clamp(
project_size_to_pixel(scatterplot.lineWidthScale * instanceLineWidths, scatterplot.lineWidthUnits),
scatterplot.lineWidthMinPixels, scatterplot.lineWidthMaxPixels
);
outerRadiusPixels += scatterplot.stroked * lineWidthPixels / 2.0;
float edgePadding = scatterplot.antialiasing ? (outerRadiusPixels + SMOOTH_EDGE_RADIUS) / outerRadiusPixels : 1.0;
unitPosition = edgePadding * positions.xy;
geometry.uv = unitPosition;
geometry.pickingColor = instancePickingColors;
innerUnitRadius = 1.0 - scatterplot.stroked * lineWidthPixels / outerRadiusPixels;
if (scatterplot.billboard) {
gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);
DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
vec3 offset = edgePadding * positions * outerRadiusPixels;
DECKGL_FILTER_SIZE(offset, geometry);
gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);
} else {
vec3 offset = edgePadding * positions * project_pixel_size(outerRadiusPixels);
DECKGL_FILTER_SIZE(offset, geometry);
gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position);
DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
}
vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * layer.opacity);
DECKGL_FILTER_COLOR(vFillColor, geometry);
vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * layer.opacity);
DECKGL_FILTER_COLOR(vLineColor, geometry);
}
`,XQ=`#version 300 es
#define SHADER_NAME scatterplot-layer-fragment-shader
precision highp float;
in vec4 vFillColor;
in vec4 vLineColor;
in vec2 unitPosition;
in float innerUnitRadius;
in float outerRadiusPixels;
out vec4 fragColor;
void main(void) {
geometry.uv = unitPosition;
float distToCenter = length(unitPosition) * outerRadiusPixels;
float inCircle = scatterplot.antialiasing ?
smoothedge(distToCenter, outerRadiusPixels) :
step(distToCenter, outerRadiusPixels);
if (inCircle == 0.0) {
discard;
}
if (scatterplot.stroked > 0.5) {
float isLine = scatterplot.antialiasing ?
smoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) :
step(innerUnitRadius * outerRadiusPixels, distToCenter);
if (scatterplot.filled) {
fragColor = mix(vFillColor, vLineColor, isLine);
} else {
if (isLine == 0.0) {
discard;
}
fragColor = vec4(vLineColor.rgb, vLineColor.a * isLine);
}
} else if (scatterplot.filled == false) {
discard;
} else {
fragColor = vFillColor;
}
fragColor.a *= inCircle;
DECKGL_FILTER_COLOR(fragColor, geometry);
}
`,FC=[0,0,0,255],qQ={radiusUnits:"meters",radiusScale:{type:"number",min:0,value:1},radiusMinPixels:{type:"number",min:0,value:0},radiusMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},lineWidthUnits:"meters",lineWidthScale:{type:"number",min:0,value:1},lineWidthMinPixels:{type:"number",min:0,value:0},lineWidthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},stroked:!1,filled:!0,billboard:!1,antialiasing:!0,getPosition:{type:"accessor",value:t=>t.position},getRadius:{type:"accessor",value:1},getFillColor:{type:"accessor",value:FC},getLineColor:{type:"accessor",value:FC},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class Vb extends sd{getShaders(){return super.getShaders({vs:WQ,fs:XQ,modules:[vO,EO,jQ]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,type:"unorm8",accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,type:"unorm8",accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(e){var n;super.updateState(e),e.changeFlags.extensionsChanged&&((n=this.state.model)==null||n.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){const{radiusUnits:n,radiusScale:r,radiusMinPixels:i,radiusMaxPixels:s,stroked:l,filled:c,billboard:f,antialiasing:d,lineWidthUnits:g,lineWidthScale:m,lineWidthMinPixels:v,lineWidthMaxPixels:S}=this.props,E={stroked:l,filled:c,billboard:f,antialiasing:d,radiusUnits:jo[n],radiusScale:r,radiusMinPixels:i,radiusMaxPixels:s,lineWidthUnits:jo[g],lineWidthScale:m,lineWidthMinPixels:v,lineWidthMaxPixels:S},w=this.state.model;w.shaderInputs.setProps({scatterplot:E}),w.draw(this.context.renderPass)}_getModel(){const e=[-1,-1,0,1,-1,0,-1,1,0,1,1,0];return new Wo(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new Db({topology:"triangle-strip",attributes:{positions:{size:3,value:new Float32Array(e)}}}),isInstanced:!0})}}Vb.defaultProps=qQ;Vb.layerName="ScatterplotLayer";const YQ={COUNTER_CLOCKWISE:-1};function KQ(t,e,n={}){return ZQ(t,n)!==e?(GQ(t,n),!0):!1}function ZQ(t,e={}){return Math.sign(QQ(t,e))}const kC={x:0,y:1,z:2};function QQ(t,e={}){const{start:n=0,end:r=t.length,plane:i="xy"}=e,s=e.size||2;let l=0;const c=kC[i[0]],f=kC[i[1]];for(let d=n,g=r-s;d<r;d+=s)l+=(t[d+c]-t[g+c])*(t[d+f]+t[g+f]),g=d;return l/2}function GQ(t,e){const{start:n=0,end:r=t.length,size:i=2}=e,s=(r-n)/i,l=Math.floor(s/2);for(let c=0;c<l;++c){const f=n+c*i,d=n+(s-1-c)*i;for(let g=0;g<i;++g){const m=t[f+g];t[f+g]=t[d+g],t[d+g]=m}}}class JQ extends Db{constructor(e){const{indices:n,attributes:r}=eG(e);super({...e,indices:n,attributes:r})}}function eG(t){const{radius:e,height:n=1,nradial:r=10}=t;let{vertices:i}=t;i&&(Sn.assert(i.length>=r),i=i.flatMap(S=>[S[0],S[1]]),KQ(i,YQ.COUNTER_CLOCKWISE));const s=n>0,l=r+1,c=s?l*3+1:r,f=Math.PI*2/r,d=new Uint16Array(s?r*3*2:0),g=new Float32Array(c*3),m=new Float32Array(c*3);let v=0;if(s){for(let S=0;S<l;S++){const E=S*f,w=S%r,b=Math.sin(E),A=Math.cos(E);for(let T=0;T<2;T++)g[v+0]=i?i[w*2]:A*e,g[v+1]=i?i[w*2+1]:b*e,g[v+2]=(1/2-T)*n,m[v+0]=i?i[w*2]:A,m[v+1]=i?i[w*2+1]:b,v+=3}g[v+0]=g[v-3],g[v+1]=g[v-2],g[v+2]=g[v-1],v+=3}for(let S=s?0:1;S<l;S++){const E=Math.floor(S/2)*Math.sign(.5-S%2),w=E*f,b=(E+r)%r,A=Math.sin(w),T=Math.cos(w);g[v+0]=i?i[b*2]:T*e,g[v+1]=i?i[b*2+1]:A*e,g[v+2]=n/2,m[v+2]=1,v+=3}if(s){let S=0;for(let E=0;E<r;E++)d[S++]=E*2+0,d[S++]=E*2+2,d[S++]=E*2+0,d[S++]=E*2+1,d[S++]=E*2+1,d[S++]=E*2+3}return{indices:d,attributes:{POSITION:{size:3,value:g},NORMAL:{size:3,value:m}}}}const BC=`uniform columnUniforms {
float radius;
float angle;
vec2 offset;
bool extruded;
bool stroked;
bool isStroke;
float coverage;
float elevationScale;
float edgeDistance;
float widthScale;
float widthMinPixels;
float widthMaxPixels;
highp int radiusUnits;
highp int widthUnits;
} column;
`,tG={name:"column",vs:BC,fs:BC,uniformTypes:{radius:"f32",angle:"f32",offset:"vec2<f32>",extruded:"f32",stroked:"f32",isStroke:"f32",coverage:"f32",elevationScale:"f32",edgeDistance:"f32",widthScale:"f32",widthMinPixels:"f32",widthMaxPixels:"f32",radiusUnits:"i32",widthUnits:"i32"}},nG=`#version 300 es
#define SHADER_NAME column-layer-vertex-shader
in vec3 positions;
in vec3 normals;
in vec3 instancePositions;
in float instanceElevations;
in vec3 instancePositions64Low;
in vec4 instanceFillColors;
in vec4 instanceLineColors;
in float instanceStrokeWidths;
in vec3 instancePickingColors;
out vec4 vColor;
#ifdef FLAT_SHADING
out vec3 cameraPosition;
out vec4 position_commonspace;
#endif
void main(void) {
geometry.worldPosition = instancePositions;
vec4 color = column.isStroke ? instanceLineColors : instanceFillColors;
mat2 rotationMatrix = mat2(cos(column.angle), sin(column.angle), -sin(column.angle), cos(column.angle));
float elevation = 0.0;
float strokeOffsetRatio = 1.0;
if (column.extruded) {
elevation = instanceElevations * (positions.z + 1.0) / 2.0 * column.elevationScale;
} else if (column.stroked) {
float widthPixels = clamp(
project_size_to_pixel(instanceStrokeWidths * column.widthScale, column.widthUnits),
column.widthMinPixels, column.widthMaxPixels) / 2.0;
float halfOffset = project_pixel_size(widthPixels) / project_size(column.edgeDistance * column.coverage * column.radius);
if (column.isStroke) {
strokeOffsetRatio -= sign(positions.z) * halfOffset;
} else {
strokeOffsetRatio -= halfOffset;
}
}
float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);
float dotRadius = column.radius * column.coverage * shouldRender;
geometry.pickingColor = instancePickingColors;
vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);
vec3 centroidPosition64Low = instancePositions64Low;
vec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + column.offset) * dotRadius;
if (column.radiusUnits == UNIT_METERS) {
offset = project_size(offset);
}
vec3 pos = vec3(offset, 0.);
DECKGL_FILTER_SIZE(pos, geometry);
gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);
geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));
DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
if (column.extruded && !column.isStroke) {
#ifdef FLAT_SHADING
cameraPosition = project.cameraPosition;
position_commonspace = geometry.position;
vColor = vec4(color.rgb, color.a * layer.opacity);
#else
vec3 lightColor = lighting_getLightColor(color.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal);
vColor = vec4(lightColor, color.a * layer.opacity);
#endif
} else {
vColor = vec4(color.rgb, color.a * layer.opacity);
}
DECKGL_FILTER_COLOR(vColor, geometry);
}
`,rG=`#version 300 es
#define SHADER_NAME column-layer-fragment-shader
precision highp float;
out vec4 fragColor;
in vec4 vColor;
#ifdef FLAT_SHADING
in vec3 cameraPosition;
in vec4 position_commonspace;
#endif
void main(void) {
fragColor = vColor;
geometry.uv = vec2(0.);
#ifdef FLAT_SHADING
if (column.extruded && !column.isStroke && !bool(picking.isActive)) {
vec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));
fragColor.rgb = lighting_getLightColor(vColor.rgb, cameraPosition, position_commonspace.xyz, normal);
}
#endif
DECKGL_FILTER_COLOR(fragColor, geometry);
}
`,Ug=[0,0,0,255],iG={diskResolution:{type:"number",min:4,value:20},vertices:null,radius:{type:"number",min:0,value:1e3},angle:{type:"number",value:0},offset:{type:"array",value:[0,0]},coverage:{type:"number",min:0,max:1,value:1},elevationScale:{type:"number",min:0,value:1},radiusUnits:"meters",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,extruded:!0,wireframe:!1,filled:!0,stroked:!1,flatShading:!1,getPosition:{type:"accessor",value:t=>t.position},getFillColor:{type:"accessor",value:Ug},getLineColor:{type:"accessor",value:Ug},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class Hb extends sd{getShaders(){const e={},{flatShading:n}=this.props;return n&&(e.FLAT_SHADING=1),super.getShaders({vs:nG,fs:rG,defines:e,modules:[vO,n?sO:iO,EO,tG]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:Ug},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:Ug},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}updateState(e){var c;super.updateState(e);const{props:n,oldProps:r,changeFlags:i}=e,s=i.extensionsChanged||n.flatShading!==r.flatShading;s&&((c=this.state.models)==null||c.forEach(f=>f.destroy()),this.setState(this._getModels()),this.getAttributeManager().invalidateAll());const l=this.getNumInstances();this.state.fillModel.setInstanceCount(l),this.state.wireframeModel.setInstanceCount(l),(s||n.diskResolution!==r.diskResolution||n.vertices!==r.vertices||(n.extruded||n.stroked)!==(r.extruded||r.stroked))&&this._updateGeometry(n)}getGeometry(e,n,r){const i=new JQ({radius:1,height:r?2:0,vertices:n,nradial:e});let s=0;if(n)for(let l=0;l<e;l++){const c=n[l],f=Math.sqrt(c[0]*c[0]+c[1]*c[1]);s+=f/e}else s=1;return this.setState({edgeDistance:Math.cos(Math.PI/e)*s}),i}_getModels(){const e=this.getShaders(),n=this.getAttributeManager().getBufferLayouts(),r=new Wo(this.context.device,{...e,id:`${this.props.id}-fill`,bufferLayout:n,isInstanced:!0}),i=new Wo(this.context.device,{...e,id:`${this.props.id}-wireframe`,bufferLayout:n,isInstanced:!0});return{fillModel:r,wireframeModel:i,models:[i,r]}}_updateGeometry({diskResolution:e,vertices:n,extruded:r,stroked:i}){const s=this.getGeometry(e,n,r||i);this.setState({fillVertexCount:s.attributes.POSITION.value.length/3});const l=this.state.fillModel,c=this.state.wireframeModel;l.setGeometry(s),l.setTopology("triangle-strip"),l.setIndexBuffer(null),c.setGeometry(s),c.setTopology("line-list")}draw({uniforms:e}){const{lineWidthUnits:n,lineWidthScale:r,lineWidthMinPixels:i,lineWidthMaxPixels:s,radiusUnits:l,elevationScale:c,extruded:f,filled:d,stroked:g,wireframe:m,offset:v,coverage:S,radius:E,angle:w}=this.props,b=this.state.fillModel,A=this.state.wireframeModel,{fillVertexCount:T,edgeDistance:C}=this.state,M={radius:E,angle:w/180*Math.PI,offset:v,extruded:f,stroked:g,coverage:S,elevationScale:c,edgeDistance:C,radiusUnits:jo[l],widthUnits:jo[n],widthScale:r,widthMinPixels:i,widthMaxPixels:s};f&&m&&(A.shaderInputs.setProps({column:{...M,isStroke:!0}}),A.draw(this.context.renderPass)),d&&(b.setVertexCount(T),b.shaderInputs.setProps({column:{...M,isStroke:!1}}),b.draw(this.context.renderPass)),!f&&g&&(b.setVertexCount(T*2/3),b.shaderInputs.setProps({column:{...M,isStroke:!0}}),b.draw(this.context.renderPass))}}Hb.layerName="ColumnLayer";Hb.defaultProps=iG;const sG={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",value:[1,1]}};class Lf extends Hb{_updateGeometry(){const e=new Mq;this.state.fillModel.setGeometry(e)}draw({uniforms:e}){const{elevationScale:n,extruded:r,offset:i,coverage:s,cellSize:l,angle:c,radiusUnits:f}=this.props,d=this.state.fillModel,g={radius:l/2,radiusUnits:jo[f],angle:c,offset:i,extruded:r,stroked:!1,coverage:s,elevationScale:n,edgeDistance:1,isStroke:!1,widthUnits:0,widthScale:0,widthMinPixels:0,widthMaxPixels:0};d.shaderInputs.setProps({column:g}),d.draw(this.context.renderPass)}}Lf.layerName="GridCellLayer";Lf.defaultProps=sG;const aG=typeof window<"u"?_.useLayoutEffect:_.useEffect;function Lg(t,e){for(;t;){if(t===e)return!0;t=Object.getPrototypeOf(t)}return!1}const oG={position:"absolute",zIndex:-1};function uP(t,e){if(typeof t=="function")return t(e);if(Array.isArray(t))return t.map(n=>uP(n,e));if(Ep(t)){if(lG(t))return e.style=oG,_.cloneElement(t,e);if(cG(t))return _.cloneElement(t,e)}return t}function Ep(t){return t&&typeof t=="object"&&"type"in t||!1}function lG(t){var e;return(e=t.props)==null?void 0:e.mapStyle}function cG(t){const e=t.type;return e&&e.deckGLViewProps}function Iy(t){if(typeof t=="function")return _.createElement(Uc,{},t);if(Array.isArray(t))return t.map(Iy);if(Ep(t)){if(t.type===_.Fragment)return Iy(t.props.children);if(Lg(t.type,Uc))return t}return t}function uG({children:t,layers:e=[],views:n=null}){const r=[],i=[],s={};return _.Children.forEach(Iy(t),l=>{if(Ep(l)){const c=l.type;if(Lg(c,sd)){const f=fG(c,l.props);i.push(f)}else r.push(l);if(Lg(c,Uc)&&c!==Uc&&l.props.id){const f=new c(l.props);s[f.id]=f}}else l&&r.push(l)}),Object.keys(s).length>0&&(Array.isArray(n)?n.forEach(l=>{s[l.id]=l}):n&&(s[n.id]=n),n=Object.values(s)),e=i.length>0?[...i,...e]:e,{layers:e,children:r,views:n}}function fG(t,e){const n={},r=t.defaultProps||{};for(const i in e)r[i]!==e[i]&&(n[i]=e[i]);return new t(n)}const dG=_.createContext();function hG({children:t,deck:e,ContextProvider:n=dG.Provider}){const{viewManager:r}=e||{};if(!r||!r.views.length)return[];const i={},s=r.views[0].id;for(const l of t){let c=s,f=l;Ep(l)&&Lg(l.type,Uc)&&(c=l.props.id||s,f=l.props.children);const d=r.getViewport(c),g=r.getViewState(c);if(d){g.padding=d.padding;const{x:m,y:v,width:S,height:E}=d;f=uP(f,{x:m,y:v,width:S,height:E,viewport:d,viewState:g}),i[c]||(i[c]={viewport:d,children:[]}),i[c].children.push(f)}}return Object.keys(i).map(l=>{const{viewport:c,children:f}=i[l],{x:d,y:g,width:m,height:v}=c,S={position:"absolute",left:d,top:g,width:m,height:v},E=`view-${l}`,w=_.createElement("div",{key:E,id:E,style:S},...f),b={deck:e,viewport:c,container:e.canvas.offsetParent,eventManager:e.eventManager,onViewStateChange:T=>{T.viewId=l,e._onViewStateChange(T)},widgets:[]},A=`view-${l}-context`;return _.createElement(n,{key:A,value:b},w)})}const gG={mixBlendMode:null};function pG({width:t,height:e,style:n}){const r={position:"absolute",zIndex:0,left:0,top:0,width:t,height:e},i={left:0,top:0};if(n)for(const s in n)s in gG?i[s]=n[s]:r[s]=n[s];return{containerStyle:r,canvasStyle:i}}function mG(t){return{get deck(){return t.deck},pickObject:e=>t.deck.pickObject(e),pickMultipleObjects:e=>t.deck.pickMultipleObjects(e),pickObjects:e=>t.deck.pickObjects(e)}}function fP(t){t.redrawReason&&(t.deck._drawLayers(t.redrawReason),t.redrawReason=null)}function vG(t,e,n){const r=new e({...n,_customRender:i=>{t.redrawReason=i;const s=r.getViewports();t.lastRenderedViewports!==s?t.forceUpdate():fP(t)}});return r}function _G(t,e){const[n,r]=_.useState(0),s=_.useRef({control:null,version:n,forceUpdate:()=>r(x=>x+1)}).current,l=_.useRef(null),c=_.useRef(null),f=_.useMemo(()=>uG(t),[t.layers,t.views,t.children]);let d=!0;const g=x=>{var N;return d&&t.viewState?(s.viewStateUpdateRequested=x,null):(s.viewStateUpdateRequested=null,(N=t.onViewStateChange)==null?void 0:N.call(t,x))},m=x=>{var N;d?s.interactionStateUpdateRequested=x:(s.interactionStateUpdateRequested=null,(N=t.onInteractionStateChange)==null||N.call(t,x))},v=_.useMemo(()=>{const x={widgets:[],...t,style:null,width:"100%",height:"100%",parent:l.current,canvas:c.current,layers:f.layers,views:f.views,onViewStateChange:g,onInteractionStateChange:m};return delete x._customRender,s.deck&&s.deck.setProps(x),x},[t]);_.useEffect(()=>{const x=t.Deck||zb;return s.deck=vG(s,x,{...v,parent:l.current,canvas:c.current}),()=>{var N;return(N=s.deck)==null?void 0:N.finalize()}},[]),aG(()=>{fP(s);const{viewStateUpdateRequested:x,interactionStateUpdateRequested:N}=s;x&&g(x),N&&m(N)}),_.useImperativeHandle(e,()=>mG(s),[]);const S=s.deck&&s.deck.isInitialized?s.deck.getViewports():void 0,{ContextProvider:E,width:w="100%",height:b="100%",id:A,style:T}=t,{containerStyle:C,canvasStyle:M}=_.useMemo(()=>pG({width:w,height:b,style:T}),[w,b,T]);if(!s.viewStateUpdateRequested&&s.lastRenderedViewports===S||s.version!==n){s.lastRenderedViewports=S,s.version=n;const x=hG({children:f.children,deck:s.deck,ContextProvider:E}),N=_.createElement("canvas",{key:"canvas",id:A||"deckgl-overlay",ref:c,style:M});s.control=_.createElement("div",{id:`${A||"deckgl"}-wrapper`,ref:l,style:C},[N,x])}return d=!1,s.control}const dP=_.forwardRef(_G),yG=_.createContext(null);function bG(t,e){const n=Array.isArray(t)?t[0]:t?t.x:0,r=Array.isArray(t)?t[1]:t?t.y:0,i=Array.isArray(e)?e[0]:e?e.x:0,s=Array.isArray(e)?e[1]:e?e.y:0;return n===i&&r===s}function ms(t,e){if(t===e)return!0;if(!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!ms(t[n],e[n]))return!1;return!0}else if(Array.isArray(e))return!1;if(typeof t=="object"&&typeof e=="object"){const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n)if(!e.hasOwnProperty(i)||!ms(t[i],e[i]))return!1;return!0}return!1}function UC(t){return{longitude:t.center.lng,latitude:t.center.lat,zoom:t.zoom,pitch:t.pitch,bearing:t.bearing,padding:t.padding}}function LC(t,e){const n=e.viewState||e,r={};if("longitude"in n&&"latitude"in n&&(n.longitude!==t.center.lng||n.latitude!==t.center.lat)){const i=t.center.constructor;r.center=new i(n.longitude,n.latitude)}return"zoom"in n&&n.zoom!==t.zoom&&(r.zoom=n.zoom),"bearing"in n&&n.bearing!==t.bearing&&(r.bearing=n.bearing),"pitch"in n&&n.pitch!==t.pitch&&(r.pitch=n.pitch),n.padding&&t.padding&&!ms(n.padding,t.padding)&&(r.padding=n.padding),r}const SG=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function zC(t){if(!t)return null;if(typeof t=="string"||("toJS"in t&&(t=t.toJS()),!t.layers))return t;const e={};for(const r of t.layers)e[r.id]=r;const n=t.layers.map(r=>{let i=null;"interactive"in r&&(i=Object.assign({},r),delete i.interactive);const s=e[r.ref];if(s){i=i||Object.assign({},r),delete i.ref;for(const l of SG)l in s&&(i[l]=s[l])}return i||r});return{...t,layers:n}}const $C={version:8,sources:{},layers:[]},VC={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},HC={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},jC={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},wG=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],EG=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class zc{constructor(e,n,r){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=i=>{const s=this.props[jC[i.type]];s?s(i):i.type==="error"&&console.error(i.error)},this._onCameraEvent=i=>{if(this._internalUpdate)return;i.viewState=this._propsedCameraUpdate||UC(this._map.transform);const s=this.props[HC[i.type]];s&&s(i)},this._onCameraUpdate=i=>this._internalUpdate?i:(this._propsedCameraUpdate=UC(i),LC(i,this.props)),this._onPointerEvent=i=>{(i.type==="mousemove"||i.type==="mouseout")&&this._updateHover(i);const s=this.props[VC[i.type]];s&&(this.props.interactiveLayerIds&&i.type!=="mouseover"&&i.type!=="mouseout"&&(i.features=this._hoveredFeatures||this._queryRenderedFeatures(i.point)),s(i),delete i.features)},this._MapClass=e,this.props=n,this._initialize(r)}get map(){return this._map}setProps(e){const n=this.props;this.props=e;const r=this._updateSettings(e,n),i=this._updateSize(e),s=this._updateViewState(e);this._updateStyle(e,n),this._updateStyleComponents(e),this._updateHandlers(e,n),(r||i||s&&!this._map.isMoving())&&this.redraw()}static reuse(e,n){const r=zc.savedMaps.pop();if(!r)return null;const i=r.map,s=i.getContainer();for(n.className=s.className;s.childNodes.length>0;)n.appendChild(s.childNodes[0]);i._container=n;const l=i._resizeObserver;l&&(l.disconnect(),l.observe(n)),r.setProps({...e,styleDiffing:!1}),i.resize();const{initialViewState:c}=e;return c&&(c.bounds?i.fitBounds(c.bounds,{...c.fitBoundsOptions,duration:0}):r._updateViewState(c)),i.isStyleLoaded()?i.fire("load"):i.once("style.load",()=>i.fire("load")),i._update(),r}_initialize(e){const{props:n}=this,{mapStyle:r=$C}=n,i={...n,...n.initialViewState,container:e,style:zC(r)},s=i.initialViewState||i.viewState||i;if(Object.assign(i,{center:[s.longitude||0,s.latitude||0],zoom:s.zoom||0,pitch:s.pitch||0,bearing:s.bearing||0}),n.gl){const c=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=c,n.gl)}const l=new this._MapClass(i);s.padding&&l.setPadding(s.padding),n.cursor&&(l.getCanvas().style.cursor=n.cursor),l.transformCameraUpdate=this._onCameraUpdate,l.on("style.load",()=>{var c;this._styleComponents={light:l.getLight(),sky:l.getSky(),projection:(c=l.getProjection)==null?void 0:c.call(l),terrain:l.getTerrain()},this._updateStyleComponents(this.props)}),l.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(const c in VC)l.on(c,this._onPointerEvent);for(const c in HC)l.on(c,this._onCameraEvent);for(const c in jC)l.on(c,this._onEvent);this._map=l}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),zc.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}_updateSize(e){const{viewState:n}=e;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(e){const n=this._map,r=n.transform;if(!n.isMoving()){const s=LC(r,e);if(Object.keys(s).length>0)return this._internalUpdate=!0,n.jumpTo(s),this._internalUpdate=!1,!0}return!1}_updateSettings(e,n){const r=this._map;let i=!1;for(const s of wG)if(s in e&&!ms(e[s],n[s])){i=!0;const l=r[`set${s[0].toUpperCase()}${s.slice(1)}`];l==null||l.call(r,e[s])}return i}_updateStyle(e,n){if(e.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=e.cursor||""),e.mapStyle!==n.mapStyle){const{mapStyle:r=$C,styleDiffing:i=!0}=e,s={diff:i};"localIdeographFontFamily"in e&&(s.localIdeographFontFamily=e.localIdeographFontFamily),this._map.setStyle(zC(r),s)}}_updateStyleComponents({light:e,projection:n,sky:r,terrain:i}){var c,f;const s=this._map,l=this._styleComponents;s.style._loaded&&(e&&!ms(e,l.light)&&(l.light=e,s.setLight(e)),n&&!ms(n,l.projection)&&n!==((c=l.projection)==null?void 0:c.type)&&(l.projection=typeof n=="string"?{type:n}:n,(f=s.setProjection)==null||f.call(s,l.projection)),r&&!ms(r,l.sky)&&(l.sky=r,s.setSky(r)),i!==void 0&&!ms(i,l.terrain)&&(!i||s.getSource(i.source))&&(l.terrain=i,s.setTerrain(i)))}_updateHandlers(e,n){const r=this._map;for(const i of EG){const s=e[i]??!0,l=n[i]??!0;ms(s,l)||(s?r[i].enable(s):r[i].disable())}}_queryRenderedFeatures(e){const n=this._map,{interactiveLayerIds:r=[]}=this.props;try{return n.queryRenderedFeatures(e,{layers:r.filter(n.getLayer.bind(n))})}catch{return[]}}_updateHover(e){var i;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const s=e.type,l=((i=this._hoveredFeatures)==null?void 0:i.length)>0,c=this._queryRenderedFeatures(e.point),f=c.length>0;!f&&l&&(e.type="mouseleave",this._onPointerEvent(e)),this._hoveredFeatures=c,f&&!l&&(e.type="mouseenter",this._onPointerEvent(e)),e.type=s}else this._hoveredFeatures=null}}zc.savedMaps=[];const TG=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function AG(t){if(!t)return null;const e=t.map,n={getMap:()=>e};for(const r of CG(e))!(r in n)&&!TG.includes(r)&&(n[r]=e[r].bind(e));return n}function CG(t){const e=new Set;let n=t;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof t[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&e.add(r);n=Object.getPrototypeOf(n)}return Array.from(e)}const RG=typeof document<"u"?_.useLayoutEffect:_.useEffect;function xG(t,e){const{RTLTextPlugin:n,maxParallelImageRequests:r,workerCount:i,workerUrl:s}=e;if(n&&t.getRTLTextPluginStatus&&t.getRTLTextPluginStatus()==="unavailable"){const{pluginUrl:l,lazy:c=!0}=typeof n=="string"?{pluginUrl:n}:n;t.setRTLTextPlugin(l,f=>{f&&console.error(f)},c)}r!==void 0&&t.setMaxParallelImageRequests(r),i!==void 0&&t.setWorkerCount(i),s!==void 0&&t.setWorkerUrl(s)}const Tp=_.createContext(null);function MG(t,e){const n=_.useContext(yG),[r,i]=_.useState(null),s=_.useRef(),{current:l}=_.useRef({mapLib:null,map:null});_.useEffect(()=>{const d=t.mapLib;let g=!0,m;return Promise.resolve(d||m6(()=>import("./maplibre-gl-C_BhQy4_.js").then(v=>v.m),[])).then(v=>{if(!g)return;if(!v)throw new Error("Invalid mapLib");const S="Map"in v?v:v.default;if(!S.Map)throw new Error("Invalid mapLib");if(xG(S,t),!S.supported||S.supported(t))t.reuseMaps&&(m=zc.reuse(t,s.current)),m||(m=new zc(S.Map,t,s.current)),l.map=AG(m),l.mapLib=S,i(m),n==null||n.onMapMount(l.map,t.id);else throw new Error("Map is not supported by this browser")}).catch(v=>{const{onError:S}=t;S?S({type:"error",target:null,originalEvent:null,error:v}):console.error(v)}),()=>{g=!1,m&&(n==null||n.onMapUnmount(t.id),t.reuseMaps?m.recycle():m.destroy())}},[]),RG(()=>{r&&r.setProps(t)}),_.useImperativeHandle(e,()=>l.map,[r]);const c=_.useMemo(()=>({position:"relative",width:"100%",height:"100%",...t.style}),[t.style]),f={height:"100%"};return _.createElement("div",{id:t.id,ref:s,style:c},r&&_.createElement(Tp.Provider,{value:l},_.createElement("div",{"mapboxgl-children":"",style:f},t.children)))}const hP=_.forwardRef(MG),OG=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Ks(t,e){if(!t||!e)return;const n=t.style;for(const r in e){const i=e[r];Number.isFinite(i)&&!OG.test(r)?n[r]=`${i}px`:n[r]=i}}_.memo(_.forwardRef((t,e)=>{const{map:n,mapLib:r}=_.useContext(Tp),i=_.useRef({props:t});i.current.props=t;const s=_.useMemo(()=>{let w=!1;_.Children.forEach(t.children,T=>{T&&(w=!0)});const b={...t,element:w?document.createElement("div"):null},A=new r.Marker(b);return A.setLngLat([t.longitude,t.latitude]),A.getElement().addEventListener("click",T=>{var C,M;(M=(C=i.current.props).onClick)==null||M.call(C,{type:"click",target:A,originalEvent:T})}),A.on("dragstart",T=>{var M,x;const C=T;C.lngLat=s.getLngLat(),(x=(M=i.current.props).onDragStart)==null||x.call(M,C)}),A.on("drag",T=>{var M,x;const C=T;C.lngLat=s.getLngLat(),(x=(M=i.current.props).onDrag)==null||x.call(M,C)}),A.on("dragend",T=>{var M,x;const C=T;C.lngLat=s.getLngLat(),(x=(M=i.current.props).onDragEnd)==null||x.call(M,C)}),A},[]);_.useEffect(()=>(s.addTo(n.getMap()),()=>{s.remove()}),[]);const{longitude:l,latitude:c,offset:f,style:d,draggable:g=!1,popup:m=null,rotation:v=0,rotationAlignment:S="auto",pitchAlignment:E="auto"}=t;return _.useEffect(()=>{Ks(s.getElement(),d)},[d]),_.useImperativeHandle(e,()=>s,[]),(s.getLngLat().lng!==l||s.getLngLat().lat!==c)&&s.setLngLat([l,c]),f&&!bG(s.getOffset(),f)&&s.setOffset(f),s.isDraggable()!==g&&s.setDraggable(g),s.getRotation()!==v&&s.setRotation(v),s.getRotationAlignment()!==S&&s.setRotationAlignment(S),s.getPitchAlignment()!==E&&s.setPitchAlignment(E),s.getPopup()!==m&&s.setPopup(m),$a.createPortal(t.children,s.getElement())}));function WC(t){return new Set(t?t.trim().split(/\s+/):[])}_.memo(_.forwardRef((t,e)=>{const{map:n,mapLib:r}=_.useContext(Tp),i=_.useMemo(()=>document.createElement("div"),[]),s=_.useRef({props:t});s.current.props=t;const l=_.useMemo(()=>{const c={...t},f=new r.Popup(c);return f.setLngLat([t.longitude,t.latitude]),f.once("open",d=>{var g,m;(m=(g=s.current.props).onOpen)==null||m.call(g,d)}),f},[]);if(_.useEffect(()=>{const c=f=>{var d,g;(g=(d=s.current.props).onClose)==null||g.call(d,f)};return l.on("close",c),l.setDOMContent(i).addTo(n.getMap()),()=>{l.off("close",c),l.isOpen()&&l.remove()}},[]),_.useEffect(()=>{Ks(l.getElement(),t.style)},[t.style]),_.useImperativeHandle(e,()=>l,[]),l.isOpen()&&((l.getLngLat().lng!==t.longitude||l.getLngLat().lat!==t.latitude)&&l.setLngLat([t.longitude,t.latitude]),t.offset&&!ms(l.options.offset,t.offset)&&l.setOffset(t.offset),(l.options.anchor!==t.anchor||l.options.maxWidth!==t.maxWidth)&&(l.options.anchor=t.anchor,l.setMaxWidth(t.maxWidth)),l.options.className!==t.className)){const c=WC(l.options.className),f=WC(t.className);for(const d of c)f.has(d)||l.removeClassName(d);for(const d of f)c.has(d)||l.addClassName(d);l.options.className=t.className}return $a.createPortal(t.children,i)}));function tl(t,e,n,r){const i=_.useContext(Tp),s=_.useMemo(()=>t(i),[]);return _.useEffect(()=>{const l=e,c=null,f=typeof e=="function"?e:null,{map:d}=i;return d.hasControl(s)||(d.addControl(s,l==null?void 0:l.position),c&&c(i)),()=>{f&&f(i),d.hasControl(s)&&d.removeControl(s)}},[]),s}function PG(t){const e=tl(({mapLib:n})=>new n.AttributionControl(t),{position:t.position});return _.useEffect(()=>{Ks(e._container,t.style)},[t.style]),null}_.memo(PG);function NG(t){const e=tl(({mapLib:n})=>new n.FullscreenControl({container:t.containerId&&document.getElementById(t.containerId)}),{position:t.position});return _.useEffect(()=>{Ks(e._controlContainer,t.style)},[t.style]),null}_.memo(NG);function IG(t,e){const n=_.useRef({props:t}),r=tl(({mapLib:i})=>{const s=new i.GeolocateControl(t),l=s._setupUI;return s._setupUI=()=>{s._container.hasChildNodes()||l()},s.on("geolocate",c=>{var f,d;(d=(f=n.current.props).onGeolocate)==null||d.call(f,c)}),s.on("error",c=>{var f,d;(d=(f=n.current.props).onError)==null||d.call(f,c)}),s.on("outofmaxbounds",c=>{var f,d;(d=(f=n.current.props).onOutOfMaxBounds)==null||d.call(f,c)}),s.on("trackuserlocationstart",c=>{var f,d;(d=(f=n.current.props).onTrackUserLocationStart)==null||d.call(f,c)}),s.on("trackuserlocationend",c=>{var f,d;(d=(f=n.current.props).onTrackUserLocationEnd)==null||d.call(f,c)}),s},{position:t.position});return n.current.props=t,_.useImperativeHandle(e,()=>r,[]),_.useEffect(()=>{Ks(r._container,t.style)},[t.style]),null}_.memo(_.forwardRef(IG));function DG(t){const e=tl(({mapLib:n})=>new n.NavigationControl(t),{position:t.position});return _.useEffect(()=>{Ks(e._container,t.style)},[t.style]),null}_.memo(DG);function FG(t){const e=tl(({mapLib:s})=>new s.ScaleControl(t),{position:t.position}),n=_.useRef(t),r=n.current;n.current=t;const{style:i}=t;return t.maxWidth!==void 0&&t.maxWidth!==r.maxWidth&&(e.options.maxWidth=t.maxWidth),t.unit!==void 0&&t.unit!==r.unit&&e.setUnit(t.unit),_.useEffect(()=>{Ks(e._container,i)},[i]),null}_.memo(FG);function kG(t){const e=tl(({mapLib:n})=>new n.TerrainControl(t),{position:t.position});return _.useEffect(()=>{Ks(e._container,t.style)},[t.style]),null}_.memo(kG);function BG(t){const e=tl(({mapLib:n})=>new n.LogoControl(t),{position:t.position});return _.useEffect(()=>{Ks(e._container,t.style)},[t.style]),null}_.memo(BG);const XC=mp().domain([0,1e4]).range([vg(0),vg(1)]),UG=mp().domain([0,12e3]).range([50,250]);function LG(){const[t,e]=_.useState(0),[n,r]=_.useState("00:00:00"),[i,s]=_.useState("2023-12-01"),{isPending:l,error:c,data:f}=h6({queryKey:[i],queryFn:()=>Jh(`./${i}.csv`,Zy,{csv:{}})});c&&console.log(c);const d=l?[]:[new Lf({id:"deckgl-grid",data:f.data,getPosition:g=>[g.x,g.y],getFillColor:g=>XC(g[n]).slice(4,-1).split(", ").map(Number),cellSize:505,extruded:!1,updateTriggers:{getFillColor:[n]}}),new Vb({id:"deckgl-circle2",getPosition:g=>[g.x,g.y],getFillColor:g=>XC(g[n]).slice(4,-1).split(", ").map(Number),getRadius:g=>UG(g[n]),updateTriggers:{getFillColor:[n],getRadius:[n]}})];return ar.jsxs(ar.Fragment,{children:[ar.jsx(dP,{initialViewState:{longitude:37.028,latitude:55.778,zoom:7},controller:!0,layers:d,children:ar.jsx(hP,{mapStyle:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",hash:!0})}),ar.jsxs(aM,{style:{position:"absolute",zIndex:1,justifyContent:"center",padding:30},direction:"vertical",children:[ar.jsx(uM,{spinning:l}),ar.jsx(qc,{onChange:s,options:[{value:"2023-12-01"},{value:"2023-12-02"}],value:i}),ar.jsx(N9,{value:t,min:0,max:47,onChange:g=>e(g),onChangeComplete:g=>{const m=Math.floor(g/2).toString().padStart(2,"0"),v=(g%2*30).toString().padStart(2,"0"),S=m+":"+v+":00";r(S)}}),ar.jsx("p",{id:"time",children:n}),ar.jsx("button",{onClick:()=>{e(t+1);const g=parseInt(t),m=Math.floor(g/2).toString().padStart(2,"0"),v=(g%2*30).toString().padStart(2,"0"),S=m+":"+v+":00";r(S)},children:"Плюс"})]})]})}const qC=["BOOLEAN","INT32","INT64","INT96","FLOAT","DOUBLE","BYTE_ARRAY","FIXED_LEN_BYTE_ARRAY"],So=["PLAIN",void 0,"PLAIN_DICTIONARY","RLE","BIT_PACKED","DELTA_BINARY_PACKED","DELTA_LENGTH_BYTE_ARRAY","DELTA_BYTE_ARRAY","RLE_DICTIONARY","BYTE_STREAM_SPLIT"],zG=["REQUIRED","OPTIONAL","REPEATED"],$G=["UTF8","MAP","MAP_KEY_VALUE","LIST","ENUM","DECIMAL","DATE","TIME_MILLIS","TIME_MICROS","TIMESTAMP_MILLIS","TIMESTAMP_MICROS","UINT_8","UINT_16","UINT_32","UINT_64","INT_8","INT_16","INT_32","INT_64","JSON","BSON","INTERVAL"],VG=["UNCOMPRESSED","SNAPPY","GZIP","LZO","BROTLI","LZ4","ZSTD","LZ4_RAW"],gP=["DATA_PAGE","INDEX_PAGE","DICTIONARY_PAGE","DATA_PAGE_V2"],pP=864e5;function YC(t,e,n,r,i=!0){if(e&&r.endsWith("_DICTIONARY")){e=KC(e,n,i);let s=t;t instanceof Uint8Array&&!(e instanceof Uint8Array)&&(s=new e.constructor(t.length));for(let l=0;l<t.length;l++)s[l]=e[t[l]];return s}else return KC(t,n,i)}function KC(t,e,n=!0){var i,s;const r=e.converted_type;if(r==="DECIMAL"){const c=10**-(e.scale||0),f=new Array(t.length);for(let d=0;d<f.length;d++)t[0]instanceof Uint8Array?f[d]=mP(t[d])*c:f[d]=Number(t[d])*c;return f}if(r===void 0&&e.type==="INT96")return Array.from(t).map(HG);if(r==="DATE"){const l=new Array(t.length);for(let c=0;c<l.length;c++)l[c]=new Date(t[c]*pP);return l}if(r==="TIMESTAMP_MILLIS"){const l=new Array(t.length);for(let c=0;c<l.length;c++)l[c]=new Date(Number(t[c]));return l}if(r==="TIMESTAMP_MICROS"){const l=new Array(t.length);for(let c=0;c<l.length;c++)l[c]=new Date(Number(t[c]/1000n));return l}if(r==="JSON"){const l=new TextDecoder;return t.map(c=>JSON.parse(l.decode(c)))}if(r==="BSON")throw new Error("parquet bson not supported");if(r==="INTERVAL")throw new Error("parquet interval not supported");if(r==="UTF8"||n&&e.type==="BYTE_ARRAY"){const l=new TextDecoder,c=new Array(t.length);for(let f=0;f<c.length;f++)c[f]=t[f]&&l.decode(t[f]);return c}if(r==="UINT_64"){const l=new BigUint64Array(t.length);for(let c=0;c<l.length;c++)l[c]=BigInt(t[c]);return l}if(((i=e.logical_type)==null?void 0:i.type)==="FLOAT16")return Array.from(t).map(vP);if(((s=e.logical_type)==null?void 0:s.type)==="TIMESTAMP"){const{unit:l}=e.logical_type;let c=1n;l==="MICROS"&&(c=1000n),l==="NANOS"&&(c=1000000n);const f=new Array(t.length);for(let d=0;d<f.length;d++)f[d]=new Date(Number(t[d]/c));return f}return t}function mP(t){let e=0;for(const r of t)e=e*256+r;const n=t.length*8;return e>=2**(n-1)&&(e-=2**n),e}function HG(t){const e=Number((t>>64n)-2440588n),n=Number((t&0xffffffffffffffffn)/1000000n),r=e*pP+n;return new Date(r)}function vP(t){if(!t)return;const e=t[1]<<8|t[0],n=e>>15?-1:1,r=e>>10&31,i=e&1023;return r===0?n*2**-14*(i/1024):r===31?i?NaN:n*(1/0):n*2**(r-15)*(1+i/1024)}function _P(t,e,n){const r=t[e],i=[];let s=1;if(r.num_children)for(;i.length<r.num_children;){const l=t[e+s],c=_P(t,e+s,[...n,l.name]);s+=c.count,i.push(c)}return{count:s,element:r,children:i,path:n}}function ZC(t,e){let n=_P(t,0,[]);const r=[n];for(const i of e){const s=n.children.find(l=>l.element.name===i);if(!s)throw new Error(`parquet schema element not found: ${e}`);r.push(s),n=s}return r}function yP(t){let e=0;for(const{element:n}of t)n.repetition_type==="REPEATED"&&e++;return e}function zg(t){let e=0;for(const{element:n}of t.slice(1))n.repetition_type!=="REQUIRED"&&e++;return e}function jG(t){if(!t||t.element.converted_type!=="LIST"||t.children.length>1)return!1;const e=t.children[0];return!(e.children.length>1||e.element.repetition_type!=="REPEATED")}function WG(t){if(!t||t.element.converted_type!=="MAP"||t.children.length>1)return!1;const e=t.children[0];if(e.children.length!==2||e.element.repetition_type!=="REPEATED")return!1;const n=e.children.find(i=>i.element.name==="key");if((n==null?void 0:n.element.repetition_type)==="REPEATED")return!1;const r=e.children.find(i=>i.element.name==="value");return(r==null?void 0:r.element.repetition_type)!=="REPEATED"}const Cr={STOP:0,TRUE:1,FALSE:2,BYTE:3,I16:4,I32:5,I64:6,DOUBLE:7,BINARY:8,LIST:9,STRUCT:12,UUID:13};function bP(t){let e=0;const n={};for(;t.offset<t.view.byteLength;){const[r,i,s]=wP(t,e);if(e=s,r===Cr.STOP)break;n[`field_${i}`]=Xh(t,r)}return n}function Xh(t,e){switch(e){case Cr.TRUE:return!0;case Cr.FALSE:return!1;case Cr.BYTE:return t.view.getInt8(t.offset++);case Cr.I16:case Cr.I32:return qG(t);case Cr.I64:return Dy(t);case Cr.DOUBLE:{const n=t.view.getFloat64(t.offset,!0);return t.offset+=8,n}case Cr.BINARY:{const n=$o(t),r=new Uint8Array(t.view.buffer,t.view.byteOffset+t.offset,n);return t.offset+=n,r}case Cr.LIST:{const[n,r]=YG(t),i=n===Cr.TRUE||n===Cr.FALSE,s=new Array(r);for(let l=0;l<r;l++)s[l]=i?Xh(t,Cr.BYTE)===1:Xh(t,n);return s}case Cr.STRUCT:{const n={};let r=0;for(;;){let i,s;if([i,s,r]=wP(t,r),i===Cr.STOP)break;n[`field_${s}`]=Xh(t,i)}return n}case Cr.UUID:{let n="";for(let r=0;r<16;r++)n+=t.view.getUint8(t.offset++).toString(16).padStart(2,"0");return n}default:throw new Error(`thrift unhandled type: ${e}`)}}function $o(t){let e=0,n=0;for(;;){const r=t.view.getUint8(t.offset++);if(e|=(r&127)<<n,!(r&128))return e;n+=7}}function XG(t){let e=0n,n=0n;for(;;){const r=t.view.getUint8(t.offset++);if(e|=BigInt(r&127)<<n,!(r&128))return e;n+=7n}}function qG(t){const e=$o(t);return e>>>1^-(e&1)}function Dy(t){const e=XG(t);return e>>BigInt(1)^-(e&BigInt(1))}function SP(t){return t&15}function wP(t,e){const n=t.view.getUint8(t.offset++);if((n&15)===Cr.STOP)return[0,0,e];const r=n>>4;let i;if(r)i=e+r;else throw new Error("non-delta field id not supported");return[SP(n),i,i]}function YG(t){const e=t.view.getUint8(t.offset++),n=e>>4,r=SP(e);if(n===15){const i=$o(t);return[r,i]}return[r,n]}async function KG(t,e=1<<19){if(!t)throw new Error("parquet file is required");if(!(t.byteLength>=0))throw new Error("parquet file byteLength is required");const n=Math.max(0,t.byteLength-e),r=await t.slice(n,t.byteLength),i=new DataView(r);if(i.getUint32(r.byteLength-4,!0)!==827474256)throw new Error("parquet file invalid (footer != PAR1)");const s=i.getUint32(r.byteLength-8,!0);if(s>t.byteLength-8)throw new Error(`parquet metadata length ${s} exceeds available buffer ${t.byteLength-8}`);if(s+8>e){const l=t.byteLength-s-8,c=await t.slice(l,n),f=new ArrayBuffer(s+8),d=new Uint8Array(f);return d.set(new Uint8Array(c)),d.set(new Uint8Array(r),n-l),QC(f)}else return QC(r)}function QC(t){var b;if(!t)throw new Error("parquet file is required");const e=new DataView(t);if(e.byteLength<8)throw new Error("parquet file is too short");if(e.getUint32(e.byteLength-4,!0)!==827474256)throw new Error("parquet file invalid (footer != PAR1)");const n=e.byteLength-8,r=e.getUint32(n,!0);if(r>e.byteLength-8)throw new Error(`parquet metadata length ${r} exceeds available buffer ${e.byteLength-8}`);const i=n-r,l=bP({view:e,offset:i}),c=new TextDecoder;function f(A){return A&&c.decode(A)}const d=l.field_1,g=l.field_2.map(A=>({type:qC[A.field_1],type_length:A.field_2,repetition_type:zG[A.field_3],name:f(A.field_4),num_children:A.field_5,converted_type:$G[A.field_6],scale:A.field_7,precision:A.field_8,field_id:A.field_9,logical_type:ZG(A.field_10)})),m=g.filter(A=>A.type),v=l.field_3,S=l.field_4.map(A=>{var T;return{columns:A.field_1.map((C,M)=>{var x,N;return{file_path:f(C.field_1),file_offset:C.field_2,meta_data:C.field_3&&{type:qC[C.field_3.field_1],encodings:(x=C.field_3.field_2)==null?void 0:x.map(F=>So[F]),path_in_schema:C.field_3.field_3.map(f),codec:VG[C.field_3.field_4],num_values:C.field_3.field_5,total_uncompressed_size:C.field_3.field_6,total_compressed_size:C.field_3.field_7,key_value_metadata:C.field_3.field_8,data_page_offset:C.field_3.field_9,index_page_offset:C.field_3.field_10,dictionary_page_offset:C.field_3.field_11,statistics:QG(C.field_3.field_12,m[M]),encoding_stats:(N=C.field_3.field_13)==null?void 0:N.map(F=>({page_type:gP[F.field_1],encoding:So[F.field_2],count:F.field_3})),bloom_filter_offset:C.field_3.field_14,bloom_filter_length:C.field_3.field_15,size_statistics:C.field_3.field_16&&{unencoded_byte_array_data_bytes:C.field_3.field_16.field_1,repetition_level_histogram:C.field_3.field_16.field_2,definition_level_histogram:C.field_3.field_16.field_3}},offset_index_offset:C.field_4,offset_index_length:C.field_5,column_index_offset:C.field_6,column_index_length:C.field_7,crypto_metadata:C.field_7,encrypted_column_metadata:C.field_8}}),total_byte_size:A.field_2,num_rows:A.field_3,sorting_columns:(T=A.field_4)==null?void 0:T.map(C=>({column_idx:C.field_1,descending:C.field_2,nulls_first:C.field_3})),file_offset:A.field_5,total_compressed_size:A.field_6,ordinal:A.field_7}}),E=(b=l.field_5)==null?void 0:b.map(A=>({key:f(A.field_1),value:f(A.field_2)})),w=f(l.field_6);return{version:d,schema:g,num_rows:v,row_groups:S,key_value_metadata:E,created_by:w,metadata_length:r}}function ZG(t){return t!=null&&t.field_1?{type:"STRING"}:t!=null&&t.field_2?{type:"MAP"}:t!=null&&t.field_3?{type:"LIST"}:t!=null&&t.field_4?{type:"ENUM"}:t!=null&&t.field_5?{type:"DECIMAL",scale:t.field_5.field_1,precision:t.field_5.field_2}:t!=null&&t.field_6?{type:"DATE"}:t!=null&&t.field_7?{type:"TIME",isAdjustedToUTC:t.field_7.field_1,unit:GC(t.field_7.field_2)}:t!=null&&t.field_8?{type:"TIMESTAMP",isAdjustedToUTC:t.field_8.field_1,unit:GC(t.field_8.field_2)}:t!=null&&t.field_10?{type:"INTEGER",bitWidth:t.field_10.field_1,isSigned:t.field_10.field_2}:t!=null&&t.field_11?{type:"NULL"}:t!=null&&t.field_12?{type:"JSON"}:t!=null&&t.field_13?{type:"BSON"}:t!=null&&t.field_14?{type:"UUID"}:t!=null&&t.field_15?{type:"FLOAT16"}:t}function GC(t){if(t.field_1)return"MILLIS";if(t.field_2)return"MICROS";if(t.field_3)return"NANOS";throw new Error("parquet time unit required")}function QG(t,e){return t&&{max:Dh(t.field_1,e),min:Dh(t.field_2,e),null_count:t.field_3,distinct_count:t.field_4,max_value:Dh(t.field_5,e),min_value:Dh(t.field_6,e),is_max_value_exact:t.field_7,is_min_value_exact:t.field_8}}function Dh(t,e){const{type:n,converted_type:r,logical_type:i}=e;if(t===void 0)return t;if(n==="BOOLEAN")return t[0]===1;if(n==="BYTE_ARRAY")return new TextDecoder().decode(t);const s=new DataView(t.buffer,t.byteOffset,t.byteLength);return n==="FLOAT"&&s.byteLength===4?s.getFloat32(0,!0):n==="DOUBLE"&&s.byteLength===8?s.getFloat64(0,!0):n==="INT32"&&r==="DATE"?new Date(s.getInt32(0,!0)*864e5):n==="INT64"&&r==="TIMESTAMP_MICROS"?new Date(Number(s.getBigInt64(0,!0)/1000n)):n==="INT64"&&r==="TIMESTAMP_MILLIS"?new Date(Number(s.getBigInt64(0,!0))):n==="INT64"&&(i==null?void 0:i.type)==="TIMESTAMP"&&(i==null?void 0:i.unit)==="NANOS"?new Date(Number(s.getBigInt64(0,!0)/1000000n)):n==="INT64"&&(i==null?void 0:i.type)==="TIMESTAMP"&&(i==null?void 0:i.unit)==="MICROS"?new Date(Number(s.getBigInt64(0,!0)/1000n)):n==="INT64"&&(i==null?void 0:i.type)==="TIMESTAMP"?new Date(Number(s.getBigInt64(0,!0))):n==="INT32"&&s.byteLength===4?s.getInt32(0,!0):n==="INT64"&&s.byteLength===8?s.getBigInt64(0,!0):r==="DECIMAL"?mP(t)*10**-(e.scale||0):(i==null?void 0:i.type)==="FLOAT16"?vP(t):t}function JC(t,e,n,r,i,s){const l=(e==null?void 0:e.length)||n.length;let c=0;const f=[t];let d=t,g=0,m=0,v=0;if(n[0])for(;g<i.length-2&&v<n[0];)d=d.at(-1),f.push(d),g++,i[g]!=="REQUIRED"&&m++,i[g]==="REPEATED"&&v++;for(let S=0;S<l;S++){const E=e!=null&&e.length?e[S]:s,w=n[S];for(;g&&(w<v||i[g]!=="REPEATED");)i[g]!=="REQUIRED"&&(f.pop(),m--),i[g]==="REPEATED"&&v--,g--;for(d=f.at(-1);(g<i.length-2||i[g+1]==="REPEATED")&&(m<E||i[g+1]==="REQUIRED");){if(g++,i[g]!=="REQUIRED"){const b=[];d.push(b),d=b,f.push(b),m++}i[g]==="REPEATED"&&v++}E===s?d.push(r[c++]):g===i.length-2?d.push(null):d.push([])}if(!t.length)for(let S=0;S<s;S++){const E=[];d.push(E),d=E}return t}function tf(t,e,n=0){const r=e.path.join("."),i=e.element.repetition_type==="OPTIONAL",s=i?n+1:n;if(jG(e)){let l=e.children[0],c=s;l.children.length===1&&(l=l.children[0],c++),tf(t,l,c);const f=l.path.join("."),d=t.get(f);if(!d)throw new Error("parquet list column missing values");i&&qh(d,n),t.set(r,d),t.delete(f);return}if(WG(e)){const l=e.children[0].element.name;tf(t,e.children[0].children[0],s+1),tf(t,e.children[0].children[1],s+1);const c=t.get(`${r}.${l}.key`),f=t.get(`${r}.${l}.value`);if(!c)throw new Error("parquet map column missing keys");if(!f)throw new Error("parquet map column missing values");if(c.length!==f.length)throw new Error("parquet map column key/value length mismatch");const d=EP(c,f,s);i&&qh(d,n),t.delete(`${r}.${l}.key`),t.delete(`${r}.${l}.value`),t.set(r,d);return}if(e.children.length){const l=e.element.repetition_type==="REQUIRED"?n:n+1,c={};for(const d of e.children){tf(t,d,l);const g=t.get(d.path.join("."));if(!g)throw new Error("parquet struct missing child data");c[d.element.name]=g}for(const d of e.children)t.delete(d.path.join("."));const f=TP(c,l);i&&qh(f,n),t.set(r,f)}}function qh(t,e){for(let n=0;n<t.length;n++)e?qh(t[n],e-1):t[n]=t[n][0]}function EP(t,e,n){const r=[];for(let i=0;i<t.length;i++)if(n)r.push(EP(t[i],e[i],n-1));else if(t[i]){const s={};for(let l=0;l<t[i].length;l++){const c=e[i][l];s[t[i][l]]=c===void 0?null:c}r.push(s)}else r.push(void 0);return r}function TP(t,e){var s;const n=Object.keys(t),r=(s=t[n[0]])==null?void 0:s.length,i=[];for(let l=0;l<r;l++){const c={};for(const f of n){if(t[f].length!==r)throw new Error("parquet struct parsing error");c[f]=t[f][l]}e?i.push(TP(c,e-1)):i.push(c)}return i}function $g(t,e,n){const r=n instanceof Int32Array,i=$o(t),s=$o(t);$o(t);let l=Dy(t),c=0;n[c++]=r?Number(l):l;const f=i/s;for(;c<e;){const d=Dy(t),g=new Uint8Array(s);for(let m=0;m<s;m++)g[m]=t.view.getUint8(t.offset++);for(let m=0;m<s&&c<e;m++){const v=BigInt(g[m]);if(v){let S=0n,E=f;const w=(1n<<v)-1n;for(;E&&c<e;){let b=BigInt(t.view.getUint8(t.offset))>>S&w;for(S+=v;S>=8;)S-=8n,t.offset++,S&&(b|=BigInt(t.view.getUint8(t.offset))<<v-S&w);const A=d+b;l+=A,n[c++]=r?Number(l):l,E--}E&&(t.offset+=Math.ceil((E*Number(v)+Number(S))/8))}else for(let S=0;S<f&&c<e;S++)l+=d,n[c++]=r?Number(l):l}}}function GG(t,e,n){const r=new Int32Array(e);$g(t,e,r);for(let i=0;i<e;i++)n[i]=new Uint8Array(t.view.buffer,t.view.byteOffset+t.offset,r[i]),t.offset+=r[i]}function JG(t,e,n){const r=new Int32Array(e);$g(t,e,r);const i=new Int32Array(e);$g(t,e,i);for(let s=0;s<e;s++){const l=new Uint8Array(t.view.buffer,t.view.byteOffset+t.offset,i[s]);r[s]?(n[s]=new Uint8Array(r[s]+i[s]),n[s].set(n[s-1].subarray(0,r[s])),n[s].set(l,r[s])):n[s]=l,t.offset+=i[s]}}function Ap(t){return 32-Math.clz32(t)}function Va(t,e,n,r){n||(n=t.view.getUint32(t.offset,!0),t.offset+=4);let i=0;for(;i<r.length;){const s=$o(t);if(s&1)i=tJ(t,s,e,r,i);else{const l=s>>>1;eJ(t,l,e,r,i),i+=l}}}function eJ(t,e,n,r,i){const s=n+7>>3;let l=0;for(let c=0;c<s;c++)l|=t.view.getUint8(t.offset++)<<(c<<3);for(let c=0;c<e;c++)r[i+c]=l}function tJ(t,e,n,r,i){let s=e>>1<<3;const l=(1<<n)-1;let c=0;if(t.offset<t.view.byteLength)c=t.view.getUint8(t.offset++);else if(l)throw new Error(`parquet bitpack offset ${t.offset} out of range`);let f=8,d=0;for(;s;)d>8?(d-=8,f-=8,c>>>=8):f-d<n?(c|=t.view.getUint8(t.offset)<<f,t.offset++,f+=8):(i<r.length&&(r[i++]=c>>d&l),s--,d+=n);return i}function AP(t,e,n,r){const i=nJ(n,r),s=new Uint8Array(e*i);for(let l=0;l<i;l++)for(let c=0;c<e;c++)s[c*i+l]=t.view.getUint8(t.offset++);if(n==="FLOAT")return new Float32Array(s.buffer);if(n==="DOUBLE")return new Float64Array(s.buffer);if(n==="INT32")return new Int32Array(s.buffer);if(n==="INT64")return new BigInt64Array(s.buffer);if(n==="FIXED_LEN_BYTE_ARRAY"){const l=new Array(e);for(let c=0;c<e;c++)l[c]=s.subarray(c*i,(c+1)*i);return l}throw new Error(`parquet byte_stream_split unsupported type: ${n}`)}function nJ(t,e){switch(t){case"INT32":case"FLOAT":return 4;case"INT64":case"DOUBLE":return 8;case"FIXED_LEN_BYTE_ARRAY":if(!e)throw new Error("parquet byteWidth missing type_length");return e;default:throw new Error(`parquet unsupported type: ${t}`)}}function jb(t,e,n,r){if(n===0)return[];if(e==="BOOLEAN")return rJ(t,n);if(e==="INT32")return iJ(t,n);if(e==="INT64")return sJ(t,n);if(e==="INT96")return aJ(t,n);if(e==="FLOAT")return oJ(t,n);if(e==="DOUBLE")return lJ(t,n);if(e==="BYTE_ARRAY")return cJ(t,n);if(e==="FIXED_LEN_BYTE_ARRAY"){if(!r)throw new Error("parquet missing fixed length");return uJ(t,n,r)}else throw new Error(`parquet unhandled type: ${e}`)}function rJ(t,e){const n=new Array(e);for(let r=0;r<e;r++){const i=t.offset+(r/8|0),s=r%8,l=t.view.getUint8(i);n[r]=(l&1<<s)!==0}return t.offset+=Math.ceil(e/8),n}function iJ(t,e){const n=(t.view.byteOffset+t.offset)%4?new Int32Array(Cp(t.view.buffer,t.view.byteOffset+t.offset,e*4)):new Int32Array(t.view.buffer,t.view.byteOffset+t.offset,e);return t.offset+=e*4,n}function sJ(t,e){const n=(t.view.byteOffset+t.offset)%8?new BigInt64Array(Cp(t.view.buffer,t.view.byteOffset+t.offset,e*8)):new BigInt64Array(t.view.buffer,t.view.byteOffset+t.offset,e);return t.offset+=e*8,n}function aJ(t,e){const n=new Array(e);for(let r=0;r<e;r++){const i=t.view.getBigInt64(t.offset+r*12,!0),s=t.view.getInt32(t.offset+r*12+8,!0);n[r]=BigInt(s)<<64n|i}return t.offset+=e*12,n}function oJ(t,e){const n=(t.view.byteOffset+t.offset)%4?new Float32Array(Cp(t.view.buffer,t.view.byteOffset+t.offset,e*4)):new Float32Array(t.view.buffer,t.view.byteOffset+t.offset,e);return t.offset+=e*4,n}function lJ(t,e){const n=(t.view.byteOffset+t.offset)%8?new Float64Array(Cp(t.view.buffer,t.view.byteOffset+t.offset,e*8)):new Float64Array(t.view.buffer,t.view.byteOffset+t.offset,e);return t.offset+=e*8,n}function cJ(t,e){const n=new Array(e);for(let r=0;r<e;r++){const i=t.view.getInt32(t.offset,!0);t.offset+=4,n[r]=new Uint8Array(t.view.buffer,t.view.byteOffset+t.offset,i),t.offset+=i}return n}function uJ(t,e,n){const r=new Array(e);for(let i=0;i<e;i++)r[i]=new Uint8Array(t.view.buffer,t.view.byteOffset+t.offset,n),t.offset+=n;return r}function Cp(t,e,n){const r=new ArrayBuffer(n);return new Uint8Array(r).set(new Uint8Array(t,e,n)),r}const fJ=[0,255,65535,16777215,4294967295];function dJ(t,e,n,r,i){for(let s=0;s<i;s++)n[r+s]=t[e+s]}function hJ(t,e,n,r){for(let i=0;i<r;i++)t[e+i]=t[e-n+i]}function gJ(t,e){const n=t.byteLength,r=e.byteLength;let i=0,s=0;for(;i<n;){const l=t[i];if(i++,l<128)break}if(r&&i>=n)throw new Error("invalid snappy length header");for(;i<n;){const l=t[i];let c=0;if(i++,i>=n)throw new Error("missing eof marker");if(l&3){let f=0;switch(l&3){case 1:c=(l>>>2&7)+4,f=t[i]+(l>>>5<<8),i++;break;case 2:if(n<=i+1)throw new Error("snappy error end of input");c=(l>>>2)+1,f=t[i]+(t[i+1]<<8),i+=2;break;case 3:if(n<=i+3)throw new Error("snappy error end of input");c=(l>>>2)+1,f=t[i]+(t[i+1]<<8)+(t[i+2]<<16)+(t[i+3]<<24),i+=4;break}if(f===0||isNaN(f))throw new Error(`invalid offset ${f} pos ${i} inputLength ${n}`);if(f>s)throw new Error("cannot copy from before start of buffer");hJ(e,s,f,c),s+=c}else{let f=(l>>>2)+1;if(f>60){if(i+3>=n)throw new Error("snappy error literal pos + 3 >= inputLength");const d=f-60;f=t[i]+(t[i+1]<<8)+(t[i+2]<<16)+(t[i+3]<<24),f=(f&fJ[d])+1,i+=d}if(i+f>n)throw new Error("snappy error literal exceeds input length");dJ(t,i,e,s,f),i+=f,s+=f}}if(s!==r)throw new Error("premature end of input")}function pJ(t,e,n,{type:r}){const i=new DataView(t.buffer,t.byteOffset,t.byteLength),s={view:i,offset:0};let l;const c=vJ(s,e,n),{definitionLevels:f,numNulls:d}=_J(s,e,n),g=e.num_values-d;if(e.encoding==="PLAIN"){const{type_length:m}=n[n.length-1].element;l=jb(s,r,g,m)}else if(e.encoding==="PLAIN_DICTIONARY"||e.encoding==="RLE_DICTIONARY"||e.encoding==="RLE"){const m=r==="BOOLEAN"?1:i.getUint8(s.offset++);m?(l=new Array(g),r==="BOOLEAN"?(Va(s,m,0,l),l=l.map(v=>!!v)):Va(s,m,i.byteLength-s.offset,l)):l=new Uint8Array(g)}else if(e.encoding==="BYTE_STREAM_SPLIT"){const{type_length:m}=n[n.length-1].element;l=AP(s,g,r,m)}else throw new Error(`parquet unsupported encoding: ${e.encoding}`);return{definitionLevels:f,repetitionLevels:c,dataPage:l}}function mJ(t,e,n,r){const s={view:new DataView(t.buffer,t.byteOffset,t.byteLength),offset:0};return jb(s,n.type,e.num_values,r)}function vJ(t,e,n){if(n.length>1){const r=yP(n);if(r){const i=new Array(e.num_values);return Va(t,Ap(r),0,i),i}}return[]}function _J(t,e,n){const r=zg(n);if(!r)return{definitionLevels:[],numNulls:0};const i=new Array(e.num_values);Va(t,Ap(r),0,i);let s=e.num_values;for(const l of i)l===r&&s--;return s===0&&(i.length=0),{definitionLevels:i,numNulls:s}}function Fy(t,e,n,r){let i;const s=r==null?void 0:r[n];if(n==="UNCOMPRESSED")i=t;else if(s)i=s(t,e);else if(n==="SNAPPY")i=new Uint8Array(e),gJ(t,i);else throw new Error(`parquet unsupported compression codec: ${n}`);if((i==null?void 0:i.length)!==e)throw new Error(`parquet decompressed page length ${i==null?void 0:i.length} does not match header ${e}`);return i}function yJ(t,e,n,r,i){const l={view:new DataView(t.buffer,t.byteOffset,t.byteLength),offset:0},{codec:c,type:f}=r,d=e.data_page_header_v2;if(!d)throw new Error("parquet data page header v2 is undefined");const g=bJ(l,d,n);l.offset=d.repetition_levels_byte_length;const m=SJ(l,d,n),v=e.uncompressed_page_size-d.definition_levels_byte_length-d.repetition_levels_byte_length;let S=t.subarray(l.offset);d.is_compressed!==!1&&(S=Fy(S,v,c,i));const E=new DataView(S.buffer,S.byteOffset,S.byteLength),w={view:E,offset:0};let b;const A=d.num_values-d.num_nulls;if(d.encoding==="PLAIN"){const{type_length:T}=n[n.length-1].element;b=jb(w,f,A,T)}else if(d.encoding==="RLE")b=new Array(A),Va(w,1,0,b),b=b.map(T=>!!T);else if(d.encoding==="PLAIN_DICTIONARY"||d.encoding==="RLE_DICTIONARY"){const T=E.getUint8(w.offset++);b=new Array(A),Va(w,T,v-1,b)}else if(d.encoding==="DELTA_BINARY_PACKED")b=f==="INT32"?new Int32Array(A):new BigInt64Array(A),$g(w,A,b);else if(d.encoding==="DELTA_LENGTH_BYTE_ARRAY")b=new Array(A),GG(w,A,b);else if(d.encoding==="DELTA_BYTE_ARRAY")b=new Array(A),JG(w,A,b);else if(d.encoding==="BYTE_STREAM_SPLIT"){const{type_length:T}=n[n.length-1].element;b=AP(l,A,f,T)}else throw new Error(`parquet unsupported encoding: ${d.encoding}`);return{definitionLevels:m,repetitionLevels:g,dataPage:b}}function bJ(t,e,n){const r=yP(n);if(!r)return[];const i=new Array(e.num_values);return Va(t,Ap(r),e.repetition_levels_byte_length,i),i}function SJ(t,e,n){const r=zg(n);if(r){const i=new Array(e.num_values);return Va(t,Ap(r),e.definition_levels_byte_length,i),i}}function ky(t,e){for(let r=0;r<e.length;r+=1e4)t.push(...e.slice(r,r+1e4))}async function wJ(t,e){return await fetch(t,{...e,method:"HEAD"}).then(n=>{if(!n.ok)throw new Error(`fetch head failed ${n.status}`);const r=n.headers.get("Content-Length");if(!r)throw new Error("missing content length");return parseInt(r)})}async function EJ({url:t,byteLength:e,requestInit:n}){e||(e=await wJ(t,n));let r;const i=n||{};return{byteLength:e,async slice(s,l){if(r)return r.then(g=>g.slice(s,l));const c=new Headers(i.headers),f=l===void 0?"":l-1;c.set("Range",`bytes=${s}-${f}`);const d=await fetch(t,{...i,headers:c});if(!d.ok||!d.body)throw new Error(`fetch failed ${d.status}`);if(d.status===200)return r=d.arrayBuffer(),r.then(g=>g.slice(s,l));if(d.status===206)return d.arrayBuffer();throw new Error(`fetch received unexpected status code ${d.status}`)}}}function TJ(t,e,n,r,{compressors:i,utf8:s}){const{element:l}=r[r.length-1];let c;const f=[],d=e!==void 0&&e>=0&&isFinite(e);for(;(!d||f.length<e)&&!(t.offset>=t.view.byteLength-1);){const g=AJ(t),m=new Uint8Array(t.view.buffer,t.view.byteOffset+t.offset,g.compressed_page_size);let v;if(g.type==="DATA_PAGE"){const S=g.data_page_header;if(!S)throw new Error("parquet data page header is undefined");const E=Fy(m,Number(g.uncompressed_page_size),n.codec,i),{definitionLevels:w,repetitionLevels:b,dataPage:A}=pJ(E,S,r,n);if(v=YC(A,c,l,S.encoding,s),b.length||w!=null&&w.length){const T=zg(r),C=r.map(({element:M})=>M.repetition_type);JC(f,w,b,v,C,T)}else{for(let T=2;T<r.length;T++)r[T].element.repetition_type!=="REQUIRED"&&(v=Array.from(v,C=>[C]));ky(f,v)}}else if(g.type==="DATA_PAGE_V2"){const S=g.data_page_header_v2;if(!S)throw new Error("parquet data page header v2 is undefined");const{definitionLevels:E,repetitionLevels:w,dataPage:b}=yJ(m,g,r,n,i);if(v=YC(b,c,l,S.encoding,s),w.length||E!=null&&E.length){const A=zg(r),T=r.map(({element:C})=>C.repetition_type);JC(f,E,w,v,T,A)}else ky(f,v)}else if(g.type==="DICTIONARY_PAGE"){const S=g.dictionary_page_header;if(!S)throw new Error("parquet dictionary page header is undefined");const E=Fy(m,Number(g.uncompressed_page_size),n.codec,i);c=mJ(E,S,n,l.type_length)}else throw new Error(`parquet unsupported page type: ${g.type}`);t.offset+=g.compressed_page_size}if(d){if(f.length<e)throw new Error(`parquet row data length ${f.length} does not match row group limit ${e}}`);f.length>e&&(f.length=e)}return f}function eR({dictionary_page_offset:t,data_page_offset:e,total_compressed_size:n}){let r=t;return(!r||e<r)&&(r=e),[r,r+n]}function AJ(t){const e=bP(t),n=gP[e.field_1],r=e.field_2,i=e.field_3,s=e.field_4,l=e.field_5&&{num_values:e.field_5.field_1,encoding:So[e.field_5.field_2],definition_level_encoding:So[e.field_5.field_3],repetition_level_encoding:So[e.field_5.field_4],statistics:e.field_5.field_5&&{max:e.field_5.field_5.field_1,min:e.field_5.field_5.field_2,null_count:e.field_5.field_5.field_3,distinct_count:e.field_5.field_5.field_4,max_value:e.field_5.field_5.field_5,min_value:e.field_5.field_5.field_6}},c=e.field_6,f=e.field_7&&{num_values:e.field_7.field_1,encoding:So[e.field_7.field_2],is_sorted:e.field_7.field_3},d=e.field_8&&{num_values:e.field_8.field_1,num_nulls:e.field_8.field_2,num_rows:e.field_8.field_3,encoding:So[e.field_8.field_4],definition_levels_byte_length:e.field_8.field_5,repetition_levels_byte_length:e.field_8.field_6,is_compressed:e.field_8.field_7===void 0?!0:e.field_8.field_7,statistics:e.field_8.field_8};return{type:n,uncompressed_page_size:r,compressed_page_size:i,crc:s,data_page_header:l,index_page_header:c,dictionary_page_header:f,data_page_header_v2:d}}async function CJ(t){if(!t.file)throw new Error("parquet file is required");if(t.metadata||(t.metadata=await KG(t.file)),!t.metadata)throw new Error("parquet metadata not found");const{metadata:e,onComplete:n,rowEnd:r}=t,i=t.rowStart||0,s=[];let l=0;for(const c of e.row_groups){const f=Number(c.num_rows);if(l+f>=i&&(r===void 0||l<r)){const d=r&&r-l,g=await RJ(t,c,l,d);if(n){const m=Math.max(i-l,0),v=r===void 0?void 0:r-l;ky(s,g.slice(m,v))}}l+=f}n&&n(s)}async function RJ(t,e,n,r){const{file:i,metadata:s,columns:l}=t;if(!s)throw new Error("parquet metadata not found");(r===void 0||r>e.num_rows)&&(r=Number(e.num_rows));let[c,f]=[i.byteLength,0];if(e.columns.forEach(({meta_data:E})=>{if(!E)throw new Error("parquet column metadata is undefined");if(l&&!l.includes(E.path_in_schema[0]))return;const[w,b]=eR(E).map(Number);c=Math.min(c,w),f=Math.max(f,b)}),c>=f&&(l!=null&&l.length))throw new Error(`parquet columns not found: ${l.join(", ")}`);let d;f-c<=1<<25&&(d=await i.slice(c,f));const g=[],{children:m}=ZC(s.schema,[])[0],v=new Map(m.map(E=>[E.element.name,CP(E)])),S=new Map;for(let E=0;E<e.columns.length;E++){const w=e.columns[E].meta_data;if(!w)throw new Error("parquet column metadata is undefined");const b=w.path_in_schema[0];if(l&&!l.includes(b))continue;const[A,T]=eR(w).map(Number),C=T-A;if(C>1<<30){console.warn(`parquet skipping huge column "${w.path_in_schema}" ${C.toLocaleString()} bytes`);continue}let M,x=0;d?(M=Promise.resolve(d),x=A-c):M=Promise.resolve(i.slice(A,T)),g.push(M.then(N=>{var j;const F=ZC(s.schema,w.path_in_schema),L={view:new DataView(N),offset:x};let I=TJ(L,r,w,F,t);const V=w.path_in_schema.join(".");S.set(V,I),I=void 0;const B=v.get(b);if(B!=null&&B.every(X=>S.has(X))&&(tf(S,F[1]),I=S.get(b),!I))throw new Error(`parquet column data not assembled: ${b}`);I&&((j=t.onChunk)==null||j.call(t,{columnName:b,columnData:I,rowStart:n,rowEnd:n+I.length}))}))}if(await Promise.all(g),t.onComplete){const E=new Array(r),w=m.map(T=>T.element.name).filter(T=>!l||l.includes(T)),b=l||w,A=b.map(T=>w.includes(T)?S.get(T):void 0);for(let T=0;T<r;T++)if(t.rowFormat==="object"){const C={};b.forEach((M,x)=>{var N;C[M]=(N=A[x])==null?void 0:N[T]}),E[T]=C}else E[T]=A.map(C=>C==null?void 0:C[T]);return E}return[]}function CP(t,e=[]){if(t.children.length)for(const n of t.children)CP(n,e);else e.push(t.path.join("."));return e}let Wb;await CJ({file:await EJ({url:"./f.parquet"}),onComplete:t=>Wb=t});const tR=Wb.map(t=>({id:t[0],x:t[1],y:t[2]})),xJ=mp().domain([0,10]).range([vg(0),vg(1)]);function MJ(){const[t,e]=_.useState(null),n=t&&Wb.find(s=>s[0]===t.object.id),r=t&&n[3].map((s,l)=>({...tR.find(c=>c.id===s),value:n[4][l]})),i=[new Lf({id:"deckgl-grid",data:tR,getPosition:s=>[s.x,s.y],getFillColor:[100,100,100,100],cellSize:505,extruded:!1,pickable:!0,autoHighlight:!0,highlightColor:[0,255,0],onClick:s=>e(s)}),new Lf({id:"clicked-grid",data:r,getPosition:s=>[s.x,s.y],getFillColor:s=>xJ(Number(s.value)).slice(4,-1).split(", ").map(Number),cellSize:505,extruded:!1})];return ar.jsx(ar.Fragment,{children:ar.jsx(dP,{initialViewState:{longitude:37.028,latitude:55.778,zoom:7},controller:!0,layers:i,getCursor:()=>"crosshair",children:ar.jsx(hP,{mapStyle:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",hash:!0})})})}const OJ=new YI,RP=new URL(window.location.href);console.log(RP.searchParams.get("page"));E6.createRoot(document.getElementById("root")).render(ar.jsx(_.StrictMode,{children:ar.jsxs(e6,{client:OJ,children:[RP.searchParams.get("page")=="2"?ar.jsx(MJ,{}):ar.jsx(LG,{}),ar.jsx(v6,{initialIsOpen:!1})]})}));export{By as g};