@ifc-lite/viewer 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{geometry.worker-DpnHtNr3.ts → geometry.worker-CiROVpKV.ts} +6 -9
- package/dist/assets/ifc-lite_bg-BQVS1Fh7.wasm +0 -0
- package/dist/assets/index-CvYpbxNF.js +728 -0
- package/dist/ifc-lite_bg.wasm +0 -0
- package/dist/index.html +1 -1
- package/package.json +9 -9
- package/public/ifc-lite_bg.wasm +0 -0
- package/src/components/viewer/Viewport.tsx +198 -66
- package/src/components/viewer/ViewportContainer.tsx +1 -1
- package/src/hooks/useIfc.ts +235 -20
- package/src/services/ifc-cache.ts +251 -0
- package/src/store.ts +55 -4
- package/tsconfig.json +5 -1
- package/vite.config.ts +15 -1
- package/dist/assets/ifc_lite_wasm_bg-Cd3m3f2h.wasm +0 -0
- package/dist/assets/index-Dzz3WVwq.js +0 -637
- package/dist/ifc_lite_wasm_bg.wasm +0 -0
- package/public/ifc_lite_wasm_bg.wasm +0 -0
|
@@ -0,0 +1,728 @@
|
|
|
1
|
+
function d1(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function Sd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ig={exports:{}},ml={},ag={exports:{}},ce={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var xi=Symbol.for("react.element"),f1=Symbol.for("react.portal"),h1=Symbol.for("react.fragment"),p1=Symbol.for("react.strict_mode"),m1=Symbol.for("react.profiler"),g1=Symbol.for("react.provider"),y1=Symbol.for("react.context"),v1=Symbol.for("react.forward_ref"),x1=Symbol.for("react.suspense"),w1=Symbol.for("react.memo"),b1=Symbol.for("react.lazy"),fh=Symbol.iterator;function S1(e){return e===null||typeof e!="object"?null:(e=fh&&e[fh]||e["@@iterator"],typeof e=="function"?e:null)}var lg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cg=Object.assign,ug={};function Zo(e,t,n){this.props=e,this.context=t,this.refs=ug,this.updater=n||lg}Zo.prototype.isReactComponent={};Zo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Zo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function dg(){}dg.prototype=Zo.prototype;function _d(e,t,n){this.props=e,this.context=t,this.refs=ug,this.updater=n||lg}var Cd=_d.prototype=new dg;Cd.constructor=_d;cg(Cd,Zo.prototype);Cd.isPureReactComponent=!0;var hh=Array.isArray,fg=Object.prototype.hasOwnProperty,Ed={current:null},hg={key:!0,ref:!0,__self:!0,__source:!0};function pg(e,t,n){var r,o={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)fg.call(t,r)&&!hg.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:xi,type:e,key:s,ref:i,props:o,_owner:Ed.current}}function _1(e,t){return{$$typeof:xi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Id(e){return typeof e=="object"&&e!==null&&e.$$typeof===xi}function C1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ph=/\/+/g;function lc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?C1(""+e.key):t.toString(36)}function ca(e,t,n,r,o){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case xi:case f1:i=!0}}if(i)return i=e,o=o(i),e=r===""?"."+lc(i,0):r,hh(o)?(n="",e!=null&&(n=e.replace(ph,"$&/")+"/"),ca(o,t,n,"",function(c){return c})):o!=null&&(Id(o)&&(o=_1(o,n+(!o.key||i&&i.key===o.key?"":(""+o.key).replace(ph,"$&/")+"/")+e)),t.push(o)),1;if(i=0,r=r===""?".":r+":",hh(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+lc(s,a);i+=ca(s,t,n,l,o)}else if(l=S1(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+lc(s,a++),i+=ca(s,t,n,l,o);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function zi(e,t,n){if(e==null)return e;var r=[],o=0;return ca(e,r,"","",function(s){return t.call(n,s,o++)}),r}function E1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var lt={current:null},ua={transition:null},I1={ReactCurrentDispatcher:lt,ReactCurrentBatchConfig:ua,ReactCurrentOwner:Ed};function mg(){throw Error("act(...) is not supported in production builds of React.")}ce.Children={map:zi,forEach:function(e,t,n){zi(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return zi(e,function(){t++}),t},toArray:function(e){return zi(e,function(t){return t})||[]},only:function(e){if(!Id(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ce.Component=Zo;ce.Fragment=h1;ce.Profiler=m1;ce.PureComponent=_d;ce.StrictMode=p1;ce.Suspense=x1;ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I1;ce.act=mg;ce.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=cg({},e.props),o=e.key,s=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,i=Ed.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)fg.call(t,l)&&!hg.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:xi,type:e.type,key:o,ref:s,props:r,_owner:i}};ce.createContext=function(e){return e={$$typeof:y1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:g1,_context:e},e.Consumer=e};ce.createElement=pg;ce.createFactory=function(e){var t=pg.bind(null,e);return t.type=e,t};ce.createRef=function(){return{current:null}};ce.forwardRef=function(e){return{$$typeof:v1,render:e}};ce.isValidElement=Id;ce.lazy=function(e){return{$$typeof:b1,_payload:{_status:-1,_result:e},_init:E1}};ce.memo=function(e,t){return{$$typeof:w1,type:e,compare:t===void 0?null:t}};ce.startTransition=function(e){var t=ua.transition;ua.transition={};try{e()}finally{ua.transition=t}};ce.unstable_act=mg;ce.useCallback=function(e,t){return lt.current.useCallback(e,t)};ce.useContext=function(e){return lt.current.useContext(e)};ce.useDebugValue=function(){};ce.useDeferredValue=function(e){return lt.current.useDeferredValue(e)};ce.useEffect=function(e,t){return lt.current.useEffect(e,t)};ce.useId=function(){return lt.current.useId()};ce.useImperativeHandle=function(e,t,n){return lt.current.useImperativeHandle(e,t,n)};ce.useInsertionEffect=function(e,t){return lt.current.useInsertionEffect(e,t)};ce.useLayoutEffect=function(e,t){return lt.current.useLayoutEffect(e,t)};ce.useMemo=function(e,t){return lt.current.useMemo(e,t)};ce.useReducer=function(e,t,n){return lt.current.useReducer(e,t,n)};ce.useRef=function(e){return lt.current.useRef(e)};ce.useState=function(e){return lt.current.useState(e)};ce.useSyncExternalStore=function(e,t,n){return lt.current.useSyncExternalStore(e,t,n)};ce.useTransition=function(){return lt.current.useTransition()};ce.version="18.3.1";ag.exports=ce;var g=ag.exports;const hn=Sd(g),kd=d1({__proto__:null,default:hn},[g]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var k1=g,M1=Symbol.for("react.element"),P1=Symbol.for("react.fragment"),R1=Object.prototype.hasOwnProperty,T1=k1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,N1={key:!0,ref:!0,__self:!0,__source:!0};function gg(e,t,n){var r,o={},s=null,i=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)R1.call(t,r)&&!N1.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:M1,type:e,key:s,ref:i,props:o,_owner:T1.current}}ml.Fragment=P1;ml.jsx=gg;ml.jsxs=gg;ig.exports=ml;var h=ig.exports,su={},yg={exports:{}},Tt={},vg={exports:{}},xg={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(k,T){var $=k.length;k.push(T);e:for(;0<$;){var ne=$-1>>>1,W=k[ne];if(0<o(W,T))k[ne]=T,k[$]=W,$=ne;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var T=k[0],$=k.pop();if($!==T){k[0]=$;e:for(var ne=0,W=k.length,Q=W>>>1;ne<Q;){var ee=2*(ne+1)-1,fe=k[ee],Re=ee+1,oe=k[Re];if(0>o(fe,$))Re<W&&0>o(oe,fe)?(k[ne]=oe,k[Re]=$,ne=Re):(k[ne]=fe,k[ee]=$,ne=ee);else if(Re<W&&0>o(oe,$))k[ne]=oe,k[Re]=$,ne=Re;else break e}}return T}function o(k,T){var $=k.sortIndex-T.sortIndex;return $!==0?$:k.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var l=[],c=[],u=1,d=null,f=3,y=!1,p=!1,x=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(k){for(var T=n(c);T!==null;){if(T.callback===null)r(c);else if(T.startTime<=k)r(c),T.sortIndex=T.expirationTime,t(l,T);else break;T=n(c)}}function S(k){if(x=!1,w(k),!p)if(n(l)!==null)p=!0,O(_);else{var T=n(c);T!==null&&V(S,T.startTime-k)}}function _(k,T){p=!1,x&&(x=!1,m(E),E=-1),y=!0;var $=f;try{for(w(T),d=n(l);d!==null&&(!(d.expirationTime>T)||k&&!N());){var ne=d.callback;if(typeof ne=="function"){d.callback=null,f=d.priorityLevel;var W=ne(d.expirationTime<=T);T=e.unstable_now(),typeof W=="function"?d.callback=W:d===n(l)&&r(l),w(T)}else r(l);d=n(l)}if(d!==null)var Q=!0;else{var ee=n(c);ee!==null&&V(S,ee.startTime-T),Q=!1}return Q}finally{d=null,f=$,y=!1}}var I=!1,C=null,E=-1,R=5,M=-1;function N(){return!(e.unstable_now()-M<R)}function A(){if(C!==null){var k=e.unstable_now();M=k;var T=!0;try{T=C(!0,k)}finally{T?j():(I=!1,C=null)}}else I=!1}var j;if(typeof v=="function")j=function(){v(A)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,F=L.port2;L.port1.onmessage=A,j=function(){F.postMessage(null)}}else j=function(){b(A,0)};function O(k){C=k,I||(I=!0,j())}function V(k,T){E=b(function(){k(e.unstable_now())},T)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(k){k.callback=null},e.unstable_continueExecution=function(){p||y||(p=!0,O(_))},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(k){switch(f){case 1:case 2:case 3:var T=3;break;default:T=f}var $=f;f=T;try{return k()}finally{f=$}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(k,T){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var $=f;f=k;try{return T()}finally{f=$}},e.unstable_scheduleCallback=function(k,T,$){var ne=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?ne+$:ne):$=ne,k){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=$+W,k={id:u++,callback:T,priorityLevel:k,startTime:$,expirationTime:W,sortIndex:-1},$>ne?(k.sortIndex=$,t(c,k),n(l)===null&&k===n(c)&&(x?(m(E),E=-1):x=!0,V(S,$-ne))):(k.sortIndex=W,t(l,k),p||y||(p=!0,O(_))),k},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(k){var T=f;return function(){var $=f;f=T;try{return k.apply(this,arguments)}finally{f=$}}}})(xg);vg.exports=xg;var A1=vg.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var z1=g,Rt=A1;function U(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var wg=new Set,Us={};function Xr(e,t){Lo(e,t),Lo(e+"Capture",t)}function Lo(e,t){for(Us[e]=t,e=0;e<t.length;e++)wg.add(t[e])}var zn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),iu=Object.prototype.hasOwnProperty,F1=/^[: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]*$/,mh={},gh={};function j1(e){return iu.call(gh,e)?!0:iu.call(mh,e)?!1:F1.test(e)?gh[e]=!0:(mh[e]=!0,!1)}function L1(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function O1(e,t,n,r){if(t===null||typeof t>"u"||L1(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ct(e,t,n,r,o,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var Ke={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ke[e]=new ct(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ke[t]=new ct(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ke[e]=new ct(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ke[e]=new ct(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ke[e]=new ct(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ke[e]=new ct(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ke[e]=new ct(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ke[e]=new ct(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ke[e]=new ct(e,5,!1,e.toLowerCase(),null,!1,!1)});var Md=/[\-:]([a-z])/g;function Pd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Md,Pd);Ke[t]=new ct(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Md,Pd);Ke[t]=new ct(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Md,Pd);Ke[t]=new ct(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ke[e]=new ct(e,1,!1,e.toLowerCase(),null,!1,!1)});Ke.xlinkHref=new ct("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ke[e]=new ct(e,1,!1,e.toLowerCase(),null,!0,!0)});function Rd(e,t,n,r){var o=Ke.hasOwnProperty(t)?Ke[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(O1(t,n,o,r)&&(n=null),r||o===null?j1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Dn=z1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Fi=Symbol.for("react.element"),mo=Symbol.for("react.portal"),go=Symbol.for("react.fragment"),Td=Symbol.for("react.strict_mode"),au=Symbol.for("react.profiler"),bg=Symbol.for("react.provider"),Sg=Symbol.for("react.context"),Nd=Symbol.for("react.forward_ref"),lu=Symbol.for("react.suspense"),cu=Symbol.for("react.suspense_list"),Ad=Symbol.for("react.memo"),Kn=Symbol.for("react.lazy"),_g=Symbol.for("react.offscreen"),yh=Symbol.iterator;function cs(e){return e===null||typeof e!="object"?null:(e=yh&&e[yh]||e["@@iterator"],typeof e=="function"?e:null)}var Fe=Object.assign,cc;function xs(e){if(cc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);cc=t&&t[1]||""}return`
|
|
34
|
+
`+cc+e}var uc=!1;function dc(e,t){if(!e||uc)return"";uc=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
|
|
35
|
+
`),s=r.stack.split(`
|
|
36
|
+
`),i=o.length-1,a=s.length-1;1<=i&&0<=a&&o[i]!==s[a];)a--;for(;1<=i&&0<=a;i--,a--)if(o[i]!==s[a]){if(i!==1||a!==1)do if(i--,a--,0>a||o[i]!==s[a]){var l=`
|
|
37
|
+
`+o[i].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=i&&0<=a);break}}}finally{uc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?xs(e):""}function B1(e){switch(e.tag){case 5:return xs(e.type);case 16:return xs("Lazy");case 13:return xs("Suspense");case 19:return xs("SuspenseList");case 0:case 2:case 15:return e=dc(e.type,!1),e;case 11:return e=dc(e.type.render,!1),e;case 1:return e=dc(e.type,!0),e;default:return""}}function uu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case go:return"Fragment";case mo:return"Portal";case au:return"Profiler";case Td:return"StrictMode";case lu:return"Suspense";case cu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Sg:return(e.displayName||"Context")+".Consumer";case bg:return(e._context.displayName||"Context")+".Provider";case Nd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ad:return t=e.displayName||null,t!==null?t:uu(e.type)||"Memo";case Kn:t=e._payload,e=e._init;try{return uu(e(t))}catch{}}return null}function D1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return uu(t);case 8:return t===Td?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function hr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Cg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function U1(e){var t=Cg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ji(e){e._valueTracker||(e._valueTracker=U1(e))}function Eg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Cg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ta(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function du(e,t){var n=t.checked;return Fe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function vh(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=hr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ig(e,t){t=t.checked,t!=null&&Rd(e,"checked",t,!1)}function fu(e,t){Ig(e,t);var n=hr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?hu(e,t.type,n):t.hasOwnProperty("defaultValue")&&hu(e,t.type,hr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function xh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function hu(e,t,n){(t!=="number"||Ta(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ws=Array.isArray;function Mo(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+hr(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function pu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(U(91));return Fe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function wh(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(U(92));if(ws(n)){if(1<n.length)throw Error(U(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:hr(n)}}function kg(e,t){var n=hr(t.value),r=hr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function bh(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Mg(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function mu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Mg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Li,Pg=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Li=Li||document.createElement("div"),Li.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Li.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function $s(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ms={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$1=["Webkit","ms","Moz","O"];Object.keys(Ms).forEach(function(e){$1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ms[t]=Ms[e]})});function Rg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ms.hasOwnProperty(e)&&Ms[e]?(""+t).trim():t+"px"}function Tg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Rg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var V1=Fe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function gu(e,t){if(t){if(V1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(U(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(U(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(U(61))}if(t.style!=null&&typeof t.style!="object")throw Error(U(62))}}function yu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var vu=null;function zd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xu=null,Po=null,Ro=null;function Sh(e){if(e=Si(e)){if(typeof xu!="function")throw Error(U(280));var t=e.stateNode;t&&(t=wl(t),xu(e.stateNode,e.type,t))}}function Ng(e){Po?Ro?Ro.push(e):Ro=[e]:Po=e}function Ag(){if(Po){var e=Po,t=Ro;if(Ro=Po=null,Sh(e),t)for(e=0;e<t.length;e++)Sh(t[e])}}function zg(e,t){return e(t)}function Fg(){}var fc=!1;function jg(e,t,n){if(fc)return e(t,n);fc=!0;try{return zg(e,t,n)}finally{fc=!1,(Po!==null||Ro!==null)&&(Fg(),Ag())}}function Vs(e,t){var n=e.stateNode;if(n===null)return null;var r=wl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(U(231,t,typeof n));return n}var wu=!1;if(zn)try{var us={};Object.defineProperty(us,"passive",{get:function(){wu=!0}}),window.addEventListener("test",us,us),window.removeEventListener("test",us,us)}catch{wu=!1}function G1(e,t,n,r,o,s,i,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Ps=!1,Na=null,Aa=!1,bu=null,W1={onError:function(e){Ps=!0,Na=e}};function H1(e,t,n,r,o,s,i,a,l){Ps=!1,Na=null,G1.apply(W1,arguments)}function Y1(e,t,n,r,o,s,i,a,l){if(H1.apply(this,arguments),Ps){if(Ps){var c=Na;Ps=!1,Na=null}else throw Error(U(198));Aa||(Aa=!0,bu=c)}}function Qr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Lg(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function _h(e){if(Qr(e)!==e)throw Error(U(188))}function q1(e){var t=e.alternate;if(!t){if(t=Qr(e),t===null)throw Error(U(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var s=o.alternate;if(s===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===n)return _h(o),e;if(s===r)return _h(o),t;s=s.sibling}throw Error(U(188))}if(n.return!==r.return)n=o,r=s;else{for(var i=!1,a=o.child;a;){if(a===n){i=!0,n=o,r=s;break}if(a===r){i=!0,r=o,n=s;break}a=a.sibling}if(!i){for(a=s.child;a;){if(a===n){i=!0,n=s,r=o;break}if(a===r){i=!0,r=s,n=o;break}a=a.sibling}if(!i)throw Error(U(189))}}if(n.alternate!==r)throw Error(U(190))}if(n.tag!==3)throw Error(U(188));return n.stateNode.current===n?e:t}function Og(e){return e=q1(e),e!==null?Bg(e):null}function Bg(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Bg(e);if(t!==null)return t;e=e.sibling}return null}var Dg=Rt.unstable_scheduleCallback,Ch=Rt.unstable_cancelCallback,X1=Rt.unstable_shouldYield,Q1=Rt.unstable_requestPaint,De=Rt.unstable_now,K1=Rt.unstable_getCurrentPriorityLevel,Fd=Rt.unstable_ImmediatePriority,Ug=Rt.unstable_UserBlockingPriority,za=Rt.unstable_NormalPriority,Z1=Rt.unstable_LowPriority,$g=Rt.unstable_IdlePriority,gl=null,yn=null;function J1(e){if(yn&&typeof yn.onCommitFiberRoot=="function")try{yn.onCommitFiberRoot(gl,e,void 0,(e.current.flags&128)===128)}catch{}}var rn=Math.clz32?Math.clz32:nb,eb=Math.log,tb=Math.LN2;function nb(e){return e>>>=0,e===0?32:31-(eb(e)/tb|0)|0}var Oi=64,Bi=4194304;function bs(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fa(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~o;a!==0?r=bs(a):(s&=i,s!==0&&(r=bs(s)))}else i=n&~o,i!==0?r=bs(i):s!==0&&(r=bs(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-rn(t),o=1<<n,r|=e[n],t&=~o;return r}function rb(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ob(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,s=e.pendingLanes;0<s;){var i=31-rn(s),a=1<<i,l=o[i];l===-1?(!(a&n)||a&r)&&(o[i]=rb(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function Su(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Vg(){var e=Oi;return Oi<<=1,!(Oi&4194240)&&(Oi=64),e}function hc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function wi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-rn(t),e[t]=n}function sb(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-rn(n),s=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~s}}function jd(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-rn(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var we=0;function Gg(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Wg,Ld,Hg,Yg,qg,_u=!1,Di=[],sr=null,ir=null,ar=null,Gs=new Map,Ws=new Map,er=[],ib="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Eh(e,t){switch(e){case"focusin":case"focusout":sr=null;break;case"dragenter":case"dragleave":ir=null;break;case"mouseover":case"mouseout":ar=null;break;case"pointerover":case"pointerout":Gs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ws.delete(t.pointerId)}}function ds(e,t,n,r,o,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[o]},t!==null&&(t=Si(t),t!==null&&Ld(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function ab(e,t,n,r,o){switch(t){case"focusin":return sr=ds(sr,e,t,n,r,o),!0;case"dragenter":return ir=ds(ir,e,t,n,r,o),!0;case"mouseover":return ar=ds(ar,e,t,n,r,o),!0;case"pointerover":var s=o.pointerId;return Gs.set(s,ds(Gs.get(s)||null,e,t,n,r,o)),!0;case"gotpointercapture":return s=o.pointerId,Ws.set(s,ds(Ws.get(s)||null,e,t,n,r,o)),!0}return!1}function Xg(e){var t=Ar(e.target);if(t!==null){var n=Qr(t);if(n!==null){if(t=n.tag,t===13){if(t=Lg(n),t!==null){e.blockedOn=t,qg(e.priority,function(){Hg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function da(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);vu=r,n.target.dispatchEvent(r),vu=null}else return t=Si(n),t!==null&&Ld(t),e.blockedOn=n,!1;t.shift()}return!0}function Ih(e,t,n){da(e)&&n.delete(t)}function lb(){_u=!1,sr!==null&&da(sr)&&(sr=null),ir!==null&&da(ir)&&(ir=null),ar!==null&&da(ar)&&(ar=null),Gs.forEach(Ih),Ws.forEach(Ih)}function fs(e,t){e.blockedOn===t&&(e.blockedOn=null,_u||(_u=!0,Rt.unstable_scheduleCallback(Rt.unstable_NormalPriority,lb)))}function Hs(e){function t(o){return fs(o,e)}if(0<Di.length){fs(Di[0],e);for(var n=1;n<Di.length;n++){var r=Di[n];r.blockedOn===e&&(r.blockedOn=null)}}for(sr!==null&&fs(sr,e),ir!==null&&fs(ir,e),ar!==null&&fs(ar,e),Gs.forEach(t),Ws.forEach(t),n=0;n<er.length;n++)r=er[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<er.length&&(n=er[0],n.blockedOn===null);)Xg(n),n.blockedOn===null&&er.shift()}var To=Dn.ReactCurrentBatchConfig,ja=!0;function cb(e,t,n,r){var o=we,s=To.transition;To.transition=null;try{we=1,Od(e,t,n,r)}finally{we=o,To.transition=s}}function ub(e,t,n,r){var o=we,s=To.transition;To.transition=null;try{we=4,Od(e,t,n,r)}finally{we=o,To.transition=s}}function Od(e,t,n,r){if(ja){var o=Cu(e,t,n,r);if(o===null)_c(e,t,r,La,n),Eh(e,r);else if(ab(o,e,t,n,r))r.stopPropagation();else if(Eh(e,r),t&4&&-1<ib.indexOf(e)){for(;o!==null;){var s=Si(o);if(s!==null&&Wg(s),s=Cu(e,t,n,r),s===null&&_c(e,t,r,La,n),s===o)break;o=s}o!==null&&r.stopPropagation()}else _c(e,t,r,null,n)}}var La=null;function Cu(e,t,n,r){if(La=null,e=zd(r),e=Ar(e),e!==null)if(t=Qr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Lg(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return La=e,null}function Qg(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(K1()){case Fd:return 1;case Ug:return 4;case za:case Z1:return 16;case $g:return 536870912;default:return 16}default:return 16}}var nr=null,Bd=null,fa=null;function Kg(){if(fa)return fa;var e,t=Bd,n=t.length,r,o="value"in nr?nr.value:nr.textContent,s=o.length;for(e=0;e<n&&t[e]===o[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===o[s-r];r++);return fa=o.slice(e,1<r?1-r:void 0)}function ha(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ui(){return!0}function kh(){return!1}function Nt(e){function t(n,r,o,s,i){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=s,this.target=i,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Ui:kh,this.isPropagationStopped=kh,this}return Fe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ui)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ui)},persist:function(){},isPersistent:Ui}),t}var Jo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dd=Nt(Jo),bi=Fe({},Jo,{view:0,detail:0}),db=Nt(bi),pc,mc,hs,yl=Fe({},bi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ud,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==hs&&(hs&&e.type==="mousemove"?(pc=e.screenX-hs.screenX,mc=e.screenY-hs.screenY):mc=pc=0,hs=e),pc)},movementY:function(e){return"movementY"in e?e.movementY:mc}}),Mh=Nt(yl),fb=Fe({},yl,{dataTransfer:0}),hb=Nt(fb),pb=Fe({},bi,{relatedTarget:0}),gc=Nt(pb),mb=Fe({},Jo,{animationName:0,elapsedTime:0,pseudoElement:0}),gb=Nt(mb),yb=Fe({},Jo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vb=Nt(yb),xb=Fe({},Jo,{data:0}),Ph=Nt(xb),wb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bb={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"},Sb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _b(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Sb[e])?!!t[e]:!1}function Ud(){return _b}var Cb=Fe({},bi,{key:function(e){if(e.key){var t=wb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ha(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?bb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ud,charCode:function(e){return e.type==="keypress"?ha(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ha(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Eb=Nt(Cb),Ib=Fe({},yl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rh=Nt(Ib),kb=Fe({},bi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ud}),Mb=Nt(kb),Pb=Fe({},Jo,{propertyName:0,elapsedTime:0,pseudoElement:0}),Rb=Nt(Pb),Tb=Fe({},yl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Nb=Nt(Tb),Ab=[9,13,27,32],$d=zn&&"CompositionEvent"in window,Rs=null;zn&&"documentMode"in document&&(Rs=document.documentMode);var zb=zn&&"TextEvent"in window&&!Rs,Zg=zn&&(!$d||Rs&&8<Rs&&11>=Rs),Th=" ",Nh=!1;function Jg(e,t){switch(e){case"keyup":return Ab.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ey(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yo=!1;function Fb(e,t){switch(e){case"compositionend":return ey(t);case"keypress":return t.which!==32?null:(Nh=!0,Th);case"textInput":return e=t.data,e===Th&&Nh?null:e;default:return null}}function jb(e,t){if(yo)return e==="compositionend"||!$d&&Jg(e,t)?(e=Kg(),fa=Bd=nr=null,yo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Zg&&t.locale!=="ko"?null:t.data;default:return null}}var Lb={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 Ah(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lb[e.type]:t==="textarea"}function ty(e,t,n,r){Ng(r),t=Oa(t,"onChange"),0<t.length&&(n=new Dd("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ts=null,Ys=null;function Ob(e){fy(e,0)}function vl(e){var t=wo(e);if(Eg(t))return e}function Bb(e,t){if(e==="change")return t}var ny=!1;if(zn){var yc;if(zn){var vc="oninput"in document;if(!vc){var zh=document.createElement("div");zh.setAttribute("oninput","return;"),vc=typeof zh.oninput=="function"}yc=vc}else yc=!1;ny=yc&&(!document.documentMode||9<document.documentMode)}function Fh(){Ts&&(Ts.detachEvent("onpropertychange",ry),Ys=Ts=null)}function ry(e){if(e.propertyName==="value"&&vl(Ys)){var t=[];ty(t,Ys,e,zd(e)),jg(Ob,t)}}function Db(e,t,n){e==="focusin"?(Fh(),Ts=t,Ys=n,Ts.attachEvent("onpropertychange",ry)):e==="focusout"&&Fh()}function Ub(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return vl(Ys)}function $b(e,t){if(e==="click")return vl(t)}function Vb(e,t){if(e==="input"||e==="change")return vl(t)}function Gb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sn=typeof Object.is=="function"?Object.is:Gb;function qs(e,t){if(sn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!iu.call(t,o)||!sn(e[o],t[o]))return!1}return!0}function jh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lh(e,t){var n=jh(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=jh(n)}}function oy(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?oy(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function sy(){for(var e=window,t=Ta();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ta(e.document)}return t}function Vd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Wb(e){var t=sy(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&oy(n.ownerDocument.documentElement,n)){if(r!==null&&Vd(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=Lh(n,s);var i=Lh(n,r);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Hb=zn&&"documentMode"in document&&11>=document.documentMode,vo=null,Eu=null,Ns=null,Iu=!1;function Oh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Iu||vo==null||vo!==Ta(r)||(r=vo,"selectionStart"in r&&Vd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ns&&qs(Ns,r)||(Ns=r,r=Oa(Eu,"onSelect"),0<r.length&&(t=new Dd("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=vo)))}function $i(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var xo={animationend:$i("Animation","AnimationEnd"),animationiteration:$i("Animation","AnimationIteration"),animationstart:$i("Animation","AnimationStart"),transitionend:$i("Transition","TransitionEnd")},xc={},iy={};zn&&(iy=document.createElement("div").style,"AnimationEvent"in window||(delete xo.animationend.animation,delete xo.animationiteration.animation,delete xo.animationstart.animation),"TransitionEvent"in window||delete xo.transitionend.transition);function xl(e){if(xc[e])return xc[e];if(!xo[e])return e;var t=xo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in iy)return xc[e]=t[n];return e}var ay=xl("animationend"),ly=xl("animationiteration"),cy=xl("animationstart"),uy=xl("transitionend"),dy=new Map,Bh="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yr(e,t){dy.set(e,t),Xr(t,[e])}for(var wc=0;wc<Bh.length;wc++){var bc=Bh[wc],Yb=bc.toLowerCase(),qb=bc[0].toUpperCase()+bc.slice(1);yr(Yb,"on"+qb)}yr(ay,"onAnimationEnd");yr(ly,"onAnimationIteration");yr(cy,"onAnimationStart");yr("dblclick","onDoubleClick");yr("focusin","onFocus");yr("focusout","onBlur");yr(uy,"onTransitionEnd");Lo("onMouseEnter",["mouseout","mouseover"]);Lo("onMouseLeave",["mouseout","mouseover"]);Lo("onPointerEnter",["pointerout","pointerover"]);Lo("onPointerLeave",["pointerout","pointerover"]);Xr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Xr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Xr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Xr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Xr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Xr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ss="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(" "),Xb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ss));function Dh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Y1(r,t,void 0,e),e.currentTarget=null}function fy(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var i=r.length-1;0<=i;i--){var a=r[i],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&o.isPropagationStopped())break e;Dh(o,a,c),s=l}else for(i=0;i<r.length;i++){if(a=r[i],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&o.isPropagationStopped())break e;Dh(o,a,c),s=l}}}if(Aa)throw e=bu,Aa=!1,bu=null,e}function Me(e,t){var n=t[Tu];n===void 0&&(n=t[Tu]=new Set);var r=e+"__bubble";n.has(r)||(hy(t,e,2,!1),n.add(r))}function Sc(e,t,n){var r=0;t&&(r|=4),hy(n,e,r,t)}var Vi="_reactListening"+Math.random().toString(36).slice(2);function Xs(e){if(!e[Vi]){e[Vi]=!0,wg.forEach(function(n){n!=="selectionchange"&&(Xb.has(n)||Sc(n,!1,e),Sc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Vi]||(t[Vi]=!0,Sc("selectionchange",!1,t))}}function hy(e,t,n,r){switch(Qg(t)){case 1:var o=cb;break;case 4:o=ub;break;default:o=Od}n=o.bind(null,t,n,e),o=void 0,!wu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function _c(e,t,n,r,o){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(i===4)for(i=r.return;i!==null;){var l=i.tag;if((l===3||l===4)&&(l=i.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;i=i.return}for(;a!==null;){if(i=Ar(a),i===null)return;if(l=i.tag,l===5||l===6){r=s=i;continue e}a=a.parentNode}}r=r.return}jg(function(){var c=s,u=zd(n),d=[];e:{var f=dy.get(e);if(f!==void 0){var y=Dd,p=e;switch(e){case"keypress":if(ha(n)===0)break e;case"keydown":case"keyup":y=Eb;break;case"focusin":p="focus",y=gc;break;case"focusout":p="blur",y=gc;break;case"beforeblur":case"afterblur":y=gc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=Mh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=hb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=Mb;break;case ay:case ly:case cy:y=gb;break;case uy:y=Rb;break;case"scroll":y=db;break;case"wheel":y=Nb;break;case"copy":case"cut":case"paste":y=vb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=Rh}var x=(t&4)!==0,b=!x&&e==="scroll",m=x?f!==null?f+"Capture":null:f;x=[];for(var v=c,w;v!==null;){w=v;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,m!==null&&(S=Vs(v,m),S!=null&&x.push(Qs(v,S,w)))),b)break;v=v.return}0<x.length&&(f=new y(f,p,null,n,u),d.push({event:f,listeners:x}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",f&&n!==vu&&(p=n.relatedTarget||n.fromElement)&&(Ar(p)||p[Fn]))break e;if((y||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,y?(p=n.relatedTarget||n.toElement,y=c,p=p?Ar(p):null,p!==null&&(b=Qr(p),p!==b||p.tag!==5&&p.tag!==6)&&(p=null)):(y=null,p=c),y!==p)){if(x=Mh,S="onMouseLeave",m="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(x=Rh,S="onPointerLeave",m="onPointerEnter",v="pointer"),b=y==null?f:wo(y),w=p==null?f:wo(p),f=new x(S,v+"leave",y,n,u),f.target=b,f.relatedTarget=w,S=null,Ar(u)===c&&(x=new x(m,v+"enter",p,n,u),x.target=w,x.relatedTarget=b,S=x),b=S,y&&p)t:{for(x=y,m=p,v=0,w=x;w;w=ro(w))v++;for(w=0,S=m;S;S=ro(S))w++;for(;0<v-w;)x=ro(x),v--;for(;0<w-v;)m=ro(m),w--;for(;v--;){if(x===m||m!==null&&x===m.alternate)break t;x=ro(x),m=ro(m)}x=null}else x=null;y!==null&&Uh(d,f,y,x,!1),p!==null&&b!==null&&Uh(d,b,p,x,!0)}}e:{if(f=c?wo(c):window,y=f.nodeName&&f.nodeName.toLowerCase(),y==="select"||y==="input"&&f.type==="file")var _=Bb;else if(Ah(f))if(ny)_=Vb;else{_=Ub;var I=Db}else(y=f.nodeName)&&y.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(_=$b);if(_&&(_=_(e,c))){ty(d,_,n,u);break e}I&&I(e,f,c),e==="focusout"&&(I=f._wrapperState)&&I.controlled&&f.type==="number"&&hu(f,"number",f.value)}switch(I=c?wo(c):window,e){case"focusin":(Ah(I)||I.contentEditable==="true")&&(vo=I,Eu=c,Ns=null);break;case"focusout":Ns=Eu=vo=null;break;case"mousedown":Iu=!0;break;case"contextmenu":case"mouseup":case"dragend":Iu=!1,Oh(d,n,u);break;case"selectionchange":if(Hb)break;case"keydown":case"keyup":Oh(d,n,u)}var C;if($d)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else yo?Jg(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(Zg&&n.locale!=="ko"&&(yo||E!=="onCompositionStart"?E==="onCompositionEnd"&&yo&&(C=Kg()):(nr=u,Bd="value"in nr?nr.value:nr.textContent,yo=!0)),I=Oa(c,E),0<I.length&&(E=new Ph(E,e,null,n,u),d.push({event:E,listeners:I}),C?E.data=C:(C=ey(n),C!==null&&(E.data=C)))),(C=zb?Fb(e,n):jb(e,n))&&(c=Oa(c,"onBeforeInput"),0<c.length&&(u=new Ph("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=C))}fy(d,t)})}function Qs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Oa(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,s=o.stateNode;o.tag===5&&s!==null&&(o=s,s=Vs(e,n),s!=null&&r.unshift(Qs(e,s,o)),s=Vs(e,t),s!=null&&r.push(Qs(e,s,o))),e=e.return}return r}function ro(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Uh(e,t,n,r,o){for(var s=t._reactName,i=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,o?(l=Vs(n,s),l!=null&&i.unshift(Qs(n,l,a))):o||(l=Vs(n,s),l!=null&&i.push(Qs(n,l,a)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var Qb=/\r\n?/g,Kb=/\u0000|\uFFFD/g;function $h(e){return(typeof e=="string"?e:""+e).replace(Qb,`
|
|
38
|
+
`).replace(Kb,"")}function Gi(e,t,n){if(t=$h(t),$h(e)!==t&&n)throw Error(U(425))}function Ba(){}var ku=null,Mu=null;function Pu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ru=typeof setTimeout=="function"?setTimeout:void 0,Zb=typeof clearTimeout=="function"?clearTimeout:void 0,Vh=typeof Promise=="function"?Promise:void 0,Jb=typeof queueMicrotask=="function"?queueMicrotask:typeof Vh<"u"?function(e){return Vh.resolve(null).then(e).catch(eS)}:Ru;function eS(e){setTimeout(function(){throw e})}function Cc(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Hs(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Hs(t)}function lr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Gh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var es=Math.random().toString(36).slice(2),pn="__reactFiber$"+es,Ks="__reactProps$"+es,Fn="__reactContainer$"+es,Tu="__reactEvents$"+es,tS="__reactListeners$"+es,nS="__reactHandles$"+es;function Ar(e){var t=e[pn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Fn]||n[pn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Gh(e);e!==null;){if(n=e[pn])return n;e=Gh(e)}return t}e=n,n=e.parentNode}return null}function Si(e){return e=e[pn]||e[Fn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function wo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(U(33))}function wl(e){return e[Ks]||null}var Nu=[],bo=-1;function vr(e){return{current:e}}function Pe(e){0>bo||(e.current=Nu[bo],Nu[bo]=null,bo--)}function Ee(e,t){bo++,Nu[bo]=e.current,e.current=t}var pr={},rt=vr(pr),vt=vr(!1),Dr=pr;function Oo(e,t){var n=e.type.contextTypes;if(!n)return pr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function xt(e){return e=e.childContextTypes,e!=null}function Da(){Pe(vt),Pe(rt)}function Wh(e,t,n){if(rt.current!==pr)throw Error(U(168));Ee(rt,t),Ee(vt,n)}function py(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(U(108,D1(e)||"Unknown",o));return Fe({},n,r)}function Ua(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pr,Dr=rt.current,Ee(rt,e),Ee(vt,vt.current),!0}function Hh(e,t,n){var r=e.stateNode;if(!r)throw Error(U(169));n?(e=py(e,t,Dr),r.__reactInternalMemoizedMergedChildContext=e,Pe(vt),Pe(rt),Ee(rt,e)):Pe(vt),Ee(vt,n)}var Pn=null,bl=!1,Ec=!1;function my(e){Pn===null?Pn=[e]:Pn.push(e)}function rS(e){bl=!0,my(e)}function xr(){if(!Ec&&Pn!==null){Ec=!0;var e=0,t=we;try{var n=Pn;for(we=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Pn=null,bl=!1}catch(o){throw Pn!==null&&(Pn=Pn.slice(e+1)),Dg(Fd,xr),o}finally{we=t,Ec=!1}}return null}var So=[],_o=0,$a=null,Va=0,Dt=[],Ut=0,Ur=null,Tn=1,Nn="";function Pr(e,t){So[_o++]=Va,So[_o++]=$a,$a=e,Va=t}function gy(e,t,n){Dt[Ut++]=Tn,Dt[Ut++]=Nn,Dt[Ut++]=Ur,Ur=e;var r=Tn;e=Nn;var o=32-rn(r)-1;r&=~(1<<o),n+=1;var s=32-rn(t)+o;if(30<s){var i=o-o%5;s=(r&(1<<i)-1).toString(32),r>>=i,o-=i,Tn=1<<32-rn(t)+o|n<<o|r,Nn=s+e}else Tn=1<<s|n<<o|r,Nn=e}function Gd(e){e.return!==null&&(Pr(e,1),gy(e,1,0))}function Wd(e){for(;e===$a;)$a=So[--_o],So[_o]=null,Va=So[--_o],So[_o]=null;for(;e===Ur;)Ur=Dt[--Ut],Dt[Ut]=null,Nn=Dt[--Ut],Dt[Ut]=null,Tn=Dt[--Ut],Dt[Ut]=null}var Mt=null,kt=null,Ne=!1,en=null;function yy(e,t){var n=$t(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Yh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Mt=e,kt=lr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Mt=e,kt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ur!==null?{id:Tn,overflow:Nn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=$t(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Mt=e,kt=null,!0):!1;default:return!1}}function Au(e){return(e.mode&1)!==0&&(e.flags&128)===0}function zu(e){if(Ne){var t=kt;if(t){var n=t;if(!Yh(e,t)){if(Au(e))throw Error(U(418));t=lr(n.nextSibling);var r=Mt;t&&Yh(e,t)?yy(r,n):(e.flags=e.flags&-4097|2,Ne=!1,Mt=e)}}else{if(Au(e))throw Error(U(418));e.flags=e.flags&-4097|2,Ne=!1,Mt=e}}}function qh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Mt=e}function Wi(e){if(e!==Mt)return!1;if(!Ne)return qh(e),Ne=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Pu(e.type,e.memoizedProps)),t&&(t=kt)){if(Au(e))throw vy(),Error(U(418));for(;t;)yy(e,t),t=lr(t.nextSibling)}if(qh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(U(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){kt=lr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}kt=null}}else kt=Mt?lr(e.stateNode.nextSibling):null;return!0}function vy(){for(var e=kt;e;)e=lr(e.nextSibling)}function Bo(){kt=Mt=null,Ne=!1}function Hd(e){en===null?en=[e]:en.push(e)}var oS=Dn.ReactCurrentBatchConfig;function ps(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(U(309));var r=n.stateNode}if(!r)throw Error(U(147,e));var o=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(i){var a=o.refs;i===null?delete a[s]:a[s]=i},t._stringRef=s,t)}if(typeof e!="string")throw Error(U(284));if(!n._owner)throw Error(U(290,e))}return e}function Hi(e,t){throw e=Object.prototype.toString.call(t),Error(U(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Xh(e){var t=e._init;return t(e._payload)}function xy(e){function t(m,v){if(e){var w=m.deletions;w===null?(m.deletions=[v],m.flags|=16):w.push(v)}}function n(m,v){if(!e)return null;for(;v!==null;)t(m,v),v=v.sibling;return null}function r(m,v){for(m=new Map;v!==null;)v.key!==null?m.set(v.key,v):m.set(v.index,v),v=v.sibling;return m}function o(m,v){return m=fr(m,v),m.index=0,m.sibling=null,m}function s(m,v,w){return m.index=w,e?(w=m.alternate,w!==null?(w=w.index,w<v?(m.flags|=2,v):w):(m.flags|=2,v)):(m.flags|=1048576,v)}function i(m){return e&&m.alternate===null&&(m.flags|=2),m}function a(m,v,w,S){return v===null||v.tag!==6?(v=Nc(w,m.mode,S),v.return=m,v):(v=o(v,w),v.return=m,v)}function l(m,v,w,S){var _=w.type;return _===go?u(m,v,w.props.children,S,w.key):v!==null&&(v.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Kn&&Xh(_)===v.type)?(S=o(v,w.props),S.ref=ps(m,v,w),S.return=m,S):(S=wa(w.type,w.key,w.props,null,m.mode,S),S.ref=ps(m,v,w),S.return=m,S)}function c(m,v,w,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=Ac(w,m.mode,S),v.return=m,v):(v=o(v,w.children||[]),v.return=m,v)}function u(m,v,w,S,_){return v===null||v.tag!==7?(v=Lr(w,m.mode,S,_),v.return=m,v):(v=o(v,w),v.return=m,v)}function d(m,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Nc(""+v,m.mode,w),v.return=m,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Fi:return w=wa(v.type,v.key,v.props,null,m.mode,w),w.ref=ps(m,null,v),w.return=m,w;case mo:return v=Ac(v,m.mode,w),v.return=m,v;case Kn:var S=v._init;return d(m,S(v._payload),w)}if(ws(v)||cs(v))return v=Lr(v,m.mode,w,null),v.return=m,v;Hi(m,v)}return null}function f(m,v,w,S){var _=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return _!==null?null:a(m,v,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Fi:return w.key===_?l(m,v,w,S):null;case mo:return w.key===_?c(m,v,w,S):null;case Kn:return _=w._init,f(m,v,_(w._payload),S)}if(ws(w)||cs(w))return _!==null?null:u(m,v,w,S,null);Hi(m,w)}return null}function y(m,v,w,S,_){if(typeof S=="string"&&S!==""||typeof S=="number")return m=m.get(w)||null,a(v,m,""+S,_);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Fi:return m=m.get(S.key===null?w:S.key)||null,l(v,m,S,_);case mo:return m=m.get(S.key===null?w:S.key)||null,c(v,m,S,_);case Kn:var I=S._init;return y(m,v,w,I(S._payload),_)}if(ws(S)||cs(S))return m=m.get(w)||null,u(v,m,S,_,null);Hi(v,S)}return null}function p(m,v,w,S){for(var _=null,I=null,C=v,E=v=0,R=null;C!==null&&E<w.length;E++){C.index>E?(R=C,C=null):R=C.sibling;var M=f(m,C,w[E],S);if(M===null){C===null&&(C=R);break}e&&C&&M.alternate===null&&t(m,C),v=s(M,v,E),I===null?_=M:I.sibling=M,I=M,C=R}if(E===w.length)return n(m,C),Ne&&Pr(m,E),_;if(C===null){for(;E<w.length;E++)C=d(m,w[E],S),C!==null&&(v=s(C,v,E),I===null?_=C:I.sibling=C,I=C);return Ne&&Pr(m,E),_}for(C=r(m,C);E<w.length;E++)R=y(C,m,E,w[E],S),R!==null&&(e&&R.alternate!==null&&C.delete(R.key===null?E:R.key),v=s(R,v,E),I===null?_=R:I.sibling=R,I=R);return e&&C.forEach(function(N){return t(m,N)}),Ne&&Pr(m,E),_}function x(m,v,w,S){var _=cs(w);if(typeof _!="function")throw Error(U(150));if(w=_.call(w),w==null)throw Error(U(151));for(var I=_=null,C=v,E=v=0,R=null,M=w.next();C!==null&&!M.done;E++,M=w.next()){C.index>E?(R=C,C=null):R=C.sibling;var N=f(m,C,M.value,S);if(N===null){C===null&&(C=R);break}e&&C&&N.alternate===null&&t(m,C),v=s(N,v,E),I===null?_=N:I.sibling=N,I=N,C=R}if(M.done)return n(m,C),Ne&&Pr(m,E),_;if(C===null){for(;!M.done;E++,M=w.next())M=d(m,M.value,S),M!==null&&(v=s(M,v,E),I===null?_=M:I.sibling=M,I=M);return Ne&&Pr(m,E),_}for(C=r(m,C);!M.done;E++,M=w.next())M=y(C,m,E,M.value,S),M!==null&&(e&&M.alternate!==null&&C.delete(M.key===null?E:M.key),v=s(M,v,E),I===null?_=M:I.sibling=M,I=M);return e&&C.forEach(function(A){return t(m,A)}),Ne&&Pr(m,E),_}function b(m,v,w,S){if(typeof w=="object"&&w!==null&&w.type===go&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Fi:e:{for(var _=w.key,I=v;I!==null;){if(I.key===_){if(_=w.type,_===go){if(I.tag===7){n(m,I.sibling),v=o(I,w.props.children),v.return=m,m=v;break e}}else if(I.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Kn&&Xh(_)===I.type){n(m,I.sibling),v=o(I,w.props),v.ref=ps(m,I,w),v.return=m,m=v;break e}n(m,I);break}else t(m,I);I=I.sibling}w.type===go?(v=Lr(w.props.children,m.mode,S,w.key),v.return=m,m=v):(S=wa(w.type,w.key,w.props,null,m.mode,S),S.ref=ps(m,v,w),S.return=m,m=S)}return i(m);case mo:e:{for(I=w.key;v!==null;){if(v.key===I)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(m,v.sibling),v=o(v,w.children||[]),v.return=m,m=v;break e}else{n(m,v);break}else t(m,v);v=v.sibling}v=Ac(w,m.mode,S),v.return=m,m=v}return i(m);case Kn:return I=w._init,b(m,v,I(w._payload),S)}if(ws(w))return p(m,v,w,S);if(cs(w))return x(m,v,w,S);Hi(m,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(m,v.sibling),v=o(v,w),v.return=m,m=v):(n(m,v),v=Nc(w,m.mode,S),v.return=m,m=v),i(m)):n(m,v)}return b}var Do=xy(!0),wy=xy(!1),Ga=vr(null),Wa=null,Co=null,Yd=null;function qd(){Yd=Co=Wa=null}function Xd(e){var t=Ga.current;Pe(Ga),e._currentValue=t}function Fu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function No(e,t){Wa=e,Yd=Co=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(gt=!0),e.firstContext=null)}function Ht(e){var t=e._currentValue;if(Yd!==e)if(e={context:e,memoizedValue:t,next:null},Co===null){if(Wa===null)throw Error(U(308));Co=e,Wa.dependencies={lanes:0,firstContext:e}}else Co=Co.next=e;return t}var zr=null;function Qd(e){zr===null?zr=[e]:zr.push(e)}function by(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Qd(t)):(n.next=o.next,o.next=n),t.interleaved=n,jn(e,r)}function jn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Zn=!1;function Kd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Sy(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function An(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function cr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,de&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,jn(e,n)}return o=r.interleaved,o===null?(t.next=t,Qd(r)):(t.next=o.next,o.next=t),r.interleaved=t,jn(e,n)}function pa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jd(e,n)}}function Qh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?o=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?o=s=t:s=s.next=t}else o=s=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ha(e,t,n,r){var o=e.updateQueue;Zn=!1;var s=o.firstBaseUpdate,i=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,i===null?s=c:i.next=c,i=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==i&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(s!==null){var d=o.baseState;i=0,u=c=l=null,a=s;do{var f=a.lane,y=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:y,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=e,x=a;switch(f=t,y=n,x.tag){case 1:if(p=x.payload,typeof p=="function"){d=p.call(y,d,f);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=x.payload,f=typeof p=="function"?p.call(y,d,f):p,f==null)break e;d=Fe({},d,f);break e;case 2:Zn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[a]:f.push(a))}else y={eventTime:y,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=y,l=d):u=u.next=y,i|=f;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;f=a,a=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(u===null&&(l=d),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,t=o.shared.interleaved,t!==null){o=t;do i|=o.lane,o=o.next;while(o!==t)}else s===null&&(o.shared.lanes=0);Vr|=i,e.lanes=i,e.memoizedState=d}}function Kh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(U(191,o));o.call(r)}}}var _i={},vn=vr(_i),Zs=vr(_i),Js=vr(_i);function Fr(e){if(e===_i)throw Error(U(174));return e}function Zd(e,t){switch(Ee(Js,t),Ee(Zs,e),Ee(vn,_i),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:mu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=mu(t,e)}Pe(vn),Ee(vn,t)}function Uo(){Pe(vn),Pe(Zs),Pe(Js)}function _y(e){Fr(Js.current);var t=Fr(vn.current),n=mu(t,e.type);t!==n&&(Ee(Zs,e),Ee(vn,n))}function Jd(e){Zs.current===e&&(Pe(vn),Pe(Zs))}var Ae=vr(0);function Ya(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ic=[];function ef(){for(var e=0;e<Ic.length;e++)Ic[e]._workInProgressVersionPrimary=null;Ic.length=0}var ma=Dn.ReactCurrentDispatcher,kc=Dn.ReactCurrentBatchConfig,$r=0,ze=null,We=null,Ye=null,qa=!1,As=!1,ei=0,sS=0;function Je(){throw Error(U(321))}function tf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sn(e[n],t[n]))return!1;return!0}function nf(e,t,n,r,o,s){if($r=s,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ma.current=e===null||e.memoizedState===null?cS:uS,e=n(r,o),As){s=0;do{if(As=!1,ei=0,25<=s)throw Error(U(301));s+=1,Ye=We=null,t.updateQueue=null,ma.current=dS,e=n(r,o)}while(As)}if(ma.current=Xa,t=We!==null&&We.next!==null,$r=0,Ye=We=ze=null,qa=!1,t)throw Error(U(300));return e}function rf(){var e=ei!==0;return ei=0,e}function fn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ye===null?ze.memoizedState=Ye=e:Ye=Ye.next=e,Ye}function Yt(){if(We===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=Ye===null?ze.memoizedState:Ye.next;if(t!==null)Ye=t,We=e;else{if(e===null)throw Error(U(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},Ye===null?ze.memoizedState=Ye=e:Ye=Ye.next=e}return Ye}function ti(e,t){return typeof t=="function"?t(e):t}function Mc(e){var t=Yt(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=We,o=r.baseQueue,s=n.pending;if(s!==null){if(o!==null){var i=o.next;o.next=s.next,s.next=i}r.baseQueue=o=s,n.pending=null}if(o!==null){s=o.next,r=r.baseState;var a=i=null,l=null,c=s;do{var u=c.lane;if(($r&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,i=r):l=l.next=d,ze.lanes|=u,Vr|=u}c=c.next}while(c!==null&&c!==s);l===null?i=r:l.next=a,sn(r,t.memoizedState)||(gt=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do s=o.lane,ze.lanes|=s,Vr|=s,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Pc(e){var t=Yt(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,s=t.memoizedState;if(o!==null){n.pending=null;var i=o=o.next;do s=e(s,i.action),i=i.next;while(i!==o);sn(s,t.memoizedState)||(gt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Cy(){}function Ey(e,t){var n=ze,r=Yt(),o=t(),s=!sn(r.memoizedState,o);if(s&&(r.memoizedState=o,gt=!0),r=r.queue,of(My.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Ye!==null&&Ye.memoizedState.tag&1){if(n.flags|=2048,ni(9,ky.bind(null,n,r,o,t),void 0,null),qe===null)throw Error(U(349));$r&30||Iy(n,t,o)}return o}function Iy(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ze.updateQueue,t===null?(t={lastEffect:null,stores:null},ze.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ky(e,t,n,r){t.value=n,t.getSnapshot=r,Py(t)&&Ry(e)}function My(e,t,n){return n(function(){Py(t)&&Ry(e)})}function Py(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sn(e,n)}catch{return!0}}function Ry(e){var t=jn(e,1);t!==null&&on(t,e,1,-1)}function Zh(e){var t=fn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ti,lastRenderedState:e},t.queue=e,e=e.dispatch=lS.bind(null,ze,e),[t.memoizedState,e]}function ni(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ze.updateQueue,t===null?(t={lastEffect:null,stores:null},ze.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Ty(){return Yt().memoizedState}function ga(e,t,n,r){var o=fn();ze.flags|=e,o.memoizedState=ni(1|t,n,void 0,r===void 0?null:r)}function Sl(e,t,n,r){var o=Yt();r=r===void 0?null:r;var s=void 0;if(We!==null){var i=We.memoizedState;if(s=i.destroy,r!==null&&tf(r,i.deps)){o.memoizedState=ni(t,n,s,r);return}}ze.flags|=e,o.memoizedState=ni(1|t,n,s,r)}function Jh(e,t){return ga(8390656,8,e,t)}function of(e,t){return Sl(2048,8,e,t)}function Ny(e,t){return Sl(4,2,e,t)}function Ay(e,t){return Sl(4,4,e,t)}function zy(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Fy(e,t,n){return n=n!=null?n.concat([e]):null,Sl(4,4,zy.bind(null,t,e),n)}function sf(){}function jy(e,t){var n=Yt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&tf(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ly(e,t){var n=Yt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&tf(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Oy(e,t,n){return $r&21?(sn(n,t)||(n=Vg(),ze.lanes|=n,Vr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,gt=!0),e.memoizedState=n)}function iS(e,t){var n=we;we=n!==0&&4>n?n:4,e(!0);var r=kc.transition;kc.transition={};try{e(!1),t()}finally{we=n,kc.transition=r}}function By(){return Yt().memoizedState}function aS(e,t,n){var r=dr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Dy(e))Uy(t,n);else if(n=by(e,t,n,r),n!==null){var o=at();on(n,e,r,o),$y(n,t,r)}}function lS(e,t,n){var r=dr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Dy(e))Uy(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,a=s(i,n);if(o.hasEagerState=!0,o.eagerState=a,sn(a,i)){var l=t.interleaved;l===null?(o.next=o,Qd(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=by(e,t,o,r),n!==null&&(o=at(),on(n,e,r,o),$y(n,t,r))}}function Dy(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function Uy(e,t){As=qa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function $y(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jd(e,n)}}var Xa={readContext:Ht,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useInsertionEffect:Je,useLayoutEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useMutableSource:Je,useSyncExternalStore:Je,useId:Je,unstable_isNewReconciler:!1},cS={readContext:Ht,useCallback:function(e,t){return fn().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:Jh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ga(4194308,4,zy.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ga(4194308,4,e,t)},useInsertionEffect:function(e,t){return ga(4,2,e,t)},useMemo:function(e,t){var n=fn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=fn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=aS.bind(null,ze,e),[r.memoizedState,e]},useRef:function(e){var t=fn();return e={current:e},t.memoizedState=e},useState:Zh,useDebugValue:sf,useDeferredValue:function(e){return fn().memoizedState=e},useTransition:function(){var e=Zh(!1),t=e[0];return e=iS.bind(null,e[1]),fn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ze,o=fn();if(Ne){if(n===void 0)throw Error(U(407));n=n()}else{if(n=t(),qe===null)throw Error(U(349));$r&30||Iy(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,Jh(My.bind(null,r,s,e),[e]),r.flags|=2048,ni(9,ky.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=fn(),t=qe.identifierPrefix;if(Ne){var n=Nn,r=Tn;n=(r&~(1<<32-rn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ei++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=sS++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},uS={readContext:Ht,useCallback:jy,useContext:Ht,useEffect:of,useImperativeHandle:Fy,useInsertionEffect:Ny,useLayoutEffect:Ay,useMemo:Ly,useReducer:Mc,useRef:Ty,useState:function(){return Mc(ti)},useDebugValue:sf,useDeferredValue:function(e){var t=Yt();return Oy(t,We.memoizedState,e)},useTransition:function(){var e=Mc(ti)[0],t=Yt().memoizedState;return[e,t]},useMutableSource:Cy,useSyncExternalStore:Ey,useId:By,unstable_isNewReconciler:!1},dS={readContext:Ht,useCallback:jy,useContext:Ht,useEffect:of,useImperativeHandle:Fy,useInsertionEffect:Ny,useLayoutEffect:Ay,useMemo:Ly,useReducer:Pc,useRef:Ty,useState:function(){return Pc(ti)},useDebugValue:sf,useDeferredValue:function(e){var t=Yt();return We===null?t.memoizedState=e:Oy(t,We.memoizedState,e)},useTransition:function(){var e=Pc(ti)[0],t=Yt().memoizedState;return[e,t]},useMutableSource:Cy,useSyncExternalStore:Ey,useId:By,unstable_isNewReconciler:!1};function Zt(e,t){if(e&&e.defaultProps){t=Fe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ju(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Fe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _l={isMounted:function(e){return(e=e._reactInternals)?Qr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=at(),o=dr(e),s=An(r,o);s.payload=t,n!=null&&(s.callback=n),t=cr(e,s,o),t!==null&&(on(t,e,o,r),pa(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=at(),o=dr(e),s=An(r,o);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=cr(e,s,o),t!==null&&(on(t,e,o,r),pa(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=at(),r=dr(e),o=An(n,r);o.tag=2,t!=null&&(o.callback=t),t=cr(e,o,r),t!==null&&(on(t,e,r,n),pa(t,e,r))}};function ep(e,t,n,r,o,s,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,i):t.prototype&&t.prototype.isPureReactComponent?!qs(n,r)||!qs(o,s):!0}function Vy(e,t,n){var r=!1,o=pr,s=t.contextType;return typeof s=="object"&&s!==null?s=Ht(s):(o=xt(t)?Dr:rt.current,r=t.contextTypes,s=(r=r!=null)?Oo(e,o):pr),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=_l,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=s),t}function tp(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_l.enqueueReplaceState(t,t.state,null)}function Lu(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Kd(e);var s=t.contextType;typeof s=="object"&&s!==null?o.context=Ht(s):(s=xt(t)?Dr:rt.current,o.context=Oo(e,s)),o.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(ju(e,t,s,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&_l.enqueueReplaceState(o,o.state,null),Ha(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function $o(e,t){try{var n="",r=t;do n+=B1(r),r=r.return;while(r);var o=n}catch(s){o=`
|
|
39
|
+
Error generating stack: `+s.message+`
|
|
40
|
+
`+s.stack}return{value:e,source:t,stack:o,digest:null}}function Rc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ou(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var fS=typeof WeakMap=="function"?WeakMap:Map;function Gy(e,t,n){n=An(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ka||(Ka=!0,qu=r),Ou(e,t)},n}function Wy(e,t,n){n=An(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Ou(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Ou(e,t),typeof r!="function"&&(ur===null?ur=new Set([this]):ur.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function np(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new fS;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=IS.bind(null,e,t,n),t.then(e,e))}function rp(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function op(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=An(-1,1),t.tag=2,cr(n,t,1))),n.lanes|=1),e)}var hS=Dn.ReactCurrentOwner,gt=!1;function st(e,t,n,r){t.child=e===null?wy(t,null,n,r):Do(t,e.child,n,r)}function sp(e,t,n,r,o){n=n.render;var s=t.ref;return No(t,o),r=nf(e,t,n,r,s,o),n=rf(),e!==null&&!gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ln(e,t,o)):(Ne&&n&&Gd(t),t.flags|=1,st(e,t,r,o),t.child)}function ip(e,t,n,r,o){if(e===null){var s=n.type;return typeof s=="function"&&!pf(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Hy(e,t,s,r,o)):(e=wa(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&o)){var i=s.memoizedProps;if(n=n.compare,n=n!==null?n:qs,n(i,r)&&e.ref===t.ref)return Ln(e,t,o)}return t.flags|=1,e=fr(s,r),e.ref=t.ref,e.return=t,t.child=e}function Hy(e,t,n,r,o){if(e!==null){var s=e.memoizedProps;if(qs(s,r)&&e.ref===t.ref)if(gt=!1,t.pendingProps=r=s,(e.lanes&o)!==0)e.flags&131072&&(gt=!0);else return t.lanes=e.lanes,Ln(e,t,o)}return Bu(e,t,n,r,o)}function Yy(e,t,n){var r=t.pendingProps,o=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ee(Io,_t),_t|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ee(Io,_t),_t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Ee(Io,_t),_t|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Ee(Io,_t),_t|=r;return st(e,t,o,n),t.child}function qy(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Bu(e,t,n,r,o){var s=xt(n)?Dr:rt.current;return s=Oo(t,s),No(t,o),n=nf(e,t,n,r,s,o),r=rf(),e!==null&&!gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ln(e,t,o)):(Ne&&r&&Gd(t),t.flags|=1,st(e,t,n,o),t.child)}function ap(e,t,n,r,o){if(xt(n)){var s=!0;Ua(t)}else s=!1;if(No(t,o),t.stateNode===null)ya(e,t),Vy(t,n,r),Lu(t,n,r,o),r=!0;else if(e===null){var i=t.stateNode,a=t.memoizedProps;i.props=a;var l=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=Ht(c):(c=xt(n)?Dr:rt.current,c=Oo(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function";d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==r||l!==c)&&tp(t,i,r,c),Zn=!1;var f=t.memoizedState;i.state=f,Ha(t,r,i,o),l=t.memoizedState,a!==r||f!==l||vt.current||Zn?(typeof u=="function"&&(ju(t,n,u,r),l=t.memoizedState),(a=Zn||ep(t,n,a,r,f,l,c))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),i.props=r,i.state=l,i.context=c,r=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Sy(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Zt(t.type,a),i.props=c,d=t.pendingProps,f=i.context,l=n.contextType,typeof l=="object"&&l!==null?l=Ht(l):(l=xt(n)?Dr:rt.current,l=Oo(t,l));var y=n.getDerivedStateFromProps;(u=typeof y=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==d||f!==l)&&tp(t,i,r,l),Zn=!1,f=t.memoizedState,i.state=f,Ha(t,r,i,o);var p=t.memoizedState;a!==d||f!==p||vt.current||Zn?(typeof y=="function"&&(ju(t,n,y,r),p=t.memoizedState),(c=Zn||ep(t,n,c,r,f,p,l)||!1)?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,p,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,p,l)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),i.props=r,i.state=p,i.context=l,r=c):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Du(e,t,n,r,s,o)}function Du(e,t,n,r,o,s){qy(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return o&&Hh(t,n,!1),Ln(e,t,s);r=t.stateNode,hS.current=t;var a=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=Do(t,e.child,null,s),t.child=Do(t,null,a,s)):st(e,t,a,s),t.memoizedState=r.state,o&&Hh(t,n,!0),t.child}function Xy(e){var t=e.stateNode;t.pendingContext?Wh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Wh(e,t.context,!1),Zd(e,t.containerInfo)}function lp(e,t,n,r,o){return Bo(),Hd(o),t.flags|=256,st(e,t,n,r),t.child}var Uu={dehydrated:null,treeContext:null,retryLane:0};function $u(e){return{baseLanes:e,cachePool:null,transitions:null}}function Qy(e,t,n){var r=t.pendingProps,o=Ae.current,s=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ee(Ae,o&1),e===null)return zu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,s?(r=t.mode,s=t.child,i={mode:"hidden",children:i},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=i):s=Il(i,r,0,null),e=Lr(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=$u(n),t.memoizedState=Uu,e):af(t,i));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return pS(e,t,i,r,a,o,n);if(s){s=r.fallback,i=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(i&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=fr(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?s=fr(a,s):(s=Lr(s,i,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,i=e.child.memoizedState,i=i===null?$u(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},s.memoizedState=i,s.childLanes=e.childLanes&~n,t.memoizedState=Uu,r}return s=e.child,e=s.sibling,r=fr(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function af(e,t){return t=Il({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Yi(e,t,n,r){return r!==null&&Hd(r),Do(t,e.child,null,n),e=af(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pS(e,t,n,r,o,s,i){if(n)return t.flags&256?(t.flags&=-257,r=Rc(Error(U(422))),Yi(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,o=t.mode,r=Il({mode:"visible",children:r.children},o,0,null),s=Lr(s,o,i,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Do(t,e.child,null,i),t.child.memoizedState=$u(i),t.memoizedState=Uu,s);if(!(t.mode&1))return Yi(e,t,i,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(U(419)),r=Rc(s,r,void 0),Yi(e,t,i,r)}if(a=(i&e.childLanes)!==0,gt||a){if(r=qe,r!==null){switch(i&-i){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|i)?0:o,o!==0&&o!==s.retryLane&&(s.retryLane=o,jn(e,o),on(r,e,o,-1))}return hf(),r=Rc(Error(U(421))),Yi(e,t,i,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=kS.bind(null,e),o._reactRetry=t,null):(e=s.treeContext,kt=lr(o.nextSibling),Mt=t,Ne=!0,en=null,e!==null&&(Dt[Ut++]=Tn,Dt[Ut++]=Nn,Dt[Ut++]=Ur,Tn=e.id,Nn=e.overflow,Ur=t),t=af(t,r.children),t.flags|=4096,t)}function cp(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Fu(e.return,t,n)}function Tc(e,t,n,r,o){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=o)}function Ky(e,t,n){var r=t.pendingProps,o=r.revealOrder,s=r.tail;if(st(e,t,r.children,n),r=Ae.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cp(e,n,t);else if(e.tag===19)cp(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ee(Ae,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Ya(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Tc(t,!1,o,n,s);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Ya(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Tc(t,!0,n,null,s);break;case"together":Tc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ya(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ln(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Vr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(U(153));if(t.child!==null){for(e=t.child,n=fr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=fr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function mS(e,t,n){switch(t.tag){case 3:Xy(t),Bo();break;case 5:_y(t);break;case 1:xt(t.type)&&Ua(t);break;case 4:Zd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ee(Ga,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ee(Ae,Ae.current&1),t.flags|=128,null):n&t.child.childLanes?Qy(e,t,n):(Ee(Ae,Ae.current&1),e=Ln(e,t,n),e!==null?e.sibling:null);Ee(Ae,Ae.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Ky(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ee(Ae,Ae.current),r)break;return null;case 22:case 23:return t.lanes=0,Yy(e,t,n)}return Ln(e,t,n)}var Zy,Vu,Jy,e0;Zy=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Vu=function(){};Jy=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Fr(vn.current);var s=null;switch(n){case"input":o=du(e,o),r=du(e,r),s=[];break;case"select":o=Fe({},o,{value:void 0}),r=Fe({},r,{value:void 0}),s=[];break;case"textarea":o=pu(e,o),r=pu(e,r),s=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ba)}gu(n,r);var i;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(i in a)a.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Us.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=o?.[c],r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(i in a)!a.hasOwnProperty(i)||l&&l.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in l)l.hasOwnProperty(i)&&a[i]!==l[i]&&(n||(n={}),n[i]=l[i])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Us.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Me("scroll",e),s||a===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};e0=function(e,t,n,r){n!==r&&(t.flags|=4)};function ms(e,t){if(!Ne)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function et(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function gS(e,t,n){var r=t.pendingProps;switch(Wd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(t),null;case 1:return xt(t.type)&&Da(),et(t),null;case 3:return r=t.stateNode,Uo(),Pe(vt),Pe(rt),ef(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Wi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,en!==null&&(Ku(en),en=null))),Vu(e,t),et(t),null;case 5:Jd(t);var o=Fr(Js.current);if(n=t.type,e!==null&&t.stateNode!=null)Jy(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(U(166));return et(t),null}if(e=Fr(vn.current),Wi(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[pn]=t,r[Ks]=s,e=(t.mode&1)!==0,n){case"dialog":Me("cancel",r),Me("close",r);break;case"iframe":case"object":case"embed":Me("load",r);break;case"video":case"audio":for(o=0;o<Ss.length;o++)Me(Ss[o],r);break;case"source":Me("error",r);break;case"img":case"image":case"link":Me("error",r),Me("load",r);break;case"details":Me("toggle",r);break;case"input":vh(r,s),Me("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Me("invalid",r);break;case"textarea":wh(r,s),Me("invalid",r)}gu(n,s),o=null;for(var i in s)if(s.hasOwnProperty(i)){var a=s[i];i==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Gi(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Gi(r.textContent,a,e),o=["children",""+a]):Us.hasOwnProperty(i)&&a!=null&&i==="onScroll"&&Me("scroll",r)}switch(n){case"input":ji(r),xh(r,s,!0);break;case"textarea":ji(r),bh(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Ba)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Mg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[pn]=t,e[Ks]=r,Zy(e,t,!1,!1),t.stateNode=e;e:{switch(i=yu(n,r),n){case"dialog":Me("cancel",e),Me("close",e),o=r;break;case"iframe":case"object":case"embed":Me("load",e),o=r;break;case"video":case"audio":for(o=0;o<Ss.length;o++)Me(Ss[o],e);o=r;break;case"source":Me("error",e),o=r;break;case"img":case"image":case"link":Me("error",e),Me("load",e),o=r;break;case"details":Me("toggle",e),o=r;break;case"input":vh(e,r),o=du(e,r),Me("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Fe({},r,{value:void 0}),Me("invalid",e);break;case"textarea":wh(e,r),o=pu(e,r),Me("invalid",e);break;default:o=r}gu(n,o),a=o;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?Tg(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Pg(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&$s(e,l):typeof l=="number"&&$s(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Us.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Me("scroll",e):l!=null&&Rd(e,s,l,i))}switch(n){case"input":ji(e),xh(e,r,!1);break;case"textarea":ji(e),bh(e);break;case"option":r.value!=null&&e.setAttribute("value",""+hr(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Mo(e,!!r.multiple,s,!1):r.defaultValue!=null&&Mo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Ba)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return et(t),null;case 6:if(e&&t.stateNode!=null)e0(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(U(166));if(n=Fr(Js.current),Fr(vn.current),Wi(t)){if(r=t.stateNode,n=t.memoizedProps,r[pn]=t,(s=r.nodeValue!==n)&&(e=Mt,e!==null))switch(e.tag){case 3:Gi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Gi(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[pn]=t,t.stateNode=r}return et(t),null;case 13:if(Pe(Ae),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ne&&kt!==null&&t.mode&1&&!(t.flags&128))vy(),Bo(),t.flags|=98560,s=!1;else if(s=Wi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(U(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(U(317));s[pn]=t}else Bo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;et(t),s=!1}else en!==null&&(Ku(en),en=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ae.current&1?He===0&&(He=3):hf())),t.updateQueue!==null&&(t.flags|=4),et(t),null);case 4:return Uo(),Vu(e,t),e===null&&Xs(t.stateNode.containerInfo),et(t),null;case 10:return Xd(t.type._context),et(t),null;case 17:return xt(t.type)&&Da(),et(t),null;case 19:if(Pe(Ae),s=t.memoizedState,s===null)return et(t),null;if(r=(t.flags&128)!==0,i=s.rendering,i===null)if(r)ms(s,!1);else{if(He!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Ya(e),i!==null){for(t.flags|=128,ms(s,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,i=s.alternate,i===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=i.childLanes,s.lanes=i.lanes,s.child=i.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=i.memoizedProps,s.memoizedState=i.memoizedState,s.updateQueue=i.updateQueue,s.type=i.type,e=i.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ee(Ae,Ae.current&1|2),t.child}e=e.sibling}s.tail!==null&&De()>Vo&&(t.flags|=128,r=!0,ms(s,!1),t.lanes=4194304)}else{if(!r)if(e=Ya(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ms(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!Ne)return et(t),null}else 2*De()-s.renderingStartTime>Vo&&n!==1073741824&&(t.flags|=128,r=!0,ms(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=De(),t.sibling=null,n=Ae.current,Ee(Ae,r?n&1|2:n&1),t):(et(t),null);case 22:case 23:return ff(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?_t&1073741824&&(et(t),t.subtreeFlags&6&&(t.flags|=8192)):et(t),null;case 24:return null;case 25:return null}throw Error(U(156,t.tag))}function yS(e,t){switch(Wd(t),t.tag){case 1:return xt(t.type)&&Da(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Uo(),Pe(vt),Pe(rt),ef(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Jd(t),null;case 13:if(Pe(Ae),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(U(340));Bo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Pe(Ae),null;case 4:return Uo(),null;case 10:return Xd(t.type._context),null;case 22:case 23:return ff(),null;case 24:return null;default:return null}}var qi=!1,tt=!1,vS=typeof WeakSet=="function"?WeakSet:Set,H=null;function Eo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Oe(e,t,r)}else n.current=null}function Gu(e,t,n){try{n()}catch(r){Oe(e,t,r)}}var up=!1;function xS(e,t){if(ku=ja,e=sy(),Vd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,a=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var y;d!==n||o!==0&&d.nodeType!==3||(a=i+o),d!==s||r!==0&&d.nodeType!==3||(l=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(y=d.firstChild)!==null;)f=d,d=y;for(;;){if(d===e)break t;if(f===n&&++c===o&&(a=i),f===s&&++u===r&&(l=i),(y=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=y}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Mu={focusedElem:e,selectionRange:n},ja=!1,H=t;H!==null;)if(t=H,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,H=e;else for(;H!==null;){t=H;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var x=p.memoizedProps,b=p.memoizedState,m=t.stateNode,v=m.getSnapshotBeforeUpdate(t.elementType===t.type?x:Zt(t.type,x),b);m.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(U(163))}}catch(S){Oe(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,H=e;break}H=t.return}return p=up,up=!1,p}function zs(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&Gu(t,n,s)}o=o.next}while(o!==r)}}function Cl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Wu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function t0(e){var t=e.alternate;t!==null&&(e.alternate=null,t0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[pn],delete t[Ks],delete t[Tu],delete t[tS],delete t[nS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function n0(e){return e.tag===5||e.tag===3||e.tag===4}function dp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||n0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ba));else if(r!==4&&(e=e.child,e!==null))for(Hu(e,t,n),e=e.sibling;e!==null;)Hu(e,t,n),e=e.sibling}function Yu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Yu(e,t,n),e=e.sibling;e!==null;)Yu(e,t,n),e=e.sibling}var Xe=null,Jt=!1;function Yn(e,t,n){for(n=n.child;n!==null;)r0(e,t,n),n=n.sibling}function r0(e,t,n){if(yn&&typeof yn.onCommitFiberUnmount=="function")try{yn.onCommitFiberUnmount(gl,n)}catch{}switch(n.tag){case 5:tt||Eo(n,t);case 6:var r=Xe,o=Jt;Xe=null,Yn(e,t,n),Xe=r,Jt=o,Xe!==null&&(Jt?(e=Xe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Xe.removeChild(n.stateNode));break;case 18:Xe!==null&&(Jt?(e=Xe,n=n.stateNode,e.nodeType===8?Cc(e.parentNode,n):e.nodeType===1&&Cc(e,n),Hs(e)):Cc(Xe,n.stateNode));break;case 4:r=Xe,o=Jt,Xe=n.stateNode.containerInfo,Jt=!0,Yn(e,t,n),Xe=r,Jt=o;break;case 0:case 11:case 14:case 15:if(!tt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&Gu(n,t,i),o=o.next}while(o!==r)}Yn(e,t,n);break;case 1:if(!tt&&(Eo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Oe(n,t,a)}Yn(e,t,n);break;case 21:Yn(e,t,n);break;case 22:n.mode&1?(tt=(r=tt)||n.memoizedState!==null,Yn(e,t,n),tt=r):Yn(e,t,n);break;default:Yn(e,t,n)}}function fp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new vS),t.forEach(function(r){var o=MS.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Kt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var s=e,i=t,a=i;e:for(;a!==null;){switch(a.tag){case 5:Xe=a.stateNode,Jt=!1;break e;case 3:Xe=a.stateNode.containerInfo,Jt=!0;break e;case 4:Xe=a.stateNode.containerInfo,Jt=!0;break e}a=a.return}if(Xe===null)throw Error(U(160));r0(s,i,o),Xe=null,Jt=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){Oe(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)o0(t,e),t=t.sibling}function o0(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Kt(t,e),dn(e),r&4){try{zs(3,e,e.return),Cl(3,e)}catch(x){Oe(e,e.return,x)}try{zs(5,e,e.return)}catch(x){Oe(e,e.return,x)}}break;case 1:Kt(t,e),dn(e),r&512&&n!==null&&Eo(n,n.return);break;case 5:if(Kt(t,e),dn(e),r&512&&n!==null&&Eo(n,n.return),e.flags&32){var o=e.stateNode;try{$s(o,"")}catch(x){Oe(e,e.return,x)}}if(r&4&&(o=e.stateNode,o!=null)){var s=e.memoizedProps,i=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&Ig(o,s),yu(a,i);var c=yu(a,s);for(i=0;i<l.length;i+=2){var u=l[i],d=l[i+1];u==="style"?Tg(o,d):u==="dangerouslySetInnerHTML"?Pg(o,d):u==="children"?$s(o,d):Rd(o,u,d,c)}switch(a){case"input":fu(o,s);break;case"textarea":kg(o,s);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!s.multiple;var y=s.value;y!=null?Mo(o,!!s.multiple,y,!1):f!==!!s.multiple&&(s.defaultValue!=null?Mo(o,!!s.multiple,s.defaultValue,!0):Mo(o,!!s.multiple,s.multiple?[]:"",!1))}o[Ks]=s}catch(x){Oe(e,e.return,x)}}break;case 6:if(Kt(t,e),dn(e),r&4){if(e.stateNode===null)throw Error(U(162));o=e.stateNode,s=e.memoizedProps;try{o.nodeValue=s}catch(x){Oe(e,e.return,x)}}break;case 3:if(Kt(t,e),dn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Hs(t.containerInfo)}catch(x){Oe(e,e.return,x)}break;case 4:Kt(t,e),dn(e);break;case 13:Kt(t,e),dn(e),o=e.child,o.flags&8192&&(s=o.memoizedState!==null,o.stateNode.isHidden=s,!s||o.alternate!==null&&o.alternate.memoizedState!==null||(uf=De())),r&4&&fp(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(tt=(c=tt)||u,Kt(t,e),tt=c):Kt(t,e),dn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(H=e,u=e.child;u!==null;){for(d=H=u;H!==null;){switch(f=H,y=f.child,f.tag){case 0:case 11:case 14:case 15:zs(4,f,f.return);break;case 1:Eo(f,f.return);var p=f.stateNode;if(typeof p.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(x){Oe(r,n,x)}}break;case 5:Eo(f,f.return);break;case 22:if(f.memoizedState!==null){pp(d);continue}}y!==null?(y.return=f,H=y):pp(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{o=d.stateNode,c?(s=o.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=d.stateNode,l=d.memoizedProps.style,i=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Rg("display",i))}catch(x){Oe(e,e.return,x)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(x){Oe(e,e.return,x)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Kt(t,e),dn(e),r&4&&fp(e);break;case 21:break;default:Kt(t,e),dn(e)}}function dn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(n0(n)){var r=n;break e}n=n.return}throw Error(U(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&($s(o,""),r.flags&=-33);var s=dp(e);Yu(e,s,o);break;case 3:case 4:var i=r.stateNode.containerInfo,a=dp(e);Hu(e,a,i);break;default:throw Error(U(161))}}catch(l){Oe(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wS(e,t,n){H=e,s0(e)}function s0(e,t,n){for(var r=(e.mode&1)!==0;H!==null;){var o=H,s=o.child;if(o.tag===22&&r){var i=o.memoizedState!==null||qi;if(!i){var a=o.alternate,l=a!==null&&a.memoizedState!==null||tt;a=qi;var c=tt;if(qi=i,(tt=l)&&!c)for(H=o;H!==null;)i=H,l=i.child,i.tag===22&&i.memoizedState!==null?mp(o):l!==null?(l.return=i,H=l):mp(o);for(;s!==null;)H=s,s0(s),s=s.sibling;H=o,qi=a,tt=c}hp(e)}else o.subtreeFlags&8772&&s!==null?(s.return=o,H=s):hp(e)}}function hp(e){for(;H!==null;){var t=H;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:tt||Cl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!tt)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Zt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Kh(t,s,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Kh(t,i,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&Hs(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(U(163))}tt||t.flags&512&&Wu(t)}catch(f){Oe(t,t.return,f)}}if(t===e){H=null;break}if(n=t.sibling,n!==null){n.return=t.return,H=n;break}H=t.return}}function pp(e){for(;H!==null;){var t=H;if(t===e){H=null;break}var n=t.sibling;if(n!==null){n.return=t.return,H=n;break}H=t.return}}function mp(e){for(;H!==null;){var t=H;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Cl(4,t)}catch(l){Oe(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Oe(t,o,l)}}var s=t.return;try{Wu(t)}catch(l){Oe(t,s,l)}break;case 5:var i=t.return;try{Wu(t)}catch(l){Oe(t,i,l)}}}catch(l){Oe(t,t.return,l)}if(t===e){H=null;break}var a=t.sibling;if(a!==null){a.return=t.return,H=a;break}H=t.return}}var bS=Math.ceil,Qa=Dn.ReactCurrentDispatcher,lf=Dn.ReactCurrentOwner,Vt=Dn.ReactCurrentBatchConfig,de=0,qe=null,Ue=null,Qe=0,_t=0,Io=vr(0),He=0,ri=null,Vr=0,El=0,cf=0,Fs=null,pt=null,uf=0,Vo=1/0,Mn=null,Ka=!1,qu=null,ur=null,Xi=!1,rr=null,Za=0,js=0,Xu=null,va=-1,xa=0;function at(){return de&6?De():va!==-1?va:va=De()}function dr(e){return e.mode&1?de&2&&Qe!==0?Qe&-Qe:oS.transition!==null?(xa===0&&(xa=Vg()),xa):(e=we,e!==0||(e=window.event,e=e===void 0?16:Qg(e.type)),e):1}function on(e,t,n,r){if(50<js)throw js=0,Xu=null,Error(U(185));wi(e,n,r),(!(de&2)||e!==qe)&&(e===qe&&(!(de&2)&&(El|=n),He===4&&tr(e,Qe)),wt(e,r),n===1&&de===0&&!(t.mode&1)&&(Vo=De()+500,bl&&xr()))}function wt(e,t){var n=e.callbackNode;ob(e,t);var r=Fa(e,e===qe?Qe:0);if(r===0)n!==null&&Ch(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ch(n),t===1)e.tag===0?rS(gp.bind(null,e)):my(gp.bind(null,e)),Jb(function(){!(de&6)&&xr()}),n=null;else{switch(Gg(r)){case 1:n=Fd;break;case 4:n=Ug;break;case 16:n=za;break;case 536870912:n=$g;break;default:n=za}n=h0(n,i0.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function i0(e,t){if(va=-1,xa=0,de&6)throw Error(U(327));var n=e.callbackNode;if(Ao()&&e.callbackNode!==n)return null;var r=Fa(e,e===qe?Qe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ja(e,r);else{t=r;var o=de;de|=2;var s=l0();(qe!==e||Qe!==t)&&(Mn=null,Vo=De()+500,jr(e,t));do try{CS();break}catch(a){a0(e,a)}while(!0);qd(),Qa.current=s,de=o,Ue!==null?t=0:(qe=null,Qe=0,t=He)}if(t!==0){if(t===2&&(o=Su(e),o!==0&&(r=o,t=Qu(e,o))),t===1)throw n=ri,jr(e,0),tr(e,r),wt(e,De()),n;if(t===6)tr(e,r);else{if(o=e.current.alternate,!(r&30)&&!SS(o)&&(t=Ja(e,r),t===2&&(s=Su(e),s!==0&&(r=s,t=Qu(e,s))),t===1))throw n=ri,jr(e,0),tr(e,r),wt(e,De()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(U(345));case 2:Rr(e,pt,Mn);break;case 3:if(tr(e,r),(r&130023424)===r&&(t=uf+500-De(),10<t)){if(Fa(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){at(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Ru(Rr.bind(null,e,pt,Mn),t);break}Rr(e,pt,Mn);break;case 4:if(tr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var i=31-rn(r);s=1<<i,i=t[i],i>o&&(o=i),r&=~s}if(r=o,r=De()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*bS(r/1960))-r,10<r){e.timeoutHandle=Ru(Rr.bind(null,e,pt,Mn),r);break}Rr(e,pt,Mn);break;case 5:Rr(e,pt,Mn);break;default:throw Error(U(329))}}}return wt(e,De()),e.callbackNode===n?i0.bind(null,e):null}function Qu(e,t){var n=Fs;return e.current.memoizedState.isDehydrated&&(jr(e,t).flags|=256),e=Ja(e,t),e!==2&&(t=pt,pt=n,t!==null&&Ku(t)),e}function Ku(e){pt===null?pt=e:pt.push.apply(pt,e)}function SS(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],s=o.getSnapshot;o=o.value;try{if(!sn(s(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function tr(e,t){for(t&=~cf,t&=~El,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-rn(t),r=1<<n;e[n]=-1,t&=~r}}function gp(e){if(de&6)throw Error(U(327));Ao();var t=Fa(e,0);if(!(t&1))return wt(e,De()),null;var n=Ja(e,t);if(e.tag!==0&&n===2){var r=Su(e);r!==0&&(t=r,n=Qu(e,r))}if(n===1)throw n=ri,jr(e,0),tr(e,t),wt(e,De()),n;if(n===6)throw Error(U(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Rr(e,pt,Mn),wt(e,De()),null}function df(e,t){var n=de;de|=1;try{return e(t)}finally{de=n,de===0&&(Vo=De()+500,bl&&xr())}}function Gr(e){rr!==null&&rr.tag===0&&!(de&6)&&Ao();var t=de;de|=1;var n=Vt.transition,r=we;try{if(Vt.transition=null,we=1,e)return e()}finally{we=r,Vt.transition=n,de=t,!(de&6)&&xr()}}function ff(){_t=Io.current,Pe(Io)}function jr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Zb(n)),Ue!==null)for(n=Ue.return;n!==null;){var r=n;switch(Wd(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Da();break;case 3:Uo(),Pe(vt),Pe(rt),ef();break;case 5:Jd(r);break;case 4:Uo();break;case 13:Pe(Ae);break;case 19:Pe(Ae);break;case 10:Xd(r.type._context);break;case 22:case 23:ff()}n=n.return}if(qe=e,Ue=e=fr(e.current,null),Qe=_t=t,He=0,ri=null,cf=El=Vr=0,pt=Fs=null,zr!==null){for(t=0;t<zr.length;t++)if(n=zr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,s=n.pending;if(s!==null){var i=s.next;s.next=o,r.next=i}n.pending=r}zr=null}return e}function a0(e,t){do{var n=Ue;try{if(qd(),ma.current=Xa,qa){for(var r=ze.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}qa=!1}if($r=0,Ye=We=ze=null,As=!1,ei=0,lf.current=null,n===null||n.return===null){He=1,ri=t,Ue=null;break}e:{var s=e,i=n.return,a=n,l=t;if(t=Qe,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var y=rp(i);if(y!==null){y.flags&=-257,op(y,i,a,s,t),y.mode&1&&np(s,c,t),t=y,l=c;var p=t.updateQueue;if(p===null){var x=new Set;x.add(l),t.updateQueue=x}else p.add(l);break e}else{if(!(t&1)){np(s,c,t),hf();break e}l=Error(U(426))}}else if(Ne&&a.mode&1){var b=rp(i);if(b!==null){!(b.flags&65536)&&(b.flags|=256),op(b,i,a,s,t),Hd($o(l,a));break e}}s=l=$o(l,a),He!==4&&(He=2),Fs===null?Fs=[s]:Fs.push(s),s=i;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var m=Gy(s,l,t);Qh(s,m);break e;case 1:a=l;var v=s.type,w=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ur===null||!ur.has(w)))){s.flags|=65536,t&=-t,s.lanes|=t;var S=Wy(s,a,t);Qh(s,S);break e}}s=s.return}while(s!==null)}u0(n)}catch(_){t=_,Ue===n&&n!==null&&(Ue=n=n.return);continue}break}while(!0)}function l0(){var e=Qa.current;return Qa.current=Xa,e===null?Xa:e}function hf(){(He===0||He===3||He===2)&&(He=4),qe===null||!(Vr&268435455)&&!(El&268435455)||tr(qe,Qe)}function Ja(e,t){var n=de;de|=2;var r=l0();(qe!==e||Qe!==t)&&(Mn=null,jr(e,t));do try{_S();break}catch(o){a0(e,o)}while(!0);if(qd(),de=n,Qa.current=r,Ue!==null)throw Error(U(261));return qe=null,Qe=0,He}function _S(){for(;Ue!==null;)c0(Ue)}function CS(){for(;Ue!==null&&!X1();)c0(Ue)}function c0(e){var t=f0(e.alternate,e,_t);e.memoizedProps=e.pendingProps,t===null?u0(e):Ue=t,lf.current=null}function u0(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=yS(n,t),n!==null){n.flags&=32767,Ue=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{He=6,Ue=null;return}}else if(n=gS(n,t,_t),n!==null){Ue=n;return}if(t=t.sibling,t!==null){Ue=t;return}Ue=t=e}while(t!==null);He===0&&(He=5)}function Rr(e,t,n){var r=we,o=Vt.transition;try{Vt.transition=null,we=1,ES(e,t,n,r)}finally{Vt.transition=o,we=r}return null}function ES(e,t,n,r){do Ao();while(rr!==null);if(de&6)throw Error(U(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(U(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(sb(e,s),e===qe&&(Ue=qe=null,Qe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Xi||(Xi=!0,h0(za,function(){return Ao(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Vt.transition,Vt.transition=null;var i=we;we=1;var a=de;de|=4,lf.current=null,xS(e,n),o0(n,e),Wb(Mu),ja=!!ku,Mu=ku=null,e.current=n,wS(n),Q1(),de=a,we=i,Vt.transition=s}else e.current=n;if(Xi&&(Xi=!1,rr=e,Za=o),s=e.pendingLanes,s===0&&(ur=null),J1(n.stateNode),wt(e,De()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Ka)throw Ka=!1,e=qu,qu=null,e;return Za&1&&e.tag!==0&&Ao(),s=e.pendingLanes,s&1?e===Xu?js++:(js=0,Xu=e):js=0,xr(),null}function Ao(){if(rr!==null){var e=Gg(Za),t=Vt.transition,n=we;try{if(Vt.transition=null,we=16>e?16:e,rr===null)var r=!1;else{if(e=rr,rr=null,Za=0,de&6)throw Error(U(331));var o=de;for(de|=4,H=e.current;H!==null;){var s=H,i=s.child;if(H.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(H=c;H!==null;){var u=H;switch(u.tag){case 0:case 11:case 15:zs(8,u,s)}var d=u.child;if(d!==null)d.return=u,H=d;else for(;H!==null;){u=H;var f=u.sibling,y=u.return;if(t0(u),u===c){H=null;break}if(f!==null){f.return=y,H=f;break}H=y}}}var p=s.alternate;if(p!==null){var x=p.child;if(x!==null){p.child=null;do{var b=x.sibling;x.sibling=null,x=b}while(x!==null)}}H=s}}if(s.subtreeFlags&2064&&i!==null)i.return=s,H=i;else e:for(;H!==null;){if(s=H,s.flags&2048)switch(s.tag){case 0:case 11:case 15:zs(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,H=m;break e}H=s.return}}var v=e.current;for(H=v;H!==null;){i=H;var w=i.child;if(i.subtreeFlags&2064&&w!==null)w.return=i,H=w;else e:for(i=v;H!==null;){if(a=H,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Cl(9,a)}}catch(_){Oe(a,a.return,_)}if(a===i){H=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,H=S;break e}H=a.return}}if(de=o,xr(),yn&&typeof yn.onPostCommitFiberRoot=="function")try{yn.onPostCommitFiberRoot(gl,e)}catch{}r=!0}return r}finally{we=n,Vt.transition=t}}return!1}function yp(e,t,n){t=$o(n,t),t=Gy(e,t,1),e=cr(e,t,1),t=at(),e!==null&&(wi(e,1,t),wt(e,t))}function Oe(e,t,n){if(e.tag===3)yp(e,e,n);else for(;t!==null;){if(t.tag===3){yp(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ur===null||!ur.has(r))){e=$o(n,e),e=Wy(t,e,1),t=cr(t,e,1),e=at(),t!==null&&(wi(t,1,e),wt(t,e));break}}t=t.return}}function IS(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=at(),e.pingedLanes|=e.suspendedLanes&n,qe===e&&(Qe&n)===n&&(He===4||He===3&&(Qe&130023424)===Qe&&500>De()-uf?jr(e,0):cf|=n),wt(e,t)}function d0(e,t){t===0&&(e.mode&1?(t=Bi,Bi<<=1,!(Bi&130023424)&&(Bi=4194304)):t=1);var n=at();e=jn(e,t),e!==null&&(wi(e,t,n),wt(e,n))}function kS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),d0(e,n)}function MS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(U(314))}r!==null&&r.delete(t),d0(e,n)}var f0;f0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||vt.current)gt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return gt=!1,mS(e,t,n);gt=!!(e.flags&131072)}else gt=!1,Ne&&t.flags&1048576&&gy(t,Va,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ya(e,t),e=t.pendingProps;var o=Oo(t,rt.current);No(t,n),o=nf(null,t,r,e,o,n);var s=rf();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xt(r)?(s=!0,Ua(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Kd(t),o.updater=_l,t.stateNode=o,o._reactInternals=t,Lu(t,r,e,n),t=Du(null,t,r,!0,s,n)):(t.tag=0,Ne&&s&&Gd(t),st(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ya(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=RS(r),e=Zt(r,e),o){case 0:t=Bu(null,t,r,e,n);break e;case 1:t=ap(null,t,r,e,n);break e;case 11:t=sp(null,t,r,e,n);break e;case 14:t=ip(null,t,r,Zt(r.type,e),n);break e}throw Error(U(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),Bu(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),ap(e,t,r,o,n);case 3:e:{if(Xy(t),e===null)throw Error(U(387));r=t.pendingProps,s=t.memoizedState,o=s.element,Sy(e,t),Ha(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=$o(Error(U(423)),t),t=lp(e,t,r,n,o);break e}else if(r!==o){o=$o(Error(U(424)),t),t=lp(e,t,r,n,o);break e}else for(kt=lr(t.stateNode.containerInfo.firstChild),Mt=t,Ne=!0,en=null,n=wy(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Bo(),r===o){t=Ln(e,t,n);break e}st(e,t,r,n)}t=t.child}return t;case 5:return _y(t),e===null&&zu(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,Pu(r,o)?i=null:s!==null&&Pu(r,s)&&(t.flags|=32),qy(e,t),st(e,t,i,n),t.child;case 6:return e===null&&zu(t),null;case 13:return Qy(e,t,n);case 4:return Zd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Do(t,null,r,n):st(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),sp(e,t,r,o,n);case 7:return st(e,t,t.pendingProps,n),t.child;case 8:return st(e,t,t.pendingProps.children,n),t.child;case 12:return st(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value,Ee(Ga,r._currentValue),r._currentValue=i,s!==null)if(sn(s.value,i)){if(s.children===o.children&&!vt.current){t=Ln(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){i=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=An(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Fu(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(U(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Fu(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}st(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,No(t,n),o=Ht(o),r=r(o),t.flags|=1,st(e,t,r,n),t.child;case 14:return r=t.type,o=Zt(r,t.pendingProps),o=Zt(r.type,o),ip(e,t,r,o,n);case 15:return Hy(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),ya(e,t),t.tag=1,xt(r)?(e=!0,Ua(t)):e=!1,No(t,n),Vy(t,r,o),Lu(t,r,o,n),Du(null,t,r,!0,e,n);case 19:return Ky(e,t,n);case 22:return Yy(e,t,n)}throw Error(U(156,t.tag))};function h0(e,t){return Dg(e,t)}function PS(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $t(e,t,n,r){return new PS(e,t,n,r)}function pf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function RS(e){if(typeof e=="function")return pf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Nd)return 11;if(e===Ad)return 14}return 2}function fr(e,t){var n=e.alternate;return n===null?(n=$t(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function wa(e,t,n,r,o,s){var i=2;if(r=e,typeof e=="function")pf(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case go:return Lr(n.children,o,s,t);case Td:i=8,o|=8;break;case au:return e=$t(12,n,t,o|2),e.elementType=au,e.lanes=s,e;case lu:return e=$t(13,n,t,o),e.elementType=lu,e.lanes=s,e;case cu:return e=$t(19,n,t,o),e.elementType=cu,e.lanes=s,e;case _g:return Il(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case bg:i=10;break e;case Sg:i=9;break e;case Nd:i=11;break e;case Ad:i=14;break e;case Kn:i=16,r=null;break e}throw Error(U(130,e==null?e:typeof e,""))}return t=$t(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function Lr(e,t,n,r){return e=$t(7,e,r,t),e.lanes=n,e}function Il(e,t,n,r){return e=$t(22,e,r,t),e.elementType=_g,e.lanes=n,e.stateNode={isHidden:!1},e}function Nc(e,t,n){return e=$t(6,e,null,t),e.lanes=n,e}function Ac(e,t,n){return t=$t(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function TS(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hc(0),this.expirationTimes=hc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hc(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function mf(e,t,n,r,o,s,i,a,l){return e=new TS(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=$t(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Kd(s),e}function NS(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:mo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function p0(e){if(!e)return pr;e=e._reactInternals;e:{if(Qr(e)!==e||e.tag!==1)throw Error(U(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(xt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(U(171))}if(e.tag===1){var n=e.type;if(xt(n))return py(e,n,t)}return t}function m0(e,t,n,r,o,s,i,a,l){return e=mf(n,r,!0,e,o,s,i,a,l),e.context=p0(null),n=e.current,r=at(),o=dr(n),s=An(r,o),s.callback=t??null,cr(n,s,o),e.current.lanes=o,wi(e,o,r),wt(e,r),e}function kl(e,t,n,r){var o=t.current,s=at(),i=dr(o);return n=p0(n),t.context===null?t.context=n:t.pendingContext=n,t=An(s,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=cr(o,t,i),e!==null&&(on(e,o,i,s),pa(e,o,i)),i}function el(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function vp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gf(e,t){vp(e,t),(e=e.alternate)&&vp(e,t)}function AS(){return null}var g0=typeof reportError=="function"?reportError:function(e){console.error(e)};function yf(e){this._internalRoot=e}Ml.prototype.render=yf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(U(409));kl(e,t,null,null)};Ml.prototype.unmount=yf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Gr(function(){kl(null,e,null,null)}),t[Fn]=null}};function Ml(e){this._internalRoot=e}Ml.prototype.unstable_scheduleHydration=function(e){if(e){var t=Yg();e={blockedOn:null,target:e,priority:t};for(var n=0;n<er.length&&t!==0&&t<er[n].priority;n++);er.splice(n,0,e),n===0&&Xg(e)}};function vf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Pl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function xp(){}function zS(e,t,n,r,o){if(o){if(typeof r=="function"){var s=r;r=function(){var c=el(i);s.call(c)}}var i=m0(t,r,e,0,null,!1,!1,"",xp);return e._reactRootContainer=i,e[Fn]=i.current,Xs(e.nodeType===8?e.parentNode:e),Gr(),i}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=el(l);a.call(c)}}var l=mf(e,0,!1,null,null,!1,!1,"",xp);return e._reactRootContainer=l,e[Fn]=l.current,Xs(e.nodeType===8?e.parentNode:e),Gr(function(){kl(t,l,n,r)}),l}function Rl(e,t,n,r,o){var s=n._reactRootContainer;if(s){var i=s;if(typeof o=="function"){var a=o;o=function(){var l=el(i);a.call(l)}}kl(t,i,e,o)}else i=zS(n,t,e,o,r);return el(i)}Wg=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=bs(t.pendingLanes);n!==0&&(jd(t,n|1),wt(t,De()),!(de&6)&&(Vo=De()+500,xr()))}break;case 13:Gr(function(){var r=jn(e,1);if(r!==null){var o=at();on(r,e,1,o)}}),gf(e,1)}};Ld=function(e){if(e.tag===13){var t=jn(e,134217728);if(t!==null){var n=at();on(t,e,134217728,n)}gf(e,134217728)}};Hg=function(e){if(e.tag===13){var t=dr(e),n=jn(e,t);if(n!==null){var r=at();on(n,e,t,r)}gf(e,t)}};Yg=function(){return we};qg=function(e,t){var n=we;try{return we=e,t()}finally{we=n}};xu=function(e,t,n){switch(t){case"input":if(fu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=wl(r);if(!o)throw Error(U(90));Eg(r),fu(r,o)}}}break;case"textarea":kg(e,n);break;case"select":t=n.value,t!=null&&Mo(e,!!n.multiple,t,!1)}};zg=df;Fg=Gr;var FS={usingClientEntryPoint:!1,Events:[Si,wo,wl,Ng,Ag,df]},gs={findFiberByHostInstance:Ar,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},jS={bundleType:gs.bundleType,version:gs.version,rendererPackageName:gs.rendererPackageName,rendererConfig:gs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Dn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Og(e),e===null?null:e.stateNode},findFiberByHostInstance:gs.findFiberByHostInstance||AS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qi.isDisabled&&Qi.supportsFiber)try{gl=Qi.inject(jS),yn=Qi}catch{}}Tt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=FS;Tt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vf(t))throw Error(U(200));return NS(e,t,null,n)};Tt.createRoot=function(e,t){if(!vf(e))throw Error(U(299));var n=!1,r="",o=g0;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=mf(e,1,!1,null,null,n,!1,r,o),e[Fn]=t.current,Xs(e.nodeType===8?e.parentNode:e),new yf(t)};Tt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(U(188)):(e=Object.keys(e).join(","),Error(U(268,e)));return e=Og(t),e=e===null?null:e.stateNode,e};Tt.flushSync=function(e){return Gr(e)};Tt.hydrate=function(e,t,n){if(!Pl(t))throw Error(U(200));return Rl(null,e,t,!0,n)};Tt.hydrateRoot=function(e,t,n){if(!vf(e))throw Error(U(405));var r=n!=null&&n.hydratedSources||null,o=!1,s="",i=g0;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=m0(t,null,e,1,n??null,o,!1,s,i),e[Fn]=t.current,Xs(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Ml(t)};Tt.render=function(e,t,n){if(!Pl(t))throw Error(U(200));return Rl(null,e,t,!1,n)};Tt.unmountComponentAtNode=function(e){if(!Pl(e))throw Error(U(40));return e._reactRootContainer?(Gr(function(){Rl(null,null,e,!1,function(){e._reactRootContainer=null,e[Fn]=null})}),!0):!1};Tt.unstable_batchedUpdates=df;Tt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Pl(n))throw Error(U(200));if(e==null||e._reactInternals===void 0)throw Error(U(38));return Rl(e,t,n,!1,r)};Tt.version="18.3.1-next-f1338f8080-20240426";function y0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(y0)}catch(e){console.error(e)}}y0(),yg.exports=Tt;var Ci=yg.exports;const LS=Sd(Ci);var wp=Ci;su.createRoot=wp.createRoot,su.hydrateRoot=wp.hydrateRoot;function _e(e,t="Assertion error"){if(!e)throw Error(t)}function Go({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,o)=>(r+=t==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,r),0)}function Zu(e,t){return t.sort(e==="horizontal"?OS:BS)}function OS(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function BS(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function v0(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function x0(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function DS({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let o,s=Number.MAX_VALUE;for(const i of t){const{x:a,y:l}=x0(r,i),c=e==="horizontal"?a:l;c<s&&(s=c,o=i)}return _e(o,"No rect found"),o}function w0(e){const{element:t,orientation:n,panels:r,separators:o}=e,s=Zu(n,Array.from(t.children).filter(v0).map(u=>({element:u}))).map(({element:u})=>u),i=[];let a=!1,l,c=[];for(const u of s)if(u.hasAttribute("data-panel")){const d=r.find(f=>f.element===u);if(d){if(l){const f=l.element.getBoundingClientRect(),y=u.getBoundingClientRect();let p;if(a){const x=n==="horizontal"?new DOMRect(f.right,f.top,0,f.height):new DOMRect(f.left,f.bottom,f.width,0),b=n==="horizontal"?new DOMRect(y.left,y.top,0,y.height):new DOMRect(y.left,y.top,y.width,0);switch(c.length){case 0:{p=[x,b];break}case 1:{const m=c[0],v=DS({orientation:n,rects:[f,y],targetRect:m.element.getBoundingClientRect()});p=[m,v===f?b:x];break}default:{p=c;break}}}else c.length?p=c:p=[n==="horizontal"?new DOMRect(f.right,y.top,y.left-f.right,y.height):new DOMRect(y.left,f.bottom,y.width,y.top-f.bottom)];for(const x of p)i.push({group:e,groupSize:Go({group:e}),panels:[l,d],separator:"width"in x?void 0:x,rect:"width"in x?x:x.element.getBoundingClientRect()})}a=!1,l=d,c=[]}}else if(u.hasAttribute("data-separator")){const d=o.find(f=>f.element===u);d?c.push(d):(l=void 0,c=[])}else a=!0;return i}function US(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function $S(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function VS(e){return e/100*window.innerHeight}function GS(e){return e/100*window.innerWidth}function WS(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function Ki({groupSize:e,panelElement:t,styleProp:n}){let r;const[o,s]=WS(n);switch(s){case"%":{r=o/100*e;break}case"px":{r=o;break}case"rem":{r=$S(t,o);break}case"em":{r=US(t,o);break}case"vh":{r=VS(o);break}case"vw":{r=GS(o);break}}return r}function nn(e){return parseFloat(e.toFixed(3))}function bp(e){const{panels:t}=e,n=Go({group:e});return n===0?t.map(r=>({collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:o,panelConstraints:s}=r;let i=0;if(s.collapsedSize){const u=Ki({groupSize:n,panelElement:o,styleProp:s.collapsedSize});i=nn(u/n*100)}let a;if(s.defaultSize){const u=Ki({groupSize:n,panelElement:o,styleProp:s.defaultSize});a=nn(u/n*100)}let l=0;if(s.minSize){const u=Ki({groupSize:n,panelElement:o,styleProp:s.minSize});l=nn(u/n*100)}let c=100;if(s.maxSize){const u=Ki({groupSize:n,panelElement:o,styleProp:s.maxSize});c=nn(u/n*100)}return{collapsedSize:i,collapsible:s.collapsible===!0,defaultSize:a,minSize:l,maxSize:c,panelId:r.id}})}class HS{#e={};addListener(t,n){const r=this.#e[t];return r===void 0?this.#e[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=this.#e[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let o=!1,s=null;const i=Array.from(r);for(let a=0;a<i.length;a++){const l=i[a];try{l.call(null,n)}catch(c){s===null&&(o=!0,s=c)}}if(o)throw s}}removeAllListeners(){this.#e={}}removeListener(t,n){const r=this.#e[t];if(r!==void 0){const o=r.indexOf(n);o>=0&&r.splice(o,1)}}}function it(e,t,n=0){return Math.abs(nn(e)-nn(t))<=n}let jt={cursorFlags:0,interactionState:{state:"inactive"},mountedGroups:new Map};const Or=new HS;function Gt(){return jt}function yt(e){const t=typeof e=="function"?e(jt):e;if(jt===t)return jt;const n=jt;return jt={...jt,...t},t.cursorFlags!==void 0&&Or.emit("cursorFlagsChange",jt.cursorFlags),t.interactionState!==void 0&&Or.emit("interactionStateChange",jt.interactionState),t.mountedGroups!==void 0&&(jt.mountedGroups.forEach((r,o)=>{r.derivedPanelConstraints.forEach(s=>{if(s.collapsible){const{layout:i}=n.mountedGroups.get(o)??{};if(i){const a=it(s.collapsedSize,r.layout[s.panelId]),l=it(s.collapsedSize,i[s.panelId]);a&&!l&&(o.inMemoryLastExpandedPanelSizes[s.panelId]=i[s.panelId])}}})}),Or.emit("mountedGroupsChange",jt.mountedGroups)),jt}function YS(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function oi(e,t){return it(e,t)?0:e>t?1:-1}function ko({panelConstraints:e,size:t}){const{collapsedSize:n=0,collapsible:r,maxSize:o=100,minSize:s=0}=e;if(oi(t,s)<0)if(r){const i=(n+s)/2;oi(t,i)<0?t=n:t=s}else t=s;return t=Math.min(o,t),t=nn(t),t}function si({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:s}){if(it(e,0))return t;const i=Object.values(t),a=Object.values(o),l=[...i],[c,u]=r;_e(c!=null,"Invalid first pivot index"),_e(u!=null,"Invalid second pivot index");let d=0;if(s==="keyboard"){{const p=e<0?u:c,x=n[p];_e(x,`Panel constraints not found for index ${p}`);const{collapsedSize:b=0,collapsible:m,minSize:v=0}=x;if(m){const w=i[p];if(_e(w!=null,`Previous layout not found for panel index ${p}`),it(w,b)){const S=v-w;oi(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}{const p=e<0?c:u,x=n[p];_e(x,`No panel constraints found for index ${p}`);const{collapsedSize:b=0,collapsible:m,minSize:v=0}=x;if(m){const w=i[p];if(_e(w!=null,`Previous layout not found for panel index ${p}`),it(w,v)){const S=w-b;oi(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}}{const p=e<0?1:-1;let x=e<0?u:c,b=0;for(;;){const v=i[x];_e(v!=null,`Previous layout not found for panel index ${x}`);const w=ko({panelConstraints:n[x],size:100})-v;if(b+=w,x+=p,x<0||x>=n.length)break}const m=Math.min(Math.abs(e),Math.abs(b));e=e<0?0-m:m}{let p=e<0?c:u;for(;p>=0&&p<n.length;){const x=Math.abs(e)-Math.abs(d),b=i[p];_e(b!=null,`Previous layout not found for panel index ${p}`);const m=b-x,v=ko({panelConstraints:n[p],size:m});if(!it(b,v)&&(d+=b-v,l[p]=v,d.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?p--:p++}}if(YS(a,l))return o;{const p=e<0?u:c,x=i[p];_e(x!=null,`Previous layout not found for panel index ${p}`);const b=x+d,m=ko({panelConstraints:n[p],size:b});if(l[p]=m,!it(m,b)){let v=b-m,w=e<0?u:c;for(;w>=0&&w<n.length;){const S=l[w];_e(S!=null,`Previous layout not found for panel index ${w}`);const _=S+v,I=ko({panelConstraints:n[w],size:_});if(it(S,I)||(v-=I-S,l[w]=I),it(v,0))break;e>0?w--:w++}}}const f=Object.values(l).reduce((p,x)=>x+p,0);if(!it(f,100,.1))return o;const y=Object.keys(o);return l.reduce((p,x,b)=>(p[y[b]]=x,p),{})}function ba(e){const{mountedGroups:t}=Gt();for(const[n]of t)if(n.separators.some(r=>r.element===e))return n;throw Error("Could not find parent Group for separator element")}function Wr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||oi(e[n],t[n])!==0)return!1;return!0}function Hr({layout:e,panelConstraints:t}){const n=[...Object.values(e)],r=n.reduce((i,a)=>i+a,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!it(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const a=n[i];_e(a!=null,`No layout data found for index ${i}`);const l=100/r*a;n[i]=l}let o=0;for(let i=0;i<t.length;i++){const a=n[i];_e(a!=null,`No layout data found for index ${i}`);const l=ko({panelConstraints:t[i],size:a});a!=l&&(o+=a-l,n[i]=l)}if(!it(o,0))for(let i=0;i<t.length;i++){const a=n[i];_e(a!=null,`No layout data found for index ${i}`);const l=a+o,c=ko({panelConstraints:t[i],size:l});if(a!==c&&(o-=c-a,n[i]=c,it(o,0)))break}const s=Object.keys(e);return n.reduce((i,a,l)=>(i[s[l]]=a,i),{})}function b0({groupId:e}){const t=()=>{const{mountedGroups:n}=Gt();for(const[r,o]of n)if(r.id===e)return{group:r,...o};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:o,group:s,layout:i,separatorToPanels:a}=t(),l=Hr({layout:n,panelConstraints:o});return r?i:(Wr(i,l)||yt(c=>({mountedGroups:new Map(c.mountedGroups).set(s,{defaultLayoutDeferred:r,derivedPanelConstraints:o,layout:l,separatorToPanels:a})})),l)}}}function S0(e){const{mountedGroups:t}=Gt(),n=t.get(e);return _e(n,`Mounted Group ${e.id} not found`),n}function Er(e,t){const n=ba(e),r=S0(n),o=n.separators.find(u=>u.element===e);_e(o,"Matching separator not found");const s=r.separatorToPanels.get(o);_e(s,"Matching panels not found");const i=s.map(u=>n.panels.indexOf(u)),a=b0({groupId:n.id}).getLayout(),l=si({delta:t,initialLayout:a,panelConstraints:r.derivedPanelConstraints,pivotIndices:i,prevLayout:a,trigger:"keyboard"}),c=Hr({layout:l,panelConstraints:r.derivedPanelConstraints});Wr(a,c)||yt(u=>({mountedGroups:new Map(u.mountedGroups).set(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,layout:c,separatorToPanels:r.separatorToPanels})}))}function Sp(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=ba(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Er(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Er(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Er(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Er(t,-5);break}case"End":{e.preventDefault(),Er(t,100);break}case"Enter":{e.preventDefault();const r=ba(t),{derivedPanelConstraints:o,layout:s,separatorToPanels:i}=S0(r),a=r.separators.find(d=>d.element===t);_e(a,"Matching separator not found");const l=i.get(a);_e(l,"Matching panels not found");const c=l[0],u=o.find(d=>d.panelId===c.id);if(_e(u,"Panel metadata not found"),u.collapsible){const d=s[c.id],f=u.collapsedSize===d?r.inMemoryLastExpandedPanelSizes[c.id]??u.minSize:u.collapsedSize;Er(t,f-d)}break}case"F6":{e.preventDefault();const r=ba(t).separators.map(i=>i.element),o=Array.from(r).findIndex(i=>i===e.currentTarget);_e(o!==null,"Index not found");const s=e.shiftKey?o>0?o-1:r.length-1:o+1<r.length?o+1:0;r[s].focus();break}case"Home":{e.preventDefault(),Er(t,-100);break}}}const qS=e=>e,zc=()=>{},_0=1,C0=2,E0=4,I0=8,_p={coarse:10,precise:5};function XS(e,t,n){let r,o={x:1/0,y:1/0};for(const s of t){const i=x0(n,s.rect);switch(e){case"horizontal":{i.x<=o.x&&(r=s,o=i);break}case"vertical":{i.y<=o.y&&(r=s,o=i);break}}}return r?{distance:o,hitRegion:r}:void 0}let Zi;function QS(){return Zi===void 0&&(typeof matchMedia=="function"?Zi=!!matchMedia("(pointer:coarse)").matches:Zi=!1),Zi}function KS(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function ZS(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Ip(e),b:Ip(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;_e(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:Ep(Cp(n.a)),b:Ep(Cp(n.b))};if(o.a===o.b){const s=r.childNodes,i={a:n.a.at(-1),b:n.b.at(-1)};let a=s.length;for(;a--;){const l=s[a];if(l===i.a)return 1;if(l===i.b)return-1}}return Math.sign(o.a-o.b)}const JS=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function e_(e){const t=getComputedStyle(k0(e)??e).display;return t==="flex"||t==="inline-flex"}function t_(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||e_(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||JS.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Cp(e){let t=e.length;for(;t--;){const n=e[t];if(_e(n,"Missing node"),t_(n))return n}return null}function Ep(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ip(e){const t=[];for(;e;)t.push(e),e=k0(e);return t}function k0(e){const{parentNode:t}=e;return KS(t)?t.host:t}function n_(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function r_({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!v0(n)||n.contains(e)||e.contains(n))return!0;if(ZS(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(n_(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function M0(e,t){const n=[];return t.forEach((r,o)=>{if(o.disabled)return;const s=QS()?_p.coarse:_p.precise,i=w0(o),a=XS(o.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=s&&a.distance.y<=s&&r_({groupElement:o.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function kp(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const{mountedGroups:t}=Gt(),n=M0(e,t),r=new Set,o=new Set,s=new Set,i=new Map;let a=!1;n.forEach(l=>{r.add(l.group),l.panels.forEach(u=>{o.add(u)}),l.separator&&(s.add(l.separator),a||(a=!0,l.separator.element.focus()));const c=t.get(l.group);c&&i.set(l.group,c.layout)}),yt({interactionState:{hitRegions:n,initialLayoutMap:i,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}}),n.length&&e.preventDefault()}function o_({cursorFlags:e,groups:t,state:n}){let r=0,o=0;switch(n){case"active":case"hover":t.forEach(s=>{if(!s.disableCursor)switch(s.orientation){case"horizontal":{r++;break}case"vertical":{o++;break}}})}if(r===0&&o===0)return null;switch(n){case"active":{const s=(e&_0)!==0,i=(e&C0)!==0,a=(e&E0)!==0,l=(e&I0)!==0;if(e){if(s)return a?"se-resize":l?"ne-resize":"e-resize";if(i)return a?"sw-resize":l?"nw-resize":"w-resize";if(a)return"s-resize";if(l)return"n-resize"}break}}return r>0&&o>0?"move":r>0?"ew-resize":"ns-resize"}const Mp=new WeakMap;function xf(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=Mp.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets=[n]);const{cursorFlags:r,interactionState:o}=Gt();switch(o.state){case"active":case"hover":{const s=o_({cursorFlags:r,groups:o.hitRegions.map(a=>a.group),state:o.state}),i=`*{cursor: ${s} !important; ${o.state==="active"?"touch-action: none;":""} }`;if(t===i)return;t=i,s?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}Mp.set(e,{prevStyle:t,styleSheet:n})}function P0({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:o,pointerDownAtPoint:s}){let i=0;const a=new Map(o);n.forEach(l=>{const{group:c,groupSize:u}=l,{disableCursor:d,orientation:f,panels:y}=c;let p=0;s?f==="horizontal"?p=(t.clientX-s.x)/u*100:p=(t.clientY-s.y)/u*100:f==="horizontal"?p=t.clientX<0?-100:100:p=t.clientY<0?-100:100;const x=r.get(c),{defaultLayoutDeferred:b,derivedPanelConstraints:m,layout:v,separatorToPanels:w}=o.get(c)??{defaultLayoutDeferred:!1};if(m&&x&&v&&w){const S=si({delta:p,initialLayout:x,panelConstraints:m,pivotIndices:l.panels.map(_=>y.indexOf(_)),prevLayout:v,trigger:"mouse-or-touch"});if(Wr(S,v)){if(p!==0&&!d)switch(f){case"horizontal":{i|=p<0?_0:C0;break}case"vertical":{i|=p<0?E0:I0;break}}}else{a.set(l.group,{defaultLayoutDeferred:b,derivedPanelConstraints:m,layout:S,separatorToPanels:w});const _=l.group.panels.map(({id:I})=>I).join(",");l.group.inMemoryLayouts[_]=S}}}),yt({cursorFlags:i,mountedGroups:a}),xf(e)}function Pp(e){const{interactionState:t,mountedGroups:n}=Gt();switch(t.state){case"active":P0({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n})}}function Rp(e){if(e.defaultPrevented)return;const{interactionState:t,mountedGroups:n}=Gt();switch(t.state){case"active":{if(e.buttons===0){yt(r=>r.interactionState.state==="inactive"?r:{cursorFlags:0,interactionState:{state:"inactive"}}),yt(r=>({mountedGroups:new Map(r.mountedGroups)}));return}P0({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint});break}default:{const r=M0(e,n);r.length===0?t.state!=="inactive"&&yt({interactionState:{state:"inactive"}}):yt({interactionState:{hitRegions:r,state:"hover"}}),xf(e.currentTarget);break}}}function Tp(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const{interactionState:t}=Gt();switch(t.state){case"active":yt({cursorFlags:0,interactionState:{state:"inactive"}}),t.hitRegions.length>0&&(xf(e.currentTarget),yt(n=>({mountedGroups:new Map(n.mountedGroups)})),e.preventDefault())}}function Np(e){let t=0,n=0;const r={};for(const s of e)if(s.defaultSize!==void 0){t++;const i=nn(s.defaultSize);n+=i,r[s.panelId]=i}else r[s.panelId]=void 0;const o=e.length-t;if(o!==0){const s=nn((100-n)/o);for(const i of e)i.defaultSize===void 0&&(r[i.panelId]=s)}return r}function s_(e,t,n){if(!n[0])return;const r=e.panels.find(l=>l.element===t);if(!r||!r.onResize)return;const o=Go({group:e}),s=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,i=r.mutableValues.prevSize,a={asPercentage:nn(s/o*100),inPixels:s};r.mutableValues.prevSize=a,r.onResize(a,r.id,i)}function i_(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function a_(e,t){const n=e.map(o=>o.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!r.includes(o))return!1;return!0}const oo=new Map;function l_(e){let t=!0;_e(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,o=new Set,s=new n(p=>{for(const x of p){const{borderBoxSize:b,target:m}=x;if(m===e.element){if(t){if(Go({group:e})===0)return;yt(v=>{const w=v.mountedGroups.get(e);if(w){const S=bp(e),_=w.defaultLayoutDeferred?Np(S):w.layout,I=Hr({layout:_,panelConstraints:S});return!w.defaultLayoutDeferred&&Wr(_,I)&&i_(w.derivedPanelConstraints,S)?v:{mountedGroups:new Map(v.mountedGroups).set(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:S,layout:I,separatorToPanels:w.separatorToPanels})}}return v})}}else s_(e,m,b)}});s.observe(e.element),e.panels.forEach(p=>{_e(!r.has(p.id),`Panel ids must be unique; id "${p.id}" was used more than once`),r.add(p.id),p.onResize&&s.observe(p.element)});const i=Go({group:e}),a=bp(e),l=e.panels.map(({id:p})=>p).join(",");let c=e.defaultLayout;c&&(a_(e.panels,c)||(c=void 0));const u=e.inMemoryLayouts[l]??c??Np(a),d=Hr({layout:u,panelConstraints:a}),f=w0(e),y=e.element.ownerDocument;return yt(p=>{const x=new Map;return oo.set(y,(oo.get(y)??0)+1),f.forEach(b=>{b.separator&&x.set(b.separator,b.panels)}),{mountedGroups:new Map(p.mountedGroups).set(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:a,layout:d,separatorToPanels:x})}}),e.separators.forEach(p=>{_e(!o.has(p.id),`Separator ids must be unique; id "${p.id}" was used more than once`),o.add(p.id),p.element.addEventListener("keydown",Sp)}),oo.get(y)===1&&(y.addEventListener("pointerdown",kp,!0),y.addEventListener("pointerleave",Pp),y.addEventListener("pointermove",Rp),y.addEventListener("pointerup",Tp,!0)),function(){t=!1,oo.set(y,Math.max(0,(oo.get(y)??0)-1)),yt(p=>{const x=new Map(p.mountedGroups);return x.delete(e),{mountedGroups:x}}),e.separators.forEach(p=>{p.element.removeEventListener("keydown",Sp)}),oo.get(y)||(y.removeEventListener("pointerdown",kp,!0),y.removeEventListener("pointerleave",Pp),y.removeEventListener("pointermove",Rp),y.removeEventListener("pointerup",Tp,!0)),s.disconnect()}}function R0(){const[e,t]=g.useState({}),n=g.useCallback(()=>t({}),[]);return[e,n]}function wf(e){const t=g.useId();return`${e??t}`}const Kr=typeof window<"u"?g.useLayoutEffect:g.useEffect;function Ls(e){const t=g.useRef(e);return Kr(()=>{t.current=e},[e]),g.useCallback((...n)=>t.current?.(...n),[t])}function bf(...e){return Ls(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function c_(e){const t=g.useRef({...e});return Kr(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const T0=g.createContext(null);function u_(e,t){const n=g.useRef({getLayout:()=>({}),setLayout:qS});g.useImperativeHandle(t,()=>n.current,[]),Kr(()=>{Object.assign(n.current,b0({groupId:e}))})}function N0({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:o,elementRef:s,groupRef:i,id:a,onLayoutChange:l,onLayoutChanged:c,orientation:u="horizontal",style:d,...f}){const y=g.useRef({onLayoutChange:{},onLayoutChanged:{}}),p=Ls(M=>{Wr(y.current.onLayoutChange,M)||(y.current.onLayoutChange=M,l?.(M))}),x=Ls(M=>{Wr(y.current.onLayoutChanged,M)||(y.current.onLayoutChanged=M,c?.(M))}),b=wf(a),m=g.useRef(null),[v,w]=R0(),S=g.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],separators:[]}),_=bf(m,s);u_(b,i);const I=Ls((M,N)=>{const{interactionState:A,mountedGroups:j}=Gt();for(const L of j.keys())if(L.id===M){const F=j.get(L);if(F){let O=!1;switch(A.state){case"active":{O=A.hitRegions.some(V=>V.group===L);break}}return{flexGrow:F.layout[N]??1,pointerEvents:O?"none":void 0}}}return{flexGrow:n?.[N]??1}}),C=g.useMemo(()=>({getPanelStyles:I,id:b,orientation:u,registerPanel:M=>{const N=S.current;return N.panels=Zu(u,[...N.panels,M]),w(),()=>{N.panels=N.panels.filter(A=>A!==M),w()}},registerSeparator:M=>{const N=S.current;return N.separators=Zu(u,[...N.separators,M]),w(),()=>{N.separators=N.separators.filter(A=>A!==M),w()}}}),[I,b,w,u]),E=c_({defaultLayout:n,disableCursor:r}),R=g.useRef(null);return Kr(()=>{const M=m.current;if(M===null)return;const N=S.current,A={defaultLayout:E.defaultLayout,disableCursor:!!E.disableCursor,disabled:!!o,element:M,id:b,inMemoryLastExpandedPanelSizes:S.current.lastExpandedPanelSizes,inMemoryLayouts:S.current.layouts,orientation:u,panels:N.panels,separators:N.separators};R.current=A;const j=l_(A),L=Gt().mountedGroups.get(A);if(L){const{defaultLayoutDeferred:V,derivedPanelConstraints:k,layout:T}=L;!V&&k.length>0&&(p(T),x(T),N.panels.forEach($=>{$.scheduleUpdate()}))}const F=Or.addListener("interactionStateChange",()=>{N.panels.forEach(V=>{V.scheduleUpdate()})}),O=Or.addListener("mountedGroupsChange",V=>{const k=V.get(A);if(k){const{defaultLayoutDeferred:T,derivedPanelConstraints:$,layout:ne}=k;if(T||$.length===0)return;const{interactionState:W}=Gt(),Q=W.state!=="active";p(ne),Q&&x(ne),N.panels.forEach(ee=>{ee.scheduleUpdate()})}});return()=>{R.current=null,j(),F(),O()}},[o,b,x,p,u,v,E]),g.useEffect(()=>{const M=R.current;M&&(M.defaultLayout=n,M.disableCursor=!!r)}),h.jsx(T0.Provider,{value:C,children:h.jsx("div",{...f,"aria-orientation":u,className:t,"data-group":!0,"data-testid":b,id:b,ref:_,style:{height:"100%",width:"100%",overflow:"hidden",...d,display:"flex",flexDirection:u==="horizontal"?"row":"column",flexWrap:"nowrap"},children:e})})}N0.displayName="Group";function Sf(){const e=g.useContext(T0);return _e(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function d_({groupId:e,panelId:t}){const n=()=>{const{mountedGroups:a}=Gt();for(const[l,{defaultLayoutDeferred:c,derivedPanelConstraints:u,layout:d,separatorToPanels:f}]of a)if(l.id===e)return{defaultLayoutDeferred:c,derivedPanelConstraints:u,group:l,layout:d,separatorToPanels:f};throw Error(`Group ${e} not found`)},r=()=>{const a=n().derivedPanelConstraints.find(l=>l.panelId===t);if(a!==void 0)return a;throw Error(`Panel constraints not found for Panel ${t}`)},o=()=>{const a=n().group.panels.find(l=>l.id===t);if(a!==void 0)return a;throw Error(`Layout not found for Panel ${t}`)},s=()=>{const a=n().layout[t];if(a!==void 0)return a;throw Error(`Layout not found for Panel ${t}`)},i=a=>{const l=s();if(a===l)return;const{defaultLayoutDeferred:c,derivedPanelConstraints:u,group:d,layout:f,separatorToPanels:y}=n(),p=d.panels.findIndex(v=>v.id===t),x=p===d.panels.length-1,b=si({delta:x?l-a:a-l,initialLayout:f,panelConstraints:u,pivotIndices:x?[p-1,p]:[p,p+1],prevLayout:f,trigger:"imperative-api"}),m=Hr({layout:b,panelConstraints:u});Wr(f,m)||yt(v=>({mountedGroups:new Map(v.mountedGroups).set(d,{defaultLayoutDeferred:c,derivedPanelConstraints:u,layout:m,separatorToPanels:y})}))};return{collapse:()=>{const{collapsible:a,collapsedSize:l}=r(),{mutableValues:c}=o(),u=s();a&&u!==l&&(c.expandToSize=u,i(l))},expand:()=>{const{collapsible:a,collapsedSize:l,minSize:c}=r(),{mutableValues:u}=o(),d=s();if(a&&d===l){let f=u.expandToSize??c;f===0&&(f=1),i(f)}},getSize:()=>{const{group:a}=n(),l=s(),{element:c}=o(),u=a.orientation==="horizontal"?c.offsetWidth:c.offsetHeight;return{asPercentage:l,inPixels:u}},isCollapsed:()=>{const{collapsible:a,collapsedSize:l}=r(),c=s();return a&&it(l,c)},resize:a=>{if(s()!==a){let l;switch(typeof a){case"number":{const{group:c}=n(),u=Go({group:c});l=nn(a/u*100);break}case"string":{l=parseFloat(a);break}}i(l)}}}}function f_(e,t){const{id:n}=Sf(),r=g.useRef({collapse:zc,expand:zc,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:zc});g.useImperativeHandle(t,()=>r.current,[]),Kr(()=>{Object.assign(r.current,d_({groupId:n,panelId:e}))})}function Sa({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:o,elementRef:s,id:i,maxSize:a="100%",minSize:l="0%",onResize:c,panelRef:u,style:d,...f}){const y=!!i,p=wf(i),x=g.useRef(null),b=bf(x,s),[,m]=R0(),{getPanelStyles:v,id:w,registerPanel:S}=Sf(),_=c!==null,I=Ls((E,R,M)=>{c?.(E,i,M)});Kr(()=>{const E=x.current;if(E!==null)return S({element:E,id:p,idIsStable:y,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:_?I:void 0,panelConstraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},scheduleUpdate:m})},[n,r,o,m,_,p,y,a,l,I,S]),f_(p,u);const C=v(w,p);return h.jsx("div",{...f,"data-panel":!0,"data-testid":p,id:p,ref:b,style:{...h_,flexBasis:0,flexShrink:1,overflow:"hidden",...C},children:h.jsx("div",{className:t,style:{width:"100%",height:"100%",...d},children:e})})}Sa.displayName="Panel";const h_={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function p_({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let o,s;const i=e[n],a=t.find(l=>l.panelId===n);if(a){const l=a.maxSize,c=s=a.collapsible?a.collapsedSize:a.minSize,u=[r,r+1];s=Hr({layout:si({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e,trigger:"keyboard"}),panelConstraints:t})[n],o=Hr({layout:si({delta:l-i,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e,trigger:"keyboard"}),panelConstraints:t})[n]}return{valueControls:n,valueMax:o,valueMin:s,valueNow:i}}function Ju({children:e,className:t,elementRef:n,id:r,style:o,...s}){const i=wf(r),[a,l]=g.useState({}),[c,u]=g.useState("inactive"),d=g.useRef(null),f=bf(d,n),{id:y,orientation:p,registerSeparator:x}=Sf(),b=p==="horizontal"?"vertical":"horizontal";return Kr(()=>{const m=d.current;if(m!==null){const v={element:m,id:i},w=x(v),S=Or.addListener("interactionStateChange",I=>{u(I.state!=="inactive"&&I.hitRegions.some(C=>C.separator===v)?I.state:"inactive")}),_=Or.addListener("mountedGroupsChange",I=>{I.forEach(({derivedPanelConstraints:C,layout:E,separatorToPanels:R},M)=>{if(M.id===y){const N=R.get(v);if(N){const A=N[0],j=M.panels.indexOf(A);l(p_({layout:E,panelConstraints:C,panelId:A.id,panelIndex:j}))}}})});return()=>{S(),_(),w()}}},[y,i,x]),h.jsx("div",{...s,"aria-controls":a.valueControls,"aria-orientation":b,"aria-valuemax":a.valueMax,"aria-valuemin":a.valueMin,"aria-valuenow":a.valueNow,children:e,className:t,"data-separator":c,"data-testid":i,id:i,ref:f,role:"separator",style:{flexBasis:"auto",...o,flexGrow:0,flexShrink:0},tabIndex:0})}Ju.displayName="Separator";function te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function Ap(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ei(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ap(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ap(e[o],null)}}}}function je(...e){return g.useCallback(Ei(...e),e)}function Un(e,t=[]){let n=[];function r(s,i){const a=g.createContext(i),l=n.length;n=[...n,i];const c=d=>{const{scope:f,children:y,...p}=d,x=f?.[e]?.[l]||a,b=g.useMemo(()=>p,Object.values(p));return h.jsx(x.Provider,{value:b,children:y})};c.displayName=s+"Provider";function u(d,f){const y=f?.[e]?.[l]||a,p=g.useContext(y);if(p)return p;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[c,u]}const o=()=>{const s=n.map(i=>g.createContext(i));return function(a){const l=a?.[e]||s;return g.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,m_(o,...t)]}function m_(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function tl(e){const t=g_(e),n=g.forwardRef((r,o)=>{const{children:s,...i}=r,a=g.Children.toArray(s),l=a.find(v_);if(l){const c=l.props.children,u=a.map(d=>d===l?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return h.jsx(t,{...i,ref:o,children:g.isValidElement(c)?g.cloneElement(c,void 0,u):null})}return h.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function g_(e){const t=g.forwardRef((n,r)=>{const{children:o,...s}=n;if(g.isValidElement(o)){const i=w_(o),a=x_(s,o.props);return o.type!==g.Fragment&&(a.ref=r?Ei(r,i):i),g.cloneElement(o,a)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var A0=Symbol("radix.slottable");function y_(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=A0,t}function v_(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===A0}function x_(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function w_(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var b_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],be=b_.reduce((e,t)=>{const n=tl(`Primitive.${t}`),r=g.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function z0(e,t){e&&Ci.flushSync(()=>e.dispatchEvent(t))}function nt(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>t.current?.(...n),[])}function S_(e,t=globalThis?.document){const n=nt(e);g.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var __="DismissableLayer",ed="dismissableLayer.update",C_="dismissableLayer.pointerDownOutside",E_="dismissableLayer.focusOutside",zp,F0=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_f=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,c=g.useContext(F0),[u,d]=g.useState(null),f=u?.ownerDocument??globalThis?.document,[,y]=g.useState({}),p=je(t,C=>d(C)),x=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),m=x.indexOf(b),v=u?x.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,S=v>=m,_=M_(C=>{const E=C.target,R=[...c.branches].some(M=>M.contains(E));!S||R||(o?.(C),i?.(C),C.defaultPrevented||a?.())},f),I=P_(C=>{const E=C.target;[...c.branches].some(M=>M.contains(E))||(s?.(C),i?.(C),C.defaultPrevented||a?.())},f);return S_(C=>{v===c.layers.size-1&&(r?.(C),!C.defaultPrevented&&a&&(C.preventDefault(),a()))},f),g.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(zp=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Fp(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=zp)}},[u,f,n,c]),g.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Fp())},[u,c]),g.useEffect(()=>{const C=()=>y({});return document.addEventListener(ed,C),()=>document.removeEventListener(ed,C)},[]),h.jsx(be.div,{...l,ref:p,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:te(e.onFocusCapture,I.onFocusCapture),onBlurCapture:te(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:te(e.onPointerDownCapture,_.onPointerDownCapture)})});_f.displayName=__;var I_="DismissableLayerBranch",k_=g.forwardRef((e,t)=>{const n=g.useContext(F0),r=g.useRef(null),o=je(t,r);return g.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),h.jsx(be.div,{...e,ref:o})});k_.displayName=I_;function M_(e,t=globalThis?.document){const n=nt(e),r=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){j0(C_,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function P_(e,t=globalThis?.document){const n=nt(e),r=g.useRef(!1);return g.useEffect(()=>{const o=s=>{s.target&&!r.current&&j0(E_,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Fp(){const e=new CustomEvent(ed);document.dispatchEvent(e)}function j0(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?z0(o,s):o.dispatchEvent(s)}var wn=globalThis?.document?g.useLayoutEffect:()=>{},R_=kd[" useId ".trim().toString()]||(()=>{}),T_=0;function Wo(e){const[t,n]=g.useState(R_());return wn(()=>{n(r=>r??String(T_++))},[e]),t?`radix-${t}`:""}const N_=["top","right","bottom","left"],mr=Math.min,Et=Math.max,nl=Math.round,Ji=Math.floor,xn=e=>({x:e,y:e}),A_={left:"right",right:"left",bottom:"top",top:"bottom"},z_={start:"end",end:"start"};function td(e,t,n){return Et(e,mr(t,n))}function On(e,t){return typeof e=="function"?e(t):e}function Bn(e){return e.split("-")[0]}function ts(e){return e.split("-")[1]}function Cf(e){return e==="x"?"y":"x"}function Ef(e){return e==="y"?"height":"width"}const F_=new Set(["top","bottom"]);function gn(e){return F_.has(Bn(e))?"y":"x"}function If(e){return Cf(gn(e))}function j_(e,t,n){n===void 0&&(n=!1);const r=ts(e),o=If(e),s=Ef(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=rl(i)),[i,rl(i)]}function L_(e){const t=rl(e);return[nd(e),t,nd(t)]}function nd(e){return e.replace(/start|end/g,t=>z_[t])}const jp=["left","right"],Lp=["right","left"],O_=["top","bottom"],B_=["bottom","top"];function D_(e,t,n){switch(e){case"top":case"bottom":return n?t?Lp:jp:t?jp:Lp;case"left":case"right":return t?O_:B_;default:return[]}}function U_(e,t,n,r){const o=ts(e);let s=D_(Bn(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(nd)))),s}function rl(e){return e.replace(/left|right|bottom|top/g,t=>A_[t])}function $_(e){return{top:0,right:0,bottom:0,left:0,...e}}function L0(e){return typeof e!="number"?$_(e):{top:e,right:e,bottom:e,left:e}}function ol(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Op(e,t,n){let{reference:r,floating:o}=e;const s=gn(t),i=If(t),a=Ef(i),l=Bn(t),c=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let y;switch(l){case"top":y={x:u,y:r.y-o.height};break;case"bottom":y={x:u,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:d};break;case"left":y={x:r.x-o.width,y:d};break;default:y={x:r.x,y:r.y}}switch(ts(t)){case"start":y[i]-=f*(n&&c?-1:1);break;case"end":y[i]+=f*(n&&c?-1:1);break}return y}const V_=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Op(c,r,l),f=r,y={},p=0;for(let x=0;x<a.length;x++){const{name:b,fn:m}=a[x],{x:v,y:w,data:S,reset:_}=await m({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:y,rects:c,platform:i,elements:{reference:e,floating:t}});u=v??u,d=w??d,y={...y,[b]:{...y[b],...S}},_&&p<=50&&(p++,typeof _=="object"&&(_.placement&&(f=_.placement),_.rects&&(c=_.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):_.rects),{x:u,y:d}=Op(c,f,l)),x=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:y}};async function ii(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:y=0}=On(t,e),p=L0(y),b=a[f?d==="floating"?"reference":"floating":d],m=ol(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},_=ol(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:l}):v);return{top:(m.top-_.top+p.top)/S.y,bottom:(_.bottom-m.bottom+p.bottom)/S.y,left:(m.left-_.left+p.left)/S.x,right:(_.right-m.right+p.right)/S.x}}const G_=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=On(e,t)||{};if(c==null)return{};const d=L0(u),f={x:n,y:r},y=If(o),p=Ef(y),x=await i.getDimensions(c),b=y==="y",m=b?"top":"left",v=b?"bottom":"right",w=b?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[y]-f[y]-s.floating[p],_=f[y]-s.reference[y],I=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let C=I?I[w]:0;(!C||!await(i.isElement==null?void 0:i.isElement(I)))&&(C=a.floating[w]||s.floating[p]);const E=S/2-_/2,R=C/2-x[p]/2-1,M=mr(d[m],R),N=mr(d[v],R),A=M,j=C-x[p]-N,L=C/2-x[p]/2+E,F=td(A,L,j),O=!l.arrow&&ts(o)!=null&&L!==F&&s.reference[p]/2-(L<A?M:N)-x[p]/2<0,V=O?L<A?L-A:L-j:0;return{[y]:f[y]+V,data:{[y]:F,centerOffset:L-F-V,...O&&{alignmentOffset:V}},reset:O}}}),W_=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:x=!0,...b}=On(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const m=Bn(o),v=gn(a),w=Bn(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=f||(w||!x?[rl(a)]:L_(a)),I=p!=="none";!f&&I&&_.push(...U_(a,x,p,S));const C=[a,..._],E=await ii(t,b),R=[];let M=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&R.push(E[m]),d){const L=j_(o,i,S);R.push(E[L[0]],E[L[1]])}if(M=[...M,{placement:o,overflows:R}],!R.every(L=>L<=0)){var N,A;const L=(((N=s.flip)==null?void 0:N.index)||0)+1,F=C[L];if(F&&(!(d==="alignment"?v!==gn(F):!1)||M.every(k=>gn(k.placement)===v?k.overflows[0]>0:!0)))return{data:{index:L,overflows:M},reset:{placement:F}};let O=(A=M.filter(V=>V.overflows[0]<=0).sort((V,k)=>V.overflows[1]-k.overflows[1])[0])==null?void 0:A.placement;if(!O)switch(y){case"bestFit":{var j;const V=(j=M.filter(k=>{if(I){const T=gn(k.placement);return T===v||T==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(T=>T>0).reduce((T,$)=>T+$,0)]).sort((k,T)=>k[1]-T[1])[0])==null?void 0:j[0];V&&(O=V);break}case"initialPlacement":O=a;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function Bp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Dp(e){return N_.some(t=>e[t]>=0)}const H_=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=On(e,t);switch(r){case"referenceHidden":{const s=await ii(t,{...o,elementContext:"reference"}),i=Bp(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Dp(i)}}}case"escaped":{const s=await ii(t,{...o,altBoundary:!0}),i=Bp(s,n.floating);return{data:{escapedOffsets:i,escaped:Dp(i)}}}default:return{}}}}},O0=new Set(["left","top"]);async function Y_(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Bn(n),a=ts(n),l=gn(n)==="y",c=O0.has(i)?-1:1,u=s&&l?-1:1,d=On(t,e);let{mainAxis:f,crossAxis:y,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(y=a==="end"?p*-1:p),l?{x:y*u,y:f*c}:{x:f*c,y:y*u}}const q_=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await Y_(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},X_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:b=>{let{x:m,y:v}=b;return{x:m,y:v}}},...l}=On(e,t),c={x:n,y:r},u=await ii(t,l),d=gn(Bn(o)),f=Cf(d);let y=c[f],p=c[d];if(s){const b=f==="y"?"top":"left",m=f==="y"?"bottom":"right",v=y+u[b],w=y-u[m];y=td(v,y,w)}if(i){const b=d==="y"?"top":"left",m=d==="y"?"bottom":"right",v=p+u[b],w=p-u[m];p=td(v,p,w)}const x=a.fn({...t,[f]:y,[d]:p});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[f]:s,[d]:i}}}}}},Q_=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=On(e,t),u={x:n,y:r},d=gn(o),f=Cf(d);let y=u[f],p=u[d];const x=On(a,t),b=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(l){const w=f==="y"?"height":"width",S=s.reference[f]-s.floating[w]+b.mainAxis,_=s.reference[f]+s.reference[w]-b.mainAxis;y<S?y=S:y>_&&(y=_)}if(c){var m,v;const w=f==="y"?"width":"height",S=O0.has(Bn(o)),_=s.reference[d]-s.floating[w]+(S&&((m=i.offset)==null?void 0:m[d])||0)+(S?0:b.crossAxis),I=s.reference[d]+s.reference[w]+(S?0:((v=i.offset)==null?void 0:v[d])||0)-(S?b.crossAxis:0);p<_?p=_:p>I&&(p=I)}return{[f]:y,[d]:p}}}},K_=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=On(e,t),u=await ii(t,c),d=Bn(o),f=ts(o),y=gn(o)==="y",{width:p,height:x}=s.floating;let b,m;d==="top"||d==="bottom"?(b=d,m=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(m=d,b=f==="end"?"top":"bottom");const v=x-u.top-u.bottom,w=p-u.left-u.right,S=mr(x-u[b],v),_=mr(p-u[m],w),I=!t.middlewareData.shift;let C=S,E=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),I&&!f){const M=Et(u.left,0),N=Et(u.right,0),A=Et(u.top,0),j=Et(u.bottom,0);y?E=p-2*(M!==0||N!==0?M+N:Et(u.left,u.right)):C=x-2*(A!==0||j!==0?A+j:Et(u.top,u.bottom))}await l({...t,availableWidth:E,availableHeight:C});const R=await i.getDimensions(a.floating);return p!==R.width||x!==R.height?{reset:{rects:!0}}:{}}}};function Tl(){return typeof window<"u"}function ns(e){return B0(e)?(e.nodeName||"").toLowerCase():"#document"}function Pt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Sn(e){var t;return(t=(B0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function B0(e){return Tl()?e instanceof Node||e instanceof Pt(e).Node:!1}function an(e){return Tl()?e instanceof Element||e instanceof Pt(e).Element:!1}function bn(e){return Tl()?e instanceof HTMLElement||e instanceof Pt(e).HTMLElement:!1}function Up(e){return!Tl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Pt(e).ShadowRoot}const Z_=new Set(["inline","contents"]);function Ii(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ln(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Z_.has(o)}const J_=new Set(["table","td","th"]);function eC(e){return J_.has(ns(e))}const tC=[":popover-open",":modal"];function Nl(e){return tC.some(t=>{try{return e.matches(t)}catch{return!1}})}const nC=["transform","translate","scale","rotate","perspective"],rC=["transform","translate","scale","rotate","perspective","filter"],oC=["paint","layout","strict","content"];function kf(e){const t=Mf(),n=an(e)?ln(e):e;return nC.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||rC.some(r=>(n.willChange||"").includes(r))||oC.some(r=>(n.contain||"").includes(r))}function sC(e){let t=gr(e);for(;bn(t)&&!Ho(t);){if(kf(t))return t;if(Nl(t))return null;t=gr(t)}return null}function Mf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const iC=new Set(["html","body","#document"]);function Ho(e){return iC.has(ns(e))}function ln(e){return Pt(e).getComputedStyle(e)}function Al(e){return an(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gr(e){if(ns(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Up(e)&&e.host||Sn(e);return Up(t)?t.host:t}function D0(e){const t=gr(e);return Ho(t)?e.ownerDocument?e.ownerDocument.body:e.body:bn(t)&&Ii(t)?t:D0(t)}function ai(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=D0(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Pt(o);if(s){const a=rd(i);return t.concat(i,i.visualViewport||[],Ii(o)?o:[],a&&n?ai(a):[])}return t.concat(o,ai(o,[],n))}function rd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function U0(e){const t=ln(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=bn(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=nl(n)!==s||nl(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Pf(e){return an(e)?e:e.contextElement}function zo(e){const t=Pf(e);if(!bn(t))return xn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=U0(t);let i=(s?nl(n.width):n.width)/r,a=(s?nl(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const aC=xn(0);function $0(e){const t=Pt(e);return!Mf()||!t.visualViewport?aC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lC(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Pt(e)?!1:t}function Yr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Pf(e);let i=xn(1);t&&(r?an(r)&&(i=zo(r)):i=zo(e));const a=lC(s,n,r)?$0(s):xn(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const f=Pt(s),y=r&&an(r)?Pt(r):r;let p=f,x=rd(p);for(;x&&r&&y!==p;){const b=zo(x),m=x.getBoundingClientRect(),v=ln(x),w=m.left+(x.clientLeft+parseFloat(v.paddingLeft))*b.x,S=m.top+(x.clientTop+parseFloat(v.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=w,c+=S,p=Pt(x),x=rd(p)}}return ol({width:u,height:d,x:l,y:c})}function zl(e,t){const n=Al(e).scrollLeft;return t?t.left+n:Yr(Sn(e)).left+n}function V0(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-zl(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function cC(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Sn(r),a=t?Nl(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=xn(1);const u=xn(0),d=bn(r);if((d||!d&&!s)&&((ns(r)!=="body"||Ii(i))&&(l=Al(r)),bn(r))){const y=Yr(r);c=zo(r),u.x=y.x+r.clientLeft,u.y=y.y+r.clientTop}const f=i&&!d&&!s?V0(i,l):xn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function uC(e){return Array.from(e.getClientRects())}function dC(e){const t=Sn(e),n=Al(e),r=e.ownerDocument.body,o=Et(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Et(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+zl(e);const a=-n.scrollTop;return ln(r).direction==="rtl"&&(i+=Et(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const $p=25;function fC(e,t){const n=Pt(e),r=Sn(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const u=Mf();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=zl(r);if(c<=0){const u=r.ownerDocument,d=u.body,f=getComputedStyle(d),y=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,p=Math.abs(r.clientWidth-d.clientWidth-y);p<=$p&&(s-=p)}else c<=$p&&(s+=c);return{width:s,height:i,x:a,y:l}}const hC=new Set(["absolute","fixed"]);function pC(e,t){const n=Yr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=bn(e)?zo(e):xn(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function Vp(e,t,n){let r;if(t==="viewport")r=fC(e,n);else if(t==="document")r=dC(Sn(e));else if(an(t))r=pC(t,n);else{const o=$0(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ol(r)}function G0(e,t){const n=gr(e);return n===t||!an(n)||Ho(n)?!1:ln(n).position==="fixed"||G0(n,t)}function mC(e,t){const n=t.get(e);if(n)return n;let r=ai(e,[],!1).filter(a=>an(a)&&ns(a)!=="body"),o=null;const s=ln(e).position==="fixed";let i=s?gr(e):e;for(;an(i)&&!Ho(i);){const a=ln(i),l=kf(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&hC.has(o.position)||Ii(i)&&!l&&G0(e,i))?r=r.filter(u=>u!==i):o=a,i=gr(i)}return t.set(e,r),r}function gC(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Nl(t)?[]:mC(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,u)=>{const d=Vp(t,u,o);return c.top=Et(d.top,c.top),c.right=mr(d.right,c.right),c.bottom=mr(d.bottom,c.bottom),c.left=Et(d.left,c.left),c},Vp(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function yC(e){const{width:t,height:n}=U0(e);return{width:t,height:n}}function vC(e,t,n){const r=bn(t),o=Sn(t),s=n==="fixed",i=Yr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=xn(0);function c(){l.x=zl(o)}if(r||!r&&!s)if((ns(t)!=="body"||Ii(o))&&(a=Al(t)),r){const y=Yr(t,!0,s,t);l.x=y.x+t.clientLeft,l.y=y.y+t.clientTop}else o&&c();s&&!r&&o&&c();const u=o&&!r&&!s?V0(o,a):xn(0),d=i.left+a.scrollLeft-l.x-u.x,f=i.top+a.scrollTop-l.y-u.y;return{x:d,y:f,width:i.width,height:i.height}}function Fc(e){return ln(e).position==="static"}function Gp(e,t){if(!bn(e)||ln(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Sn(e)===n&&(n=n.ownerDocument.body),n}function W0(e,t){const n=Pt(e);if(Nl(e))return n;if(!bn(e)){let o=gr(e);for(;o&&!Ho(o);){if(an(o)&&!Fc(o))return o;o=gr(o)}return n}let r=Gp(e,t);for(;r&&eC(r)&&Fc(r);)r=Gp(r,t);return r&&Ho(r)&&Fc(r)&&!kf(r)?n:r||sC(e)||n}const xC=async function(e){const t=this.getOffsetParent||W0,n=this.getDimensions,r=await n(e.floating);return{reference:vC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wC(e){return ln(e).direction==="rtl"}const bC={convertOffsetParentRelativeRectToViewportRelativeRect:cC,getDocumentElement:Sn,getClippingRect:gC,getOffsetParent:W0,getElementRects:xC,getClientRects:uC,getDimensions:yC,getScale:zo,isElement:an,isRTL:wC};function H0(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function SC(e,t){let n=null,r;const o=Sn(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:y}=c;if(a||t(),!f||!y)return;const p=Ji(d),x=Ji(o.clientWidth-(u+f)),b=Ji(o.clientHeight-(d+y)),m=Ji(u),w={rootMargin:-p+"px "+-x+"px "+-b+"px "+-m+"px",threshold:Et(0,mr(1,l))||1};let S=!0;function _(I){const C=I[0].intersectionRatio;if(C!==l){if(!S)return i();C?i(!1,C):r=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!H0(c,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(_,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(_,w)}n.observe(e)}return i(!0),s}function _C(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Pf(e),u=o||s?[...c?ai(c):[],...ai(t)]:[];u.forEach(m=>{o&&m.addEventListener("scroll",n,{passive:!0}),s&&m.addEventListener("resize",n)});const d=c&&a?SC(c,n):null;let f=-1,y=null;i&&(y=new ResizeObserver(m=>{let[v]=m;v&&v.target===c&&y&&(y.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=y)==null||w.observe(t)})),n()}),c&&!l&&y.observe(c),y.observe(t));let p,x=l?Yr(e):null;l&&b();function b(){const m=Yr(e);x&&!H0(x,m)&&n(),x=m,p=requestAnimationFrame(b)}return n(),()=>{var m;u.forEach(v=>{o&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d?.(),(m=y)==null||m.disconnect(),y=null,l&&cancelAnimationFrame(p)}}const CC=q_,EC=X_,IC=W_,kC=K_,MC=H_,Wp=G_,PC=Q_,RC=(e,t,n)=>{const r=new Map,o={platform:bC,...n},s={...o.platform,_c:r};return V_(e,t,{...o,platform:s})};var TC=typeof document<"u",NC=function(){},_a=TC?g.useLayoutEffect:NC;function sl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!sl(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!sl(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Y0(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hp(e,t){const n=Y0(e);return Math.round(t*n)/n}function jc(e){const t=g.useRef(e);return _a(()=>{t.current=e}),t}function AC(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,y]=g.useState(r);sl(f,r)||y(r);const[p,x]=g.useState(null),[b,m]=g.useState(null),v=g.useCallback(k=>{k!==I.current&&(I.current=k,x(k))},[]),w=g.useCallback(k=>{k!==C.current&&(C.current=k,m(k))},[]),S=s||p,_=i||b,I=g.useRef(null),C=g.useRef(null),E=g.useRef(u),R=l!=null,M=jc(l),N=jc(o),A=jc(c),j=g.useCallback(()=>{if(!I.current||!C.current)return;const k={placement:t,strategy:n,middleware:f};N.current&&(k.platform=N.current),RC(I.current,C.current,k).then(T=>{const $={...T,isPositioned:A.current!==!1};L.current&&!sl(E.current,$)&&(E.current=$,Ci.flushSync(()=>{d($)}))})},[f,t,n,N,A]);_a(()=>{c===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(k=>({...k,isPositioned:!1})))},[c]);const L=g.useRef(!1);_a(()=>(L.current=!0,()=>{L.current=!1}),[]),_a(()=>{if(S&&(I.current=S),_&&(C.current=_),S&&_){if(M.current)return M.current(S,_,j);j()}},[S,_,j,M,R]);const F=g.useMemo(()=>({reference:I,floating:C,setReference:v,setFloating:w}),[v,w]),O=g.useMemo(()=>({reference:S,floating:_}),[S,_]),V=g.useMemo(()=>{const k={position:n,left:0,top:0};if(!O.floating)return k;const T=Hp(O.floating,u.x),$=Hp(O.floating,u.y);return a?{...k,transform:"translate("+T+"px, "+$+"px)",...Y0(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:T,top:$}},[n,a,O.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:j,refs:F,elements:O,floatingStyles:V}),[u,j,F,O,V])}const zC=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Wp({element:r.current,padding:o}).fn(n):{}:r?Wp({element:r,padding:o}).fn(n):{}}}},FC=(e,t)=>({...CC(e),options:[e,t]}),jC=(e,t)=>({...EC(e),options:[e,t]}),LC=(e,t)=>({...PC(e),options:[e,t]}),OC=(e,t)=>({...IC(e),options:[e,t]}),BC=(e,t)=>({...kC(e),options:[e,t]}),DC=(e,t)=>({...MC(e),options:[e,t]}),UC=(e,t)=>({...zC(e),options:[e,t]});var $C="Arrow",q0=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return h.jsx(be.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});q0.displayName=$C;var VC=q0;function GC(e){const[t,n]=g.useState(void 0);return wn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Rf="Popper",[X0,Fl]=Un(Rf),[WC,Q0]=X0(Rf),K0=e=>{const{__scopePopper:t,children:n}=e,[r,o]=g.useState(null);return h.jsx(WC,{scope:t,anchor:r,onAnchorChange:o,children:n})};K0.displayName=Rf;var Z0="PopperAnchor",J0=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Q0(Z0,n),i=g.useRef(null),a=je(t,i),l=g.useRef(null);return g.useEffect(()=>{const c=l.current;l.current=r?.current||i.current,c!==l.current&&s.onAnchorChange(l.current)}),r?null:h.jsx(be.div,{...o,ref:a})});J0.displayName=Z0;var Tf="PopperContent",[HC,YC]=X0(Tf),ev=g.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:y="optimized",onPlaced:p,...x}=e,b=Q0(Tf,n),[m,v]=g.useState(null),w=je(t,oe=>v(oe)),[S,_]=g.useState(null),I=GC(S),C=I?.width??0,E=I?.height??0,R=r+(s!=="center"?"-"+s:""),M=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},N=Array.isArray(c)?c:[c],A=N.length>0,j={padding:M,boundary:N.filter(XC),altBoundary:A},{refs:L,floatingStyles:F,placement:O,isPositioned:V,middlewareData:k}=AC({strategy:"fixed",placement:R,whileElementsMounted:(...oe)=>_C(...oe,{animationFrame:y==="always"}),elements:{reference:b.anchor},middleware:[FC({mainAxis:o+E,alignmentAxis:i}),l&&jC({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?LC():void 0,...j}),l&&OC({...j}),BC({...j,apply:({elements:oe,rects:Se,availableWidth:Cn,availableHeight:dt})=>{const{width:$n,height:Vn}=Se.reference,br=oe.floating.style;br.setProperty("--radix-popper-available-width",`${Cn}px`),br.setProperty("--radix-popper-available-height",`${dt}px`),br.setProperty("--radix-popper-anchor-width",`${$n}px`),br.setProperty("--radix-popper-anchor-height",`${Vn}px`)}}),S&&UC({element:S,padding:a}),QC({arrowWidth:C,arrowHeight:E}),f&&DC({strategy:"referenceHidden",...j})]}),[T,$]=rv(O),ne=nt(p);wn(()=>{V&&ne?.()},[V,ne]);const W=k.arrow?.x,Q=k.arrow?.y,ee=k.arrow?.centerOffset!==0,[fe,Re]=g.useState();return wn(()=>{m&&Re(window.getComputedStyle(m).zIndex)},[m]),h.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:V?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[k.transformOrigin?.x,k.transformOrigin?.y].join(" "),...k.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(HC,{scope:n,placedSide:T,onArrowChange:_,arrowX:W,arrowY:Q,shouldHideArrow:ee,children:h.jsx(be.div,{"data-side":T,"data-align":$,...x,ref:w,style:{...x.style,animation:V?void 0:"none"}})})})});ev.displayName=Tf;var tv="PopperArrow",qC={top:"bottom",right:"left",bottom:"top",left:"right"},nv=g.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=YC(tv,r),i=qC[s.placedSide];return h.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:h.jsx(VC,{...o,ref:n,style:{...o.style,display:"block"}})})});nv.displayName=tv;function XC(e){return e!==null}var QC=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,u]=rv(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(o.arrow?.x??0)+a/2,y=(o.arrow?.y??0)+l/2;let p="",x="";return c==="bottom"?(p=i?d:`${f}px`,x=`${-l}px`):c==="top"?(p=i?d:`${f}px`,x=`${r.floating.height+l}px`):c==="right"?(p=`${-l}px`,x=i?d:`${y}px`):c==="left"&&(p=`${r.floating.width+l}px`,x=i?d:`${y}px`),{data:{x:p,y:x}}}});function rv(e){const[t,n="center"]=e.split("-");return[t,n]}var ov=K0,sv=J0,iv=ev,av=nv,KC="Portal",Nf=g.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=g.useState(!1);wn(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?LS.createPortal(h.jsx(be.div,{...r,ref:t}),i):null});Nf.displayName=KC;function ZC(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var At=e=>{const{present:t,children:n}=e,r=JC(t),o=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),s=je(r.ref,eE(o));return typeof n=="function"||r.isPresent?g.cloneElement(o,{ref:s}):null};At.displayName="Presence";function JC(e){const[t,n]=g.useState(),r=g.useRef(null),o=g.useRef(e),s=g.useRef("none"),i=e?"mounted":"unmounted",[a,l]=ZC(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=ea(r.current);s.current=a==="mounted"?c:"none"},[a]),wn(()=>{const c=r.current,u=o.current;if(u!==e){const f=s.current,y=ea(c);e?l("MOUNT"):y==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&f!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),wn(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=y=>{const x=ea(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&x&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},f=y=>{y.target===t&&(s.current=ea(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function ea(e){return e?.animationName||"none"}function eE(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tE=kd[" useInsertionEffect ".trim().toString()]||wn;function ki({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=nE({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const u=g.useRef(e!==void 0);g.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const c=g.useCallback(u=>{if(a){const d=rE(u)?u(e):u;d!==e&&i.current?.(d)}else s(u)},[a,e,s,i]);return[l,c]}function nE({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),o=g.useRef(n),s=g.useRef(t);return tE(()=>{s.current=t},[t]),g.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function rE(e){return typeof e=="function"}var oE=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),sE="VisuallyHidden",lv=g.forwardRef((e,t)=>h.jsx(be.span,{...e,ref:t,style:{...oE,...e.style}}));lv.displayName=sE;var iE=lv,[jl]=Un("Tooltip",[Fl]),Ll=Fl(),cv="TooltipProvider",aE=700,od="tooltip.open",[lE,Af]=jl(cv),uv=e=>{const{__scopeTooltip:t,delayDuration:n=aE,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=g.useRef(!0),a=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),h.jsx(lE,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:g.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:s})};uv.displayName=cv;var li="Tooltip",[cE,Mi]=jl(li),dv=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,l=Af(li,e.__scopeTooltip),c=Ll(t),[u,d]=g.useState(null),f=Wo(),y=g.useRef(0),p=i??l.disableHoverableContent,x=a??l.delayDuration,b=g.useRef(!1),[m,v]=ki({prop:r,defaultProp:o??!1,onChange:C=>{C?(l.onOpen(),document.dispatchEvent(new CustomEvent(od))):l.onClose(),s?.(C)},caller:li}),w=g.useMemo(()=>m?b.current?"delayed-open":"instant-open":"closed",[m]),S=g.useCallback(()=>{window.clearTimeout(y.current),y.current=0,b.current=!1,v(!0)},[v]),_=g.useCallback(()=>{window.clearTimeout(y.current),y.current=0,v(!1)},[v]),I=g.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{b.current=!0,v(!0),y.current=0},x)},[x,v]);return g.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),h.jsx(ov,{...c,children:h.jsx(cE,{scope:t,contentId:f,open:m,stateAttribute:w,trigger:u,onTriggerChange:d,onTriggerEnter:g.useCallback(()=>{l.isOpenDelayedRef.current?I():S()},[l.isOpenDelayedRef,I,S]),onTriggerLeave:g.useCallback(()=>{p?_():(window.clearTimeout(y.current),y.current=0)},[_,p]),onOpen:S,onClose:_,disableHoverableContent:p,children:n})})};dv.displayName=li;var sd="TooltipTrigger",fv=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Mi(sd,n),s=Af(sd,n),i=Ll(n),a=g.useRef(null),l=je(t,a,o.onTriggerChange),c=g.useRef(!1),u=g.useRef(!1),d=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),h.jsx(sv,{asChild:!0,...i,children:h.jsx(be.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:te(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:te(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:te(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:te(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:te(e.onBlur,o.onClose),onClick:te(e.onClick,o.onClose)})})});fv.displayName=sd;var zf="TooltipPortal",[uE,dE]=jl(zf,{forceMount:void 0}),hv=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Mi(zf,t);return h.jsx(uE,{scope:t,forceMount:n,children:h.jsx(At,{present:n||s.open,children:h.jsx(Nf,{asChild:!0,container:o,children:r})})})};hv.displayName=zf;var Yo="TooltipContent",pv=g.forwardRef((e,t)=>{const n=dE(Yo,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Mi(Yo,e.__scopeTooltip);return h.jsx(At,{present:r||i.open,children:i.disableHoverableContent?h.jsx(mv,{side:o,...s,ref:t}):h.jsx(fE,{side:o,...s,ref:t})})}),fE=g.forwardRef((e,t)=>{const n=Mi(Yo,e.__scopeTooltip),r=Af(Yo,e.__scopeTooltip),o=g.useRef(null),s=je(t,o),[i,a]=g.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,f=g.useCallback(()=>{a(null),d(!1)},[d]),y=g.useCallback((p,x)=>{const b=p.currentTarget,m={x:p.clientX,y:p.clientY},v=yE(m,b.getBoundingClientRect()),w=vE(m,v),S=xE(x.getBoundingClientRect()),_=bE([...w,...S]);a(_),d(!0)},[d]);return g.useEffect(()=>()=>f(),[f]),g.useEffect(()=>{if(l&&u){const p=b=>y(b,u),x=b=>y(b,l);return l.addEventListener("pointerleave",p),u.addEventListener("pointerleave",x),()=>{l.removeEventListener("pointerleave",p),u.removeEventListener("pointerleave",x)}}},[l,u,y,f]),g.useEffect(()=>{if(i){const p=x=>{const b=x.target,m={x:x.clientX,y:x.clientY},v=l?.contains(b)||u?.contains(b),w=!wE(m,i);v?f():w&&(f(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[l,u,i,c,f]),h.jsx(mv,{...e,ref:s})}),[hE,pE]=jl(li,{isInside:!1}),mE=y_("TooltipContent"),mv=g.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=Mi(Yo,n),c=Ll(n),{onClose:u}=l;return g.useEffect(()=>(document.addEventListener(od,u),()=>document.removeEventListener(od,u)),[u]),g.useEffect(()=>{if(l.trigger){const d=f=>{f.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),h.jsx(_f,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:h.jsxs(iv,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(mE,{children:r}),h.jsx(hE,{scope:n,isInside:!0,children:h.jsx(iE,{id:l.contentId,role:"tooltip",children:o||r})})]})})});pv.displayName=Yo;var gv="TooltipArrow",gE=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ll(n);return pE(gv,n).isInside?null:h.jsx(av,{...o,...r,ref:t})});gE.displayName=gv;function yE(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function vE(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function xE(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function wE(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],c=a.x,u=a.y,d=l.x,f=l.y;u>r!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(o=!o)}return o}function bE(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),SE(t)}function SE(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var _E=uv,CE=dv,EE=fv,IE=hv,yv=pv;function vv(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=vv(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function xv(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=vv(e))&&(r&&(r+=" "),r+=t);return r}const kE=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},ME=(e,t)=>({classGroupId:e,validator:t}),wv=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),il="-",Yp=[],PE="arbitrary..",RE=e=>{const t=NE(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return TE(i);const a=i.split(il),l=a[0]===""&&a.length>1?1:0;return bv(a,l,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const l=r[i],c=n[i];return l?c?kE(c,l):l:c||Yp}return n[i]||Yp}}},bv=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const c=bv(e,t+1,s);if(c)return c}const i=n.validators;if(i===null)return;const a=t===0?e.join(il):e.slice(t).join(il),l=i.length;for(let c=0;c<l;c++){const u=i[c];if(u.validator(a))return u.classGroupId}},TE=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?PE+r:void 0})(),NE=e=>{const{theme:t,classGroups:n}=e;return AE(n,t)},AE=(e,t)=>{const n=wv();for(const r in e){const o=e[r];Ff(o,n,r,t)}return n},Ff=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];zE(i,t,n,r)}},zE=(e,t,n,r)=>{if(typeof e=="string"){FE(e,t,n);return}if(typeof e=="function"){jE(e,t,n,r);return}LE(e,t,n,r)},FE=(e,t,n)=>{const r=e===""?t:Sv(t,e);r.classGroupId=n},jE=(e,t,n,r)=>{if(OE(e)){Ff(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ME(n,e))},LE=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[a,l]=o[i];Ff(l,Sv(t,a),n,r)}},Sv=(e,t)=>{let n=e;const r=t.split(il),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=n.nextPart.get(i);a||(a=wv(),n.nextPart.set(i,a)),n=a}return n},OE=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,BE=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},id="!",qp=":",DE=[],Xp=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),UE=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,l=0,c;const u=o.length;for(let x=0;x<u;x++){const b=o[x];if(i===0&&a===0){if(b===qp){s.push(o.slice(l,x)),l=x+1;continue}if(b==="/"){c=x;continue}}b==="["?i++:b==="]"?i--:b==="("?a++:b===")"&&a--}const d=s.length===0?o:o.slice(l);let f=d,y=!1;d.endsWith(id)?(f=d.slice(0,-1),y=!0):d.startsWith(id)&&(f=d.slice(1),y=!0);const p=c&&c>l?c-l:void 0;return Xp(s,y,f,p)};if(t){const o=t+qp,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):Xp(DE,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},$E=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",l=t.has(i);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},VE=e=>({cache:BE(e.cacheSize),parseClassName:UE(e),sortModifiers:$E(e),...RE(e)}),GE=/\s+/,WE=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(GE);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:f,hasImportantModifier:y,baseClassName:p,maybePostfixModifierPosition:x}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let b=!!x,m=r(b?p.substring(0,x):p);if(!m){if(!b){l=u+(l.length>0?" "+l:l);continue}if(m=r(p),!m){l=u+(l.length>0?" "+l:l);continue}b=!1}const v=f.length===0?"":f.length===1?f[0]:s(f).join(":"),w=y?v+id:v,S=w+m;if(i.indexOf(S)>-1)continue;i.push(S);const _=o(m,b);for(let I=0;I<_.length;++I){const C=_[I];i.push(w+C)}l=u+(l.length>0?" "+l:l)}return l},HE=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=_v(n))&&(o&&(o+=" "),o+=r);return o},_v=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=_v(e[r]))&&(n&&(n+=" "),n+=t);return n},YE=(e,...t)=>{let n,r,o,s;const i=l=>{const c=t.reduce((u,d)=>d(u),e());return n=VE(c),r=n.cache.get,o=n.cache.set,s=a,a(l)},a=l=>{const c=r(l);if(c)return c;const u=WE(l,n);return o(l,u),u};return s=i,(...l)=>s(HE(...l))},qE=[],Ge=e=>{const t=n=>n[e]||qE;return t.isThemeGetter=!0,t},Cv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ev=/^\((?:(\w[\w-]*):)?(.+)\)$/i,XE=/^\d+\/\d+$/,QE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,KE=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ZE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,JE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,so=e=>XE.test(e),le=e=>!!e&&!Number.isNaN(Number(e)),qn=e=>!!e&&Number.isInteger(Number(e)),Lc=e=>e.endsWith("%")&&le(e.slice(0,-1)),kn=e=>QE.test(e),tI=()=>!0,nI=e=>KE.test(e)&&!ZE.test(e),Iv=()=>!1,rI=e=>JE.test(e),oI=e=>eI.test(e),sI=e=>!Y(e)&&!q(e),iI=e=>rs(e,Pv,Iv),Y=e=>Cv.test(e),Ir=e=>rs(e,Rv,nI),Oc=e=>rs(e,dI,le),Qp=e=>rs(e,kv,Iv),aI=e=>rs(e,Mv,oI),ta=e=>rs(e,Tv,rI),q=e=>Ev.test(e),ys=e=>os(e,Rv),lI=e=>os(e,fI),Kp=e=>os(e,kv),cI=e=>os(e,Pv),uI=e=>os(e,Mv),na=e=>os(e,Tv,!0),rs=(e,t,n)=>{const r=Cv.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},os=(e,t,n=!1)=>{const r=Ev.exec(e);return r?r[1]?t(r[1]):n:!1},kv=e=>e==="position"||e==="percentage",Mv=e=>e==="image"||e==="url",Pv=e=>e==="length"||e==="size"||e==="bg-size",Rv=e=>e==="length",dI=e=>e==="number",fI=e=>e==="family-name",Tv=e=>e==="shadow",hI=()=>{const e=Ge("color"),t=Ge("font"),n=Ge("text"),r=Ge("font-weight"),o=Ge("tracking"),s=Ge("leading"),i=Ge("breakpoint"),a=Ge("container"),l=Ge("spacing"),c=Ge("radius"),u=Ge("shadow"),d=Ge("inset-shadow"),f=Ge("text-shadow"),y=Ge("drop-shadow"),p=Ge("blur"),x=Ge("perspective"),b=Ge("aspect"),m=Ge("ease"),v=Ge("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...S(),q,Y],I=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],E=()=>[q,Y,l],R=()=>[so,"full","auto",...E()],M=()=>[qn,"none","subgrid",q,Y],N=()=>["auto",{span:["full",qn,q,Y]},qn,q,Y],A=()=>[qn,"auto",q,Y],j=()=>["auto","min","max","fr",q,Y],L=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...E()],V=()=>[so,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],k=()=>[e,q,Y],T=()=>[...S(),Kp,Qp,{position:[q,Y]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ne=()=>["auto","cover","contain",cI,iI,{size:[q,Y]}],W=()=>[Lc,ys,Ir],Q=()=>["","none","full",c,q,Y],ee=()=>["",le,ys,Ir],fe=()=>["solid","dashed","dotted","double"],Re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[le,Lc,Kp,Qp],Se=()=>["","none",p,q,Y],Cn=()=>["none",le,q,Y],dt=()=>["none",le,q,Y],$n=()=>[le,q,Y],Vn=()=>[so,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[kn],breakpoint:[kn],color:[tI],container:[kn],"drop-shadow":[kn],ease:["in","out","in-out"],font:[sI],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[kn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[kn],shadow:[kn],spacing:["px",le],text:[kn],"text-shadow":[kn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",so,Y,q,b]}],container:["container"],columns:[{columns:[le,Y,q,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[qn,"auto",q,Y]}],basis:[{basis:[so,"full","auto",a,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[le,so,"auto","initial","none",Y]}],grow:[{grow:["",le,q,Y]}],shrink:[{shrink:["",le,q,Y]}],order:[{order:[qn,"first","last","none",q,Y]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":j()}],"auto-rows":[{"auto-rows":j()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...L(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...L()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":L()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],w:[{w:[a,"screen",...V()]}],"min-w":[{"min-w":[a,"screen","none",...V()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,ys,Ir]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,q,Oc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Lc,Y]}],"font-family":[{font:[lI,Y,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,q,Y]}],"line-clamp":[{"line-clamp":[le,"none",q,Oc]}],leading:[{leading:[s,...E()]}],"list-image":[{"list-image":["none",q,Y]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",q,Y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[le,"from-font","auto",q,Ir]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[le,"auto",q,Y]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q,Y]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",q,Y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:T()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qn,q,Y],radial:["",q,Y],conic:[qn,q,Y]},uI,aI]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[le,q,Y]}],"outline-w":[{outline:["",le,ys,Ir]}],"outline-color":[{outline:k()}],shadow:[{shadow:["","none",u,na,ta]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":["none",d,na,ta]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[le,Ir]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":["none",f,na,ta]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[le,q,Y]}],"mix-blend":[{"mix-blend":[...Re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Re()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[le]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[q,Y]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[le]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:T()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",q,Y]}],filter:[{filter:["","none",q,Y]}],blur:[{blur:Se()}],brightness:[{brightness:[le,q,Y]}],contrast:[{contrast:[le,q,Y]}],"drop-shadow":[{"drop-shadow":["","none",y,na,ta]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:["",le,q,Y]}],"hue-rotate":[{"hue-rotate":[le,q,Y]}],invert:[{invert:["",le,q,Y]}],saturate:[{saturate:[le,q,Y]}],sepia:[{sepia:["",le,q,Y]}],"backdrop-filter":[{"backdrop-filter":["","none",q,Y]}],"backdrop-blur":[{"backdrop-blur":Se()}],"backdrop-brightness":[{"backdrop-brightness":[le,q,Y]}],"backdrop-contrast":[{"backdrop-contrast":[le,q,Y]}],"backdrop-grayscale":[{"backdrop-grayscale":["",le,q,Y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[le,q,Y]}],"backdrop-invert":[{"backdrop-invert":["",le,q,Y]}],"backdrop-opacity":[{"backdrop-opacity":[le,q,Y]}],"backdrop-saturate":[{"backdrop-saturate":[le,q,Y]}],"backdrop-sepia":[{"backdrop-sepia":["",le,q,Y]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",q,Y]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[le,"initial",q,Y]}],ease:[{ease:["linear","initial",m,q,Y]}],delay:[{delay:[le,q,Y]}],animate:[{animate:["none",v,q,Y]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,q,Y]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:Cn()}],"rotate-x":[{"rotate-x":Cn()}],"rotate-y":[{"rotate-y":Cn()}],"rotate-z":[{"rotate-z":Cn()}],scale:[{scale:dt()}],"scale-x":[{"scale-x":dt()}],"scale-y":[{"scale-y":dt()}],"scale-z":[{"scale-z":dt()}],"scale-3d":["scale-3d"],skew:[{skew:$n()}],"skew-x":[{"skew-x":$n()}],"skew-y":[{"skew-y":$n()}],transform:[{transform:[q,Y,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Vn()}],"translate-x":[{"translate-x":Vn()}],"translate-y":[{"translate-y":Vn()}],"translate-z":[{"translate-z":Vn()}],"translate-none":["translate-none"],accent:[{accent:k()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",q,Y]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",q,Y]}],fill:[{fill:["none",...k()]}],"stroke-w":[{stroke:[le,ys,Ir,Oc]}],stroke:[{stroke:["none",...k()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},pI=YE(hI);function Ie(...e){return pI(xv(e))}function Bc(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}function mI(e){return e>=1024*1024*1024?(e/(1024*1024*1024)).toFixed(1)+" GB":e>=1024*1024?(e/(1024*1024)).toFixed(0)+" MB":e>=1024?(e/1024).toFixed(0)+" KB":e+" B"}const gI=_E,Ot=CE,Bt=EE,Ct=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(IE,{children:h.jsx(yv,{ref:r,sideOffset:t,className:Ie("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Ct.displayName=yv.displayName;/**
|
|
41
|
+
* @license lucide-react v0.562.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/const yI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vI=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Zp=e=>{const t=vI(e);return t.charAt(0).toUpperCase()+t.slice(1)},Nv=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),xI=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
46
|
+
* @license lucide-react v0.562.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/var wI={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
51
|
+
* @license lucide-react v0.562.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const bI=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>g.createElement("svg",{ref:l,...wI,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Nv("lucide",o),...!s&&!xI(a)&&{"aria-hidden":"true"},...a},[...i.map(([c,u])=>g.createElement(c,u)),...Array.isArray(s)?s:[s]]));/**
|
|
56
|
+
* @license lucide-react v0.562.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/const re=(e,t)=>{const n=g.forwardRef(({className:r,...o},s)=>g.createElement(bI,{ref:s,iconNode:t,className:Nv(`lucide-${yI(Zp(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Zp(e),n};/**
|
|
61
|
+
* @license lucide-react v0.562.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const SI=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],_I=re("arrow-down",SI);/**
|
|
66
|
+
* @license lucide-react v0.562.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const CI=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Jp=re("arrow-left",CI);/**
|
|
71
|
+
* @license lucide-react v0.562.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const EI=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],em=re("arrow-right",EI);/**
|
|
76
|
+
* @license lucide-react v0.562.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const II=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],kI=re("arrow-up",II);/**
|
|
81
|
+
* @license lucide-react v0.562.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const MI=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],ad=re("box",MI);/**
|
|
86
|
+
* @license lucide-react v0.562.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const PI=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],RI=re("boxes",PI);/**
|
|
91
|
+
* @license lucide-react v0.562.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const TI=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],jf=re("building-2",TI);/**
|
|
96
|
+
* @license lucide-react v0.562.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const NI=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]],AI=re("calculator",NI);/**
|
|
101
|
+
* @license lucide-react v0.562.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const zI=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],FI=re("camera",zI);/**
|
|
106
|
+
* @license lucide-react v0.562.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const jI=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],LI=re("check",jI);/**
|
|
111
|
+
* @license lucide-react v0.562.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const OI=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Av=re("chevron-right",OI);/**
|
|
116
|
+
* @license lucide-react v0.562.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const BI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],DI=re("circle-alert",BI);/**
|
|
121
|
+
* @license lucide-react v0.562.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const UI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],$I=re("circle-check",UI);/**
|
|
126
|
+
* @license lucide-react v0.562.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const VI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],GI=re("circle-question-mark",VI);/**
|
|
131
|
+
* @license lucide-react v0.562.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const WI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],HI=re("circle",WI);/**
|
|
136
|
+
* @license lucide-react v0.562.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const YI=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],zv=re("copy",YI);/**
|
|
141
|
+
* @license lucide-react v0.562.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const qI=[["path",{d:"M11 20H2",key:"nlcfvz"}],["path",{d:"M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z",key:"au4z13"}],["path",{d:"M11 4H8a2 2 0 0 0-2 2v14",key:"74r1mk"}],["path",{d:"M14 12h.01",key:"1jfl7z"}],["path",{d:"M22 20h-3",key:"vhrsz"}]],XI=re("door-open",qI);/**
|
|
146
|
+
* @license lucide-react v0.562.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const QI=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],tm=re("download",QI);/**
|
|
151
|
+
* @license lucide-react v0.562.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const KI=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Ol=re("eye-off",KI);/**
|
|
156
|
+
* @license lucide-react v0.562.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const ZI=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Bl=re("eye",ZI);/**
|
|
161
|
+
* @license lucide-react v0.562.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const JI=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],e2=re("file-braces",JI);/**
|
|
166
|
+
* @license lucide-react v0.562.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const t2=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],Dc=re("file-spreadsheet",t2);/**
|
|
171
|
+
* @license lucide-react v0.562.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const n2=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],r2=re("file-text",n2);/**
|
|
176
|
+
* @license lucide-react v0.562.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const o2=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]],al=re("focus",o2);/**
|
|
181
|
+
* @license lucide-react v0.562.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const s2=[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]],i2=re("folder-kanban",s2);/**
|
|
186
|
+
* @license lucide-react v0.562.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const a2=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],l2=re("folder-open",a2);/**
|
|
191
|
+
* @license lucide-react v0.562.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const c2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],u2=re("grid-3x3",c2);/**
|
|
196
|
+
* @license lucide-react v0.562.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const d2=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],f2=re("hand",d2);/**
|
|
201
|
+
* @license lucide-react v0.562.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const h2=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Fv=re("house",h2);/**
|
|
206
|
+
* @license lucide-react v0.562.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const p2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],m2=re("info",p2);/**
|
|
211
|
+
* @license lucide-react v0.562.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const g2=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Dl=re("layers",g2);/**
|
|
216
|
+
* @license lucide-react v0.562.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const y2=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],v2=re("loader-circle",y2);/**
|
|
221
|
+
* @license lucide-react v0.562.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const x2=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],w2=re("map-pin",x2);/**
|
|
226
|
+
* @license lucide-react v0.562.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const b2=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],jv=re("maximize-2",b2);/**
|
|
231
|
+
* @license lucide-react v0.562.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const S2=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],_2=re("moon",S2);/**
|
|
236
|
+
* @license lucide-react v0.562.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const C2=[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]],E2=re("mouse-pointer-2",C2);/**
|
|
241
|
+
* @license lucide-react v0.562.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const I2=[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["path",{d:"m9 20 3-6 3 6",key:"se2kox"}],["path",{d:"m6 8 6 2 6-2",key:"4o3us4"}],["path",{d:"M12 10v4",key:"1kjpxc"}]],k2=re("person-standing",I2);/**
|
|
246
|
+
* @license lucide-react v0.562.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const M2=[["path",{d:"M16.466 7.5C15.643 4.237 13.952 2 12 2 9.239 2 7 6.477 7 12s2.239 10 5 10c.342 0 .677-.069 1-.2",key:"10n0gc"}],["path",{d:"m15.194 13.707 3.814 1.86-1.86 3.814",key:"16shm9"}],["path",{d:"M19 15.57c-1.804.885-4.274 1.43-7 1.43-5.523 0-10-2.239-10-5s4.477-5 10-5c4.838 0 8.873 1.718 9.8 4",key:"1lxi77"}]],P2=re("rotate-3d",M2);/**
|
|
251
|
+
* @license lucide-react v0.562.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const R2=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],Lv=re("ruler",R2);/**
|
|
256
|
+
* @license lucide-react v0.562.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const T2=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],N2=re("scissors",T2);/**
|
|
261
|
+
* @license lucide-react v0.562.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const A2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],z2=re("search",A2);/**
|
|
266
|
+
* @license lucide-react v0.562.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const F2=[["path",{d:"M11 16.586V19a1 1 0 0 1-1 1H2L18.37 3.63a1 1 0 1 1 3 3l-9.663 9.663a1 1 0 0 1-1.414 0L8 14",key:"1sllp5"}]],j2=re("slice",F2);/**
|
|
271
|
+
* @license lucide-react v0.562.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const L2=[["path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z",key:"xwnzip"}],["path",{d:"M5 3a2 2 0 0 0-2 2",key:"y57alp"}],["path",{d:"M19 3a2 2 0 0 1 2 2",key:"18rm91"}],["path",{d:"M5 21a2 2 0 0 1-2-2",key:"sbafld"}],["path",{d:"M9 3h1",key:"1yesri"}],["path",{d:"M9 21h2",key:"1qve2z"}],["path",{d:"M14 3h1",key:"1ec4yj"}],["path",{d:"M3 9v1",key:"1r0deq"}],["path",{d:"M21 9v2",key:"p14lih"}],["path",{d:"M3 14v1",key:"vnatye"}]],O2=re("square-dashed-mouse-pointer",L2);/**
|
|
276
|
+
* @license lucide-react v0.562.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const B2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],nm=re("square",B2);/**
|
|
281
|
+
* @license lucide-react v0.562.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const D2=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],U2=re("sun",D2);/**
|
|
286
|
+
* @license lucide-react v0.562.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const $2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],V2=re("trash-2",$2);/**
|
|
291
|
+
* @license lucide-react v0.562.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const G2=[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]],W2=re("triangle",G2);/**
|
|
296
|
+
* @license lucide-react v0.562.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const H2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ul=re("x",H2);/**
|
|
301
|
+
* @license lucide-react v0.562.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const Y2=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],q2=re("zoom-in",Y2);/**
|
|
306
|
+
* @license lucide-react v0.562.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/const X2=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Q2=re("zoom-out",X2);var K2=Symbol.for("react.lazy"),ll=kd[" use ".trim().toString()];function Z2(e){return typeof e=="object"&&e!==null&&"then"in e}function Ov(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===K2&&"_payload"in e&&Z2(e._payload)}function Bv(e){const t=ek(e),n=g.forwardRef((r,o)=>{let{children:s,...i}=r;Ov(s)&&typeof ll=="function"&&(s=ll(s._payload));const a=g.Children.toArray(s),l=a.find(nk);if(l){const c=l.props.children,u=a.map(d=>d===l?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return h.jsx(t,{...i,ref:o,children:g.isValidElement(c)?g.cloneElement(c,void 0,u):null})}return h.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var J2=Bv("Slot");function ek(e){const t=g.forwardRef((n,r)=>{let{children:o,...s}=n;if(Ov(o)&&typeof ll=="function"&&(o=ll(o._payload)),g.isValidElement(o)){const i=ok(o),a=rk(s,o.props);return o.type!==g.Fragment&&(a.ref=r?Ei(r,i):i),g.cloneElement(o,a)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tk=Symbol("radix.slottable");function nk(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tk}function rk(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function ok(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const rm=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,om=xv,sk=(e,t)=>n=>{var r;if(t?.variants==null)return om(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const u=n?.[c],d=s?.[c];if(u===null)return null;const f=rm(u)||rm(d);return o[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...y}=u;return Object.entries(y).every(p=>{let[x,b]=p;return Array.isArray(b)?b.includes({...s,...a}[x]):{...s,...a}[x]===b})?[...c,d,f]:c},[]);return om(e,i,l,n?.class,n?.className)},ik=sk("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9","icon-sm":"h-8 w-8","icon-xs":"h-7 w-7"}},defaultVariants:{variant:"default",size:"default"}}),Te=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?J2:"button";return h.jsx(i,{className:Ie(ik({variant:t,size:n,className:e})),ref:s,...o})});Te.displayName="Button";var ak=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lf=ak.reduce((e,t)=>{const n=Bv(`Primitive.${t}`),r=g.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),lk="Separator",sm="horizontal",ck=["horizontal","vertical"],Dv=g.forwardRef((e,t)=>{const{decorative:n,orientation:r=sm,...o}=e,s=uk(r)?r:sm,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return h.jsx(Lf.div,{"data-orientation":s,...a,...o,ref:t})});Dv.displayName=lk;function uk(e){return ck.includes(e)}var Uv=Dv;const tn=g.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>h.jsx(Uv,{ref:o,decorative:n,orientation:t,className:Ie("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));tn.displayName=Uv.displayName;function $v(e){const t=e+"CollectionProvider",[n,r]=Un(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=x=>{const{scope:b,children:m}=x,v=hn.useRef(null),w=hn.useRef(new Map).current;return h.jsx(o,{scope:b,itemMap:w,collectionRef:v,children:m})};i.displayName=t;const a=e+"CollectionSlot",l=tl(a),c=hn.forwardRef((x,b)=>{const{scope:m,children:v}=x,w=s(a,m),S=je(b,w.collectionRef);return h.jsx(l,{ref:S,children:v})});c.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=tl(u),y=hn.forwardRef((x,b)=>{const{scope:m,children:v,...w}=x,S=hn.useRef(null),_=je(b,S),I=s(u,m);return hn.useEffect(()=>(I.itemMap.set(S,{ref:S,...w}),()=>void I.itemMap.delete(S))),h.jsx(f,{[d]:"",ref:_,children:v})});y.displayName=u;function p(x){const b=s(e+"CollectionConsumer",x);return hn.useCallback(()=>{const v=b.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((I,C)=>w.indexOf(I.ref.current)-w.indexOf(C.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:c,ItemSlot:y},p,r]}var dk=g.createContext(void 0);function $l(e){const t=g.useContext(dk);return e||t||"ltr"}var Uc=0;function fk(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??im()),document.body.insertAdjacentElement("beforeend",e[1]??im()),Uc++,()=>{Uc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Uc--}},[])}function im(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var $c="focusScope.autoFocusOnMount",Vc="focusScope.autoFocusOnUnmount",am={bubbles:!1,cancelable:!0},hk="FocusScope",Vv=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,l]=g.useState(null),c=nt(o),u=nt(s),d=g.useRef(null),f=je(t,x=>l(x)),y=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let x=function(w){if(y.paused||!a)return;const S=w.target;a.contains(S)?d.current=S:Xn(d.current,{select:!0})},b=function(w){if(y.paused||!a)return;const S=w.relatedTarget;S!==null&&(a.contains(S)||Xn(d.current,{select:!0}))},m=function(w){if(document.activeElement===document.body)for(const _ of w)_.removedNodes.length>0&&Xn(a)};document.addEventListener("focusin",x),document.addEventListener("focusout",b);const v=new MutationObserver(m);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",b),v.disconnect()}}},[r,a,y.paused]),g.useEffect(()=>{if(a){cm.add(y);const x=document.activeElement;if(!a.contains(x)){const m=new CustomEvent($c,am);a.addEventListener($c,c),a.dispatchEvent(m),m.defaultPrevented||(pk(xk(Gv(a)),{select:!0}),document.activeElement===x&&Xn(a))}return()=>{a.removeEventListener($c,c),setTimeout(()=>{const m=new CustomEvent(Vc,am);a.addEventListener(Vc,u),a.dispatchEvent(m),m.defaultPrevented||Xn(x??document.body,{select:!0}),a.removeEventListener(Vc,u),cm.remove(y)},0)}}},[a,c,u,y]);const p=g.useCallback(x=>{if(!n&&!r||y.paused)return;const b=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,m=document.activeElement;if(b&&m){const v=x.currentTarget,[w,S]=mk(v);w&&S?!x.shiftKey&&m===S?(x.preventDefault(),n&&Xn(w,{select:!0})):x.shiftKey&&m===w&&(x.preventDefault(),n&&Xn(S,{select:!0})):m===v&&x.preventDefault()}},[n,r,y.paused]);return h.jsx(be.div,{tabIndex:-1,...i,ref:f,onKeyDown:p})});Vv.displayName=hk;function pk(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xn(r,{select:t}),document.activeElement!==n)return}function mk(e){const t=Gv(e),n=lm(t,e),r=lm(t.reverse(),e);return[n,r]}function Gv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function lm(e,t){for(const n of e)if(!gk(n,{upTo:t}))return n}function gk(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function yk(e){return e instanceof HTMLInputElement&&"select"in e}function Xn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&yk(e)&&t&&e.select()}}var cm=vk();function vk(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=um(e,t),e.unshift(t)},remove(t){e=um(e,t),e[0]?.resume()}}}function um(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function xk(e){return e.filter(t=>t.tagName!=="A")}var Gc="rovingFocusGroup.onEntryFocus",wk={bubbles:!1,cancelable:!0},Pi="RovingFocusGroup",[ld,Wv,bk]=$v(Pi),[Sk,Vl]=Un(Pi,[bk]),[_k,Ck]=Sk(Pi),Hv=g.forwardRef((e,t)=>h.jsx(ld.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(ld.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Ek,{...e,ref:t})})}));Hv.displayName=Pi;var Ek=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=g.useRef(null),y=je(t,f),p=$l(s),[x,b]=ki({prop:i,defaultProp:a??null,onChange:l,caller:Pi}),[m,v]=g.useState(!1),w=nt(c),S=Wv(n),_=g.useRef(!1),[I,C]=g.useState(0);return g.useEffect(()=>{const E=f.current;if(E)return E.addEventListener(Gc,w),()=>E.removeEventListener(Gc,w)},[w]),h.jsx(_k,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:x,onItemFocus:g.useCallback(E=>b(E),[b]),onItemShiftTab:g.useCallback(()=>v(!0),[]),onFocusableItemAdd:g.useCallback(()=>C(E=>E+1),[]),onFocusableItemRemove:g.useCallback(()=>C(E=>E-1),[]),children:h.jsx(be.div,{tabIndex:m||I===0?-1:0,"data-orientation":r,...d,ref:y,style:{outline:"none",...e.style},onMouseDown:te(e.onMouseDown,()=>{_.current=!0}),onFocus:te(e.onFocus,E=>{const R=!_.current;if(E.target===E.currentTarget&&R&&!m){const M=new CustomEvent(Gc,wk);if(E.currentTarget.dispatchEvent(M),!M.defaultPrevented){const N=S().filter(O=>O.focusable),A=N.find(O=>O.active),j=N.find(O=>O.id===x),F=[A,j,...N].filter(Boolean).map(O=>O.ref.current);Xv(F,u)}}_.current=!1}),onBlur:te(e.onBlur,()=>v(!1))})})}),Yv="RovingFocusGroupItem",qv=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,l=Wo(),c=s||l,u=Ck(Yv,n),d=u.currentTabStopId===c,f=Wv(n),{onFocusableItemAdd:y,onFocusableItemRemove:p,currentTabStopId:x}=u;return g.useEffect(()=>{if(r)return y(),()=>p()},[r,y,p]),h.jsx(ld.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:h.jsx(be.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:te(e.onMouseDown,b=>{r?u.onItemFocus(c):b.preventDefault()}),onFocus:te(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:te(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){u.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const m=Mk(b,u.orientation,u.dir);if(m!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let w=f().filter(S=>S.focusable).map(S=>S.ref.current);if(m==="last")w.reverse();else if(m==="prev"||m==="next"){m==="prev"&&w.reverse();const S=w.indexOf(b.currentTarget);w=u.loop?Pk(w,S+1):w.slice(S+1)}setTimeout(()=>Xv(w))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:x!=null}):i})})});qv.displayName=Yv;var Ik={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kk(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Mk(e,t,n){const r=kk(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ik[r]}function Xv(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Pk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Qv=Hv,Kv=qv,Rk=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},io=new WeakMap,ra=new WeakMap,oa={},Wc=0,Zv=function(e){return e&&(e.host||Zv(e.parentNode))},Tk=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Zv(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Nk=function(e,t,n,r){var o=Tk(t,Array.isArray(e)?e:[e]);oa[n]||(oa[n]=new WeakMap);var s=oa[n],i=[],a=new Set,l=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var y=f.getAttribute(r),p=y!==null&&y!=="false",x=(io.get(f)||0)+1,b=(s.get(f)||0)+1;io.set(f,x),s.set(f,b),i.push(f),x===1&&p&&ra.set(f,!0),b===1&&f.setAttribute(n,"true"),p||f.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",f,m)}})};return u(t),a.clear(),Wc++,function(){i.forEach(function(d){var f=io.get(d)-1,y=s.get(d)-1;io.set(d,f),s.set(d,y),f||(ra.has(d)||d.removeAttribute(r),ra.delete(d)),y||d.removeAttribute(n)}),Wc--,Wc||(io=new WeakMap,io=new WeakMap,ra=new WeakMap,oa={})}},Ak=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Rk(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Nk(r,o,n,"aria-hidden")):function(){return null}},mn=function(){return mn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},mn.apply(this,arguments)};function Jv(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function zk(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Ca="right-scroll-bar-position",Ea="width-before-scroll-bar",Fk="with-scroll-bars-hidden",jk="--removed-body-scroll-bar-size";function Hc(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Lk(e,t){var n=g.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Ok=typeof window<"u"?g.useLayoutEffect:g.useEffect,dm=new WeakMap;function Bk(e,t){var n=Lk(null,function(r){return e.forEach(function(o){return Hc(o,r)})});return Ok(function(){var r=dm.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Hc(a,null)}),s.forEach(function(a){o.has(a)||Hc(a,i)})}dm.set(n,e)},[e]),n}function Dk(e){return e}function Uk(e,t){t===void 0&&(t=Dk);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var l=function(){var u=i;i=[],u.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){i.push(u),c()},filter:function(u){return i=i.filter(u),n}}}};return o}function $k(e){e===void 0&&(e={});var t=Uk(null);return t.options=mn({async:!0,ssr:!1},e),t}var ex=function(e){var t=e.sideCar,n=Jv(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,mn({},n))};ex.isSideCarExport=!0;function Vk(e,t){return e.useMedium(t),ex}var tx=$k(),Yc=function(){},Gl=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:Yc,onWheelCapture:Yc,onTouchMoveCapture:Yc}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,y=e.noRelative,p=e.noIsolation,x=e.inert,b=e.allowPinchZoom,m=e.as,v=m===void 0?"div":m,w=e.gapMode,S=Jv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=f,I=Bk([n,t]),C=mn(mn({},S),o);return g.createElement(g.Fragment,null,u&&g.createElement(_,{sideCar:tx,removeScrollBar:c,shards:d,noRelative:y,noIsolation:p,inert:x,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:w}),i?g.cloneElement(g.Children.only(a),mn(mn({},C),{ref:I})):g.createElement(v,mn({},C,{className:l,ref:I}),a))});Gl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Gl.classNames={fullWidth:Ea,zeroRight:Ca};var Gk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Wk(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Gk();return t&&e.setAttribute("nonce",t),e}function Hk(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yk(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var qk=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Wk())&&(Hk(t,n),Yk(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Xk=function(){var e=qk();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},nx=function(){var e=Xk(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Qk={left:0,top:0,right:0,gap:0},qc=function(e){return parseInt(e||"",10)||0},Kk=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[qc(n),qc(r),qc(o)]},Zk=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Qk;var t=Kk(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Jk=nx(),Fo="data-scroll-locked",eM=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
311
|
+
.`.concat(Fk,` {
|
|
312
|
+
overflow: hidden `).concat(r,`;
|
|
313
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
314
|
+
}
|
|
315
|
+
body[`).concat(Fo,`] {
|
|
316
|
+
overflow: hidden `).concat(r,`;
|
|
317
|
+
overscroll-behavior: contain;
|
|
318
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
319
|
+
padding-left: `.concat(o,`px;
|
|
320
|
+
padding-top: `).concat(s,`px;
|
|
321
|
+
padding-right: `).concat(i,`px;
|
|
322
|
+
margin-left:0;
|
|
323
|
+
margin-top:0;
|
|
324
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
325
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.`).concat(Ca,` {
|
|
329
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.`).concat(Ea,` {
|
|
333
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.`).concat(Ca," .").concat(Ca,` {
|
|
337
|
+
right: 0 `).concat(r,`;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.`).concat(Ea," .").concat(Ea,` {
|
|
341
|
+
margin-right: 0 `).concat(r,`;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
body[`).concat(Fo,`] {
|
|
345
|
+
`).concat(jk,": ").concat(a,`px;
|
|
346
|
+
}
|
|
347
|
+
`)},fm=function(){var e=parseInt(document.body.getAttribute(Fo)||"0",10);return isFinite(e)?e:0},tM=function(){g.useEffect(function(){return document.body.setAttribute(Fo,(fm()+1).toString()),function(){var e=fm()-1;e<=0?document.body.removeAttribute(Fo):document.body.setAttribute(Fo,e.toString())}},[])},nM=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;tM();var s=g.useMemo(function(){return Zk(o)},[o]);return g.createElement(Jk,{styles:eM(s,!t,o,n?"":"!important")})},cd=!1;if(typeof window<"u")try{var sa=Object.defineProperty({},"passive",{get:function(){return cd=!0,!0}});window.addEventListener("test",sa,sa),window.removeEventListener("test",sa,sa)}catch{cd=!1}var ao=cd?{passive:!1}:!1,rM=function(e){return e.tagName==="TEXTAREA"},rx=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!rM(e)&&n[t]==="visible")},oM=function(e){return rx(e,"overflowY")},sM=function(e){return rx(e,"overflowX")},hm=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ox(e,r);if(o){var s=sx(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},iM=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},aM=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ox=function(e,t){return e==="v"?oM(t):sM(t)},sx=function(e,t){return e==="v"?iM(t):aM(t)},lM=function(e,t){return e==="h"&&t==="rtl"?-1:1},cM=function(e,t,n,r,o){var s=lM(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,l=t.contains(a),c=!1,u=i>0,d=0,f=0;do{if(!a)break;var y=sx(e,a),p=y[0],x=y[1],b=y[2],m=x-b-s*p;(p||m)&&ox(e,a)&&(d+=m,f+=p);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(c=!0),c},ia=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},pm=function(e){return[e.deltaX,e.deltaY]},mm=function(e){return e&&"current"in e?e.current:e},uM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},dM=function(e){return`
|
|
348
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
349
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
350
|
+
`)},fM=0,lo=[];function hM(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),o=g.useState(fM++)[0],s=g.useState(nx)[0],i=g.useRef(e);g.useEffect(function(){i.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var x=zk([e.lockRef.current],(e.shards||[]).map(mm),!0).filter(Boolean);return x.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),x.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=g.useCallback(function(x,b){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!i.current.allowPinchZoom;var m=ia(x),v=n.current,w="deltaX"in x?x.deltaX:v[0]-m[0],S="deltaY"in x?x.deltaY:v[1]-m[1],_,I=x.target,C=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in x&&C==="h"&&I.type==="range")return!1;var E=window.getSelection(),R=E&&E.anchorNode,M=R?R===I||R.contains(I):!1;if(M)return!1;var N=hm(C,I);if(!N)return!0;if(N?_=C:(_=C==="v"?"h":"v",N=hm(C,I)),!N)return!1;if(!r.current&&"changedTouches"in x&&(w||S)&&(r.current=_),!_)return!0;var A=r.current||_;return cM(A,b,x,A==="h"?w:S)},[]),l=g.useCallback(function(x){var b=x;if(!(!lo.length||lo[lo.length-1]!==s)){var m="deltaY"in b?pm(b):ia(b),v=t.current.filter(function(_){return _.name===b.type&&(_.target===b.target||b.target===_.shadowParent)&&uM(_.delta,m)})[0];if(v&&v.should){b.cancelable&&b.preventDefault();return}if(!v){var w=(i.current.shards||[]).map(mm).filter(Boolean).filter(function(_){return _.contains(b.target)}),S=w.length>0?a(b,w[0]):!i.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),c=g.useCallback(function(x,b,m,v){var w={name:x,delta:b,target:m,should:v,shadowParent:pM(m)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),u=g.useCallback(function(x){n.current=ia(x),r.current=void 0},[]),d=g.useCallback(function(x){c(x.type,pm(x),x.target,a(x,e.lockRef.current))},[]),f=g.useCallback(function(x){c(x.type,ia(x),x.target,a(x,e.lockRef.current))},[]);g.useEffect(function(){return lo.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ao),document.addEventListener("touchmove",l,ao),document.addEventListener("touchstart",u,ao),function(){lo=lo.filter(function(x){return x!==s}),document.removeEventListener("wheel",l,ao),document.removeEventListener("touchmove",l,ao),document.removeEventListener("touchstart",u,ao)}},[]);var y=e.removeScrollBar,p=e.inert;return g.createElement(g.Fragment,null,p?g.createElement(s,{styles:dM(o)}):null,y?g.createElement(nM,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function pM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const mM=Vk(tx,hM);var ix=g.forwardRef(function(e,t){return g.createElement(Gl,mn({},e,{ref:t,sideCar:mM}))});ix.classNames=Gl.classNames;var ud=["Enter"," "],gM=["ArrowDown","PageUp","Home"],ax=["ArrowUp","PageDown","End"],yM=[...gM,...ax],vM={ltr:[...ud,"ArrowRight"],rtl:[...ud,"ArrowLeft"]},xM={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ri="Menu",[ci,wM,bM]=$v(Ri),[Zr,lx]=Un(Ri,[bM,Fl,Vl]),Wl=Fl(),cx=Vl(),[SM,Jr]=Zr(Ri),[_M,Ti]=Zr(Ri),ux=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=Wl(t),[l,c]=g.useState(null),u=g.useRef(!1),d=nt(s),f=$l(o);return g.useEffect(()=>{const y=()=>{u.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>u.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),h.jsx(ov,{...a,children:h.jsx(SM,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:h.jsx(_M,{scope:t,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:i,children:r})})})};ux.displayName=Ri;var CM="MenuAnchor",Of=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Wl(n);return h.jsx(sv,{...o,...r,ref:t})});Of.displayName=CM;var Bf="MenuPortal",[EM,dx]=Zr(Bf,{forceMount:void 0}),fx=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Jr(Bf,t);return h.jsx(EM,{scope:t,forceMount:n,children:h.jsx(At,{present:n||s.open,children:h.jsx(Nf,{asChild:!0,container:o,children:r})})})};fx.displayName=Bf;var Wt="MenuContent",[IM,Df]=Zr(Wt),hx=g.forwardRef((e,t)=>{const n=dx(Wt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Jr(Wt,e.__scopeMenu),i=Ti(Wt,e.__scopeMenu);return h.jsx(ci.Provider,{scope:e.__scopeMenu,children:h.jsx(At,{present:r||s.open,children:h.jsx(ci.Slot,{scope:e.__scopeMenu,children:i.modal?h.jsx(kM,{...o,ref:t}):h.jsx(MM,{...o,ref:t})})})})}),kM=g.forwardRef((e,t)=>{const n=Jr(Wt,e.__scopeMenu),r=g.useRef(null),o=je(t,r);return g.useEffect(()=>{const s=r.current;if(s)return Ak(s)},[]),h.jsx(Uf,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:te(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),MM=g.forwardRef((e,t)=>{const n=Jr(Wt,e.__scopeMenu);return h.jsx(Uf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),PM=tl("MenuContent.ScrollLock"),Uf=g.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:y,disableOutsideScroll:p,...x}=e,b=Jr(Wt,n),m=Ti(Wt,n),v=Wl(n),w=cx(n),S=wM(n),[_,I]=g.useState(null),C=g.useRef(null),E=je(t,C,b.onContentChange),R=g.useRef(0),M=g.useRef(""),N=g.useRef(0),A=g.useRef(null),j=g.useRef("right"),L=g.useRef(0),F=p?ix:g.Fragment,O=p?{as:PM,allowPinchZoom:!0}:void 0,V=T=>{const $=M.current+T,ne=S().filter(oe=>!oe.disabled),W=document.activeElement,Q=ne.find(oe=>oe.ref.current===W)?.textValue,ee=ne.map(oe=>oe.textValue),fe=UM(ee,$,Q),Re=ne.find(oe=>oe.textValue===fe)?.ref.current;(function oe(Se){M.current=Se,window.clearTimeout(R.current),Se!==""&&(R.current=window.setTimeout(()=>oe(""),1e3))})($),Re&&setTimeout(()=>Re.focus())};g.useEffect(()=>()=>window.clearTimeout(R.current),[]),fk();const k=g.useCallback(T=>j.current===A.current?.side&&VM(T,A.current?.area),[]);return h.jsx(IM,{scope:n,searchRef:M,onItemEnter:g.useCallback(T=>{k(T)&&T.preventDefault()},[k]),onItemLeave:g.useCallback(T=>{k(T)||(C.current?.focus(),I(null))},[k]),onTriggerLeave:g.useCallback(T=>{k(T)&&T.preventDefault()},[k]),pointerGraceTimerRef:N,onPointerGraceIntentChange:g.useCallback(T=>{A.current=T},[]),children:h.jsx(F,{...O,children:h.jsx(Vv,{asChild:!0,trapped:o,onMountAutoFocus:te(s,T=>{T.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:h.jsx(_f,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:y,children:h.jsx(Qv,{asChild:!0,...w,dir:m.dir,orientation:"vertical",loop:r,currentTabStopId:_,onCurrentTabStopIdChange:I,onEntryFocus:te(l,T=>{m.isUsingKeyboardRef.current||T.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(iv,{role:"menu","aria-orientation":"vertical","data-state":Px(b.open),"data-radix-menu-content":"",dir:m.dir,...v,...x,ref:E,style:{outline:"none",...x.style},onKeyDown:te(x.onKeyDown,T=>{const ne=T.target.closest("[data-radix-menu-content]")===T.currentTarget,W=T.ctrlKey||T.altKey||T.metaKey,Q=T.key.length===1;ne&&(T.key==="Tab"&&T.preventDefault(),!W&&Q&&V(T.key));const ee=C.current;if(T.target!==ee||!yM.includes(T.key))return;T.preventDefault();const Re=S().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);ax.includes(T.key)&&Re.reverse(),BM(Re)}),onBlur:te(e.onBlur,T=>{T.currentTarget.contains(T.target)||(window.clearTimeout(R.current),M.current="")}),onPointerMove:te(e.onPointerMove,ui(T=>{const $=T.target,ne=L.current!==T.clientX;if(T.currentTarget.contains($)&&ne){const W=T.clientX>L.current?"right":"left";j.current=W,L.current=T.clientX}}))})})})})})})});hx.displayName=Wt;var RM="MenuGroup",$f=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(be.div,{role:"group",...r,ref:t})});$f.displayName=RM;var TM="MenuLabel",px=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(be.div,{...r,ref:t})});px.displayName=TM;var cl="MenuItem",gm="menu.itemSelect",Hl=g.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=g.useRef(null),i=Ti(cl,e.__scopeMenu),a=Df(cl,e.__scopeMenu),l=je(t,s),c=g.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(gm,{bubbles:!0,cancelable:!0});d.addEventListener(gm,y=>r?.(y),{once:!0}),z0(d,f),f.defaultPrevented?c.current=!1:i.onClose()}};return h.jsx(mx,{...o,ref:l,disabled:n,onClick:te(e.onClick,u),onPointerDown:d=>{e.onPointerDown?.(d),c.current=!0},onPointerUp:te(e.onPointerUp,d=>{c.current||d.currentTarget?.click()}),onKeyDown:te(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||ud.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Hl.displayName=cl;var mx=g.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=Df(cl,n),a=cx(n),l=g.useRef(null),c=je(t,l),[u,d]=g.useState(!1),[f,y]=g.useState("");return g.useEffect(()=>{const p=l.current;p&&y((p.textContent??"").trim())},[s.children]),h.jsx(ci.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:h.jsx(Kv,{asChild:!0,...a,focusable:!r,children:h.jsx(be.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:te(e.onPointerMove,ui(p=>{r?i.onItemLeave(p):(i.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:te(e.onPointerLeave,ui(p=>i.onItemLeave(p))),onFocus:te(e.onFocus,()=>d(!0)),onBlur:te(e.onBlur,()=>d(!1))})})})}),NM="MenuCheckboxItem",gx=g.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return h.jsx(bx,{scope:e.__scopeMenu,checked:n,children:h.jsx(Hl,{role:"menuitemcheckbox","aria-checked":ul(n)?"mixed":n,...o,ref:t,"data-state":Gf(n),onSelect:te(o.onSelect,()=>r?.(ul(n)?!0:!n),{checkForDefaultPrevented:!1})})})});gx.displayName=NM;var yx="MenuRadioGroup",[AM,zM]=Zr(yx,{value:void 0,onValueChange:()=>{}}),vx=g.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=nt(r);return h.jsx(AM,{scope:e.__scopeMenu,value:n,onValueChange:s,children:h.jsx($f,{...o,ref:t})})});vx.displayName=yx;var xx="MenuRadioItem",wx=g.forwardRef((e,t)=>{const{value:n,...r}=e,o=zM(xx,e.__scopeMenu),s=n===o.value;return h.jsx(bx,{scope:e.__scopeMenu,checked:s,children:h.jsx(Hl,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Gf(s),onSelect:te(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});wx.displayName=xx;var Vf="MenuItemIndicator",[bx,FM]=Zr(Vf,{checked:!1}),Sx=g.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=FM(Vf,n);return h.jsx(At,{present:r||ul(s.checked)||s.checked===!0,children:h.jsx(be.span,{...o,ref:t,"data-state":Gf(s.checked)})})});Sx.displayName=Vf;var jM="MenuSeparator",_x=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(be.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});_x.displayName=jM;var LM="MenuArrow",Cx=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Wl(n);return h.jsx(av,{...o,...r,ref:t})});Cx.displayName=LM;var OM="MenuSub",[NN,Ex]=Zr(OM),_s="MenuSubTrigger",Ix=g.forwardRef((e,t)=>{const n=Jr(_s,e.__scopeMenu),r=Ti(_s,e.__scopeMenu),o=Ex(_s,e.__scopeMenu),s=Df(_s,e.__scopeMenu),i=g.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},u=g.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return g.useEffect(()=>u,[u]),g.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),h.jsx(Of,{asChild:!0,...c,children:h.jsx(mx,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Px(n.open),...e,ref:Ei(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:te(e.onPointerMove,ui(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:te(e.onPointerLeave,ui(d=>{u();const f=n.content?.getBoundingClientRect();if(f){const y=n.content?.dataset.side,p=y==="right",x=p?-5:5,b=f[p?"left":"right"],m=f[p?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+x,y:d.clientY},{x:b,y:f.top},{x:m,y:f.top},{x:m,y:f.bottom},{x:b,y:f.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:te(e.onKeyDown,d=>{const f=s.searchRef.current!=="";e.disabled||f&&d.key===" "||vM[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});Ix.displayName=_s;var kx="MenuSubContent",Mx=g.forwardRef((e,t)=>{const n=dx(Wt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Jr(Wt,e.__scopeMenu),i=Ti(Wt,e.__scopeMenu),a=Ex(kx,e.__scopeMenu),l=g.useRef(null),c=je(t,l);return h.jsx(ci.Provider,{scope:e.__scopeMenu,children:h.jsx(At,{present:r||s.open,children:h.jsx(ci.Slot,{scope:e.__scopeMenu,children:h.jsx(Uf,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{i.isUsingKeyboardRef.current&&l.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:te(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:te(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:te(e.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),f=xM[i.dir].includes(u.key);d&&f&&(s.onOpenChange(!1),a.trigger?.focus(),u.preventDefault())})})})})})});Mx.displayName=kx;function Px(e){return e?"open":"closed"}function ul(e){return e==="indeterminate"}function Gf(e){return ul(e)?"indeterminate":e?"checked":"unchecked"}function BM(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function DM(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function UM(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=DM(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==n));const l=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function $M(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],c=a.x,u=a.y,d=l.x,f=l.y;u>r!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(o=!o)}return o}function VM(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return $M(n,t)}function ui(e){return t=>t.pointerType==="mouse"?e(t):void 0}var GM=ux,WM=Of,HM=fx,YM=hx,qM=$f,XM=px,QM=Hl,KM=gx,ZM=vx,JM=wx,eP=Sx,tP=_x,nP=Cx,rP=Ix,oP=Mx,Yl="DropdownMenu",[sP]=Un(Yl,[lx]),ut=lx(),[iP,Rx]=sP(Yl),Tx=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,l=ut(t),c=g.useRef(null),[u,d]=ki({prop:o,defaultProp:s??!1,onChange:i,caller:Yl});return h.jsx(iP,{scope:t,triggerId:Wo(),triggerRef:c,contentId:Wo(),open:u,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:a,children:h.jsx(GM,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};Tx.displayName=Yl;var Nx="DropdownMenuTrigger",Ax=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Rx(Nx,n),i=ut(n);return h.jsx(WM,{asChild:!0,...i,children:h.jsx(be.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Ei(t,s.triggerRef),onPointerDown:te(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:te(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Ax.displayName=Nx;var aP="DropdownMenuPortal",zx=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ut(t);return h.jsx(HM,{...r,...n})};zx.displayName=aP;var Fx="DropdownMenuContent",jx=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Rx(Fx,n),s=ut(n),i=g.useRef(!1);return h.jsx(YM,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:te(e.onCloseAutoFocus,a=>{i.current||o.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:te(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});jx.displayName=Fx;var lP="DropdownMenuGroup",cP=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ut(n);return h.jsx(qM,{...o,...r,ref:t})});cP.displayName=lP;var uP="DropdownMenuLabel",Lx=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ut(n);return h.jsx(XM,{...o,...r,ref:t})});Lx.displayName=uP;var dP="DropdownMenuItem",Ox=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ut(n);return h.jsx(QM,{...o,...r,ref:t})});Ox.displayName=dP;var fP="DropdownMenuCheckboxItem",Bx=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ut(n);return h.jsx(KM,{...o,...r,ref:t})});Bx.displayName=fP;var hP="DropdownMenuRadioGroup",pP=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ut(n);return h.jsx(ZM,{...o,...r,ref:t})});pP.displayName=hP;var mP="DropdownMenuRadioItem",Dx=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ut(n);return h.jsx(JM,{...o,...r,ref:t})});Dx.displayName=mP;var gP="DropdownMenuItemIndicator",Ux=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ut(n);return h.jsx(eP,{...o,...r,ref:t})});Ux.displayName=gP;var yP="DropdownMenuSeparator",$x=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ut(n);return h.jsx(tP,{...o,...r,ref:t})});$x.displayName=yP;var vP="DropdownMenuArrow",xP=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ut(n);return h.jsx(nP,{...o,...r,ref:t})});xP.displayName=vP;var wP="DropdownMenuSubTrigger",Vx=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ut(n);return h.jsx(rP,{...o,...r,ref:t})});Vx.displayName=wP;var bP="DropdownMenuSubContent",Gx=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ut(n);return h.jsx(oP,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Gx.displayName=bP;var SP=Tx,_P=Ax,CP=zx,Wx=jx,Hx=Lx,Yx=Ox,qx=Bx,Xx=Dx,Qx=Ux,Kx=$x,Zx=Vx,Jx=Gx;const ym=SP,vm=_P,EP=g.forwardRef(({className:e,inset:t,children:n,...r},o)=>h.jsxs(Zx,{ref:o,className:Ie("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,h.jsx(Av,{className:"ml-auto h-4 w-4"})]}));EP.displayName=Zx.displayName;const IP=g.forwardRef(({className:e,...t},n)=>h.jsx(Jx,{ref:n,className:Ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));IP.displayName=Jx.displayName;const dd=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(CP,{children:h.jsx(Wx,{ref:r,sideOffset:t,className:Ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));dd.displayName=Wx.displayName;const ft=g.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(Yx,{ref:r,className:Ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));ft.displayName=Yx.displayName;const kP=g.forwardRef(({className:e,children:t,checked:n,...r},o)=>h.jsxs(qx,{ref:o,className:Ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(Qx,{children:h.jsx(LI,{className:"h-4 w-4"})})}),t]}));kP.displayName=qx.displayName;const MP=g.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(Xx,{ref:r,className:Ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(Qx,{children:h.jsx(HI,{className:"h-2 w-2 fill-current"})})}),t]}));MP.displayName=Xx.displayName;const PP=g.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(Hx,{ref:r,className:Ie("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));PP.displayName=Hx.displayName;const Ia=g.forwardRef(({className:e,...t},n)=>h.jsx(Kx,{ref:n,className:Ie("-mx-1 my-1 h-px bg-muted",e),...t}));Ia.displayName=Kx.displayName;function RP(e,t=[]){let n=[];function r(s,i){const a=g.createContext(i);a.displayName=s+"Context";const l=n.length;n=[...n,i];const c=d=>{const{scope:f,children:y,...p}=d,x=f?.[e]?.[l]||a,b=g.useMemo(()=>p,Object.values(p));return h.jsx(x.Provider,{value:b,children:y})};c.displayName=s+"Provider";function u(d,f){const y=f?.[e]?.[l]||a,p=g.useContext(y);if(p)return p;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[c,u]}const o=()=>{const s=n.map(i=>g.createContext(i));return function(a){const l=a?.[e]||s;return g.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,TP(o,...t)]}function TP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var Wf="Progress",Hf=100,[NP]=RP(Wf),[AP,zP]=NP(Wf),ew=g.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:s=FP,...i}=e;(o||o===0)&&!xm(o)&&console.error(jP(`${o}`,"Progress"));const a=xm(o)?o:Hf;r!==null&&!wm(r,a)&&console.error(LP(`${r}`,"Progress"));const l=wm(r,a)?r:null,c=dl(l)?s(l,a):void 0;return h.jsx(AP,{scope:n,value:l,max:a,children:h.jsx(Lf.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":dl(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":rw(l,a),"data-value":l??void 0,"data-max":a,...i,ref:t})})});ew.displayName=Wf;var tw="ProgressIndicator",nw=g.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=zP(tw,n);return h.jsx(Lf.div,{"data-state":rw(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});nw.displayName=tw;function FP(e,t){return`${Math.round(e/t*100)}%`}function rw(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function dl(e){return typeof e=="number"}function xm(e){return dl(e)&&!isNaN(e)&&e>0}function wm(e,t){return dl(e)&&!isNaN(e)&&e<=t&&e>=0}function jP(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Hf}\`.`}function LP(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
351
|
+
- a positive number
|
|
352
|
+
- less than the value passed to \`max\` (or ${Hf} if no \`max\` prop is set)
|
|
353
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
354
|
+
|
|
355
|
+
Defaulting to \`null\`.`}var ow=ew,OP=nw;const sw=g.forwardRef(({className:e,value:t,...n},r)=>h.jsx(ow,{ref:r,className:Ie("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:h.jsx(OP,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));sw.displayName=ow.displayName;const BP={},bm=e=>{let t;const n=new Set,r=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const y=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(p=>p(t,y))}},o=()=>t,l={setState:r,getState:o,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(BP?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,o,l);return l},DP=e=>e?bm(e):bm;var iw={exports:{}},aw={},lw={exports:{}},cw={};/**
|
|
356
|
+
* @license React
|
|
357
|
+
* use-sync-external-store-shim.production.js
|
|
358
|
+
*
|
|
359
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
360
|
+
*
|
|
361
|
+
* This source code is licensed under the MIT license found in the
|
|
362
|
+
* LICENSE file in the root directory of this source tree.
|
|
363
|
+
*/var qo=g;function UP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $P=typeof Object.is=="function"?Object.is:UP,VP=qo.useState,GP=qo.useEffect,WP=qo.useLayoutEffect,HP=qo.useDebugValue;function YP(e,t){var n=t(),r=VP({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return WP(function(){o.value=n,o.getSnapshot=t,Xc(o)&&s({inst:o})},[e,n,t]),GP(function(){return Xc(o)&&s({inst:o}),e(function(){Xc(o)&&s({inst:o})})},[e]),HP(n),n}function Xc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!$P(e,n)}catch{return!0}}function qP(e,t){return t()}var XP=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?qP:YP;cw.useSyncExternalStore=qo.useSyncExternalStore!==void 0?qo.useSyncExternalStore:XP;lw.exports=cw;var QP=lw.exports;/**
|
|
364
|
+
* @license React
|
|
365
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
366
|
+
*
|
|
367
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
368
|
+
*
|
|
369
|
+
* This source code is licensed under the MIT license found in the
|
|
370
|
+
* LICENSE file in the root directory of this source tree.
|
|
371
|
+
*/var ql=g,KP=QP;function ZP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var JP=typeof Object.is=="function"?Object.is:ZP,eR=KP.useSyncExternalStore,tR=ql.useRef,nR=ql.useEffect,rR=ql.useMemo,oR=ql.useDebugValue;aw.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var s=tR(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=rR(function(){function l(y){if(!c){if(c=!0,u=y,y=r(y),o!==void 0&&i.hasValue){var p=i.value;if(o(p,y))return d=p}return d=y}if(p=d,JP(u,y))return p;var x=r(y);return o!==void 0&&o(p,x)?(u=y,p):(u=y,d=x)}var c=!1,u,d,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,o]);var a=eR(e,s[0],s[1]);return nR(function(){i.hasValue=!0,i.value=a},[a]),oR(a),a};iw.exports=aw;var sR=iw.exports;const iR=Sd(sR),uw={},{useDebugValue:aR}=hn,{useSyncExternalStoreWithSelector:lR}=iR;let Sm=!1;const cR=e=>e;function uR(e,t=cR,n){(uw?"production":void 0)!=="production"&&n&&!Sm&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Sm=!0);const r=lR(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return aR(r),r}const _m=e=>{(uw?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?DP(e):e,n=(r,o)=>uR(t,r,o);return Object.assign(n,t),n},dR=e=>e?_m(e):_m,D=dR((e,t)=>({loading:!1,progress:null,error:null,ifcDataStore:null,geometryResult:null,selectedEntityId:null,selectedEntityIds:new Set,selectedStorey:null,hiddenEntities:new Set,isolatedEntities:null,leftPanelCollapsed:!1,rightPanelCollapsed:!1,activeTool:"select",theme:"dark",isMobile:!1,hoverTooltipsEnabled:!1,hoverState:{entityId:null,screenX:0,screenY:0},contextMenu:{isOpen:!1,entityId:null,screenX:0,screenY:0},boxSelect:{isSelecting:!1,startX:0,startY:0,currentX:0,currentY:0},measurements:[],pendingMeasurePoint:null,sectionPlane:{axis:"y",position:50,enabled:!1},cameraRotation:{azimuth:45,elevation:25},cameraCallbacks:{},onCameraRotationChange:null,onScaleChange:null,setLoading:n=>e({loading:n}),setProgress:n=>e({progress:n}),setError:n=>e({error:n}),setIfcDataStore:n=>e({ifcDataStore:n}),setGeometryResult:n=>e({geometryResult:n}),appendGeometryBatch:(n,r)=>e(o=>{if(!o.geometryResult){const l=n.reduce((u,d)=>u+d.indices.length/3,0),c=n.reduce((u,d)=>u+d.positions.length/3,0);return{geometryResult:{meshes:n,totalTriangles:l,totalVertices:c,coordinateInfo:r||{originShift:{x:0,y:0,z:0},originalBounds:{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}},shiftedBounds:{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}},isGeoReferenced:!1}}}}const s=[...o.geometryResult.meshes,...n],i=s.reduce((l,c)=>l+c.indices.length/3,0),a=s.reduce((l,c)=>l+c.positions.length/3,0);return{geometryResult:{...o.geometryResult,meshes:s,totalTriangles:i,totalVertices:a,coordinateInfo:r||o.geometryResult.coordinateInfo}}}),updateCoordinateInfo:n=>e(r=>r.geometryResult?{geometryResult:{...r.geometryResult,coordinateInfo:n}}:{}),setSelectedEntityId:n=>e({selectedEntityId:n}),setSelectedStorey:n=>e({selectedStorey:n}),setLeftPanelCollapsed:n=>e({leftPanelCollapsed:n}),setRightPanelCollapsed:n=>e({rightPanelCollapsed:n}),setActiveTool:n=>e({activeTool:n}),setTheme:n=>{document.documentElement.classList.toggle("dark",n==="dark"),e({theme:n})},toggleTheme:()=>{const n=t().theme==="dark"?"light":"dark";document.documentElement.classList.toggle("dark",n==="dark"),e({theme:n})},setIsMobile:n=>e({isMobile:n}),toggleHoverTooltips:()=>e(n=>({hoverTooltipsEnabled:!n.hoverTooltipsEnabled})),setCameraRotation:n=>e({cameraRotation:n}),setCameraCallbacks:n=>e({cameraCallbacks:n}),setOnCameraRotationChange:n=>e({onCameraRotationChange:n}),updateCameraRotationRealtime:n=>{const r=t().onCameraRotationChange;r&&r(n)},setOnScaleChange:n=>e({onScaleChange:n}),updateScaleRealtime:n=>{const r=t().onScaleChange;r&&r(n)},hideEntity:n=>e(r=>{const o=new Set(r.hiddenEntities);return o.has(n)?o.delete(n):o.add(n),{hiddenEntities:o}}),hideEntities:n=>e(r=>{const o=new Set(r.hiddenEntities);return n.forEach(s=>{o.has(s)?o.delete(s):o.add(s)}),{hiddenEntities:o}}),showEntity:n=>e(r=>{const o=new Set(r.hiddenEntities);return o.delete(n),{hiddenEntities:o}}),showEntities:n=>e(r=>{const o=new Set(r.hiddenEntities);return n.forEach(s=>o.delete(s)),{hiddenEntities:o}}),toggleEntityVisibility:n=>e(r=>{const o=new Set(r.hiddenEntities);return o.has(n)?o.delete(n):o.add(n),{hiddenEntities:o}}),isolateEntity:n=>e(r=>{if(r.isolatedEntities!==null&&r.isolatedEntities.size===1&&r.isolatedEntities.has(n))return{isolatedEntities:null};{const s=new Set(r.hiddenEntities);return s.delete(n),{isolatedEntities:new Set([n]),hiddenEntities:s}}}),isolateEntities:n=>e(r=>{const o=new Set(n);if(r.isolatedEntities!==null&&r.isolatedEntities.size===o.size&&n.every(i=>r.isolatedEntities.has(i)))return{isolatedEntities:null};{const i=new Set(r.hiddenEntities);return n.forEach(a=>i.delete(a)),{isolatedEntities:o,hiddenEntities:i}}}),clearIsolation:()=>e({isolatedEntities:null}),showAll:()=>e({hiddenEntities:new Set,isolatedEntities:null}),isEntityVisible:n=>{const r=t();return!(r.hiddenEntities.has(n)||r.isolatedEntities!==null&&!r.isolatedEntities.has(n))},addToSelection:n=>e(r=>{const o=new Set(r.selectedEntityIds);return o.add(n),{selectedEntityIds:o,selectedEntityId:n}}),removeFromSelection:n=>e(r=>{const o=new Set(r.selectedEntityIds);o.delete(n);const s=Array.from(o);return{selectedEntityIds:o,selectedEntityId:s.length>0?s[s.length-1]:null}}),toggleSelection:n=>e(r=>{const o=new Set(r.selectedEntityIds);o.has(n)?o.delete(n):o.add(n);const s=Array.from(o);return{selectedEntityIds:o,selectedEntityId:s.length>0?s[s.length-1]:null}}),setSelectedEntityIds:n=>e({selectedEntityIds:new Set(n),selectedEntityId:n.length>0?n[n.length-1]:null}),clearSelection:()=>e({selectedEntityIds:new Set,selectedEntityId:null}),setHoverState:n=>e({hoverState:n}),clearHover:()=>e({hoverState:{entityId:null,screenX:0,screenY:0}}),openContextMenu:(n,r,o)=>e({contextMenu:{isOpen:!0,entityId:n,screenX:r,screenY:o}}),closeContextMenu:()=>e({contextMenu:{isOpen:!1,entityId:null,screenX:0,screenY:0}}),startBoxSelect:(n,r)=>e({boxSelect:{isSelecting:!0,startX:n,startY:r,currentX:n,currentY:r}}),updateBoxSelect:(n,r)=>e(o=>({boxSelect:{...o.boxSelect,currentX:n,currentY:r}})),endBoxSelect:()=>e({boxSelect:{isSelecting:!1,startX:0,startY:0,currentX:0,currentY:0}}),cancelBoxSelect:()=>e({boxSelect:{isSelecting:!1,startX:0,startY:0,currentX:0,currentY:0}}),addMeasurePoint:n=>e({pendingMeasurePoint:n}),completeMeasurement:n=>e(r=>{if(!r.pendingMeasurePoint)return{};const o=r.pendingMeasurePoint,s=Math.sqrt(Math.pow(n.x-o.x,2)+Math.pow(n.y-o.y,2)+Math.pow(n.z-o.z,2)),i={id:`m-${Date.now()}`,start:o,end:n,distance:s};return{measurements:[...r.measurements,i],pendingMeasurePoint:null}}),deleteMeasurement:n=>e(r=>({measurements:r.measurements.filter(o=>o.id!==n)})),clearMeasurements:()=>e({measurements:[],pendingMeasurePoint:null}),setSectionPlaneAxis:n=>e(r=>({sectionPlane:{...r.sectionPlane,axis:n}})),setSectionPlanePosition:n=>e(r=>({sectionPlane:{...r.sectionPlane,position:n}})),toggleSectionPlane:()=>e(n=>({sectionPlane:{...n.sectionPlane,enabled:!n.sectionPlane.enabled}})),flipSectionPlane:()=>e(n=>({sectionPlane:{...n.sectionPlane,position:100-n.sectionPlane.position}})),resetSectionPlane:()=>e({sectionPlane:{axis:"y",position:50,enabled:!1}}),resetViewerState:()=>e({selectedEntityId:null,selectedEntityIds:new Set,selectedStorey:null,hiddenEntities:new Set,isolatedEntities:null,hoverState:{entityId:null,screenX:0,screenY:0},contextMenu:{isOpen:!1,entityId:null,screenX:0,screenY:0},boxSelect:{isSelecting:!1,startX:0,startY:0,currentX:0,currentY:0},measurements:[],pendingMeasurePoint:null,sectionPlane:{axis:"y",position:50,enabled:!1},cameraRotation:{azimuth:45,elevation:25},activeTool:"select"})}));class Cm{buffer;position=0;lineNumber=1;constructor(t){this.buffer=t}*scanEntities(){for(this.position=0,this.lineNumber=1;this.position<this.buffer.length;)if(this.buffer[this.position]===35){const t=this.position,n=this.lineNumber,r=this.readExpressId();if(r===null){this.position++;continue}if(this.skipWhitespace(),this.position>=this.buffer.length||this.buffer[this.position]!==61){this.position++;continue}this.position++,this.skipWhitespace();const o=this.readTypeName();if(!o){this.position++;continue}if(this.skipWhitespace(),this.position>=this.buffer.length||this.buffer[this.position]!==40){this.position++;continue}const s=this.findEntityLength(t);s>0&&(yield{expressId:r,type:o,offset:t,length:s,line:n})}else this.buffer[this.position]===10?(this.lineNumber++,this.position++):this.position++}readExpressId(){let t=0,n=0,r=this.position+1;for(;r<this.buffer.length;){const o=this.buffer[r];if(o>=48&&o<=57)t=t*10+(o-48),n++,r++;else break}return n===0?null:(this.position=r,t)}readTypeName(){let t=this.position,n=t;if(this.position>=this.buffer.length||this.buffer[this.position]<65||this.buffer[this.position]>90)return null;for(;n<this.buffer.length;){const o=this.buffer[n];if(o>=65&&o<=90||o>=97&&o<=122||o>=48&&o<=57||o===95)n++;else break}if(n===t)return null;const r=new TextDecoder().decode(this.buffer.subarray(t,n));return this.position=n,r}skipWhitespace(){for(;this.position<this.buffer.length;){const t=this.buffer[this.position];if(t===32||t===9||t===13||t===10)t===10&&this.lineNumber++,this.position++;else break}}findEntityLength(t){let n=this.position,r=0,o=!1,s=!1;for(;n<this.buffer.length;){const i=this.buffer[n];if(s){s=!1,n++;continue}if(i===39){o=!o,n++;continue}if(o){i===92&&(s=!0),n++;continue}if(i===40)r++,n++;else if(i===41){if(r--,n++,r===0)return n-t}else n++}return 0}}class Em{byId=new Map;byType=new Map;addEntity(t){this.byId.set(t.expressId,t);let n=this.byType.get(t.type);n||(n=[],this.byType.set(t.type,n)),n.push(t.expressId)}build(){return{byId:this.byId,byType:this.byType}}}class fd{buffer;constructor(t){this.buffer=t}extractEntity(t){try{const r=new TextDecoder().decode(this.buffer.subarray(t.byteOffset,t.byteOffset+t.byteLength)).match(/^#(\d+)\s*=\s*(\w+)\((.*)\)/);if(!r)return null;const o=parseInt(r[1],10),s=r[2],i=r[3],a=this.parseAttributes(i);return{expressId:o,type:s,attributes:a}}catch(n){return console.warn(`Failed to extract entity #${t.expressId}:`,n),null}}parseAttributes(t){if(!t.trim())return[];const n=[];let r=0,o="",s=!1,i=!1;for(let a=0;a<t.length;a++){const l=t[a];if(i){o+=l,i=!1;continue}l==="'"?(s=!s,o+=l):s?(l==="\\"&&(i=!0),o+=l):l==="("?(r++,o+=l):l===")"?(r--,o+=l):l===","&&r===0?(n.push(this.parseAttributeValue(o.trim())),o=""):o+=l}return o.trim()&&n.push(this.parseAttributeValue(o.trim())),n}parseAttributeValue(t){if(t=t.trim(),!t||t==="$")return null;if(t.startsWith("(")&&t.endsWith(")")){const r=t.slice(1,-1).trim();if(!r)return[];const o=[];let s=0,i="";for(let a=0;a<r.length;a++){const l=r[a];if(l==="(")s++,i+=l;else if(l===")")s--,i+=l;else if(l===","&&s===0){const c=i.trim();c&&o.push(this.parseAttributeValue(c)),i=""}else i+=l}return i.trim()&&o.push(this.parseAttributeValue(i.trim())),o}if(t.startsWith("#")){const r=parseInt(t.substring(1),10);return isNaN(r)?null:r}if(t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1).replace(/\\'/g,"'").replace(/\\\\/g,"\\");const n=parseFloat(t);return isNaN(n)?t:n}}class dw{entities;constructor(t){this.entities=t}extractPropertySets(){const t=new Map;for(const[n,r]of this.entities)if(r.type.toUpperCase()==="IFCPROPERTYSET"){const o=this.extractPropertySet(r);o&&t.set(n,o)}return t}extractPropertySet(t){try{const n=this.getAttributeValue(t,2);if(!n)return null;const r=this.getAttributeValue(t,4),o=new Map;if(Array.isArray(r)){for(const s of r)if(typeof s=="number"){const i=this.entities.get(s);if(i){const a=this.extractProperty(i);a&&o.set(a.name,a.value)}}}return{name:n,properties:o}}catch(n){return console.warn(`Failed to extract PropertySet #${t.expressId}:`,n),null}}extractProperty(t){try{const n=this.getAttributeValue(t,0);if(!n)return null;const r=this.getAttributeValue(t,2),o=this.parsePropertyValue(r);return{name:n,value:o}}catch(n){return console.warn(`Failed to extract property #${t.expressId}:`,n),null}}parsePropertyValue(t){return t==null?{type:"null",value:null}:typeof t=="number"?{type:"number",value:t}:typeof t=="boolean"?{type:"boolean",value:t}:typeof t=="string"?{type:"string",value:t}:typeof t=="number"&&t<0?{type:"reference",value:t}:{type:"string",value:String(t)}}getAttributeValue(t,n){return n<0||n>=t.attributes.length?null:t.attributes[n]}}const Im={IFCQUANTITYLENGTH:"length",IFCQUANTITYAREA:"area",IFCQUANTITYVOLUME:"volume",IFCQUANTITYCOUNT:"count",IFCQUANTITYWEIGHT:"weight",IFCQUANTITYTIME:"time"};class fR{entities;debug;constructor(t,n=!1){this.entities=t,this.debug=n}extractQuantitySets(){const t=new Map;let n=0,r=0;for(const[o,s]of this.entities)if(s.type.toUpperCase()==="IFCELEMENTQUANTITY"){n++;const a=this.extractQuantitySet(s);a&&(t.set(o,a),r+=a.quantities.length,this.debug&&t.size<=3&&console.log(`[QuantityExtractor] Extracted QuantitySet #${o}:`,{name:a.name,quantities:a.quantities.length,first:a.quantities[0]}))}return console.log(`[QuantityExtractor] Found ${n} IfcElementQuantity entities`),console.log(`[QuantityExtractor] Extracted ${t.size} quantity sets with ${r} total quantities`),t}extractQuantitySet(t){try{const n=t.attributes;if(n.length<6)return this.debug&&console.warn(`[QuantityExtractor] IfcElementQuantity #${t.expressId} has insufficient attributes: ${n.length}`),null;const r=this.toString(n[0]),o=this.toString(n[2]);if(!o)return this.debug&&console.warn(`[QuantityExtractor] IfcElementQuantity #${t.expressId} has no name`),null;const s=this.toString(n[4])||void 0,i=n[5],a=[];if(Array.isArray(i)){for(const l of i)if(typeof l=="number"){const c=this.entities.get(l);if(c){const u=this.extractQuantity(c);u&&a.push(u)}else this.debug&&console.warn(`[QuantityExtractor] Referenced quantity #${l} not found`)}}return{expressId:t.expressId,name:o,globalId:r||void 0,methodOfMeasurement:s,quantities:a}}catch(n){return console.warn(`[QuantityExtractor] Failed to extract QuantitySet #${t.expressId}:`,n),null}}extractQuantity(t){try{const n=t.type.toUpperCase(),r=Im[n];if(!r)return null;const o=t.attributes;if(o.length<4)return this.debug&&console.warn(`[QuantityExtractor] ${t.type} #${t.expressId} has insufficient attributes: ${o.length}`),null;const s=this.toString(o[0]);if(!s)return this.debug&&console.warn(`[QuantityExtractor] ${t.type} #${t.expressId} has no name`),null;const i=o[3];if(typeof i!="number")return this.debug&&console.warn(`[QuantityExtractor] ${t.type} #${t.expressId} has non-numeric value:`,i),null;const a=o.length>4&&this.toString(o[4])||void 0;return{name:s,type:r,value:i,formula:a}}catch(n){return console.warn(`[QuantityExtractor] Failed to extract quantity #${t.expressId}:`,n),null}}toString(t){return t==null?null:typeof t=="string"?t:null}getElementQuantityCount(){let t=0;for(const n of this.entities.values())n.type.toUpperCase()==="IFCELEMENTQUANTITY"&&t++;return t}getQuantityValueCount(){let t=0;for(const n of this.entities.values()){const r=n.type.toUpperCase();Im[r]&&t++}return t}}class fw{entities;constructor(t){this.entities=t}extractRelationships(){const t=[],n=new Map;for(const[,r]of this.entities){const o=r.type.toUpperCase();o.startsWith("IFCREL")&&n.set(o,(n.get(o)||0)+1);const s=this.extractRelationship(r);s&&t.push(s)}return console.log("[RelationshipExtractor] Relationship type counts:",Object.fromEntries(n)),console.log("[RelationshipExtractor] Successfully extracted:",t.length),t}extractRelationship(t){const n=t.type.toUpperCase();if(!["IFCRELCONTAINEDINSPATIALSTRUCTURE","IFCRELAGGREGATES","IFCRELDEFINESBYPROPERTIES","IFCRELDEFINESBYTYPE","IFCRELASSOCIATESMATERIAL","IFCRELVOIDSELEMENT","IFCRELFILLSELEMENT"].includes(n))return null;try{let o,s;return n==="IFCRELDEFINESBYPROPERTIES"?(s=this.getAttributeValue(t,4),o=this.getAttributeValue(t,5)):n==="IFCRELCONTAINEDINSPATIALSTRUCTURE"?(s=this.getAttributeValue(t,4),o=this.getAttributeValue(t,5)):(o=this.getAttributeValue(t,4),s=this.getAttributeValue(t,5)),o===null||typeof o!="number"||!Array.isArray(s)?null:{type:t.type,relatingObject:o,relatedObjects:s.filter(i=>typeof i=="number")}}catch(o){return console.warn(`Failed to extract relationship #${t.expressId}:`,o),null}}getAttributeValue(t,n){return n<0||n>=t.attributes.length?null:t.attributes[n]}}class hw{strings=[""];index=new Map([["",0]]);NULL_INDEX=-1;get count(){return this.strings.length}get(t){return t<0||t>=this.strings.length?"":this.strings[t]}intern(t){if(t==null)return this.NULL_INDEX;const n=this.index.get(t);if(n!==void 0)return n;const r=this.strings.length;return this.strings.push(t),this.index.set(t,r),r}has(t){return this.index.has(t)}indexOf(t){return this.index.get(t)??-1}getAll(){return[...this.strings]}}var Lt=(e=>(e[e.IfcProject=1]="IfcProject",e[e.IfcSite=2]="IfcSite",e[e.IfcBuilding=3]="IfcBuilding",e[e.IfcBuildingStorey=4]="IfcBuildingStorey",e[e.IfcSpace=5]="IfcSpace",e[e.IfcWall=10]="IfcWall",e[e.IfcWallStandardCase=11]="IfcWallStandardCase",e[e.IfcDoor=12]="IfcDoor",e[e.IfcWindow=13]="IfcWindow",e[e.IfcSlab=14]="IfcSlab",e[e.IfcColumn=15]="IfcColumn",e[e.IfcBeam=16]="IfcBeam",e[e.IfcStair=17]="IfcStair",e[e.IfcRamp=18]="IfcRamp",e[e.IfcRoof=19]="IfcRoof",e[e.IfcCovering=20]="IfcCovering",e[e.IfcCurtainWall=21]="IfcCurtainWall",e[e.IfcRailing=22]="IfcRailing",e[e.IfcOpeningElement=30]="IfcOpeningElement",e[e.IfcDistributionElement=40]="IfcDistributionElement",e[e.IfcFlowTerminal=41]="IfcFlowTerminal",e[e.IfcFlowSegment=42]="IfcFlowSegment",e[e.IfcFlowFitting=43]="IfcFlowFitting",e[e.IfcRelContainedInSpatialStructure=100]="IfcRelContainedInSpatialStructure",e[e.IfcRelAggregates=101]="IfcRelAggregates",e[e.IfcRelDefinesByProperties=102]="IfcRelDefinesByProperties",e[e.IfcRelDefinesByType=103]="IfcRelDefinesByType",e[e.IfcRelAssociatesMaterial=104]="IfcRelAssociatesMaterial",e[e.IfcRelAssociatesClassification=105]="IfcRelAssociatesClassification",e[e.IfcRelVoidsElement=106]="IfcRelVoidsElement",e[e.IfcRelFillsElement=107]="IfcRelFillsElement",e[e.IfcRelConnectsPathElements=108]="IfcRelConnectsPathElements",e[e.IfcRelSpaceBoundary=109]="IfcRelSpaceBoundary",e[e.IfcPropertySet=200]="IfcPropertySet",e[e.IfcPropertySingleValue=201]="IfcPropertySingleValue",e[e.IfcPropertyEnumeratedValue=202]="IfcPropertyEnumeratedValue",e[e.IfcPropertyBoundedValue=203]="IfcPropertyBoundedValue",e[e.IfcPropertyListValue=204]="IfcPropertyListValue",e[e.IfcElementQuantity=210]="IfcElementQuantity",e[e.IfcQuantityLength=211]="IfcQuantityLength",e[e.IfcQuantityArea=212]="IfcQuantityArea",e[e.IfcQuantityVolume=213]="IfcQuantityVolume",e[e.IfcQuantityCount=214]="IfcQuantityCount",e[e.IfcQuantityWeight=215]="IfcQuantityWeight",e[e.IfcWallType=300]="IfcWallType",e[e.IfcDoorType=301]="IfcDoorType",e[e.IfcWindowType=302]="IfcWindowType",e[e.IfcSlabType=303]="IfcSlabType",e[e.IfcColumnType=304]="IfcColumnType",e[e.IfcBeamType=305]="IfcBeamType",e[e.Unknown=9999]="Unknown",e))(Lt||{}),se=(e=>(e[e.String=0]="String",e[e.Real=1]="Real",e[e.Integer=2]="Integer",e[e.Boolean=3]="Boolean",e[e.Logical=4]="Logical",e[e.Label=5]="Label",e[e.Identifier=6]="Identifier",e[e.Text=7]="Text",e[e.Enum=8]="Enum",e[e.Reference=9]="Reference",e[e.List=10]="List",e))(se||{}),ht=(e=>(e[e.Length=0]="Length",e[e.Area=1]="Area",e[e.Volume=2]="Volume",e[e.Count=3]="Count",e[e.Weight=4]="Weight",e[e.Time=5]="Time",e))(ht||{}),X=(e=>(e[e.ContainsElements=1]="ContainsElements",e[e.Aggregates=2]="Aggregates",e[e.DefinesByProperties=10]="DefinesByProperties",e[e.DefinesByType=11]="DefinesByType",e[e.AssociatesMaterial=20]="AssociatesMaterial",e[e.AssociatesClassification=30]="AssociatesClassification",e[e.ConnectsPathElements=40]="ConnectsPathElements",e[e.FillsElement=41]="FillsElement",e[e.VoidsElement=42]="VoidsElement",e[e.ConnectsElements=43]="ConnectsElements",e[e.SpaceBoundary=50]="SpaceBoundary",e[e.AssignsToGroup=60]="AssignsToGroup",e[e.AssignsToProduct=61]="AssignsToProduct",e[e.ReferencedInSpatialStructure=70]="ReferencedInSpatialStructure",e))(X||{}),ka=(e=>(e[e.HAS_GEOMETRY=1]="HAS_GEOMETRY",e[e.HAS_PROPERTIES=2]="HAS_PROPERTIES",e[e.HAS_QUANTITIES=4]="HAS_QUANTITIES",e[e.IS_TYPE=8]="IS_TYPE",e[e.IS_EXTERNAL=16]="IS_EXTERNAL",e[e.HAS_OPENINGS=32]="HAS_OPENINGS",e[e.IS_FILLING=64]="IS_FILLING",e))(ka||{});const hR=new Map([["IFCPROJECT",1],["IFCSITE",2],["IFCBUILDING",3],["IFCBUILDINGSTOREY",4],["IFCSPACE",5],["IFCWALL",10],["IFCWALLSTANDARDCASE",11],["IFCDOOR",12],["IFCWINDOW",13],["IFCSLAB",14],["IFCCOLUMN",15],["IFCBEAM",16],["IFCSTAIR",17],["IFCRAMP",18],["IFCROOF",19],["IFCCOVERING",20],["IFCCURTAINWALL",21],["IFCRAILING",22],["IFCOPENINGELEMENT",30],["IFCDISTRIBUTIONELEMENT",40],["IFCFLOWTERMINAL",41],["IFCFLOWSEGMENT",42],["IFCFLOWFITTING",43],["IFCRELCONTAINEDINSPATIALSTRUCTURE",100],["IFCRELAGGREGATES",101],["IFCRELDEFINESBYPROPERTIES",102],["IFCRELDEFINESBYTYPE",103],["IFCRELASSOCIATESMATERIAL",104],["IFCRELASSOCIATESCLASSIFICATION",105],["IFCRELVOIDSELEMENT",106],["IFCRELFILLSELEMENT",107],["IFCRELCONNECTSPATHELEMENTS",108],["IFCRELSPACEBOUNDARY",109],["IFCPROPERTYSET",200],["IFCPROPERTYSINGLEVALUE",201],["IFCPROPERTYENUMERATEDVALUE",202],["IFCPROPERTYBOUNDEDVALUE",203],["IFCPROPERTYLISTVALUE",204],["IFCELEMENTQUANTITY",210],["IFCQUANTITYLENGTH",211],["IFCQUANTITYAREA",212],["IFCQUANTITYVOLUME",213],["IFCQUANTITYCOUNT",214],["IFCQUANTITYWEIGHT",215],["IFCWALLTYPE",300],["IFCDOORTYPE",301],["IFCWINDOWTYPE",302],["IFCSLABTYPE",303],["IFCCOLUMNTYPE",304],["IFCBEAMTYPE",305]]),pR=new Map([[1,"IfcProject"],[2,"IfcSite"],[3,"IfcBuilding"],[4,"IfcBuildingStorey"],[5,"IfcSpace"],[10,"IfcWall"],[11,"IfcWallStandardCase"],[12,"IfcDoor"],[13,"IfcWindow"],[14,"IfcSlab"],[15,"IfcColumn"],[16,"IfcBeam"],[17,"IfcStair"],[18,"IfcRamp"],[19,"IfcRoof"],[20,"IfcCovering"],[21,"IfcCurtainWall"],[22,"IfcRailing"],[30,"IfcOpeningElement"],[40,"IfcDistributionElement"],[41,"IfcFlowTerminal"],[42,"IfcFlowSegment"],[43,"IfcFlowFitting"],[100,"IfcRelContainedInSpatialStructure"],[101,"IfcRelAggregates"],[102,"IfcRelDefinesByProperties"],[103,"IfcRelDefinesByType"],[104,"IfcRelAssociatesMaterial"],[105,"IfcRelAssociatesClassification"],[106,"IfcRelVoidsElement"],[107,"IfcRelFillsElement"],[108,"IfcRelConnectsPathElements"],[109,"IfcRelSpaceBoundary"],[200,"IfcPropertySet"],[201,"IfcPropertySingleValue"],[202,"IfcPropertyEnumeratedValue"],[203,"IfcPropertyBoundedValue"],[204,"IfcPropertyListValue"],[210,"IfcElementQuantity"],[211,"IfcQuantityLength"],[212,"IfcQuantityArea"],[213,"IfcQuantityVolume"],[214,"IfcQuantityCount"],[215,"IfcQuantityWeight"],[300,"IfcWallType"],[301,"IfcDoorType"],[302,"IfcWindowType"],[303,"IfcSlabType"],[304,"IfcColumnType"],[305,"IfcBeamType"]]);function pw(e){return hR.get(e.toUpperCase())??9999}function Yf(e){return pR.get(e)??"Unknown"}class mR{count=0;strings;expressId;typeEnum;globalId;name;description;objectType;flags;containedInStorey;definedByType;geometryIndex;typeStarts=new Map;typeCounts=new Map;constructor(t,n){this.strings=n,this.expressId=new Uint32Array(t),this.typeEnum=new Uint16Array(t),this.globalId=new Uint32Array(t),this.name=new Uint32Array(t),this.description=new Uint32Array(t),this.objectType=new Uint32Array(t),this.flags=new Uint8Array(t),this.containedInStorey=new Int32Array(t).fill(-1),this.definedByType=new Int32Array(t).fill(-1),this.geometryIndex=new Int32Array(t).fill(-1)}add(t,n,r,o,s,i,a=!1,l=!1){const c=this.count++;this.expressId[c]=t;const u=pw(n);this.typeEnum[c]=u,this.globalId[c]=this.strings.intern(r),this.name[c]=this.strings.intern(o),this.description[c]=this.strings.intern(s),this.objectType[c]=this.strings.intern(i);let d=0;a&&(d|=ka.HAS_GEOMETRY),l&&(d|=ka.IS_TYPE),this.flags[c]=d,this.typeStarts.has(u)||(this.typeStarts.set(u,c),this.typeCounts.set(u,0)),this.typeCounts.set(u,this.typeCounts.get(u)+1)}build(){const t=y=>y.subarray(0,this.count),n=new Map;for(const[y,p]of this.typeStarts){const x=this.typeCounts.get(y);n.set(y,{start:p,end:p+x})}const r=t(this.expressId),o=t(this.typeEnum),s=t(this.globalId),i=t(this.name),a=t(this.description),l=t(this.objectType),c=t(this.flags),u=t(this.containedInStorey),d=t(this.definedByType),f=t(this.geometryIndex);return{count:this.count,expressId:r,typeEnum:o,globalId:s,name:i,description:a,objectType:l,flags:c,containedInStorey:u,definedByType:d,geometryIndex:f,typeRanges:n,getGlobalId:y=>{const p=this.indexOfId(r,y);return p>=0?this.strings.get(s[p]):""},getName:y=>{const p=this.indexOfId(r,y);return p>=0?this.strings.get(i[p]):""},getTypeName:y=>{const p=this.indexOfId(r,y);return p>=0?Yf(o[p]):"Unknown"},hasGeometry:y=>{const p=this.indexOfId(r,y);return p>=0?(c[p]&ka.HAS_GEOMETRY)!==0:!1},getByType:y=>{const p=n.get(y);if(!p)return[];const x=[];for(let b=p.start;b<p.end;b++)x.push(r[b]);return x}}}indexOfId(t,n){for(let r=0;r<t.length;r++)if(t[r]===n)return r;return-1}}class gR{strings;rows=[];constructor(t){this.strings=t}add(t){this.rows.push(t)}build(){const t=this.rows.length,n=new Uint32Array(t),r=new Uint32Array(t),o=new Uint32Array(t),s=new Uint32Array(t),i=new Uint8Array(t),a=new Uint32Array(t),l=new Float64Array(t),c=new Int32Array(t),u=new Uint8Array(t).fill(255),d=new Int32Array(t).fill(-1),f=new Map,y=new Map,p=new Map;for(let m=0;m<t;m++){const v=this.rows[m];n[m]=v.entityId;const w=this.strings.intern(v.psetName),S=this.strings.intern(v.psetGlobalId),_=this.strings.intern(v.propName);switch(r[m]=w,o[m]=S,s[m]=_,i[m]=v.propType,v.propType){case se.String:case se.Label:case se.Identifier:case se.Text:case se.Enum:a[m]=this.strings.intern(v.value);break;case se.Real:l[m]=v.value;break;case se.Integer:c[m]=v.value;break;case se.Boolean:case se.Logical:u[m]=v.value===!0?1:v.value===!1?0:255;break;case se.List:a[m]=this.strings.intern(JSON.stringify(v.value));break}v.unitId!==void 0&&(d[m]=v.unitId),Qc(f,v.entityId,m),Qc(y,w,m),Qc(p,_,m)}const x=this.strings,b={count:t,entityId:n,psetName:r,psetGlobalId:o,propName:s,propType:i,valueString:a,valueReal:l,valueInt:c,valueBool:u,unitId:d,entityIndex:f,psetIndex:y,propIndex:p,getForEntity:m=>{const v=f.get(m)||[],w=new Map;for(const S of v){const _=x.get(r[S]),I=x.get(o[S]);w.has(_)||w.set(_,{name:_,globalId:I,properties:[]});const C=w.get(_),E=x.get(s[S]),R=Kc(b,S,x);C.properties.push({name:E,type:i[S],value:R})}return Array.from(w.values())},getPropertyValue:(m,v,w)=>{const S=f.get(m)||[],_=x.indexOf(v),I=x.indexOf(w);for(const C of S)if(r[C]===_&&s[C]===I)return Kc(b,C,x);return null},findByProperty:(m,v,w)=>{const S=x.indexOf(m);if(S<0)return[];const _=p.get(S)||[],I=[];for(const C of _){const E=Kc(b,C,x);yR(E,v,w)&&I.push(n[C])}return I}};return b}}function Qc(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function Kc(e,t,n){switch(e.propType[t]){case se.String:case se.Label:case se.Identifier:case se.Text:case se.Enum:return e.valueString[t]>=0?n.get(e.valueString[t]):null;case se.Real:return e.valueReal[t];case se.Integer:return e.valueInt[t];case se.Boolean:case se.Logical:const o=e.valueBool[t];return o===255?null:o===1;case se.List:const s=n.get(e.valueString[t]);try{return JSON.parse(s)}catch{return[]}default:return null}}function yR(e,t,n){if(e===null||n===null)return!1;if(typeof e=="number"&&typeof n=="number")switch(t){case">=":return e>=n;case">":return e>n;case"<=":return e<=n;case"<":return e<n;case"=":case"==":return e===n;case"!=":return e!==n}if(typeof e=="string"&&typeof n=="string")switch(t){case"=":case"==":return e===n;case"!=":return e!==n;case"contains":return e.includes(n);case"startsWith":return e.startsWith(n)}return!1}class vR{strings;rows=[];constructor(t){this.strings=t}add(t){this.rows.push(t)}build(){const t=this.rows.length,n=new Uint32Array(t),r=new Uint32Array(t),o=new Uint32Array(t),s=new Uint8Array(t),i=new Float64Array(t),a=new Int32Array(t).fill(-1),l=new Uint32Array(t).fill(0),c=new Map,u=new Map,d=new Map;for(let f=0;f<t;f++){const y=this.rows[f];n[f]=y.entityId,r[f]=this.strings.intern(y.qsetName),o[f]=this.strings.intern(y.quantityName),s[f]=y.quantityType,i[f]=y.value,y.unitId!==void 0&&(a[f]=y.unitId),y.formula&&(l[f]=this.strings.intern(y.formula)),Zc(c,y.entityId,f),Zc(u,r[f],f),Zc(d,o[f],f)}return{count:t,entityId:n,qsetName:r,quantityName:o,quantityType:s,value:i,unitId:a,formula:l,entityIndex:c,qsetIndex:u,quantityIndex:d,getForEntity:f=>{const y=c.get(f)||[],p=new Map;for(const x of y){const b=this.strings.get(r[x]);p.has(b)||p.set(b,{name:b,quantities:[]});const m=p.get(b),v=this.strings.get(o[x]);m.quantities.push({name:v,type:s[x],value:i[x],formula:l[x]>0?this.strings.get(l[x]):void 0})}return Array.from(p.values())},getQuantityValue:(f,y,p)=>{const x=c.get(f)||[],b=this.strings.indexOf(y),m=this.strings.indexOf(p);for(const v of x)if(r[v]===b&&o[v]===m)return i[v];return null},sumByType:f=>{const y=this.strings.indexOf(f);if(y<0)return 0;const p=d.get(y)||[];let x=0;for(const b of p)x+=i[b];return x}}}}function Zc(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}class xR{edges=[];addEdge(t,n,r,o){this.edges.push({source:t,target:n,type:r,relId:o})}build(){const t=[...this.edges].sort((s,i)=>s.source-i.source),n=[...this.edges].sort((s,i)=>s.target-i.target),r=this.buildEdges(t,"source","target"),o=this.buildEdges(n,"target","source");return{forward:r,inverse:o,getRelated:(s,i,a)=>(a==="forward"?r.getEdges(s,i):o.getEdges(s,i)).map(c=>c.target),hasRelationship:(s,i,a)=>r.getEdges(s,a).some(c=>c.target===i),getRelationshipsBetween:(s,i)=>r.getEdges(s).filter(l=>l.target===i).map(l=>({relationshipId:l.relationshipId,type:l.type,typeName:wR(l.type)}))}}buildEdges(t,n,r){const o=new Map,s=new Map,i=new Uint32Array(t.length),a=new Uint16Array(t.length),l=new Uint32Array(t.length);let c=-1;for(let u=0;u<t.length;u++){const d=t[u],f=d[n];f!==c&&(o.set(f,u),c=f),s.set(f,(s.get(f)??0)+1),i[u]=d[r],a[u]=d.type,l[u]=d.relId}return{offsets:o,counts:s,edgeTargets:i,edgeTypes:a,edgeRelIds:l,getEdges(u,d){const f=o.get(u);if(f===void 0)return[];const y=s.get(u),p=[];for(let x=f;x<f+y;x++)(d===void 0||a[x]===d)&&p.push({target:i[x],type:a[x],relationshipId:l[x]});return p},getTargets(u,d){return this.getEdges(u,d).map(f=>f.target)},hasAnyEdges(u){return o.has(u)}}}}function wR(e){return{[X.ContainsElements]:"IfcRelContainedInSpatialStructure",[X.Aggregates]:"IfcRelAggregates",[X.DefinesByProperties]:"IfcRelDefinesByProperties",[X.DefinesByType]:"IfcRelDefinesByType",[X.AssociatesMaterial]:"IfcRelAssociatesMaterial",[X.AssociatesClassification]:"IfcRelAssociatesClassification",[X.VoidsElement]:"IfcRelVoidsElement",[X.FillsElement]:"IfcRelFillsElement",[X.ConnectsPathElements]:"IfcRelConnectsPathElements",[X.ConnectsElements]:"IfcRelConnectsElements",[X.SpaceBoundary]:"IfcRelSpaceBoundary",[X.AssignsToGroup]:"IfcRelAssignsToGroup",[X.AssignsToProduct]:"IfcRelAssignsToProduct",[X.ReferencedInSpatialStructure]:"ReferencedInSpatialStructure"}[e]||"Unknown"}class bR{build(t,n,r,o,s){const i=new Map,a=new Map,l=new Map,c=new Map,u=new Map,d=new Map,f=t.getByType(Lt.IfcProject);if(f.length===0)throw console.warn("[SpatialHierarchyBuilder] No IfcProject found in IFC file"),new Error("No IfcProject found in IFC file");const y=f[0],p=this.buildNode(y,t,n,r,o,s,i,a,l,c,u,d);for(const[b,m]of i)for(const v of m)d.set(v,b);return i.size===0&&console.warn("[SpatialHierarchyBuilder] No storeys found in spatial hierarchy"),a.size===0&&console.warn("[SpatialHierarchyBuilder] No buildings found in spatial hierarchy"),{project:p,byStorey:i,byBuilding:a,bySite:l,bySpace:c,storeyElevations:u,elementToStorey:d,getStoreyElements(b){return i.get(b)??[]},getStoreyByElevation(b){let m=null,v=1/0;for(const[w,S]of u){const _=Math.abs(S-b);_<v&&(v=_,m=w)}return v<1?m:null},getContainingSpace(b){for(const[m,v]of c)if(v.includes(b))return m;return null},getPath(b){const m=[];if(!d.get(b))return m;const w=(S,_)=>{if(m.push(S),S.elements.includes(_))return!0;for(const I of S.children)if(w(I,_))return!0;return m.pop(),!1};return w(p,b),m}}}buildNode(t,n,r,o,s,i,a,l,c,u,d,f){const y=this.getTypeEnum(t,n),p=n.getName(t);let x;y===Lt.IfcBuildingStorey&&(x=this.extractElevation(t,s,i),x!==void 0&&d.set(t,x));const b=r.getRelated(t,X.ContainsElements,"forward"),m=r.getRelated(t,X.Aggregates,"forward"),v=[];for(const w of m){const S=this.getTypeEnum(w,n);if(S===Lt.IfcSite||S===Lt.IfcBuilding||S===Lt.IfcBuildingStorey||S===Lt.IfcSpace){const _=this.buildNode(w,n,r,o,s,i,a,l,c,u,d,f);v.push(_)}}return y===Lt.IfcBuildingStorey?a.set(t,b):y===Lt.IfcBuilding?l.set(t,b):y===Lt.IfcSite?c.set(t,b):y===Lt.IfcSpace&&u.set(t,b),{expressId:t,type:y,name:p,elevation:x,children:v,elements:b}}getTypeEnum(t,n){for(let r=0;r<n.count;r++)if(n.expressId[r]===t)return n.typeEnum[r];return Lt.Unknown}extractElevation(t,n,r){const o=r.byId.get(t);if(o)try{const i=new fd(n).extractEntity(o);if(!i)return;const a=i.attributes||[];if(a.length>8&&typeof a[8]=="number")return a[8];if(a.length>7&&typeof a[7]=="number")return a[7];if(a.length>6&&typeof a[6]=="number")return a[6];for(let l=0;l<a.length;l++)if(typeof a[l]=="number"&&Math.abs(a[l])<1e4)return a[l]}catch{}}}class SR{async parse(t,n,r,o={}){const s=performance.now(),i=new Uint8Array(t),a=new hw,l=new mR(r.size,a),c=new gR(a),u=new xR;o.onProgress?.({phase:"entities",percent:0});let d=0;for(const[F,O]of r){const V=O.attributes||[],k=String(V[0]||""),T=String(V[2]||""),$=String(V[3]||""),ne=String(V[7]||""),W=O.type.toUpperCase().includes("WALL")||O.type.toUpperCase().includes("DOOR")||O.type.toUpperCase().includes("WINDOW")||O.type.toUpperCase().includes("SLAB")||O.type.toUpperCase().includes("COLUMN")||O.type.toUpperCase().includes("BEAM"),Q=O.type.toUpperCase().endsWith("TYPE");l.add(F,O.type,k,T,$,ne,W,Q),d++,d%1e3===0&&o.onProgress?.({phase:"entities",percent:d/r.size*100})}const f=l.build();o.onProgress?.({phase:"entities",percent:100}),o.onProgress?.({phase:"properties",percent:0});const p=new dw(r).extractPropertySets(),x=new Map,m=new fw(r).extractRelationships();for(const F of m)if(F.type.toUpperCase()==="IFCRELDEFINESBYPROPERTIES"){const O=F.relatingObject;for(const V of F.relatedObjects){let k=x.get(O);k||(k=[],x.set(O,k)),k.push(V)}}for(const[F,O]of p){const V=x.get(F)||[],k=String(r.get(F)?.attributes?.[0]||"");for(const[T,$]of O.properties)for(const ne of V){let W=se.String,Q=$.value;$.type==="number"?(W=se.Real,Q=$.value):$.type==="boolean"?(W=se.Boolean,Q=$.value):$.type==="string"&&(W=se.String,Q=String($.value)),c.add({entityId:ne,psetName:O.name,psetGlobalId:k,propName:T,propType:W,value:Q})}}const v=c.build();o.onProgress?.({phase:"properties",percent:100}),o.onProgress?.({phase:"quantities",percent:0});const w=new vR(a),_=new fR(r).extractQuantitySets(),I=new Map;for(const F of m)if(F.type.toUpperCase()==="IFCRELDEFINESBYPROPERTIES"){const O=F.relatingObject;if(_.has(O))for(const V of F.relatedObjects){let k=I.get(O);k||(k=[],I.set(O,k)),k.push(V)}}const C={length:ht.Length,area:ht.Area,volume:ht.Volume,count:ht.Count,weight:ht.Weight,time:ht.Time};for(const[F,O]of _){const V=I.get(F)||[];for(const k of O.quantities)for(const T of V)w.add({entityId:T,qsetName:O.name,quantityName:k.name,quantityType:C[k.type]??ht.Length,value:k.value,formula:k.formula})}const E=w.build();o.onProgress?.({phase:"quantities",percent:100}),o.onProgress?.({phase:"relationships",percent:0});const R={IFCRELCONTAINEDINSPATIALSTRUCTURE:X.ContainsElements,IFCRELAGGREGATES:X.Aggregates,IFCRELDEFINESBYPROPERTIES:X.DefinesByProperties,IFCRELDEFINESBYTYPE:X.DefinesByType,IFCRELASSOCIATESMATERIAL:X.AssociatesMaterial,IFCRELASSOCIATESCLASSIFICATION:X.AssociatesClassification,IFCRELVOIDSELEMENT:X.VoidsElement,IFCRELFILLSELEMENT:X.FillsElement,IFCRELCONNECTSPATHELEMENTS:X.ConnectsPathElements,IFCRELSPACEBOUNDARY:X.SpaceBoundary};for(const F of m){const O=R[F.type.toUpperCase()];if(O)for(const V of F.relatedObjects)u.addEdge(F.relatingObject,V,O,F.relatingObject)}const M=u.build();o.onProgress?.({phase:"relationships",percent:100});let N="IFC4";for(const[,F]of r)if(F.type.toUpperCase()==="IFCPROJECT"){N="IFC4";break}const A=performance.now()-s,j={byId:new Map,byType:new Map};for(const F of n){j.byId.set(F.expressId,F);let O=j.byType.get(F.type);O||(O=[],j.byType.set(F.type,O)),O.push(F.expressId)}o.onProgress?.({phase:"spatial-hierarchy",percent:0});let L;try{L=new bR().build(f,M,a,i,j)}catch(F){console.warn("[ColumnarParser] Failed to build spatial hierarchy:",F)}return o.onProgress?.({phase:"spatial-hierarchy",percent:100}),{fileSize:t.byteLength,schemaVersion:N,entityCount:r.size,parseTime:A,source:i,entityIndex:j,strings:a,entities:f,properties:v,quantities:E,relationships:M,spatialHierarchy:L}}}class _R{async parse(t,n={}){const r=new Uint8Array(t);n.onProgress?.({phase:"scan",percent:0});const o=new Cm(r),s=new Em,i=[];for(const p of o.scanEntities())s.addEntity({expressId:p.expressId,type:p.type,byteOffset:p.offset,byteLength:p.length,lineNumber:p.line}),i.push({expressId:p.expressId,type:p.type,byteOffset:p.offset,byteLength:p.length,lineNumber:p.line});const a=s.build();n.onProgress?.({phase:"scan",percent:100}),n.onProgress?.({phase:"extract",percent:0});const l=new fd(r),c=new Map;for(let p=0;p<i.length;p++){const x=i[p],b=l.extractEntity(x);b&&c.set(x.expressId,b),(p+1)%1e3===0&&n.onProgress?.({phase:"extract",percent:(p+1)/i.length*100})}n.onProgress?.({phase:"extract",percent:100}),n.onProgress?.({phase:"properties",percent:0});const d=new dw(c).extractPropertySets();n.onProgress?.({phase:"properties",percent:100}),n.onProgress?.({phase:"relationships",percent:0});const y=new fw(c).extractRelationships();return n.onProgress?.({phase:"relationships",percent:100}),{entities:c,propertySets:d,relationships:y,entityIndex:a,fileSize:t.byteLength,entityCount:c.size}}async parseColumnar(t,n={}){const r=new Uint8Array(t);n.onProgress?.({phase:"scan",percent:0});const o=new Cm(r),s=new Em,i=[];for(const u of o.scanEntities())s.addEntity({expressId:u.expressId,type:u.type,byteOffset:u.offset,byteLength:u.length,lineNumber:u.line}),i.push({expressId:u.expressId,type:u.type,byteOffset:u.offset,byteLength:u.length,lineNumber:u.line});s.build(),n.onProgress?.({phase:"scan",percent:100}),n.onProgress?.({phase:"extract",percent:0});const a=new fd(r),l=new Map;for(let u=0;u<i.length;u++){const d=i[u],f=a.extractEntity(d);f&&l.set(d.expressId,f),(u+1)%1e3===0&&n.onProgress?.({phase:"extract",percent:(u+1)/i.length*100})}return n.onProgress?.({phase:"extract",percent:100}),new SR().parse(t,i,l,n)}}let P;function ue(e){Os===Rn.length&&Rn.push(Rn.length+1);const t=Os;return Os=Rn[t],Rn[t]=e,t}const km=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>e.dtor(e.a,e.b));function hd(e){const t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){const o=e.description;return o==null?"Symbol":`Symbol(${o})`}if(t=="function"){const o=e.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(e)){const o=e.length;let s="[";o>0&&(s+=hd(e[0]));for(let i=1;i<o;i++)s+=", "+hd(e[i]);return s+="]",s}const n=/\[object ([^\]]+)\]/.exec(toString.call(e));let r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message}
|
|
372
|
+
${e.stack}`:r}function CR(e){e<132||(Rn[e]=Os,Os=e)}function di(e,t){return e=e>>>0,IR().subarray(e/4,e/4+t)}function Ma(e,t){return e=e>>>0,kR().subarray(e/8,e/8+t)}function ER(e,t){return e=e>>>0,MR().subarray(e/4,e/4+t)}let Tr=null;function me(){return(Tr===null||Tr.buffer.detached===!0||Tr.buffer.detached===void 0&&Tr.buffer!==P.memory.buffer)&&(Tr=new DataView(P.memory.buffer)),Tr}let Cs=null;function IR(){return(Cs===null||Cs.byteLength===0)&&(Cs=new Float32Array(P.memory.buffer)),Cs}let Es=null;function kR(){return(Es===null||Es.byteLength===0)&&(Es=new Float64Array(P.memory.buffer)),Es}function or(e,t){return e=e>>>0,RR(e,t)}let Is=null;function MR(){return(Is===null||Is.byteLength===0)&&(Is=new Uint32Array(P.memory.buffer)),Is}let ks=null;function Pa(){return(ks===null||ks.byteLength===0)&&(ks=new Uint8Array(P.memory.buffer)),ks}function he(e){return Rn[e]}function co(e,t){try{return e.apply(this,t)}catch(n){P.__wbindgen_export3(ue(n))}}let Rn=new Array(128).fill(void 0);Rn.push(void 0,null,!0,!1);let Os=Rn.length;function uo(e){return e==null}function Mm(e,t,n,r){const o={a:e,b:t,cnt:1,dtor:n},s=(...i)=>{o.cnt++;const a=o.a;o.a=0;try{return r(a,o.b,...i)}finally{o.a=a,s._wbg_cb_unref()}};return s._wbg_cb_unref=()=>{--o.cnt===0&&(o.dtor(o.a,o.b),o.a=0,km.unregister(o))},km.register(s,o,o),s}function St(e,t,n){if(n===void 0){const a=Bs.encode(e),l=t(a.length,1)>>>0;return Pa().subarray(l,l+a.length).set(a),ot=a.length,l}let r=e.length,o=t(r,1)>>>0;const s=Pa();let i=0;for(;i<r;i++){const a=e.charCodeAt(i);if(a>127)break;s[o+i]=a}if(i!==r){i!==0&&(e=e.slice(i)),o=n(o,r,r=i+e.length*3,1)>>>0;const a=Pa().subarray(o+i,o+r),l=Bs.encodeInto(e,a);i+=l.written,o=n(o,r,i,1)>>>0}return ot=i,o}function mt(e){const t=he(e);return CR(e),t}let Ra=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});Ra.decode();const PR=2146435072;let Jc=0;function RR(e,t){return Jc+=t,Jc>=PR&&(Ra=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),Ra.decode(),Jc=t),Ra.decode(Pa().subarray(e,e+t))}const Bs=new TextEncoder;"encodeInto"in Bs||(Bs.encodeInto=function(e,t){const n=Bs.encode(e);return t.set(n),{read:e.length,written:n.length}});let ot=0;function TR(e,t){P.__wasm_bindgen_func_elem_295(e,t)}function NR(e,t,n){P.__wasm_bindgen_func_elem_306(e,t,ue(n))}function AR(e,t,n,r){P.__wasm_bindgen_func_elem_340(e,t,ue(n),ue(r))}const Pm=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>P.__wbg_georeferencejs_free(e>>>0,1)),Rm=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>P.__wbg_ifcapi_free(e>>>0,1)),Tm=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>P.__wbg_instancedata_free(e>>>0,1)),Nm=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>P.__wbg_instancedgeometry_free(e>>>0,1)),Am=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>P.__wbg_instancedmeshcollection_free(e>>>0,1)),zm=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>P.__wbg_meshcollection_free(e>>>0,1)),Fm=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>P.__wbg_meshcollectionwithrtc_free(e>>>0,1)),jm=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>P.__wbg_meshdatajs_free(e>>>0,1)),Lm=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>P.__wbg_rtcoffsetjs_free(e>>>0,1)),eu=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>P.__wbg_zerocopymesh_free(e>>>0,1));class fi{static __wrap(t){t=t>>>0;const n=Object.create(fi.prototype);return n.__wbg_ptr=t,Pm.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Pm.unregister(this),t}free(){const t=this.__destroy_into_raw();P.__wbg_georeferencejs_free(t,0)}localToMap(t,n,r){try{const a=P.__wbindgen_add_to_stack_pointer(-16);P.georeferencejs_localToMap(a,this.__wbg_ptr,t,n,r);var o=me().getInt32(a+4*0,!0),s=me().getInt32(a+4*1,!0),i=Ma(o,s).slice();return P.__wbindgen_export4(o,s*8,8),i}finally{P.__wbindgen_add_to_stack_pointer(16)}}mapToLocal(t,n,r){try{const a=P.__wbindgen_add_to_stack_pointer(-16);P.georeferencejs_mapToLocal(a,this.__wbg_ptr,t,n,r);var o=me().getInt32(a+4*0,!0),s=me().getInt32(a+4*1,!0),i=Ma(o,s).slice();return P.__wbindgen_export4(o,s*8,8),i}finally{P.__wbindgen_add_to_stack_pointer(16)}}get crsName(){try{const r=P.__wbindgen_add_to_stack_pointer(-16);P.georeferencejs_crsName(r,this.__wbg_ptr);var t=me().getInt32(r+4*0,!0),n=me().getInt32(r+4*1,!0);let o;return t!==0&&(o=or(t,n).slice(),P.__wbindgen_export4(t,n*1,1)),o}finally{P.__wbindgen_add_to_stack_pointer(16)}}get rotation(){return P.georeferencejs_rotation(this.__wbg_ptr)}toMatrix(){try{const o=P.__wbindgen_add_to_stack_pointer(-16);P.georeferencejs_toMatrix(o,this.__wbg_ptr);var t=me().getInt32(o+4*0,!0),n=me().getInt32(o+4*1,!0),r=Ma(t,n).slice();return P.__wbindgen_export4(t,n*8,8),r}finally{P.__wbindgen_add_to_stack_pointer(16)}}get eastings(){return P.__wbg_get_georeferencejs_eastings(this.__wbg_ptr)}set eastings(t){P.__wbg_set_georeferencejs_eastings(this.__wbg_ptr,t)}get northings(){return P.__wbg_get_georeferencejs_northings(this.__wbg_ptr)}set northings(t){P.__wbg_set_georeferencejs_northings(this.__wbg_ptr,t)}get orthogonal_height(){return P.__wbg_get_georeferencejs_orthogonal_height(this.__wbg_ptr)}set orthogonal_height(t){P.__wbg_set_georeferencejs_orthogonal_height(this.__wbg_ptr,t)}get x_axis_abscissa(){return P.__wbg_get_georeferencejs_x_axis_abscissa(this.__wbg_ptr)}set x_axis_abscissa(t){P.__wbg_set_georeferencejs_x_axis_abscissa(this.__wbg_ptr,t)}get x_axis_ordinate(){return P.__wbg_get_georeferencejs_x_axis_ordinate(this.__wbg_ptr)}set x_axis_ordinate(t){P.__wbg_set_georeferencejs_x_axis_ordinate(this.__wbg_ptr,t)}get scale(){return P.__wbg_get_georeferencejs_scale(this.__wbg_ptr)}set scale(t){P.__wbg_set_georeferencejs_scale(this.__wbg_ptr,t)}}Symbol.dispose&&(fi.prototype[Symbol.dispose]=fi.prototype.free);class pd{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Rm.unregister(this),t}free(){const t=this.__destroy_into_raw();P.__wbg_ifcapi_free(t,0)}getMemory(){const t=P.ifcapi_getMemory(this.__wbg_ptr);return mt(t)}parseMeshes(t){const n=St(t,P.__wbindgen_export,P.__wbindgen_export2),r=ot,o=P.ifcapi_parseMeshes(this.__wbg_ptr,n,r);return Qo.__wrap(o)}parseStreaming(t,n){const r=St(t,P.__wbindgen_export,P.__wbindgen_export2),o=ot,s=P.ifcapi_parseStreaming(this.__wbg_ptr,r,o,ue(n));return mt(s)}parseZeroCopy(t){const n=St(t,P.__wbindgen_export,P.__wbindgen_export2),r=ot,o=P.ifcapi_parseZeroCopy(this.__wbg_ptr,n,r);return yi.__wrap(o)}getGeoReference(t){const n=St(t,P.__wbindgen_export,P.__wbindgen_export2),r=ot,o=P.ifcapi_getGeoReference(this.__wbg_ptr,n,r);return o===0?void 0:fi.__wrap(o)}parseMeshesAsync(t,n){const r=St(t,P.__wbindgen_export,P.__wbindgen_export2),o=ot,s=P.ifcapi_parseMeshesAsync(this.__wbg_ptr,r,o,ue(n));return mt(s)}parseMeshesWithRtc(t){const n=St(t,P.__wbindgen_export,P.__wbindgen_export2),r=ot,o=P.ifcapi_parseMeshesWithRtc(this.__wbg_ptr,n,r);return mi.__wrap(o)}parseMeshesInstanced(t){const n=St(t,P.__wbindgen_export,P.__wbindgen_export2),r=ot,o=P.ifcapi_parseMeshesInstanced(this.__wbg_ptr,n,r);return pi.__wrap(o)}debugProcessEntity953(t){let n,r;try{const i=P.__wbindgen_add_to_stack_pointer(-16),a=St(t,P.__wbindgen_export,P.__wbindgen_export2),l=ot;P.ifcapi_debugProcessEntity953(i,this.__wbg_ptr,a,l);var o=me().getInt32(i+4*0,!0),s=me().getInt32(i+4*1,!0);return n=o,r=s,or(o,s)}finally{P.__wbindgen_add_to_stack_pointer(16),P.__wbindgen_export4(n,r,1)}}debugProcessFirstWall(t){let n,r;try{const i=P.__wbindgen_add_to_stack_pointer(-16),a=St(t,P.__wbindgen_export,P.__wbindgen_export2),l=ot;P.ifcapi_debugProcessFirstWall(i,this.__wbg_ptr,a,l);var o=me().getInt32(i+4*0,!0),s=me().getInt32(i+4*1,!0);return n=o,r=s,or(o,s)}finally{P.__wbindgen_add_to_stack_pointer(16),P.__wbindgen_export4(n,r,1)}}parseMeshesInstancedAsync(t,n){const r=St(t,P.__wbindgen_export,P.__wbindgen_export2),o=ot,s=P.ifcapi_parseMeshesInstancedAsync(this.__wbg_ptr,r,o,ue(n));return mt(s)}constructor(){const t=P.ifcapi_new();return this.__wbg_ptr=t>>>0,Rm.register(this,this.__wbg_ptr,this),this}parse(t){const n=St(t,P.__wbindgen_export,P.__wbindgen_export2),r=ot,o=P.ifcapi_parse(this.__wbg_ptr,n,r);return mt(o)}get version(){let t,n;try{const s=P.__wbindgen_add_to_stack_pointer(-16);P.ifcapi_version(s,this.__wbg_ptr);var r=me().getInt32(s+4*0,!0),o=me().getInt32(s+4*1,!0);return t=r,n=o,or(r,o)}finally{P.__wbindgen_add_to_stack_pointer(16),P.__wbindgen_export4(t,n,1)}}get is_ready(){return P.ifcapi_is_ready(this.__wbg_ptr)!==0}}Symbol.dispose&&(pd.prototype[Symbol.dispose]=pd.prototype.free);class hi{static __wrap(t){t=t>>>0;const n=Object.create(hi.prototype);return n.__wbg_ptr=t,Tm.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Tm.unregister(this),t}free(){const t=this.__destroy_into_raw();P.__wbg_instancedata_free(t,0)}get expressId(){return P.instancedata_expressId(this.__wbg_ptr)>>>0}get color(){try{const o=P.__wbindgen_add_to_stack_pointer(-16);P.instancedata_color(o,this.__wbg_ptr);var t=me().getInt32(o+4*0,!0),n=me().getInt32(o+4*1,!0),r=di(t,n).slice();return P.__wbindgen_export4(t,n*4,4),r}finally{P.__wbindgen_add_to_stack_pointer(16)}}get transform(){const t=P.instancedata_transform(this.__wbg_ptr);return mt(t)}}Symbol.dispose&&(hi.prototype[Symbol.dispose]=hi.prototype.free);class Xo{static __wrap(t){t=t>>>0;const n=Object.create(Xo.prototype);return n.__wbg_ptr=t,Nm.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Nm.unregister(this),t}free(){const t=this.__destroy_into_raw();P.__wbg_instancedgeometry_free(t,0)}get geometryId(){const t=P.instancedgeometry_geometryId(this.__wbg_ptr);return BigInt.asUintN(64,t)}get_instance(t){const n=P.instancedgeometry_get_instance(this.__wbg_ptr,t);return n===0?void 0:hi.__wrap(n)}get instance_count(){return P.instancedgeometry_instance_count(this.__wbg_ptr)>>>0}get indices(){const t=P.instancedgeometry_indices(this.__wbg_ptr);return mt(t)}get normals(){const t=P.instancedgeometry_normals(this.__wbg_ptr);return mt(t)}get positions(){const t=P.instancedgeometry_positions(this.__wbg_ptr);return mt(t)}}Symbol.dispose&&(Xo.prototype[Symbol.dispose]=Xo.prototype.free);class pi{static __wrap(t){t=t>>>0;const n=Object.create(pi.prototype);return n.__wbg_ptr=t,Am.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Am.unregister(this),t}free(){const t=this.__destroy_into_raw();P.__wbg_instancedmeshcollection_free(t,0)}get totalInstances(){return P.instancedmeshcollection_totalInstances(this.__wbg_ptr)>>>0}get totalGeometries(){return P.instancedmeshcollection_length(this.__wbg_ptr)>>>0}get(t){const n=P.instancedmeshcollection_get(this.__wbg_ptr,t);return n===0?void 0:Xo.__wrap(n)}get length(){return P.instancedmeshcollection_length(this.__wbg_ptr)>>>0}}Symbol.dispose&&(pi.prototype[Symbol.dispose]=pi.prototype.free);class Qo{static __wrap(t){t=t>>>0;const n=Object.create(Qo.prototype);return n.__wbg_ptr=t,zm.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,zm.unregister(this),t}free(){const t=this.__destroy_into_raw();P.__wbg_meshcollection_free(t,0)}get totalVertices(){return P.meshcollection_totalVertices(this.__wbg_ptr)>>>0}get totalTriangles(){return P.meshcollection_totalTriangles(this.__wbg_ptr)>>>0}get(t){const n=P.meshcollection_get(this.__wbg_ptr,t);return n===0?void 0:qr.__wrap(n)}get length(){return P.instancedmeshcollection_length(this.__wbg_ptr)>>>0}}Symbol.dispose&&(Qo.prototype[Symbol.dispose]=Qo.prototype.free);class mi{static __wrap(t){t=t>>>0;const n=Object.create(mi.prototype);return n.__wbg_ptr=t,Fm.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Fm.unregister(this),t}free(){const t=this.__destroy_into_raw();P.__wbg_meshcollectionwithrtc_free(t,0)}get rtcOffset(){const t=P.meshcollectionwithrtc_rtcOffset(this.__wbg_ptr);return gi.__wrap(t)}get(t){const n=P.meshcollectionwithrtc_get(this.__wbg_ptr,t);return n===0?void 0:qr.__wrap(n)}get length(){return P.meshcollectionwithrtc_length(this.__wbg_ptr)>>>0}get meshes(){const t=P.meshcollectionwithrtc_meshes(this.__wbg_ptr);return Qo.__wrap(t)}}Symbol.dispose&&(mi.prototype[Symbol.dispose]=mi.prototype.free);class qr{static __wrap(t){t=t>>>0;const n=Object.create(qr.prototype);return n.__wbg_ptr=t,jm.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,jm.unregister(this),t}free(){const t=this.__destroy_into_raw();P.__wbg_meshdatajs_free(t,0)}get expressId(){return P.meshdatajs_expressId(this.__wbg_ptr)>>>0}get vertexCount(){return P.meshdatajs_vertexCount(this.__wbg_ptr)>>>0}get triangleCount(){return P.meshdatajs_triangleCount(this.__wbg_ptr)>>>0}get color(){try{const o=P.__wbindgen_add_to_stack_pointer(-16);P.meshdatajs_color(o,this.__wbg_ptr);var t=me().getInt32(o+4*0,!0),n=me().getInt32(o+4*1,!0),r=di(t,n).slice();return P.__wbindgen_export4(t,n*4,4),r}finally{P.__wbindgen_add_to_stack_pointer(16)}}get indices(){const t=P.meshdatajs_indices(this.__wbg_ptr);return mt(t)}get normals(){const t=P.meshdatajs_normals(this.__wbg_ptr);return mt(t)}get positions(){const t=P.meshdatajs_positions(this.__wbg_ptr);return mt(t)}}Symbol.dispose&&(qr.prototype[Symbol.dispose]=qr.prototype.free);class gi{static __wrap(t){t=t>>>0;const n=Object.create(gi.prototype);return n.__wbg_ptr=t,Lm.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Lm.unregister(this),t}free(){const t=this.__destroy_into_raw();P.__wbg_rtcoffsetjs_free(t,0)}isSignificant(){return P.rtcoffsetjs_isSignificant(this.__wbg_ptr)!==0}toWorld(t,n,r){try{const a=P.__wbindgen_add_to_stack_pointer(-16);P.rtcoffsetjs_toWorld(a,this.__wbg_ptr,t,n,r);var o=me().getInt32(a+4*0,!0),s=me().getInt32(a+4*1,!0),i=Ma(o,s).slice();return P.__wbindgen_export4(o,s*8,8),i}finally{P.__wbindgen_add_to_stack_pointer(16)}}get x(){return P.__wbg_get_georeferencejs_eastings(this.__wbg_ptr)}set x(t){P.__wbg_set_georeferencejs_eastings(this.__wbg_ptr,t)}get y(){return P.__wbg_get_georeferencejs_northings(this.__wbg_ptr)}set y(t){P.__wbg_set_georeferencejs_northings(this.__wbg_ptr,t)}get z(){return P.__wbg_get_georeferencejs_orthogonal_height(this.__wbg_ptr)}set z(t){P.__wbg_set_georeferencejs_orthogonal_height(this.__wbg_ptr,t)}}Symbol.dispose&&(gi.prototype[Symbol.dispose]=gi.prototype.free);class yi{static __wrap(t){t=t>>>0;const n=Object.create(yi.prototype);return n.__wbg_ptr=t,eu.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,eu.unregister(this),t}free(){const t=this.__destroy_into_raw();P.__wbg_zerocopymesh_free(t,0)}bounds_max(){try{const o=P.__wbindgen_add_to_stack_pointer(-16);P.zerocopymesh_bounds_max(o,this.__wbg_ptr);var t=me().getInt32(o+4*0,!0),n=me().getInt32(o+4*1,!0),r=di(t,n).slice();return P.__wbindgen_export4(t,n*4,4),r}finally{P.__wbindgen_add_to_stack_pointer(16)}}bounds_min(){try{const o=P.__wbindgen_add_to_stack_pointer(-16);P.zerocopymesh_bounds_min(o,this.__wbg_ptr);var t=me().getInt32(o+4*0,!0),n=me().getInt32(o+4*1,!0),r=di(t,n).slice();return P.__wbindgen_export4(t,n*4,4),r}finally{P.__wbindgen_add_to_stack_pointer(16)}}get indices_len(){return P.zerocopymesh_indices_len(this.__wbg_ptr)>>>0}get indices_ptr(){return P.zerocopymesh_indices_ptr(this.__wbg_ptr)>>>0}get normals_len(){return P.zerocopymesh_normals_len(this.__wbg_ptr)>>>0}get normals_ptr(){return P.zerocopymesh_normals_ptr(this.__wbg_ptr)>>>0}get vertex_count(){return P.meshdatajs_vertexCount(this.__wbg_ptr)>>>0}get positions_len(){return P.zerocopymesh_positions_len(this.__wbg_ptr)>>>0}get positions_ptr(){return P.zerocopymesh_positions_ptr(this.__wbg_ptr)>>>0}get triangle_count(){return P.meshdatajs_triangleCount(this.__wbg_ptr)>>>0}constructor(){const t=P.zerocopymesh_new();return this.__wbg_ptr=t>>>0,eu.register(this,this.__wbg_ptr,this),this}get is_empty(){return P.zerocopymesh_is_empty(this.__wbg_ptr)!==0}}Symbol.dispose&&(yi.prototype[Symbol.dispose]=yi.prototype.free);const zR=new Set(["basic","cors","default"]);async function FR(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.ok&&zR.has(e.type)&&e.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{const n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function jR(){const e={};return e.wbg={},e.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6=function(t,n){const r=hd(he(n)),o=St(r,P.__wbindgen_export,P.__wbindgen_export2),s=ot;me().setInt32(t+4*1,s,!0),me().setInt32(t+4*0,o,!0)},e.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd=function(t){return typeof he(t)=="function"},e.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269=function(t){return he(t)===void 0},e.wbg.__wbg___wbindgen_memory_a342e963fbcabd68=function(){const t=P.memory;return ue(t)},e.wbg.__wbg___wbindgen_number_get_9619185a74197f95=function(t,n){const r=he(n),o=typeof r=="number"?r:void 0;me().setFloat64(t+8*1,uo(o)?0:o,!0),me().setInt32(t+4*0,!uo(o),!0)},e.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e=function(t,n){throw new Error(or(t,n))},e.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7=function(t){he(t)._wbg_cb_unref()},e.wbg.__wbg_call_3020136f7a2d6e44=function(){return co(function(t,n,r){const o=he(t).call(he(n),he(r));return ue(o)},arguments)},e.wbg.__wbg_call_abb4ff46ce38be40=function(){return co(function(t,n){const r=he(t).call(he(n));return ue(r)},arguments)},e.wbg.__wbg_call_c8baa5c5e72d274e=function(){return co(function(t,n,r,o){const s=he(t).call(he(n),he(r),he(o));return ue(s)},arguments)},e.wbg.__wbg_clearTimeout_5a54f8841c30079a=function(t){const n=clearTimeout(mt(t));return ue(n)},e.wbg.__wbg_error_7534b8e9a36f1ab4=function(t,n){let r,o;try{r=t,o=n,console.error(or(t,n))}finally{P.__wbindgen_export4(r,o,1)}},e.wbg.__wbg_get_af9dab7e9603ea93=function(){return co(function(t,n){const r=Reflect.get(he(t),he(n));return ue(r)},arguments)},e.wbg.__wbg_instancedgeometry_new=function(t){const n=Xo.__wrap(t);return ue(n)},e.wbg.__wbg_length_d45040a40c570362=function(t){return he(t).length},e.wbg.__wbg_meshdatajs_new=function(t){const n=qr.__wrap(t);return ue(n)},e.wbg.__wbg_new_1ba21ce319a06297=function(){const t=new Object;return ue(t)},e.wbg.__wbg_new_25f239778d6112b9=function(){const t=new Array;return ue(t)},e.wbg.__wbg_new_8a6f238a6ece86ea=function(){const t=new Error;return ue(t)},e.wbg.__wbg_new_ff12d2b041fb48f1=function(t,n){try{var r={a:t,b:n},o=(i,a)=>{const l=r.a;r.a=0;try{return AR(l,r.b,i,a)}finally{r.a=l}};const s=new Promise(o);return ue(s)}finally{r.a=r.b=0}},e.wbg.__wbg_new_from_slice_41e2764a343e3cb1=function(t,n){const r=new Float32Array(di(t,n));return ue(r)},e.wbg.__wbg_new_from_slice_db0691b69e9d3891=function(t,n){const r=new Uint32Array(ER(t,n));return ue(r)},e.wbg.__wbg_new_no_args_cb138f77cf6151ee=function(t,n){const r=new Function(or(t,n));return ue(r)},e.wbg.__wbg_push_7d9be8f38fc13975=function(t,n){return he(t).push(he(n))},e.wbg.__wbg_queueMicrotask_9b549dfce8865860=function(t){const n=he(t).queueMicrotask;return ue(n)},e.wbg.__wbg_queueMicrotask_fca69f5bfad613a5=function(t){queueMicrotask(he(t))},e.wbg.__wbg_resolve_fd5bfbaa4ce36e1e=function(t){const n=Promise.resolve(he(t));return ue(n)},e.wbg.__wbg_setTimeout_db2dbaeefb6f39c7=function(){return co(function(t,n){const r=setTimeout(he(t),n);return ue(r)},arguments)},e.wbg.__wbg_set_781438a03c0c3c81=function(){return co(function(t,n,r){return Reflect.set(he(t),he(n),he(r))},arguments)},e.wbg.__wbg_stack_0ed75d68575b0f3c=function(t,n){const r=he(n).stack,o=St(r,P.__wbindgen_export,P.__wbindgen_export2),s=ot;me().setInt32(t+4*1,s,!0),me().setInt32(t+4*0,o,!0)},e.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335=function(){const t=typeof global>"u"?null:global;return uo(t)?0:ue(t)},e.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1=function(){const t=typeof globalThis>"u"?null:globalThis;return uo(t)?0:ue(t)},e.wbg.__wbg_static_accessor_SELF_08f5a74c69739274=function(){const t=typeof self>"u"?null:self;return uo(t)?0:ue(t)},e.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024=function(){const t=typeof window>"u"?null:window;return uo(t)?0:ue(t)},e.wbg.__wbg_then_4f95312d68691235=function(t,n){const r=he(t).then(he(n));return ue(r)},e.wbg.__wbindgen_cast_2241b6af4c4b2941=function(t,n){const r=or(t,n);return ue(r)},e.wbg.__wbindgen_cast_6da2ad44da782ca3=function(t,n){const r=Mm(t,n,P.__wasm_bindgen_func_elem_294,TR);return ue(r)},e.wbg.__wbindgen_cast_cfd578dc132ebaa8=function(t,n){const r=Mm(t,n,P.__wasm_bindgen_func_elem_305,NR);return ue(r)},e.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(t){return ue(t)},e.wbg.__wbindgen_object_clone_ref=function(t){const n=he(t);return ue(n)},e.wbg.__wbindgen_object_drop_ref=function(t){mt(t)},e}function LR(e,t){return P=e.exports,mw.__wbindgen_wasm_module=t,Tr=null,Cs=null,Es=null,Is=null,ks=null,P.__wbindgen_start(),P}async function mw(e){if(P!==void 0)return P;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("/assets/ifc-lite_bg-BQVS1Fh7.wasm",import.meta.url));const t=jR();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));const{instance:n,module:r}=await FR(await e,t);return LR(n,r)}class OR{ifcApi=null;initialized=!1;async init(t){this.initialized||(await mw(),this.ifcApi=new pd,this.initialized=!0)}parseMeshes(t){if(!this.ifcApi)throw new Error("IFC-Lite not initialized. Call init() first.");return this.ifcApi.parseMeshes(t)}parseMeshesInstanced(t){if(!this.ifcApi)throw new Error("IFC-Lite not initialized. Call init() first.");return this.ifcApi.parseMeshesInstanced(t)}async parseMeshesAsync(t,n={}){if(!this.ifcApi)throw new Error("IFC-Lite not initialized. Call init() first.");return this.ifcApi.parseMeshesAsync(t,n)}async parseMeshesInstancedAsync(t,n={}){if(!this.ifcApi)throw new Error("IFC-Lite not initialized. Call init() first.");return this.ifcApi.parseMeshesInstancedAsync(t,n)}getApi(){if(!this.ifcApi)throw new Error("IFC-Lite not initialized. Call init() first.");return this.ifcApi}isInitialized(){return this.initialized}getVersion(){return this.ifcApi?.version??"unknown"}}class aa{ifcApi;content;constructor(t,n){this.ifcApi=t,this.content=n}convertZUpToYUp(t){for(let n=0;n<t.length;n+=3){const r=t[n+1],o=t[n+2];t[n+1]=o,t[n+2]=-r}}collectMeshes(){const t=this.ifcApi.parseMeshes(this.content),n=[];for(let r=0;r<t.length;r++){const o=t.get(r);if(!o)continue;const s=o.color,i=[s[0],s[1],s[2],s[3]],a=o.positions,l=o.normals,c=o.indices;this.convertZUpToYUp(a),this.convertZUpToYUp(l),n.push({expressId:o.expressId,positions:a,normals:l,indices:c,color:i}),o.free()}return t.free(),n}async*collectMeshesStreaming(t=25){const n=[];let r=null,o=!1;const s=this.ifcApi.parseMeshesAsync(this.content,{batchSize:t,onBatch:(i,a)=>{const l=[];for(const c of i){const u=c.color,d=[u[0],u[1],u[2],u[3]],f=c.positions,y=c.normals,p=c.indices;this.convertZUpToYUp(f),this.convertZUpToYUp(y),l.push({expressId:c.expressId,positions:f,normals:y,indices:p,color:d}),c.free()}n.push(l),r&&(r(),r=null)},onComplete:i=>{o=!0,r&&(r(),r=null)}});for(;;){for(;n.length>0;)yield n.shift();if(o&&n.length===0)break;await new Promise(i=>{r=i})}await s}async*collectInstancedGeometryStreaming(t=25){const n=[];let r=null,o=!1;const s=this.ifcApi.parseMeshesInstancedAsync(this.content,{batchSize:t,onBatch:(i,a)=>{n.push(i),r&&(r(),r=null)},onComplete:i=>{o=!0,r&&(r(),r=null)}});for(;;){for(;n.length>0;)yield n.shift();if(o&&n.length===0)break;await new Promise(i=>{r=i})}await s}}class BR{buildInterleavedBuffer(t){const n=t.positions.length/3,r=new Float32Array(n*6);for(let o=0;o<n;o++){const s=o*6,i=o*3,a=o*3;r[s]=t.positions[i],r[s+1]=t.positions[i+1],r[s+2]=t.positions[i+2],r[s+3]=t.normals[a],r[s+4]=t.normals[a+1],r[s+5]=t.normals[a+2]}return r}processMeshes(t){let n=0,r=0;for(const o of t)n+=o.indices.length/3,r+=o.positions.length/3;return{meshes:t,totalTriangles:n,totalVertices:r}}}class DR{originShift={x:0,y:0,z:0};THRESHOLD=1e4;MAX_REASONABLE_COORD=1e7;accumulatedBounds=null;shiftCalculated=!1;isReasonableValue(t){return Number.isFinite(t)&&Math.abs(t)<this.MAX_REASONABLE_COORD}calculateBounds(t){const n={min:{x:1/0,y:1/0,z:1/0},max:{x:-1/0,y:-1/0,z:-1/0}};let r=0,o=0;for(const s of t){const i=s.positions;for(let a=0;a<i.length;a+=3){const l=i[a],c=i[a+1],u=i[a+2];this.isReasonableValue(l)&&this.isReasonableValue(c)&&this.isReasonableValue(u)?(n.min.x=Math.min(n.min.x,l),n.min.y=Math.min(n.min.y,c),n.min.z=Math.min(n.min.z,u),n.max.x=Math.max(n.max.x,l),n.max.y=Math.max(n.max.y,c),n.max.z=Math.max(n.max.z,u),r++):o++}}return o>0&&console.log(`[CoordinateHandler] Filtered ${o} corrupted vertices, kept ${r} valid`),n}needsShift(t){return Math.max(Math.abs(t.min.x),Math.abs(t.max.x),Math.abs(t.min.y),Math.abs(t.max.y),Math.abs(t.min.z),Math.abs(t.max.z))>this.THRESHOLD}calculateCentroid(t){return{x:(t.min.x+t.max.x)/2,y:(t.min.y+t.max.y)/2,z:(t.min.z+t.max.z)/2}}shiftPositions(t,n){for(let r=0;r<t.length;r+=3){const o=t[r],s=t[r+1],i=t[r+2];this.isReasonableValue(o)&&this.isReasonableValue(s)&&this.isReasonableValue(i)?(t[r]=o-n.x,t[r+1]=s-n.y,t[r+2]=i-n.z):(t[r]=0,t[r+1]=0,t[r+2]=0)}}shiftBounds(t,n){return{min:{x:t.min.x-n.x,y:t.min.y-n.y,z:t.min.z-n.z},max:{x:t.max.x-n.x,y:t.max.y-n.y,z:t.max.z-n.z}}}processMeshes(t){const n={originShift:{x:0,y:0,z:0},originalBounds:{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}},shiftedBounds:{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}},isGeoReferenced:!1};if(t.length===0)return n;const r=this.calculateBounds(t);if(!(r.min.x!==1/0&&r.max.x!==-1/0))return console.warn("[CoordinateHandler] No valid coordinates found in geometry"),n;const s={x:r.max.x-r.min.x,y:r.max.y-r.min.y,z:r.max.z-r.min.z},i=Math.max(s.x,s.y,s.z);if(console.log("[CoordinateHandler] Original bounds:",{min:r.min,max:r.max,size:s,maxSize:i.toFixed(2)+"m"}),!this.needsShift(r)){console.log("[CoordinateHandler] Coordinates within normal range, no shift needed");const u={x:0,y:0,z:0};for(const d of t)this.shiftPositions(d.positions,u);return{originShift:u,originalBounds:r,shiftedBounds:r,isGeoReferenced:!1}}const l=this.calculateCentroid(r);this.originShift=l,console.log("[CoordinateHandler] Large coordinates detected, shifting to origin:",{centroid:l,maxCoord:Math.max(Math.abs(r.min.x),Math.abs(r.max.x),Math.abs(r.min.y),Math.abs(r.max.y),Math.abs(r.min.z),Math.abs(r.max.z)).toFixed(2)+"m"});for(const u of t)this.shiftPositions(u.positions,l);const c=this.shiftBounds(r,l);return console.log("[CoordinateHandler] Shifted bounds:",{min:c.min,max:c.max,maxSize:i.toFixed(2)+"m"}),{originShift:l,originalBounds:r,shiftedBounds:c,isGeoReferenced:!0}}toWorldCoordinates(t){return{x:t.x+this.originShift.x,y:t.y+this.originShift.y,z:t.z+this.originShift.z}}toLocalCoordinates(t){return{x:t.x-this.originShift.x,y:t.y-this.originShift.y,z:t.z-this.originShift.z}}getOriginShift(){return{...this.originShift}}processMeshesIncremental(t){const n=this.calculateBounds(t);if(this.accumulatedBounds===null?this.accumulatedBounds=n:(this.accumulatedBounds.min.x=Math.min(this.accumulatedBounds.min.x,n.min.x),this.accumulatedBounds.min.y=Math.min(this.accumulatedBounds.min.y,n.min.y),this.accumulatedBounds.min.z=Math.min(this.accumulatedBounds.min.z,n.min.z),this.accumulatedBounds.max.x=Math.max(this.accumulatedBounds.max.x,n.max.x),this.accumulatedBounds.max.y=Math.max(this.accumulatedBounds.max.y,n.max.y),this.accumulatedBounds.max.z=Math.max(this.accumulatedBounds.max.z,n.max.z)),!this.shiftCalculated&&this.accumulatedBounds){if(this.accumulatedBounds.min.x!==1/0&&this.accumulatedBounds.max.x!==-1/0){const o={x:this.accumulatedBounds.max.x-this.accumulatedBounds.min.x,y:this.accumulatedBounds.max.y-this.accumulatedBounds.min.y,z:this.accumulatedBounds.max.z-this.accumulatedBounds.min.z},s=Math.max(o.x,o.y,o.z),i=this.calculateCentroid(this.accumulatedBounds),a=Math.sqrt(i.x**2+i.y**2+i.z**2);(a>this.THRESHOLD||s>this.THRESHOLD)&&(this.originShift=i,console.log("[CoordinateHandler] Large coordinates detected, shifting to origin:",{distanceFromOrigin:a.toFixed(2)+"m",maxSize:s.toFixed(2)+"m",shift:this.originShift}))}this.shiftCalculated=!0}if(this.originShift.x!==0||this.originShift.y!==0||this.originShift.z!==0)for(const r of t)this.shiftPositions(r.positions,this.originShift)}getCurrentCoordinateInfo(){if(!this.accumulatedBounds||!(this.accumulatedBounds.min.x!==1/0&&this.accumulatedBounds.max.x!==-1/0))return null;const n=this.shiftBounds(this.accumulatedBounds,this.originShift),r=this.originShift.x!==0||this.originShift.y!==0||this.originShift.z!==0;return{originShift:{...this.originShift},originalBounds:{...this.accumulatedBounds},shiftedBounds:n,isGeoReferenced:r}}getFinalCoordinateInfo(){const t=this.getCurrentCoordinateInfo();return t||{originShift:{x:0,y:0,z:0},originalBounds:{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}},shiftedBounds:{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}},isGeoReferenced:!1}}reset(){this.accumulatedBounds=null,this.shiftCalculated=!1,this.originShift={x:0,y:0,z:0}}}class UR{workers=[];taskQueue=[];activeTasks=new Map;availableWorkers=new Set;workerCount;workerUrl;initialized=!1;constructor(t,n){this.workerUrl=t,this.workerCount=n??Math.max(1,navigator.hardwareConcurrency??4)}async init(){if(this.initialized)return;const t=performance.now();if(typeof Worker>"u"){console.warn("[WorkerPool] Web Workers not available");return}try{for(let r=0;r<this.workerCount;r++){const o=performance.now(),s=new Worker(this.workerUrl,{type:"module"});await new Promise(i=>{const a=l=>{if(l.data.type==="ready"){s.removeEventListener("message",a),s.onmessage=u=>{this.handleMessage(s,u)};const c=performance.now()-o;console.log(`[WorkerPool] Worker ${r} ready in ${c.toFixed(2)}ms`),i()}};s.addEventListener("message",a)}),s.onerror=i=>{console.error(`[WorkerPool] Worker ${r} error:`,i),this.availableWorkers.delete(s)},this.workers.push(s),this.availableWorkers.add(s)}this.initialized=!0;const n=performance.now()-t;console.log(`[WorkerPool] Initialized ${this.workers.length} workers in ${n.toFixed(2)}ms`)}catch(n){console.error("[WorkerPool] Failed to initialize:",n)}}isAvailable(){return this.initialized&&this.workers.length>0&&this.availableWorkers.size>0}async submit(t,n){if(!this.isAvailable())throw new Error("Worker pool not available. Use fallback to main thread.");return new Promise((r,o)=>{const s={id:crypto.randomUUID(),type:t,data:n,resolve:r,reject:o};this.taskQueue.push(s),this.processQueue()})}processQueue(){if(this.taskQueue.length===0||this.availableWorkers.size===0)return;const t=Array.from(this.availableWorkers)[0],n=this.taskQueue.shift();!n||!t||(this.activeTasks.set(n.id,n),this.availableWorkers.delete(t),t.postMessage({id:n.id,type:n.type,data:n.data}))}handleMessage(t,n){const{id:r,type:o,result:s,error:i}=n.data;if(o==="ready")return;const a=this.activeTasks.get(r);if(!a){console.warn(`[WorkerPool] Task ${r} not found`),this.availableWorkers.add(t),this.processQueue();return}this.activeTasks.delete(r),o==="task-result"?a.resolve(s):o==="task-error"&&a.reject(new Error(i||"Unknown worker error")),this.availableWorkers.add(t),this.processQueue()}terminate(){for(const t of this.workers)t.terminate();this.workers=[],this.availableWorkers.clear(),this.taskQueue=[],this.activeTasks.clear(),this.initialized=!1}}var gw=(e=>(e.Fast="fast",e.Balanced="balanced",e.High="high",e))(gw||{});function $R(e,t){const n=[e.length,t.length],r=Math.min(12,e.length);for(let s=0;s<r;s++)n.push(Math.round(e[s]*1e3));const o=Math.min(6,t.length);for(let s=0;s<o;s++)n.push(t[s]);if(e.length>24){const s=Math.floor(e.length/2);for(let i=0;i<6;i++)n.push(Math.round(e[s+i]*1e3))}return n.join("_")}function VR(e){const t=new Map;for(const n of e){const r=$R(n.positions,n.indices),o=t.get(r);o?o.instances.push({expressId:n.expressId,color:n.color}):t.set(r,{geometryHash:r,positions:n.positions,normals:n.normals,indices:n.indices,instances:[{expressId:n.expressId,color:n.color}]})}return Array.from(t.values())}class GR{bridge;bufferBuilder;coordinateHandler;workerPool=null;useWorkers=!1;constructor(t={}){this.bridge=new OR,this.bufferBuilder=new BR,this.coordinateHandler=new DR,this.useWorkers=t.useWorkers??!1,t.quality}async init(t){await this.bridge.init()}async process(t,n){this.bridge.isInitialized()||await this.init();let r;if(this.useWorkers){if(!this.workerPool)try{let a;try{a=new URL("/assets/geometry.worker-CiROVpKV.ts",import.meta.url)}catch{a="./geometry.worker.ts"}this.workerPool=new UR(a,1),await this.workerPool.init()}catch(a){console.warn("[GeometryProcessor] Worker pool initialization failed, will use main thread:",a),this.workerPool=null}if(this.workerPool?.isAvailable())try{r=await this.workerPool.submit("mesh-collection",{buffer:t.buffer})}catch(a){console.warn("[Geometry] Worker pool failed, falling back to main thread:",a),r=await this.collectMeshesMainThread(t)}else r=await this.collectMeshesMainThread(t)}else r=await this.collectMeshesMainThread(t);const o=this.coordinateHandler.processMeshes(r),s=this.bufferBuilder.processMeshes(r);return{meshes:s.meshes,totalTriangles:s.totalTriangles,totalVertices:s.totalVertices,coordinateInfo:o}}async collectMeshesMainThread(t,n){const o=new TextDecoder().decode(t);return new aa(this.bridge.getApi(),o).collectMeshes()}async*processStreaming(t,n,r=25){this.bridge.isInitialized()||await this.init(),this.coordinateHandler.reset(),yield{type:"start",totalEstimate:t.length/1e3};const s=new TextDecoder().decode(t);yield{type:"model-open",modelID:0};const i=new aa(this.bridge.getApi(),s);let a=0;for await(const c of i.collectMeshesStreaming(r)){this.coordinateHandler.processMeshesIncremental(c),a+=c.length;const u=this.coordinateHandler.getCurrentCoordinateInfo();yield{type:"batch",meshes:c,totalSoFar:a,coordinateInfo:u||void 0}}const l=this.coordinateHandler.getFinalCoordinateInfo();yield{type:"complete",totalMeshes:a,coordinateInfo:l}}async*processInstancedStreaming(t,n=25){this.bridge.isInitialized()||await this.init(),this.coordinateHandler.reset(),yield{type:"start",totalEstimate:t.length/1e3};const o=new TextDecoder().decode(t);yield{type:"model-open",modelID:0};const s=new aa(this.bridge.getApi(),o);let i=0,a=0;for await(const c of s.collectInstancedGeometryStreaming(n)){const u=[];for(const f of c){const y=f.positions,p=f.normals,x=f.indices;if(f.instance_count>0){const b=f.get_instance(0);if(b){const m=b.color;u.push({expressId:b.expressId,positions:y,normals:p,indices:x,color:[m[0],m[1],m[2],m[3]]})}}}u.length>0&&this.coordinateHandler.processMeshesIncremental(u),i+=c.length,a+=c.reduce((f,y)=>f+y.instance_count,0);const d=this.coordinateHandler.getCurrentCoordinateInfo();yield{type:"batch",geometries:c,totalSoFar:i,coordinateInfo:d||void 0}}const l=this.coordinateHandler.getFinalCoordinateInfo();yield{type:"complete",totalGeometries:i,totalInstances:a,coordinateInfo:l}}async*processAdaptive(t,n={}){const r=n.sizeThreshold??2097152,o=n.batchSize??25;if(this.bridge.isInitialized()||await this.init(),this.coordinateHandler.reset(),t.length<r){yield{type:"start",totalEstimate:t.length/1e3};const i=new TextDecoder().decode(t);yield{type:"model-open",modelID:0};const l=new aa(this.bridge.getApi(),i).collectMeshes();this.coordinateHandler.processMeshesIncremental(l);const c=this.coordinateHandler.getFinalCoordinateInfo();yield{type:"batch",meshes:l,totalSoFar:l.length,coordinateInfo:c||void 0},yield{type:"complete",totalMeshes:l.length,coordinateInfo:c}}else yield*this.processStreaming(t,n.entityIndex,o)}dispose(){this.workerPool&&(this.workerPool.terminate(),this.workerPool=null)}}class vi{store;expressId;constructor(t,n){this.store=t,this.expressId=n}get globalId(){return this.store.entities.getGlobalId(this.expressId)}get name(){return this.store.entities.getName(this.expressId)}get type(){return this.store.entities.getTypeName(this.expressId)}contains(){return this.getRelated(X.ContainsElements,"forward")}containedIn(){return this.getRelated(X.ContainsElements,"inverse")[0]??null}decomposes(){return this.getRelated(X.Aggregates,"forward")}decomposedBy(){return this.getRelated(X.Aggregates,"inverse")[0]??null}definingType(){return this.getRelated(X.DefinesByType,"forward")[0]??null}instances(){return this.getRelated(X.DefinesByType,"inverse")}voids(){return this.getRelated(X.VoidsElement,"forward")}filledBy(){return this.getRelated(X.FillsElement,"inverse")}traverse(t,n,r="forward"){const o=new Set,s=[],i=(a,l)=>{if(l>n||o.has(a))return;o.add(a),a!==this.expressId&&s.push(new vi(this.store,a));const c=r==="forward"?this.store.relationships.forward.getEdges(a,t):this.store.relationships.inverse.getEdges(a,t);for(const u of c)i(u.target,l+1)};return i(this.expressId,0),s}building(){let t=this;const n=new Set;for(;t&&!n.has(t.expressId);){if(n.add(t.expressId),t.type==="IfcBuilding")return t;t=t.containedIn()??t.decomposedBy()}return null}storey(){let t=this;const n=new Set;for(;t&&!n.has(t.expressId);){if(n.add(t.expressId),t.type==="IfcBuildingStorey")return t;t=t.containedIn()??t.decomposedBy()}return null}properties(){return this.store.properties.getForEntity(this.expressId)}property(t,n){return this.store.properties.getPropertyValue(this.expressId,t,n)}quantities(){return this.store.quantities.getForEntity(this.expressId)}quantity(t,n){return this.store.quantities.getQuantityValue(this.expressId,t,n)}getRelated(t,n){return this.store.relationships.getRelated(this.expressId,t,n).map(o=>new vi(this.store,o))}}class WR{store;expressId;_properties;_quantities;_geometry;constructor(t,n,r){this.store=t,this.expressId=n}get globalId(){return this.store.entities.getGlobalId(this.expressId)}get name(){return this.store.entities.getName(this.expressId)}get type(){return this.store.entities.getTypeName(this.expressId)}get properties(){return this._properties!==void 0?this._properties:this.store.properties.getForEntity(this.expressId)}get quantities(){return this._quantities!==void 0?this._quantities:this.store.quantities?this.store.quantities.getForEntity(this.expressId):[]}get geometry(){return this._geometry!==void 0?this._geometry:null}getProperty(t,n){return this.store.properties.getPropertyValue(this.expressId,t,n)}loadProperties(){this._properties===void 0&&(this._properties=this.store.properties.getForEntity(this.expressId))}loadQuantities(){this._quantities===void 0&&this.store.quantities?this._quantities=this.store.quantities.getForEntity(this.expressId):this._quantities===void 0&&(this._quantities=[])}loadGeometry(){this._geometry===void 0&&(this._geometry=null)}asNode(){return new vi(this.store,this.expressId)}toJSON(){return{expressId:this.expressId,globalId:this.globalId,name:this.name,type:this.type,properties:this.properties,quantities:this.quantities.length>0?this.quantities:void 0}}}class vs{store;typeFilter;idFilter;propertyFilters=[];limitCount=null;offsetCount=0;includeFlags={};constructor(t,n,r=null){this.store=t,this.typeFilter=n,this.idFilter=r}whereProperty(t,n,r,o){return this.propertyFilters.push({pset:t,prop:n,op:r,value:o}),this}limit(t){return this.limitCount=t,this}offset(t){return this.offsetCount=t,this}includeGeometry(){return this.includeFlags.geometry=!0,this}includeProperties(){return this.includeFlags.properties=!0,this}includeQuantities(){return this.includeFlags.quantities=!0,this}includeAll(){return this.includeFlags={geometry:!0,properties:!0,quantities:!0},this}execute(){let t=this.getCandidateIds();t=this.applyPropertyFilters(t),this.offsetCount>0&&(t=t.slice(this.offsetCount)),this.limitCount!==null&&(t=t.slice(0,this.limitCount));const n=t.map(r=>new WR(this.store,r,this.includeFlags));for(const r of n)this.includeFlags.properties&&r.loadProperties(),this.includeFlags.quantities&&r.loadQuantities(),this.includeFlags.geometry&&r.loadGeometry();return n}async ids(){let t=this.getCandidateIds();return t=this.applyPropertyFilters(t),this.offsetCount>0&&(t=t.slice(this.offsetCount)),this.limitCount!==null&&(t=t.slice(0,this.limitCount)),t}async count(){let t=this.getCandidateIds();return t=this.applyPropertyFilters(t),t.length}async first(){return this.limit(1).execute()[0]??null}getCandidateIds(){if(this.idFilter)return[...this.idFilter];if(this.typeFilter){const n=[];for(const r of this.typeFilter)n.push(...this.store.entities.getByType(r));return n}const t=[];for(let n=0;n<this.store.entities.count;n++)t.push(this.store.entities.expressId[n]);return t}applyPropertyFilters(t){if(this.propertyFilters.length===0)return t;let n=t;for(const r of this.propertyFilters){const o=this.store.properties.findByProperty(r.prop,r.op,r.value),s=new Set(o);n=n.filter(i=>s.has(i))}return n}}class Om{db=null;conn=null;initPromise=null;initialized=!1;async init(t){if(!this.initialized)return this.initPromise?this.initPromise:(this.initPromise=(async()=>{try{const n=await new Function('return import("@duckdb/duckdb-wasm")')(),r=await n.selectBundle(n.getJsDelivrBundles()),o=new Worker(r.mainWorker);this.db=new n.AsyncDuckDB(new n.ConsoleLogger,o),await this.db.instantiate(r.mainModule,r.pthreadWorker),this.conn=await this.db.connect(),await this.registerTables(t),await this.createViews(),this.initialized=!0,console.log("[DuckDB] Initialization complete")}catch(n){throw new Error(`Failed to initialize DuckDB: ${n}`)}})(),this.initPromise)}async query(t){if(!this.initialized)throw new Error("DuckDB not initialized. Call init() first.");const n=await this.conn.query(t),r=n.toArray();return{columns:n.schema.fields.map(o=>o.name),rows:r,toArray:()=>r,toJSON:()=>r.map(o=>{const s={};return n.schema.fields.forEach((i,a)=>{s[i.name]=Array.isArray(o)?o[a]:o[i.name]}),s})}}async registerTables(t){console.log("[DuckDB] Registering tables from store with",t.entities.count,"entities"),await this.createEntitiesTable(t),await this.createPropertiesTable(t),await this.createQuantitiesTable(t),await this.createRelationshipsTable(t),console.log("[DuckDB] All tables registered successfully")}async createEntitiesTable(t){await this.conn.query(`
|
|
373
|
+
CREATE TABLE entities (
|
|
374
|
+
express_id INTEGER PRIMARY KEY,
|
|
375
|
+
global_id VARCHAR,
|
|
376
|
+
name VARCHAR,
|
|
377
|
+
description VARCHAR,
|
|
378
|
+
type VARCHAR,
|
|
379
|
+
object_type VARCHAR,
|
|
380
|
+
has_geometry BOOLEAN,
|
|
381
|
+
is_type BOOLEAN,
|
|
382
|
+
contained_in_storey INTEGER,
|
|
383
|
+
defined_by_type INTEGER
|
|
384
|
+
)
|
|
385
|
+
`);const{entities:n,strings:r}=t,o=1e3;for(let s=0;s<n.count;s+=o){const i=Math.min(s+o,n.count),a=[];for(let l=s;l<i;l++){const c=n.expressId[l],u=Ft(r.get(n.globalId[l])),d=Ft(r.get(n.name[l])),f=Ft(r.get(n.description[l])),y=Ft(Yf(n.typeEnum[l])),p=Ft(r.get(n.objectType[l])),x=(n.flags[l]&1)!==0,b=(n.flags[l]&2)!==0,m=n.containedInStorey[l]||"NULL",v=n.definedByType[l]||"NULL";a.push(`(${c}, '${u}', '${d}', '${f}', '${y}', '${p}', ${x}, ${b}, ${m}, ${v})`)}a.length>0&&await this.conn.query(`INSERT INTO entities VALUES ${a.join(", ")}`)}console.log(`[DuckDB] Registered entities table with ${n.count} rows`)}async createPropertiesTable(t){await this.conn.query(`
|
|
386
|
+
CREATE TABLE properties (
|
|
387
|
+
entity_id INTEGER,
|
|
388
|
+
pset_name VARCHAR,
|
|
389
|
+
pset_global_id VARCHAR,
|
|
390
|
+
prop_name VARCHAR,
|
|
391
|
+
prop_type VARCHAR,
|
|
392
|
+
value_string VARCHAR,
|
|
393
|
+
value_real DOUBLE,
|
|
394
|
+
value_int INTEGER,
|
|
395
|
+
value_bool BOOLEAN
|
|
396
|
+
)
|
|
397
|
+
`);const{properties:n,strings:r}=t,o=1e3,s={[se.String]:"String",[se.Real]:"Real",[se.Integer]:"Integer",[se.Boolean]:"Boolean",[se.Logical]:"Logical",[se.Label]:"Label",[se.Identifier]:"Identifier",[se.Text]:"Text",[se.Enum]:"Enum",[se.Reference]:"Reference",[se.List]:"List"};for(let i=0;i<n.count;i+=o){const a=Math.min(i+o,n.count),l=[];for(let c=i;c<a;c++){const u=n.entityId[c],d=Ft(r.get(n.psetName[c])),f=Ft(r.get(n.psetGlobalId[c])),y=Ft(r.get(n.propName[c])),p=s[n.propType[c]]||"Unknown",x=n.valueString[c],b=x>=0?Ft(r.get(x)):"",m=isNaN(n.valueReal[c])?"NULL":n.valueReal[c],v=n.valueInt[c],w=n.valueBool[c],S=w===255?"NULL":w===1?"true":"false";l.push(`(${u}, '${d}', '${f}', '${y}', '${p}', '${b}', ${m}, ${v}, ${S})`)}l.length>0&&await this.conn.query(`INSERT INTO properties VALUES ${l.join(", ")}`)}console.log(`[DuckDB] Registered properties table with ${n.count} rows`)}async createQuantitiesTable(t){await this.conn.query(`
|
|
398
|
+
CREATE TABLE quantities (
|
|
399
|
+
entity_id INTEGER,
|
|
400
|
+
qset_name VARCHAR,
|
|
401
|
+
quantity_name VARCHAR,
|
|
402
|
+
quantity_type VARCHAR,
|
|
403
|
+
value DOUBLE,
|
|
404
|
+
formula VARCHAR
|
|
405
|
+
)
|
|
406
|
+
`);const{quantities:n,strings:r}=t,o=1e3,s={[ht.Length]:"Length",[ht.Area]:"Area",[ht.Volume]:"Volume",[ht.Count]:"Count",[ht.Weight]:"Weight",[ht.Time]:"Time"};for(let i=0;i<n.count;i+=o){const a=Math.min(i+o,n.count),l=[];for(let c=i;c<a;c++){const u=n.entityId[c],d=Ft(r.get(n.qsetName[c])),f=Ft(r.get(n.quantityName[c])),y=s[n.quantityType[c]]||"Unknown",p=n.value[c],x=n.formula[c],b=x>0?Ft(r.get(x)):"";l.push(`(${u}, '${d}', '${f}', '${y}', ${p}, '${b}')`)}l.length>0&&await this.conn.query(`INSERT INTO quantities VALUES ${l.join(", ")}`)}console.log(`[DuckDB] Registered quantities table with ${n.count} rows`)}async createRelationshipsTable(t){await this.conn.query(`
|
|
407
|
+
CREATE TABLE relationships (
|
|
408
|
+
source_id INTEGER,
|
|
409
|
+
target_id INTEGER,
|
|
410
|
+
rel_type VARCHAR,
|
|
411
|
+
rel_id INTEGER
|
|
412
|
+
)
|
|
413
|
+
`);const{relationships:n}=t,r=n.forward,o=1e3,s={[X.ContainsElements]:"ContainsElements",[X.Aggregates]:"Aggregates",[X.DefinesByProperties]:"DefinesByProperties",[X.DefinesByType]:"DefinesByType",[X.AssociatesMaterial]:"AssociatesMaterial",[X.AssociatesClassification]:"AssociatesClassification",[X.VoidsElement]:"VoidsElement",[X.FillsElement]:"FillsElement",[X.ConnectsPathElements]:"ConnectsPathElements",[X.ConnectsElements]:"ConnectsElements",[X.SpaceBoundary]:"SpaceBoundary",[X.AssignsToGroup]:"AssignsToGroup",[X.AssignsToProduct]:"AssignsToProduct",[X.ReferencedInSpatialStructure]:"ReferencedInSpatialStructure"},i=[];for(const[a,l]of r.offsets){const c=r.counts.get(a)||0;for(let u=l;u<l+c;u++)i.push({sourceId:a,targetId:r.edgeTargets[u],relType:s[r.edgeTypes[u]]||"Unknown",relId:r.edgeRelIds[u]})}for(let a=0;a<i.length;a+=o){const l=Math.min(a+o,i.length),c=[];for(let u=a;u<l;u++){const d=i[u];c.push(`(${d.sourceId}, ${d.targetId}, '${d.relType}', ${d.relId})`)}c.length>0&&await this.conn.query(`INSERT INTO relationships VALUES ${c.join(", ")}`)}console.log(`[DuckDB] Registered relationships table with ${i.length} rows`)}async createViews(){try{await this.conn.query(`
|
|
414
|
+
CREATE VIEW IF NOT EXISTS walls AS
|
|
415
|
+
SELECT * FROM entities WHERE type IN ('IfcWall', 'IfcWallStandardCase')
|
|
416
|
+
`),await this.conn.query(`
|
|
417
|
+
CREATE VIEW IF NOT EXISTS doors AS
|
|
418
|
+
SELECT * FROM entities WHERE type = 'IfcDoor'
|
|
419
|
+
`),await this.conn.query(`
|
|
420
|
+
CREATE VIEW IF NOT EXISTS windows AS
|
|
421
|
+
SELECT * FROM entities WHERE type = 'IfcWindow'
|
|
422
|
+
`),await this.conn.query(`
|
|
423
|
+
CREATE VIEW IF NOT EXISTS slabs AS
|
|
424
|
+
SELECT * FROM entities WHERE type = 'IfcSlab'
|
|
425
|
+
`),await this.conn.query(`
|
|
426
|
+
CREATE VIEW IF NOT EXISTS columns AS
|
|
427
|
+
SELECT * FROM entities WHERE type = 'IfcColumn'
|
|
428
|
+
`),await this.conn.query(`
|
|
429
|
+
CREATE VIEW IF NOT EXISTS beams AS
|
|
430
|
+
SELECT * FROM entities WHERE type = 'IfcBeam'
|
|
431
|
+
`),await this.conn.query(`
|
|
432
|
+
CREATE VIEW IF NOT EXISTS spaces AS
|
|
433
|
+
SELECT * FROM entities WHERE type = 'IfcSpace'
|
|
434
|
+
`),await this.conn.query(`
|
|
435
|
+
CREATE VIEW IF NOT EXISTS entity_properties AS
|
|
436
|
+
SELECT
|
|
437
|
+
e.express_id, e.name as entity_name, e.type as entity_type,
|
|
438
|
+
p.pset_name, p.prop_name, p.prop_type,
|
|
439
|
+
p.value_string, p.value_real, p.value_int, p.value_bool
|
|
440
|
+
FROM entities e
|
|
441
|
+
LEFT JOIN properties p ON e.express_id = p.entity_id
|
|
442
|
+
`),await this.conn.query(`
|
|
443
|
+
CREATE VIEW IF NOT EXISTS entity_quantities AS
|
|
444
|
+
SELECT
|
|
445
|
+
e.express_id, e.name as entity_name, e.type as entity_type,
|
|
446
|
+
q.qset_name, q.quantity_name, q.quantity_type, q.value
|
|
447
|
+
FROM entities e
|
|
448
|
+
LEFT JOIN quantities q ON e.express_id = q.entity_id
|
|
449
|
+
`),console.log("[DuckDB] Created convenience views")}catch(t){console.warn("[DuckDB] Could not create views:",t)}}static async isAvailable(){try{return await new Function('return import("@duckdb/duckdb-wasm")')(),!0}catch{return!1}}async dispose(){this.conn&&(await this.conn.close(),this.conn=null),this.db&&(await this.db.terminate(),this.db=null),this.initialized=!1,this.initPromise=null}}function Ft(e){return e==null?"":e.replace(/'/g,"''")}class HR{store;duckdb=null;constructor(t){this.store=t}async sql(t){return await this.ensureDuckDB(),this.duckdb.query(t)}async ensureDuckDB(){if(!this.duckdb){if(!await Om.isAvailable())throw new Error("DuckDB-WASM is not available. Install @duckdb/duckdb-wasm to use SQL queries.");this.duckdb=new Om,await this.duckdb.init(this.store)}}walls(){return this.ofType("IfcWall","IfcWallStandardCase")}doors(){return this.ofType("IfcDoor")}windows(){return this.ofType("IfcWindow")}slabs(){return this.ofType("IfcSlab")}columns(){return this.ofType("IfcColumn")}beams(){return this.ofType("IfcBeam")}spaces(){return this.ofType("IfcSpace")}ofType(...t){const n=t.map(r=>pw(r));return new vs(this.store,n)}all(){return new vs(this.store,null)}byId(t){return new vs(this.store,null,[t])}entity(t){return new vi(this.store,t)}inBounds(t){if(!this.store.spatialIndex)throw new Error("Spatial index not available. Geometry must be processed first.");const n=this.store.spatialIndex.queryAABB(t);return new vs(this.store,null,n)}onStorey(t){if(!this.store.spatialHierarchy)throw new Error("Spatial hierarchy not available.");const n=this.store.spatialHierarchy.byStorey.get(t)??[];return new vs(this.store,null,n)}raycast(t,n){if(!this.store.spatialIndex)throw new Error("Spatial index not available. Geometry must be processed first.");return this.store.spatialIndex.raycast(t,n)}get hierarchy(){return this.store.spatialHierarchy??null}get project(){return this.store.spatialHierarchy?this.entity(this.store.spatialHierarchy.project.expressId):null}get storeys(){return this.store.spatialHierarchy?[...this.store.spatialHierarchy.byStorey.keys()].sort((t,n)=>{const r=this.store.spatialHierarchy.storeyElevations.get(t)??0,o=this.store.spatialHierarchy.storeyElevations.get(n)??0;return r-o}).map(t=>this.entity(t)):[]}}class Bm{static intersects(t,n){return t.min[0]<=n.max[0]&&t.max[0]>=n.min[0]&&t.min[1]<=n.max[1]&&t.max[1]>=n.min[1]&&t.min[2]<=n.max[2]&&t.max[2]>=n.min[2]}static union(t,n){return{min:[Math.min(t.min[0],n.min[0]),Math.min(t.min[1],n.min[1]),Math.min(t.min[2],n.min[2])],max:[Math.max(t.max[0],n.max[0]),Math.max(t.max[1],n.max[1]),Math.max(t.max[2],n.max[2])]}}static center(t){return[(t.min[0]+t.max[0])/2,(t.min[1]+t.max[1])/2,(t.min[2]+t.max[2])/2]}static size(t){return[t.max[0]-t.min[0],t.max[1]-t.min[1],t.max[2]-t.min[2]]}static surfaceArea(t){const[n,r,o]=this.size(t);return 2*(n*r+n*o+r*o)}static contains(t,n){return n[0]>=t.min[0]&&n[0]<=t.max[0]&&n[1]>=t.min[1]&&n[1]<=t.max[1]&&n[2]>=t.min[2]&&n[2]<=t.max[2]}}class md{static isAABBVisible(t,n){for(const r of t.planes){const o=[r.normal[0]>0?n.max[0]:n.min[0],r.normal[1]>0?n.max[1]:n.min[1],r.normal[2]>0?n.max[2]:n.min[2]];if(this.pointToPlaneDistance(o,r)<0)return!1}return!0}static pointToPlaneDistance(t,n){return t[0]*n.normal[0]+t[1]*n.normal[1]+t[2]*n.normal[2]+n.distance}static fromViewProjMatrix(t){const n=t,r=[];r.push({normal:[n[3]+n[0],n[7]+n[4],n[11]+n[8]],distance:n[15]+n[12]}),r.push({normal:[n[3]-n[0],n[7]-n[4],n[11]-n[8]],distance:n[15]-n[12]}),r.push({normal:[n[3]+n[1],n[7]+n[5],n[11]+n[9]],distance:n[15]+n[13]}),r.push({normal:[n[3]-n[1],n[7]-n[5],n[11]-n[9]],distance:n[15]-n[13]}),r.push({normal:[n[3]+n[2],n[7]+n[6],n[11]+n[10]],distance:n[15]+n[14]}),r.push({normal:[n[3]-n[2],n[7]-n[6],n[11]-n[10]],distance:n[15]-n[14]});for(const o of r){const s=Math.sqrt(o.normal[0]**2+o.normal[1]**2+o.normal[2]**2);s>0&&(o.normal[0]/=s,o.normal[1]/=s,o.normal[2]/=s,o.distance/=s)}return{planes:r}}}class qf{root=null;meshes=[];static build(t){const n=new qf;if(n.meshes=t,t.length===0)return n;const r=t.map((o,s)=>s);return n.root=n.buildNode(r,0),n}queryAABB(t){const n=[];return this.root&&this.queryNode(this.root,t,n),n}raycast(t,n){const r=[];if(!this.root)return r;const o=Math.sqrt(n[0]**2+n[1]**2+n[2]**2),s=[n[0]/o,n[1]/o,n[2]/o];return this.raycastNode(this.root,t,s,r),r}queryFrustum(t){const n=[];return this.root&&this.queryFrustumNode(this.root,t,n),n}buildNode(t,n){if(t.length===0)throw new Error("Empty node");if(t.length===1)return{bounds:this.meshes[t[0]].bounds,meshIndices:[t[0]]};const r=this.computeBounds(t),o=[r.max[0]-r.min[0],r.max[1]-r.min[1],r.max[2]-r.min[2]],s=o[0]>o[1]&&o[0]>o[2]?0:o[1]>o[2]?1:2;t.sort((c,u)=>{const d=(this.meshes[c].bounds.min[s]+this.meshes[c].bounds.max[s])/2,f=(this.meshes[u].bounds.min[s]+this.meshes[u].bounds.max[s])/2;return d-f});const i=Math.floor(t.length/2),a=t.slice(0,i),l=t.slice(i);return{bounds:r,left:this.buildNode(a,n+1),right:this.buildNode(l,n+1)}}computeBounds(t){let n=1/0,r=1/0,o=1/0,s=-1/0,i=-1/0,a=-1/0;for(const l of t){const c=this.meshes[l].bounds;n=Math.min(n,c.min[0]),r=Math.min(r,c.min[1]),o=Math.min(o,c.min[2]),s=Math.max(s,c.max[0]),i=Math.max(i,c.max[1]),a=Math.max(a,c.max[2])}return{min:[n,r,o],max:[s,i,a]}}queryNode(t,n,r){if(Bm.intersects(t.bounds,n))if(t.meshIndices)for(const o of t.meshIndices)Bm.intersects(this.meshes[o].bounds,n)&&r.push(this.meshes[o].expressId);else t.left&&this.queryNode(t.left,n,r),t.right&&this.queryNode(t.right,n,r)}raycastNode(t,n,r,o){if(this.rayIntersectsAABB(n,r,t.bounds))if(t.meshIndices)for(const s of t.meshIndices)this.rayIntersectsAABB(n,r,this.meshes[s].bounds)&&o.push(this.meshes[s].expressId);else t.left&&this.raycastNode(t.left,n,r,o),t.right&&this.raycastNode(t.right,n,r,o)}queryFrustumNode(t,n,r){if(md.isAABBVisible(n,t.bounds))if(t.meshIndices)for(const o of t.meshIndices)md.isAABBVisible(n,this.meshes[o].bounds)&&r.push(this.meshes[o].expressId);else t.left&&this.queryFrustumNode(t.left,n,r),t.right&&this.queryFrustumNode(t.right,n,r)}rayIntersectsAABB(t,n,r){let o=-1/0,s=1/0;for(let i=0;i<3;i++){const a=1/n[i];let l=(r.min[i]-t[i])*a,c=(r.max[i]-t[i])*a;if(a<0&&([l,c]=[c,l]),o=Math.max(o,l),s=Math.min(s,c),s<o)return!1}return s>=0}}function Dm(e){const t=e.map(n=>{const r=YR(n);return{expressId:n.expressId,bounds:r}});return qf.build(t)}function YR(e){const t=e.positions;if(t.length===0)return{min:[0,0,0],max:[0,0,0]};let n=1/0,r=1/0,o=1/0,s=-1/0,i=-1/0,a=-1/0;for(let l=0;l<t.length;l+=3){const c=t[l],u=t[l+1],d=t[l+2];n=Math.min(n,c),r=Math.min(r,u),o=Math.min(o,d),s=Math.max(s,c),i=Math.max(i,u),a=Math.max(a,d)}return{min:[n,r,o],max:[s,i,a]}}const gd=1279477321,yd=1;var It=(e=>(e[e.Strings=1]="Strings",e[e.Entities=2]="Entities",e[e.Properties=3]="Properties",e[e.Quantities=4]="Quantities",e[e.Relationships=5]="Relationships",e[e.Geometry=6]="Geometry",e[e.Spatial=7]="Spatial",e[e.Bounds=8]="Bounds",e))(It||{}),jo=(e=>(e[e.None=0]="None",e[e.Compressed=1]="Compressed",e[e.HasGeometry=2]="HasGeometry",e[e.HasSpatial=4]="HasSpatial",e))(jo||{}),yw=(e=>(e[e.None=0]="None",e[e.Compressed=1]="Compressed",e))(yw||{});const Xf=64,qR=16;class kr{chunks=[];currentChunk;view;offset=0;totalSize=0;constructor(t=1024*1024){this.currentChunk=new Uint8Array(t),this.view=new DataView(this.currentChunk.buffer)}ensureCapacity(t){if(this.offset+t>this.currentChunk.length){this.chunks.push(this.currentChunk.subarray(0,this.offset)),this.totalSize+=this.offset;const n=Math.max(t,this.currentChunk.length);this.currentChunk=new Uint8Array(n),this.view=new DataView(this.currentChunk.buffer),this.offset=0}}writeUint8(t){this.ensureCapacity(1),this.currentChunk[this.offset++]=t}writeUint16(t){this.ensureCapacity(2),this.view.setUint16(this.offset,t,!0),this.offset+=2}writeUint32(t){this.ensureCapacity(4),this.view.setUint32(this.offset,t,!0),this.offset+=4}writeInt32(t){this.ensureCapacity(4),this.view.setInt32(this.offset,t,!0),this.offset+=4}writeBigUint64(t){this.ensureCapacity(8),this.view.setBigUint64(this.offset,t,!0),this.offset+=8}writeFloat32(t){this.ensureCapacity(4),this.view.setFloat32(this.offset,t,!0),this.offset+=4}writeFloat64(t){this.ensureCapacity(8),this.view.setFloat64(this.offset,t,!0),this.offset+=8}writeBytes(t){this.ensureCapacity(t.length),this.currentChunk.set(t,this.offset),this.offset+=t.length}writeTypedArray(t){const n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);this.writeBytes(n)}writeString(t){const r=new TextEncoder().encode(t);this.writeUint32(r.length),this.writeBytes(r)}align(t){const n=this.totalSize+this.offset,r=(t-n%t)%t;for(let o=0;o<r;o++)this.writeUint8(0)}get position(){return this.totalSize+this.offset}build(){this.chunks.push(this.currentChunk.subarray(0,this.offset)),this.totalSize+=this.offset;const t=new Uint8Array(this.totalSize);let n=0;for(const r of this.chunks)t.set(r,n),n+=r.length;return t.buffer}}class Um{view;bytes;offset=0;constructor(t){this.view=new DataView(t),this.bytes=new Uint8Array(t)}get position(){return this.offset}set position(t){this.offset=t}get remaining(){return this.bytes.length-this.offset}readUint8(){return this.bytes[this.offset++]}readUint16(){const t=this.view.getUint16(this.offset,!0);return this.offset+=2,t}readUint32(){const t=this.view.getUint32(this.offset,!0);return this.offset+=4,t}readInt32(){const t=this.view.getInt32(this.offset,!0);return this.offset+=4,t}readBigUint64(){const t=this.view.getBigUint64(this.offset,!0);return this.offset+=8,t}readFloat32(){const t=this.view.getFloat32(this.offset,!0);return this.offset+=4,t}readFloat64(){const t=this.view.getFloat64(this.offset,!0);return this.offset+=8,t}readBytes(t){const n=this.bytes.slice(this.offset,this.offset+t);return this.offset+=t,n}readUint8Array(t){return this.readBytes(t)}readUint16Array(t){const n=this.readBytes(t*2);return new Uint16Array(n.buffer,n.byteOffset,t)}readUint32Array(t){const n=this.readBytes(t*4);return new Uint32Array(n.buffer,n.byteOffset,t)}readInt32Array(t){const n=this.readBytes(t*4);return new Int32Array(n.buffer,n.byteOffset,t)}readFloat32Array(t){const n=this.readBytes(t*4);return new Float32Array(n.buffer,n.byteOffset,t)}readFloat64Array(t){const n=this.readBytes(t*8);return new Float64Array(n.buffer,n.byteOffset,t)}readString(){const t=this.readUint32(),n=this.readBytes(t);return new TextDecoder().decode(n)}align(t){const n=(t-this.offset%t)%t;this.offset+=n}skip(t){this.offset+=t}}const Nr=0x9E3779B185EBCA87n,Ds=0xC2B2AE3D27D4EB4Fn,vw=0x165667B19E3779F9n,xw=0x85EBCA77C2B2AE63n,$m=0x27D4EB2F165667C5n;function Qn(e,t){return(e<<BigInt(t)|e>>BigInt(64-t))&0xFFFFFFFFFFFFFFFFn}function po(e,t){return e=e+t*Ds&0xFFFFFFFFFFFFFFFFn,e=Qn(e,31),e=e*Nr&0xFFFFFFFFFFFFFFFFn,e}function la(e,t){return t=po(0n,t),e=(e^t)&0xFFFFFFFFFFFFFFFFn,e=e*Nr+xw&0xFFFFFFFFFFFFFFFFn,e}function XR(e){return e=(e^e>>33n)&0xFFFFFFFFFFFFFFFFn,e=e*Ds&0xFFFFFFFFFFFFFFFFn,e=(e^e>>29n)&0xFFFFFFFFFFFFFFFFn,e=e*vw&0xFFFFFFFFFFFFFFFFn,e=(e^e>>32n)&0xFFFFFFFFFFFFFFFFn,e}function fl(e,t=0n){const n=e instanceof Uint8Array?e:new Uint8Array(e),r=n.length,o=new DataView(n.buffer,n.byteOffset,n.byteLength);let s,i=0;if(r>=32){let a=t+Nr+Ds&0xFFFFFFFFFFFFFFFFn,l=t+Ds&0xFFFFFFFFFFFFFFFFn,c=t,u=t-Nr&0xFFFFFFFFFFFFFFFFn;const d=r-32;for(;i<=d;)a=po(a,o.getBigUint64(i,!0)),l=po(l,o.getBigUint64(i+8,!0)),c=po(c,o.getBigUint64(i+16,!0)),u=po(u,o.getBigUint64(i+24,!0)),i+=32;s=Qn(a,1)+Qn(l,7)+Qn(c,12)+Qn(u,18),s=s&0xFFFFFFFFFFFFFFFFn,s=la(s,a),s=la(s,l),s=la(s,c),s=la(s,u)}else s=t+$m&0xFFFFFFFFFFFFFFFFn;for(s=s+BigInt(r)&0xFFFFFFFFFFFFFFFFn;i+8<=r;){const a=po(0n,o.getBigUint64(i,!0));s=(s^a)&0xFFFFFFFFFFFFFFFFn,s=Qn(s,27)*Nr+xw&0xFFFFFFFFFFFFFFFFn,i+=8}for(i+4<=r&&(s=(s^BigInt(o.getUint32(i,!0))*Nr)&0xFFFFFFFFFFFFFFFFn,s=Qn(s,23)*Ds+vw&0xFFFFFFFFFFFFFFFFn,i+=4);i<r;)s=(s^BigInt(n[i])*$m)&0xFFFFFFFFFFFFFFFFn,s=Qn(s,11)*Nr&0xFFFFFFFFFFFFFFFFn,i++;return XR(s)}function QR(e,t=0n){return fl(e,t).toString(16).padStart(16,"0")}function KR(e,t,n){e.writeUint32(gd),e.writeUint16(t.version),e.writeUint16(t.flags),e.writeBigUint64(t.sourceHash),e.writeUint8(t.schema),e.writeUint32(t.entityCount),e.writeUint32(t.totalVertices),e.writeUint32(t.totalTriangles),e.writeUint16(n.length);const r=Xf-31;for(let o=0;o<r;o++)e.writeUint8(0);for(const o of n)e.writeUint16(o.type),e.writeUint16(o.flags),e.writeUint32(o.offset),e.writeUint32(o.size),e.writeUint32(o.compressedSize)}function Vm(e){const t=e.readUint32();if(t!==gd)throw new Error(`Invalid magic bytes: expected 0x${gd.toString(16)}, got 0x${t.toString(16)}`);const n=e.readUint16();if(n>yd)throw new Error(`Unsupported format version: ${n} (max supported: ${yd})`);const r=e.readUint16(),o=e.readBigUint64(),s=e.readUint8(),i=e.readUint32(),a=e.readUint32(),l=e.readUint32(),c=e.readUint16(),u=Xf-31;e.skip(u);const d=[];for(let f=0;f<c;f++)d.push({type:e.readUint16(),flags:e.readUint16(),offset:e.readUint32(),size:e.readUint32(),compressedSize:e.readUint32()});return{version:n,schema:s,sourceHash:o,entityCount:i,totalVertices:a,totalTriangles:l,hasGeometry:(r&jo.HasGeometry)!==0,hasSpatialHierarchy:(r&jo.HasSpatial)!==0,sections:d}}function ZR(e,t){const n=t.getAll(),r=n.length,o=new TextEncoder,s=n.map(l=>o.encode(l)),i=new Uint32Array(r+1);let a=0;for(let l=0;l<r;l++)i[l]=a,a+=s[l].length;i[r]=a,e.writeUint32(r),e.writeTypedArray(i);for(const l of s)e.writeBytes(l)}function JR(e){const t=e.readUint32(),n=e.readUint32Array(t+1),r=n[t],o=e.readBytes(r),s=new TextDecoder,i=new hw;for(let a=0;a<t;a++){const l=n[a],c=n[a+1],u=s.decode(o.subarray(l,c));i.intern(u)}return i}function eT(e,t){const n=t.count;e.writeUint32(n),e.writeTypedArray(t.expressId),e.writeTypedArray(t.typeEnum),e.writeTypedArray(t.globalId),e.writeTypedArray(t.name),e.writeTypedArray(t.description),e.writeTypedArray(t.objectType),e.writeTypedArray(t.flags),e.writeTypedArray(t.containedInStorey),e.writeTypedArray(t.definedByType),e.writeTypedArray(t.geometryIndex);const r=t.typeRanges.size;e.writeUint16(r);for(const[o,s]of t.typeRanges)e.writeUint16(o),e.writeUint32(s.start),e.writeUint32(s.end)}function tT(e,t){const n=e.readUint32(),r=e.readUint32Array(n),o=e.readUint16Array(n),s=e.readUint32Array(n),i=e.readUint32Array(n),a=e.readUint32Array(n),l=e.readUint32Array(n),c=e.readUint8Array(n),u=e.readInt32Array(n),d=e.readInt32Array(n),f=e.readInt32Array(n),y=e.readUint16(),p=new Map;for(let m=0;m<y;m++){const v=e.readUint16(),w=e.readUint32(),S=e.readUint32();p.set(v,{start:w,end:S})}const x=1,b=m=>{for(let v=0;v<r.length;v++)if(r[v]===m)return v;return-1};return{count:n,expressId:r,typeEnum:o,globalId:s,name:i,description:a,objectType:l,flags:c,containedInStorey:u,definedByType:d,geometryIndex:f,typeRanges:p,getGlobalId:m=>{const v=b(m);return v>=0?t.get(s[v]):""},getName:m=>{const v=b(m);return v>=0?t.get(i[v]):""},getTypeName:m=>{const v=b(m);return v>=0?Yf(o[v]):"Unknown"},hasGeometry:m=>{const v=b(m);return v>=0?(c[v]&x)!==0:!1},getByType:m=>{const v=p.get(m);if(!v)return[];const w=[];for(let S=v.start;S<v.end;S++)w.push(r[S]);return w}}}function nT(e,t){const n=t.count;e.writeUint32(n),e.writeTypedArray(t.entityId),e.writeTypedArray(t.psetName),e.writeTypedArray(t.psetGlobalId),e.writeTypedArray(t.propName),e.writeTypedArray(t.propType),e.writeTypedArray(t.valueString),e.writeTypedArray(t.valueReal),e.writeTypedArray(t.valueInt),e.writeTypedArray(t.valueBool),e.writeTypedArray(t.unitId),tu(e,t.entityIndex),tu(e,t.psetIndex),tu(e,t.propIndex)}function rT(e,t){const n=e.readUint32(),r=e.readUint32Array(n),o=e.readUint32Array(n),s=e.readUint32Array(n),i=e.readUint32Array(n),a=e.readUint8Array(n),l=e.readUint32Array(n),c=e.readFloat64Array(n),u=e.readInt32Array(n),d=e.readUint8Array(n),f=e.readInt32Array(n),y=nu(e),p=nu(e),x=nu(e),b=m=>{switch(a[m]){case se.String:case se.Label:case se.Identifier:case se.Text:case se.Enum:return l[m]>=0?t.get(l[m]):null;case se.Real:return c[m];case se.Integer:return u[m];case se.Boolean:case se.Logical:const w=d[m];return w===255?null:w===1;case se.List:const S=t.get(l[m]);try{return JSON.parse(S)}catch{return[]}default:return null}};return{count:n,entityId:r,psetName:o,psetGlobalId:s,propName:i,propType:a,valueString:l,valueReal:c,valueInt:u,valueBool:d,unitId:f,entityIndex:y,psetIndex:p,propIndex:x,getForEntity:m=>{const v=y.get(m)||[],w=new Map;for(const S of v){const _=t.get(o[S]),I=t.get(s[S]);w.has(_)||w.set(_,{name:_,globalId:I,properties:[]});const C=w.get(_),E=t.get(i[S]);C.properties.push({name:E,type:a[S],value:b(S)})}return Array.from(w.values())},getPropertyValue:(m,v,w)=>{const S=y.get(m)||[],_=t.indexOf(v),I=t.indexOf(w);for(const C of S)if(o[C]===_&&i[C]===I)return b(C);return null},findByProperty:(m,v,w)=>{const S=t.indexOf(m);if(S<0)return[];const _=x.get(S)||[],I=[];for(const C of _){const E=b(C);oT(E,v,w)&&I.push(r[C])}return I}}}function oT(e,t,n){if(e===null||n===null)return!1;if(typeof e=="number"&&typeof n=="number")switch(t){case">=":return e>=n;case">":return e>n;case"<=":return e<=n;case"<":return e<n;case"=":case"==":return e===n;case"!=":return e!==n}if(typeof e=="string"&&typeof n=="string")switch(t){case"=":case"==":return e===n;case"!=":return e!==n;case"contains":return e.includes(n);case"startsWith":return e.startsWith(n)}return!1}function tu(e,t){e.writeUint32(t.size);for(const[n,r]of t){e.writeUint32(n),e.writeUint32(r.length);for(const o of r)e.writeUint32(o)}}function nu(e){const t=e.readUint32(),n=new Map;for(let r=0;r<t;r++){const o=e.readUint32(),s=e.readUint32(),i=[];for(let a=0;a<s;a++)i.push(e.readUint32());n.set(o,i)}return n}function sT(e,t){const n=t.count;e.writeUint32(n),e.writeTypedArray(t.entityId),e.writeTypedArray(t.qsetName),e.writeTypedArray(t.quantityName),e.writeTypedArray(t.quantityType),e.writeTypedArray(t.value),e.writeTypedArray(t.unitId),e.writeTypedArray(t.formula),ru(e,t.entityIndex),ru(e,t.qsetIndex),ru(e,t.quantityIndex)}function iT(e,t){const n=e.readUint32(),r=e.readUint32Array(n),o=e.readUint32Array(n),s=e.readUint32Array(n),i=e.readUint8Array(n),a=e.readFloat64Array(n),l=e.readInt32Array(n),c=e.readUint32Array(n),u=ou(e),d=ou(e),f=ou(e);return{count:n,entityId:r,qsetName:o,quantityName:s,quantityType:i,value:a,unitId:l,formula:c,entityIndex:u,qsetIndex:d,quantityIndex:f,getForEntity:y=>{const p=u.get(y)||[],x=new Map;for(const b of p){const m=t.get(o[b]);x.has(m)||x.set(m,{name:m,quantities:[]});const v=x.get(m),w=t.get(s[b]);v.quantities.push({name:w,type:i[b],value:a[b],formula:c[b]>0?t.get(c[b]):void 0})}return Array.from(x.values())},getQuantityValue:(y,p,x)=>{const b=u.get(y)||[],m=t.indexOf(p),v=t.indexOf(x);for(const w of b)if(o[w]===m&&s[w]===v)return a[w];return null},sumByType:y=>{const p=t.indexOf(y);if(p<0)return 0;const x=f.get(p)||[];let b=0;for(const m of x)b+=a[m];return b}}}function ru(e,t){e.writeUint32(t.size);for(const[n,r]of t){e.writeUint32(n),e.writeUint32(r.length);for(const o of r)e.writeUint32(o)}}function ou(e){const t=e.readUint32(),n=new Map;for(let r=0;r<t;r++){const o=e.readUint32(),s=e.readUint32(),i=[];for(let a=0;a<s;a++)i.push(e.readUint32());n.set(o,i)}return n}function aT(e,t){Gm(e,t.forward),Gm(e,t.inverse)}function Gm(e,t){const n=t.offsets.size;e.writeUint32(n);for(const[o,s]of t.offsets){const i=t.counts.get(o)??0;e.writeUint32(o),e.writeUint32(s),e.writeUint32(i)}const r=t.edgeTargets.length;e.writeUint32(r),e.writeTypedArray(t.edgeTargets),e.writeTypedArray(t.edgeTypes),e.writeTypedArray(t.edgeRelIds)}function lT(e){const t=Wm(e),n=Wm(e);return{forward:t,inverse:n,getRelated:(r,o,s)=>(s==="forward"?t.getEdges(r,o):n.getEdges(r,o)).map(a=>a.target),hasRelationship:(r,o,s)=>t.getEdges(r,s).some(a=>a.target===o),getRelationshipsBetween:(r,o)=>t.getEdges(r).filter(i=>i.target===o).map(i=>({relationshipId:i.relationshipId,type:i.type,typeName:cT(i.type)}))}}function Wm(e){const t=e.readUint32(),n=new Map,r=new Map;for(let l=0;l<t;l++){const c=e.readUint32(),u=e.readUint32(),d=e.readUint32();n.set(c,u),r.set(c,d)}const o=e.readUint32(),s=e.readUint32Array(o),i=e.readUint16Array(o),a=e.readUint32Array(o);return{offsets:n,counts:r,edgeTargets:s,edgeTypes:i,edgeRelIds:a,getEdges(l,c){const u=n.get(l);if(u===void 0)return[];const d=r.get(l),f=[];for(let y=u;y<u+d;y++)(c===void 0||i[y]===c)&&f.push({target:s[y],type:i[y],relationshipId:a[y]});return f},getTargets(l,c){return this.getEdges(l,c).map(u=>u.target)},hasAnyEdges(l){return n.has(l)}}}function cT(e){return{[X.ContainsElements]:"IfcRelContainedInSpatialStructure",[X.Aggregates]:"IfcRelAggregates",[X.DefinesByProperties]:"IfcRelDefinesByProperties",[X.DefinesByType]:"IfcRelDefinesByType",[X.AssociatesMaterial]:"IfcRelAssociatesMaterial",[X.AssociatesClassification]:"IfcRelAssociatesClassification",[X.VoidsElement]:"IfcRelVoidsElement",[X.FillsElement]:"IfcRelFillsElement",[X.ConnectsPathElements]:"IfcRelConnectsPathElements",[X.ConnectsElements]:"IfcRelConnectsElements",[X.SpaceBoundary]:"IfcRelSpaceBoundary",[X.AssignsToGroup]:"IfcRelAssignsToGroup",[X.AssignsToProduct]:"IfcRelAssignsToProduct",[X.ReferencedInSpatialStructure]:"ReferencedInSpatialStructure"}[e]||"Unknown"}function uT(e,t,n,r,o){e.writeUint32(t.length),e.writeUint32(n),e.writeUint32(r),dT(e,o);for(const s of t){e.writeUint32(s.expressId);const i=s.positions.length/3,a=s.indices.length;e.writeUint32(i),e.writeUint32(a),e.writeFloat32(s.color[0]),e.writeFloat32(s.color[1]),e.writeFloat32(s.color[2]),e.writeFloat32(s.color[3]),e.writeTypedArray(s.positions),e.writeTypedArray(s.normals),e.writeTypedArray(s.indices)}}function dT(e,t){vd(e,t.originShift),Hm(e,t.originalBounds),Hm(e,t.shiftedBounds),e.writeUint8(t.isGeoReferenced?1:0)}function vd(e,t){e.writeFloat64(t.x),e.writeFloat64(t.y),e.writeFloat64(t.z)}function Hm(e,t){vd(e,t.min),vd(e,t.max)}function fT(e){const t=e.readUint32(),n=e.readUint32(),r=e.readUint32(),o=hT(e),s=[];for(let i=0;i<t;i++){const a=e.readUint32(),l=e.readUint32(),c=e.readUint32(),u=[e.readFloat32(),e.readFloat32(),e.readFloat32(),e.readFloat32()],d=e.readFloat32Array(l*3),f=e.readFloat32Array(l*3),y=e.readUint32Array(c);s.push({expressId:a,positions:d,normals:f,indices:y,color:u})}return{meshes:s,totalVertices:n,totalTriangles:r,coordinateInfo:o}}function hT(e){const t=xd(e),n=Ym(e),r=Ym(e),o=e.readUint8()===1;return{originShift:t,originalBounds:n,shiftedBounds:r,isGeoReferenced:o}}function xd(e){return{x:e.readFloat64(),y:e.readFloat64(),z:e.readFloat64()}}function Ym(e){return{min:xd(e),max:xd(e)}}class pT{async write(t,n,r,o={}){const{includeGeometry:s=!0,includeSpatialHierarchy:i=!0}=o,a=fl(r),l=[],c=this.writeSection(()=>{const C=new kr;return ZR(C,t.strings),C.build()});l.push({type:It.Strings,buffer:c});const u=this.writeSection(()=>{const C=new kr;return eT(C,t.entities),C.build()});l.push({type:It.Entities,buffer:u});const d=this.writeSection(()=>{const C=new kr;return nT(C,t.properties),C.build()});l.push({type:It.Properties,buffer:d});const f=this.writeSection(()=>{const C=new kr;return sT(C,t.quantities),C.build()});l.push({type:It.Quantities,buffer:f});const y=this.writeSection(()=>{const C=new kr;return aT(C,t.relationships),C.build()});l.push({type:It.Relationships,buffer:y});let p=0,x=0;if(s&&n){const C=this.writeSection(()=>{const E=new kr;return uT(E,n.meshes,n.totalVertices,n.totalTriangles,n.coordinateInfo),E.build()});l.push({type:It.Geometry,buffer:C}),p=n.totalVertices,x=n.totalTriangles}const b=l.length*qR;let m=Xf+b;const v=l.map(({type:C,buffer:E})=>{const R={type:C,flags:yw.None,offset:m,size:E.byteLength,compressedSize:0};return m+=E.byteLength,R});let w=jo.None;s&&n&&(w|=jo.HasGeometry),i&&t.spatialHierarchy&&(w|=jo.HasSpatial);const S={version:yd,flags:w,sourceHash:a,schema:t.schema,entityCount:t.entityCount,totalVertices:p,totalTriangles:x,sectionCount:v.length},_=m,I=new kr(_);KR(I,S,v);for(const{buffer:C}of l)I.writeBytes(new Uint8Array(C));return I.build()}writeSection(t){return t()}}class mT{readHeader(t){const n=new Um(t);return Vm(n)}validate(t,n){const r=this.readHeader(t),o=fl(n);return r.sourceHash===o}async read(t,n={}){const{skipGeometry:r=!1,sourceBuffer:o}=n,s=new Um(t),i=Vm(s);if(o){const S=fl(o);if(i.sourceHash!==S)throw new Error("Cache validation failed: source file has changed")}const a=new Map(i.sections.map(S=>[S.type,S])),l=a.get(It.Strings);if(!l)throw new Error("Missing required Strings section");s.position=l.offset;const c=JR(s),u=a.get(It.Entities);if(!u)throw new Error("Missing required Entities section");s.position=u.offset;const d=tT(s,c),f=a.get(It.Properties);if(!f)throw new Error("Missing required Properties section");s.position=f.offset;const y=rT(s,c),p=a.get(It.Quantities);if(!p)throw new Error("Missing required Quantities section");s.position=p.offset;const x=iT(s,c),b=a.get(It.Relationships);if(!b)throw new Error("Missing required Relationships section");s.position=b.offset;const m=lT(s),w={dataStore:{schema:i.schema,entityCount:i.entityCount,strings:c,entities:d,properties:y,quantities:x,relationships:m}};if(!r&&i.hasGeometry){const S=a.get(It.Geometry);S&&(s.position=S.offset,w.geometry=fT(s))}return w}}const qm="ifc-lite-cache",gT=1,Br="models";let fo=null;function Qf(){return fo||(fo=new Promise((e,t)=>{const n=indexedDB.open(qm,gT);n.onerror=()=>{console.error("[IFC Cache] Failed to open database:",n.error),fo=null,t(n.error)},n.onsuccess=()=>{const r=n.result;if(!r.objectStoreNames.contains(Br)){console.warn("[IFC Cache] Object store missing, recreating database..."),r.close(),fo=null;const o=indexedDB.deleteDatabase(qm);o.onsuccess=()=>{Qf().then(e).catch(t)},o.onerror=()=>{t(new Error("Failed to recreate database"))};return}e(r)},n.onupgradeneeded=r=>{const o=r.target.result;if(!o.objectStoreNames.contains(Br)){const s=o.createObjectStore(Br,{keyPath:"key"});s.createIndex("createdAt","createdAt",{unique:!1}),s.createIndex("fileName","fileName",{unique:!1})}}}),fo)}async function yT(e){try{const t=await Qf();return new Promise((n,r)=>{const i=t.transaction(Br,"readonly").objectStore(Br).get(e);i.onsuccess=()=>{const a=i.result;a?(console.log(`[IFC Cache] Cache hit for ${a.fileName} (${(a.fileSize/1024/1024).toFixed(2)}MB)`),n(a.buffer)):n(null)},i.onerror=()=>{console.error("[IFC Cache] Failed to get cache entry:",i.error),r(i.error)}})}catch(t){return console.warn("[IFC Cache] Cache read failed:",t),null}}async function vT(e,t,n,r){try{const o=await Qf();return new Promise((s,i)=>{const l=o.transaction(Br,"readwrite").objectStore(Br),c={key:e,buffer:t,fileName:n,fileSize:r,createdAt:Date.now()},u=l.put(c);u.onsuccess=()=>{console.log(`[IFC Cache] Cached ${n} (${(r/1024/1024).toFixed(2)}MB)`),s()},u.onerror=()=>{console.error("[IFC Cache] Failed to cache entry:",u.error),i(u.error)}})}catch(o){console.warn("[IFC Cache] Cache write failed:",o)}}const Xm=10*1024*1024;function wr(){const{loading:e,progress:t,error:n,ifcDataStore:r,geometryResult:o,setLoading:s,setProgress:i,setError:a,setIfcDataStore:l,setGeometryResult:c,appendGeometryBatch:u,updateCoordinateInfo:d}=D(),f=g.useRef(null),y=g.useCallback(async(m,v)=>{try{console.time("[useIfc] cache-load"),i({phase:"Loading from cache",percent:10}),c(null);const S=await new mT().read(m),_=S.dataStore;if(S.geometry){const{meshes:I,coordinateInfo:C,totalVertices:E,totalTriangles:R}=S.geometry;if(c({meshes:I,totalVertices:E,totalTriangles:R,coordinateInfo:C}),l(_),I.length>0){const M=()=>{console.time("[useIfc] spatial-index-background");try{const N=Dm(I);_.spatialIndex=N,l({..._}),console.timeEnd("[useIfc] spatial-index-background")}catch(N){console.warn("[useIfc] Failed to build spatial index:",N)}};"requestIdleCallback"in window?window.requestIdleCallback(M,{timeout:1e3}):setTimeout(M,100)}}else l(_);return i({phase:"Complete (from cache)",percent:100}),console.timeEnd("[useIfc] cache-load"),console.log(`[useIfc] INSTANT load: ${v} from cache (${S.geometry?.meshes.length||0} meshes)`),!0}catch(w){return console.error("[useIfc] Failed to load from cache:",w),!1}},[i,l,c]),p=g.useCallback(async(m,v,w,S,_)=>{try{console.time("[useIfc] cache-write");const I=new pT,C={schema:v.schemaVersion==="IFC4"?1:v.schemaVersion==="IFC4X3"?2:0,entityCount:v.entityCount||v.entities?.count||0,strings:v.strings,entities:v.entities,properties:v.properties,quantities:v.quantities,relationships:v.relationships,spatialHierarchy:v.spatialHierarchy},E=await I.write(C,w,S,{includeGeometry:!0});await vT(m,E,_,S.byteLength),console.timeEnd("[useIfc] cache-write"),console.log(`[useIfc] Cached ${_} (${(E.byteLength/1024/1024).toFixed(2)}MB cache)`)}catch(I){console.warn("[useIfc] Failed to cache model:",I)}},[]),x=g.useCallback(async m=>{const{resetViewerState:v}=D.getState();try{v(),s(!0),a(null),i({phase:"Loading file",percent:0});const w=await m.arrayBuffer(),S=w.byteLength/(1024*1024);i({phase:"Checking cache",percent:5});const _=QR(w);if(console.log(`[useIfc] File: ${m.name}, size: ${S.toFixed(2)}MB, hash: ${_}`),w.byteLength>=Xm){const T=await yT(_);if(T){if(await y(T,m.name)){s(!1);return}console.log("[useIfc] Cache load failed, falling back to parsing")}}i({phase:"Parsing IFC",percent:10});const C=await new _R().parseColumnar(w,{onProgress:T=>{i({phase:`Parsing: ${T.phase}`,percent:10+T.percent*.4})}});l(C),i({phase:"Triangulating geometry",percent:50});const E=new GR({useWorkers:!1,quality:gw.Balanced});await E.init();const R=new Map;if(C.entityIndex?.byId)for(const[T,$]of C.entityIndex.byId)R.set(T,{type:$.type});let M=0,N=0;const A=[];let j=null;c(null);const L=performance.now();let F=0,O=L,V=0,k=0;try{console.log(`[useIfc] Starting adaptive processing (file size: ${S.toFixed(2)}MB)...`),console.time("[useIfc] total-processing");for await(const T of E.processAdaptive(new Uint8Array(w),{sizeThreshold:2*1024*1024,batchSize:25,entityIndex:R})){const $=performance.now(),ne=$-O;switch(T.type){case"start":M=T.totalEstimate,console.log(`[useIfc] Processing started, estimated: ${M}`);break;case"model-open":i({phase:"Processing geometry",percent:50}),console.log(`[useIfc] Model opened at ${($-L).toFixed(0)}ms`);break;case"batch":{F++,V+=ne;const W=performance.now();A.push(...T.meshes),j=T.coordinateInfo,u(T.meshes,T.coordinateInfo),N=T.totalSoFar;const Q=50+Math.min(45,N/Math.max(M/10,N)*45);i({phase:`Rendering geometry (${N} meshes)`,percent:Q});const ee=performance.now()-W;k+=ee,(F<=5||F%10===0)&&console.log(`[useIfc] Batch #${F}: ${T.meshes.length} meshes, wait: ${ne.toFixed(0)}ms, process: ${ee.toFixed(0)}ms, total: ${N} meshes at ${($-L).toFixed(0)}ms`);break}case"complete":if(console.log(`[useIfc] Processing complete: ${F} batches, ${T.totalMeshes} meshes
|
|
450
|
+
Total wait (WASM): ${V.toFixed(0)}ms
|
|
451
|
+
Total process (JS): ${k.toFixed(0)}ms
|
|
452
|
+
First batch at: ${F>0?"(see Batch #1 above)":"N/A"}`),console.timeEnd("[useIfc] total-processing"),j=T.coordinateInfo,d(T.coordinateInfo),A.length>0){i({phase:"Building spatial index",percent:95}),console.time("[useIfc] spatial-index");try{const W=Dm(A);C.spatialIndex=W,l(C),console.timeEnd("[useIfc] spatial-index")}catch(W){console.timeEnd("[useIfc] spatial-index"),console.warn("[useIfc] Failed to build spatial index:",W)}}if(i({phase:"Complete",percent:100}),w.byteLength>=Xm&&A.length>0&&j){const W={meshes:A,totalVertices:A.reduce((Q,ee)=>Q+ee.positions.length/3,0),totalTriangles:A.reduce((Q,ee)=>Q+ee.indices.length/3,0),coordinateInfo:j};p(_,C,W,w,m.name)}break}O=performance.now()}}catch(T){console.error("[useIfc] Error in processing:",T),a(T instanceof Error?T.message:"Unknown error during geometry processing")}s(!1)}catch(w){a(w instanceof Error?w.message:"Unknown error"),s(!1)}},[s,a,i,l,c,u,d,y,p]),b=g.useMemo(()=>r?(f.current=r,new HR(r)):null,[r]);return{loading:e,progress:t,error:n,ifcDataStore:r,geometryResult:o,query:b,loadFile:x}}class xT{geometryResult;constructor(t){this.geometryResult=t}exportGLB(t={}){const n=this.buildGLTF(t);return this.packGLB(n.json,n.buffers)}exportGLTF(t={}){const n=this.buildGLTF(t);return{json:JSON.stringify(n.json,null,2),bin:this.combineBuffers(n.buffers)}}buildGLTF(t){const n=this.geometryResult.meshes,r={asset:{version:"2.0",generator:"IFC-Lite"},scene:0,scenes:[{nodes:[]}],nodes:[],meshes:[],accessors:[],bufferViews:[],buffers:[{byteLength:0}]};t.includeMetadata&&(r.asset.extras={meshCount:n.length,vertexCount:this.geometryResult.totalVertices,triangleCount:this.geometryResult.totalTriangles});const o=[],s=[],i=[],a=[],l=b=>{if(b.length===0)return{min:[0,0,0],max:[0,0,0]};let m=b[0],v=b[1],w=b[2],S=b[0],_=b[1],I=b[2];for(let C=0;C<b.length;C+=3){const E=b[C],R=b[C+1],M=b[C+2];m=Math.min(m,E),v=Math.min(v,R),w=Math.min(w,M),S=Math.max(S,E),_=Math.max(_,R),I=Math.max(I,M)}return{min:[m,v,w],max:[S,_,I]}};for(let b=0;b<n.length;b++){const m=n[b],v=m.positions||[],w=m.normals||[],S=m.indices||[];if(!v.length||!w.length||!S.length){console.warn(`Skipping empty mesh ${b} (positions: ${v.length}, normals: ${w.length}, indices: ${S.length})`);continue}if(v.length%3!==0){console.warn(`Mesh ${b} has invalid position count: ${v.length} (not divisible by 3)`);continue}if(w.length%3!==0){console.warn(`Mesh ${b} has invalid normal count: ${w.length} (not divisible by 3)`);continue}const _=o.length*4,I=s.length*4,C=i.length*4,E=Array.from(v),R=Array.from(w),M=Array.from(S);o.push(...E),s.push(...R),i.push(...M);const N=l(E),A=r.accessors.length;r.accessors.push({bufferView:0,byteOffset:_,componentType:5126,count:v.length/3,type:"VEC3",min:N.min,max:N.max});const j=r.accessors.length;r.accessors.push({bufferView:1,byteOffset:I,componentType:5126,count:w.length/3,type:"VEC3"});const L=r.accessors.length;r.accessors.push({bufferView:2,byteOffset:C,componentType:5125,count:S.length,type:"SCALAR"});const F=r.meshes.length;r.meshes.push({primitives:[{attributes:{POSITION:A,NORMAL:j},indices:L}]});const O=r.nodes.length,V={mesh:F};t.includeMetadata&&m.expressId&&(V.extras={expressId:m.expressId}),r.nodes.push(V),a.push(O)}if(r.scenes[0].nodes=a,o.length===0||s.length===0||i.length===0)throw new Error("Cannot export GLB: no valid geometry data found");const c=new Float32Array(o),u=new Float32Array(s),d=new Uint32Array(i),f=c.buffer,y=u.buffer,p=d.buffer,x=f.byteLength+y.byteLength+p.byteLength;r.bufferViews.push({buffer:0,byteOffset:0,byteLength:f.byteLength,byteStride:12,target:34962}),r.bufferViews.push({buffer:0,byteOffset:f.byteLength,byteLength:y.byteLength,byteStride:12,target:34962}),r.bufferViews.push({buffer:0,byteOffset:f.byteLength+y.byteLength,byteLength:p.byteLength,target:34963}),r.buffers[0].byteLength=x;for(const b of r.accessors){const m=r.bufferViews[b.bufferView];if(!m)throw new Error(`Accessor references invalid bufferView ${b.bufferView}`);let v=0;if(b.componentType===5126)v=4;else if(b.componentType===5125)v=4;else if(b.componentType===5123)v=2;else if(b.componentType===5120)v=1;else throw new Error(`Unsupported component type: ${b.componentType}`);let w=1;if(b.type==="VEC3")w=3;else if(b.type==="VEC2")w=2;else if(b.type==="SCALAR")w=1;else throw new Error(`Unsupported accessor type: ${b.type}`);const S=b.count*w*v,_=(b.byteOffset||0)+S;if(_>m.byteLength)throw new Error(`Accessor exceeds bufferView bounds: accessor byteOffset=${b.byteOffset||0}, length=${S}, bufferView byteLength=${m.byteLength}, end=${_}`)}return{json:r,buffers:[new Uint8Array(f),new Uint8Array(y),new Uint8Array(p)]}}combineBuffers(t){const n=t.reduce((s,i)=>s+i.byteLength,0),r=new Uint8Array(n);let o=0;for(const s of t)r.set(s,o),o+=s.byteLength;return r}packGLB(t,n){const r=JSON.stringify(t),o=new TextEncoder().encode(r),s=(4-o.byteLength%4)%4,i=o.byteLength+s,a=this.combineBuffers(n),l=(4-a.byteLength%4)%4,c=a.byteLength+l,u=20+i+8+c,d=new ArrayBuffer(u),f=new DataView(d),y=new Uint8Array(d);let p=0;f.setUint32(p,1179937895,!0),p+=4,f.setUint32(p,2,!0),p+=4,f.setUint32(p,u,!0),p+=4,f.setUint32(p,i,!0),p+=4,f.setUint32(p,1313821514,!0),p+=4,y.set(o,p),p+=o.byteLength;for(let x=0;x<s;x++)y[p++]=32;return f.setUint32(p,c,!0),p+=4,f.setUint32(p,5130562,!0),p+=4,y.set(a,p),new Uint8Array(d)}}class wT{store;constructor(t){this.store=t}exportEntities(t,n={}){const r=n.delimiter??",",o=n.includeProperties??!1,s=n.flattenProperties??!1,i=["expressId","globalId","name","type"],a=new Map;if(o&&s){const u=t??this.getAllEntityIds();for(const d of u){const f=this.store.properties.getForEntity(d);for(const y of f){a.has(y.name)||a.set(y.name,new Set);for(const p of y.properties)a.get(y.name).add(p.name)}}for(const[d,f]of a)for(const y of f)i.push(`${d}_${y}`)}const l=[this.escapeRow(i,r)],c=t??this.getAllEntityIds();for(const u of c){const d=[String(u),this.escapeValue(this.store.entities.getGlobalId(u)),this.escapeValue(this.store.entities.getName(u)),this.escapeValue(this.store.entities.getTypeName(u))];if(o&&s){const f=this.store.properties.getForEntity(u),y=new Map;for(const p of f){const x=new Map;for(const b of p.properties)x.set(b.name,b.value);y.set(p.name,x)}for(const[p,x]of a)for(const b of x){const m=y.get(p)?.get(b)??"";d.push(this.escapeValue(m))}}l.push(this.escapeRow(d,r))}return l.join(`
|
|
453
|
+
`)}exportProperties(t,n={}){const r=n.delimiter??",",o=["entityId","psetName","propName","value","type"],s=[this.escapeRow(o,r)],i=t??this.getAllEntityIds();for(const a of i){const l=this.store.properties.getForEntity(a);for(const c of l)for(const u of c.properties){const d=[String(a),this.escapeValue(c.name),this.escapeValue(u.name),this.escapeValue(u.value),String(u.type)];s.push(this.escapeRow(d,r))}}return s.join(`
|
|
454
|
+
`)}exportQuantities(t,n={}){const r=n.delimiter??",";if(!this.store.quantities)return this.escapeRow(["entityId","qsetName","quantityName","value","type"],r);const o=["entityId","qsetName","quantityName","value","type"],s=[this.escapeRow(o,r)],i=t??this.getAllEntityIds();for(const a of i){const l=this.store.quantities.getForEntity(a);for(const c of l)for(const u of c.quantities){const d=[String(a),this.escapeValue(c.name),this.escapeValue(u.name),String(u.value),String(u.type)];s.push(this.escapeRow(d,r))}}return s.join(`
|
|
455
|
+
`)}getAllEntityIds(){const t=[];for(let n=0;n<this.store.entities.count;n++)t.push(this.store.entities.expressId[n]);return t}escapeValue(t){if(t==null)return"";const n=String(t);return n.includes(",")||n.includes('"')||n.includes(`
|
|
456
|
+
`)||n.includes("\r")?`"${n.replace(/"/g,'""')}"`:n}escapeRow(t,n){return t.map(r=>this.escapeValue(r)).join(n)}}function bT({onShowShortcuts:e}={}){const t=g.useRef(null),{loadFile:n,loading:r,progress:o,geometryResult:s,ifcDataStore:i}=wr(),a=D(A=>A.activeTool),l=D(A=>A.setActiveTool),c=D(A=>A.theme),u=D(A=>A.toggleTheme),d=D(A=>A.selectedEntityId),f=D(A=>A.isolateEntity),y=D(A=>A.hideEntity),p=D(A=>A.showAll),x=D(A=>A.error),b=D(A=>A.cameraCallbacks),m=D(A=>A.hoverTooltipsEnabled),v=D(A=>A.toggleHoverTooltips),w=g.useCallback(A=>{const j=A.target.files?.[0];j&&n(j)},[n]),S=g.useCallback(()=>{d&&f(d)},[d,f]),_=g.useCallback(()=>{d&&y(d)},[d,y]),I=g.useCallback(()=>{if(s)try{const j=new xT(s).exportGLB({includeMetadata:!0}),L=new Blob([new Uint8Array(j)],{type:"model/gltf-binary"}),F=URL.createObjectURL(L),O=document.createElement("a");O.href=F,O.download="model.glb",O.click(),URL.revokeObjectURL(F)}catch(A){console.error("Export failed:",A)}},[s]),C=g.useCallback(()=>{const A=document.querySelector("canvas");if(A)try{const j=A.toDataURL("image/png"),L=document.createElement("a");L.href=j,L.download="screenshot.png",L.click()}catch(j){console.error("Screenshot failed:",j)}},[]),E=g.useCallback(A=>{if(i)try{const j=new wT(i);let L,F;switch(A){case"entities":L=j.exportEntities(void 0,{includeProperties:!0,flattenProperties:!0}),F="entities.csv";break;case"properties":L=j.exportProperties(),F="properties.csv";break;case"quantities":L=j.exportQuantities(),F="quantities.csv";break}const O=new Blob([L],{type:"text/csv"}),V=URL.createObjectURL(O),k=document.createElement("a");k.href=V,k.download=F,k.click(),URL.revokeObjectURL(V)}catch(j){console.error("CSV export failed:",j)}},[i]),R=g.useCallback(()=>{if(i)try{const A=[];for(let V=0;V<i.entities.count;V++){const k=i.entities.expressId[V];A.push({expressId:k,globalId:i.entities.getGlobalId(k),name:i.entities.getName(k),type:i.entities.getTypeName(k),properties:i.properties.getForEntity(k)})}const j=JSON.stringify({entities:A},null,2),L=new Blob([j],{type:"application/json"}),F=URL.createObjectURL(L),O=document.createElement("a");O.href=F,O.download="model-data.json",O.click(),URL.revokeObjectURL(F)}catch(A){console.error("JSON export failed:",A)}},[i]),M=({tool:A,icon:j,label:L,shortcut:F})=>h.jsxs(Ot,{children:[h.jsx(Bt,{asChild:!0,children:h.jsx(Te,{variant:a===A?"default":"ghost",size:"icon-sm",onClick:()=>l(A),className:Ie(a===A&&"bg-primary text-primary-foreground"),children:h.jsx(j,{className:"h-4 w-4"})})}),h.jsxs(Ct,{children:[L," ",F&&h.jsxs("span",{className:"ml-2 text-xs opacity-60",children:["(",F,")"]})]})]}),N=({icon:A,label:j,onClick:L,shortcut:F,disabled:O})=>h.jsxs(Ot,{children:[h.jsx(Bt,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:L,disabled:O,children:h.jsx(A,{className:"h-4 w-4"})})}),h.jsxs(Ct,{children:[j," ",F&&h.jsxs("span",{className:"ml-2 text-xs opacity-60",children:["(",F,")"]})]})]});return h.jsxs("div",{className:"flex items-center gap-1 px-2 h-12 border-b bg-card",children:[h.jsx("input",{ref:t,type:"file",accept:".ifc",onChange:w,className:"hidden"}),h.jsxs(Ot,{children:[h.jsx(Bt,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:()=>t.current?.click(),disabled:r,children:r?h.jsx(v2,{className:"h-4 w-4 animate-spin"}):h.jsx(l2,{className:"h-4 w-4"})})}),h.jsx(Ct,{children:"Open IFC File"})]}),h.jsxs(ym,{children:[h.jsx(vm,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-sm",disabled:!s,children:h.jsx(tm,{className:"h-4 w-4"})})}),h.jsxs(dd,{children:[h.jsxs(ft,{onClick:I,children:[h.jsx(tm,{className:"h-4 w-4 mr-2"}),"Export GLB (3D Model)"]}),h.jsx(Ia,{}),h.jsxs(ft,{onClick:()=>E("entities"),disabled:!i,children:[h.jsx(Dc,{className:"h-4 w-4 mr-2"}),"Export Entities (CSV)"]}),h.jsxs(ft,{onClick:()=>E("properties"),disabled:!i,children:[h.jsx(Dc,{className:"h-4 w-4 mr-2"}),"Export Properties (CSV)"]}),h.jsxs(ft,{onClick:()=>E("quantities"),disabled:!i,children:[h.jsx(Dc,{className:"h-4 w-4 mr-2"}),"Export Quantities (CSV)"]}),h.jsxs(ft,{onClick:R,disabled:!i,children:[h.jsx(e2,{className:"h-4 w-4 mr-2"}),"Export JSON (All Data)"]}),h.jsx(Ia,{}),h.jsxs(ft,{onClick:C,children:[h.jsx(FI,{className:"h-4 w-4 mr-2"}),"Screenshot"]})]})]}),h.jsx(tn,{orientation:"vertical",className:"h-6 mx-1"}),h.jsx(M,{tool:"select",icon:E2,label:"Select",shortcut:"V"}),h.jsx(M,{tool:"boxselect",icon:O2,label:"Box Select",shortcut:"B"}),h.jsx(M,{tool:"pan",icon:f2,label:"Pan",shortcut:"P"}),h.jsx(M,{tool:"orbit",icon:P2,label:"Orbit",shortcut:"O"}),h.jsx(M,{tool:"walk",icon:k2,label:"Walk Mode",shortcut:"C"}),h.jsx(tn,{orientation:"vertical",className:"h-6 mx-1"}),h.jsx(M,{tool:"measure",icon:Lv,label:"Measure",shortcut:"M"}),h.jsx(M,{tool:"section",icon:N2,label:"Section",shortcut:"X"}),h.jsx(tn,{orientation:"vertical",className:"h-6 mx-1"}),h.jsx(N,{icon:al,label:"Isolate Selection",onClick:S,shortcut:"I",disabled:!d}),h.jsx(N,{icon:Ol,label:"Hide Selection",onClick:_,shortcut:"Del",disabled:!d}),h.jsx(N,{icon:Bl,label:"Show All",onClick:p,shortcut:"A"}),h.jsx(tn,{orientation:"vertical",className:"h-6 mx-1"}),h.jsxs(Ot,{children:[h.jsx(Bt,{asChild:!0,children:h.jsx(Te,{variant:m?"default":"ghost",size:"icon-sm",onClick:v,className:Ie(m&&"bg-primary text-primary-foreground"),children:h.jsx(m2,{className:"h-4 w-4"})})}),h.jsxs(Ct,{children:[m?"Disable":"Enable"," Hover Tooltips"]})]}),h.jsx(tn,{orientation:"vertical",className:"h-6 mx-1"}),h.jsx(N,{icon:Fv,label:"Home (Isometric)",onClick:()=>b.home?.(),shortcut:"H"}),h.jsx(N,{icon:jv,label:"Fit All",onClick:()=>b.fitAll?.(),shortcut:"Z"}),h.jsx(N,{icon:al,label:"Frame Selection",onClick:()=>b.frameSelection?.(),shortcut:"F",disabled:!d}),h.jsxs(ym,{children:[h.jsxs(Ot,{children:[h.jsx(Bt,{asChild:!0,children:h.jsx(vm,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-sm",children:h.jsx(u2,{className:"h-4 w-4"})})})}),h.jsx(Ct,{children:"Preset Views (0-6)"})]}),h.jsxs(dd,{children:[h.jsxs(ft,{onClick:()=>b.home?.(),children:[h.jsx(ad,{className:"h-4 w-4 mr-2"})," Isometric ",h.jsx("span",{className:"ml-auto text-xs opacity-60",children:"0"})]}),h.jsx(Ia,{}),h.jsxs(ft,{onClick:()=>b.setPresetView?.("top"),children:[h.jsx(kI,{className:"h-4 w-4 mr-2"})," Top ",h.jsx("span",{className:"ml-auto text-xs opacity-60",children:"1"})]}),h.jsxs(ft,{onClick:()=>b.setPresetView?.("bottom"),children:[h.jsx(_I,{className:"h-4 w-4 mr-2"})," Bottom ",h.jsx("span",{className:"ml-auto text-xs opacity-60",children:"2"})]}),h.jsxs(ft,{onClick:()=>b.setPresetView?.("front"),children:[h.jsx(em,{className:"h-4 w-4 mr-2"})," Front ",h.jsx("span",{className:"ml-auto text-xs opacity-60",children:"3"})]}),h.jsxs(ft,{onClick:()=>b.setPresetView?.("back"),children:[h.jsx(Jp,{className:"h-4 w-4 mr-2"})," Back ",h.jsx("span",{className:"ml-auto text-xs opacity-60",children:"4"})]}),h.jsxs(ft,{onClick:()=>b.setPresetView?.("left"),children:[h.jsx(Jp,{className:"h-4 w-4 mr-2"})," Left ",h.jsx("span",{className:"ml-auto text-xs opacity-60",children:"5"})]}),h.jsxs(ft,{onClick:()=>b.setPresetView?.("right"),children:[h.jsx(em,{className:"h-4 w-4 mr-2"})," Right ",h.jsx("span",{className:"ml-auto text-xs opacity-60",children:"6"})]})]})]}),h.jsx("div",{className:"flex-1"}),r&&o&&h.jsxs("div",{className:"flex items-center gap-2 mr-4",children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:o.phase}),h.jsx(sw,{value:o.percent,className:"w-32 h-2"}),h.jsxs("span",{className:"text-xs text-muted-foreground",children:[Math.round(o.percent),"%"]})]}),x&&h.jsx("span",{className:"text-xs text-destructive mr-4",children:x}),h.jsxs(Ot,{children:[h.jsx(Bt,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:u,children:c==="dark"?h.jsx(U2,{className:"h-4 w-4"}):h.jsx(_2,{className:"h-4 w-4"})})}),h.jsx(Ct,{children:"Toggle Theme"})]}),h.jsxs(Ot,{children:[h.jsx(Bt,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:()=>e?.(),children:h.jsx(GI,{className:"h-4 w-4"})})}),h.jsx(Ct,{children:"Keyboard Shortcuts (?)"})]})]})}function ho(e,t,n){let r=n.initialDeps??[],o,s=!0;function i(){var a,l,c;let u;n.key&&((a=n.debug)!=null&&a.call(n))&&(u=Date.now());const d=e();if(!(d.length!==r.length||d.some((p,x)=>r[x]!==p)))return o;r=d;let y;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(y=Date.now()),o=t(...d),n.key&&((c=n.debug)!=null&&c.call(n))){const p=Math.round((Date.now()-u)*100)/100,x=Math.round((Date.now()-y)*100)/100,b=x/16,m=(v,w)=>{for(v=String(v);v.length<w;)v=" "+v;return v};console.info(`%c⏱ ${m(x,5)} /${m(p,5)} ms`,`
|
|
457
|
+
font-size: .6rem;
|
|
458
|
+
font-weight: bold;
|
|
459
|
+
color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(s&&n.skipInitialOnChange)&&n.onChange(o),s=!1,o}return i.updateDeps=a=>{r=a},i}function Qm(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const ST=(e,t)=>Math.abs(e-t)<1.01,_T=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},Km=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},CT=e=>e,ET=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},IT=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=i=>{const{width:a,height:l}=i;t({width:Math.round(a),height:Math.round(l)})};if(o(Km(n)),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(i=>{const a=()=>{const l=i[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(Km(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},Zm={passive:!0},Jm=typeof window>"u"?!0:"onscrollend"in window,kT=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const s=e.options.useScrollendEvent&&Jm?()=>{}:_T(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),i=u=>()=>{const{horizontal:d,isRtl:f}=e.options;o=d?n.scrollLeft*(f&&-1||1):n.scrollTop,s(),t(o,u)},a=i(!0),l=i(!1);n.addEventListener("scroll",a,Zm);const c=e.options.useScrollendEvent&&Jm;return c&&n.addEventListener("scrollend",l,Zm),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},MT=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},PT=(e,{adjustments:t=0,behavior:n},r)=>{var o,s;const i=e+t;(s=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||s.call(o,{[r.options.horizontal?"left":"top"]:i,behavior:n})};class RT{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(s=>{const i=()=>{this._measureElement(s.target,s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var s;return(s=r())==null?void 0:s.observe(o,{box:"border-box"})},unobserve:o=>{var s;return(s=r())==null?void 0:s.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:CT,rangeExtractor:ET,onChange:()=>{},measureElement:MT,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=ho(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=s,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,s=new Map;for(let i=r-1;i>=0;i--){const a=n[i];if(o.has(a.lane))continue;const l=s.get(a.lane);if(l==null||a.end>l.end?s.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((i,a)=>i.end===a.end?i.index-a.index:i.end-a.end)[0]:void 0},this.getMeasurementOptions=ho(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,o,s,i,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:s,enabled:i,lanes:a}),{key:!1}),this.getMeasurements=ho(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:s,enabled:i,lanes:a},l)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const f of this.laneAssignments.keys())f>=n&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,c),d=new Array(a).fill(void 0);for(let f=0;f<c;f++){const y=u[f];y&&(d[y.lane]=f)}for(let f=c;f<n;f++){const y=s(f),p=this.laneAssignments.get(f);let x,b;if(p!==void 0&&this.options.lanes>1){x=p;const S=d[x],_=S!==void 0?u[S]:void 0;b=_?_.end+this.options.gap:r+o}else{const S=this.options.lanes===1?u[f-1]:this.getFurthestMeasurement(u,f);b=S?S.end+this.options.gap:r+o,x=S?S.lane:f%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(f,x)}const m=l.get(y),v=typeof m=="number"?m:this.options.estimateSize(f),w=b+v;u[f]={index:f,start:b,size:v,end:w,key:y,lane:x},d[x]=f}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ho(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,s)=>this.range=n.length>0&&r>0?TT({measurements:n,outerSize:r,scrollOffset:o,lanes:s}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ho(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,s,i)=>s===null||i===null?[]:n({startIndex:s,endIndex:i,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),s=this.measurementsCache[o];if(!s)return;const i=s.key,a=this.elementsCache.get(i);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(i,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const s=this.itemSizeCache.get(o.key)??o.size,i=r-s;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,i,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=ho(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let s=0,i=n.length;s<i;s++){const a=n[s],l=r[a];o.push(l)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Qm(r[ww(0,r.length-1,o=>Qm(r[o]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,o=0)=>{if(!this.scrollElement)return 0;const s=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=n>=i+s?"end":"start"),r==="center"?n+=(o-s)/2:r==="end"&&(n-=s);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const s=this.getSize(),i=this.getScrollOffset();if(r==="auto")if(o.end>=i+s-this.options.scrollPaddingEnd)r="end";else if(o.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1)),this.currentScrollToIndex=n;let s=0;const i=10,a=c=>{if(!this.targetWindow)return;const u=this.getOffsetForIndex(n,c);if(!u){console.warn("Failed to get offset for index:",n);return}const[d,f]=u;this._scrollToOffset(d,{adjustments:void 0,behavior:o}),this.targetWindow.requestAnimationFrame(()=>{const y=()=>{if(this.currentScrollToIndex!==n)return;const p=this.getScrollOffset(),x=this.getOffsetForIndex(n,f);if(!x){console.warn("Failed to get offset for index:",n);return}ST(x[0],p)||l(f)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(y):y()})},l=c=>{this.targetWindow&&this.currentScrollToIndex===n&&(s++,s<i?this.targetWindow.requestAnimationFrame(()=>a(c)):console.warn(`Failed to scroll to index ${n} after ${i} attempts.`))};a(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=r[r.length-1])==null?void 0:n.end)??0;else{const s=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&s.some(a=>a===null);){const a=r[i];s[a.lane]===null&&(s[a.lane]=a.end),i--}o=Math.max(...s.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const ww=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,s=n(o);if(s<r)e=o+1;else if(s>r)t=o-1;else return o}return e>0?e-1:0};function TT({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1,s=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:o};let i=ww(0,o,s,n),a=i;if(r===1)for(;a<o&&e[a].end<n+t;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<o&&l.some(u=>u<n+t);){const u=e[a];l[u.lane]=u.end,a++}const c=Array(r).fill(n+t);for(;i>=0&&c.some(u=>u>=n);){const u=e[i];c[u.lane]=u.start,i--}i=Math.max(0,i-i%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:i,endIndex:a}}const eg=typeof document<"u"?g.useLayoutEffect:g.useEffect;function NT({useFlushSync:e=!0,...t}){const n=g.useReducer(()=>({}),{})[1],r={...t,onChange:(s,i)=>{var a;e&&i?Ci.flushSync(n):n(),(a=t.onChange)==null||a.call(t,s,i)}},[o]=g.useState(()=>new RT(r));return o.setOptions(r),eg(()=>o._didMount(),[]),eg(()=>o._willUpdate()),o}function AT(e){return NT({observeElementRect:IT,observeElementOffset:kT,scrollToFn:PT,...e})}const bw=g.forwardRef(({className:e,type:t,leftIcon:n,...r},o)=>n?h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground",children:n}),h.jsx("input",{type:t,className:Ie("flex h-9 w-full rounded-md border border-input bg-transparent py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50","pl-8 pr-3",e),ref:o,...r})]}):h.jsx("input",{type:t,className:Ie("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));bw.displayName="Input";const tg={IfcProject:i2,IfcSite:w2,IfcBuilding:jf,IfcBuildingStorey:Dl,IfcSpace:ad,IfcWall:nm,IfcWallStandardCase:nm,IfcDoor:XI,default:ad};function ng(){const{ifcDataStore:e}=wr(),t=D(C=>C.selectedEntityId),n=D(C=>C.setSelectedEntityId),r=D(C=>C.selectedStorey),o=D(C=>C.setSelectedStorey),s=D(C=>C.hiddenEntities),i=D(C=>C.hideEntities),a=D(C=>C.showEntities),l=D(C=>C.toggleEntityVisibility),c=D(C=>C.isEntityVisible),[u,d]=g.useState(""),[f,y]=g.useState(new Set),p=g.useMemo(()=>e?.spatialHierarchy?e.spatialHierarchy.byStorey:new Map,[e]),x=g.useMemo(()=>{if(!e?.spatialHierarchy)return[];const C=e.spatialHierarchy,E=[];E.push({id:C.project.expressId,name:C.project.name||"Project",type:"IfcProject",depth:0,hasChildren:C.byStorey.size>0,isExpanded:!0,isVisible:!0});const M=Array.from(C.byStorey.entries()).map(([N,A])=>({id:N,name:e.entities.getName(N)||`Storey #${N}`,elevation:C.storeyElevations.get(N)??0,elements:A})).sort((N,A)=>A.elevation-N.elevation);for(const N of M){const A=f.has(N.id);if(E.push({id:N.id,name:N.name,type:"IfcBuildingStorey",depth:1,hasChildren:N.elements.length>0,isExpanded:A,isVisible:!0,elementCount:N.elements.length}),A&&N.elements.length>0)for(const j of N.elements){const L=e.entities.getTypeName(j)||"Unknown",F=e.entities.getName(j)||`${L} #${j}`;E.push({id:j,name:F,type:L,depth:2,hasChildren:!1,isExpanded:!1,isVisible:c(j)})}}return E},[e,f,c,s]),b=g.useMemo(()=>{if(!u.trim())return x;const C=u.toLowerCase();return x.filter(E=>E.name.toLowerCase().includes(C)||E.type.toLowerCase().includes(C))},[x,u]),m=g.useRef(null),v=AT({count:b.length,getScrollElement:()=>m.current,estimateSize:()=>36,overscan:10}),w=g.useCallback(C=>{y(E=>{const R=new Set(E);return R.has(C)?R.delete(C):R.add(C),R})},[]),S=g.useCallback(C=>{if(C.type==="IfcBuildingStorey"){const E=p.get(C.id)||[];if(E.length===0)return;E.every(M=>c(M))?i(E):a(E)}else l(C.id)},[p,c,i,a,l]),_=g.useCallback(C=>{const E=p.get(C)||[];return E.length===0?!0:E.every(R=>c(R))},[p,c]),I=g.useCallback(C=>{C.type==="IfcBuildingStorey"?o(r===C.id?null:C.id):n(C.id)},[r,o,n]);return e?h.jsxs("div",{className:"h-full flex flex-col border-r bg-card",children:[h.jsxs("div",{className:"p-3 border-b space-y-2",children:[h.jsx("h2",{className:"font-semibold text-sm",children:"Model Hierarchy"}),h.jsx(bw,{placeholder:"Search elements...",value:u,onChange:C=>d(C.target.value),leftIcon:h.jsx(z2,{className:"h-4 w-4"}),className:"h-8 text-sm"})]}),h.jsx("div",{ref:m,className:"flex-1 overflow-auto scrollbar-thin",children:h.jsx("div",{style:{height:`${v.getTotalSize()}px`,width:"100%",position:"relative"},children:v.getVirtualItems().map(C=>{const E=b[C.index],R=tg[E.type]||tg.default,M=E.type==="IfcBuildingStorey"?r===E.id:t===E.id,N=E.type==="IfcBuildingStorey"?_(E.id):c(E.id),A=!N;return h.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:`${C.size}px`,transform:`translateY(${C.start}px)`},children:h.jsxs("div",{className:Ie("flex items-center gap-1 px-2 py-1.5 cursor-pointer hover:bg-muted/50 border-l-2 border-transparent transition-colors group",M&&"bg-primary/10 border-l-primary",A&&"opacity-50"),style:{paddingLeft:`${E.depth*16+8}px`},onClick:j=>{j.target.closest("button")===null&&I(E)},onMouseDown:j=>{j.target.closest("button")===null&&j.preventDefault()},children:[E.hasChildren?h.jsx("button",{onClick:j=>{j.stopPropagation(),w(E.id)},className:"p-0.5 hover:bg-muted rounded",children:h.jsx(Av,{className:Ie("h-3.5 w-3.5 transition-transform",E.isExpanded&&"rotate-90")})}):h.jsx("div",{className:"w-4.5"}),h.jsx("button",{onClick:j=>{j.stopPropagation(),S(E)},className:Ie("p-0.5 rounded opacity-0 group-hover:opacity-100 transition-opacity",A&&"opacity-100"),children:N?h.jsx(Bl,{className:"h-3 w-3 text-muted-foreground"}):h.jsx(Ol,{className:"h-3 w-3 text-muted-foreground"})}),h.jsx(R,{className:"h-4 w-4 text-muted-foreground shrink-0"}),h.jsx("span",{className:Ie("flex-1 text-sm truncate",A&&"line-through"),children:E.name}),E.elementCount!==void 0&&h.jsx("span",{className:"text-xs text-muted-foreground",children:E.elementCount})]})},E.id)})})}),r&&h.jsx("div",{className:"p-2 border-t bg-primary/5",children:h.jsxs("div",{className:"flex items-center justify-between text-xs",children:[h.jsx("span",{className:"text-muted-foreground",children:"Filtered to storey"}),h.jsx(Te,{variant:"ghost",size:"sm",className:"h-6 text-xs",onClick:()=>o(null),children:"Clear filter"})]})})]}):h.jsxs("div",{className:"h-full flex flex-col border-r bg-card",children:[h.jsx("div",{className:"p-3 border-b",children:h.jsx("h2",{className:"font-semibold text-sm",children:"Model Hierarchy"})}),h.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:"Load an IFC file to view hierarchy"})]})}var Xl="Tabs",[zT]=Un(Xl,[Vl]),Sw=Vl(),[FT,Kf]=zT(Xl),_w=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=$l(a),[d,f]=ki({prop:r,onChange:o,defaultProp:s??"",caller:Xl});return h.jsx(FT,{scope:n,baseId:Wo(),value:d,onValueChange:f,orientation:i,dir:u,activationMode:l,children:h.jsx(be.div,{dir:u,"data-orientation":i,...c,ref:t})})});_w.displayName=Xl;var Cw="TabsList",Ew=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=Kf(Cw,n),i=Sw(n);return h.jsx(Qv,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:h.jsx(be.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Ew.displayName=Cw;var Iw="TabsTrigger",kw=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=Kf(Iw,n),a=Sw(n),l=Rw(i.baseId,r),c=Tw(i.baseId,r),u=r===i.value;return h.jsx(Kv,{asChild:!0,...a,focusable:!o,active:u,children:h.jsx(be.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...s,ref:t,onMouseDown:te(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?i.onValueChange(r):d.preventDefault()}),onKeyDown:te(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(r)}),onFocus:te(e.onFocus,()=>{const d=i.activationMode!=="manual";!u&&!o&&d&&i.onValueChange(r)})})})});kw.displayName=Iw;var Mw="TabsContent",Pw=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=Kf(Mw,n),l=Rw(a.baseId,r),c=Tw(a.baseId,r),u=r===a.value,d=g.useRef(u);return g.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),h.jsx(At,{present:o||u,children:({present:f})=>h.jsx(be.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&s})})});Pw.displayName=Mw;function Rw(e,t){return`${e}-trigger-${t}`}function Tw(e,t){return`${e}-content-${t}`}var jT=_w,Nw=Ew,Aw=kw,zw=Pw;const LT=jT,Fw=g.forwardRef(({className:e,...t},n)=>h.jsx(Nw,{ref:n,className:Ie("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Fw.displayName=Nw.displayName;const wd=g.forwardRef(({className:e,...t},n)=>h.jsx(Aw,{ref:n,className:Ie("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));wd.displayName=Aw.displayName;const bd=g.forwardRef(({className:e,...t},n)=>h.jsx(zw,{ref:n,className:Ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));bd.displayName=zw.displayName;function OT(e,[t,n]){return Math.min(n,Math.max(t,e))}function BT(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var Zf="ScrollArea",[jw]=Un(Zf),[DT,qt]=jw(Zf),Lw=g.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[a,l]=g.useState(null),[c,u]=g.useState(null),[d,f]=g.useState(null),[y,p]=g.useState(null),[x,b]=g.useState(null),[m,v]=g.useState(0),[w,S]=g.useState(0),[_,I]=g.useState(!1),[C,E]=g.useState(!1),R=je(t,N=>l(N)),M=$l(o);return h.jsx(DT,{scope:n,type:r,dir:M,scrollHideDelay:s,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:y,onScrollbarXChange:p,scrollbarXEnabled:_,onScrollbarXEnabledChange:I,scrollbarY:x,onScrollbarYChange:b,scrollbarYEnabled:C,onScrollbarYEnabledChange:E,onCornerWidthChange:v,onCornerHeightChange:S,children:h.jsx(be.div,{dir:M,...i,ref:R,style:{position:"relative","--radix-scroll-area-corner-width":m+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});Lw.displayName=Zf;var Ow="ScrollAreaViewport",Bw=g.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...s}=e,i=qt(Ow,n),a=g.useRef(null),l=je(t,a,i.onViewportChange);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),h.jsx(be.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:h.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Bw.displayName=Ow;var _n="ScrollAreaScrollbar",Jf=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=qt(_n,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,a=e.orientation==="horizontal";return g.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),o.type==="hover"?h.jsx(UT,{...r,ref:t,forceMount:n}):o.type==="scroll"?h.jsx($T,{...r,ref:t,forceMount:n}):o.type==="auto"?h.jsx(Dw,{...r,ref:t,forceMount:n}):o.type==="always"?h.jsx(eh,{...r,ref:t}):null});Jf.displayName=_n;var UT=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=qt(_n,e.__scopeScrollArea),[s,i]=g.useState(!1);return g.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),i(!0)},u=()=>{l=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),h.jsx(At,{present:n||s,children:h.jsx(Dw,{"data-state":s?"visible":"hidden",...r,ref:t})})}),$T=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=qt(_n,e.__scopeScrollArea),s=e.orientation==="horizontal",i=Kl(()=>l("SCROLL_END"),100),[a,l]=BT("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return g.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),g.useEffect(()=>{const c=o.viewport,u=s?"scrollLeft":"scrollTop";if(c){let d=c[u];const f=()=>{const y=c[u];d!==y&&(l("SCROLL"),i()),d=y};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,s,l,i]),h.jsx(At,{present:n||a!=="hidden",children:h.jsx(eh,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:te(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:te(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Dw=g.forwardRef((e,t)=>{const n=qt(_n,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=g.useState(!1),a=e.orientation==="horizontal",l=Kl(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;i(a?c:u)}},10);return Ko(n.viewport,l),Ko(n.content,l),h.jsx(At,{present:r||s,children:h.jsx(eh,{"data-state":s?"visible":"hidden",...o,ref:t})})}),eh=g.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=qt(_n,e.__scopeScrollArea),s=g.useRef(null),i=g.useRef(0),[a,l]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=Ww(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>s.current=f,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:f=>i.current=f};function d(f,y){return qT(f,i.current,a,y)}return n==="horizontal"?h.jsx(VT,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const f=o.viewport.scrollLeft,y=rg(f,a,o.dir);s.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}}):n==="vertical"?h.jsx(GT,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const f=o.viewport.scrollTop,y=rg(f,a);s.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),VT=g.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=qt(_n,e.__scopeScrollArea),[i,a]=g.useState(),l=g.useRef(null),c=je(t,l,s.onScrollbarXChange);return g.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.jsx($w,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ql(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(s.viewport){const f=s.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),Yw(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:pl(i.paddingLeft),paddingEnd:pl(i.paddingRight)}})}})}),GT=g.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=qt(_n,e.__scopeScrollArea),[i,a]=g.useState(),l=g.useRef(null),c=je(t,l,s.onScrollbarYChange);return g.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.jsx($w,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ql(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(s.viewport){const f=s.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),Yw(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:pl(i.paddingTop),paddingEnd:pl(i.paddingBottom)}})}})}),[WT,Uw]=jw(_n),$w=g.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,y=qt(_n,n),[p,x]=g.useState(null),b=je(t,R=>x(R)),m=g.useRef(null),v=g.useRef(""),w=y.viewport,S=r.content-r.viewport,_=nt(u),I=nt(l),C=Kl(d,10);function E(R){if(m.current){const M=R.clientX-m.current.left,N=R.clientY-m.current.top;c({x:M,y:N})}}return g.useEffect(()=>{const R=M=>{const N=M.target;p?.contains(N)&&_(M,S)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[w,p,S,_]),g.useEffect(I,[r,I]),Ko(p,C),Ko(y.content,C),h.jsx(WT,{scope:n,scrollbar:p,hasThumb:o,onThumbChange:nt(s),onThumbPointerUp:nt(i),onThumbPositionChange:I,onThumbPointerDown:nt(a),children:h.jsx(be.div,{...f,ref:b,style:{position:"absolute",...f.style},onPointerDown:te(e.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),m.current=p.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),E(R))}),onPointerMove:te(e.onPointerMove,E),onPointerUp:te(e.onPointerUp,R=>{const M=R.target;M.hasPointerCapture(R.pointerId)&&M.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=v.current,y.viewport&&(y.viewport.style.scrollBehavior=""),m.current=null})})})}),hl="ScrollAreaThumb",Vw=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Uw(hl,e.__scopeScrollArea);return h.jsx(At,{present:n||o.hasThumb,children:h.jsx(HT,{ref:t,...r})})}),HT=g.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=qt(hl,n),i=Uw(hl,n),{onThumbPositionChange:a}=i,l=je(t,d=>i.onThumbChange(d)),c=g.useRef(void 0),u=Kl(()=>{c.current&&(c.current(),c.current=void 0)},100);return g.useEffect(()=>{const d=s.viewport;if(d){const f=()=>{if(u(),!c.current){const y=XT(d,a);c.current=y,a()}};return a(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[s.viewport,u,a]),h.jsx(be.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:te(e.onPointerDownCapture,d=>{const y=d.target.getBoundingClientRect(),p=d.clientX-y.left,x=d.clientY-y.top;i.onThumbPointerDown({x:p,y:x})}),onPointerUp:te(e.onPointerUp,i.onThumbPointerUp)})});Vw.displayName=hl;var th="ScrollAreaCorner",Gw=g.forwardRef((e,t)=>{const n=qt(th,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?h.jsx(YT,{...e,ref:t}):null});Gw.displayName=th;var YT=g.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=qt(th,n),[s,i]=g.useState(0),[a,l]=g.useState(0),c=!!(s&&a);return Ko(o.scrollbarX,()=>{const u=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(u),l(u)}),Ko(o.scrollbarY,()=>{const u=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(u),i(u)}),c?h.jsx(be.div,{...r,ref:t,style:{width:s,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function pl(e){return e?parseInt(e,10):0}function Ww(e,t){const n=e/t;return isNaN(n)?0:n}function Ql(e){const t=Ww(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function qT(e,t,n,r="ltr"){const o=Ql(n),s=o/2,i=t||s,a=o-i,l=n.scrollbar.paddingStart+i,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return Hw([l,c],d)(e)}function rg(e,t,n="ltr"){const r=Ql(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,a=s-r,l=n==="ltr"?[0,i]:[i*-1,0],c=OT(e,l);return Hw([0,i],[0,a])(c)}function Hw(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Yw(e,t){return e>0&&e<t}var XT=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,a=n.top!==s.top;(i||a)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Kl(e,t){const n=nt(e),r=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),g.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ko(e,t){const n=nt(t);wn(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var qw=Lw,QT=Bw,KT=Gw;const Xw=g.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(qw,{ref:r,className:Ie("relative overflow-hidden",e),...n,children:[h.jsx(QT,{className:"h-full w-full rounded-[inherit]",children:t}),h.jsx(Qw,{}),h.jsx(KT,{})]}));Xw.displayName=qw.displayName;const Qw=g.forwardRef(({className:e,orientation:t="vertical",...n},r)=>h.jsx(Jf,{ref:r,orientation:t,className:Ie("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:h.jsx(Vw,{className:"relative flex-1 rounded-full bg-border"})}));Qw.displayName=Jf.displayName;var Zl="Collapsible",[ZT]=Un(Zl),[JT,nh]=ZT(Zl),Kw=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:i,...a}=e,[l,c]=ki({prop:r,defaultProp:o??!1,onChange:i,caller:Zl});return h.jsx(JT,{scope:n,disabled:s,contentId:Wo(),open:l,onOpenToggle:g.useCallback(()=>c(u=>!u),[c]),children:h.jsx(be.div,{"data-state":oh(l),"data-disabled":s?"":void 0,...a,ref:t})})});Kw.displayName=Zl;var Zw="CollapsibleTrigger",Jw=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=nh(Zw,n);return h.jsx(be.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":oh(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:te(e.onClick,o.onOpenToggle)})});Jw.displayName=Zw;var rh="CollapsibleContent",e1=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=nh(rh,e.__scopeCollapsible);return h.jsx(At,{present:n||o.open,children:({present:s})=>h.jsx(eN,{...r,ref:t,present:s})})});e1.displayName=rh;var eN=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,i=nh(rh,n),[a,l]=g.useState(r),c=g.useRef(null),u=je(t,c),d=g.useRef(0),f=d.current,y=g.useRef(0),p=y.current,x=i.open||a,b=g.useRef(x),m=g.useRef(void 0);return g.useEffect(()=>{const v=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(v)},[]),wn(()=>{const v=c.current;if(v){m.current=m.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();d.current=w.height,y.current=w.width,b.current||(v.style.transitionDuration=m.current.transitionDuration,v.style.animationName=m.current.animationName),l(r)}},[i.open,r]),h.jsx(be.div,{"data-state":oh(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!x,...s,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style},children:x&&o})});function oh(e){return e?"open":"closed"}var tN=Kw;const t1=tN,n1=Jw,r1=e1;function og(){const e=D(p=>p.selectedEntityId),t=D(p=>p.cameraCallbacks),n=D(p=>p.toggleEntityVisibility),r=D(p=>p.isEntityVisible),{query:o,ifcDataStore:s}=wr(),i=g.useMemo(()=>{if(!e||!s?.spatialHierarchy)return null;const p=s.spatialHierarchy;let x=null;for(const[b,m]of p.byStorey)if(m.includes(e)){x=b;break}return x?{storeyId:x,storeyName:s.entities.getName(x)||`Storey #${x}`,elevation:p.storeyElevations.get(x)}:null},[e,s]),a=g.useMemo(()=>!e||!s?.quantities?[]:s.quantities.getForEntity(e),[e,s]);if(!e||!o)return h.jsxs("div",{className:"h-full flex flex-col border-l bg-card",children:[h.jsx("div",{className:"p-3 border-b",children:h.jsx("h2",{className:"font-semibold text-sm",children:"Properties"})}),h.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm p-4 text-center",children:"Select an object to view properties"})]});const l=o.entity(e),c=l.properties(),u=l.type,d=l.name,f=l.globalId,y=p=>{navigator.clipboard.writeText(p)};return h.jsxs("div",{className:"h-full flex flex-col border-l bg-card",children:[h.jsxs("div",{className:"p-3 border-b space-y-2",children:[h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx("div",{className:"p-2 rounded-lg bg-primary/10 shrink-0",children:h.jsx(jf,{className:"h-5 w-5 text-primary"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("h3",{className:"font-semibold text-sm truncate",children:d||`${u}`}),h.jsx("p",{className:"text-xs text-muted-foreground",children:u})]}),h.jsxs("div",{className:"flex gap-1 shrink-0",children:[h.jsxs(Ot,{children:[h.jsx(Bt,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-xs",onClick:()=>{e&&t.frameSelection&&t.frameSelection()},children:h.jsx(al,{className:"h-3.5 w-3.5"})})}),h.jsx(Ct,{children:"Zoom to"})]}),h.jsxs(Ot,{children:[h.jsx(Bt,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-xs",onClick:()=>{e&&n(e)},children:e&&r(e)?h.jsx(Ol,{className:"h-3.5 w-3.5"}):h.jsx(Bl,{className:"h-3.5 w-3.5"})})}),h.jsx(Ct,{children:e&&r(e)?"Hide":"Show"})]})]})]}),f&&h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 text-xs bg-muted px-2 py-1 rounded truncate font-mono",children:f}),h.jsx(Te,{variant:"ghost",size:"icon-xs",onClick:()=>y(f),children:h.jsx(zv,{className:"h-3 w-3"})})]}),i&&h.jsxs("div",{className:"flex items-center gap-2 text-xs bg-emerald-500/10 text-emerald-700 dark:text-emerald-400 px-2 py-1.5 rounded",children:[h.jsx(Dl,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"font-medium",children:i.storeyName}),i.elevation!==void 0&&h.jsxs("span",{className:"text-emerald-600/70 dark:text-emerald-400/70",children:["(",i.elevation.toFixed(2),"m)"]})]})]}),h.jsxs(LT,{defaultValue:"properties",className:"flex-1 flex flex-col overflow-hidden",children:[h.jsxs(Fw,{className:"w-full justify-start rounded-none border-b bg-transparent h-9 p-0",children:[h.jsxs(wd,{value:"properties",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",children:[h.jsx(r2,{className:"h-3.5 w-3.5 mr-1.5"}),"Properties"]}),h.jsxs(wd,{value:"quantities",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",children:[h.jsx(AI,{className:"h-3.5 w-3.5 mr-1.5"}),"Quantities"]})]}),h.jsxs(Xw,{className:"flex-1",children:[h.jsx(bd,{value:"properties",className:"m-0 p-3",children:c.length===0?h.jsx("p",{className:"text-sm text-muted-foreground",children:"No property sets"}):h.jsx("div",{className:"space-y-2",children:c.map(p=>h.jsx(nN,{pset:p},p.name))})}),h.jsx(bd,{value:"quantities",className:"m-0 p-3",children:a.length===0?h.jsx("p",{className:"text-sm text-muted-foreground",children:"No quantities"}):h.jsx("div",{className:"space-y-2",children:a.map(p=>h.jsx(rN,{qset:p},p.name))})})]})]})]})}function nN({pset:e}){return h.jsxs(t1,{defaultOpen:!0,className:"border rounded-lg",children:[h.jsxs(n1,{className:"flex items-center justify-between w-full p-2.5 hover:bg-muted/50 rounded-t-lg text-left",children:[h.jsx("span",{className:"font-medium text-sm",children:e.name}),h.jsx("span",{className:"text-xs text-muted-foreground",children:e.properties.length})]}),h.jsxs(r1,{children:[h.jsx(tn,{}),h.jsx("div",{className:"divide-y",children:e.properties.map(t=>h.jsxs("div",{className:"flex justify-between gap-2 px-2.5 py-1.5 text-sm",children:[h.jsx("span",{className:"text-muted-foreground truncate",children:t.name}),h.jsx("span",{className:"text-right truncate font-medium",children:t.value!==null&&t.value!==void 0?String(t.value):"—"})]},t.name))})]})]})}function rN({qset:e}){const t=(n,r)=>{const o=n.toLocaleString(void 0,{maximumFractionDigits:3});switch(r){case 0:return`${o} m`;case 1:return`${o} m²`;case 2:return`${o} m³`;case 3:return o;case 4:return`${o} kg`;case 5:return`${o} s`;default:return o}};return h.jsxs(t1,{defaultOpen:!0,className:"border rounded-lg border-blue-200 dark:border-blue-900",children:[h.jsxs(n1,{className:"flex items-center justify-between w-full p-2.5 hover:bg-blue-50 dark:hover:bg-blue-950/50 rounded-t-lg text-left",children:[h.jsx("span",{className:"font-medium text-sm text-blue-700 dark:text-blue-400",children:e.name}),h.jsx("span",{className:"text-xs text-blue-500/70",children:e.quantities.length})]}),h.jsxs(r1,{children:[h.jsx(tn,{className:"bg-blue-200 dark:bg-blue-900"}),h.jsx("div",{className:"divide-y divide-blue-100 dark:divide-blue-900/50",children:e.quantities.map(n=>h.jsxs("div",{className:"flex justify-between gap-2 px-2.5 py-1.5 text-sm",children:[h.jsx("span",{className:"text-muted-foreground truncate",children:n.name}),h.jsx("span",{className:"text-right font-mono text-blue-700 dark:text-blue-400",children:t(n.value,n.type)})]},n.name))})]})]})}function oN(){const{loading:e,geometryResult:t,ifcDataStore:n}=wr(),r=D(p=>p.progress),o=D(p=>p.error),s=D(p=>p.selectedStorey),[i,a]=g.useState(60),[l,c]=g.useState(0),[u,d]=g.useState(null);g.useEffect(()=>{d("gpu"in navigator)},[]),g.useEffect(()=>{let p=0,x=performance.now(),b;const m=()=>{p++;const v=performance.now();v-x>=1e3&&(a(p),p=0,x=v),b=requestAnimationFrame(m)};return b=requestAnimationFrame(m),()=>cancelAnimationFrame(b)},[]),g.useEffect(()=>{const p=()=>{performance.memory&&c(performance.memory.usedJSHeapSize)};p();const x=setInterval(p,2e3);return()=>clearInterval(x)},[]);const f=g.useMemo(()=>t?{elements:t.meshes?.length??0,triangles:t.totalTriangles??0}:{elements:0,triangles:0},[t]),y=g.useMemo(()=>!s||!n?.spatialHierarchy?f.elements:n.spatialHierarchy.byStorey.get(s)?.length??f.elements,[s,n,f.elements]);return h.jsxs("div",{className:"h-7 px-3 border-t bg-muted/30 flex items-center justify-between text-xs text-muted-foreground",children:[h.jsx("div",{className:"flex items-center gap-3",children:e?h.jsx("span",{className:"text-primary",children:r?.phase||"Loading..."}):o?h.jsx("span",{className:"text-destructive",children:o}):h.jsx("span",{children:"Ready"})}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(RI,{className:"h-3.5 w-3.5"}),h.jsxs("span",{children:[Bc(y),s&&f.elements!==y&&h.jsxs("span",{className:"opacity-60",children:[" / ",Bc(f.elements)]})," ","elements"]})]}),h.jsx(tn,{orientation:"vertical",className:"h-3.5"}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(W2,{className:"h-3.5 w-3.5"}),h.jsxs("span",{children:[Bc(f.triangles)," tris"]})]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("span",{className:i<30?"text-destructive":i<50?"text-yellow-500":"",children:[i," FPS"]}),l>0&&h.jsxs(h.Fragment,{children:[h.jsx(tn,{orientation:"vertical",className:"h-3.5"}),h.jsx("span",{children:mI(l)})]}),h.jsx(tn,{orientation:"vertical",className:"h-3.5"}),h.jsxs("div",{className:"flex items-center gap-1",children:[u?h.jsx($I,{className:"h-3.5 w-3.5 text-green-500"}):h.jsx(DI,{className:"h-3.5 w-3.5 text-yellow-500"}),h.jsx("span",{children:u?"WebGPU":"WebGL"})]})]})]})}class sN{adapter=null;device=null;context=null;format="bgra8unorm";canvas=null;lastWidth=0;lastHeight=0;contextConfigured=!1;frameCount=0;async init(t){if(!navigator.gpu)throw new Error("WebGPU not available");if(this.adapter=await navigator.gpu.requestAdapter(),!this.adapter)throw new Error("Failed to get GPU adapter");if(this.device=await this.adapter.requestDevice(),this.format=navigator.gpu.getPreferredCanvasFormat(),this.canvas=t,this.context=t.getContext("webgpu"),!this.context)throw new Error("Failed to get WebGPU context");const n=this.device;n.lost&&n.lost.then(r=>{console.warn("[WebGPU] Device lost:",r.message),this.contextConfigured=!1}),this.configureContext()}configureContext(){if(!(!this.context||!this.device||!this.canvas)){this.lastWidth=this.canvas.width,this.lastHeight=this.canvas.height;try{this.context.configure({device:this.device,format:this.format,usage:GPUTextureUsage.RENDER_ATTACHMENT,alphaMode:"premultiplied"}),this.contextConfigured=!0}catch(t){console.warn("[WebGPU] Failed to configure context:",t),this.contextConfigured=!1}}}needsReconfigure(){return this.canvas?this.contextConfigured?this.canvas.width!==this.lastWidth||this.canvas.height!==this.lastHeight:!0:!1}invalidateContext(){this.contextConfigured=!1}ensureContext(){return!this.context||!this.device||!this.canvas?!1:(this.needsReconfigure()&&this.configureContext(),this.contextConfigured)}getCurrentTexture(){if(!this.context||!this.contextConfigured)return null;try{const t=this.context.getCurrentTexture();return this.frameCount++,t}catch{return this.contextConfigured=!1,null}}getDevice(){if(!this.device)throw new Error("Device not initialized");return this.device}getContext(){if(!this.context)throw new Error("Context not initialized");return this.context}getFormat(){return this.format}isInitialized(){return this.device!==null&&this.context!==null}}class iN{device;pipeline;selectionPipeline;depthTexture;depthTextureView;uniformBuffer;bindGroup;bindGroupLayout;currentWidth;currentHeight;constructor(t,n=1,r=1){this.currentWidth=n,this.currentHeight=r,this.device=t.getDevice();const o=t.getFormat();this.depthTexture=this.device.createTexture({size:{width:n,height:r},format:"depth24plus",usage:GPUTextureUsage.RENDER_ATTACHMENT}),this.depthTextureView=this.depthTexture.createView(),this.uniformBuffer=this.device.createBuffer({size:192,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.bindGroupLayout=this.device.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,buffer:{type:"uniform"}}]});const s=this.device.createShaderModule({code:`
|
|
460
|
+
struct Uniforms {
|
|
461
|
+
viewProj: mat4x4<f32>,
|
|
462
|
+
model: mat4x4<f32>,
|
|
463
|
+
baseColor: vec4<f32>,
|
|
464
|
+
metallicRoughness: vec2<f32>, // x = metallic, y = roughness
|
|
465
|
+
_padding1: vec2<f32>,
|
|
466
|
+
sectionPlane: vec4<f32>, // xyz = plane normal, w = plane distance
|
|
467
|
+
flags: vec4<u32>, // x = isSelected, y = sectionEnabled, z,w = reserved
|
|
468
|
+
}
|
|
469
|
+
@binding(0) @group(0) var<uniform> uniforms: Uniforms;
|
|
470
|
+
|
|
471
|
+
struct VertexInput {
|
|
472
|
+
@location(0) position: vec3<f32>,
|
|
473
|
+
@location(1) normal: vec3<f32>,
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
struct VertexOutput {
|
|
477
|
+
@builtin(position) position: vec4<f32>,
|
|
478
|
+
@location(0) worldPos: vec3<f32>,
|
|
479
|
+
@location(1) normal: vec3<f32>,
|
|
480
|
+
@location(2) @interpolate(flat) objectId: u32,
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
@vertex
|
|
484
|
+
fn vs_main(input: VertexInput, @builtin(instance_index) instanceIndex: u32) -> VertexOutput {
|
|
485
|
+
var output: VertexOutput;
|
|
486
|
+
let worldPos = uniforms.model * vec4<f32>(input.position, 1.0);
|
|
487
|
+
output.position = uniforms.viewProj * worldPos;
|
|
488
|
+
output.worldPos = worldPos.xyz;
|
|
489
|
+
output.normal = normalize((uniforms.model * vec4<f32>(input.normal, 0.0)).xyz);
|
|
490
|
+
output.objectId = instanceIndex;
|
|
491
|
+
return output;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// PBR helper functions
|
|
495
|
+
fn fresnelSchlick(cosTheta: f32, F0: vec3<f32>) -> vec3<f32> {
|
|
496
|
+
return F0 + (1.0 - F0) * pow(clamp(1.0 - cosTheta, 0.0, 1.0), 5.0);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
fn distributionGGX(NdotH: f32, roughness: f32) -> f32 {
|
|
500
|
+
let a = roughness * roughness;
|
|
501
|
+
let a2 = a * a;
|
|
502
|
+
let NdotH2 = NdotH * NdotH;
|
|
503
|
+
let num = a2;
|
|
504
|
+
let denomBase = (NdotH2 * (a2 - 1.0) + 1.0);
|
|
505
|
+
let denom = 3.14159265 * denomBase * denomBase;
|
|
506
|
+
return num / max(denom, 0.0000001);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
fn geometrySchlickGGX(NdotV: f32, roughness: f32) -> f32 {
|
|
510
|
+
let r = (roughness + 1.0);
|
|
511
|
+
let k = (r * r) / 8.0;
|
|
512
|
+
let num = NdotV;
|
|
513
|
+
let denom = NdotV * (1.0 - k) + k;
|
|
514
|
+
return num / max(denom, 0.0000001);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
fn geometrySmith(NdotV: f32, NdotL: f32, roughness: f32) -> f32 {
|
|
518
|
+
let ggx2 = geometrySchlickGGX(NdotV, roughness);
|
|
519
|
+
let ggx1 = geometrySchlickGGX(NdotL, roughness);
|
|
520
|
+
return ggx1 * ggx2;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
@fragment
|
|
524
|
+
fn fs_main(input: VertexOutput) -> @location(0) vec4<f32> {
|
|
525
|
+
// Section plane clipping
|
|
526
|
+
if (uniforms.flags.y == 1u) {
|
|
527
|
+
let planeNormal = uniforms.sectionPlane.xyz;
|
|
528
|
+
let planeDistance = uniforms.sectionPlane.w;
|
|
529
|
+
let distToPlane = dot(input.worldPos, planeNormal) - planeDistance;
|
|
530
|
+
if (distToPlane > 0.0) {
|
|
531
|
+
discard;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
let N = normalize(input.normal);
|
|
536
|
+
let L = normalize(vec3<f32>(0.5, 1.0, 0.3)); // Light direction
|
|
537
|
+
|
|
538
|
+
let NdotL = max(dot(N, L), 0.0);
|
|
539
|
+
|
|
540
|
+
var baseColor = uniforms.baseColor.rgb;
|
|
541
|
+
|
|
542
|
+
// Simple diffuse lighting with ambient
|
|
543
|
+
let ambient = 0.3;
|
|
544
|
+
let diffuse = NdotL * 0.7;
|
|
545
|
+
|
|
546
|
+
var color = baseColor * (ambient + diffuse);
|
|
547
|
+
|
|
548
|
+
// Selection highlight - add glow/fresnel effect
|
|
549
|
+
if (uniforms.flags.x == 1u) {
|
|
550
|
+
// Calculate view direction for fresnel effect
|
|
551
|
+
let V = normalize(-input.worldPos); // Assuming camera at origin (simplified)
|
|
552
|
+
let NdotV = max(dot(N, V), 0.0);
|
|
553
|
+
|
|
554
|
+
// Fresnel-like edge highlight for selection
|
|
555
|
+
let fresnel = pow(1.0 - NdotV, 2.0);
|
|
556
|
+
let highlightColor = vec3<f32>(0.3, 0.6, 1.0); // Blue highlight
|
|
557
|
+
color = mix(color, highlightColor, fresnel * 0.5 + 0.2);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// Gamma correction (IFC colors are typically in sRGB)
|
|
561
|
+
color = pow(color, vec3<f32>(1.0 / 2.2));
|
|
562
|
+
|
|
563
|
+
return vec4<f32>(color, uniforms.baseColor.a);
|
|
564
|
+
}
|
|
565
|
+
`}),i=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});this.pipeline=this.device.createRenderPipeline({layout:i,vertex:{module:s,entryPoint:"vs_main",buffers:[{arrayStride:24,attributes:[{shaderLocation:0,offset:0,format:"float32x3"},{shaderLocation:1,offset:12,format:"float32x3"}]}]},fragment:{module:s,entryPoint:"fs_main",targets:[{format:o}]},primitive:{topology:"triangle-list",cullMode:"none"},depthStencil:{format:"depth24plus",depthWriteEnabled:!0,depthCompare:"less"}}),this.selectionPipeline=this.device.createRenderPipeline({layout:i,vertex:{module:s,entryPoint:"vs_main",buffers:[{arrayStride:24,attributes:[{shaderLocation:0,offset:0,format:"float32x3"},{shaderLocation:1,offset:12,format:"float32x3"}]}]},fragment:{module:s,entryPoint:"fs_main",targets:[{format:o}]},primitive:{topology:"triangle-list",cullMode:"none"},depthStencil:{format:"depth24plus",depthWriteEnabled:!0,depthCompare:"less-equal",depthBias:-1,depthBiasSlopeScale:-1}}),this.bindGroup=this.device.createBindGroup({layout:this.bindGroupLayout,entries:[{binding:0,resource:{buffer:this.uniformBuffer}}]})}updateUniforms(t,n,r,o,s,i){const a=new Float32Array(48),l=new Uint32Array(a.buffer,176,4);a.set(t,0),a.set(n,16),r?a.set(r,32):a.set([1,1,1,1],32);const c=o?.metallic??0,u=o?.roughness??.6;a[36]=c,a[37]=u,s&&(a[40]=s.normal[0],a[41]=s.normal[1],a[42]=s.normal[2],a[43]=s.distance),l[0]=i?1:0,l[1]=s?.enabled?1:0,l[2]=0,l[3]=0,this.device.queue.writeBuffer(this.uniformBuffer,0,a)}needsResize(t,n){return this.currentWidth!==t||this.currentHeight!==n}resize(t,n){t<=0||n<=0||(this.currentWidth=t,this.currentHeight=n,this.depthTexture.destroy(),this.depthTexture=this.device.createTexture({size:{width:t,height:n},format:"depth24plus",usage:GPUTextureUsage.RENDER_ATTACHMENT}),this.depthTextureView=this.depthTexture.createView())}getPipeline(){return this.pipeline}getSelectionPipeline(){return this.selectionPipeline}getDepthTextureView(){return this.depthTextureView}getBindGroup(){return this.bindGroup}getBindGroupLayout(){return this.bindGroupLayout}getUniformBufferSize(){return 192}}class aN{device;pipeline;depthTexture;depthTextureView;uniformBuffer;currentHeight;constructor(t,n=1,r=1){this.currentHeight=r,this.device=t.getDevice();const o=t.getFormat();this.depthTexture=this.device.createTexture({size:{width:n,height:r},format:"depth24plus",usage:GPUTextureUsage.RENDER_ATTACHMENT}),this.depthTextureView=this.depthTexture.createView(),this.uniformBuffer=this.device.createBuffer({size:96,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});const s=this.device.createShaderModule({code:`
|
|
566
|
+
// Instance data structure: transform (16 floats) + color (4 floats) = 20 floats = 80 bytes
|
|
567
|
+
struct Instance {
|
|
568
|
+
transform: mat4x4<f32>,
|
|
569
|
+
color: vec4<f32>,
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
struct Uniforms {
|
|
573
|
+
viewProj: mat4x4<f32>,
|
|
574
|
+
sectionPlane: vec4<f32>, // xyz = plane normal, w = plane distance
|
|
575
|
+
flags: vec4<u32>, // x = sectionEnabled, y,z,w = reserved
|
|
576
|
+
}
|
|
577
|
+
@binding(0) @group(0) var<uniform> uniforms: Uniforms;
|
|
578
|
+
@binding(1) @group(0) var<storage, read> instances: array<Instance>;
|
|
579
|
+
|
|
580
|
+
struct VertexInput {
|
|
581
|
+
@location(0) position: vec3<f32>,
|
|
582
|
+
@location(1) normal: vec3<f32>,
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
struct VertexOutput {
|
|
586
|
+
@builtin(position) position: vec4<f32>,
|
|
587
|
+
@location(0) worldPos: vec3<f32>,
|
|
588
|
+
@location(1) normal: vec3<f32>,
|
|
589
|
+
@location(2) color: vec4<f32>,
|
|
590
|
+
@location(3) @interpolate(flat) instanceId: u32,
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
// Z-up to Y-up conversion matrix (IFC uses Z-up, WebGPU/viewer uses Y-up)
|
|
594
|
+
// This swaps Y and Z, negating the new Z to maintain right-handedness
|
|
595
|
+
const zToYUp = mat4x4<f32>(
|
|
596
|
+
vec4<f32>(1.0, 0.0, 0.0, 0.0),
|
|
597
|
+
vec4<f32>(0.0, 0.0, -1.0, 0.0),
|
|
598
|
+
vec4<f32>(0.0, 1.0, 0.0, 0.0),
|
|
599
|
+
vec4<f32>(0.0, 0.0, 0.0, 1.0)
|
|
600
|
+
);
|
|
601
|
+
|
|
602
|
+
@vertex
|
|
603
|
+
fn vs_main(input: VertexInput, @builtin(instance_index) instanceIndex: u32) -> VertexOutput {
|
|
604
|
+
var output: VertexOutput;
|
|
605
|
+
let inst = instances[instanceIndex];
|
|
606
|
+
|
|
607
|
+
// Transform to world space (still in Z-up coordinates)
|
|
608
|
+
let worldPosZUp = inst.transform * vec4<f32>(input.position, 1.0);
|
|
609
|
+
let normalZUp = (inst.transform * vec4<f32>(input.normal, 0.0)).xyz;
|
|
610
|
+
|
|
611
|
+
// Convert from Z-up to Y-up for the viewer
|
|
612
|
+
let worldPos = zToYUp * worldPosZUp;
|
|
613
|
+
let normalYUp = (zToYUp * vec4<f32>(normalZUp, 0.0)).xyz;
|
|
614
|
+
|
|
615
|
+
output.position = uniforms.viewProj * worldPos;
|
|
616
|
+
output.worldPos = worldPos.xyz;
|
|
617
|
+
output.normal = normalize(normalYUp);
|
|
618
|
+
output.color = inst.color;
|
|
619
|
+
output.instanceId = instanceIndex;
|
|
620
|
+
return output;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
@fragment
|
|
624
|
+
fn fs_main(input: VertexOutput) -> @location(0) vec4<f32> {
|
|
625
|
+
// Section plane clipping
|
|
626
|
+
if (uniforms.flags.x == 1u) {
|
|
627
|
+
let planeNormal = uniforms.sectionPlane.xyz;
|
|
628
|
+
let planeDistance = uniforms.sectionPlane.w;
|
|
629
|
+
let distToPlane = dot(input.worldPos, planeNormal) - planeDistance;
|
|
630
|
+
if (distToPlane > 0.0) {
|
|
631
|
+
discard;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
let N = normalize(input.normal);
|
|
636
|
+
let L = normalize(vec3<f32>(0.5, 1.0, 0.3)); // Light direction
|
|
637
|
+
|
|
638
|
+
let NdotL = max(dot(N, L), 0.0);
|
|
639
|
+
|
|
640
|
+
var baseColor = input.color.rgb;
|
|
641
|
+
|
|
642
|
+
// Simple diffuse lighting with ambient
|
|
643
|
+
let ambient = 0.3;
|
|
644
|
+
let diffuse = NdotL * 0.7;
|
|
645
|
+
|
|
646
|
+
var color = baseColor * (ambient + diffuse);
|
|
647
|
+
|
|
648
|
+
// Gamma correction (IFC colors are typically in sRGB)
|
|
649
|
+
color = pow(color, vec3<f32>(1.0 / 2.2));
|
|
650
|
+
|
|
651
|
+
return vec4<f32>(color, input.color.a);
|
|
652
|
+
}
|
|
653
|
+
`});this.pipeline=this.device.createRenderPipeline({layout:"auto",vertex:{module:s,entryPoint:"vs_main",buffers:[{arrayStride:24,attributes:[{shaderLocation:0,offset:0,format:"float32x3"},{shaderLocation:1,offset:12,format:"float32x3"}]}]},fragment:{module:s,entryPoint:"fs_main",targets:[{format:o}]},primitive:{topology:"triangle-list",cullMode:"none"},depthStencil:{format:"depth24plus",depthWriteEnabled:!0,depthCompare:"less"}})}updateUniforms(t,n){const r=new Float32Array(24),o=new Uint32Array(r.buffer,80,4);r.set(t,0),n?.enabled?(r[16]=n.normal[0],r[17]=n.normal[1],r[18]=n.normal[2],r[19]=n.distance,o[0]=1):(r[16]=0,r[17]=0,r[18]=0,r[19]=0,o[0]=0),this.device.queue.writeBuffer(this.uniformBuffer,0,r)}resize(t,n){this.currentHeight===n&&this.depthTexture.width===t||(this.currentHeight=n,this.depthTexture.destroy(),this.depthTexture=this.device.createTexture({size:{width:t,height:n},format:"depth24plus",usage:GPUTextureUsage.RENDER_ATTACHMENT}),this.depthTextureView=this.depthTexture.createView())}needsResize(t,n){return this.depthTexture.width!==t||this.depthTexture.height!==n}getPipeline(){return this.pipeline}getDepthTextureView(){return this.depthTextureView}getBindGroupLayout(){return this.pipeline.getBindGroupLayout(0)}createInstanceBindGroup(t){return this.device.createBindGroup({layout:this.pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.uniformBuffer}},{binding:1,resource:{buffer:t}}]})}}class Jn{static identity(){const t=new Float32Array(16);return t[0]=1,t[5]=1,t[10]=1,t[15]=1,{m:t}}static perspective(t,n,r,o){const s=1/Math.tan(t/2),i=1/(r-o),a=new Float32Array(16);return a[0]=s/n,a[5]=s,a[10]=(o+r)*i,a[11]=-1,a[14]=2*o*r*i,{m:a}}static lookAt(t,n,r){const o=t.x-n.x,s=t.y-n.y,i=t.z-n.z,a=1/Math.sqrt(o*o+s*s+i*i),l=o*a,c=s*a,u=i*a,d=r.y*u-r.z*c,f=r.z*l-r.x*u,y=r.x*c-r.y*l,p=1/Math.sqrt(d*d+f*f+y*y),x=d*p,b=f*p,m=y*p,v=c*m-u*b,w=u*x-l*m,S=l*b-c*x,_=new Float32Array(16);return _[0]=x,_[1]=v,_[2]=l,_[3]=0,_[4]=b,_[5]=w,_[6]=c,_[7]=0,_[8]=m,_[9]=S,_[10]=u,_[11]=0,_[12]=-(x*t.x+b*t.y+m*t.z),_[13]=-(v*t.x+w*t.y+S*t.z),_[14]=-(l*t.x+c*t.y+u*t.z),_[15]=1,{m:_}}static multiply(t,n){const r=new Float32Array(16),o=t.m[0],s=t.m[1],i=t.m[2],a=t.m[3],l=t.m[4],c=t.m[5],u=t.m[6],d=t.m[7],f=t.m[8],y=t.m[9],p=t.m[10],x=t.m[11],b=t.m[12],m=t.m[13],v=t.m[14],w=t.m[15],S=n.m[0],_=n.m[1],I=n.m[2],C=n.m[3],E=n.m[4],R=n.m[5],M=n.m[6],N=n.m[7],A=n.m[8],j=n.m[9],L=n.m[10],F=n.m[11],O=n.m[12],V=n.m[13],k=n.m[14],T=n.m[15];return r[0]=S*o+_*l+I*f+C*b,r[1]=S*s+_*c+I*y+C*m,r[2]=S*i+_*u+I*p+C*v,r[3]=S*a+_*d+I*x+C*w,r[4]=E*o+R*l+M*f+N*b,r[5]=E*s+R*c+M*y+N*m,r[6]=E*i+R*u+M*p+N*v,r[7]=E*a+R*d+M*x+N*w,r[8]=A*o+j*l+L*f+F*b,r[9]=A*s+j*c+L*y+F*m,r[10]=A*i+j*u+L*p+F*v,r[11]=A*a+j*d+L*x+F*w,r[12]=O*o+V*l+k*f+T*b,r[13]=O*s+V*c+k*y+T*m,r[14]=O*i+V*u+k*p+T*v,r[15]=O*a+V*d+k*x+T*w,{m:r}}}class lN{camera;viewMatrix;projMatrix;viewProjMatrix;velocity={orbit:{x:0,y:0},pan:{x:0,y:0},zoom:0};damping=.92;minVelocity=.001;animationStartTime=0;animationDuration=0;animationStartPos=null;animationStartTarget=null;animationEndPos=null;animationEndTarget=null;animationStartUp=null;animationEndUp=null;animationEasing=null;isFirstPersonMode=!1;firstPersonSpeed=.1;orbitPivot=null;lastPresetView=null;presetViewRotation=0;constructor(){this.camera={position:{x:50,y:50,z:100},target:{x:0,y:0,z:0},up:{x:0,y:1,z:0},fov:Math.PI/4,aspect:1,near:.1,far:1e5},this.viewMatrix=Jn.identity(),this.projMatrix=Jn.identity(),this.viewProjMatrix=Jn.identity(),this.updateMatrices()}setAspect(t){this.camera.aspect=t,this.updateMatrices()}setPosition(t,n,r){this.camera.position={x:t,y:n,z:r},this.updateMatrices()}setTarget(t,n,r){this.camera.target={x:t,y:n,z:r},this.updateMatrices()}setOrbitPivot(t){this.orbitPivot=t?{...t}:null}getOrbitPivot(){return this.orbitPivot?{...this.orbitPivot}:{...this.camera.target}}hasOrbitPivot(){return this.orbitPivot!==null}orbit(t,n,r=!1){this.camera.up={x:0,y:1,z:0},this.lastPresetView=null,this.presetViewRotation=0;const o=-t*.01,s=-n*.01,i=this.orbitPivot||this.camera.target,a={x:this.camera.position.x-i.x,y:this.camera.position.y-i.y,z:this.camera.position.z-i.z},l=Math.sqrt(a.x*a.x+a.y*a.y+a.z*a.z);if(l<1e-6)return;let c=Math.acos(Math.max(-1,Math.min(1,a.y/l))),u;Math.sin(c)>.05?u=Math.atan2(a.x,a.z):(u=0,c<Math.PI/2?c=.15:c=Math.PI-.15),u+=o;const f=c+s,y=Math.max(.15,Math.min(Math.PI-.15,f)),p=i.x+l*Math.sin(y)*Math.sin(u),x=i.y+l*Math.cos(y),b=i.z+l*Math.sin(y)*Math.cos(u);this.camera.position.x=p,this.camera.position.y=x,this.camera.position.z=b,r&&(this.velocity.orbit.x+=t*.001,this.velocity.orbit.y+=n*.001),this.updateMatrices()}pan(t,n,r=!1){const o={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z},s=Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z),i={x:-o.z,y:0,z:o.x},a=Math.sqrt(i.x*i.x+i.z*i.z);a>1e-10&&(i.x/=a,i.z/=a);const l={x:i.z*o.y-i.y*o.z,y:i.x*o.z-i.z*o.x,z:i.y*o.x-i.x*o.y},c=Math.sqrt(l.x*l.x+l.y*l.y+l.z*l.z);c>1e-10&&(l.x/=c,l.y/=c,l.z/=c);const u=s*.001;this.camera.target.x+=(i.x*t+l.x*n)*u,this.camera.target.y+=(i.y*t+l.y*n)*u,this.camera.target.z+=(i.z*t+l.z*n)*u,this.camera.position.x+=(i.x*t+l.x*n)*u,this.camera.position.y+=(i.y*t+l.y*n)*u,this.camera.position.z+=(i.z*t+l.z*n)*u,r&&(this.velocity.pan.x+=t*u*.1,this.velocity.pan.y+=n*u*.1),this.updateMatrices()}zoom(t,n=!1,r,o,s,i){const a={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z},l=Math.sqrt(a.x*a.x+a.y*a.y+a.z*a.z),c=Math.sign(t)*Math.min(Math.abs(t)*.001,.1),u=1+c;if(r!==void 0&&o!==void 0&&s&&i){const y=r/s*2-1,p=1-o/i*2,x={x:-a.x/l,y:-a.y/l,z:-a.z/l},b=this.camera.up,m={x:x.y*b.z-x.z*b.y,y:x.z*b.x-x.x*b.z,z:x.x*b.y-x.y*b.x},v=Math.sqrt(m.x*m.x+m.y*m.y+m.z*m.z);v>1e-10&&(m.x/=v,m.y/=v,m.z/=v);const w={x:m.y*x.z-m.z*x.y,y:m.z*x.x-m.x*x.z,z:m.x*x.y-m.y*x.x},S=l*Math.tan(this.camera.fov/2),_=S*this.camera.aspect,I=y*_,C=p*S,E={x:this.camera.target.x+m.x*I+w.x*C,y:this.camera.target.y+m.y*I+w.y*C,z:this.camera.target.z+m.z*I+w.z*C},R=1-u;this.camera.target.x+=(E.x-this.camera.target.x)*R,this.camera.target.y+=(E.y-this.camera.target.y)*R,this.camera.target.z+=(E.z-this.camera.target.z)*R}const f=Math.max(.1,l*u)/l;this.camera.position.x=this.camera.target.x+a.x*f,this.camera.position.y=this.camera.target.y+a.y*f,this.camera.position.z=this.camera.target.z+a.z*f,n&&(this.velocity.zoom+=c*.1),this.updateMatrices()}fitToBounds(t,n){const r={x:(t.x+n.x)/2,y:(t.y+n.y)/2,z:(t.z+n.z)/2},o={x:n.x-t.x,y:n.y-t.y,z:n.z-t.z},i=Math.max(o.x,o.y,o.z)*2;this.camera.target=r,this.camera.position={x:r.x+i*.6,y:r.y+i*.5,z:r.z+i*.6},this.camera.far=Math.max(1e5,i*50),this.camera.near=Math.max(.01,i*1e-4),this.updateMatrices()}update(t){let n=!1;if(this.animationStartTime>0&&this.animationDuration>0){const r=Date.now()-this.animationStartTime,o=Math.min(r/this.animationDuration,1);if(o<1&&this.animationStartPos&&this.animationEndPos&&this.animationStartTarget&&this.animationEndTarget&&this.animationEasing){const s=this.animationEasing(o);if(this.camera.position.x=this.animationStartPos.x+(this.animationEndPos.x-this.animationStartPos.x)*s,this.camera.position.y=this.animationStartPos.y+(this.animationEndPos.y-this.animationStartPos.y)*s,this.camera.position.z=this.animationStartPos.z+(this.animationEndPos.z-this.animationStartPos.z)*s,this.camera.target.x=this.animationStartTarget.x+(this.animationEndTarget.x-this.animationStartTarget.x)*s,this.camera.target.y=this.animationStartTarget.y+(this.animationEndTarget.y-this.animationStartTarget.y)*s,this.camera.target.z=this.animationStartTarget.z+(this.animationEndTarget.z-this.animationStartTarget.z)*s,this.animationStartUp&&this.animationEndUp){let i=this.animationStartUp.x+(this.animationEndUp.x-this.animationStartUp.x)*s,a=this.animationStartUp.y+(this.animationEndUp.y-this.animationStartUp.y)*s,l=this.animationStartUp.z+(this.animationEndUp.z-this.animationStartUp.z)*s;const c=Math.sqrt(i*i+a*a+l*l);c>1e-4&&(this.camera.up.x=i/c,this.camera.up.y=a/c,this.camera.up.z=l/c)}this.updateMatrices(),n=!0}else this.animationEndPos&&(this.camera.position.x=this.animationEndPos.x,this.camera.position.y=this.animationEndPos.y,this.camera.position.z=this.animationEndPos.z),this.animationEndTarget&&(this.camera.target.x=this.animationEndTarget.x,this.camera.target.y=this.animationEndTarget.y,this.camera.target.z=this.animationEndTarget.z),this.animationEndUp&&(this.camera.up.x=this.animationEndUp.x,this.camera.up.y=this.animationEndUp.y,this.camera.up.z=this.animationEndUp.z),this.updateMatrices(),this.animationStartTime=0,this.animationDuration=0,this.animationStartPos=null,this.animationEndPos=null,this.animationStartTarget=null,this.animationEndTarget=null,this.animationStartUp=null,this.animationEndUp=null,this.animationEasing=null}return(Math.abs(this.velocity.orbit.x)>this.minVelocity||Math.abs(this.velocity.orbit.y)>this.minVelocity)&&(this.orbit(this.velocity.orbit.x*100,this.velocity.orbit.y*100,!1),this.velocity.orbit.x*=this.damping,this.velocity.orbit.y*=this.damping,n=!0),(Math.abs(this.velocity.pan.x)>this.minVelocity||Math.abs(this.velocity.pan.y)>this.minVelocity)&&(this.pan(this.velocity.pan.x*1e3,this.velocity.pan.y*1e3,!1),this.velocity.pan.x*=this.damping,this.velocity.pan.y*=this.damping,n=!0),Math.abs(this.velocity.zoom)>this.minVelocity&&(this.zoom(this.velocity.zoom*1e3,!1),this.velocity.zoom*=this.damping,n=!0),n}async zoomToFit(t,n,r=500){const o={x:(t.x+n.x)/2,y:(t.y+n.y)/2,z:(t.z+n.z)/2},s={x:n.x-t.x,y:n.y-t.y,z:n.z-t.z},a=Math.max(s.x,s.y,s.z)*2,l=o,c={x:o.x+a*.6,y:o.y+a*.5,z:o.z+a*.6};return this.animateTo(c,l,r)}async framePoint(t,n=300){const r={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z},o={x:t.x+r.x,y:t.y+r.y,z:t.z+r.z};return this.animateTo(o,t,n)}async frameBounds(t,n,r=300){const o={x:(t.x+n.x)/2,y:(t.y+n.y)/2,z:(t.z+n.z)/2},s={x:n.x-t.x,y:n.y-t.y,z:n.z-t.z},i=Math.max(s.x,s.y,s.z);if(i<1e-6)return this.framePoint(o,r);const a=Math.tan(this.camera.fov/2),l=i/2/a*1.2,c=this.viewMatrix.m;let u={x:-c[8],y:-c[9],z:-c[10]};const d=Math.sqrt(u.x*u.x+u.y*u.y+u.z*u.z);if(d>1e-6)u.x/=d,u.y/=d,u.z/=d;else{u={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z};const y=Math.sqrt(u.x*u.x+u.y*u.y+u.z*u.z);if(y>1e-6)u.x/=y,u.y/=y,u.z/=y;else{u.x=.6,u.y=.5,u.z=.6;const p=Math.sqrt(u.x*u.x+u.y*u.y+u.z*u.z);u.x/=p,u.y/=p,u.z/=p}}const f={x:o.x+u.x*l,y:o.y+u.y*l,z:o.z+u.z*l};return this.animateTo(f,o,r)}async zoomExtent(t,n,r=300){const o={x:(t.x+n.x)/2,y:(t.y+n.y)/2,z:(t.z+n.z)/2},s={x:n.x-t.x,y:n.y-t.y,z:n.z-t.z},i=Math.max(s.x,s.y,s.z),a=Math.tan(this.camera.fov/2),l=i/2/a*1.5,c={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z},u=Math.sqrt(c.x*c.x+c.y*c.y+c.z*c.z);if(u>1e-10)c.x/=u,c.y/=u,c.z/=u;else{c.x=.6,c.y=.5,c.z=.6;const f=Math.sqrt(c.x*c.x+c.y*c.y+c.z*c.z);c.x/=f,c.y/=f,c.z/=f}const d={x:o.x+c.x*l,y:o.y+c.y*l,z:o.z+c.z*l};return this.animateTo(d,o,r)}async animateTo(t,n,r=500){return this.animationStartPos={...this.camera.position},this.animationStartTarget={...this.camera.target},this.animationEndPos=t,this.animationEndTarget=n,this.animationStartUp=null,this.animationEndUp=null,this.animationDuration=r,this.animationStartTime=Date.now(),this.animationEasing=this.easeOutCubic,new Promise(o=>{const s=()=>{this.animationStartTime===0?o():requestAnimationFrame(s)};s()})}async animateToWithUp(t,n,r,o=500){return this.velocity.orbit.x=0,this.velocity.orbit.y=0,this.velocity.pan.x=0,this.velocity.pan.y=0,this.velocity.zoom=0,this.animationStartPos={...this.camera.position},this.animationStartTarget={...this.camera.target},this.animationStartUp={...this.camera.up},this.animationEndPos=t,this.animationEndTarget=n,this.animationEndUp=r,this.animationDuration=o,this.animationStartTime=Date.now(),this.animationEasing=this.easeOutCubic,new Promise(s=>{const i=()=>{this.animationStartTime===0?s():requestAnimationFrame(i)};i()})}easeOutCubic(t){return 1-Math.pow(1-t,3)}enableFirstPersonMode(t){this.isFirstPersonMode=t}moveFirstPerson(t,n,r){if(!this.isFirstPersonMode)return;const o={x:this.camera.target.x-this.camera.position.x,y:this.camera.target.y-this.camera.position.y,z:this.camera.target.z-this.camera.position.z},s=Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z);s>1e-10&&(o.x/=s,o.y/=s,o.z/=s);const i={x:-o.z,y:0,z:o.x},a=Math.sqrt(i.x*i.x+i.z*i.z);a>1e-10&&(i.x/=a,i.z/=a);const l={x:i.z*o.y-i.y*o.z,y:i.x*o.z-i.z*o.x,z:i.y*o.x-i.x*o.y},c=this.firstPersonSpeed;this.camera.position.x+=(o.x*t+i.x*n+l.x*r)*c,this.camera.position.y+=(o.y*t+i.y*n+l.y*r)*c,this.camera.position.z+=(o.z*t+i.z*n+l.z*r)*c,this.camera.target.x+=(o.x*t+i.x*n+l.x*r)*c,this.camera.target.y+=(o.y*t+i.y*n+l.y*r)*c,this.camera.target.z+=(o.z*t+i.z*n+l.z*r)*c,this.updateMatrices()}setPresetView(t,n){const r=n||this.getCurrentBounds();if(!r){console.warn("[Camera] No bounds available for setPresetView");return}this.lastPresetView===t?this.presetViewRotation=(this.presetViewRotation+1)%4:(this.lastPresetView=t,this.presetViewRotation=0);const o={x:(r.min.x+r.max.x)/2,y:(r.min.y+r.max.y)/2,z:(r.min.z+r.max.z)/2},s={x:r.max.x-r.min.x,y:r.max.y-r.min.y,z:r.max.z-r.min.z},i=Math.max(s.x,s.y,s.z),a=Math.tan(this.camera.fov/2),l=i/2/a*1.5;let c;const u=o;let d={x:0,y:1,z:0};const f=[{x:0,y:0,z:-1},{x:-1,y:0,z:0},{x:0,y:0,z:1},{x:1,y:0,z:0}],y=[{x:0,y:0,z:1},{x:1,y:0,z:0},{x:0,y:0,z:-1},{x:-1,y:0,z:0}];switch(t){case"top":c={x:o.x,y:o.y+l,z:o.z},d=f[this.presetViewRotation];break;case"bottom":c={x:o.x,y:o.y-l,z:o.z},d=y[this.presetViewRotation];break;case"front":c={x:o.x,y:o.y,z:o.z+l},d={x:0,y:1,z:0};break;case"back":c={x:o.x,y:o.y,z:o.z-l},d={x:0,y:1,z:0};break;case"left":c={x:o.x-l,y:o.y,z:o.z},d={x:0,y:1,z:0};break;case"right":c={x:o.x+l,y:o.y,z:o.z},d={x:0,y:1,z:0};break}this.animateToWithUp(c,u,d,300)}getCurrentBounds(){const t={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z},r=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)/2;return{min:{x:this.camera.target.x-r,y:this.camera.target.y-r,z:this.camera.target.z-r},max:{x:this.camera.target.x+r,y:this.camera.target.y+r,z:this.camera.target.z+r}}}stopInertia(){this.velocity.orbit.x=0,this.velocity.orbit.y=0,this.velocity.pan.x=0,this.velocity.pan.y=0,this.velocity.zoom=0}reset(){this.orbitPivot=null,this.stopInertia(),this.animationStartTime=0,this.animationDuration=0,this.animationStartPos=null,this.animationStartTarget=null,this.animationEndPos=null,this.animationEndTarget=null,this.animationStartUp=null,this.animationEndUp=null,this.animationEasing=null,this.lastPresetView=null,this.presetViewRotation=0}getViewProjMatrix(){return this.viewProjMatrix}getPosition(){return{...this.camera.position}}getTarget(){return{...this.camera.target}}getFOV(){return this.camera.fov}getDistance(){const t={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z};return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)}getRotation(){const t={x:this.camera.position.x-this.camera.target.x,y:this.camera.position.y-this.camera.target.y,z:this.camera.position.z-this.camera.target.z},n=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z);if(n<1e-6)return{azimuth:0,elevation:0};const r=Math.asin(Math.max(-1,Math.min(1,t.y/n)))*180/Math.PI,o=this.camera.up.x,s=this.camera.up.y,i=this.camera.up.z,a=Math.sqrt(o*o+i*i);let l;return a>.01?(l=(Math.atan2(-o,-i)*180/Math.PI+360)%360,r<-80&&s<0&&(l=(l+180)%360)):l=(Math.atan2(t.x,t.z)*180/Math.PI+360)%360,{azimuth:l,elevation:r}}projectToScreen(t,n,r){const o=this.viewProjMatrix.m,s=o[0]*t.x+o[4]*t.y+o[8]*t.z+o[12],i=o[1]*t.x+o[5]*t.y+o[9]*t.z+o[13],a=o[2]*t.x+o[6]*t.y+o[10]*t.z+o[14],l=o[3]*t.x+o[7]*t.y+o[11]*t.z+o[15];if(l<=0)return null;const c=s/l,u=i/l,d=a/l;if(d<-1||d>1)return null;const f=(c+1)*.5*n,y=(1-u)*.5*r;return{x:f,y}}updateMatrices(){this.viewMatrix=Jn.lookAt(this.camera.position,this.camera.target,this.camera.up),this.projMatrix=Jn.perspective(this.camera.fov,this.camera.aspect,this.camera.near,this.camera.far),this.viewProjMatrix=Jn.multiply(this.projMatrix,this.viewMatrix)}}class cN{meshes=[];instancedMeshes=[];batchedMeshes=[];batchedMeshMap=new Map;batchedMeshData=new Map;meshDataMap=new Map;addMesh(t){this.meshes.push(t)}addInstancedMesh(t){this.instancedMeshes.push(t)}getMeshes(){return this.meshes}getInstancedMeshes(){return this.instancedMeshes}getBatchedMeshes(){return this.batchedMeshes}addMeshData(t){this.meshDataMap.set(t.expressId,t)}getMeshData(t){return this.meshDataMap.get(t)}hasMeshData(t){return this.meshDataMap.has(t)}colorKey(t){const n=Math.round(t[0]*1e3)/1e3,r=Math.round(t[1]*1e3)/1e3,o=Math.round(t[2]*1e3)/1e3,s=Math.round(t[3]*1e3)/1e3;return`${n},${r},${o},${s}`}appendToBatches(t,n,r){for(const o of t){const s=this.colorKey(o.color);this.batchedMeshData.has(s)||this.batchedMeshData.set(s,[]),this.batchedMeshData.get(s).push(o)}for(const[o,s]of this.batchedMeshData){const i=this.batchedMeshMap.get(o);i&&(i.vertexBuffer.destroy(),i.indexBuffer.destroy(),i.uniformBuffer&&i.uniformBuffer.destroy());const a=s[0].color,l=this.createBatchedMesh(s,a,n,r);this.batchedMeshMap.set(o,l);const c=this.batchedMeshes.findIndex(u=>u.colorKey===o);c>=0?this.batchedMeshes[c]=l:this.batchedMeshes.push(l)}}createBatchedMesh(t,n,r,o){const s=this.mergeGeometry(t),i=t.map(d=>d.expressId),a=r.createBuffer({size:s.vertexData.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});r.queue.writeBuffer(a,0,s.vertexData);const l=r.createBuffer({size:s.indices.byteLength,usage:GPUBufferUsage.INDEX|GPUBufferUsage.COPY_DST});r.queue.writeBuffer(l,0,s.indices);const c=r.createBuffer({size:o.getUniformBufferSize(),usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),u=r.createBindGroup({layout:o.getBindGroupLayout(),entries:[{binding:0,resource:{buffer:c}}]});return{colorKey:this.colorKey(n),vertexBuffer:a,indexBuffer:l,indexCount:s.indices.length,color:n,expressIds:i,bindGroup:u,uniformBuffer:c}}mergeGeometry(t){let n=0,r=0;for(const l of t)n+=l.positions.length/3,r+=l.indices.length;const o=new Float32Array(n*6),s=new Uint32Array(r);let i=0,a=0;for(const l of t){const c=l.positions.length/3;for(let u=0;u<c;u++){const d=(a+u)*6,f=u*3,y=u*3;o[d+0]=l.positions[f+0],o[d+1]=l.positions[f+1],o[d+2]=l.positions[f+2],o[d+3]=l.normals[y+0],o[d+4]=l.normals[y+1],o[d+5]=l.normals[y+2]}for(let u=0;u<l.indices.length;u++)s[i+u]=l.indices[u]+a;a+=c,i+=l.indices.length}return{vertexData:o,indices:s}}clearRegularMeshes(){for(const t of this.meshes)t.vertexBuffer.destroy(),t.indexBuffer.destroy(),t.uniformBuffer&&t.uniformBuffer.destroy();this.meshes=[]}clear(){for(const t of this.meshes)t.vertexBuffer.destroy(),t.indexBuffer.destroy(),t.uniformBuffer&&t.uniformBuffer.destroy();for(const t of this.instancedMeshes)t.vertexBuffer.destroy(),t.indexBuffer.destroy(),t.instanceBuffer.destroy();for(const t of this.batchedMeshes)t.vertexBuffer.destroy(),t.indexBuffer.destroy(),t.uniformBuffer&&t.uniformBuffer.destroy();this.meshes=[],this.instancedMeshes=[],this.batchedMeshes=[],this.batchedMeshMap.clear(),this.batchedMeshData.clear(),this.meshDataMap.clear()}getBounds(){return this.meshes.length===0?null:{min:{x:-10,y:-10,z:-10},max:{x:10,y:10,z:10}}}}class uN{device;pipeline;depthTexture;colorTexture;uniformBuffer;expressIdBuffer;bindGroup;maxMeshes=1e5;constructor(t,n=1,r=1){this.device=t.getDevice(),this.colorTexture=this.device.createTexture({size:{width:n,height:r},format:"r32uint",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC}),this.depthTexture=this.device.createTexture({size:{width:n,height:r},format:"depth24plus",usage:GPUTextureUsage.RENDER_ATTACHMENT}),this.uniformBuffer=this.device.createBuffer({size:64,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.expressIdBuffer=this.device.createBuffer({size:this.maxMeshes*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});const o=this.device.createShaderModule({code:`
|
|
654
|
+
struct Uniforms {
|
|
655
|
+
viewProj: mat4x4<f32>,
|
|
656
|
+
}
|
|
657
|
+
@binding(0) @group(0) var<uniform> uniforms: Uniforms;
|
|
658
|
+
@binding(1) @group(0) var<storage, read> expressIds: array<u32>;
|
|
659
|
+
|
|
660
|
+
struct VertexInput {
|
|
661
|
+
@location(0) position: vec3<f32>,
|
|
662
|
+
@location(1) normal: vec3<f32>,
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
struct VertexOutput {
|
|
666
|
+
@builtin(position) position: vec4<f32>,
|
|
667
|
+
@location(0) @interpolate(flat) objectId: u32,
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
@vertex
|
|
671
|
+
fn vs_main(input: VertexInput, @builtin(instance_index) instanceIndex: u32) -> VertexOutput {
|
|
672
|
+
var output: VertexOutput;
|
|
673
|
+
// Identity transform - positions are already in world space
|
|
674
|
+
output.position = uniforms.viewProj * vec4<f32>(input.position, 1.0);
|
|
675
|
+
// Look up expressId from storage buffer using instance index
|
|
676
|
+
output.objectId = expressIds[instanceIndex];
|
|
677
|
+
return output;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
@fragment
|
|
681
|
+
fn fs_main(input: VertexOutput) -> @location(0) u32 {
|
|
682
|
+
return input.objectId;
|
|
683
|
+
}
|
|
684
|
+
`});this.pipeline=this.device.createRenderPipeline({layout:"auto",vertex:{module:o,entryPoint:"vs_main",buffers:[{arrayStride:24,attributes:[{shaderLocation:0,offset:0,format:"float32x3"},{shaderLocation:1,offset:12,format:"float32x3"}]}]},fragment:{module:o,entryPoint:"fs_main",targets:[{format:"r32uint"}]},primitive:{topology:"triangle-list",cullMode:"back"},depthStencil:{format:"depth24plus",depthWriteEnabled:!0,depthCompare:"less"}}),this.bindGroup=this.device.createBindGroup({layout:this.pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.uniformBuffer}},{binding:1,resource:{buffer:this.expressIdBuffer}}]})}async pick(t,n,r,o,s,i){(this.colorTexture.width!==r||this.colorTexture.height!==o)&&(this.colorTexture.destroy(),this.depthTexture.destroy(),this.colorTexture=this.device.createTexture({size:{width:r,height:o},format:"r32uint",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC}),this.depthTexture=this.device.createTexture({size:{width:r,height:o},format:"depth24plus",usage:GPUTextureUsage.RENDER_ATTACHMENT}));const a=this.colorTexture.createView(),l=this.depthTexture.createView(),c=this.device.createCommandEncoder(),u=c.beginRenderPass({colorAttachments:[{view:a,loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0},storeOp:"store"}],depthStencilAttachment:{view:l,depthClearValue:1,depthLoadOp:"clear",depthStoreOp:"store"}});s.length>this.maxMeshes&&this.resizeExpressIdBuffer(s.length),this.device.queue.writeBuffer(this.uniformBuffer,0,i);const d=new Uint32Array(s.length);for(let b=0;b<s.length;b++){const m=s[b];m&&(d[b]=m.expressId+1)}this.device.queue.writeBuffer(this.expressIdBuffer,0,d),u.setPipeline(this.pipeline),u.setBindGroup(0,this.bindGroup);for(let b=0;b<s.length;b++){const m=s[b];m&&(u.setVertexBuffer(0,m.vertexBuffer),u.setIndexBuffer(m.indexBuffer,"uint32"),u.drawIndexed(m.indexCount,1,0,0,b))}u.end();const f=256,y=this.device.createBuffer({size:f,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});c.copyTextureToBuffer({texture:this.colorTexture,origin:{x:Math.floor(t),y:Math.floor(n),z:0}},{buffer:y,bytesPerRow:f,rowsPerImage:1},{width:1,height:1}),this.device.queue.submit([c.finish()]),await y.mapAsync(1);const x=new Uint32Array(y.getMappedRange())[0];return y.unmap(),y.destroy(),x>0?x-1:null}updateUniforms(t){this.device.queue.writeBuffer(this.uniformBuffer,0,t)}resizeExpressIdBuffer(t){this.expressIdBuffer.destroy(),this.maxMeshes=Math.ceil(t*1.5),this.expressIdBuffer=this.device.createBuffer({size:this.maxMeshes*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.bindGroup=this.device.createBindGroup({layout:this.pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.uniformBuffer}},{binding:1,resource:{buffer:this.expressIdBuffer}}]})}}class dN{device;pipeline=null;vertexBuffer=null;uniformBuffer=null;bindGroup=null;format;initialized=!1;constructor(t,n){this.device=t,this.format=n}init(){if(this.initialized)return;const t=this.device.createShaderModule({code:`
|
|
685
|
+
struct Uniforms {
|
|
686
|
+
viewProj: mat4x4<f32>,
|
|
687
|
+
planeColor: vec4<f32>,
|
|
688
|
+
}
|
|
689
|
+
@binding(0) @group(0) var<uniform> uniforms: Uniforms;
|
|
690
|
+
|
|
691
|
+
struct VertexOutput {
|
|
692
|
+
@builtin(position) position: vec4<f32>,
|
|
693
|
+
@location(0) uv: vec2<f32>,
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
@vertex
|
|
697
|
+
fn vs_main(@location(0) position: vec3<f32>, @location(1) uv: vec2<f32>) -> VertexOutput {
|
|
698
|
+
var output: VertexOutput;
|
|
699
|
+
output.position = uniforms.viewProj * vec4<f32>(position, 1.0);
|
|
700
|
+
output.uv = uv;
|
|
701
|
+
return output;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
@fragment
|
|
705
|
+
fn fs_main(input: VertexOutput) -> @location(0) vec4<f32> {
|
|
706
|
+
// Create a grid pattern on the plane
|
|
707
|
+
let gridSize = 0.05;
|
|
708
|
+
let lineWidth = 0.02;
|
|
709
|
+
|
|
710
|
+
let gridX = abs(fract(input.uv.x / gridSize + 0.5) - 0.5);
|
|
711
|
+
let gridY = abs(fract(input.uv.y / gridSize + 0.5) - 0.5);
|
|
712
|
+
|
|
713
|
+
let gridLine = min(gridX, gridY);
|
|
714
|
+
let isGridLine = gridLine < lineWidth;
|
|
715
|
+
|
|
716
|
+
// Edge fade for softer appearance
|
|
717
|
+
let edgeFade = smoothstep(0.0, 0.1, min(input.uv.x, min(input.uv.y, min(1.0 - input.uv.x, 1.0 - input.uv.y))));
|
|
718
|
+
|
|
719
|
+
var color = uniforms.planeColor;
|
|
720
|
+
if (isGridLine) {
|
|
721
|
+
color = vec4<f32>(color.rgb * 1.3, color.a * 1.5);
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
color.a *= edgeFade;
|
|
725
|
+
|
|
726
|
+
return color;
|
|
727
|
+
}
|
|
728
|
+
`});this.pipeline=this.device.createRenderPipeline({layout:"auto",vertex:{module:t,entryPoint:"vs_main",buffers:[{arrayStride:20,attributes:[{shaderLocation:0,offset:0,format:"float32x3"},{shaderLocation:1,offset:12,format:"float32x2"}]}]},fragment:{module:t,entryPoint:"fs_main",targets:[{format:this.format,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}}}]},primitive:{topology:"triangle-list",cullMode:"none"},depthStencil:{format:"depth24plus",depthWriteEnabled:!1,depthCompare:"less-equal"}}),this.vertexBuffer=this.device.createBuffer({size:6*5*4,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST}),this.uniformBuffer=this.device.createBuffer({size:80,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.bindGroup=this.device.createBindGroup({layout:this.pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.uniformBuffer}}]}),this.initialized=!0}render(t,n,r,o){if(this.init(),!this.pipeline||!this.vertexBuffer||!this.uniformBuffer||!this.bindGroup)return;const{axis:s,position:i,bounds:a,viewProj:l}=o,c=this.calculatePlaneVertices(s,i,a);this.device.queue.writeBuffer(this.vertexBuffer,0,c);const u=new Float32Array(20);u.set(l,0),u[16]=.2,u[17]=.6,u[18]=.9,u[19]=.3,this.device.queue.writeBuffer(this.uniformBuffer,0,u);const d=t.beginRenderPass({colorAttachments:[{view:n,loadOp:"load",storeOp:"store"}],depthStencilAttachment:{view:r,depthLoadOp:"load",depthStoreOp:"store"}});d.setPipeline(this.pipeline),d.setBindGroup(0,this.bindGroup),d.setVertexBuffer(0,this.vertexBuffer),d.draw(6),d.end()}calculatePlaneVertices(t,n,r){const{min:o,max:s}=r,i=.1,a=(s.x-o.x)*(1+i),l=(s.y-o.y)*(1+i),c=(s.z-o.z)*(1+i),u=(o.x+s.x)/2,d=(o.y+s.y)/2,f=(o.z+s.z)/2,y=n/100;let p=[];if(t==="x"){const x=o.x+y*(s.x-o.x),b=l/2,m=c/2;p=[x,d-b,f-m,0,0,x,d+b,f-m,1,0,x,d+b,f+m,1,1,x,d-b,f-m,0,0,x,d+b,f+m,1,1,x,d-b,f+m,0,1]}else if(t==="y"){const x=o.y+y*(s.y-o.y),b=a/2,m=c/2;p=[u-b,x,f-m,0,0,u+b,x,f-m,1,0,u+b,x,f+m,1,1,u-b,x,f-m,0,0,u+b,x,f+m,1,1,u-b,x,f+m,0,1]}else{const x=o.z+y*(s.z-o.z),b=a/2,m=l/2;p=[u-b,d-m,x,0,0,u+b,d-m,x,1,0,u+b,d+m,x,1,1,u-b,d-m,x,0,0,u+b,d+m,x,1,1,u-b,d+m,x,0,1]}return new Float32Array(p)}}class fN{device;pipeline=null;instancedPipeline=null;camera;scene;picker=null;canvas;sectionPlaneRenderer=null;modelBounds=null;constructor(t){this.canvas=t,this.device=new sN,this.camera=new lN,this.scene=new cN}async init(){await this.device.init(this.canvas);const t=this.canvas.getBoundingClientRect(),n=this.canvas.width||Math.max(1,Math.floor(t.width)),r=this.canvas.height||Math.max(1,Math.floor(t.height));(!this.canvas.width||!this.canvas.height)&&(this.canvas.width=n,this.canvas.height=r),this.pipeline=new iN(this.device,n,r),this.instancedPipeline=new aN(this.device,n,r),this.picker=new uN(this.device,n,r),this.sectionPlaneRenderer=new dN(this.device.getDevice(),this.device.getFormat()),this.camera.setAspect(n/r)}addMesh(t){if(!t.uniformBuffer&&this.pipeline&&this.device.isInitialized()){const n=this.device.getDevice();t.uniformBuffer=n.createBuffer({size:this.pipeline.getUniformBufferSize(),usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),t.bindGroup=n.createBindGroup({layout:this.pipeline.getBindGroupLayout(),entries:[{binding:0,resource:{buffer:t.uniformBuffer}}]})}this.scene.addMesh(t)}addInstancedGeometry(t){if(!this.instancedPipeline||!this.device.isInitialized())throw new Error("Renderer not initialized. Call init() first.");const n=this.device.getDevice(),r=t.positions.length/3,o=new Float32Array(r*6);for(let p=0;p<r;p++)o[p*6+0]=t.positions[p*3+0],o[p*6+1]=t.positions[p*3+1],o[p*6+2]=t.positions[p*3+2],o[p*6+3]=t.normals[p*3+0],o[p*6+4]=t.normals[p*3+1],o[p*6+5]=t.normals[p*3+2];const s=o.byteLength,i=n.createBuffer({size:s,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});n.queue.writeBuffer(i,0,o);const a=n.createBuffer({size:t.indices.byteLength,usage:GPUBufferUsage.INDEX|GPUBufferUsage.COPY_DST});n.queue.writeBuffer(a,0,t.indices);const l=t.instance_count,c=new Float32Array(l*20),u=new Map;for(let p=0;p<l;p++){const x=t.get_instance(p);if(!x)continue;const b=p*20;c.set(x.transform,b),c[b+16]=x.color[0],c[b+17]=x.color[1],c[b+18]=x.color[2],c[b+19]=x.color[3],u.set(x.expressId,p)}const d=n.createBuffer({size:c.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});n.queue.writeBuffer(d,0,c);const f=this.instancedPipeline.createInstanceBindGroup(d),y={geometryId:Number(t.geometryId),vertexBuffer:i,indexBuffer:a,indexCount:t.indices.length,instanceBuffer:d,instanceCount:l,expressIdToInstanceIndex:u,bindGroup:f};this.scene.addInstancedMesh(y)}convertToInstanced(t){if(!this.instancedPipeline||!this.device.isInitialized()){console.warn("[Renderer] Cannot convert to instanced: renderer not initialized");return}const n=VR(t),r=this.device.getDevice();let o=0;for(const i of n){const a=i.positions.length/3,l=new Float32Array(a*6);for(let w=0;w<a;w++)l[w*6+0]=i.positions[w*3+0],l[w*6+1]=i.positions[w*3+1],l[w*6+2]=i.positions[w*3+2],l[w*6+3]=i.normals[w*3+0],l[w*6+4]=i.normals[w*3+1],l[w*6+5]=i.normals[w*3+2];const c=r.createBuffer({size:l.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});r.queue.writeBuffer(c,0,l);const u=r.createBuffer({size:i.indices.byteLength,usage:GPUBufferUsage.INDEX|GPUBufferUsage.COPY_DST});r.queue.writeBuffer(u,0,i.indices);const d=i.instances.length,f=new Float32Array(d*20),y=new Map,p=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);for(let w=0;w<d;w++){const S=i.instances[w],_=w*20;f.set(p,_),f[_+16]=S.color[0],f[_+17]=S.color[1],f[_+18]=S.color[2],f[_+19]=S.color[3],y.set(S.expressId,w)}const x=r.createBuffer({size:f.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});r.queue.writeBuffer(x,0,f);const b=this.instancedPipeline.createInstanceBindGroup(x),v={geometryId:this.hashStringToNumber(i.geometryHash),vertexBuffer:c,indexBuffer:u,indexCount:i.indices.length,instanceBuffer:x,instanceCount:d,expressIdToInstanceIndex:y,bindGroup:b};this.scene.addInstancedMesh(v),o+=d}const s=this.scene.getMeshes().length;this.scene.clearRegularMeshes(),console.log(`[Renderer] Converted ${t.length} meshes to ${n.length} instanced geometries (${o} total instances, ${(o/n.length).toFixed(1)}x deduplication). Cleared ${s} regular meshes.`)}hashStringToNumber(t){let n=0;for(let r=0;r<t.length;r++){const o=t.charCodeAt(r);n=(n<<5)-n+o,n=n&n}return Math.abs(n)}createMeshFromData(t){if(!this.device.isInitialized())return;const n=this.device.getDevice(),r=t.positions.length/3,o=new Float32Array(r*6);for(let a=0;a<r;a++){const l=a*6,c=a*3;o[l]=t.positions[c],o[l+1]=t.positions[c+1],o[l+2]=t.positions[c+2],o[l+3]=t.normals[c],o[l+4]=t.normals[c+1],o[l+5]=t.normals[c+2]}const s=n.createBuffer({size:o.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});n.queue.writeBuffer(s,0,o);const i=n.createBuffer({size:t.indices.byteLength,usage:GPUBufferUsage.INDEX|GPUBufferUsage.COPY_DST});n.queue.writeBuffer(i,0,t.indices),this.scene.addMesh({expressId:t.expressId,vertexBuffer:s,indexBuffer:i,indexCount:t.indices.length,transform:Jn.identity(),color:t.color})}ensureMeshResources(){if(!this.pipeline||!this.device.isInitialized())return;const t=this.device.getDevice();let n=0;for(const r of this.scene.getMeshes())r.uniformBuffer||(r.uniformBuffer=t.createBuffer({size:this.pipeline.getUniformBufferSize(),usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),r.bindGroup=t.createBindGroup({layout:this.pipeline.getBindGroupLayout(),entries:[{binding:0,resource:{buffer:r.uniformBuffer}}]}),n++);if(n>0){const r=this.scene.getMeshes().length;(r%250===0||n>100)&&console.log(`[Renderer] Created GPU resources for ${n} new meshes (${r} total)`)}}render(t={}){if(!this.device.isInitialized()||!this.pipeline)return;const n=this.canvas.getBoundingClientRect(),r=Math.max(1,Math.floor(n.width)),o=Math.max(1,Math.floor(n.height));if(r<10||o<10||((this.canvas.width!==r||this.canvas.height!==o)&&(this.canvas.width=r,this.canvas.height=o,this.camera.setAspect(r/o),this.device.configureContext(),this.pipeline.resize(r,o),this.instancedPipeline&&this.instancedPipeline.resize(r,o)),this.canvas.width===0||this.canvas.height===0)||!this.device.ensureContext())return;const i=this.device.getDevice(),a=this.camera.getViewProjMatrix().m;this.ensureMeshResources();let l=this.scene.getMeshes();const c=t.hiddenIds&&t.hiddenIds.size>0,u=t.isolatedIds!==null&&t.isolatedIds!==void 0,d=c||u,f=this.scene.getBatchedMeshes();if(d&&f.length>0&&l.length===0){const p=new Set;for(const m of f)for(const v of m.expressIds)p.add(v);const x=[];for(const m of p){const v=t.hiddenIds?.has(m)??!1,w=!u||t.isolatedIds.has(m);!v&&w&&x.push(m)}const b=new Set(l.map(m=>m.expressId));for(const m of x)if(!b.has(m)&&this.scene.hasMeshData(m)){const v=this.scene.getMeshData(m);this.createMeshFromData(v)}l=this.scene.getMeshes()}if(t.enableFrustumCulling&&t.spatialIndex)try{const p=md.fromViewProjMatrix(a),x=new Set(t.spatialIndex.queryFrustum(p));l=l.filter(b=>x.has(b.expressId))}catch(p){console.warn("Frustum culling failed:",p)}t.hiddenIds&&t.hiddenIds.size>0&&(l=l.filter(p=>!t.hiddenIds.has(p.expressId))),t.isolatedIds!==null&&t.isolatedIds!==void 0&&(l=l.filter(p=>t.isolatedIds.has(p.expressId))),this.pipeline.needsResize(this.canvas.width,this.canvas.height)&&this.pipeline.resize(this.canvas.width,this.canvas.height),this.instancedPipeline?.needsResize(this.canvas.width,this.canvas.height)&&this.instancedPipeline.resize(this.canvas.width,this.canvas.height);const y=this.device.getCurrentTexture();if(y)try{const p=t.clearColor?Array.isArray(t.clearColor)?{r:t.clearColor[0],g:t.clearColor[1],b:t.clearColor[2],a:t.clearColor[3]}:t.clearColor:{r:.1,g:.1,b:.1,a:1},x=y.createView(),b=[],m=[];for(const R of l){const M=R.color[3],N=R.material?.transparency??0;M<.99||N>.01?m.push(R):b.push(R)}m.length>0&&m.sort((R,M)=>M.expressId-R.expressId);const v=[...b,...m],w=t.selectedId,S=t.selectedIds;let _;if(t.sectionPlane?.enabled){const R=[0,0,0];t.sectionPlane.axis==="x"?R[0]=1:t.sectionPlane.axis==="y"?R[1]=1:R[2]=1;const M={x:1/0,y:1/0,z:1/0},N={x:-1/0,y:-1/0,z:-1/0};if(l.length>0){for(const V of l)V.bounds&&(M.x=Math.min(M.x,V.bounds.min[0]),M.y=Math.min(M.y,V.bounds.min[1]),M.z=Math.min(M.z,V.bounds.min[2]),N.x=Math.max(N.x,V.bounds.max[0]),N.y=Math.max(N.y,V.bounds.max[1]),N.z=Math.max(N.z,V.bounds.max[2]));Number.isFinite(M.x)||(M.x=M.y=M.z=-100,N.x=N.y=N.z=100)}else M.x=M.y=M.z=-100,N.x=N.y=N.z=100;this.modelBounds={min:M,max:N};const A=t.sectionPlane.axis==="x"?"x":t.sectionPlane.axis==="y"?"y":"z",j=M[A],F=N[A]-j,O=j+t.sectionPlane.position/100*F;_={normal:R,distance:O,enabled:!0}}for(const R of v)if(R.uniformBuffer){const M=new Float32Array(48),N=new Uint32Array(M.buffer,176,4);M.set(a,0),M.set(R.transform.m,16);const A=w!=null&&R.expressId===w||S!==void 0&&S.has(R.expressId);M.set(R.color,32),M[36]=R.material?.metallic??0,M[37]=R.material?.roughness??.6,_&&(M[40]=_.normal[0],M[41]=_.normal[1],M[42]=_.normal[2],M[43]=_.distance),N[0]=A?1:0,N[1]=_?.enabled?1:0,N[2]=0,N[3]=0,i.queue.writeBuffer(R.uniformBuffer,0,M)}const I=i.createCommandEncoder(),C=I.beginRenderPass({colorAttachments:[{view:x,loadOp:"clear",clearValue:p,storeOp:"store"}],depthStencilAttachment:{view:this.pipeline.getDepthTextureView(),depthClearValue:1,depthLoadOp:"clear",depthStoreOp:"store"}});C.setPipeline(this.pipeline.getPipeline());const E=this.scene.getBatchedMeshes();if(E.length>0&&!d){const R=[],M=new Set;if(w!=null&&M.add(w),S)for(const L of S)M.add(L);for(const L of E){if(!L.bindGroup||!L.uniformBuffer)continue;const F=new Float32Array(48),O=new Uint32Array(F.buffer,176,4);F.set(a,0),F.set([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],16),F.set(L.color,32),F[36]=0,F[37]=.6,_&&(F[40]=_.normal[0],F[41]=_.normal[1],F[42]=_.normal[2],F[43]=_.distance),O[0]=0,O[1]=_?.enabled?1:0,O[2]=0,O[3]=0,i.queue.writeBuffer(L.uniformBuffer,0,F),C.setBindGroup(0,L.bindGroup),C.setVertexBuffer(0,L.vertexBuffer),C.setIndexBuffer(L.indexBuffer,"uint32"),C.drawIndexed(L.indexCount)}const N=this.scene.getMeshes(),A=new Set(N.map(L=>L.expressId));for(const L of M)if(!A.has(L)&&this.scene.hasMeshData(L)){const F=this.scene.getMeshData(L);this.createMeshFromData(F)}const j=this.scene.getMeshes().filter(L=>M.has(L.expressId));for(const L of j)!L.uniformBuffer&&this.pipeline&&(L.uniformBuffer=i.createBuffer({size:this.pipeline.getUniformBufferSize(),usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),L.bindGroup=i.createBindGroup({layout:this.pipeline.getBindGroupLayout(),entries:[{binding:0,resource:{buffer:L.uniformBuffer}}]}));for(const L of j){if(!L.bindGroup||!L.uniformBuffer)continue;const F=new Float32Array(48),O=new Uint32Array(F.buffer,176,4);F.set(a,0),F.set(L.transform.m,16),F.set(L.color,32),F[36]=L.material?.metallic??0,F[37]=L.material?.roughness??.6,_&&(F[40]=_.normal[0],F[41]=_.normal[1],F[42]=_.normal[2],F[43]=_.distance),O[0]=1,O[1]=_?.enabled?1:0,O[2]=0,O[3]=0,i.queue.writeBuffer(L.uniformBuffer,0,F),C.setPipeline(this.pipeline.getSelectionPipeline()),C.setBindGroup(0,L.bindGroup),C.setVertexBuffer(0,L.vertexBuffer),C.setIndexBuffer(L.indexBuffer,"uint32"),C.drawIndexed(L.indexCount,1,0,0,0)}}else{for(const R of b)R.bindGroup?C.setBindGroup(0,R.bindGroup):C.setBindGroup(0,this.pipeline.getBindGroup()),C.setVertexBuffer(0,R.vertexBuffer),C.setIndexBuffer(R.indexBuffer,"uint32"),C.drawIndexed(R.indexCount,1,0,0,0);for(const R of m)R.bindGroup?C.setBindGroup(0,R.bindGroup):C.setBindGroup(0,this.pipeline.getBindGroup()),C.setVertexBuffer(0,R.vertexBuffer),C.setIndexBuffer(R.indexBuffer,"uint32"),C.drawIndexed(R.indexCount,1,0,0,0)}if(this.instancedPipeline){const R=this.scene.getInstancedMeshes();if(R.length>0){this.instancedPipeline.updateUniforms(a,_),C.setPipeline(this.instancedPipeline.getPipeline());for(const M of R){const N=M.bindGroup??this.instancedPipeline.createInstanceBindGroup(M.instanceBuffer);C.setBindGroup(0,N),C.setVertexBuffer(0,M.vertexBuffer),C.setIndexBuffer(M.indexBuffer,"uint32"),C.drawIndexed(M.indexCount,M.instanceCount,0,0,0)}}}C.end(),_?.enabled&&this.sectionPlaneRenderer&&this.modelBounds&&this.sectionPlaneRenderer.render(I,x,this.pipeline.getDepthTextureView(),{axis:t.sectionPlane.axis,position:t.sectionPlane.position,bounds:this.modelBounds,viewProj:a}),i.queue.submit([I.finish()])}catch(p){this.device.invalidateContext(),Math.random()<.01&&console.warn("Render error (context will be reconfigured):",p)}}async pick(t,n,r){if(!this.picker||r?.isStreaming)return null;let o=this.scene.getMeshes();if(o.length===0){const a=this.scene.getBatchedMeshes();if(a.length>0){const l=new Set;for(const u of a)for(const d of u.expressIds)l.add(d);const c=new Set(o.map(u=>u.expressId));for(const u of l)if(!c.has(u)&&this.scene.hasMeshData(u)){const d=this.scene.getMeshData(u);d&&(this.createMeshFromData(d),c.add(u))}o=this.scene.getMeshes()}}const s=this.camera.getViewProjMatrix().m;return await this.picker.pick(t,n,this.canvas.width,this.canvas.height,o,s)}resize(t,n){this.canvas.width=t,this.canvas.height=n,this.camera.setAspect(t/n)}getCamera(){return this.camera}getScene(){return this.scene}getPipeline(){return this.pipeline}isReady(){return this.device.isInitialized()&&this.pipeline!==null}getGPUDevice(){return this.device.isInitialized()?this.device.getDevice():null}}function hN({geometry:e,coordinateInfo:t}){const n=g.useRef(null),r=g.useRef(null),[o,s]=g.useState(!1),i=D(B=>B.selectedEntityId),a=D(B=>B.setSelectedEntityId),l=D(B=>B.hiddenEntities),c=D(B=>B.isolatedEntities),u=D(B=>B.activeTool),d=D(B=>B.updateCameraRotationRealtime),f=D(B=>B.updateScaleRealtime),y=D(B=>B.setCameraCallbacks),p=D(B=>B.theme),x=D(B=>B.setHoverState),b=D(B=>B.clearHover),m=D(B=>B.hoverTooltipsEnabled),v=D(B=>B.openContextMenu),w=D(B=>B.startBoxSelect),S=D(B=>B.updateBoxSelect),_=D(B=>B.endBoxSelect),I=D(B=>B.boxSelect),C=D(B=>B.setSelectedEntityIds),E=D(B=>B.toggleSelection),R=D(B=>B.pendingMeasurePoint),M=D(B=>B.addMeasurePoint),N=D(B=>B.completeMeasurement),A=D(B=>B.sectionPlane),j=g.useRef([.1,.1,.1,1]);g.useEffect(()=>{p==="light"?j.current=[.95,.95,.95,1]:j.current=[.1,.1,.1,1];const B=r.current;B&&o&&B.render({hiddenIds:Q.current,isolatedIds:ee.current,selectedId:fe.current,clearColor:j.current})},[p,o]);const L=g.useRef(null),F=g.useRef(0),O=g.useRef({isDragging:!1,isPanning:!1,lastX:0,lastY:0,button:0,startX:0,startY:0,didDrag:!1}),V=g.useRef({touches:[],lastDistance:0,lastCenter:{x:0,y:0}}),k=g.useRef(0),T=g.useRef(null),$=g.useRef({handleKeyDown:null,handleKeyUp:null}),ne=g.useRef(!1),W=g.useRef({min:{x:-100,y:-100,z:-100},max:{x:100,y:100,z:100}}),Q=g.useRef(l),ee=g.useRef(c),fe=g.useRef(i),Re=g.useRef(u),oe=g.useRef(R),Se=g.useRef(A),Cn=g.useRef(I),dt=g.useRef(e),$n=g.useRef(0),Vn=50,br=g.useRef(m);g.useEffect(()=>{Q.current=l},[l]),g.useEffect(()=>{ee.current=c},[c]),g.useEffect(()=>{fe.current=i},[i]),g.useEffect(()=>{Re.current=u},[u]),g.useEffect(()=>{oe.current=R},[R]),g.useEffect(()=>{Se.current=A},[A]),g.useEffect(()=>{Cn.current=I},[I]),g.useEffect(()=>{dt.current=e},[e]),g.useEffect(()=>{br.current=m,m||b()},[m,b]),g.useEffect(()=>{const B=n.current;if(!B)return;s(!1);let zt=!1,Xt=null;const En=B.getBoundingClientRect(),_r=Math.max(1,Math.floor(En.width)),Ni=Math.max(1,Math.floor(En.height));B.width=_r,B.height=Ni;const Ce=new fN(B);return r.current=Ce,Ce.init().then(()=>{if(zt)return;s(!0);const Z=Ce.getCamera(),ge=O.current,ie=V.current;function In(z,G){if(!z)return console.warn("[Viewport] getEntityBounds: geometry is null"),null;const K=z.find(Le=>Le.expressId===G);if(!K)return console.warn(`[Viewport] getEntityBounds: mesh not found for entityId ${G}`),null;if(K.positions.length<3)return console.warn(`[Viewport] getEntityBounds: mesh has insufficient positions for entityId ${G}`),null;let pe=1/0,ve=1/0,ke=1/0,$e=-1/0,Ve=-1/0,xe=-1/0;for(let Le=0;Le<K.positions.length;Le+=3){const Be=K.positions[Le],Hn=K.positions[Le+1],Cr=K.positions[Le+2];pe=Math.min(pe,Be),ve=Math.min(ve,Hn),ke=Math.min(ke,Cr),$e=Math.max($e,Be),Ve=Math.max(Ve,Hn),xe=Math.max(xe,Cr)}return{min:{x:pe,y:ve,z:ke},max:{x:$e,y:Ve,z:xe}}}function to(z,G){const K=In(z,G);return K?{x:(K.min.x+K.max.x)/2,y:(K.min.y+K.max.y)/2,z:(K.min.z+K.max.z)/2}:null}y({setPresetView:z=>{Z.setPresetView(z,W.current),Ce.render({hiddenIds:Q.current,isolatedIds:ee.current,selectedId:fe.current,clearColor:j.current,sectionPlane:Se.current.enabled?Se.current:void 0}),Ze()},fitAll:()=>{Z.zoomExtent(W.current.min,W.current.max,300),Ze()},home:()=>{Z.zoomToFit(W.current.min,W.current.max,500),Ze()},zoomIn:()=>{Z.zoom(-50,!1),Ce.render({hiddenIds:Q.current,isolatedIds:ee.current,selectedId:fe.current,clearColor:j.current,sectionPlane:Se.current.enabled?Se.current:void 0}),Ze()},zoomOut:()=>{Z.zoom(50,!1),Ce.render({hiddenIds:Q.current,isolatedIds:ee.current,selectedId:fe.current,clearColor:j.current,sectionPlane:Se.current.enabled?Se.current:void 0}),Ze()},frameSelection:()=>{const z=fe.current,G=dt.current;if(z!==null&&G){const K=In(G,z);K?(Z.frameBounds(K.min,K.max,300),Ze()):console.warn("[Viewport] frameSelection: Could not get bounds for selected element")}else console.warn("[Viewport] frameSelection: No selection or geometry")},orbit:(z,G)=>{Z.orbit(z,G,!1),Ce.render({hiddenIds:Q.current,isolatedIds:ee.current,selectedId:fe.current,clearColor:j.current,sectionPlane:Se.current.enabled?Se.current:void 0}),d(Z.getRotation()),Ze()}});const Ze=()=>{const z=n.current;if(!z)return;const G=z.height,K=Z.getDistance(),pe=Z.getFOV(),ke=96/G*(K*Math.tan(pe/2)*2);f(ke)};let ec=0,J=0;const ye=z=>{if(zt)return;const G=z-F.current;F.current=z,Z.update(G)?(Ce.render({hiddenIds:Q.current,isolatedIds:ee.current,selectedId:fe.current,clearColor:j.current,sectionPlane:Se.current.enabled?Se.current:void 0}),d(Z.getRotation()),Ze()):!ge.isDragging&&z-ec>100&&(d(Z.getRotation()),ec=z),z-J>100&&(Ze(),J=z),L.current=requestAnimationFrame(ye)};F.current=performance.now(),L.current=requestAnimationFrame(ye),B.addEventListener("mousedown",async z=>{z.preventDefault(),ge.isDragging=!0,ge.button=z.button,ge.lastX=z.clientX,ge.lastY=z.clientY,ge.startX=z.clientX,ge.startY=z.clientY,ge.didDrag=!1;const G=Re.current;if(G==="boxselect"&&z.button===0){w(z.clientX,z.clientY),B.style.cursor="crosshair";return}if(!(G==="pan"||z.button===1||z.button===2||G==="select"&&z.shiftKey||G!=="orbit"&&G!=="select"&&z.shiftKey)&&G!=="measure"&&G!=="walk"){const pe=B.getBoundingClientRect(),ve=z.clientX-pe.left,ke=z.clientY-pe.top,$e=D.getState().progress,Ve=$e!==null&&$e.percent<100,xe=await Ce.pick(ve,ke,{isStreaming:Ve});if(xe!==null){const Le=to(dt.current,xe);Le?Z.setOrbitPivot(Le):Z.setOrbitPivot(null)}else Z.setOrbitPivot(null)}G==="pan"||z.button===1||z.button===2?(ge.isPanning=!0,B.style.cursor="move"):G==="orbit"?(ge.isPanning=!1,B.style.cursor="grabbing"):G==="select"?(ge.isPanning=z.shiftKey,B.style.cursor=z.shiftKey?"move":"grabbing"):G==="measure"?B.style.cursor="crosshair":(ge.isPanning=z.shiftKey,B.style.cursor=z.shiftKey?"move":"grabbing")}),B.addEventListener("mousemove",async z=>{const G=B.getBoundingClientRect(),K=z.clientX-G.left,pe=z.clientY-G.top;if(ge.isDragging){const ve=z.clientX-ge.lastX,ke=z.clientY-ge.lastY,$e=Re.current,Ve=z.clientX-ge.startX,xe=z.clientY-ge.startY;if((Math.abs(Ve)>5||Math.abs(xe)>5)&&(ge.didDrag=!0),$e==="boxselect"&&ge.button===0){S(z.clientX,z.clientY);return}ge.isPanning||$e==="pan"?Z.pan(ve,ke,!1):$e==="walk"?(Z.orbit(ve*.5,0,!1),Math.abs(ke)>2&&Z.zoom(ke*2,!1)):Z.orbit(ve,ke,!1),ge.lastX=z.clientX,ge.lastY=z.clientY,Ce.render({hiddenIds:Q.current,isolatedIds:ee.current,selectedId:fe.current,clearColor:j.current,sectionPlane:Se.current.enabled?Se.current:void 0}),d(Z.getRotation()),Ze(),b()}else if(br.current){const ve=Date.now();if(ve-$n.current>Vn){$n.current=ve;const ke=D.getState().progress,$e=ke!==null&&ke.percent<100,Ve=await Ce.pick(K,pe,{isStreaming:$e});Ve?x({entityId:Ve,screenX:z.clientX,screenY:z.clientY}):b()}}}),B.addEventListener("mouseup",()=>{ge.isDragging=!1,ge.isPanning=!1;const z=Re.current;B.style.cursor=z==="pan"||z==="orbit"?"grab":"default",Z.setOrbitPivot(null)}),B.addEventListener("mouseleave",()=>{ge.isDragging=!1,ge.isPanning=!1,Z.stopInertia(),Z.setOrbitPivot(null),B.style.cursor="default",b()}),B.addEventListener("contextmenu",async z=>{z.preventDefault();const G=B.getBoundingClientRect(),K=z.clientX-G.left,pe=z.clientY-G.top,ve=await Ce.pick(K,pe);v(ve,z.clientX,z.clientY)}),B.addEventListener("wheel",z=>{z.preventDefault();const G=B.getBoundingClientRect(),K=z.clientX-G.left,pe=z.clientY-G.top;Z.zoom(z.deltaY,!1,K,pe,B.width,B.height),Ce.render({hiddenIds:Q.current,isolatedIds:ee.current,selectedId:fe.current,clearColor:j.current,sectionPlane:Se.current.enabled?Se.current:void 0})}),B.addEventListener("click",async z=>{const G=B.getBoundingClientRect(),K=z.clientX-G.left,pe=z.clientY-G.top,ve=Re.current;if(ge.didDrag||ve==="orbit"||ve==="pan"||ve==="walk")return;if(ve==="measure"){const xe=D.getState().progress,Le=xe!==null&&xe.percent<100,Be=await Ce.pick(K,pe,{isStreaming:Le});if(Be){const Hn=cn(dt.current,Be,K,pe,B.width,B.height),Cr={x:Hn.x,y:Hn.y,z:Hn.z,screenX:z.clientX,screenY:z.clientY};oe.current?N(Cr):M(Cr)}return}if(ve==="boxselect"){const xe=Cn.current,Le=dt.current;if(xe.isSelecting&&Le){const Be={left:Math.min(xe.startX,xe.currentX),right:Math.max(xe.startX,xe.currentX),top:Math.min(xe.startY,xe.currentY),bottom:Math.max(xe.startY,xe.currentY)},Hn=Be.right-Be.left,Cr=Be.bottom-Be.top;if(Hn>5&&Cr>5){const Ai=B.getBoundingClientRect(),i1=Be.left-Ai.left,a1=Be.right-Ai.left,l1=Be.top-Ai.top,c1=Be.bottom-Ai.top,tc=[];for(const no of Le)if(no.positions.length>=3){let nc=1/0,rc=1/0,oc=1/0,sc=-1/0,ic=-1/0,ac=-1/0;for(let ls=0;ls<no.positions.length;ls+=3){const ch=no.positions[ls],uh=no.positions[ls+1],dh=no.positions[ls+2];nc=Math.min(nc,ch),rc=Math.min(rc,uh),oc=Math.min(oc,dh),sc=Math.max(sc,ch),ic=Math.max(ic,uh),ac=Math.max(ac,dh)}const u1={x:(nc+sc)/2,y:(rc+ic)/2,z:(oc+ac)/2},as=Z.projectToScreen(u1,B.width,B.height);as&&as.x>=i1&&as.x<=a1&&as.y>=l1&&as.y<=c1&&tc.push(no.expressId)}tc.length>0&&C(tc)}}_();return}const ke=Date.now(),$e=ke-k.current,Ve={x:K,y:pe};if(T.current&&$e<300&&Math.abs(Ve.x-T.current.x)<5&&Math.abs(Ve.y-T.current.y)<5){const xe=D.getState().progress,Le=xe!==null&&xe.percent<100,Be=await Ce.pick(K,pe,{isStreaming:Le});Be&&a(Be),k.current=0,T.current=null}else{const xe=D.getState().progress,Le=xe!==null&&xe.percent<100,Be=await Ce.pick(K,pe,{isStreaming:Le});z.ctrlKey||z.metaKey?Be&&E(Be):a(Be),k.current=ke,T.current=Ve}});function cn(z,G,K,pe,ve,ke){return to(z,G)||{x:0,y:0,z:0}}B.addEventListener("touchstart",async z=>{if(z.preventDefault(),ie.touches=Array.from(z.touches),ie.touches.length===1){ie.lastCenter={x:ie.touches[0].clientX,y:ie.touches[0].clientY};const G=B.getBoundingClientRect(),K=ie.touches[0].clientX-G.left,pe=ie.touches[0].clientY-G.top,ve=D.getState().progress,ke=ve!==null&&ve.percent<100,$e=await Ce.pick(K,pe,{isStreaming:ke});if($e!==null){const Ve=to(dt.current,$e);Ve?Z.setOrbitPivot(Ve):Z.setOrbitPivot(null)}else Z.setOrbitPivot(null)}else if(ie.touches.length===2){const G=ie.touches[1].clientX-ie.touches[0].clientX,K=ie.touches[1].clientY-ie.touches[0].clientY;ie.lastDistance=Math.sqrt(G*G+K*K),ie.lastCenter={x:(ie.touches[0].clientX+ie.touches[1].clientX)/2,y:(ie.touches[0].clientY+ie.touches[1].clientY)/2}}}),B.addEventListener("touchmove",z=>{if(z.preventDefault(),ie.touches=Array.from(z.touches),ie.touches.length===1){const G=ie.touches[0].clientX-ie.lastCenter.x,K=ie.touches[0].clientY-ie.lastCenter.y;Z.orbit(G,K,!1),ie.lastCenter={x:ie.touches[0].clientX,y:ie.touches[0].clientY},Ce.render({hiddenIds:Q.current,isolatedIds:ee.current,selectedId:fe.current,clearColor:j.current})}else if(ie.touches.length===2){const G=ie.touches[1].clientX-ie.touches[0].clientX,K=ie.touches[1].clientY-ie.touches[0].clientY,pe=Math.sqrt(G*G+K*K),ve=(ie.touches[0].clientX+ie.touches[1].clientX)/2,ke=(ie.touches[0].clientY+ie.touches[1].clientY)/2,$e=ve-ie.lastCenter.x,Ve=ke-ie.lastCenter.y;Z.pan($e,Ve,!1);const xe=pe-ie.lastDistance,Le=B.getBoundingClientRect();Z.zoom(xe*10,!1,ve-Le.left,ke-Le.top,B.width,B.height),ie.lastDistance=pe,ie.lastCenter={x:ve,y:ke},Ce.render({hiddenIds:Q.current,isolatedIds:ee.current,selectedId:fe.current,clearColor:j.current,sectionPlane:Se.current.enabled?Se.current:void 0})}}),B.addEventListener("touchend",z=>{z.preventDefault(),ie.touches=Array.from(z.touches),ie.touches.length===0&&(Z.stopInertia(),Z.setOrbitPivot(null))});const ae={},bt=z=>{if(document.activeElement?.tagName==="INPUT"||document.activeElement?.tagName==="TEXTAREA")return;ae[z.key.toLowerCase()]=!0;const G=K=>{Z.setPresetView(K,W.current),Ce.render({hiddenIds:Q.current,isolatedIds:ee.current,selectedId:fe.current,clearColor:j.current}),d(Z.getRotation()),Ze()};if(z.key==="1"&&G("top"),z.key==="2"&&G("bottom"),z.key==="3"&&G("front"),z.key==="4"&&G("back"),z.key==="5"&&G("left"),z.key==="6"&&G("right"),z.key==="f"||z.key==="F"){const K=fe.current;if(K!==null){const pe=In(dt.current,K);pe&&Z.frameBounds(pe.min,pe.max,300)}else Z.zoomExtent(W.current.min,W.current.max,300);Ze()}(z.key==="h"||z.key==="H")&&(Z.zoomToFit(W.current.min,W.current.max,500),Ze()),(z.key==="z"||z.key==="Z")&&(Z.zoomExtent(W.current.min,W.current.max,300),Ze()),(z.key==="c"||z.key==="C")&&(ne.current=!ne.current,Z.enableFirstPersonMode(ne.current))},un=z=>{ae[z.key.toLowerCase()]=!1};$.current.handleKeyDown=bt,$.current.handleKeyUp=un;const Qt=()=>{if(zt)return;let z=!1;const G=5,K=.1;ne.current?((ae.w||ae.arrowup)&&(Z.moveFirstPerson(1,0,0),z=!0),(ae.s||ae.arrowdown)&&(Z.moveFirstPerson(-1,0,0),z=!0),(ae.a||ae.arrowleft)&&(Z.moveFirstPerson(0,-1,0),z=!0),(ae.d||ae.arrowright)&&(Z.moveFirstPerson(0,1,0),z=!0),ae.q&&(Z.moveFirstPerson(0,0,-1),z=!0),ae.e&&(Z.moveFirstPerson(0,0,1),z=!0)):((ae.w||ae.arrowup)&&(Z.pan(0,G,!1),z=!0),(ae.s||ae.arrowdown)&&(Z.pan(0,-G,!1),z=!0),(ae.a||ae.arrowleft)&&(Z.pan(-G,0,!1),z=!0),(ae.d||ae.arrowright)&&(Z.pan(G,0,!1),z=!0),ae.q&&(Z.zoom(-K*100,!1),z=!0),ae.e&&(Z.zoom(K*100,!1),z=!0)),z&&Ce.render({hiddenIds:Q.current,isolatedIds:ee.current,selectedId:fe.current,clearColor:j.current,sectionPlane:Se.current.enabled?Se.current:void 0}),requestAnimationFrame(Qt)};window.addEventListener("keydown",bt),window.addEventListener("keyup",un),Qt(),Xt=new ResizeObserver(()=>{if(zt)return;const z=B.getBoundingClientRect(),G=Math.max(1,Math.floor(z.width)),K=Math.max(1,Math.floor(z.height));Ce.resize(G,K),Ce.render({hiddenIds:Q.current,isolatedIds:ee.current,selectedId:fe.current,clearColor:j.current})}),Xt.observe(B),Ce.render({hiddenIds:Q.current,isolatedIds:ee.current,selectedId:fe.current,clearColor:j.current})}),()=>{zt=!0,L.current!==null&&cancelAnimationFrame(L.current),Xt&&Xt.disconnect(),$.current.handleKeyDown&&window.removeEventListener("keydown",$.current.handleKeyDown),$.current.handleKeyUp&&window.removeEventListener("keyup",$.current.handleKeyUp),s(!1),r.current=null}},[a]);const ss=g.useRef(new Set),eo=g.useRef(0),Sr=g.useRef(null),Gn=g.useRef(!1),is=g.useRef(!1),Jl=g.useRef(0),s1=200,ih=D(B=>B.progress),Wn=ih!==null&&ih.percent<100;g.useEffect(()=>{const B=r.current;if(!B||!e||!o)return;const zt=B.getGPUDevice();if(!zt)return;const Xt=B.getScene(),En=e.length,_r=eo.current,Ni=En>_r&&_r>0,Ce=En>0&&_r===0&&Sr.current!==null;if(En===0){Xt.clear(),ss.current.clear(),Gn.current=!1,is.current=!1,eo.current=0,Sr.current=null,B.getCamera().reset(),W.current={min:{x:-100,y:-100,z:-100},max:{x:100,y:100,z:100}};return}else if(Ce)Xt.clear(),ss.current.clear(),Gn.current=!1,is.current=!1,eo.current=0,Sr.current=e,B.getCamera().reset(),W.current={min:{x:-100,y:-100,z:-100},max:{x:100,y:100,z:100}};else if(!Ni&&En!==_r)Xt.clear(),ss.current.clear(),Gn.current=!1,is.current=!1,eo.current=0,Sr.current=e,B.getCamera().reset(),W.current={min:{x:-100,y:-100,z:-100},max:{x:100,y:100,z:100}};else if(En===_r){if(Gn.current&&!Wn&&!is.current&&t?.shiftedBounds){const J=t.shiftedBounds,ye=Math.max(J.max.x-J.min.x,J.max.y-J.min.y,J.max.z-J.min.z);if(ye>0&&Number.isFinite(ye)){if(e.length>1e3){const ae=W.current,bt=Math.max(ae.max.x-ae.min.x,ae.max.y-ae.min.y,ae.max.z-ae.min.z);ye>bt*1.1&&(console.log("[Viewport] Refitting camera after streaming complete - bounds expanded:",{oldMaxSize:bt.toFixed(1),newMaxSize:ye.toFixed(1),expansion:((ye/bt-1)*100).toFixed(0)+"%"}),B.getCamera().fitToBounds(J.min,J.max))}W.current={min:{...J.min},max:{...J.max}},is.current=!0}}return}(Ni||Sr.current===null)&&(Sr.current=e);const ge=eo.current,ie=e.slice(ge),In=[];for(const J of ie)ss.current.has(J.expressId)||(In.push(J),ss.current.add(J.expressId));if(In.length>0){const J=B.getPipeline();if(J){Xt.appendToBatches(In,zt,J);for(const ye of In)Xt.addMeshData(ye)}else for(const ye of In){const cn=ye.positions.length/3,ae=new Float32Array(cn*6);for(let Qt=0;Qt<cn;Qt++){const z=Qt*6,G=Qt*3;ae[z]=ye.positions[G],ae[z+1]=ye.positions[G+1],ae[z+2]=ye.positions[G+2],ae[z+3]=ye.normals[G],ae[z+4]=ye.normals[G+1],ae[z+5]=ye.normals[G+2]}const bt=zt.createBuffer({size:ae.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});zt.queue.writeBuffer(bt,0,ae);const un=zt.createBuffer({size:ye.indices.byteLength,usage:GPUBufferUsage.INDEX|GPUBufferUsage.COPY_DST});zt.queue.writeBuffer(un,0,ye.indices),Xt.addMesh({expressId:ye.expressId,vertexBuffer:bt,indexBuffer:un,indexCount:ye.indices.length,transform:Jn.identity(),color:ye.color})}}if(eo.current=En,!Gn.current&&t?.shiftedBounds){const J=t.shiftedBounds,ye=Math.max(J.max.x-J.min.x,J.max.y-J.min.y,J.max.z-J.min.z);ye>0&&Number.isFinite(ye)&&(B.getCamera().fitToBounds(J.min,J.max),W.current={min:{...J.min},max:{...J.max}},Gn.current=!0)}else if(!Gn.current&&e.length>0&&!Wn){const J={min:{x:1/0,y:1/0,z:1/0},max:{x:-1/0,y:-1/0,z:-1/0}};for(const cn of e)for(let ae=0;ae<cn.positions.length;ae+=3){const bt=cn.positions[ae],un=cn.positions[ae+1],Qt=cn.positions[ae+2];Number.isFinite(bt)&&Number.isFinite(un)&&Number.isFinite(Qt)&&(J.min.x=Math.min(J.min.x,bt),J.min.y=Math.min(J.min.y,un),J.min.z=Math.min(J.min.z,Qt),J.max.x=Math.max(J.max.x,bt),J.max.y=Math.max(J.max.y,un),J.max.z=Math.max(J.max.z,Qt))}const ye=Math.max(J.max.x-J.min.x,J.max.y-J.min.y,J.max.z-J.min.z);J.min.x!==1/0&&ye>0&&Number.isFinite(ye)&&(B.getCamera().fitToBounds(J.min,J.max),W.current=J,Gn.current=!0)}const to=Date.now(),Ze=to-Jl.current;(!Wn||Ze>=s1)&&(B.render(),Jl.current=to)},[e,t,o,Wn]);const ah=g.useRef(Wn);g.useEffect(()=>{const B=r.current;!B||!o||(ah.current&&!Wn&&(B.render(),Jl.current=Date.now()),ah.current=Wn)},[Wn,o]);const lh=D(B=>B.selectedEntityIds);return g.useEffect(()=>{const B=r.current;!B||!o||B.render({hiddenIds:l,isolatedIds:c,selectedId:i,selectedIds:lh,clearColor:j.current,sectionPlane:A.enabled?A:void 0})},[l,c,i,lh,o,A]),h.jsx("canvas",{ref:n,className:"w-full h-full block"})}const pN=[{id:"front",label:"FRONT",transform:e=>`translateZ(${e}px)`},{id:"back",label:"BACK",transform:e=>`translateZ(${-e}px) rotateY(180deg)`},{id:"top",label:"TOP",transform:e=>`translateY(${-e}px) rotateX(90deg)`},{id:"bottom",label:"BTM",transform:e=>`translateY(${e}px) rotateX(-90deg)`},{id:"right",label:"RIGHT",transform:e=>`translateX(${e}px) rotateY(90deg)`},{id:"left",label:"LEFT",transform:e=>`translateX(${-e}px) rotateY(-90deg)`}],o1=g.forwardRef(({onViewChange:e,onDrag:t,rotationX:n=-25,rotationY:r=45},o)=>{const[s,i]=g.useState(null),[a,l]=g.useState(!1),c=g.useRef(null),u=g.useRef(!1),d=g.useRef(!1),f=g.useRef(t),y=g.useRef(null),p=g.useRef(null),x=g.useRef(null);g.useEffect(()=>{f.current=t},[t]),g.useImperativeHandle(o,()=>({updateRotation:(S,_)=>{y.current&&(x.current={x:S,y:_},p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{y.current&&x.current&&(y.current.style.transform=`rotateX(${x.current.x}deg) rotateY(${x.current.y}deg)`,x.current=null),p.current=null}))}}),[]),g.useEffect(()=>{y.current&&(y.current.style.transform=`rotateX(${n}deg) rotateY(${r}deg)`)},[]);const b=60,m=b/2,v=g.useCallback(S=>{c.current={x:S.clientX,y:S.clientY},u.current=!1,d.current=!1,l(!0)},[]);g.useEffect(()=>{if(!a){document.body.style.cursor="";return}const S=I=>{if(!c.current)return;const C=I.clientX-c.current.x,E=I.clientY-c.current.y;!d.current&&(Math.abs(C)>5||Math.abs(E)>5)&&(d.current=!0,u.current=!0,document.body.style.cursor="grabbing"),d.current&&(f.current?.(C*2,E*2),c.current={x:I.clientX,y:I.clientY})},_=()=>{l(!1),d.current=!1,c.current=null,document.body.style.cursor="",setTimeout(()=>{u.current=!1},50)};return document.addEventListener("mousemove",S),document.addEventListener("mouseup",_),()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",_),document.body.style.cursor=""}},[a]);const w=g.useCallback(S=>{u.current||e?.(S)},[e]);return h.jsx("div",{className:"relative select-none",style:{width:b,height:b,perspective:200},onMouseDown:v,children:h.jsx("div",{ref:y,className:"relative w-full h-full",style:{transformStyle:"preserve-3d",transform:`rotateX(${n}deg) rotateY(${r}deg)`},children:pN.map(({id:S,label:_,transform:I})=>h.jsx("button",{type:"button",className:Ie("absolute w-full h-full flex items-center justify-center text-[10px] font-bold transition-colors cursor-pointer","bg-card/95 border border-border/50",s===S?"bg-primary/30 border-primary text-primary":"hover:bg-muted"),style:{transform:I(m),backfaceVisibility:"hidden"},onMouseEnter:()=>i(S),onMouseLeave:()=>i(null),onClick:()=>w(S),children:_},S))})})});o1.displayName="ViewCube";function mN({rotationX:e=-25,rotationY:t=45}){return h.jsx("div",{className:"relative select-none",style:{width:50,height:50,perspective:200},children:h.jsxs("div",{className:"relative w-full h-full",style:{transformStyle:"preserve-3d",transform:`rotateX(${e}deg) rotateY(${t}deg)`},children:[h.jsx("div",{className:"absolute bg-red-500",style:{width:20,height:2,left:50/2,top:50/2-1,transformOrigin:"left center",transform:"rotateY(0deg)"}}),h.jsx("div",{className:"absolute text-red-500 font-bold text-xs",style:{left:50/2+26,top:50/2-6,transform:`rotateY(${-t}deg) rotateX(${-e}deg)`,transformStyle:"preserve-3d"},children:"X"}),h.jsx("div",{className:"absolute bg-blue-500",style:{width:2,height:20,left:50/2-1,top:50/2-20,transformOrigin:"center bottom"}}),h.jsx("div",{className:"absolute text-blue-500 font-bold text-xs",style:{left:50/2-4,top:50/2-26-6,transform:`rotateY(${-t}deg) rotateX(${-e}deg)`,transformStyle:"preserve-3d"},children:"Z"}),h.jsx("div",{className:"absolute bg-green-500",style:{width:20,height:2,left:50/2,top:50/2-1,transformOrigin:"left center",transform:"rotateY(-90deg)"}}),h.jsx("div",{className:"absolute text-green-500 font-bold text-xs",style:{left:50/2-4,top:50/2+6,transform:`translateZ(26px) rotateY(${-t}deg) rotateX(${-e}deg)`,transformStyle:"preserve-3d"},children:"Y"}),h.jsx("div",{className:"absolute w-2 h-2 bg-white rounded-full border border-gray-400",style:{left:50/2-4,top:50/2-4}})]})})}function gN(){const e=D(_=>_.selectedStorey),t=D(_=>_.hiddenEntities),n=D(_=>_.isolatedEntities),r=D(_=>_.cameraCallbacks),o=D(_=>_.setOnCameraRotationChange),s=D(_=>_.setOnScaleChange),{ifcDataStore:i,geometryResult:a}=wr(),l=g.useRef({azimuth:45,elevation:25}),c=g.useRef(null),[u,d]=g.useState(10);g.useEffect(()=>(o(I=>{if(l.current=I,c.current){const C=-I.elevation,E=-I.azimuth;c.current.updateRotation(C,E)}}),()=>o(null)),[o]),g.useEffect(()=>(s(d),()=>s(null)),[s]);const f=e&&i?i.entities.getName(e)||`Storey #${e}`:null,y=a?.meshes?.length??0;n!==null?n.size:t.size>0&&y-t.size;const p=-l.current.elevation,x=-l.current.azimuth,b=g.useCallback(_=>{const C={top:"top",bottom:"bottom",front:"front",back:"back",left:"left",right:"right"}[_];C&&r.setPresetView&&r.setPresetView(C)},[r]),m=g.useCallback(()=>{r.home?.()},[r]);g.useCallback(()=>{r.fitAll?.()},[r]);const v=g.useCallback(()=>{r.zoomIn?.()},[r]),w=g.useCallback(()=>{r.zoomOut?.()},[r]),S=_=>_>=1e3?`${(_/1e3).toFixed(1)}km`:_>=1?`${_.toFixed(1)}m`:_>=.1?`${(_*100).toFixed(0)}cm`:`${(_*1e3).toFixed(0)}mm`;return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"absolute bottom-4 right-4 flex flex-col gap-1 bg-background/80 backdrop-blur-sm rounded-lg border shadow-sm p-1",children:[h.jsxs(Ot,{children:[h.jsx(Bt,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:m,children:h.jsx(Fv,{className:"h-4 w-4"})})}),h.jsx(Ct,{side:"left",children:"Home (H)"})]}),h.jsxs(Ot,{children:[h.jsx(Bt,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:v,children:h.jsx(q2,{className:"h-4 w-4"})})}),h.jsx(Ct,{side:"left",children:"Zoom In (+)"})]}),h.jsxs(Ot,{children:[h.jsx(Bt,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:w,children:h.jsx(Q2,{className:"h-4 w-4"})})}),h.jsx(Ct,{side:"left",children:"Zoom Out (-)"})]})]}),f&&h.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 px-4 py-2 bg-background/80 backdrop-blur-sm rounded-full border shadow-sm",children:h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[h.jsx(Dl,{className:"h-4 w-4 text-primary"}),h.jsx("span",{className:"font-medium",children:f})]})}),h.jsx("div",{className:"absolute top-6 right-6",children:h.jsx(o1,{ref:c,onViewChange:b,onDrag:(_,I)=>r.orbit?.(_,I),rotationX:p,rotationY:x})}),h.jsx("div",{className:"absolute bottom-16 left-4",children:h.jsx(mN,{rotationX:p,rotationY:x})}),h.jsxs("div",{className:"absolute bottom-4 left-4 flex flex-col items-start gap-1",children:[h.jsx("div",{className:"h-1 w-24 bg-foreground/80 rounded-full"}),h.jsx("span",{className:"text-xs text-foreground/80",children:S(u)})]})]})}function yN(){const e=D(t=>t.activeTool);return e==="measure"?h.jsx(vN,{}):e==="section"?h.jsx(bN,{}):null}function vN(){const e=D(c=>c.measurements),t=D(c=>c.pendingMeasurePoint),n=D(c=>c.deleteMeasurement),r=D(c=>c.clearMeasurements),o=D(c=>c.setActiveTool),s=g.useCallback(()=>{r()},[r]),i=g.useCallback(()=>{o("select")},[o]),a=g.useCallback(c=>{n(c)},[n]),l=e.reduce((c,u)=>c+u.distance,0);return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 bg-background/95 backdrop-blur-sm rounded-lg border shadow-lg p-3 min-w-64 z-30",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4 mb-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Lv,{className:"h-4 w-4 text-primary"}),h.jsx("span",{className:"font-medium text-sm",children:"Measure Tool"})]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:s,title:"Clear all",children:h.jsx(V2,{className:"h-4 w-4"})}),h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:i,title:"Close",children:h.jsx(Ul,{className:"h-4 w-4"})})]})]}),h.jsx("div",{className:"text-xs text-muted-foreground mb-3",children:"Click on the model to place measurement points"}),e.length>0?h.jsxs("div",{className:"space-y-2",children:[e.map((c,u)=>h.jsx(xN,{measurement:c,index:u,onDelete:a},c.id)),e.length>1&&h.jsxs("div",{className:"flex items-center justify-between border-t pt-2 mt-2 text-sm font-medium",children:[h.jsx("span",{children:"Total"}),h.jsx("span",{className:"font-mono",children:sh(l)})]})]}):h.jsx("div",{className:"text-center py-4 text-muted-foreground text-sm",children:"No measurements yet"})]}),h.jsx("div",{className:"absolute bottom-20 left-1/2 -translate-x-1/2 bg-primary text-primary-foreground px-4 py-2 rounded-full text-sm shadow-lg z-30",children:t?"Click to set end point":"Click on model to set start point"}),h.jsx(wN,{measurements:e,pending:t})]})}function xN({measurement:e,index:t,onDelete:n}){return h.jsxs("div",{className:"flex items-center justify-between bg-muted/50 rounded px-2 py-1 text-sm",children:[h.jsxs("span",{className:"text-muted-foreground",children:["#",t+1]}),h.jsx("span",{className:"font-mono",children:sh(e.distance)}),h.jsx(Te,{variant:"ghost",size:"icon-sm",className:"h-5 w-5",onClick:()=>n(e.id),children:h.jsx(Ul,{className:"h-3 w-3"})})]})}function wN({measurements:e,pending:t}){return h.jsxs(h.Fragment,{children:[e.map(n=>h.jsxs("div",{children:[h.jsxs("svg",{className:"absolute inset-0 pointer-events-none z-20",style:{overflow:"visible"},children:[h.jsx("line",{x1:n.start.screenX,y1:n.start.screenY,x2:n.end.screenX,y2:n.end.screenY,stroke:"hsl(var(--primary))",strokeWidth:"2",strokeDasharray:"5,5"}),h.jsx("circle",{cx:n.start.screenX,cy:n.start.screenY,r:"4",fill:"hsl(var(--primary))"}),h.jsx("circle",{cx:n.end.screenX,cy:n.end.screenY,r:"4",fill:"hsl(var(--primary))"})]}),h.jsx("div",{className:"absolute pointer-events-none z-20 bg-primary text-primary-foreground px-2 py-0.5 rounded text-xs font-mono -translate-x-1/2 -translate-y-1/2",style:{left:(n.start.screenX+n.end.screenX)/2,top:(n.start.screenY+n.end.screenY)/2},children:sh(n.distance)})]},n.id)),t&&h.jsxs("svg",{className:"absolute inset-0 pointer-events-none z-20",style:{overflow:"visible"},children:[h.jsx("circle",{cx:t.screenX,cy:t.screenY,r:"6",fill:"none",stroke:"hsl(var(--primary))",strokeWidth:"2"}),h.jsx("circle",{cx:t.screenX,cy:t.screenY,r:"3",fill:"hsl(var(--primary))"})]})]})}function bN(){const e=D(c=>c.sectionPlane),t=D(c=>c.setSectionPlaneAxis),n=D(c=>c.setSectionPlanePosition),r=D(c=>c.toggleSectionPlane),o=D(c=>c.flipSectionPlane),s=D(c=>c.setActiveTool),i=g.useCallback(()=>{s("select")},[s]),a=g.useCallback(c=>{t(c)},[t]),l=g.useCallback(c=>{n(Number(c.target.value))},[n]);return h.jsxs("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 bg-background/95 backdrop-blur-sm rounded-lg border shadow-lg p-3 min-w-72 z-30",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4 mb-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(j2,{className:"h-4 w-4 text-primary"}),h.jsx("span",{className:"font-medium text-sm",children:"Section Plane"})]}),h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:i,title:"Close",children:h.jsx(Ul,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"text-xs text-muted-foreground mb-2 block",children:"Axis"}),h.jsx("div",{className:"flex gap-1",children:["x","y","z"].map(c=>h.jsx(Te,{variant:e.axis===c?"default":"outline",size:"sm",className:"flex-1",onClick:()=>a(c),children:c.toUpperCase()},c))})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("label",{className:"text-xs text-muted-foreground",children:"Position"}),h.jsxs("span",{className:"text-xs font-mono",children:[e.position,"%"]})]}),h.jsx("input",{type:"range",min:"0",max:"100",value:e.position,onChange:l,className:"w-full h-2 bg-muted rounded-lg appearance-none cursor-pointer accent-primary"})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(Te,{variant:e.enabled?"default":"outline",size:"sm",className:"flex-1",onClick:r,children:e.enabled?"Disable":"Enable"}),h.jsx(Te,{variant:"outline",size:"sm",className:"flex-1",onClick:o,children:"Flip"})]}),h.jsx("div",{className:"text-xs text-muted-foreground text-center",children:"Section plane cuts the model along the selected axis"})]})]})}function sh(e){return e<.01?`${(e*1e3).toFixed(1)} mm`:e<1?`${(e*100).toFixed(1)} cm`:e<1e3?`${e.toFixed(2)} m`:`${(e/1e3).toFixed(2)} km`}function sg(){const{geometryResult:e,ifcDataStore:t}=wr(),n=D(o=>o.selectedStorey),r=g.useMemo(()=>{if(!e?.meshes||!t?.spatialHierarchy)return e?.meshes||null;if(n===null)return e.meshes;const s=t.spatialHierarchy.byStorey.get(n);if(!s||s.length===0)return e.meshes;const i=new Set(s);return e.meshes.filter(a=>i.has(a.expressId))},[e,t,n]);return h.jsxs("div",{className:"relative h-full w-full bg-gradient-to-br from-slate-100 to-slate-200 dark:from-slate-900 dark:to-slate-800",children:[h.jsx(hN,{geometry:r,coordinateInfo:e?.coordinateInfo}),h.jsx(gN,{}),h.jsx(yN,{})]})}function SN(e={}){const{enabled:t=!0}=e,n=D(u=>u.selectedEntityId),r=D(u=>u.setSelectedEntityId),o=D(u=>u.setActiveTool),s=D(u=>u.isolateEntity),i=D(u=>u.hideEntity),a=D(u=>u.showAll),l=D(u=>u.toggleTheme),c=g.useCallback(u=>{const d=u.target;if(d.tagName==="INPUT"||d.tagName==="TEXTAREA"||d.isContentEditable)return;const f=u.ctrlKey||u.metaKey,y=u.shiftKey,p=u.key.toLowerCase();p==="v"&&!f&&!y&&(u.preventDefault(),o("select")),p==="p"&&!f&&!y&&(u.preventDefault(),o("pan")),p==="o"&&!f&&!y&&(u.preventDefault(),o("orbit")),p==="c"&&!f&&!y&&(u.preventDefault(),o("walk")),p==="m"&&!f&&!y&&(u.preventDefault(),o("measure")),p==="x"&&!f&&!y&&(u.preventDefault(),o("section")),p==="b"&&!f&&!y&&(u.preventDefault(),o("boxselect")),p==="i"&&!f&&!y&&n&&(u.preventDefault(),s(n)),(p==="delete"||p==="backspace")&&!f&&!y&&n&&(u.preventDefault(),i(n)),p==="a"&&!f&&!y&&(u.preventDefault(),a()),p==="escape"&&(u.preventDefault(),r(null),a(),o("select")),p==="t"&&!f&&!y&&(u.preventDefault(),l())},[n,r,o,s,i,a,l]);g.useEffect(()=>{if(t)return window.addEventListener("keydown",c),()=>{window.removeEventListener("keydown",c)}},[t,c])}const _N=[{key:"V",description:"Select tool",category:"Tools"},{key:"B",description:"Box select tool",category:"Tools"},{key:"P",description:"Pan tool",category:"Tools"},{key:"O",description:"Orbit tool",category:"Tools"},{key:"C",description:"Walk mode",category:"Tools"},{key:"M",description:"Measure tool",category:"Tools"},{key:"X",description:"Section tool",category:"Tools"},{key:"I",description:"Isolate selection",category:"Visibility"},{key:"Del",description:"Hide selection",category:"Visibility"},{key:"A",description:"Show all",category:"Visibility"},{key:"H",description:"Home (Isometric view)",category:"Camera"},{key:"Z",description:"Fit all (zoom extents)",category:"Camera"},{key:"F",description:"Frame selection",category:"Camera"},{key:"0-6",description:"Preset views",category:"Camera"},{key:"T",description:"Toggle theme",category:"UI"},{key:"Esc",description:"Clear selection & switch to Select tool",category:"Selection"},{key:"?",description:"Show keyboard shortcuts",category:"Help"}];function CN({open:e,onClose:t}){if(g.useEffect(()=>{const r=o=>{o.key==="Escape"&&e&&t()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e,t]),!e)return null;const n=_N.reduce((r,o)=>(r[o.category]||(r[o.category]=[]),r[o.category].push(o),r),{});return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:h.jsxs("div",{className:"bg-card border rounded-lg shadow-xl w-full max-w-md m-4",children:[h.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[h.jsx("h2",{className:"text-lg font-semibold",children:"Keyboard Shortcuts"}),h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:t,children:h.jsx(Ul,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"p-4 max-h-96 overflow-y-auto",children:Object.entries(n).map(([r,o])=>h.jsxs("div",{className:"mb-4 last:mb-0",children:[h.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-2",children:r}),h.jsx("div",{className:"space-y-1",children:o.map(s=>h.jsxs("div",{className:"flex items-center justify-between py-1",children:[h.jsx("span",{className:"text-sm",children:s.description}),h.jsx("kbd",{className:"px-2 py-0.5 text-xs bg-muted rounded border font-mono",children:s.key})]},s.key+s.description))})]},r))}),h.jsx("div",{className:"p-4 border-t text-center",children:h.jsxs("span",{className:"text-xs text-muted-foreground",children:["Press ",h.jsx("kbd",{className:"px-1 py-0.5 bg-muted rounded border font-mono text-xs",children:"?"})," to toggle this dialog"]})})]})})}function EN(){const[e,t]=g.useState(!1),n=g.useCallback(()=>t(o=>!o),[]),r=g.useCallback(()=>t(!1),[]);return g.useEffect(()=>{const o=s=>{(s.key==="?"||s.key==="/"&&s.shiftKey)&&(s.preventDefault(),n())};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n]),{open:e,toggle:n,close:r}}function IN(){const e=D(w=>w.contextMenu),t=D(w=>w.closeContextMenu),n=D(w=>w.isolateEntity),r=D(w=>w.hideEntity),o=D(w=>w.showAll),s=D(w=>w.setSelectedEntityId),i=D(w=>w.setSelectedEntityIds),a=D(w=>w.cameraCallbacks),l=g.useRef(null),{ifcDataStore:c}=wr();g.useEffect(()=>{const w=S=>{l.current&&!l.current.contains(S.target)&&t()};if(e.isOpen)return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[e.isOpen,t]),g.useEffect(()=>{const w=S=>{S.key==="Escape"&&t()};if(e.isOpen)return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[e.isOpen,t]);const u=g.useCallback(()=>{e.entityId&&(s(e.entityId),a.fitAll?.()),t()},[e.entityId,s,a,t]),d=g.useCallback(()=>{e.entityId&&n(e.entityId),t()},[e.entityId,n,t]),f=g.useCallback(()=>{e.entityId&&r(e.entityId),t()},[e.entityId,r,t]),y=g.useCallback(()=>{o(),t()},[o,t]),p=g.useCallback(()=>{if(!e.entityId||!c){t();return}const w=c.entities;let S=null;for(let _=0;_<w.count;_++)if(w.expressId[_]===e.entityId){S=w.getTypeName(e.entityId);break}if(S){const _=[];for(let I=0;I<w.count;I++)w.getTypeName(w.expressId[I])===S&&_.push(w.expressId[I]);i(_)}t()},[e.entityId,c,i,t]),x=g.useCallback(()=>{if(!e.entityId||!c?.spatialHierarchy){t();return}const w=c.spatialHierarchy.elementToStorey.get(e.entityId);if(w){const S=c.spatialHierarchy.byStorey.get(w);S&&i(Array.from(S))}t()},[e.entityId,c,i,t]),b=g.useCallback(()=>{if(e.entityId&&c){const w=c.entities.getGlobalId(e.entityId);w&&navigator.clipboard.writeText(w)}t()},[e.entityId,c,t]);if(!e.isOpen)return null;let m="",v="";return e.entityId&&c&&(m=c.entities.getName(e.entityId)||"",v=c.entities.getTypeName(e.entityId)||""),h.jsxs("div",{ref:l,className:"fixed z-50 bg-popover border rounded-lg shadow-lg py-1 min-w-48",style:{left:e.screenX,top:e.screenY},children:[e.entityId&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"px-3 py-2 border-b",children:[h.jsx("div",{className:"font-medium text-sm truncate",children:m||`${v} #${e.entityId}`}),h.jsx("div",{className:"text-xs text-muted-foreground",children:v})]}),h.jsx(Mr,{icon:jv,label:"Zoom to",onClick:u}),h.jsx(Mr,{icon:al,label:"Isolate",onClick:d}),h.jsx(Mr,{icon:Ol,label:"Hide",onClick:f}),h.jsx("div",{className:"h-px bg-border my-1"}),h.jsx(Mr,{icon:Dl,label:`Select all ${v}`,onClick:p}),h.jsx(Mr,{icon:jf,label:"Select same storey",onClick:x}),h.jsx("div",{className:"h-px bg-border my-1"}),h.jsx(Mr,{icon:zv,label:"Copy GlobalId",onClick:b})]}),!e.entityId&&h.jsx(h.Fragment,{children:h.jsx(Mr,{icon:Bl,label:"Show all",onClick:y})})]})}function Mr({icon:e,label:t,onClick:n,disabled:r}){return h.jsxs("button",{className:"w-full px-3 py-1.5 text-sm text-left flex items-center gap-2 hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed",onClick:n,disabled:r,children:[h.jsx(e,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("span",{children:t})]})}const kN={IfcWall:"🧱",IfcWallStandardCase:"🧱",IfcDoor:"🚪",IfcWindow:"🪟",IfcSlab:"⬜",IfcColumn:"🏛️",IfcBeam:"➖",IfcStair:"🪜",IfcRailing:"🚧",IfcRoof:"🏠",IfcSpace:"📦",IfcBuildingStorey:"🏢",IfcBuilding:"🏗️",IfcSite:"📍",IfcProject:"📁",IfcFurnishingElement:"🪑",IfcFlowSegment:"〰️",IfcFlowTerminal:"⚡",IfcCurtainWall:"🔲"};function MN(){const e=D(s=>s.hoverState),t=D(s=>s.hoverTooltipsEnabled),{ifcDataStore:n}=wr(),r=g.useMemo(()=>{if(!e.entityId||!n)return null;const s=n.entities.getName(e.entityId),i=n.entities.getTypeName(e.entityId);return{name:s,type:i}},[e.entityId,n]);if(!t||!e.entityId||!r)return null;const o=kN[r.type]||"📄";return h.jsxs("div",{className:"fixed z-40 px-3 py-2 bg-popover text-popover-foreground rounded-md shadow-lg border pointer-events-none",style:{left:e.screenX+16,top:e.screenY+16},children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-base",children:o}),h.jsx("span",{className:"font-medium text-sm",children:r.name||r.type})]}),r.name&&h.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:r.type}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:["#",e.entityId]})]})}function PN(){const e=D(s=>s.boxSelect);if(!e.isSelecting)return null;const t=Math.min(e.startX,e.currentX),n=Math.min(e.startY,e.currentY),r=Math.abs(e.currentX-e.startX),o=Math.abs(e.currentY-e.startY);return r<5&&o<5?null:h.jsxs("div",{className:"fixed pointer-events-none border-2 border-primary bg-primary/10 z-30",style:{left:t,top:n,width:r,height:o},children:[h.jsx("div",{className:"absolute -left-1 -top-1 w-2 h-2 bg-primary rounded-full"}),h.jsx("div",{className:"absolute -right-1 -top-1 w-2 h-2 bg-primary rounded-full"}),h.jsx("div",{className:"absolute -left-1 -bottom-1 w-2 h-2 bg-primary rounded-full"}),h.jsx("div",{className:"absolute -right-1 -bottom-1 w-2 h-2 bg-primary rounded-full"}),(r>50||o>30)&&h.jsxs("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-xs bg-primary text-primary-foreground px-2 py-0.5 rounded whitespace-nowrap",children:[Math.round(r)," x ",Math.round(o)]})]})}function RN(){SN();const e=EN(),t=D(l=>l.theme),n=D(l=>l.isMobile),r=D(l=>l.setIsMobile),o=D(l=>l.leftPanelCollapsed),s=D(l=>l.rightPanelCollapsed),i=D(l=>l.setLeftPanelCollapsed),a=D(l=>l.setRightPanelCollapsed);return g.useEffect(()=>{const l=()=>{const c=window.innerWidth<768;r(c),c&&(i(!0),a(!0))};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[r,i,a]),g.useEffect(()=>{document.documentElement.classList.toggle("dark",t==="dark")},[t]),h.jsx(gI,{delayDuration:300,children:h.jsxs("div",{className:"flex flex-col h-screen w-screen overflow-hidden bg-background text-foreground",children:[h.jsx(CN,{open:e.open,onClose:e.close}),h.jsx(IN,{}),h.jsx(MN,{}),h.jsx(PN,{}),h.jsx(bT,{onShowShortcuts:e.toggle}),!n&&h.jsxs(N0,{orientation:"horizontal",className:"flex-1 min-h-0",children:[h.jsx(Sa,{id:"left-panel",defaultSize:20,minSize:10,collapsible:!0,collapsedSize:0,children:h.jsx("div",{className:"h-full w-full overflow-hidden",children:h.jsx(ng,{})})}),h.jsx(Ju,{className:"w-1.5 bg-border hover:bg-primary/50 active:bg-primary/70 transition-colors cursor-col-resize"}),h.jsx(Sa,{id:"viewport-panel",defaultSize:60,minSize:30,children:h.jsx("div",{className:"h-full w-full overflow-hidden",children:h.jsx(sg,{})})}),h.jsx(Ju,{className:"w-1.5 bg-border hover:bg-primary/50 active:bg-primary/70 transition-colors cursor-col-resize"}),h.jsx(Sa,{id:"right-panel",defaultSize:20,minSize:10,collapsible:!0,collapsedSize:0,children:h.jsx("div",{className:"h-full w-full overflow-hidden",children:h.jsx(og,{})})})]}),n&&h.jsxs("div",{className:"flex-1 min-h-0 relative",children:[h.jsx("div",{className:"h-full w-full",children:h.jsx(sg,{})}),!o&&h.jsxs("div",{className:"absolute inset-x-0 bottom-0 h-[50vh] bg-background border-t rounded-t-xl shadow-xl z-40 animate-in slide-in-from-bottom",children:[h.jsxs("div",{className:"flex items-center justify-between p-2 border-b",children:[h.jsx("span",{className:"font-medium text-sm",children:"Hierarchy"}),h.jsxs("button",{className:"p-1 hover:bg-muted rounded",onClick:()=>i(!0),children:[h.jsx("span",{className:"sr-only",children:"Close"}),h.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})]})]}),h.jsx("div",{className:"h-[calc(50vh-48px)] overflow-auto",children:h.jsx(ng,{})})]}),!s&&h.jsxs("div",{className:"absolute inset-x-0 bottom-0 h-[50vh] bg-background border-t rounded-t-xl shadow-xl z-40 animate-in slide-in-from-bottom",children:[h.jsxs("div",{className:"flex items-center justify-between p-2 border-b",children:[h.jsx("span",{className:"font-medium text-sm",children:"Properties"}),h.jsxs("button",{className:"p-1 hover:bg-muted rounded",onClick:()=>a(!0),children:[h.jsx("span",{className:"sr-only",children:"Close"}),h.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})]})]}),h.jsx("div",{className:"h-[calc(50vh-48px)] overflow-auto",children:h.jsx(og,{})})]}),h.jsxs("div",{className:"absolute bottom-4 left-4 right-4 flex justify-center gap-2 z-30",children:[h.jsx("button",{className:"px-4 py-2 bg-primary text-primary-foreground rounded-full shadow-lg text-sm font-medium",onClick:()=>{a(!0),i(!o)},children:"Hierarchy"}),h.jsx("button",{className:"px-4 py-2 bg-primary text-primary-foreground rounded-full shadow-lg text-sm font-medium",onClick:()=>{i(!0),a(!s)},children:"Properties"})]})]}),h.jsx(oN,{})]})})}function TN(){return h.jsx(RN,{})}su.createRoot(document.getElementById("root")).render(h.jsx(hn.StrictMode,{children:h.jsx(TN,{})}));
|