@mlightcad/data-model 1.2.17 → 1.2.18
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/data-model.cjs +1 -1
- package/dist/data-model.js +2 -2
- package/dist/dxf-parser-worker.js +1 -1
- package/package.json +5 -5
package/dist/data-model.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function jc(i,e){for(var t=0;t<e.length;t++){const s=e[t];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in i)){const h=Object.getOwnPropertyDescriptor(s,o);h&&Object.defineProperty(i,o,h.get?h:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}const qs={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Gi=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215,0];function ls(i,e,t){return Math.max(e,Math.min(t,i))}const Go=class Wo{constructor(){this._colorIndex=256,this._color=null,this._colorName=null}get color(){return this._color}set color(e){e==null?this._color=null:(this._color=Math.round(ls(e,0,256*256*256-1)),this._colorIndex=this.getColorIndexByValue(this._color),this._colorName=this.getColorNameByValue(this._color))}get hexColor(){if(this._color&&this._color>0&&this._color<=16777215){let e=this._color.toString(16).toUpperCase();for(;e.length<6;)e="0"+e;return`0x${e}`}return""}get cssColor(){return`rgb(${this.red},${this.green},${this.blue})`}get red(){return this.color?this.color>>16&255:null}get green(){return this.color?this.color>>8&255:null}get blue(){return this.color?this.color&255:null}get colorIndex(){return this._colorIndex}set colorIndex(e){e==null?this._colorIndex=null:(this._colorIndex=ls(e,0,256),this._color=Gi[e],this._colorName=this.getColorNameByValue(this._color))}get colorName(){return this._colorName}set colorName(e){if(e){const t=qs[e.toLowerCase()];t!==void 0?(this._colorName=e,this._color=t,this._colorIndex=this.getColorIndexByValue(this._color)):console.warn("Unknown color: "+e)}else this._colorName=null}get hasColorName(){return this._colorName==null}get hasColorIndex(){return this._colorIndex==null}get isByLayer(){return this.colorIndex==256}setByLayer(){return this.colorIndex=256,this}get isByBlock(){return this.colorIndex==0}setByBlock(){return this.colorIndex=0,this}setScalar(e){return this.setRGB(e,e,e),this}setRGB(e,t,s){const o=Math.round(ls(e,0,255)),h=Math.round(ls(t,0,255)),u=Math.round(ls(s,0,255));return this.color=(o<<16)+(h<<8)+u,this}setColorName(e){const t=qs[e.toLowerCase()];return t!==void 0?this.color=t:console.warn("Unknown color "+e),this}clone(){const e=new Wo;return e.colorIndex=this.colorIndex,e.color=this.color,e._colorName=this._colorName,this}copy(e){return this.colorIndex=e.colorIndex,this.color=e.color,this._colorName=e._colorName,this}equals(e){return e.color==this.color&&e.colorIndex==this.colorIndex&&e._colorName==this._colorName}toString(){return this.isByLayer?"ByLayer":this.isByBlock?"ByBlock":this.colorName?this.colorName:this.hexColor}getColorNameByValue(e){for(const[t,s]of Object.entries(qs))if(s===e)return t;return null}getColorIndexByValue(e){const t=Gi.length-1;for(let s=1;s<t;++s)if(Gi[s]===e)return s;return null}};Go.NAMES=qs;let fn=Go;const Ut={get ILLEGAL_PARAMETERS(){return new ReferenceError("Illegal Parameters")},get ZERO_DIVISION(){return new Error("Zero division")},get UNRESOLVED_BOUNDARY_CONFLICT(){return new Error("Unresolved boundary conflict in boolean operation")},get INFINITE_LOOP(){return new Error("Infinite loop")},get CANNOT_INVOKE_ABSTRACT_METHOD(){return new Error("Abstract method cannot be invoked")},get OPERATION_IS_NOT_SUPPORTED(){return new Error("Operation is not supported")},get NOT_IMPLEMENTED(){return new Error("Not implemented yet")}};let Gc=class{constructor(){this._listeners={}}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const s=this._listeners[e];if(s!==void 0){const o=s.indexOf(t);o!==-1&&s.splice(o,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const t=this._listeners[e.type];if(t!==void 0){e.target=this;const s=t.slice(0);for(let o=0,h=s.length;o<h;o++)s[o].call(this,e)}}},it=class{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}removeEventListener(e){this.listeners=this.listeners.filter(t=>t!==e)}replaceEventListener(e){this.removeEventListener(e),this.addEventListener(e)}dispatch(e,...t){for(const s of this.listeners)s.call(null,e,...t)}};var Wc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hc(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ho={exports:{}};(function(i){(function(e,t){i.exports?i.exports=t():e.log=t()})(Wc,function(){var e=function(){},t="undefined",s=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],h={},u=null;function g(D,U){var B=D[U];if(typeof B.bind=="function")return B.bind(D);try{return Function.prototype.bind.call(B,D)}catch{return function(){return Function.prototype.apply.apply(B,[D,arguments])}}}function b(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function f(D){return D==="debug"&&(D="log"),typeof console===t?!1:D==="trace"&&s?b:console[D]!==void 0?g(console,D):console.log!==void 0?g(console,"log"):e}function A(){for(var D=this.getLevel(),U=0;U<o.length;U++){var B=o[U];this[B]=U<D?e:this.methodFactory(B,D,this.name)}if(this.log=this.debug,typeof console===t&&D<this.levels.SILENT)return"No console available for logging"}function x(D){return function(){typeof console!==t&&(A.call(this),this[D].apply(this,arguments))}}function E(D,U,B){return f(D)||x.apply(this,arguments)}function M(D,U){var B=this,ge,be,oe,W="loglevel";typeof D=="string"?W+=":"+D:typeof D=="symbol"&&(W=void 0);function ce(xe){var Le=(o[xe]||"silent").toUpperCase();if(!(typeof window===t||!W)){try{window.localStorage[W]=Le;return}catch{}try{window.document.cookie=encodeURIComponent(W)+"="+Le+";"}catch{}}}function se(){var xe;if(!(typeof window===t||!W)){try{xe=window.localStorage[W]}catch{}if(typeof xe===t)try{var Le=window.document.cookie,dt=encodeURIComponent(W),mt=Le.indexOf(dt+"=");mt!==-1&&(xe=/^([^;]+)/.exec(Le.slice(mt+dt.length+1))[1])}catch{}return B.levels[xe]===void 0&&(xe=void 0),xe}}function Ve(){if(!(typeof window===t||!W)){try{window.localStorage.removeItem(W)}catch{}try{window.document.cookie=encodeURIComponent(W)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function Ye(xe){var Le=xe;if(typeof Le=="string"&&B.levels[Le.toUpperCase()]!==void 0&&(Le=B.levels[Le.toUpperCase()]),typeof Le=="number"&&Le>=0&&Le<=B.levels.SILENT)return Le;throw new TypeError("log.setLevel() called with invalid level: "+xe)}B.name=D,B.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},B.methodFactory=U||E,B.getLevel=function(){return oe??be??ge},B.setLevel=function(xe,Le){return oe=Ye(xe),Le!==!1&&ce(oe),A.call(B)},B.setDefaultLevel=function(xe){be=Ye(xe),se()||B.setLevel(xe,!1)},B.resetLevel=function(){oe=null,Ve(),A.call(B)},B.enableAll=function(xe){B.setLevel(B.levels.TRACE,xe)},B.disableAll=function(xe){B.setLevel(B.levels.SILENT,xe)},B.rebuild=function(){if(u!==B&&(ge=Ye(u.getLevel())),A.call(B),u===B)for(var xe in h)h[xe].rebuild()},ge=Ye(u?u.getLevel():"WARN");var We=se();We!=null&&(oe=Ye(We)),A.call(B)}u=new M,u.getLogger=function(D){if(typeof D!="symbol"&&typeof D!="string"||D==="")throw new TypeError("You must supply a name when creating a logger.");var U=h[D];return U||(U=h[D]=new M(D,u.methodFactory)),U};var z=typeof window!==t?window.log:void 0;return u.noConflict=function(){return typeof window!==t&&window.log===u&&(window.log=z),u},u.getLoggers=function(){return h},u.default=u,u})})(Ho);var qo=Ho.exports;const qc=Hc(qo),Yc=jc({__proto__:null,default:qc},[qo]),Xc=!0,Es=Yc;Es.setLevel("debug");const Kc=i=>{try{Es.setLevel(i)}catch(e){Es.setLevel("error"),Es.error(e)}};function Ss(i){return i===null||typeof i!="object"?i:Array.isArray(i)?[...i]:{...i}}function Bn(i,...e){for(const t of e)if(t)for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&i[s]===void 0&&(i[s]=t[s]);return i}function Yo(i,e){return i!=null&&Object.prototype.hasOwnProperty.call(i,e)}function Xo(i){return i==null?!0:Array.isArray(i)||typeof i=="string"?i.length===0:i instanceof Map||i instanceof Set?i.size===0:typeof i=="object"?Object.keys(i).length===0:!1}function zn(i,e){if(i===e)return!0;if(i==null||e==null)return i===e;if(typeof i!=typeof e)return!1;if(typeof i!="object")return i===e;if(Array.isArray(i)!==Array.isArray(e))return!1;if(Array.isArray(i)){if(i.length!==e.length)return!1;for(let o=0;o<i.length;o++)if(!zn(i[o],e[o]))return!1;return!0}const t=Object.keys(i),s=Object.keys(e);if(t.length!==s.length)return!1;for(const o of t)if(!Object.prototype.hasOwnProperty.call(e,o)||!zn(i[o],e[o]))return!1;return!0}let Ko=class $o{constructor(e,t){this.events={attrChanged:new it,modelChanged:new it},this._changing=!1,this._previousAttributes={},this._pending=!1;const s=e||{};t&&Bn(s,t),this.attributes=s,this.changed={}}get(e){return this.attributes[e]}set(e,t,s){if(e==null)return this;let o;typeof e=="object"?(o=e,s=t):(o={},o[e]=t),s||(s={});const h=s.unset,u=s.silent,g=[],b=this._changing;this._changing=!0,b||(this._previousAttributes=Ss(this.attributes),this.changed={});const f=this.attributes,A=this.changed,x=this._previousAttributes;for(const E in o)t=o[E],zn(f[E],t)||g.push(E),zn(x[E],t)?delete A[E]:A[E]=t,h?delete f[E]:f[E]=t;if(!u){g.length&&(this._pending=s);for(let E=0;E<g.length;E++)this.events.attrChanged.dispatch({object:this,attrName:g[E],attrValue:f[g[E]],options:s})}if(b)return this;if(!u)for(;this._pending;)s=this._pending,this._pending=!1,this.events.modelChanged.dispatch({object:this,options:s});return this._pending=!1,this._changing=!1,this}has(e){return this.get(e)!=null}hasChanged(e){return e==null?!Xo(this.changed):Yo(this.changed,e)}changedAttributes(e){if(!e)return this.hasChanged()?Ss(this.changed):{};const t=this._changing?this._previousAttributes:this.attributes,s={};for(const o in e){const h=e[o];zn(t[o],h)||(s[o]=h)}return s}previous(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]}previousAttributes(){return Ss(this._previousAttributes)}clone(){const e=Ss(this.attributes);return new $o(e)}},ca=class Is{constructor(){this.entries=new Map}static getInstance(){return Is.instance||(Is.instance=new Is),Is.instance}collect(e){this.entries.set(e.name,e)}printAll(){for(const[e,t]of this.entries)console.log(`${e}:`),console.log(t.format())}clear(){this.entries.clear()}getAll(){return Array.from(this.entries.values())}getEntry(e){return this.entries.get(e)}remove(e){return this.entries.delete(e)}};class $c{static formatBytes(e,t=2){if(e===0)return"0 B";const s=1024,o=Math.max(0,t),h=["B","KB","MB","GB","TB"],u=Math.floor(Math.log(e)/Math.log(s)),g=e/Math.pow(s,u);return`${parseFloat(g.toFixed(o))} ${h[u]}`}}class Zo{constructor(e){this.name=e}run(e){throw new Error("run() must be implemented by subclass")}}class Qo{constructor(){this.tasks=[],this.onProgress=()=>{},this.onComplete=()=>{},this.onError=()=>{}}scheduleTask(e){return new Promise((t,s)=>{const o=()=>{Promise.resolve(e()).then(t).catch(s)};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(o):setTimeout(o,0)})}addTask(e){this.tasks.push(e)}setProgressCallback(e){this.onProgress=e}setCompleteCallback(e){this.onComplete=e}setErrorCallback(e){this.onError=e}async run(e){const t=this.tasks.length;let s=e;for(let o=0;o<t;o++){const h=this.tasks[o];try{s=await this.scheduleTask(async()=>{const u=await h.run(s);return this.onProgress((o+1)/t,h),u})}catch(u){this.onError({error:u,taskIndex:o,task:h});return}}this.onComplete(s)}}let Jo=class{constructor(e,t,s){this.isLoading=!1,this.itemsLoaded=0,this.itemsTotal=0,this.urlModifier=void 0,this.handlers=[],this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=s}itemStart(e){this.itemsTotal++,this.isLoading===!1&&this.onStart!==void 0&&this.onStart(e,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(e){this.itemsLoaded++,this.onProgress!==void 0&&this.onProgress(e,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this.onLoad!==void 0&&this.onLoad())}itemError(e){this.onError!==void 0&&this.onError(e)}resolveURL(e){return this.urlModifier?this.urlModifier(e):e}setURLModifier(e){return this.urlModifier=e,this}addHandler(e,t){return this.handlers.push(e,t),this}removeHandler(e){const t=this.handlers.indexOf(e);return t!==-1&&this.handlers.splice(t,2),this}getHandler(e){for(let t=0,s=this.handlers.length;t<s;t+=2){const o=this.handlers[t],h=this.handlers[t+1];if(o.global&&(o.lastIndex=0),o.test(e))return h}return null}};const el=new Jo;let Zc=class{constructor(e){this.manager=e!==void 0?e:el,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}loadAsync(e,t){return new Promise((s,o)=>{this.load(e,s,t,o)})}parse(e){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}};class tl{constructor(e,t,s){this._chunkSize=-1,this._minimumChunkSize=50,this._count=e,this._numerOfChunk=t<1?1:t,this._minimumChunkSize=s,this.calculateChunkSize()}get count(){return this._count}get numerOfChunk(){return this._numerOfChunk}get minimumChunkSize(){return this._minimumChunkSize}set minimumChunkSize(e){this._minimumChunkSize=e,this.calculateChunkSize()}get chunkSize(){return this._chunkSize}calculateChunkSize(){let e=this._count/this._numerOfChunk;e<this._minimumChunkSize&&(e=Math.min(this._minimumChunkSize,this._count)),this._chunkSize=e<1?this._count:Math.floor(e)}scheduleTask(e){return new Promise((t,s)=>{const o=()=>{Promise.resolve(e()).then(t).catch(s)};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(o):setTimeout(o,0)})}async processChunk(e){let t=0;const s=async()=>{const o=t,h=Math.min(t+this._chunkSize,this._count);await e(o,h),t=h,t<this._count&&await this.scheduleTask(s)};await s()}}var ht,hs,Qe,st,cs,Jt,yt,pr,er,Jr,us,ds,en,tn,ms,ps,gs,Ct,gr,qe,rn,fs,_e,bt,_s,xt,vs,fr,_r,tr,ys,nn,Nt,vr,sn,Wi,Hi,yr,br,bs,xs,xr,ws,qi,Yi,ct,wr,ut,Lt,Xi,Ki,$i,Zi,Ar,Ot,an,As,on,zt,Pr,Dt,Sr;(ht={})[ht.None=0]="None",ht[ht.Anonymous=1]="Anonymous",ht[ht.NonConstant=2]="NonConstant",ht[ht.Xref=4]="Xref",ht[ht.XrefOverlay=8]="XrefOverlay",ht[ht.ExternallyDependent=16]="ExternallyDependent",ht[ht.ResolvedOrDependent=32]="ResolvedOrDependent",ht[ht.ReferencedXref=64]="ReferencedXref";(hs={})[hs.BYBLOCK=0]="BYBLOCK",hs[hs.BYLAYER=256]="BYLAYER";(Qe={})[Qe.Rotated=0]="Rotated",Qe[Qe.Aligned=1]="Aligned",Qe[Qe.Angular=2]="Angular",Qe[Qe.Diameter=3]="Diameter",Qe[Qe.Radius=4]="Radius",Qe[Qe.Angular3Point=5]="Angular3Point",Qe[Qe.Ordinate=6]="Ordinate",Qe[Qe.ReferenceIsExclusive=32]="ReferenceIsExclusive",Qe[Qe.IsOrdinateXTypeFlag=64]="IsOrdinateXTypeFlag",Qe[Qe.IsCustomTextPositionFlag=128]="IsCustomTextPositionFlag";(st={})[st.TopLeft=1]="TopLeft",st[st.TopCenter=2]="TopCenter",st[st.TopRight=3]="TopRight",st[st.MiddleLeft=4]="MiddleLeft",st[st.MiddleCenter=5]="MiddleCenter",st[st.MiddleRight=6]="MiddleRight",st[st.BottomLeft=7]="BottomLeft",st[st.BottomCenter=8]="BottomCenter",st[st.BottomRight=9]="BottomRight";(cs={})[cs.AtLeast=1]="AtLeast",cs[cs.Exact=2]="Exact";var Io=((Jt={})[Jt.Center=0]="Center",Jt[Jt.Above=1]="Above",Jt[Jt.Outside=2]="Outside",Jt[Jt.JIS=3]="JIS",Jt[Jt.Below=4]="Below",Jt),Nn=((yt={})[yt.Feet=0]="Feet",yt[yt.None=1]="None",yt[yt.Inch=2]="Inch",yt[yt.FeetAndInch=3]="FeetAndInch",yt[yt.Leading=4]="Leading",yt[yt.Trailing=8]="Trailing",yt[yt.LeadingAndTrailing=12]="LeadingAndTrailing",yt),Qc=((pr={})[pr.None=0]="None",pr[pr.Leading=1]="Leading",pr[pr.Trailing=2]="Trailing",pr[pr.LeadingAndTrailing=3]="LeadingAndTrailing",pr),Jc=((er={})[er.Center=0]="Center",er[er.Left=1]="Left",er[er.Right=2]="Right",er[er.OverFirst=3]="OverFirst",er[er.OverSecond=4]="OverSecond",er),eu=((Jr={})[Jr.Bottom=0]="Bottom",Jr[Jr.Center=1]="Center",Jr[Jr.Top=2]="Top",Jr);(us={})[us.PatternFill=0]="PatternFill",us[us.SolidFill=1]="SolidFill";(ds={})[ds.NonAssociative=0]="NonAssociative",ds[ds.Associative=1]="Associative";(en={})[en.Normal=0]="Normal",en[en.Outer=1]="Outer",en[en.Ignore=2]="Ignore";(tn={})[tn.UserDefined=0]="UserDefined",tn[tn.Predefined=1]="Predefined",tn[tn.Custom=2]="Custom";(ms={})[ms.NotAnnotated=0]="NotAnnotated",ms[ms.Annotated=1]="Annotated";(ps={})[ps.Solid=0]="Solid",ps[ps.Gradient=1]="Gradient";(gs={})[gs.TwoColor=0]="TwoColor",gs[gs.OneColor=1]="OneColor";var tu=((Ct={})[Ct.Default=0]="Default",Ct[Ct.External=1]="External",Ct[Ct.Polyline=2]="Polyline",Ct[Ct.Derived=4]="Derived",Ct[Ct.Textbox=8]="Textbox",Ct[Ct.Outermost=16]="Outermost",Ct),Vs=((gr={})[gr.Line=1]="Line",gr[gr.Circular=2]="Circular",gr[gr.Elliptic=3]="Elliptic",gr[gr.Spline=4]="Spline",gr),ru=((qe={})[qe.Off=0]="Off",qe[qe.Solid=1]="Solid",qe[qe.Dashed=2]="Dashed",qe[qe.Dotted=3]="Dotted",qe[qe.ShotDash=4]="ShotDash",qe[qe.MediumDash=5]="MediumDash",qe[qe.LongDash=6]="LongDash",qe[qe.DoubleShortDash=7]="DoubleShortDash",qe[qe.DoubleMediumDash=8]="DoubleMediumDash",qe[qe.DoubleLongDash=9]="DoubleLongDash",qe[qe.DoubleMediumLongDash=10]="DoubleMediumLongDash",qe[qe.SparseDot=11]="SparseDot",qe);ru.Off;(rn={})[rn.Standard=-3]="Standard",rn[rn.ByLayer=-2]="ByLayer",rn[rn.ByBlock=-1]="ByBlock";(fs={})[fs.English=0]="English",fs[fs.Metric=1]="Metric";(_e={})[_e.PERSPECTIVE_MODE=1]="PERSPECTIVE_MODE",_e[_e.FRONT_CLIPPING=2]="FRONT_CLIPPING",_e[_e.BACK_CLIPPING=4]="BACK_CLIPPING",_e[_e.UCS_FOLLOW=8]="UCS_FOLLOW",_e[_e.FRONT_CLIP_NOT_AT_EYE=16]="FRONT_CLIP_NOT_AT_EYE",_e[_e.UCS_ICON_VISIBILITY=32]="UCS_ICON_VISIBILITY",_e[_e.UCS_ICON_AT_ORIGIN=64]="UCS_ICON_AT_ORIGIN",_e[_e.FAST_ZOOM=128]="FAST_ZOOM",_e[_e.SNAP_MODE=256]="SNAP_MODE",_e[_e.GRID_MODE=512]="GRID_MODE",_e[_e.ISOMETRIC_SNAP_STYLE=1024]="ISOMETRIC_SNAP_STYLE",_e[_e.HIDE_PLOT_MODE=2048]="HIDE_PLOT_MODE",_e[_e.K_ISO_PAIR_TOP=4096]="K_ISO_PAIR_TOP",_e[_e.K_ISO_PAIR_RIGHT=8192]="K_ISO_PAIR_RIGHT",_e[_e.VIEWPORT_ZOOM_LOCKING=16384]="VIEWPORT_ZOOM_LOCKING",_e[_e.UNUSED=32768]="UNUSED",_e[_e.NON_RECTANGULAR_CLIPPING=65536]="NON_RECTANGULAR_CLIPPING",_e[_e.VIEWPORT_OFF=131072]="VIEWPORT_OFF",_e[_e.GRID_BEYOND_DRAWING_LIMITS=262144]="GRID_BEYOND_DRAWING_LIMITS",_e[_e.ADAPTIVE_GRID_DISPLAY=524288]="ADAPTIVE_GRID_DISPLAY",_e[_e.SUBDIVISION_BELOW_SPACING=1048576]="SUBDIVISION_BELOW_SPACING",_e[_e.GRID_FOLLOWS_WORKPLANE=2097152]="GRID_FOLLOWS_WORKPLANE";(bt={})[bt.OPTIMIZED_2D=0]="OPTIMIZED_2D",bt[bt.WIREFRAME=1]="WIREFRAME",bt[bt.HIDDEN_LINE=2]="HIDDEN_LINE",bt[bt.FLAT_SHADED=3]="FLAT_SHADED",bt[bt.GOURAUD_SHADED=4]="GOURAUD_SHADED",bt[bt.FLAT_SHADED_WITH_WIREFRAME=5]="FLAT_SHADED_WITH_WIREFRAME",bt[bt.GOURAUD_SHADED_WITH_WIREFRAME=6]="GOURAUD_SHADED_WITH_WIREFRAME";(_s={})[_s.UCS_UNCHANGED=0]="UCS_UNCHANGED",_s[_s.HAS_OWN_UCS=1]="HAS_OWN_UCS";(xt={})[xt.NON_ORTHOGRAPHIC=0]="NON_ORTHOGRAPHIC",xt[xt.TOP=1]="TOP",xt[xt.BOTTOM=2]="BOTTOM",xt[xt.FRONT=3]="FRONT",xt[xt.BACK=4]="BACK",xt[xt.LEFT=5]="LEFT",xt[xt.RIGHT=6]="RIGHT";(vs={})[vs.ONE_DISTANT_LIGHT=0]="ONE_DISTANT_LIGHT",vs[vs.TWO_DISTANT_LIGHTS=1]="TWO_DISTANT_LIGHTS";(fr={})[fr.ByLayer=0]="ByLayer",fr[fr.ByBlock=1]="ByBlock",fr[fr.ByDictionaryDefault=2]="ByDictionaryDefault",fr[fr.ByObject=3]="ByObject";function Ae(i,e,t){return i.code===e&&(t==null||i.value===t)}function ze(i){let e={};i.rewind();let t=i.next(),s=t.code;if(e.x=t.value,(t=i.next()).code!==s+10)throw Error("Expected code for point value to be 20 but got "+t.code+".");return e.y=t.value,(t=i.next()).code!==s+20?i.rewind():e.z=t.value,e}let ua=Symbol();function ye(i,e){return(t,s,o)=>{let h=function(b,f=!1){return b.reduce((A,x)=>{x.pushContext&&A.push({});let E=A[A.length-1];for(let M of typeof x.code=="number"?[x.code]:x.code){let z=E[M]??(E[M]=[]);x.isMultiple&&z.length&&f&&console.warn(`Snippet ${z[z.length-1].name} for code(${M}) is shadowed by ${x.name}`),z.push(x)}return A},[{}])}(i,s.debug),u=!1,g=h.length-1;for(;!Ae(t,0,"EOF");){let b=function(U,B,ge){return U.find((be,oe)=>{var W;return oe>=ge&&((W=be[B])==null?void 0:W.length)})}(h,t.code,g),f=b==null?void 0:b[t.code],A=f==null?void 0:f[f.length-1];if(!b||!A){s.rewind();break}A.isMultiple||b[t.code].pop();let{name:x,parser:E,isMultiple:M,isReducible:z}=A,D=E==null?void 0:E(t,s,o);if(D===ua){s.rewind();break}if(x){let[U,B]=function(ge,be){let oe=be.split(".");if(!oe.length)throw Error("[parserGenerator::getObjectByPath] Invalid empty path");let W=ge;for(let ce=0;ce<oe.length-1;++ce){let se=Qi(oe[ce]),Ve=Qi(oe[ce+1]);Object.prototype.hasOwnProperty.call(W,se)||(typeof Ve=="number"?W[se]=[]:W[se]={}),W=W[se]}return[W,Qi(oe[oe.length-1])]}(o,x);M&&!z?(Object.prototype.hasOwnProperty.call(U,B)||(U[B]=[]),U[B].push(D)):U[B]=D}A.pushContext&&(g-=1),u=!0,t=s.next()}return e&&Object.setPrototypeOf(o,e),u}}function Qi(i){let e=Number.parseInt(i);return Number.isNaN(e)?i:e}function y({value:i}){return i}function G(i,e){return ze(e)}function Be({value:i}){return!!i}let nu=[{code:1001,name:"xdata",parser:rl}];function rl(i,e){var o;if(!Ae(i,1001))throw Error("XData must starts with code 1001");let t={appName:i.value,value:[]};i=e.next();let s=[t.value];for(;!Ae(i,0,"EOF")&&i.code>=1e3;){let h=s[s.length-1];switch(i.code){case 1002:i.value==="{"?s.push([]):(s.pop(),(o=s[s.length-1])==null||o.push(h));break;case 1e3:case 1004:case 1040:case 1070:case 1071:h.push({type:Ir(i.code),value:i.value});break;case 1003:h.push({name:"layer",type:Ir(i.code),value:i.value});break;case 1005:h.push({name:"handle",type:Ir(i.code),value:i.value});break;case 1010:h.push({type:Ir(i.code),value:ze(e)});break;case 1011:h.push({name:"worldSpacePosition",type:Ir(i.code),value:ze(e)});break;case 1012:h.push({name:"worldSpaceDisplacement",type:Ir(i.code),value:ze(e)});break;case 1013:h.push({name:"worldSpaceDirection",type:Ir(i.code),value:ze(e)});break;case 1041:h.push({name:"distance",type:Ir(i.code),value:i.value});break;case 1042:h.push({name:"scale",type:Ir(i.code),value:i.value})}i=e.next()}return e.rewind(),t}function Ir(i){switch(i){case 1e3:case 1003:case 1005:return"string";case 1004:return"hex";case 1040:case 1041:case 1042:return"real";case 1070:return"integer";case 1071:return"long";case 1010:case 1011:case 1012:case 1013:return"point";default:return""}}function dn(i,e,t){for(;Ae(i,102);){var s;let o=i.value;if(i=e.next(),!o.startsWith("{")){e.debug&&console.warn(`Invalid application group, expected to start with "{" but received: ${o}`),function(u,g){for(;!Ae(u,102)&&!Ae(u,0,"EOF");)u=g.next()}(i,e),i=e.next();continue}let h=o.slice(1).trim();t.extensions??(t.extensions={}),(s=t.extensions)[h]??(s[h]=[]),function(u,g,b){for(;!Ae(u,102,"}")&&!Ae(u,0,"EOF");)b.push(u),u=g.next()}(i,e,t.extensions[h]),i=e.next()}e.rewind()}let su=0;function nl(i){if(!i)throw TypeError("entity cannot be undefined or null");i.handle||(i.handle=su++)}var iu=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215];function sl(i){return iu[i]}(_r={})[_r.CAST_AND_RECEIVE=0]="CAST_AND_RECEIVE",_r[_r.CAST=1]="CAST",_r[_r.RECEIVE=2]="RECEIVE",_r[_r.IGNORE=3]="IGNORE";let Ue=[...nu,{code:284,name:"shadowMode",parser:y},{code:390,name:"plotStyleHardId",parser:y},{code:380,name:"plotStyleType",parser:y},{code:440,name:"transparency",parser:y},{code:430,name:"colorName",parser:y},{code:420,name:"color",parser:y},{code:310,name:"proxyEntity",isMultiple:!0,parser:y},{code:92,name:"proxyByte",parser:y},{code:60,name:"isVisible",parser:Be},{code:48,name:"lineTypeScale",parser:y},{code:370,name:"lineweight",parser:y},{code:62,name:"colorIndex",parser(i,e,t){let s=i.value;return t.color=sl(Math.abs(s)),s}},{code:347,name:"materialObjectHardId",parser:y},{code:6,name:"lineType",parser:y},{code:8,name:"layer",parser:y},{code:410,name:"layoutTabName",parser:y},{code:67,name:"isInPaperSpace",parser:Be},{code:100},{code:160},{code:330,name:"ownerBlockRecordSoftId",parser:y},{code:102,parser:dn},{code:102,parser:dn},{code:102,parser:dn},{code:5,name:"handle",parser:y}];function Ii(i){return[{code:3,name:i,parser:(e,t,s)=>(s._code3text=(s._code3text??"")+e.value,s._code3text+(s._code1text??"")),isMultiple:!0,isReducible:!0},{code:1,name:i,parser:(e,t,s)=>(s._code1text=e.value,(s._code3text??"")+s._code1text)}]}function il(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let au={extrusionDirection:{x:0,y:0,z:1}},ou=[{code:210,name:"extrusionDirection",parser:G},{code:51,name:"endAngle",parser:y},{code:50,name:"startAngle",parser:y},{code:100,name:"subclassMarker",parser:y},{code:40,name:"radius",parser:y},{code:10,name:"center",parser:G},{code:39,name:"thickness",parser:y},{code:100},...Ue];class al{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){il(this,"parser",ye(ou,au))}}il(al,"ForEntityName","ARC");(tr={})[tr.NONE=0]="NONE",tr[tr.INVISIBLE=1]="INVISIBLE",tr[tr.CONSTANT=2]="CONSTANT",tr[tr.VERIFICATION_REQUIRED=4]="VERIFICATION_REQUIRED",tr[tr.PRESET=8]="PRESET";(ys={})[ys.MULTILINE=2]="MULTILINE",ys[ys.CONSTANT_MULTILINE=4]="CONSTANT_MULTILINE";(nn={})[nn.NONE=0]="NONE",nn[nn.MIRRORED_X=2]="MIRRORED_X",nn[nn.MIRRORED_Y=4]="MIRRORED_Y";var lu=((Nt={})[Nt.LEFT=0]="LEFT",Nt[Nt.CENTER=1]="CENTER",Nt[Nt.RIGHT=2]="RIGHT",Nt[Nt.ALIGNED=3]="ALIGNED",Nt[Nt.MIDDLE=4]="MIDDLE",Nt[Nt.FIT=5]="FIT",Nt),hu=((vr={})[vr.BASELINE=0]="BASELINE",vr[vr.BOTTOM=1]="BOTTOM",vr[vr.MIDDLE=2]="MIDDLE",vr[vr.TOP=3]="TOP",vr);function ol(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let ll={thickness:0,rotation:0,xScale:1,obliqueAngle:0,styleName:"STANDARD",generationFlag:0,halign:lu.LEFT,valign:hu.BASELINE,extrusionDirection:{x:0,y:0,z:1}},hl=[{code:73,name:"valign",parser:y},{code:100},{code:210,name:"extrusionDirection",parser:G},{code:11,name:"endPoint",parser:G},{code:72,name:"valign",parser:y},{code:72,name:"halign",parser:y},{code:71,name:"generationFlag",parser:y},{code:7,name:"styleName",parser:y},{code:51,name:"obliqueAngle",parser:y},{code:41,name:"xScale",parser:y},{code:50,name:"rotation",parser:y},{code:1,name:"text",parser:y},{code:40,name:"textHeight",parser:y},{code:10,name:"startPoint",parser:G},{code:39,name:"thickness",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class cl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){ol(this,"parser",ye(hl,ll))}}function ul(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}ol(cl,"ForEntityName","TEXT");let cu={...ll},uu=[{code:2},{code:40,name:"annotationScale",parser:y},{code:10,name:"alignmentPoint",parser:G},{code:340,name:"secondaryAttributesHardIds",isMultiple:!0,parser:y},{code:70,name:"numberOfSecondaryAttributes",parser:y},{code:70,name:"isReallyLocked",parser:Be},{code:70,name:"mtextFlag",parser:y},{code:280,name:"isDuplicatedRecord",parser:Be},{code:100},{code:280,name:"isLocked",parser:Be},{code:74,name:"valign",parser:y},{code:73},{code:70,name:"attributeFlag",parser:y},{code:2,name:"tag",parser:y},{code:3,name:"prompt",parser:y},{code:280},{code:100,name:"subclassMarker",parser:y},...hl.slice(2)];class dl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){ul(this,"parser",ye(uu,cu))}}ul(dl,"ForEntityName","ATTDEF");(sn={})[sn.LEFT_TO_RIGHT=1]="LEFT_TO_RIGHT",sn[sn.TOP_TO_BOTTOM=3]="TOP_TO_BOTTOM",sn[sn.BY_STYLE=5]="BY_STYLE";function du(i,e){let t={};for(let s of i){let o=e(s);o!=null&&(t[o]??(t[o]=[]),t[o].push(s))}return t}function*Js(i,e=1/0,t=1){for(let s=i;s!==e;s+=t)yield s}function Vr(i){return{x:i.x??0,y:i.y??0,z:i.z??0}}function da(i,e,t){if(Ae(e,102))return dn(e,t,i),!0;switch(e.code){case 0:i.type=e.value;break;case 5:i.handle=e.value;break;case 330:i.ownerBlockRecordSoftId=e.value;break;case 67:i.isInPaperSpace=!!e.value;break;case 8:i.layer=e.value;break;case 6:i.lineType=e.value;break;case 347:i.materialObjectHardId=e.value;break;case 62:i.colorIndex=e.value,i.color=sl(Math.abs(e.value));break;case 370:i.lineweight=e.value;break;case 48:i.lineTypeScale=e.value;break;case 60:i.isVisible=!!e.value;break;case 92:i.proxyByte=e.value;break;case 310:i.proxyEntity=e.value;break;case 100:break;case 420:i.color=e.value;break;case 430:i.transparency=e.value;break;case 390:i.plotStyleHardId=e.value;break;case 284:i.shadowMode=e.value;break;case 1001:i.xdata=rl(e,t);break;default:return!1}return!0}function ml(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let mu={textStyle:"STANDARD",extrusionDirection:{x:0,y:0,z:1},rotation:0},Ys=[{code:46,name:"annotationHeight",parser:y},{code:101,parser(i,e){(function(t){t.rewind();let s=t.next();if(s.code!==101)throw Error("Bad call for skipEmbeddedObject()");do s=t.next();while(s.code!==0);t.rewind()})(e)}},{code:50,name:"columnHeight",parser:y},{code:49,name:"columnGutter",parser:y},{code:48,name:"columnWidth",parser:y},{code:79,name:"columnAutoHeight",parser:y},{code:78,name:"columnFlowReversed",parser:y},{code:76,name:"columnCount",parser:y},{code:75,name:"columnType",parser:y},{code:441,name:"backgroundFillTransparency",parser:y},{code:63,name:"backgroundFillColor",parser:y},{code:45,name:"fillBoxScale",parser:y},{code:[...Js(430,440)],name:"backgroundColor",parser:y},{code:[...Js(420,430)],name:"backgroundColor",parser:y},{code:90,name:"backgroundFill",parser:y},{code:44,name:"lineSpacing",parser:y},{code:73,name:"lineSpacingStyle",parser:y},{code:50,name:"rotation",parser:y},{code:43},{code:42},{code:11,name:"direction",parser:G},{code:210,name:"extrusionDirection",parser:G},{code:7,name:"styleName",parser:y},...Ii("text"),{code:72,name:"drawingDirection",parser:y},{code:71,name:"attachmentPoint",parser:y},{code:41,name:"width",parser:y},{code:40,name:"height",parser:y},{code:10,name:"insertionPoint",parser:G},{code:100,name:"subclassMarker",parser:y},...Ue];class pl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){ml(this,"parser",ye(Ys,mu))}}function gl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}ml(pl,"ForEntityName","MTEXT");let pu={thickness:0,rotation:0,scale:1,obliqueAngle:0,textStyle:"STANDARD",textGenerationFlag:0,horizontalJustification:0,verticalJustification:0,extrusionDirection:{x:0,y:0,z:1}},gu=[...Ys.slice(Ys.findIndex(({name:i})=>i==="columnType"),Ys.findIndex(({name:i})=>i==="subclassMarker")+1),{code:100},{code:0,parser(i){if(!Ae(i,0,"MTEXT"))return ua}},{code:2,name:"definitionTag",parser:y},{code:40,name:"annotationScale",parser:y},{code:10,name:"alignmentPoint",parser:G},{code:340,name:"secondaryAttributesHardId",parser:y},{code:70,name:"numberOfSecondaryAttributes",parser:y},{code:70,name:"isReallyLocked",parser:Be},{code:70,name:"mtextFlag",parser:y},{code:280,name:"isDuplicatedEntriesKeep",parser:Be},{code:100},{code:280,name:"lockPositionFlag",parser:Be},{code:210,name:"extrusionDirection",parser:G},{code:11,name:"alignmentPoint",parser:G},{code:74,name:"verticalJustification",parser:y},{code:72,name:"horizontalJustification",parser:y},{code:71,name:"textGenerationFlag",parser:y},{code:7,name:"textStyle",parser:y},{code:51,name:"obliqueAngle",parser:y},{code:41,name:"scale",parser:y},{code:50,name:"rotation",parser:y},{code:73},{code:70,name:"attributeFlag",parser:y},{code:2,name:"tag",parser:y},{code:280},{code:100,name:"subclassMarker",parser:y},{code:1,name:"text",parser:y},{code:40,name:"textHeight",parser:y},{code:10,name:"startPoint",parser:G},{code:39,name:"thickness",parser:y},{code:100},...Ue];class fl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){gl(this,"parser",ye(gu,pu))}}function _l(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}gl(fl,"ForEntityName","ATTRIB");let fu=[...Ii("data"),{code:70,name:"version",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class vl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){_l(this,"parser",ye(fu))}}function yl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}_l(vl,"ForEntityName","BODY");let _u={thickness:0,extrusionDirection:{x:0,y:0,z:1}},vu=[{code:210,name:"extrusionDirection",parser:G},{code:40,name:"radius",parser:y},{code:10,name:"center",parser:G},{code:39,name:"thickness",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class bl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){yl(this,"parser",ye(vu,_u))}}yl(bl,"ForEntityName","CIRCLE");class Xs{parseEntity(e,t){let s={};for(;!Ae(t,0,"EOF");){if(t.code===0){e.rewind();break}(function(o,h,u){switch(h.code){case 100:o.subclassMarker=h.value;break;case 280:o.version=h.value;break;case 2:o.name=h.value;break;case 10:o.definitionPoint=ze(u);break;case 11:o.textPoint=ze(u);break;case 12:o.insertionPoint=ze(u);break;case 13:o.subDefinitionPoint1=ze(u);break;case 14:o.subDefinitionPoint2=ze(u);break;case 15:o.centerPoint=ze(u);break;case 16:o.arcPoint=ze(u);break;case 70:o.dimensionType=h.value;break;case 71:o.attachmentPoint=h.value;break;case 72:o.textLineSpacingStyle=h.value;break;case 40:o.leaderLength=h.value;break;case 41:o.textLineSpacingFactor=h.value;break;case 42:o.measurement=h.value;break;case 1:o.text=h.value;break;case 50:o.rotationAngle=h.value;break;case 52:o.obliqueAngle=h.value;break;case 53:o.textRotation=h.value;break;case 51:o.ocsRotation=h.value;break;case 210:o.extrusionDirection=ze(u);break;case 3:o.styleName=h.value;break;default:da(o,h,u)}})(s,t,e),t=e.next()}return s}}function xl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Hi="DIMENSION",(Wi="ForEntityName")in Xs?Object.defineProperty(Xs,Wi,{value:Hi,enumerable:!0,configurable:!0,writable:!0}):Xs[Wi]=Hi;let yu={extrusionDirection:{x:0,y:0,z:1}},bu=[{code:42,name:"endAngle",parser:y},{code:41,name:"startAngle",parser:y},{code:40,name:"axisRatio",parser:y},{code:210,name:"extrusionDirection",parser:G},{code:11,name:"majorAxisEndPoint",parser:G},{code:10,name:"center",parser:G},{code:100,name:"subclassMarker",parser:y},...Ue];class wl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){xl(this,"parser",ye(bu,yu))}}xl(wl,"ForEntityName","ELLIPSE");(yr={})[yr.First=1]="First",yr[yr.Second=2]="Second",yr[yr.Third=4]="Third",yr[yr.Fourth=8]="Fourth";function Al(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let xu=[{code:13,name:"vertices.3",parser:G},{code:12,name:"vertices.2",parser:G},{code:11,name:"vertices.1",parser:G},{code:10,name:"vertices.0",parser:G},{code:100,name:"subclassMarker",parser:y},...Ue];class Pl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Al(this,"parser",ye(xu))}}Al(Pl,"ForEntityName","3DFACE");let Sl=[{code:330,name:"sourceBoundaryObjects",parser:y,isMultiple:!0},{code:97,name:"numberOfSourceBoundaryObjects",parser:y}],wu=[{code:11,name:"end",parser:G},{code:10,name:"start",parser:G}],Au=[{code:73,name:"isCCW",parser:Be},{code:51,name:"endAngle",parser:y},{code:50,name:"startAngle",parser:y},{code:40,name:"radius",parser:y},{code:10,name:"center",parser:G}],Pu=[{code:73,name:"isCCW",parser:Be},{code:51,name:"endAngle",parser:y},{code:50,name:"startAngle",parser:y},{code:40,name:"lengthOfMinorAxis",parser:y},{code:11,name:"end",parser:G},{code:10,name:"center",parser:G}],Su=[{code:13,name:"endTangent",parser:G},{code:12,name:"startTangent",parser:G},{code:11,name:"fitDatum",isMultiple:!0,parser:G},{code:97,name:"numberOfFitData",parser:y},{code:10,name:"controlPoints",isMultiple:!0,parser(i,e){let t={...ze(e),weight:1};return(i=e.next()).code===42?t.weight=i.value:e.rewind(),t}},{code:40,name:"knots",isMultiple:!0,parser:y},{code:96,name:"numberOfControlPoints",parser:y},{code:95,name:"numberOfKnots",parser:y},{code:74,name:"isPeriodic",parser:Be},{code:73,name:"splineFlag",parser:y},{code:94,name:"degree",parser:y}],Iu={[Vs.Line]:wu,[Vs.Circular]:Au,[Vs.Elliptic]:Pu,[Vs.Spline]:Su},Eu=[...Sl,{code:72,name:"edges",parser(i,e){let t={type:i.value},s=ye(Iu[t.type]);if(!s)throw Error(`Invalid edge type ${t.type}`);return s(i=e.next(),e,t),t},isMultiple:!0},{code:93,name:"numberOfEdges",parser:y}],ku=[...Sl,{code:10,name:"vertices",parser(i,e){let t={...ze(e),bulge:0};return(i=e.next()).code===42?t.bulge=i.value:e.rewind(),t},isMultiple:!0},{code:93,name:"numberOfVertices",parser:y},{code:73,name:"isClosed",parser:Be},{code:72,name:"hasBulge",parser:Be}],Mu=[{code:49,name:"dashLengths",parser:y,isMultiple:!0},{code:79,name:"numberOfDashLengths",parser:y},{code:45,name:"offset",parser:Eo},{code:43,name:"base",parser:Eo},{code:53,name:"angle",parser:y}];function Eo(i,e){let t=i.code+1,s={x:i.value,y:1};return(i=e.next()).code===t?s.y=i.value:e.rewind(),s}function Il(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let Tu={extrusionDirection:{x:0,y:0,z:1},gradientRotation:0,colorTint:0},Cu=[{code:470},{code:463},{code:462,name:"colorTint",parser:y},{code:461,name:"gradientDefinition",parser:y},{code:460,name:"gradientRotation",parser:y},{code:453,name:"numberOfColors",parser:y},{code:452,name:"gradientColorFlag",parser:y},{code:451},{code:450,name:"gradientFlag",parser:y},{code:10,name:"seedPoints",parser:G,isMultiple:!0},{code:99},{code:11,name:"offsetVector",parser:G},{code:98,name:"numberOfSeedPoints",parser:y},{code:47,name:"pixelSize",parser:y},{code:53,name:"definitionLines",parser:function(i,e){let t={};return ye(Mu)(i,e,t),t},isMultiple:!0},{code:78,name:"numberOfDefinitionLines",parser:y},{code:77,name:"isDouble",parser:Be},{code:73,name:"isAnnotated",parser:Be},{code:41,name:"patternScale",parser:y},{code:52,name:"patternAngle",parser:y},{code:76,name:"patternType",parser:y},{code:75,name:"hatchStyle",parser:y},{code:92,name:"boundaryPaths",parser:function(i,e){let t={boundaryPathTypeFlag:i.value},s=t.boundaryPathTypeFlag&tu.Polyline;return i=e.next(),s?ye(ku)(i,e,t):ye(Eu)(i,e,t),t},isMultiple:!0},{code:91,name:"numberOfBoundaryPaths",parser:y},{code:71,name:"associativity",parser:y},{code:63,name:"patternFillColor",parser:y},{code:70,name:"solidFill",parser:y},{code:2,name:"patternName",parser:y},{code:210,name:"extrusionDirection",parser:G},{code:10,name:"elevationPoint",parser:G},{code:100,name:"subclassMarker",parser:y,pushContext:!0},...Ue];class El{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Il(this,"parser",ye(Cu,Tu))}}Il(El,"ForEntityName","HATCH");(br={})[br.ShowImage=1]="ShowImage",br[br.ShowImageWhenNotAlignedWithScreen=2]="ShowImageWhenNotAlignedWithScreen",br[br.UseClippingBoundary=4]="UseClippingBoundary",br[br.TransparencyIsOn=8]="TransparencyIsOn";(bs={})[bs.Rectangular=1]="Rectangular",bs[bs.Polygonal=2]="Polygonal";(xs={})[xs.Outside=0]="Outside",xs[xs.Inside=1]="Inside";function kl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let Nu={brightness:50,contrast:50,fade:0,clippingBoundaryPath:[]},Lu=[{code:290,name:"clipMode",parser:y},{code:14,name:"clippingBoundaryPath",isMultiple:!0,parser:G},{code:91,name:"countBoundaryPoints",parser:y},{code:71,name:"clippingBoundaryType",parser:y},{code:360,name:"imageDefReactorHandle",parser:y},{code:283,name:"fade",parser:y},{code:282,name:"contrast",parser:y},{code:281,name:"brightness",parser:y},{code:280,name:"isClipped",parser:Be},{code:70,name:"flags",parser:y},{code:340,name:"imageDefHandle",parser:y},{code:13,name:"imageSize",parser:G},{code:12,name:"vPixel",parser:G},{code:11,name:"uPixel",parser:G},{code:10,name:"position",parser:G},{code:90,name:"version",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class Ml{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){kl(this,"parser",ye(Lu,Nu))}}function Tl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}kl(Ml,"ForEntityName","IMAGE");let Ou={xScale:1,yScale:1,zScale:1,rotation:0,columnCount:0,rowCount:0,columnSpacing:0,rowSpacing:0,extrusionDirection:{x:0,y:0,z:1}},zu=[{code:210,name:"extrusionDirection",parser:G},{code:45,name:"rowSpacing",parser:y},{code:44,name:"columnSpacing",parser:y},{code:71,name:"rowCount",parser:y},{code:70,name:"columnCount",parser:y},{code:50,name:"rotation",parser:y},{code:43,name:"zScale",parser:y},{code:42,name:"yScale",parser:y},{code:41,name:"xScale",parser:y},{code:10,name:"insertionPoint",parser:G},{code:2,name:"name",parser:y},{code:66,name:"isVariableAttributes",parser:Be},{code:100,name:"subclassMarker",parser:y},...Ue];class Cl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Tl(this,"parser",ye(zu,Ou))}}function Nl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Tl(Cl,"ForEntityName","INSERT");let Du={isArrowheadEnabled:!0},Ru=[{code:213,name:"offsetFromAnnotation",parser:G},{code:212,name:"offsetFromBlock",parser:G},{code:211,name:"horizontalDirection",parser:G},{code:210,name:"normal",parser:G},{code:340,name:"associatedAnnotation",parser:y},{code:77,name:"byBlockColor",parser:y},{code:10,name:"vertices",parser:G,isMultiple:!0},{code:76,name:"numberOfVertices",parser:y},{code:41,name:"textWidth",parser:y},{code:40,name:"textHeight",parser:y},{code:75,name:"isHooklineExists",parser:Be},{code:74,name:"isHooklineSameDirection",parser:Be},{code:73,name:"leaderCreationFlag",parser:y},{code:72,name:"isSpline",parser:Be},{code:71,name:"isArrowheadEnabled",parser:Be},{code:3,name:"styleName",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue],Ll=class{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Nl(this,"parser",ye(Ru,Du))}};Nl(Ll,"ForEntityName","LEADER");(xr={})[xr.TextAnnotation=0]="TextAnnotation",xr[xr.ToleranceAnnotation=1]="ToleranceAnnotation",xr[xr.BlockReferenceAnnotation=2]="BlockReferenceAnnotation",xr[xr.NoAnnotation=3]="NoAnnotation";function Ol(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let Bu={thickness:0,extrusionDirection:{x:0,y:0,z:1}},Fu=[{code:210,name:"extrusionDirection",parser:G},{code:11,name:"endPoint",parser:G},{code:10,name:"startPoint",parser:G},{code:39,name:"thickness",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class zl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Ol(this,"parser",ye(Fu,Bu))}}Ol(zl,"ForEntityName","LINE");(ws={})[ws.IS_CLOSED=1]="IS_CLOSED",ws[ws.PLINE_GEN=128]="PLINE_GEN";let Uu={flag:0,elevation:0,thickness:0,extrusionDirection:{x:0,y:0,z:1},vertices:[]},Vu={bulge:0},ju=[{code:42,name:"bulge",parser:y},{code:41,name:"endWidth",parser:y},{code:40,name:"startWidth",parser:y},{code:91,name:"id",parser:y},{code:20,name:"y",parser:y},{code:10,name:"x",parser:y}],Gu=[{code:210,name:"extrusionDirection",parser:G},{code:10,name:"vertices",isMultiple:!0,parser(i,e){let t={};return ye(ju,Vu)(i,e,t),t}},{code:39,name:"thickness",parser:y},{code:38,name:"elevation",parser:y},{code:43,name:"constantWidth",parser:y},{code:70,name:"flag",parser:y},{code:90,name:"numberOfVertices",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class Ks{parseEntity(e,t){let s={};return ye(Gu,Uu)(t,e,s),s}}function Dl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Yi="LWPOLYLINE",(qi="ForEntityName")in Ks?Object.defineProperty(Ks,qi,{value:Yi,enumerable:!0,configurable:!0,writable:!0}):Ks[qi]=Yi;let Wu=[{code:90,name:"overridenSubEntityCount",parser:y},{code:140,name:"edgeCreaseWeights",parser:y,isMultiple:!0},{code:95,name:"edgeCreaseCount",parser:y},{code:94,parser(i,e,t){t.edgeCount=i.value,t.edgeIndices=[];for(let s=0;s<t.edgeCount;++s){let o=[];i=e.next(),o[0]=i.value,i=e.next(),o[1]=i.value,t.edgeIndices.push(o)}}},{code:93,parser(i,e,t){t.totalFaceIndices=i.value,t.faceIndices=[];let s=[];for(let h=0;h<t.totalFaceIndices&&!Ae(i,0);++h)i=e.next(),s.push(i.value);let o=0;for(;o<s.length;){let h=s[o++],u=[];for(let g=0;g<h;++g)u.push(s[o++]);t.faceIndices.push(u)}}},{code:10,name:"vertices",parser:G,isMultiple:!0},{code:92,name:"verticesCount",parser:y},{code:91,name:"subdivisionLevel",parser:y},{code:40,name:"blendCrease",parser:y},{code:72,name:"isBlendCreased",parser:Be},{code:71,name:"version",parser:y},{code:100,name:"subclassMarker",parser:function({value:i}){return i.trim()},pushContext:!0},...Ue];class Rl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Dl(this,"parser",ye(Wu))}}function Bl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Dl(Rl,"ForEntityName","MESH");let Hu={thickness:0,extrusionDirection:{x:0,y:0,z:1},angle:0},qu=[{code:50,name:"angle",parser:y},{code:210,name:"extrusionDirection",parser:G},{code:39,name:"thickness",parser:y},{code:10,name:"position",parser:G},{code:100,name:"subclassMarker",parser:y},...Ue];class Fl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Bl(this,"parser",ye(qu,Hu))}}Bl(Fl,"ForEntityName","POINT");(ct={})[ct.CLOSED_POLYLINE=1]="CLOSED_POLYLINE",ct[ct.CURVE_FIT=2]="CURVE_FIT",ct[ct.SPLINE_FIT=4]="SPLINE_FIT",ct[ct.POLYLINE_3D=8]="POLYLINE_3D",ct[ct.POLYGON_3D=16]="POLYGON_3D",ct[ct.CLOSED_POLYGON=32]="CLOSED_POLYGON",ct[ct.POLYFACE=64]="POLYFACE",ct[ct.CONTINUOUS=128]="CONTINUOUS";(wr={})[wr.NONE=0]="NONE",wr[wr.QUADRATIC=5]="QUADRATIC",wr[wr.CUBIC=6]="CUBIC",wr[wr.BEZIER=8]="BEZIER";(ut={})[ut.CREATED_BY_CURVE_FIT=1]="CREATED_BY_CURVE_FIT",ut[ut.TANGENT_DEFINED=2]="TANGENT_DEFINED",ut[ut.NOT_USED=4]="NOT_USED",ut[ut.CREATED_BY_SPLINE_FIT=8]="CREATED_BY_SPLINE_FIT",ut[ut.SPLINE_CONTROL_POINT=16]="SPLINE_CONTROL_POINT",ut[ut.FOR_POLYLINE=32]="FOR_POLYLINE",ut[ut.FOR_POLYGON=64]="FOR_POLYGON",ut[ut.POLYFACE=128]="POLYFACE";function Ul(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let Yu={startWidth:0,endWidth:0,bulge:0},Xu=[{code:91,name:"id",parser:y},{code:[...Js(71,75)],name:"faces",isMultiple:!0,parser:y},{code:50,name:"tangentDirection",parser:y},{code:70,name:"flag",parser:y},{code:42,name:"bulge",parser:y},{code:41,name:"endWidth",parser:y},{code:40,name:"startWidth",parser:y},{code:30,name:"z",parser:y},{code:20,name:"y",parser:y},{code:10,name:"x",parser:y},{code:100,name:"subclassMarker",parser:y},{code:100},...Ue];class ma{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Ul(this,"parser",ye(Xu,Yu))}}function Vl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Ul(ma,"ForEntityName","VERTEX");let Ku={thickness:0,flag:0,startWidth:0,endWidth:0,meshMVertexCount:0,meshNVertexCount:0,surfaceMDensity:0,surfaceNDensity:0,smoothType:0,extrusionDirection:{x:0,y:0,z:1},vertices:[]},$u=[{code:0,name:"vertices",isMultiple:!0,parser:(i,e)=>Ae(i,0,"VERTEX")?(i=e.next(),new ma().parseEntity(e,i)):ua},{code:210,name:"extrusionDirection",parser:G},{code:75,name:"smoothType",parser:y},{code:74,name:"surfaceNDensity",parser:y},{code:73,name:"surfaceMDensity",parser:y},{code:72,name:"meshNVertexCount",parser:y},{code:71,name:"meshMVertexCount",parser:y},{code:41,name:"endWidth",parser:y},{code:40,name:"startWidth",parser:y},{code:70,name:"flag",parser:y},{code:39,name:"thickness",parser:y},{code:30,name:"elevation",parser:y},{code:20},{code:10},{code:66},{code:100,name:"subclassMarker",parser:y},...Ue];class jl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Vl(this,"parser",ye($u,Ku))}}function Gl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Vl(jl,"ForEntityName","POLYLINE");let Zu=[{code:11,name:"direction",parser:G},{code:10,name:"position",parser:G},{code:100,name:"subclassMarker",parser:y},...Ue];class Wl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Gl(this,"parser",ye(Zu))}}function Hl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Gl(Wl,"ForEntityName","RAY");let Qu=[...Ii("data"),{code:70,name:"version",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class ql{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Hl(this,"parser",ye(Qu))}}function Yl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Hl(ql,"ForEntityName","REGION");let Ju={vertices:[],backLineVertices:[]},ed=[{code:360,name:"geometrySettingHardId",parser:y},{code:12,name:"backLineVertices",isMultiple:!0,parser:G},{code:93,name:"numberOfBackLineVertices",parser:y},{code:11,name:"vertices",isMultiple:!0,parser:G},{code:92,name:"verticesCount",parser:y},{code:[63,411],name:"indicatorColor",parser:y},{code:70,name:"indicatorTransparency",parser:y},{code:41,name:"bottomHeight",parser:y},{code:40,name:"topHeight",parser:y},{code:10,name:"verticalDirection",parser:G},{code:1,name:"name",parser:y},{code:91,name:"flag",parser:y},{code:90,name:"state",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class Xl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Yl(this,"parser",ye(ed,Ju))}}function Kl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Yl(Xl,"ForEntityName","SECTION");let td={points:[],thickness:0,extrusionDirection:{x:0,y:0,z:1}},rd=[{code:210,name:"extrusionDirection",parser:G},{code:39,name:"thickness",parser:y},{code:[...Js(10,14)],name:"points",isMultiple:!0,parser:G},{code:100,name:"subclassMarker",parser:y},...Ue];class $l{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Kl(this,"parser",ye(rd,td))}}function Zl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Kl($l,"ForEntityName","SOLID");let nd=[{code:350,name:"historyObjectSoftId",parser:y},{code:100,name:"subclassMarker",parser:y},...Ii("data"),{code:70,name:"version",parser:y},{code:100},...Ue];class Ql{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Zl(this,"parser",ye(nd))}}Zl(Ql,"ForEntityName","3DSOLID");(Lt={})[Lt.NONE=0]="NONE",Lt[Lt.CLOSED=1]="CLOSED",Lt[Lt.PERIODIC=2]="PERIODIC",Lt[Lt.RATIONAL=4]="RATIONAL",Lt[Lt.PLANAR=8]="PLANAR",Lt[Lt.LINEAR=16]="LINEAR";function Jl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let sd={knotTolerance:1e-6,controlTolerance:1e-6,fitTolerance:1e-9,knotValues:[],controlPoints:[],fitPoints:[]},id=[{code:11,name:"fitPoints",isMultiple:!0,parser:G},{code:10,name:"controlPoints",isMultiple:!0,parser:G},{code:41,name:"weights",isMultiple:!0,parser:y},{code:40,name:"knots",isMultiple:!0,parser:y},{code:13,name:"endTangent",parser:G},{code:12,name:"startTangent",parser:G},{code:44,name:"fitTolerance",parser:y},{code:43,name:"controlTolerance",parser:y},{code:42,name:"knotTolerance",parser:y},{code:74,name:"numberOfFitPoints",parser:y},{code:73,name:"numberOfControlPoints",parser:y},{code:72,name:"numberOfKnots",parser:y},{code:71,name:"degree",parser:y},{code:70,name:"flag",parser:y},{code:210,name:"normal",parser:G},{code:100,name:"subclassMarker",parser:y},...Ue];class eh{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Jl(this,"parser",ye(id,sd))}}Jl(eh,"ForEntityName","SPLINE");class $s{parseEntity(e,t){let s={};for(;!e.isEOF();){if(t.code===0){e.rewind();break}switch(t.code){case 100:s.subclassMarker=t.value,t=e.next();break;case 2:s.name=t.value,t=e.next();break;case 5:s.handle=t.value,t=e.next();break;case 10:s.startPoint=Vr(ze(e)),t=e.lastReadGroup;break;case 11:s.directionVector=Vr(ze(e)),t=e.lastReadGroup;break;case 90:s.tableValue=t.value,t=e.next();break;case 91:s.rowCount=t.value,t=e.next();break;case 92:s.columnCount=t.value,t=e.next();break;case 93:s.overrideFlag=t.value,t=e.next();break;case 94:s.borderColorOverrideFlag=t.value,t=e.next();break;case 95:s.borderLineWeightOverrideFlag=t.value,t=e.next();break;case 96:s.borderVisibilityOverrideFlag=t.value,t=e.next();break;case 141:s.rowHeightArr??(s.rowHeightArr=[]),s.rowHeightArr.push(t.value),t=e.next();break;case 142:s.columnWidthArr??(s.columnWidthArr=[]),s.columnWidthArr.push(t.value),t=e.next();break;case 280:s.version=t.value,t=e.next();break;case 310:s.bmpPreview??(s.bmpPreview=""),s.bmpPreview+=t.value,t=e.next();break;case 330:s.ownerDictionaryId=t.value,t=e.next();break;case 342:s.tableStyleId=t.value,t=e.next();break;case 343:s.blockRecordHandle=t.value,t=e.next();break;case 170:s.attachmentPoint=t.value,t=e.next();break;case 171:s.cells??(s.cells=[]),s.cells.push(function(o,h){let u=!1,g=!1,b={};for(;!o.isEOF()&&h.code!==0&&!g;)switch(h.code){case 171:if(u){g=!0;continue}b.cellType=h.value,u=!0,h=o.next();break;case 172:b.flagValue=h.value,h=o.next();break;case 173:b.mergedValue=h.value,h=o.next();break;case 174:b.autoFit=h.value,h=o.next();break;case 175:b.borderWidth=h.value,h=o.next();break;case 176:b.borderHeight=h.value,h=o.next();break;case 91:b.overrideFlag=h.value,h=o.next();break;case 178:b.virtualEdgeFlag=h.value,h=o.next();break;case 145:b.rotation=h.value,h=o.next();break;case 345:b.fieldObjetId=h.value,h=o.next();break;case 340:b.blockTableRecordId=h.value,h=o.next();break;case 146:b.blockScale=h.value,h=o.next();break;case 177:b.blockAttrNum=h.value,h=o.next();break;case 7:b.textStyle=h.value,h=o.next();break;case 140:b.textHeight=h.value,h=o.next();break;case 170:b.attachmentPoint=h.value,h=o.next();break;case 92:b.extendedCellFlags=h.value,h=o.next();break;case 285:b.rightBorderVisibility=!!(h.value??!0),h=o.next();break;case 286:b.bottomBorderVisibility=!!(h.value??!0),h=o.next();break;case 288:b.leftBorderVisibility=!!(h.value??!0),h=o.next();break;case 289:b.topBorderVisibility=!!(h.value??!0),h=o.next();break;case 301:(function(f,A,x){for(;x.code!==304;)switch(x.code){case 301:case 93:case 90:case 94:x=A.next();break;case 1:f.text=x.value,x=A.next();break;case 300:f.attrText=x.value,x=A.next();break;case 302:f.text=x.value?x.value:f.text,x=A.next();break;default:console.log(`Ignore code: ${x.code}, value: ${x.value}`),x=A.next()}})(b,o,h),h=o.next();break;default:return b}return u=!1,g=!1,b}(e,t)),t=e.lastReadGroup;break;default:da(s,t,e),t=e.next()}}return s}}function th(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Ki="ACAD_TABLE",(Xi="ForEntityName")in $s?Object.defineProperty($s,Xi,{value:Ki,enumerable:!0,configurable:!0,writable:!0}):$s[Xi]=Ki;let ad=[{code:11,name:"xAxisDirection",parser:G},{code:210,name:"extrusionDirection",parser:G},{code:1,name:"text",parser:y},{code:10,name:"position",parser:G},{code:3,name:"styleName",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class rh{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){th(this,"parser",ye(ad))}}th(rh,"ForEntityName","TOLERANCE");let Zs=class{parseEntity(e,t){let s={};for(;t!=="EOF";){if(t.code===0){e.rewind();break}!function(o,h,u){if(u==="EOF")return!1;switch(u.code){case 0:return!1;case 8:o.layer=u.value;break;case 100:o.subclassMarker=u.value;break;case 10:o.viewportCenter=Vr(ze(h));break;case 40:o.width=u.value;break;case 41:o.height=u.value;break;case 68:o.status=u.value;break;case 69:o.viewportId=u.value;break;case 12:o.displayCenter=ze(h);break;case 13:o.snapBase=ze(h);break;case 14:o.snapSpacing=ze(h);break;case 15:o.gridSpacing=ze(h);break;case 16:o.viewDirection=Vr(ze(h));break;case 17:o.targetPoint=Vr(ze(h));break;case 42:o.perspectiveLensLength=u.value;break;case 43:o.frontClipZ=u.value;break;case 44:o.backClipZ=u.value;break;case 45:o.viewHeight=u.value;break;case 50:o.snapAngle=u.value;break;case 51:o.viewTwistAngle=u.value;break;case 72:o.circleZoomPercent=u.value;break;case 331:o.frozenLayerIds??(o.frozenLayerIds=[]),o.frozenLayerIds.push(u.value);break;case 90:o.statusBitFlags=u.value;break;case 340:o.clippingBoundaryId=u.value;break;case 1:o.sheetName=u.value;break;case 281:o.renderMode=u.value;break;case 71:o.ucsPerViewport=u.value;break;case 110:o.ucsOrigin=Vr(ze(h));break;case 111:o.ucsXAxis=Vr(ze(h));break;case 112:o.ucsYAxis=Vr(ze(h));break;case 345:o.ucsId=u.value;break;case 346:o.ucsBaseId=u.value;break;case 79:o.orthographicType=u.value;break;case 146:o.elevation=u.value;break;case 170:o.shadePlotMode=u.value;break;case 61:o.majorGridFrequency=u.value;break;case 332:o.backgroundId=u.value;break;case 333:o.shadePlotId=u.value;break;case 348:o.visualStyleId=u.value;break;case 292:o.isDefaultLighting=!!u.value;break;case 282:o.defaultLightingType=u.value;break;case 141:o.brightness=u.value;break;case 142:o.contrast=u.value;break;case 63:case 421:case 431:o.ambientLightColor=u.value;break;case 361:o.sunId=u.value;break;case 335:case 343:case 344:case 91:o.softPointer=u.value}return!0}(s,e,t)&&da(s,t,e),t=e.next()}return s}};Zi="VIEWPORT",($i="ForEntityName")in Zs?Object.defineProperty(Zs,$i,{value:Zi,enumerable:!0,configurable:!0,writable:!0}):Zs[$i]=Zi;(Ar={})[Ar.ShowImage=1]="ShowImage",Ar[Ar.ShowImageWhenNotAligned=2]="ShowImageWhenNotAligned",Ar[Ar.UseClippingBoundary=4]="UseClippingBoundary",Ar[Ar.Transparency=8]="Transparency";function nh(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let od={brightness:50,constrast:50,fade:0},ld=[{code:14,name:"boundary",isMultiple:!0,parser:G},{code:91,name:"numberOfVertices",parser:y},{code:71,name:"boundaryType",parser:y},{code:360,name:"imageDefReactorHardId",parser:y},{code:283,name:"fade",parser:y},{code:282,name:"contrast",parser:y},{code:281,name:"brightness",parser:y},{code:280,name:"isClipping",parser:Be},{code:70,name:"displayFlag",parser:y},{code:340,name:"imageDefHardId",parser:y},{code:13,name:"imageSize",parser:G},{code:12,name:"vDirection",parser:G},{code:11,name:"uDirection",parser:G},{code:10,name:"position",parser:G},{code:90,name:"classVersion",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class sh{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){nh(this,"parser",ye(ld,od))}}function ih(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}nh(sh,"ForEntityName","WIPEOUT");let hd=[{code:11,name:"direction",parser:G},{code:10,name:"position",parser:G},{code:100,name:"subclassMarker",parser:y},...Ue],ah=class{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){ih(this,"parser",ye(hd))}};function oh(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}ih(ah,"ForEntityName","XLINE");let cd={},ud=[{code:170,name:"multileaderType",parser:y},{code:291,name:"doglegEnabled",parser:Be},{code:40,name:"doglegLength",parser:y},{code:172,name:"contentType",parser:y},{code:3,name:"textContent",parser:y},{code:12,name:"textAnchor",parser:G},{code:344,name:"blockHandle",parser:y},{code:15,name:"blockPosition",parser:G},{code:302,name:"leaderSections",parser:function(i,e,t){let s,o={leaderLines:[]};for(;e.hasNext()&&(s=e.next()).code!==303;)switch(s.code){case 10:o.landingPoint=(s.value,ze(e));break;case 11:o.doglegVector=(s.value,ze(e));break;case 40:o.doglegLength=s.value;break;case 304:o.leaderLines.push(function(h,u,g){let b,f={vertices:[]};for(;u.hasNext()&&(b=u.next()).code!==305;)b.code===10&&f.vertices.push((b.value,ze(u)));return f}(0,e))}return o},isMultiple:!0},...Ue];class lh{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){oh(this,"parser",ye(ud,cd))}}oh(lh,"ForEntityName","MULTILEADER");let dd=Object.fromEntries([al,dl,fl,vl,bl,Xs,wl,Pl,Ml,Cl,Ll,zl,Ks,Rl,pl,lh,Fl,jl,Wl,ql,Xl,$l,Ql,eh,$s,cl,rh,El,ma,Zs,sh,ah].map(i=>[i.ForEntityName,new i]));function hh(i,e){let t=[];for(;!Ae(i,0,"EOF");){if(i.code===0){if(i.value==="ENDBLK"||i.value==="ENDSEC"){e.rewind();break}let s=dd[i.value];if(s){let o=i.value;i=e.next();let h=s.parseEntity(e,i);h.type=o,nl(h),t.push(h)}else e.debug&&console.warn(`Unsupported ENTITY type: ${i.value}`)}i=e.next()}return t}function md(i,e){let t={};for(;!Ae(i,0,"EOF")&&!Ae(i,0,"ENDSEC");){if(Ae(i,0,"BLOCK")){let s=pd(i=e.next(),e);nl(s),s.name&&(t[s.name]=s)}i=e.next()}return t}function pd(i,e){let t={};for(;!Ae(i,0,"EOF");){if(Ae(i,0,"ENDBLK")){for(i=e.next();!Ae(i,0,"EOF");){if(Ae(i,100,"AcDbBlockEnd"))return t;i=e.next()}break}switch(i.code){case 1:t.xrefPath=i.value;break;case 2:t.name=i.value;break;case 3:t.name2=i.value;break;case 5:t.handle=i.value;break;case 8:t.layer=i.value;break;case 10:t.position=ze(e);break;case 67:t.paperSpace=!!i.value&&i.value==1;break;case 70:i.value!==0&&(t.type=i.value);break;case 100:break;case 330:t.ownerHandle=i.value;break;case 0:t.entities=hh(i,e)}i=e.next()}return t}function gd(i,e){let t=null,s={};for(;!Ae(i,0,"EOF")&&!Ae(i,0,"ENDSEC");)i.code===9?t=i.value:i.code===10?s[t]=ze(e):s[t]=i.value,i=e.next();return s}(Ot={})[Ot.NOT_APPLICABLE=0]="NOT_APPLICABLE",Ot[Ot.KEEP_EXISTING=1]="KEEP_EXISTING",Ot[Ot.USE_CLONE=2]="USE_CLONE",Ot[Ot.XREF_VALUE_NAME=3]="XREF_VALUE_NAME",Ot[Ot.VALUE_NAME=4]="VALUE_NAME",Ot[Ot.UNMANGLE_NAME=5]="UNMANGLE_NAME";let pa=[{code:330,name:"ownerObjectId",parser:y},{code:102,parser:dn},{code:102,parser:dn},{code:102,parser:dn},{code:5,name:"handle",parser:y}],fd=[{code:3,name:"entries",parser:(i,e)=>{let t={name:i.value};return(i=e.next()).code===350?t.objectSoftId=i.value:i.code===360?t.objectHardId=i.value:e.rewind(),t},isMultiple:!0},{code:281,name:"recordCloneFlag",parser:y},{code:280,name:"isHardOwned",parser:Be},{code:100,name:"subclassMarker",parser:y},...pa],_d=[{code:330,name:"imageDefReactorIdSoft",isMultiple:!0,parser:y},{code:90,name:"version",parser:y},{code:1,name:"fileName",parser:y},{code:10,name:"size",parser:G},{code:11,name:"sizeOfOnePixel",parser:G},{code:280,name:"isLoaded",parser:y},{code:281,name:"resolutionUnits",parser:y},{code:100,name:"subclassMarker",parser:y}];(an={})[an.NOUNIT=0]="NOUNIT",an[an.CENTIMETERS=2]="CENTIMETERS",an[an.INCH=5]="INCH";(As={})[As.PSLTSCALE=1]="PSLTSCALE",As[As.LIMCHECK=2]="LIMCHECK";(on={})[on.INCHES=0]="INCHES",on[on.MILLIMETERS=1]="MILLIMETERS",on[on.PIXELS=2]="PIXELS";(zt={})[zt.LAST_SCREEN_DISPLAY=0]="LAST_SCREEN_DISPLAY",zt[zt.DRAWING_EXTENTS=1]="DRAWING_EXTENTS",zt[zt.DRAWING_LIMITS=2]="DRAWING_LIMITS",zt[zt.VIEW_SPECIFIED=3]="VIEW_SPECIFIED",zt[zt.WINDOW_SPECIFIED=4]="WINDOW_SPECIFIED",zt[zt.LAYOUT_INFORMATION=5]="LAYOUT_INFORMATION";(Pr={})[Pr.AS_DISPLAYED=0]="AS_DISPLAYED",Pr[Pr.WIREFRAME=1]="WIREFRAME",Pr[Pr.HIDDEN=2]="HIDDEN",Pr[Pr.RENDERED=3]="RENDERED";(Dt={})[Dt.DRAFT=0]="DRAFT",Dt[Dt.PREVIEW=1]="PREVIEW",Dt[Dt.NORMAL=2]="NORMAL",Dt[Dt.PRESENTATION=3]="PRESENTATION",Dt[Dt.MAXIMUM=4]="MAXIMUM",Dt[Dt.CUSTOM=5]="CUSTOM";let ch=[{code:333,name:"shadePlotId",parser:y},{code:149,name:"imageOriginY",parser:y},{code:148,name:"imageOriginX",parser:y},{code:147,name:"scaleFactor",parser:y},{code:78,name:"shadePlotCustomDPI",parser:y},{code:77,name:"shadePlotResolution",parser:y},{code:76,name:"shadePlotMode",parser:y},{code:75,name:"standardScaleType",parser:y},{code:7,name:"currentStyleSheet",parser:y},{code:74,name:"plotType",parser:y},{code:73,name:"plotRotation",parser:y},{code:72,name:"plotPaperUnit",parser:y},{code:70,name:"layoutFlag",parser:y},{code:143,name:"printScaleDenominator",parser:y},{code:142,name:"printScaleNumerator",parser:y},{code:141,name:"windowAreaYMax",parser:y},{code:140,name:"windowAreaXMax",parser:y},{code:49,name:"windowAreaYMin",parser:y},{code:48,name:"windowAreaXMin",parser:y},{code:47,name:"plotOriginY",parser:y},{code:46,name:"plotOriginX",parser:y},{code:45,name:"paperHeight",parser:y},{code:44,name:"paperWidth",parser:y},{code:43,name:"marginTop",parser:y},{code:42,name:"marginRight",parser:y},{code:41,name:"marginBottom",parser:y},{code:40,name:"marginLeft",parser:y},{code:6,name:"plotViewName",parser:y},{code:4,name:"paperSize",parser:y},{code:2,name:"configName",parser:y},{code:1,name:"pageSetupName",parser:y},{code:100,name:"subclassMarker",parser:y},...pa],vd=[{code:346,name:"orthographicUcsId",parser:y},{code:345,name:"namedUcsId",parser:y},{code:331,name:"viewportId",parser:y},{code:330,name:"paperSpaceTableId",parser:y},{code:76,name:"orthographicType",parser:y},{code:17,name:"ucsYAxis",parser:G},{code:16,name:"ucsXAxis",parser:G},{code:13,name:"ucsOrigin",parser:G},{code:146,name:"elevation",parser:y},{code:15,name:"maxExtent",parser:G},{code:14,name:"minExtent",parser:G},{code:12,name:"insertionPoint",parser:G},{code:11,name:"maxLimit",parser:G},{code:10,name:"minLimit",parser:G},{code:71,name:"tabOrder",parser:y},{code:70,name:"controlFlag",parser:y},{code:1,name:"layoutName",parser:y},{code:100,name:"subclassMarker",parser:y},...ch],yd=[{code:40,name:"wcsToOCSTransform",parser:ko},{code:40,name:"ocsToWCSTransform",parser:ko},{code:41,name:"backClippingDistance",parser:y},{code:73,name:"isBackClipping",parser:Be,pushContext:!0},{code:40,name:"frontClippingDistance",parser:y},{code:72,name:"isFrontClipping",parser:Be,pushContext:!0},{code:71,name:"isClipBoundaryDisplayed",parser:Be},{code:11,name:"position",parser:G},{code:210,name:"normal",parser:G},{code:10,name:"boundaryVertices",parser:G,isMultiple:!0},{code:70,name:"boundaryCount",parser:y},{code:100,name:"subclassMarker",parser:y},{code:100},...pa];function ko(i,e){let t=[];for(let s=0;s<3&&Ae(i,40);++s){let o=[];for(let h=0;h<4&&Ae(i,40);++h)o.push(i.value),i=e.next();t.push(o)}return e.rewind(),t}let bd={LAYOUT:vd,PLOTSETTINGS:ch,DICTIONARY:fd,SPATIAL_FILTER:yd,IMAGEDEF:_d};function xd(i,e){let t=[];for(;i.code!==0||!["EOF","ENDSEC"].includes(i.value);){let s=i.value,o=bd[s];if(i.code===0&&(o!=null&&o.length)){let h=ye(o),u={name:s};h(i=e.next(),e,u)?(t.push(u),i=e.peek()):i=e.next()}else i=e.next()}return{byName:du(t,({name:s})=>s)}}let Fn=[{code:100,name:"subclassMarker",parser:y},{code:330,name:"ownerObjectId",parser:y},{code:102,parser(i,e){for(;!Ae(i,0,"EOF")&&!Ae(i,102,"}");)i=e.next()}},{code:5,name:"handle",parser:y}],wd=ye([{code:310,name:"bmpPreview",parser:y},{code:281,name:"scalability",parser:y},{code:280,name:"explodability",parser:y},{code:70,name:"insertionUnits",parser:y},{code:340,name:"layoutObjects",parser:y},{code:2,name:"name",parser:y},{code:100,name:"subclassMarker",parser:y},...Fn]),Ad=[{name:"DIMPOST",code:3},{name:"DIMAPOST",code:4},{name:"DIMBLK_OBSOLETE",code:5},{name:"DIMBLK1_OBSOLETE",code:6},{name:"DIMBLK2_OBSOLETE",code:7},{name:"DIMSCALE",code:40,defaultValue:1},{name:"DIMASZ",code:41,defaultValue:.25},{name:"DIMEXO",code:42,defaultValue:.625,defaultValueImperial:.0625},{name:"DIMDLI",code:43,defaultValue:3.75,defaultValueImperial:.38},{name:"DIMEXE",code:44,defaultValue:2.25,defaultValueImperial:.28},{name:"DIMRND",code:45,defaultValue:0},{name:"DIMDLE",code:46,defaultValue:0},{name:"DIMTP",code:47,defaultValue:0},{name:"DIMTM",code:48,defaultValue:0},{name:"DIMTXT",code:140,defaultValue:2.5,defaultValueImperial:.28},{name:"DIMCEN",code:141,defaultValue:2.5,defaultValueImperial:.09},{name:"DIMTSZ",code:142,defaultValue:0},{name:"DIMALTF",code:143,defaultValue:25.4},{name:"DIMLFAC",code:144,defaultValue:1},{name:"DIMTVP",code:145,defaultValue:0},{name:"DIMTFAC",code:146,defaultValue:1},{name:"DIMGAP",code:147,defaultValue:.625,defaultValueImperial:.09},{name:"DIMALTRND",code:148,defaultValue:0},{name:"DIMTOL",code:71,defaultValue:0,defaultValueImperial:1},{name:"DIMLIM",code:72,defaultValue:0},{name:"DIMTIH",code:73,defaultValue:0,defaultValueImperial:1},{name:"DIMTOH",code:74,defaultValue:0,defaultValueImperial:1},{name:"DIMSE1",code:75,defaultValue:0},{name:"DIMSE2",code:76,defaultValue:0},{name:"DIMTAD",code:77,defaultValue:Io.Above,defaultValueImperial:Io.Center},{name:"DIMZIN",code:78,defaultValue:Nn.Trailing,defaultValueImperial:Nn.Feet},{name:"DIMAZIN",code:79,defaultValue:Qc.None},{name:"DIMALT",code:170,defaultValue:0},{name:"DIMALTD",code:171,defaultValue:3,defaultValueImperial:2},{name:"DIMTOFL",code:172,defaultValue:1,defaultValueImperial:0},{name:"DIMSAH",code:173,defaultValue:0},{name:"DIMTIX",code:174,defaultValue:0},{name:"DIMSOXD",code:175,defaultValue:0},{name:"DIMCLRD",code:176,defaultValue:0},{name:"DIMCLRE",code:177,defaultValue:0},{name:"DIMCLRT",code:178,defaultValue:0},{name:"DIMADEC",code:179},{name:"DIMUNIT",code:270},{name:"DIMDEC",code:271,defaultValue:2,defaultValueImperial:4},{name:"DIMTDEC",code:272,defaultValue:2,defaultValueImperial:4},{name:"DIMALTU",code:273,defaultValue:2},{name:"DIMALTTD",code:274,defaultValue:2,defaultValueImperial:4},{name:"DIMAUNIT",code:275,defaultValue:0},{name:"DIMFRAC",code:276,defaultValue:0},{name:"DIMLUNIT",code:277,defaultValue:2},{name:"DIMDSEP",code:278,defaultValue:",",defaultValueImperial:"."},{name:"DIMJUST",code:280,defaultValue:Jc.Center},{name:"DIMSD1",code:281,defaultValue:0},{name:"DIMSD2",code:282,defaultValue:0},{name:"DIMTOLJ",code:283,defaultValue:eu.Center},{name:"DIMTZIN",code:284,defaultValue:Nn.Trailing,defaultValueImperial:Nn.Feet},{name:"DIMALTZ",code:285,defaultValue:Nn.Trailing},{name:"DIMALTTZ",code:286,defaultValue:Nn.Trailing},{name:"DIMFIT",code:287},{name:"DIMUPT",code:288,defaultValue:0},{name:"DIMATFIT",code:289,defaultValue:3},{name:"DIMTXSTY",code:340},{name:"DIMLDRBLK",code:341},{name:"DIMBLK",code:342},{name:"DIMBLK1",code:343},{name:"DIMBLK2",code:344},{name:"DIMLWD",code:371,defaultValue:-2},{name:"DIMLWD",code:372,defaultValue:-2}],Pd=ye([...Ad.map(i=>({...i,parser:y})),{code:70,name:"standardFlag",parser:y},{code:2,name:"name",parser:y},{code:100,name:"subclassMarker",parser:y},{code:105,name:"handle",parser:y},...Fn.filter(i=>i.code!==5)]),Sd=ye([{code:347,name:"materialObjectId",parser:y},{code:390,name:"plotStyleNameObjectId",parser:y},{code:370,name:"lineweight",parser:y},{code:290,name:"isPlotting",parser:Be},{code:6,name:"lineType",parser:y},{code:62,name:"colorIndex",parser:y},{code:70,name:"standardFlag",parser:y},{code:2,name:"name",parser:y},{code:100,name:"subclassMarker",parser:y},...Fn]);(Sr={})[Sr.NONE=0]="NONE",Sr[Sr.AbsoluteRotation=1]="AbsoluteRotation",Sr[Sr.TextEmbedded=2]="TextEmbedded",Sr[Sr.ShapeEmbedded=4]="ShapeEmbedded";let Id=ye([{code:9,name:"text",parser:y},{code:45,name:"offsetY",parser:y},{code:44,name:"offsetX",parser:y},{code:50,name:"rotation",parser:y},{code:46,name:"scale",parser:y},{code:340,name:"styleObjectId",parser:y},{code:75,name:"shapeNumber",parser:y},{code:74,name:"elementTypeFlag",parser:y},{code:49,name:"elementLength",parser:y}],{elementTypeFlag:0,elementLength:0}),Ed=ye([{code:49,name:"pattern",parser(i,e){let t={};return Id(i,e,t),t},isMultiple:!0},{code:40,name:"totalPatternLength",parser:y},{code:73,name:"numberOfLineTypes",parser:y},{code:72,parser:y},{code:3,name:"description",parser:y},{code:70,name:"standardFlag",parser:y},{code:2,name:"name",parser:y},{code:100,name:"subclassMarker",parser:y},...Fn]),kd=ye([{code:1e3,name:"extendedFont",parser:y},{code:1001},{code:4,name:"bigFont",parser:y},{code:3,name:"font",parser:y},{code:42,name:"lastHeight",parser:y},{code:71,name:"textGenerationFlag",parser:y},{code:50,name:"obliqueAngle",parser:y},{code:41,name:"widthFactor",parser:y},{code:40,name:"fixedTextHeight",parser:y},{code:70,name:"standardFlag",parser:y},{code:2,name:"name",parser:y},{code:100,name:"subclassMarker",parser:y},...Fn]),Md=ye([{code:[63,421,431],name:"ambientColor",parser:y},{code:142,name:"contrast",parser:y},{code:141,name:"brightness",parser:y},{code:282,name:"defaultLightingType",parser:y},{code:292,name:"isDefaultLightingOn",parser:Be},{code:348,name:"visualStyleObjectId",parser:y},{code:333,name:"shadePlotObjectId",parser:y},{code:332,name:"backgroundObjectId",parser:y},{code:61,name:"majorGridLines",parser:y},{code:170,name:"shadePlotSetting",parser:y},{code:146,name:"elevation",parser:y},{code:79,name:"orthographicType",parser:y},{code:112,name:"ucsYAxis",parser:G},{code:111,name:"ucsXAxis",parser:G},{code:110,name:"ucsOrigin",parser:G},{code:74,name:"ucsIconSetting",parser:y},{code:71,name:"viewMode",parser:y},{code:281,name:"renderMode",parser:y},{code:1,name:"styleSheet",parser:y},{code:[331,441],name:"frozenLayers",parser:y,isMultiple:!0},{code:72,name:"circleSides",parser:y},{code:51,name:"viewTwistAngle",parser:y},{code:50,name:"snapRotationAngle",parser:y},{code:45,name:"viewHeight",parser:y},{code:44,name:"backClippingPlane",parser:y},{code:43,name:"frontClippingPlane",parser:y},{code:42,name:"lensLength",parser:y},{code:17,name:"viewTarget",parser:G},{code:16,name:"viewDirectionFromTarget",parser:G},{code:15,name:"gridSpacing",parser:G},{code:14,name:"snapSpacing",parser:G},{code:13,name:"snapBasePoint",parser:G},{code:12,name:"center",parser:G},{code:11,name:"upperRightCorner",parser:G},{code:10,name:"lowerLeftCorner",parser:G},{code:70,name:"standardFlag",parser:y},{code:2,name:"name",parser:y},{code:100,name:"subclassMarker",parser:y},...Fn]),Td={BLOCK_RECORD:wd,DIMSTYLE:Pd,LAYER:Sd,LTYPE:Ed,STYLE:kd,VPORT:Md},Cd=ye([{code:70,name:"maxNumberOfEntries",parser:y},{code:100,name:"subclassMarker",parser:y},{code:330,name:"ownerObjectId",parser:y},{code:102},{code:360,isMultiple:!0},{code:102},{code:5,name:"handle",parser:y},{code:2,name:"name",parser:y}]);function Nd(i,e){var s;let t={};for(;!Ae(i,0,"EOF")&&!Ae(i,0,"ENDSEC");){if(Ae(i,0,"TABLE")){i=e.next();let o={entries:[]};Cd(i,e,o),t[o.name]=o}if(Ae(i,0)&&!Ae(i,0,"ENDTAB")){let o=i.value;i=e.next();let h=Td[o];if(!h){e.debug&&console.warn(`parseTable: Invalid table name '${o}'`),i=e.next();continue}let u={};h(i,e,u),(s=t[o])==null||s.entries.push(u)}i=e.next()}return t}function Ps(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}class Mo{next(){if(!this.hasNext())return this._eof?this.debug&&console.warn("Cannot call 'next' after EOF group has been read"):this.debug&&console.warn("Unexpected end of input: EOF group not read before end of file. Ended on code "+this._data[this._pointer]),{code:0,value:"EOF"};let e=parseInt(this._data[this._pointer++],10),t=To(e,this._data[this._pointer++],this.debug),s={code:e,value:t};return Ae(s,0,"EOF")&&(this._eof=!0),this.lastReadGroup=s,s}peek(){if(!this.hasNext())throw this._eof?Error("Cannot call 'next' after EOF group has been read"):Error("Unexpected end of input: EOF group not read before end of file. Ended on code "+this._data[this._pointer]);let e={code:parseInt(this._data[this._pointer]),value:0};return e.value=To(e.code,this._data[this._pointer+1],this.debug),e}rewind(e){e=e||1,this._pointer=this._pointer-2*e}hasNext(){return!this._eof&&!(this._pointer>this._data.length-2)}isEOF(){return this._eof}constructor(e,t=!1){Ps(this,"_data",void 0),Ps(this,"debug",void 0),Ps(this,"_pointer",void 0),Ps(this,"_eof",void 0),Ps(this,"lastReadGroup",void 0),this._data=e,this.debug=t,this.lastReadGroup={code:0,value:0},this._pointer=0,this._eof=!1}}function To(i,e,t=!1){return i<=9?e:i>=10&&i<=59?parseFloat(e.trim()):i>=60&&i<=99?parseInt(e.trim()):i>=100&&i<=109?e:i>=110&&i<=149?parseFloat(e.trim()):i>=160&&i<=179?parseInt(e.trim()):i>=210&&i<=239?parseFloat(e.trim()):i>=270&&i<=289?parseInt(e.trim()):i>=290&&i<=299?function(s){if(s==="0")return!1;if(s==="1")return!0;throw TypeError("String '"+s+"' cannot be cast to Boolean type")}(e.trim()):i>=300&&i<=369?e:i>=370&&i<=389?parseInt(e.trim()):i>=390&&i<=399?e:i>=400&&i<=409?parseInt(e.trim()):i>=410&&i<=419?e:i>=420&&i<=429?parseInt(e.trim()):i>=430&&i<=439?e:i>=440&&i<=459?parseInt(e.trim()):i>=460&&i<=469?parseFloat(e.trim()):i>=470&&i<=481||i===999||i>=1e3&&i<=1009?e:i>=1010&&i<=1059?parseFloat(e.trim()):i>=1060&&i<=1071?parseInt(e.trim()):(t&&console.warn("WARNING: Group code does not have a defined type: %j",{code:i,value:e}),e)}function sa(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}class Ld{constructor(){sa(this,"encoding","utf-8"),sa(this,"encodingFailureFatal",!1)}}class Od extends EventTarget{parseSync(e,t=!1){let s=new Mo(e.split(/\r\n|\r|\n/g),t);if(!s.hasNext())throw Error("Empty file");return this.parseAll(s)}parseStream(e){let t="",s=this;return new Promise((o,h)=>{e.on("data",u=>{t+=u}),e.on("end",()=>{try{let u=t.split(/\r\n|\r|\n/g),g=new Mo(u);if(!g.hasNext())throw Error("Empty file");o(s.parseAll(g))}catch(u){h(u)}}),e.on("error",u=>{h(u)})})}async parseFromUrl(e,t){let s=await fetch(e,t);if(!s.body)return null;let o=s.body.getReader(),h="";for(;;){let{done:u,value:g}=await o.read();if(u){h+=this._decoder.decode(new ArrayBuffer(0),{stream:!1});break}h+=this._decoder.decode(g,{stream:!0})}return this.parseSync(h)}parseAll(e){let t={header:{},blocks:{},entities:[],tables:{},objects:{byName:{},byTree:void 0}},s=e.next();for(;!Ae(s,0,"EOF");)Ae(s,0,"SECTION")&&(Ae(s=e.next(),2,"HEADER")?(s=e.next(),t.header=gd(s,e)):Ae(s,2,"BLOCKS")?(s=e.next(),t.blocks=md(s,e)):Ae(s,2,"ENTITIES")?(s=e.next(),t.entities=hh(s,e)):Ae(s,2,"TABLES")?(s=e.next(),t.tables=Nd(s,e)):Ae(s,2,"OBJECTS")&&(s=e.next(),t.objects=xd(s,e))),s=e.next();return t}constructor(e=new Ld){super(),sa(this,"_decoder",void 0),this._decoder=new TextDecoder(e.encoding,{fatal:e.encodingFailureFatal})}}var ga=(i=>(i[i.DecimalDegrees=0]="DecimalDegrees",i[i.DegreesMinutesSeconds=1]="DegreesMinutesSeconds",i[i.Gradians=2]="Gradians",i[i.Radians=3]="Radians",i[i.SurveyorsUnits=4]="SurveyorsUnits",i))(ga||{});class Gr{static get instance(){return this._instance||(this._instance=new Gr),this._instance}constructor(){this._blocks=new Map}createKey(e,t){return`${e}_${t}`}set(e,t){return t=t.fastDeepClone(),this._blocks.set(e,t),t}get(e){let t=this._blocks.get(e);return t&&(t=t.fastDeepClone()),t}has(e){return this._blocks.has(e)}clear(){this._blocks.clear()}draw(e,t,s,o=!0,h,u){const g=[];if(t!=null){const b=this.createKey(t.name,s);let f;if(this.has(b))f=this.get(b);else{const A=t.newIterator();for(const x of A)x.color.isByBlock&&s?(Co.copy(x.color),x.color.color=s,this.addEntity(x,g,e),x.color.copy(Co)):this.addEntity(x,g,e);f=e.group(g),f&&o&&this.set(b,f)}return f&&h&&(f.applyMatrix(h),u&&(u.x!=0||u.y!=0||u.z!=1)&&(h.setFromExtrusionDirection(u),f.applyMatrix(h))),f}else return e.group(g)}addEntity(e,t,s){const o=e.draw(s);o&&(this.attachEntityInfo(o,e),t.push(o))}attachEntityInfo(e,t){e.objectId=t.objectId,e.ownerId=t.ownerId,e.layerName=t.layer,e.visible=t.visibility}}const Co=new fn,ei="Continuous",Qs="ByLayer",uh="ByBlock";var cn=(i=>(i[i.EndPoint=1]="EndPoint",i[i.MidPoint=2]="MidPoint",i[i.Center=3]="Center",i[i.Node=4]="Node",i[i.Quadrant=5]="Quadrant",i[i.Insertion=7]="Insertion",i[i.Perpendicular=8]="Perpendicular",i[i.Tangent=9]="Tangent",i[i.Nearest=10]="Nearest",i[i.Centroid=11]="Centroid",i))(cn||{}),fa=(i=>(i[i.Undefined=0]="Undefined",i[i.Inches=1]="Inches",i[i.Feet=2]="Feet",i[i.Miles=3]="Miles",i[i.Millimeters=4]="Millimeters",i[i.Centimeters=5]="Centimeters",i[i.Meters=6]="Meters",i[i.Kilometers=7]="Kilometers",i[i.Microinches=8]="Microinches",i[i.Mils=9]="Mils",i[i.Yards=10]="Yards",i[i.Angstroms=11]="Angstroms",i[i.Nanometers=12]="Nanometers",i[i.Microns=13]="Microns",i[i.Decimeters=14]="Decimeters",i[i.Dekameters=15]="Dekameters",i[i.Hectometers=16]="Hectometers",i[i.Gigameters=17]="Gigameters",i[i.Astronomical=18]="Astronomical",i[i.LightYears=19]="LightYears",i[i.Parsecs=20]="Parsecs",i[i.USSurveyFeet=21]="USSurveyFeet",i[i.USSurveyInch=22]="USSurveyInch",i[i.USSurveyYard=23]="USSurveyYard",i[i.USSurveyMile=24]="USSurveyMile",i[i.Max=24]="Max",i))(fa||{});function zd(i){return i==4||i==5||i==6||i==7||i==12||i==13||i==14||i==15||i==16||i==17}function Dd(i){return i==1||i==2||i==3||i==8||i==9||i==10||i==21}var dh=(i=>(i.ClosedFilled="",i.Dot="_DOT",i.DotSmall="_DOTSMALL",i.DotBlank="_DOTBLANK",i.Origin="_ORIGIN",i.Origin2="_ORIGIN2",i.Open="_OPEN",i.Open90="_OPEN90",i.Open30="_OPEN30",i.Closed="_CLOSED",i.Small="_SMALL",i.None="_NONE",i.Oblique="_OBLIQUE",i.BoxFilled="_BOXFILLED",i.Box="_BOXBLANK",i.ClosedBlank="_CLOSEDBLANK",i.DatumBlank="_DATUMBLANK",i.DatumFilled="_DATUMFILLED",i.Integral="_INTEGRAL",i.ArchTick="_ARCHTICK",i))(dh||{});class Ei{constructor(e){this.i=0,this._records=e,this._keys=Array.from(e.keys())}[Symbol.iterator](){return this}next(){for(;this.i<this._keys.length;){const e=this._records.get(this._keys[this.i]);return this.i+=1,{value:e,done:!1}}return{value:null,done:!0}}}const mh="Load Database";class St extends Zo{constructor(e,t){super(e.stage),this.data=e,this.progress=t}async run(e){const t=ca.getInstance().getEntry(mh),s=Date.now();this.progress&&await this.progress(this.data.progress.value,this.data.stage,"START");const o=await this.data.task(e);if(this.progress){const h=o.data;await this.progress(this.data.progress.value,this.data.stage,"END",h),this.data.progress.value+=this.data.step,this.data.progress.value>100&&(this.data.progress.value=100)}return t&&(t.data[this.name]=Date.now()-s),o}}class ph{constructor(e={}){this.config=e}async read(e,t,s,o){const h={name:mh,data:{total:0},format(){let f="";return Object.keys(this.data).forEach(A=>{A!=="total"&&(f+=`- ${A}: ${this.data[A]} ms
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function jc(i,e){for(var t=0;t<e.length;t++){const s=e[t];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in i)){const h=Object.getOwnPropertyDescriptor(s,o);h&&Object.defineProperty(i,o,h.get?h:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}const qs={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Gi=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215,0];function ls(i,e,t){return Math.max(e,Math.min(t,i))}const Go=class Wo{constructor(){this._colorIndex=256,this._color=null,this._colorName=null}get color(){return this._color}set color(e){e==null?this._color=null:(this._color=Math.round(ls(e,0,256*256*256-1)),this._colorIndex=this.getColorIndexByValue(this._color),this._colorName=this.getColorNameByValue(this._color))}get hexColor(){if(this._color&&this._color>0&&this._color<=16777215){let e=this._color.toString(16).toUpperCase();for(;e.length<6;)e="0"+e;return`0x${e}`}return""}get cssColor(){return`rgb(${this.red},${this.green},${this.blue})`}get red(){return this.color?this.color>>16&255:null}get green(){return this.color?this.color>>8&255:null}get blue(){return this.color?this.color&255:null}get colorIndex(){return this._colorIndex}set colorIndex(e){e==null?this._colorIndex=null:(this._colorIndex=ls(e,0,256),this._colorIndex>0&&this._colorIndex<256?(this._color=Gi[e],this._colorName=this.getColorNameByValue(this._color)):(this._color=null,this._colorName=null))}get colorName(){return this._colorName}set colorName(e){if(e){const t=qs[e.toLowerCase()];t!==void 0?(this._colorName=e,this._color=t,this._colorIndex=this.getColorIndexByValue(this._color)):console.warn("Unknown color: "+e)}else this._colorName=null}get hasColorName(){return this._colorName==null}get hasColorIndex(){return this._colorIndex==null}get isByLayer(){return this.colorIndex==256}setByLayer(){return this.colorIndex=256,this}get isByBlock(){return this.colorIndex==0}setByBlock(){return this.colorIndex=0,this}setScalar(e){return this.setRGB(e,e,e),this}setRGB(e,t,s){const o=Math.round(ls(e,0,255)),h=Math.round(ls(t,0,255)),u=Math.round(ls(s,0,255));return this.color=(o<<16)+(h<<8)+u,this}setColorName(e){const t=qs[e.toLowerCase()];return t!==void 0?this.color=t:console.warn("Unknown color "+e),this}clone(){const e=new Wo;return e.colorIndex=this.colorIndex,e.color=this.color,e._colorName=this._colorName,this}copy(e){return this.colorIndex=e.colorIndex,this.color=e.color,this._colorName=e._colorName,this}equals(e){return e.color==this.color&&e.colorIndex==this.colorIndex&&e._colorName==this._colorName}toString(){return this.isByLayer?"ByLayer":this.isByBlock?"ByBlock":this.colorName?this.colorName:this.hexColor}getColorNameByValue(e){for(const[t,s]of Object.entries(qs))if(s===e)return t;return null}getColorIndexByValue(e){const t=Gi.length-1;for(let s=1;s<t;++s)if(Gi[s]===e)return s;return null}};Go.NAMES=qs;let fn=Go;const Ut={get ILLEGAL_PARAMETERS(){return new ReferenceError("Illegal Parameters")},get ZERO_DIVISION(){return new Error("Zero division")},get UNRESOLVED_BOUNDARY_CONFLICT(){return new Error("Unresolved boundary conflict in boolean operation")},get INFINITE_LOOP(){return new Error("Infinite loop")},get CANNOT_INVOKE_ABSTRACT_METHOD(){return new Error("Abstract method cannot be invoked")},get OPERATION_IS_NOT_SUPPORTED(){return new Error("Operation is not supported")},get NOT_IMPLEMENTED(){return new Error("Not implemented yet")}};let Gc=class{constructor(){this._listeners={}}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const s=this._listeners[e];if(s!==void 0){const o=s.indexOf(t);o!==-1&&s.splice(o,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const t=this._listeners[e.type];if(t!==void 0){e.target=this;const s=t.slice(0);for(let o=0,h=s.length;o<h;o++)s[o].call(this,e)}}},it=class{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}removeEventListener(e){this.listeners=this.listeners.filter(t=>t!==e)}replaceEventListener(e){this.removeEventListener(e),this.addEventListener(e)}dispatch(e,...t){for(const s of this.listeners)s.call(null,e,...t)}};var Wc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hc(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ho={exports:{}};(function(i){(function(e,t){i.exports?i.exports=t():e.log=t()})(Wc,function(){var e=function(){},t="undefined",s=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],h={},u=null;function g(D,U){var B=D[U];if(typeof B.bind=="function")return B.bind(D);try{return Function.prototype.bind.call(B,D)}catch{return function(){return Function.prototype.apply.apply(B,[D,arguments])}}}function b(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function f(D){return D==="debug"&&(D="log"),typeof console===t?!1:D==="trace"&&s?b:console[D]!==void 0?g(console,D):console.log!==void 0?g(console,"log"):e}function A(){for(var D=this.getLevel(),U=0;U<o.length;U++){var B=o[U];this[B]=U<D?e:this.methodFactory(B,D,this.name)}if(this.log=this.debug,typeof console===t&&D<this.levels.SILENT)return"No console available for logging"}function x(D){return function(){typeof console!==t&&(A.call(this),this[D].apply(this,arguments))}}function E(D,U,B){return f(D)||x.apply(this,arguments)}function M(D,U){var B=this,ge,be,oe,W="loglevel";typeof D=="string"?W+=":"+D:typeof D=="symbol"&&(W=void 0);function ce(xe){var Le=(o[xe]||"silent").toUpperCase();if(!(typeof window===t||!W)){try{window.localStorage[W]=Le;return}catch{}try{window.document.cookie=encodeURIComponent(W)+"="+Le+";"}catch{}}}function se(){var xe;if(!(typeof window===t||!W)){try{xe=window.localStorage[W]}catch{}if(typeof xe===t)try{var Le=window.document.cookie,dt=encodeURIComponent(W),mt=Le.indexOf(dt+"=");mt!==-1&&(xe=/^([^;]+)/.exec(Le.slice(mt+dt.length+1))[1])}catch{}return B.levels[xe]===void 0&&(xe=void 0),xe}}function Ve(){if(!(typeof window===t||!W)){try{window.localStorage.removeItem(W)}catch{}try{window.document.cookie=encodeURIComponent(W)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function Ye(xe){var Le=xe;if(typeof Le=="string"&&B.levels[Le.toUpperCase()]!==void 0&&(Le=B.levels[Le.toUpperCase()]),typeof Le=="number"&&Le>=0&&Le<=B.levels.SILENT)return Le;throw new TypeError("log.setLevel() called with invalid level: "+xe)}B.name=D,B.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},B.methodFactory=U||E,B.getLevel=function(){return oe??be??ge},B.setLevel=function(xe,Le){return oe=Ye(xe),Le!==!1&&ce(oe),A.call(B)},B.setDefaultLevel=function(xe){be=Ye(xe),se()||B.setLevel(xe,!1)},B.resetLevel=function(){oe=null,Ve(),A.call(B)},B.enableAll=function(xe){B.setLevel(B.levels.TRACE,xe)},B.disableAll=function(xe){B.setLevel(B.levels.SILENT,xe)},B.rebuild=function(){if(u!==B&&(ge=Ye(u.getLevel())),A.call(B),u===B)for(var xe in h)h[xe].rebuild()},ge=Ye(u?u.getLevel():"WARN");var We=se();We!=null&&(oe=Ye(We)),A.call(B)}u=new M,u.getLogger=function(D){if(typeof D!="symbol"&&typeof D!="string"||D==="")throw new TypeError("You must supply a name when creating a logger.");var U=h[D];return U||(U=h[D]=new M(D,u.methodFactory)),U};var z=typeof window!==t?window.log:void 0;return u.noConflict=function(){return typeof window!==t&&window.log===u&&(window.log=z),u},u.getLoggers=function(){return h},u.default=u,u})})(Ho);var qo=Ho.exports;const qc=Hc(qo),Yc=jc({__proto__:null,default:qc},[qo]),Xc=!0,Es=Yc;Es.setLevel("debug");const Kc=i=>{try{Es.setLevel(i)}catch(e){Es.setLevel("error"),Es.error(e)}};function Ss(i){return i===null||typeof i!="object"?i:Array.isArray(i)?[...i]:{...i}}function Bn(i,...e){for(const t of e)if(t)for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&i[s]===void 0&&(i[s]=t[s]);return i}function Yo(i,e){return i!=null&&Object.prototype.hasOwnProperty.call(i,e)}function Xo(i){return i==null?!0:Array.isArray(i)||typeof i=="string"?i.length===0:i instanceof Map||i instanceof Set?i.size===0:typeof i=="object"?Object.keys(i).length===0:!1}function zn(i,e){if(i===e)return!0;if(i==null||e==null)return i===e;if(typeof i!=typeof e)return!1;if(typeof i!="object")return i===e;if(Array.isArray(i)!==Array.isArray(e))return!1;if(Array.isArray(i)){if(i.length!==e.length)return!1;for(let o=0;o<i.length;o++)if(!zn(i[o],e[o]))return!1;return!0}const t=Object.keys(i),s=Object.keys(e);if(t.length!==s.length)return!1;for(const o of t)if(!Object.prototype.hasOwnProperty.call(e,o)||!zn(i[o],e[o]))return!1;return!0}let Ko=class $o{constructor(e,t){this.events={attrChanged:new it,modelChanged:new it},this._changing=!1,this._previousAttributes={},this._pending=!1;const s=e||{};t&&Bn(s,t),this.attributes=s,this.changed={}}get(e){return this.attributes[e]}set(e,t,s){if(e==null)return this;let o;typeof e=="object"?(o=e,s=t):(o={},o[e]=t),s||(s={});const h=s.unset,u=s.silent,g=[],b=this._changing;this._changing=!0,b||(this._previousAttributes=Ss(this.attributes),this.changed={});const f=this.attributes,A=this.changed,x=this._previousAttributes;for(const E in o)t=o[E],zn(f[E],t)||g.push(E),zn(x[E],t)?delete A[E]:A[E]=t,h?delete f[E]:f[E]=t;if(!u){g.length&&(this._pending=s);for(let E=0;E<g.length;E++)this.events.attrChanged.dispatch({object:this,attrName:g[E],attrValue:f[g[E]],options:s})}if(b)return this;if(!u)for(;this._pending;)s=this._pending,this._pending=!1,this.events.modelChanged.dispatch({object:this,options:s});return this._pending=!1,this._changing=!1,this}has(e){return this.get(e)!=null}hasChanged(e){return e==null?!Xo(this.changed):Yo(this.changed,e)}changedAttributes(e){if(!e)return this.hasChanged()?Ss(this.changed):{};const t=this._changing?this._previousAttributes:this.attributes,s={};for(const o in e){const h=e[o];zn(t[o],h)||(s[o]=h)}return s}previous(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]}previousAttributes(){return Ss(this._previousAttributes)}clone(){const e=Ss(this.attributes);return new $o(e)}},ca=class Is{constructor(){this.entries=new Map}static getInstance(){return Is.instance||(Is.instance=new Is),Is.instance}collect(e){this.entries.set(e.name,e)}printAll(){for(const[e,t]of this.entries)console.log(`${e}:`),console.log(t.format())}clear(){this.entries.clear()}getAll(){return Array.from(this.entries.values())}getEntry(e){return this.entries.get(e)}remove(e){return this.entries.delete(e)}};class $c{static formatBytes(e,t=2){if(e===0)return"0 B";const s=1024,o=Math.max(0,t),h=["B","KB","MB","GB","TB"],u=Math.floor(Math.log(e)/Math.log(s)),g=e/Math.pow(s,u);return`${parseFloat(g.toFixed(o))} ${h[u]}`}}class Zo{constructor(e){this.name=e}run(e){throw new Error("run() must be implemented by subclass")}}class Qo{constructor(){this.tasks=[],this.onProgress=()=>{},this.onComplete=()=>{},this.onError=()=>{}}scheduleTask(e){return new Promise((t,s)=>{const o=()=>{Promise.resolve(e()).then(t).catch(s)};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(o):setTimeout(o,0)})}addTask(e){this.tasks.push(e)}setProgressCallback(e){this.onProgress=e}setCompleteCallback(e){this.onComplete=e}setErrorCallback(e){this.onError=e}async run(e){const t=this.tasks.length;let s=e;for(let o=0;o<t;o++){const h=this.tasks[o];try{s=await this.scheduleTask(async()=>{const u=await h.run(s);return this.onProgress((o+1)/t,h),u})}catch(u){this.onError({error:u,taskIndex:o,task:h});return}}this.onComplete(s)}}let Jo=class{constructor(e,t,s){this.isLoading=!1,this.itemsLoaded=0,this.itemsTotal=0,this.urlModifier=void 0,this.handlers=[],this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=s}itemStart(e){this.itemsTotal++,this.isLoading===!1&&this.onStart!==void 0&&this.onStart(e,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(e){this.itemsLoaded++,this.onProgress!==void 0&&this.onProgress(e,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this.onLoad!==void 0&&this.onLoad())}itemError(e){this.onError!==void 0&&this.onError(e)}resolveURL(e){return this.urlModifier?this.urlModifier(e):e}setURLModifier(e){return this.urlModifier=e,this}addHandler(e,t){return this.handlers.push(e,t),this}removeHandler(e){const t=this.handlers.indexOf(e);return t!==-1&&this.handlers.splice(t,2),this}getHandler(e){for(let t=0,s=this.handlers.length;t<s;t+=2){const o=this.handlers[t],h=this.handlers[t+1];if(o.global&&(o.lastIndex=0),o.test(e))return h}return null}};const el=new Jo;let Zc=class{constructor(e){this.manager=e!==void 0?e:el,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}loadAsync(e,t){return new Promise((s,o)=>{this.load(e,s,t,o)})}parse(e){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}};class tl{constructor(e,t,s){this._chunkSize=-1,this._minimumChunkSize=50,this._count=e,this._numerOfChunk=t<1?1:t,this._minimumChunkSize=s,this.calculateChunkSize()}get count(){return this._count}get numerOfChunk(){return this._numerOfChunk}get minimumChunkSize(){return this._minimumChunkSize}set minimumChunkSize(e){this._minimumChunkSize=e,this.calculateChunkSize()}get chunkSize(){return this._chunkSize}calculateChunkSize(){let e=this._count/this._numerOfChunk;e<this._minimumChunkSize&&(e=Math.min(this._minimumChunkSize,this._count)),this._chunkSize=e<1?this._count:Math.floor(e)}scheduleTask(e){return new Promise((t,s)=>{const o=()=>{Promise.resolve(e()).then(t).catch(s)};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(o):setTimeout(o,0)})}async processChunk(e){let t=0;const s=async()=>{const o=t,h=Math.min(t+this._chunkSize,this._count);await e(o,h),t=h,t<this._count&&await this.scheduleTask(s)};await s()}}var ht,hs,Qe,st,cs,Jt,yt,pr,er,Jr,us,ds,en,tn,ms,ps,gs,Ct,gr,qe,rn,fs,_e,bt,_s,xt,vs,fr,_r,tr,ys,nn,Nt,vr,sn,Wi,Hi,yr,br,bs,xs,xr,ws,qi,Yi,ct,wr,ut,Lt,Xi,Ki,$i,Zi,Ar,Ot,an,As,on,zt,Pr,Dt,Sr;(ht={})[ht.None=0]="None",ht[ht.Anonymous=1]="Anonymous",ht[ht.NonConstant=2]="NonConstant",ht[ht.Xref=4]="Xref",ht[ht.XrefOverlay=8]="XrefOverlay",ht[ht.ExternallyDependent=16]="ExternallyDependent",ht[ht.ResolvedOrDependent=32]="ResolvedOrDependent",ht[ht.ReferencedXref=64]="ReferencedXref";(hs={})[hs.BYBLOCK=0]="BYBLOCK",hs[hs.BYLAYER=256]="BYLAYER";(Qe={})[Qe.Rotated=0]="Rotated",Qe[Qe.Aligned=1]="Aligned",Qe[Qe.Angular=2]="Angular",Qe[Qe.Diameter=3]="Diameter",Qe[Qe.Radius=4]="Radius",Qe[Qe.Angular3Point=5]="Angular3Point",Qe[Qe.Ordinate=6]="Ordinate",Qe[Qe.ReferenceIsExclusive=32]="ReferenceIsExclusive",Qe[Qe.IsOrdinateXTypeFlag=64]="IsOrdinateXTypeFlag",Qe[Qe.IsCustomTextPositionFlag=128]="IsCustomTextPositionFlag";(st={})[st.TopLeft=1]="TopLeft",st[st.TopCenter=2]="TopCenter",st[st.TopRight=3]="TopRight",st[st.MiddleLeft=4]="MiddleLeft",st[st.MiddleCenter=5]="MiddleCenter",st[st.MiddleRight=6]="MiddleRight",st[st.BottomLeft=7]="BottomLeft",st[st.BottomCenter=8]="BottomCenter",st[st.BottomRight=9]="BottomRight";(cs={})[cs.AtLeast=1]="AtLeast",cs[cs.Exact=2]="Exact";var Io=((Jt={})[Jt.Center=0]="Center",Jt[Jt.Above=1]="Above",Jt[Jt.Outside=2]="Outside",Jt[Jt.JIS=3]="JIS",Jt[Jt.Below=4]="Below",Jt),Nn=((yt={})[yt.Feet=0]="Feet",yt[yt.None=1]="None",yt[yt.Inch=2]="Inch",yt[yt.FeetAndInch=3]="FeetAndInch",yt[yt.Leading=4]="Leading",yt[yt.Trailing=8]="Trailing",yt[yt.LeadingAndTrailing=12]="LeadingAndTrailing",yt),Qc=((pr={})[pr.None=0]="None",pr[pr.Leading=1]="Leading",pr[pr.Trailing=2]="Trailing",pr[pr.LeadingAndTrailing=3]="LeadingAndTrailing",pr),Jc=((er={})[er.Center=0]="Center",er[er.Left=1]="Left",er[er.Right=2]="Right",er[er.OverFirst=3]="OverFirst",er[er.OverSecond=4]="OverSecond",er),eu=((Jr={})[Jr.Bottom=0]="Bottom",Jr[Jr.Center=1]="Center",Jr[Jr.Top=2]="Top",Jr);(us={})[us.PatternFill=0]="PatternFill",us[us.SolidFill=1]="SolidFill";(ds={})[ds.NonAssociative=0]="NonAssociative",ds[ds.Associative=1]="Associative";(en={})[en.Normal=0]="Normal",en[en.Outer=1]="Outer",en[en.Ignore=2]="Ignore";(tn={})[tn.UserDefined=0]="UserDefined",tn[tn.Predefined=1]="Predefined",tn[tn.Custom=2]="Custom";(ms={})[ms.NotAnnotated=0]="NotAnnotated",ms[ms.Annotated=1]="Annotated";(ps={})[ps.Solid=0]="Solid",ps[ps.Gradient=1]="Gradient";(gs={})[gs.TwoColor=0]="TwoColor",gs[gs.OneColor=1]="OneColor";var tu=((Ct={})[Ct.Default=0]="Default",Ct[Ct.External=1]="External",Ct[Ct.Polyline=2]="Polyline",Ct[Ct.Derived=4]="Derived",Ct[Ct.Textbox=8]="Textbox",Ct[Ct.Outermost=16]="Outermost",Ct),Vs=((gr={})[gr.Line=1]="Line",gr[gr.Circular=2]="Circular",gr[gr.Elliptic=3]="Elliptic",gr[gr.Spline=4]="Spline",gr),ru=((qe={})[qe.Off=0]="Off",qe[qe.Solid=1]="Solid",qe[qe.Dashed=2]="Dashed",qe[qe.Dotted=3]="Dotted",qe[qe.ShotDash=4]="ShotDash",qe[qe.MediumDash=5]="MediumDash",qe[qe.LongDash=6]="LongDash",qe[qe.DoubleShortDash=7]="DoubleShortDash",qe[qe.DoubleMediumDash=8]="DoubleMediumDash",qe[qe.DoubleLongDash=9]="DoubleLongDash",qe[qe.DoubleMediumLongDash=10]="DoubleMediumLongDash",qe[qe.SparseDot=11]="SparseDot",qe);ru.Off;(rn={})[rn.Standard=-3]="Standard",rn[rn.ByLayer=-2]="ByLayer",rn[rn.ByBlock=-1]="ByBlock";(fs={})[fs.English=0]="English",fs[fs.Metric=1]="Metric";(_e={})[_e.PERSPECTIVE_MODE=1]="PERSPECTIVE_MODE",_e[_e.FRONT_CLIPPING=2]="FRONT_CLIPPING",_e[_e.BACK_CLIPPING=4]="BACK_CLIPPING",_e[_e.UCS_FOLLOW=8]="UCS_FOLLOW",_e[_e.FRONT_CLIP_NOT_AT_EYE=16]="FRONT_CLIP_NOT_AT_EYE",_e[_e.UCS_ICON_VISIBILITY=32]="UCS_ICON_VISIBILITY",_e[_e.UCS_ICON_AT_ORIGIN=64]="UCS_ICON_AT_ORIGIN",_e[_e.FAST_ZOOM=128]="FAST_ZOOM",_e[_e.SNAP_MODE=256]="SNAP_MODE",_e[_e.GRID_MODE=512]="GRID_MODE",_e[_e.ISOMETRIC_SNAP_STYLE=1024]="ISOMETRIC_SNAP_STYLE",_e[_e.HIDE_PLOT_MODE=2048]="HIDE_PLOT_MODE",_e[_e.K_ISO_PAIR_TOP=4096]="K_ISO_PAIR_TOP",_e[_e.K_ISO_PAIR_RIGHT=8192]="K_ISO_PAIR_RIGHT",_e[_e.VIEWPORT_ZOOM_LOCKING=16384]="VIEWPORT_ZOOM_LOCKING",_e[_e.UNUSED=32768]="UNUSED",_e[_e.NON_RECTANGULAR_CLIPPING=65536]="NON_RECTANGULAR_CLIPPING",_e[_e.VIEWPORT_OFF=131072]="VIEWPORT_OFF",_e[_e.GRID_BEYOND_DRAWING_LIMITS=262144]="GRID_BEYOND_DRAWING_LIMITS",_e[_e.ADAPTIVE_GRID_DISPLAY=524288]="ADAPTIVE_GRID_DISPLAY",_e[_e.SUBDIVISION_BELOW_SPACING=1048576]="SUBDIVISION_BELOW_SPACING",_e[_e.GRID_FOLLOWS_WORKPLANE=2097152]="GRID_FOLLOWS_WORKPLANE";(bt={})[bt.OPTIMIZED_2D=0]="OPTIMIZED_2D",bt[bt.WIREFRAME=1]="WIREFRAME",bt[bt.HIDDEN_LINE=2]="HIDDEN_LINE",bt[bt.FLAT_SHADED=3]="FLAT_SHADED",bt[bt.GOURAUD_SHADED=4]="GOURAUD_SHADED",bt[bt.FLAT_SHADED_WITH_WIREFRAME=5]="FLAT_SHADED_WITH_WIREFRAME",bt[bt.GOURAUD_SHADED_WITH_WIREFRAME=6]="GOURAUD_SHADED_WITH_WIREFRAME";(_s={})[_s.UCS_UNCHANGED=0]="UCS_UNCHANGED",_s[_s.HAS_OWN_UCS=1]="HAS_OWN_UCS";(xt={})[xt.NON_ORTHOGRAPHIC=0]="NON_ORTHOGRAPHIC",xt[xt.TOP=1]="TOP",xt[xt.BOTTOM=2]="BOTTOM",xt[xt.FRONT=3]="FRONT",xt[xt.BACK=4]="BACK",xt[xt.LEFT=5]="LEFT",xt[xt.RIGHT=6]="RIGHT";(vs={})[vs.ONE_DISTANT_LIGHT=0]="ONE_DISTANT_LIGHT",vs[vs.TWO_DISTANT_LIGHTS=1]="TWO_DISTANT_LIGHTS";(fr={})[fr.ByLayer=0]="ByLayer",fr[fr.ByBlock=1]="ByBlock",fr[fr.ByDictionaryDefault=2]="ByDictionaryDefault",fr[fr.ByObject=3]="ByObject";function Ae(i,e,t){return i.code===e&&(t==null||i.value===t)}function ze(i){let e={};i.rewind();let t=i.next(),s=t.code;if(e.x=t.value,(t=i.next()).code!==s+10)throw Error("Expected code for point value to be 20 but got "+t.code+".");return e.y=t.value,(t=i.next()).code!==s+20?i.rewind():e.z=t.value,e}let ua=Symbol();function ye(i,e){return(t,s,o)=>{let h=function(b,f=!1){return b.reduce((A,x)=>{x.pushContext&&A.push({});let E=A[A.length-1];for(let M of typeof x.code=="number"?[x.code]:x.code){let z=E[M]??(E[M]=[]);x.isMultiple&&z.length&&f&&console.warn(`Snippet ${z[z.length-1].name} for code(${M}) is shadowed by ${x.name}`),z.push(x)}return A},[{}])}(i,s.debug),u=!1,g=h.length-1;for(;!Ae(t,0,"EOF");){let b=function(U,B,ge){return U.find((be,oe)=>{var W;return oe>=ge&&((W=be[B])==null?void 0:W.length)})}(h,t.code,g),f=b==null?void 0:b[t.code],A=f==null?void 0:f[f.length-1];if(!b||!A){s.rewind();break}A.isMultiple||b[t.code].pop();let{name:x,parser:E,isMultiple:M,isReducible:z}=A,D=E==null?void 0:E(t,s,o);if(D===ua){s.rewind();break}if(x){let[U,B]=function(ge,be){let oe=be.split(".");if(!oe.length)throw Error("[parserGenerator::getObjectByPath] Invalid empty path");let W=ge;for(let ce=0;ce<oe.length-1;++ce){let se=Qi(oe[ce]),Ve=Qi(oe[ce+1]);Object.prototype.hasOwnProperty.call(W,se)||(typeof Ve=="number"?W[se]=[]:W[se]={}),W=W[se]}return[W,Qi(oe[oe.length-1])]}(o,x);M&&!z?(Object.prototype.hasOwnProperty.call(U,B)||(U[B]=[]),U[B].push(D)):U[B]=D}A.pushContext&&(g-=1),u=!0,t=s.next()}return e&&Object.setPrototypeOf(o,e),u}}function Qi(i){let e=Number.parseInt(i);return Number.isNaN(e)?i:e}function y({value:i}){return i}function G(i,e){return ze(e)}function Be({value:i}){return!!i}let nu=[{code:1001,name:"xdata",parser:rl}];function rl(i,e){var o;if(!Ae(i,1001))throw Error("XData must starts with code 1001");let t={appName:i.value,value:[]};i=e.next();let s=[t.value];for(;!Ae(i,0,"EOF")&&i.code>=1e3;){let h=s[s.length-1];switch(i.code){case 1002:i.value==="{"?s.push([]):(s.pop(),(o=s[s.length-1])==null||o.push(h));break;case 1e3:case 1004:case 1040:case 1070:case 1071:h.push({type:Ir(i.code),value:i.value});break;case 1003:h.push({name:"layer",type:Ir(i.code),value:i.value});break;case 1005:h.push({name:"handle",type:Ir(i.code),value:i.value});break;case 1010:h.push({type:Ir(i.code),value:ze(e)});break;case 1011:h.push({name:"worldSpacePosition",type:Ir(i.code),value:ze(e)});break;case 1012:h.push({name:"worldSpaceDisplacement",type:Ir(i.code),value:ze(e)});break;case 1013:h.push({name:"worldSpaceDirection",type:Ir(i.code),value:ze(e)});break;case 1041:h.push({name:"distance",type:Ir(i.code),value:i.value});break;case 1042:h.push({name:"scale",type:Ir(i.code),value:i.value})}i=e.next()}return e.rewind(),t}function Ir(i){switch(i){case 1e3:case 1003:case 1005:return"string";case 1004:return"hex";case 1040:case 1041:case 1042:return"real";case 1070:return"integer";case 1071:return"long";case 1010:case 1011:case 1012:case 1013:return"point";default:return""}}function dn(i,e,t){for(;Ae(i,102);){var s;let o=i.value;if(i=e.next(),!o.startsWith("{")){e.debug&&console.warn(`Invalid application group, expected to start with "{" but received: ${o}`),function(u,g){for(;!Ae(u,102)&&!Ae(u,0,"EOF");)u=g.next()}(i,e),i=e.next();continue}let h=o.slice(1).trim();t.extensions??(t.extensions={}),(s=t.extensions)[h]??(s[h]=[]),function(u,g,b){for(;!Ae(u,102,"}")&&!Ae(u,0,"EOF");)b.push(u),u=g.next()}(i,e,t.extensions[h]),i=e.next()}e.rewind()}let su=0;function nl(i){if(!i)throw TypeError("entity cannot be undefined or null");i.handle||(i.handle=su++)}var iu=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215];function sl(i){return iu[i]}(_r={})[_r.CAST_AND_RECEIVE=0]="CAST_AND_RECEIVE",_r[_r.CAST=1]="CAST",_r[_r.RECEIVE=2]="RECEIVE",_r[_r.IGNORE=3]="IGNORE";let Ue=[...nu,{code:284,name:"shadowMode",parser:y},{code:390,name:"plotStyleHardId",parser:y},{code:380,name:"plotStyleType",parser:y},{code:440,name:"transparency",parser:y},{code:430,name:"colorName",parser:y},{code:420,name:"color",parser:y},{code:310,name:"proxyEntity",isMultiple:!0,parser:y},{code:92,name:"proxyByte",parser:y},{code:60,name:"isVisible",parser:Be},{code:48,name:"lineTypeScale",parser:y},{code:370,name:"lineweight",parser:y},{code:62,name:"colorIndex",parser(i,e,t){let s=i.value;return s>0&&s<256&&(t.color=sl(Math.abs(s))),s}},{code:347,name:"materialObjectHardId",parser:y},{code:6,name:"lineType",parser:y},{code:8,name:"layer",parser:y},{code:410,name:"layoutTabName",parser:y},{code:67,name:"isInPaperSpace",parser:Be},{code:100},{code:160},{code:330,name:"ownerBlockRecordSoftId",parser:y},{code:102,parser:dn},{code:102,parser:dn},{code:102,parser:dn},{code:5,name:"handle",parser:y}];function Ii(i){return[{code:3,name:i,parser:(e,t,s)=>(s._code3text=(s._code3text??"")+e.value,s._code3text+(s._code1text??"")),isMultiple:!0,isReducible:!0},{code:1,name:i,parser:(e,t,s)=>(s._code1text=e.value,(s._code3text??"")+s._code1text)}]}function il(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let au={extrusionDirection:{x:0,y:0,z:1}},ou=[{code:210,name:"extrusionDirection",parser:G},{code:51,name:"endAngle",parser:y},{code:50,name:"startAngle",parser:y},{code:100,name:"subclassMarker",parser:y},{code:40,name:"radius",parser:y},{code:10,name:"center",parser:G},{code:39,name:"thickness",parser:y},{code:100},...Ue];class al{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){il(this,"parser",ye(ou,au))}}il(al,"ForEntityName","ARC");(tr={})[tr.NONE=0]="NONE",tr[tr.INVISIBLE=1]="INVISIBLE",tr[tr.CONSTANT=2]="CONSTANT",tr[tr.VERIFICATION_REQUIRED=4]="VERIFICATION_REQUIRED",tr[tr.PRESET=8]="PRESET";(ys={})[ys.MULTILINE=2]="MULTILINE",ys[ys.CONSTANT_MULTILINE=4]="CONSTANT_MULTILINE";(nn={})[nn.NONE=0]="NONE",nn[nn.MIRRORED_X=2]="MIRRORED_X",nn[nn.MIRRORED_Y=4]="MIRRORED_Y";var lu=((Nt={})[Nt.LEFT=0]="LEFT",Nt[Nt.CENTER=1]="CENTER",Nt[Nt.RIGHT=2]="RIGHT",Nt[Nt.ALIGNED=3]="ALIGNED",Nt[Nt.MIDDLE=4]="MIDDLE",Nt[Nt.FIT=5]="FIT",Nt),hu=((vr={})[vr.BASELINE=0]="BASELINE",vr[vr.BOTTOM=1]="BOTTOM",vr[vr.MIDDLE=2]="MIDDLE",vr[vr.TOP=3]="TOP",vr);function ol(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let ll={thickness:0,rotation:0,xScale:1,obliqueAngle:0,styleName:"STANDARD",generationFlag:0,halign:lu.LEFT,valign:hu.BASELINE,extrusionDirection:{x:0,y:0,z:1}},hl=[{code:73,name:"valign",parser:y},{code:100},{code:210,name:"extrusionDirection",parser:G},{code:11,name:"endPoint",parser:G},{code:72,name:"valign",parser:y},{code:72,name:"halign",parser:y},{code:71,name:"generationFlag",parser:y},{code:7,name:"styleName",parser:y},{code:51,name:"obliqueAngle",parser:y},{code:41,name:"xScale",parser:y},{code:50,name:"rotation",parser:y},{code:1,name:"text",parser:y},{code:40,name:"textHeight",parser:y},{code:10,name:"startPoint",parser:G},{code:39,name:"thickness",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class cl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){ol(this,"parser",ye(hl,ll))}}function ul(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}ol(cl,"ForEntityName","TEXT");let cu={...ll},uu=[{code:2},{code:40,name:"annotationScale",parser:y},{code:10,name:"alignmentPoint",parser:G},{code:340,name:"secondaryAttributesHardIds",isMultiple:!0,parser:y},{code:70,name:"numberOfSecondaryAttributes",parser:y},{code:70,name:"isReallyLocked",parser:Be},{code:70,name:"mtextFlag",parser:y},{code:280,name:"isDuplicatedRecord",parser:Be},{code:100},{code:280,name:"isLocked",parser:Be},{code:74,name:"valign",parser:y},{code:73},{code:70,name:"attributeFlag",parser:y},{code:2,name:"tag",parser:y},{code:3,name:"prompt",parser:y},{code:280},{code:100,name:"subclassMarker",parser:y},...hl.slice(2)];class dl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){ul(this,"parser",ye(uu,cu))}}ul(dl,"ForEntityName","ATTDEF");(sn={})[sn.LEFT_TO_RIGHT=1]="LEFT_TO_RIGHT",sn[sn.TOP_TO_BOTTOM=3]="TOP_TO_BOTTOM",sn[sn.BY_STYLE=5]="BY_STYLE";function du(i,e){let t={};for(let s of i){let o=e(s);o!=null&&(t[o]??(t[o]=[]),t[o].push(s))}return t}function*Js(i,e=1/0,t=1){for(let s=i;s!==e;s+=t)yield s}function Vr(i){return{x:i.x??0,y:i.y??0,z:i.z??0}}function da(i,e,t){if(Ae(e,102))return dn(e,t,i),!0;switch(e.code){case 0:i.type=e.value;break;case 5:i.handle=e.value;break;case 330:i.ownerBlockRecordSoftId=e.value;break;case 67:i.isInPaperSpace=!!e.value;break;case 8:i.layer=e.value;break;case 6:i.lineType=e.value;break;case 347:i.materialObjectHardId=e.value;break;case 62:i.colorIndex=e.value,i.color=sl(Math.abs(e.value));break;case 370:i.lineweight=e.value;break;case 48:i.lineTypeScale=e.value;break;case 60:i.isVisible=!!e.value;break;case 92:i.proxyByte=e.value;break;case 310:i.proxyEntity=e.value;break;case 100:break;case 420:i.color=e.value;break;case 430:i.transparency=e.value;break;case 390:i.plotStyleHardId=e.value;break;case 284:i.shadowMode=e.value;break;case 1001:i.xdata=rl(e,t);break;default:return!1}return!0}function ml(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let mu={textStyle:"STANDARD",extrusionDirection:{x:0,y:0,z:1},rotation:0},Ys=[{code:46,name:"annotationHeight",parser:y},{code:101,parser(i,e){(function(t){t.rewind();let s=t.next();if(s.code!==101)throw Error("Bad call for skipEmbeddedObject()");do s=t.next();while(s.code!==0);t.rewind()})(e)}},{code:50,name:"columnHeight",parser:y},{code:49,name:"columnGutter",parser:y},{code:48,name:"columnWidth",parser:y},{code:79,name:"columnAutoHeight",parser:y},{code:78,name:"columnFlowReversed",parser:y},{code:76,name:"columnCount",parser:y},{code:75,name:"columnType",parser:y},{code:441,name:"backgroundFillTransparency",parser:y},{code:63,name:"backgroundFillColor",parser:y},{code:45,name:"fillBoxScale",parser:y},{code:[...Js(430,440)],name:"backgroundColor",parser:y},{code:[...Js(420,430)],name:"backgroundColor",parser:y},{code:90,name:"backgroundFill",parser:y},{code:44,name:"lineSpacing",parser:y},{code:73,name:"lineSpacingStyle",parser:y},{code:50,name:"rotation",parser:y},{code:43},{code:42},{code:11,name:"direction",parser:G},{code:210,name:"extrusionDirection",parser:G},{code:7,name:"styleName",parser:y},...Ii("text"),{code:72,name:"drawingDirection",parser:y},{code:71,name:"attachmentPoint",parser:y},{code:41,name:"width",parser:y},{code:40,name:"height",parser:y},{code:10,name:"insertionPoint",parser:G},{code:100,name:"subclassMarker",parser:y},...Ue];class pl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){ml(this,"parser",ye(Ys,mu))}}function gl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}ml(pl,"ForEntityName","MTEXT");let pu={thickness:0,rotation:0,scale:1,obliqueAngle:0,textStyle:"STANDARD",textGenerationFlag:0,horizontalJustification:0,verticalJustification:0,extrusionDirection:{x:0,y:0,z:1}},gu=[...Ys.slice(Ys.findIndex(({name:i})=>i==="columnType"),Ys.findIndex(({name:i})=>i==="subclassMarker")+1),{code:100},{code:0,parser(i){if(!Ae(i,0,"MTEXT"))return ua}},{code:2,name:"definitionTag",parser:y},{code:40,name:"annotationScale",parser:y},{code:10,name:"alignmentPoint",parser:G},{code:340,name:"secondaryAttributesHardId",parser:y},{code:70,name:"numberOfSecondaryAttributes",parser:y},{code:70,name:"isReallyLocked",parser:Be},{code:70,name:"mtextFlag",parser:y},{code:280,name:"isDuplicatedEntriesKeep",parser:Be},{code:100},{code:280,name:"lockPositionFlag",parser:Be},{code:210,name:"extrusionDirection",parser:G},{code:11,name:"alignmentPoint",parser:G},{code:74,name:"verticalJustification",parser:y},{code:72,name:"horizontalJustification",parser:y},{code:71,name:"textGenerationFlag",parser:y},{code:7,name:"textStyle",parser:y},{code:51,name:"obliqueAngle",parser:y},{code:41,name:"scale",parser:y},{code:50,name:"rotation",parser:y},{code:73},{code:70,name:"attributeFlag",parser:y},{code:2,name:"tag",parser:y},{code:280},{code:100,name:"subclassMarker",parser:y},{code:1,name:"text",parser:y},{code:40,name:"textHeight",parser:y},{code:10,name:"startPoint",parser:G},{code:39,name:"thickness",parser:y},{code:100},...Ue];class fl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){gl(this,"parser",ye(gu,pu))}}function _l(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}gl(fl,"ForEntityName","ATTRIB");let fu=[...Ii("data"),{code:70,name:"version",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class vl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){_l(this,"parser",ye(fu))}}function yl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}_l(vl,"ForEntityName","BODY");let _u={thickness:0,extrusionDirection:{x:0,y:0,z:1}},vu=[{code:210,name:"extrusionDirection",parser:G},{code:40,name:"radius",parser:y},{code:10,name:"center",parser:G},{code:39,name:"thickness",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class bl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){yl(this,"parser",ye(vu,_u))}}yl(bl,"ForEntityName","CIRCLE");class Xs{parseEntity(e,t){let s={};for(;!Ae(t,0,"EOF");){if(t.code===0){e.rewind();break}(function(o,h,u){switch(h.code){case 100:o.subclassMarker=h.value;break;case 280:o.version=h.value;break;case 2:o.name=h.value;break;case 10:o.definitionPoint=ze(u);break;case 11:o.textPoint=ze(u);break;case 12:o.insertionPoint=ze(u);break;case 13:o.subDefinitionPoint1=ze(u);break;case 14:o.subDefinitionPoint2=ze(u);break;case 15:o.centerPoint=ze(u);break;case 16:o.arcPoint=ze(u);break;case 70:o.dimensionType=h.value;break;case 71:o.attachmentPoint=h.value;break;case 72:o.textLineSpacingStyle=h.value;break;case 40:o.leaderLength=h.value;break;case 41:o.textLineSpacingFactor=h.value;break;case 42:o.measurement=h.value;break;case 1:o.text=h.value;break;case 50:o.rotationAngle=h.value;break;case 52:o.obliqueAngle=h.value;break;case 53:o.textRotation=h.value;break;case 51:o.ocsRotation=h.value;break;case 210:o.extrusionDirection=ze(u);break;case 3:o.styleName=h.value;break;default:da(o,h,u)}})(s,t,e),t=e.next()}return s}}function xl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Hi="DIMENSION",(Wi="ForEntityName")in Xs?Object.defineProperty(Xs,Wi,{value:Hi,enumerable:!0,configurable:!0,writable:!0}):Xs[Wi]=Hi;let yu={extrusionDirection:{x:0,y:0,z:1}},bu=[{code:42,name:"endAngle",parser:y},{code:41,name:"startAngle",parser:y},{code:40,name:"axisRatio",parser:y},{code:210,name:"extrusionDirection",parser:G},{code:11,name:"majorAxisEndPoint",parser:G},{code:10,name:"center",parser:G},{code:100,name:"subclassMarker",parser:y},...Ue];class wl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){xl(this,"parser",ye(bu,yu))}}xl(wl,"ForEntityName","ELLIPSE");(yr={})[yr.First=1]="First",yr[yr.Second=2]="Second",yr[yr.Third=4]="Third",yr[yr.Fourth=8]="Fourth";function Al(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let xu=[{code:13,name:"vertices.3",parser:G},{code:12,name:"vertices.2",parser:G},{code:11,name:"vertices.1",parser:G},{code:10,name:"vertices.0",parser:G},{code:100,name:"subclassMarker",parser:y},...Ue];class Pl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Al(this,"parser",ye(xu))}}Al(Pl,"ForEntityName","3DFACE");let Sl=[{code:330,name:"sourceBoundaryObjects",parser:y,isMultiple:!0},{code:97,name:"numberOfSourceBoundaryObjects",parser:y}],wu=[{code:11,name:"end",parser:G},{code:10,name:"start",parser:G}],Au=[{code:73,name:"isCCW",parser:Be},{code:51,name:"endAngle",parser:y},{code:50,name:"startAngle",parser:y},{code:40,name:"radius",parser:y},{code:10,name:"center",parser:G}],Pu=[{code:73,name:"isCCW",parser:Be},{code:51,name:"endAngle",parser:y},{code:50,name:"startAngle",parser:y},{code:40,name:"lengthOfMinorAxis",parser:y},{code:11,name:"end",parser:G},{code:10,name:"center",parser:G}],Su=[{code:13,name:"endTangent",parser:G},{code:12,name:"startTangent",parser:G},{code:11,name:"fitDatum",isMultiple:!0,parser:G},{code:97,name:"numberOfFitData",parser:y},{code:10,name:"controlPoints",isMultiple:!0,parser(i,e){let t={...ze(e),weight:1};return(i=e.next()).code===42?t.weight=i.value:e.rewind(),t}},{code:40,name:"knots",isMultiple:!0,parser:y},{code:96,name:"numberOfControlPoints",parser:y},{code:95,name:"numberOfKnots",parser:y},{code:74,name:"isPeriodic",parser:Be},{code:73,name:"splineFlag",parser:y},{code:94,name:"degree",parser:y}],Iu={[Vs.Line]:wu,[Vs.Circular]:Au,[Vs.Elliptic]:Pu,[Vs.Spline]:Su},Eu=[...Sl,{code:72,name:"edges",parser(i,e){let t={type:i.value},s=ye(Iu[t.type]);if(!s)throw Error(`Invalid edge type ${t.type}`);return s(i=e.next(),e,t),t},isMultiple:!0},{code:93,name:"numberOfEdges",parser:y}],ku=[...Sl,{code:10,name:"vertices",parser(i,e){let t={...ze(e),bulge:0};return(i=e.next()).code===42?t.bulge=i.value:e.rewind(),t},isMultiple:!0},{code:93,name:"numberOfVertices",parser:y},{code:73,name:"isClosed",parser:Be},{code:72,name:"hasBulge",parser:Be}],Mu=[{code:49,name:"dashLengths",parser:y,isMultiple:!0},{code:79,name:"numberOfDashLengths",parser:y},{code:45,name:"offset",parser:Eo},{code:43,name:"base",parser:Eo},{code:53,name:"angle",parser:y}];function Eo(i,e){let t=i.code+1,s={x:i.value,y:1};return(i=e.next()).code===t?s.y=i.value:e.rewind(),s}function Il(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let Tu={extrusionDirection:{x:0,y:0,z:1},gradientRotation:0,colorTint:0},Cu=[{code:470},{code:463},{code:462,name:"colorTint",parser:y},{code:461,name:"gradientDefinition",parser:y},{code:460,name:"gradientRotation",parser:y},{code:453,name:"numberOfColors",parser:y},{code:452,name:"gradientColorFlag",parser:y},{code:451},{code:450,name:"gradientFlag",parser:y},{code:10,name:"seedPoints",parser:G,isMultiple:!0},{code:99},{code:11,name:"offsetVector",parser:G},{code:98,name:"numberOfSeedPoints",parser:y},{code:47,name:"pixelSize",parser:y},{code:53,name:"definitionLines",parser:function(i,e){let t={};return ye(Mu)(i,e,t),t},isMultiple:!0},{code:78,name:"numberOfDefinitionLines",parser:y},{code:77,name:"isDouble",parser:Be},{code:73,name:"isAnnotated",parser:Be},{code:41,name:"patternScale",parser:y},{code:52,name:"patternAngle",parser:y},{code:76,name:"patternType",parser:y},{code:75,name:"hatchStyle",parser:y},{code:92,name:"boundaryPaths",parser:function(i,e){let t={boundaryPathTypeFlag:i.value},s=t.boundaryPathTypeFlag&tu.Polyline;return i=e.next(),s?ye(ku)(i,e,t):ye(Eu)(i,e,t),t},isMultiple:!0},{code:91,name:"numberOfBoundaryPaths",parser:y},{code:71,name:"associativity",parser:y},{code:63,name:"patternFillColor",parser:y},{code:70,name:"solidFill",parser:y},{code:2,name:"patternName",parser:y},{code:210,name:"extrusionDirection",parser:G},{code:10,name:"elevationPoint",parser:G},{code:100,name:"subclassMarker",parser:y,pushContext:!0},...Ue];class El{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Il(this,"parser",ye(Cu,Tu))}}Il(El,"ForEntityName","HATCH");(br={})[br.ShowImage=1]="ShowImage",br[br.ShowImageWhenNotAlignedWithScreen=2]="ShowImageWhenNotAlignedWithScreen",br[br.UseClippingBoundary=4]="UseClippingBoundary",br[br.TransparencyIsOn=8]="TransparencyIsOn";(bs={})[bs.Rectangular=1]="Rectangular",bs[bs.Polygonal=2]="Polygonal";(xs={})[xs.Outside=0]="Outside",xs[xs.Inside=1]="Inside";function kl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let Nu={brightness:50,contrast:50,fade:0,clippingBoundaryPath:[]},Lu=[{code:290,name:"clipMode",parser:y},{code:14,name:"clippingBoundaryPath",isMultiple:!0,parser:G},{code:91,name:"countBoundaryPoints",parser:y},{code:71,name:"clippingBoundaryType",parser:y},{code:360,name:"imageDefReactorHandle",parser:y},{code:283,name:"fade",parser:y},{code:282,name:"contrast",parser:y},{code:281,name:"brightness",parser:y},{code:280,name:"isClipped",parser:Be},{code:70,name:"flags",parser:y},{code:340,name:"imageDefHandle",parser:y},{code:13,name:"imageSize",parser:G},{code:12,name:"vPixel",parser:G},{code:11,name:"uPixel",parser:G},{code:10,name:"position",parser:G},{code:90,name:"version",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class Ml{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){kl(this,"parser",ye(Lu,Nu))}}function Tl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}kl(Ml,"ForEntityName","IMAGE");let Ou={xScale:1,yScale:1,zScale:1,rotation:0,columnCount:0,rowCount:0,columnSpacing:0,rowSpacing:0,extrusionDirection:{x:0,y:0,z:1}},zu=[{code:210,name:"extrusionDirection",parser:G},{code:45,name:"rowSpacing",parser:y},{code:44,name:"columnSpacing",parser:y},{code:71,name:"rowCount",parser:y},{code:70,name:"columnCount",parser:y},{code:50,name:"rotation",parser:y},{code:43,name:"zScale",parser:y},{code:42,name:"yScale",parser:y},{code:41,name:"xScale",parser:y},{code:10,name:"insertionPoint",parser:G},{code:2,name:"name",parser:y},{code:66,name:"isVariableAttributes",parser:Be},{code:100,name:"subclassMarker",parser:y},...Ue];class Cl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Tl(this,"parser",ye(zu,Ou))}}function Nl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Tl(Cl,"ForEntityName","INSERT");let Du={isArrowheadEnabled:!0},Ru=[{code:213,name:"offsetFromAnnotation",parser:G},{code:212,name:"offsetFromBlock",parser:G},{code:211,name:"horizontalDirection",parser:G},{code:210,name:"normal",parser:G},{code:340,name:"associatedAnnotation",parser:y},{code:77,name:"byBlockColor",parser:y},{code:10,name:"vertices",parser:G,isMultiple:!0},{code:76,name:"numberOfVertices",parser:y},{code:41,name:"textWidth",parser:y},{code:40,name:"textHeight",parser:y},{code:75,name:"isHooklineExists",parser:Be},{code:74,name:"isHooklineSameDirection",parser:Be},{code:73,name:"leaderCreationFlag",parser:y},{code:72,name:"isSpline",parser:Be},{code:71,name:"isArrowheadEnabled",parser:Be},{code:3,name:"styleName",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue],Ll=class{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Nl(this,"parser",ye(Ru,Du))}};Nl(Ll,"ForEntityName","LEADER");(xr={})[xr.TextAnnotation=0]="TextAnnotation",xr[xr.ToleranceAnnotation=1]="ToleranceAnnotation",xr[xr.BlockReferenceAnnotation=2]="BlockReferenceAnnotation",xr[xr.NoAnnotation=3]="NoAnnotation";function Ol(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let Bu={thickness:0,extrusionDirection:{x:0,y:0,z:1}},Fu=[{code:210,name:"extrusionDirection",parser:G},{code:11,name:"endPoint",parser:G},{code:10,name:"startPoint",parser:G},{code:39,name:"thickness",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class zl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Ol(this,"parser",ye(Fu,Bu))}}Ol(zl,"ForEntityName","LINE");(ws={})[ws.IS_CLOSED=1]="IS_CLOSED",ws[ws.PLINE_GEN=128]="PLINE_GEN";let Uu={flag:0,elevation:0,thickness:0,extrusionDirection:{x:0,y:0,z:1},vertices:[]},Vu={bulge:0},ju=[{code:42,name:"bulge",parser:y},{code:41,name:"endWidth",parser:y},{code:40,name:"startWidth",parser:y},{code:91,name:"id",parser:y},{code:20,name:"y",parser:y},{code:10,name:"x",parser:y}],Gu=[{code:210,name:"extrusionDirection",parser:G},{code:10,name:"vertices",isMultiple:!0,parser(i,e){let t={};return ye(ju,Vu)(i,e,t),t}},{code:39,name:"thickness",parser:y},{code:38,name:"elevation",parser:y},{code:43,name:"constantWidth",parser:y},{code:70,name:"flag",parser:y},{code:90,name:"numberOfVertices",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class Ks{parseEntity(e,t){let s={};return ye(Gu,Uu)(t,e,s),s}}function Dl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Yi="LWPOLYLINE",(qi="ForEntityName")in Ks?Object.defineProperty(Ks,qi,{value:Yi,enumerable:!0,configurable:!0,writable:!0}):Ks[qi]=Yi;let Wu=[{code:90,name:"overridenSubEntityCount",parser:y},{code:140,name:"edgeCreaseWeights",parser:y,isMultiple:!0},{code:95,name:"edgeCreaseCount",parser:y},{code:94,parser(i,e,t){t.edgeCount=i.value,t.edgeIndices=[];for(let s=0;s<t.edgeCount;++s){let o=[];i=e.next(),o[0]=i.value,i=e.next(),o[1]=i.value,t.edgeIndices.push(o)}}},{code:93,parser(i,e,t){t.totalFaceIndices=i.value,t.faceIndices=[];let s=[];for(let h=0;h<t.totalFaceIndices&&!Ae(i,0);++h)i=e.next(),s.push(i.value);let o=0;for(;o<s.length;){let h=s[o++],u=[];for(let g=0;g<h;++g)u.push(s[o++]);t.faceIndices.push(u)}}},{code:10,name:"vertices",parser:G,isMultiple:!0},{code:92,name:"verticesCount",parser:y},{code:91,name:"subdivisionLevel",parser:y},{code:40,name:"blendCrease",parser:y},{code:72,name:"isBlendCreased",parser:Be},{code:71,name:"version",parser:y},{code:100,name:"subclassMarker",parser:function({value:i}){return i.trim()},pushContext:!0},...Ue];class Rl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Dl(this,"parser",ye(Wu))}}function Bl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Dl(Rl,"ForEntityName","MESH");let Hu={thickness:0,extrusionDirection:{x:0,y:0,z:1},angle:0},qu=[{code:50,name:"angle",parser:y},{code:210,name:"extrusionDirection",parser:G},{code:39,name:"thickness",parser:y},{code:10,name:"position",parser:G},{code:100,name:"subclassMarker",parser:y},...Ue];class Fl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Bl(this,"parser",ye(qu,Hu))}}Bl(Fl,"ForEntityName","POINT");(ct={})[ct.CLOSED_POLYLINE=1]="CLOSED_POLYLINE",ct[ct.CURVE_FIT=2]="CURVE_FIT",ct[ct.SPLINE_FIT=4]="SPLINE_FIT",ct[ct.POLYLINE_3D=8]="POLYLINE_3D",ct[ct.POLYGON_3D=16]="POLYGON_3D",ct[ct.CLOSED_POLYGON=32]="CLOSED_POLYGON",ct[ct.POLYFACE=64]="POLYFACE",ct[ct.CONTINUOUS=128]="CONTINUOUS";(wr={})[wr.NONE=0]="NONE",wr[wr.QUADRATIC=5]="QUADRATIC",wr[wr.CUBIC=6]="CUBIC",wr[wr.BEZIER=8]="BEZIER";(ut={})[ut.CREATED_BY_CURVE_FIT=1]="CREATED_BY_CURVE_FIT",ut[ut.TANGENT_DEFINED=2]="TANGENT_DEFINED",ut[ut.NOT_USED=4]="NOT_USED",ut[ut.CREATED_BY_SPLINE_FIT=8]="CREATED_BY_SPLINE_FIT",ut[ut.SPLINE_CONTROL_POINT=16]="SPLINE_CONTROL_POINT",ut[ut.FOR_POLYLINE=32]="FOR_POLYLINE",ut[ut.FOR_POLYGON=64]="FOR_POLYGON",ut[ut.POLYFACE=128]="POLYFACE";function Ul(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let Yu={startWidth:0,endWidth:0,bulge:0},Xu=[{code:91,name:"id",parser:y},{code:[...Js(71,75)],name:"faces",isMultiple:!0,parser:y},{code:50,name:"tangentDirection",parser:y},{code:70,name:"flag",parser:y},{code:42,name:"bulge",parser:y},{code:41,name:"endWidth",parser:y},{code:40,name:"startWidth",parser:y},{code:30,name:"z",parser:y},{code:20,name:"y",parser:y},{code:10,name:"x",parser:y},{code:100,name:"subclassMarker",parser:y},{code:100},...Ue];class ma{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Ul(this,"parser",ye(Xu,Yu))}}function Vl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Ul(ma,"ForEntityName","VERTEX");let Ku={thickness:0,flag:0,startWidth:0,endWidth:0,meshMVertexCount:0,meshNVertexCount:0,surfaceMDensity:0,surfaceNDensity:0,smoothType:0,extrusionDirection:{x:0,y:0,z:1},vertices:[]},$u=[{code:0,name:"vertices",isMultiple:!0,parser:(i,e)=>Ae(i,0,"VERTEX")?(i=e.next(),new ma().parseEntity(e,i)):ua},{code:210,name:"extrusionDirection",parser:G},{code:75,name:"smoothType",parser:y},{code:74,name:"surfaceNDensity",parser:y},{code:73,name:"surfaceMDensity",parser:y},{code:72,name:"meshNVertexCount",parser:y},{code:71,name:"meshMVertexCount",parser:y},{code:41,name:"endWidth",parser:y},{code:40,name:"startWidth",parser:y},{code:70,name:"flag",parser:y},{code:39,name:"thickness",parser:y},{code:30,name:"elevation",parser:y},{code:20},{code:10},{code:66},{code:100,name:"subclassMarker",parser:y},...Ue];class jl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Vl(this,"parser",ye($u,Ku))}}function Gl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Vl(jl,"ForEntityName","POLYLINE");let Zu=[{code:11,name:"direction",parser:G},{code:10,name:"position",parser:G},{code:100,name:"subclassMarker",parser:y},...Ue];class Wl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Gl(this,"parser",ye(Zu))}}function Hl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Gl(Wl,"ForEntityName","RAY");let Qu=[...Ii("data"),{code:70,name:"version",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class ql{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Hl(this,"parser",ye(Qu))}}function Yl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Hl(ql,"ForEntityName","REGION");let Ju={vertices:[],backLineVertices:[]},ed=[{code:360,name:"geometrySettingHardId",parser:y},{code:12,name:"backLineVertices",isMultiple:!0,parser:G},{code:93,name:"numberOfBackLineVertices",parser:y},{code:11,name:"vertices",isMultiple:!0,parser:G},{code:92,name:"verticesCount",parser:y},{code:[63,411],name:"indicatorColor",parser:y},{code:70,name:"indicatorTransparency",parser:y},{code:41,name:"bottomHeight",parser:y},{code:40,name:"topHeight",parser:y},{code:10,name:"verticalDirection",parser:G},{code:1,name:"name",parser:y},{code:91,name:"flag",parser:y},{code:90,name:"state",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class Xl{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Yl(this,"parser",ye(ed,Ju))}}function Kl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Yl(Xl,"ForEntityName","SECTION");let td={points:[],thickness:0,extrusionDirection:{x:0,y:0,z:1}},rd=[{code:210,name:"extrusionDirection",parser:G},{code:39,name:"thickness",parser:y},{code:[...Js(10,14)],name:"points",isMultiple:!0,parser:G},{code:100,name:"subclassMarker",parser:y},...Ue];class $l{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Kl(this,"parser",ye(rd,td))}}function Zl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Kl($l,"ForEntityName","SOLID");let nd=[{code:350,name:"historyObjectSoftId",parser:y},{code:100,name:"subclassMarker",parser:y},...Ii("data"),{code:70,name:"version",parser:y},{code:100},...Ue];class Ql{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Zl(this,"parser",ye(nd))}}Zl(Ql,"ForEntityName","3DSOLID");(Lt={})[Lt.NONE=0]="NONE",Lt[Lt.CLOSED=1]="CLOSED",Lt[Lt.PERIODIC=2]="PERIODIC",Lt[Lt.RATIONAL=4]="RATIONAL",Lt[Lt.PLANAR=8]="PLANAR",Lt[Lt.LINEAR=16]="LINEAR";function Jl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let sd={knotTolerance:1e-6,controlTolerance:1e-6,fitTolerance:1e-9,knotValues:[],controlPoints:[],fitPoints:[]},id=[{code:11,name:"fitPoints",isMultiple:!0,parser:G},{code:10,name:"controlPoints",isMultiple:!0,parser:G},{code:41,name:"weights",isMultiple:!0,parser:y},{code:40,name:"knots",isMultiple:!0,parser:y},{code:13,name:"endTangent",parser:G},{code:12,name:"startTangent",parser:G},{code:44,name:"fitTolerance",parser:y},{code:43,name:"controlTolerance",parser:y},{code:42,name:"knotTolerance",parser:y},{code:74,name:"numberOfFitPoints",parser:y},{code:73,name:"numberOfControlPoints",parser:y},{code:72,name:"numberOfKnots",parser:y},{code:71,name:"degree",parser:y},{code:70,name:"flag",parser:y},{code:210,name:"normal",parser:G},{code:100,name:"subclassMarker",parser:y},...Ue];class eh{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){Jl(this,"parser",ye(id,sd))}}Jl(eh,"ForEntityName","SPLINE");class $s{parseEntity(e,t){let s={};for(;!e.isEOF();){if(t.code===0){e.rewind();break}switch(t.code){case 100:s.subclassMarker=t.value,t=e.next();break;case 2:s.name=t.value,t=e.next();break;case 5:s.handle=t.value,t=e.next();break;case 10:s.startPoint=Vr(ze(e)),t=e.lastReadGroup;break;case 11:s.directionVector=Vr(ze(e)),t=e.lastReadGroup;break;case 90:s.tableValue=t.value,t=e.next();break;case 91:s.rowCount=t.value,t=e.next();break;case 92:s.columnCount=t.value,t=e.next();break;case 93:s.overrideFlag=t.value,t=e.next();break;case 94:s.borderColorOverrideFlag=t.value,t=e.next();break;case 95:s.borderLineWeightOverrideFlag=t.value,t=e.next();break;case 96:s.borderVisibilityOverrideFlag=t.value,t=e.next();break;case 141:s.rowHeightArr??(s.rowHeightArr=[]),s.rowHeightArr.push(t.value),t=e.next();break;case 142:s.columnWidthArr??(s.columnWidthArr=[]),s.columnWidthArr.push(t.value),t=e.next();break;case 280:s.version=t.value,t=e.next();break;case 310:s.bmpPreview??(s.bmpPreview=""),s.bmpPreview+=t.value,t=e.next();break;case 330:s.ownerDictionaryId=t.value,t=e.next();break;case 342:s.tableStyleId=t.value,t=e.next();break;case 343:s.blockRecordHandle=t.value,t=e.next();break;case 170:s.attachmentPoint=t.value,t=e.next();break;case 171:s.cells??(s.cells=[]),s.cells.push(function(o,h){let u=!1,g=!1,b={};for(;!o.isEOF()&&h.code!==0&&!g;)switch(h.code){case 171:if(u){g=!0;continue}b.cellType=h.value,u=!0,h=o.next();break;case 172:b.flagValue=h.value,h=o.next();break;case 173:b.mergedValue=h.value,h=o.next();break;case 174:b.autoFit=h.value,h=o.next();break;case 175:b.borderWidth=h.value,h=o.next();break;case 176:b.borderHeight=h.value,h=o.next();break;case 91:b.overrideFlag=h.value,h=o.next();break;case 178:b.virtualEdgeFlag=h.value,h=o.next();break;case 145:b.rotation=h.value,h=o.next();break;case 345:b.fieldObjetId=h.value,h=o.next();break;case 340:b.blockTableRecordId=h.value,h=o.next();break;case 146:b.blockScale=h.value,h=o.next();break;case 177:b.blockAttrNum=h.value,h=o.next();break;case 7:b.textStyle=h.value,h=o.next();break;case 140:b.textHeight=h.value,h=o.next();break;case 170:b.attachmentPoint=h.value,h=o.next();break;case 92:b.extendedCellFlags=h.value,h=o.next();break;case 285:b.rightBorderVisibility=!!(h.value??!0),h=o.next();break;case 286:b.bottomBorderVisibility=!!(h.value??!0),h=o.next();break;case 288:b.leftBorderVisibility=!!(h.value??!0),h=o.next();break;case 289:b.topBorderVisibility=!!(h.value??!0),h=o.next();break;case 301:(function(f,A,x){for(;x.code!==304;)switch(x.code){case 301:case 93:case 90:case 94:x=A.next();break;case 1:f.text=x.value,x=A.next();break;case 300:f.attrText=x.value,x=A.next();break;case 302:f.text=x.value?x.value:f.text,x=A.next();break;default:console.log(`Ignore code: ${x.code}, value: ${x.value}`),x=A.next()}})(b,o,h),h=o.next();break;default:return b}return u=!1,g=!1,b}(e,t)),t=e.lastReadGroup;break;default:da(s,t,e),t=e.next()}}return s}}function th(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}Ki="ACAD_TABLE",(Xi="ForEntityName")in $s?Object.defineProperty($s,Xi,{value:Ki,enumerable:!0,configurable:!0,writable:!0}):$s[Xi]=Ki;let ad=[{code:11,name:"xAxisDirection",parser:G},{code:210,name:"extrusionDirection",parser:G},{code:1,name:"text",parser:y},{code:10,name:"position",parser:G},{code:3,name:"styleName",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class rh{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){th(this,"parser",ye(ad))}}th(rh,"ForEntityName","TOLERANCE");let Zs=class{parseEntity(e,t){let s={};for(;t!=="EOF";){if(t.code===0){e.rewind();break}!function(o,h,u){if(u==="EOF")return!1;switch(u.code){case 0:return!1;case 8:o.layer=u.value;break;case 100:o.subclassMarker=u.value;break;case 10:o.viewportCenter=Vr(ze(h));break;case 40:o.width=u.value;break;case 41:o.height=u.value;break;case 68:o.status=u.value;break;case 69:o.viewportId=u.value;break;case 12:o.displayCenter=ze(h);break;case 13:o.snapBase=ze(h);break;case 14:o.snapSpacing=ze(h);break;case 15:o.gridSpacing=ze(h);break;case 16:o.viewDirection=Vr(ze(h));break;case 17:o.targetPoint=Vr(ze(h));break;case 42:o.perspectiveLensLength=u.value;break;case 43:o.frontClipZ=u.value;break;case 44:o.backClipZ=u.value;break;case 45:o.viewHeight=u.value;break;case 50:o.snapAngle=u.value;break;case 51:o.viewTwistAngle=u.value;break;case 72:o.circleZoomPercent=u.value;break;case 331:o.frozenLayerIds??(o.frozenLayerIds=[]),o.frozenLayerIds.push(u.value);break;case 90:o.statusBitFlags=u.value;break;case 340:o.clippingBoundaryId=u.value;break;case 1:o.sheetName=u.value;break;case 281:o.renderMode=u.value;break;case 71:o.ucsPerViewport=u.value;break;case 110:o.ucsOrigin=Vr(ze(h));break;case 111:o.ucsXAxis=Vr(ze(h));break;case 112:o.ucsYAxis=Vr(ze(h));break;case 345:o.ucsId=u.value;break;case 346:o.ucsBaseId=u.value;break;case 79:o.orthographicType=u.value;break;case 146:o.elevation=u.value;break;case 170:o.shadePlotMode=u.value;break;case 61:o.majorGridFrequency=u.value;break;case 332:o.backgroundId=u.value;break;case 333:o.shadePlotId=u.value;break;case 348:o.visualStyleId=u.value;break;case 292:o.isDefaultLighting=!!u.value;break;case 282:o.defaultLightingType=u.value;break;case 141:o.brightness=u.value;break;case 142:o.contrast=u.value;break;case 63:case 421:case 431:o.ambientLightColor=u.value;break;case 361:o.sunId=u.value;break;case 335:case 343:case 344:case 91:o.softPointer=u.value}return!0}(s,e,t)&&da(s,t,e),t=e.next()}return s}};Zi="VIEWPORT",($i="ForEntityName")in Zs?Object.defineProperty(Zs,$i,{value:Zi,enumerable:!0,configurable:!0,writable:!0}):Zs[$i]=Zi;(Ar={})[Ar.ShowImage=1]="ShowImage",Ar[Ar.ShowImageWhenNotAligned=2]="ShowImageWhenNotAligned",Ar[Ar.UseClippingBoundary=4]="UseClippingBoundary",Ar[Ar.Transparency=8]="Transparency";function nh(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}let od={brightness:50,constrast:50,fade:0},ld=[{code:14,name:"boundary",isMultiple:!0,parser:G},{code:91,name:"numberOfVertices",parser:y},{code:71,name:"boundaryType",parser:y},{code:360,name:"imageDefReactorHardId",parser:y},{code:283,name:"fade",parser:y},{code:282,name:"contrast",parser:y},{code:281,name:"brightness",parser:y},{code:280,name:"isClipping",parser:Be},{code:70,name:"displayFlag",parser:y},{code:340,name:"imageDefHardId",parser:y},{code:13,name:"imageSize",parser:G},{code:12,name:"vDirection",parser:G},{code:11,name:"uDirection",parser:G},{code:10,name:"position",parser:G},{code:90,name:"classVersion",parser:y},{code:100,name:"subclassMarker",parser:y},...Ue];class sh{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){nh(this,"parser",ye(ld,od))}}function ih(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}nh(sh,"ForEntityName","WIPEOUT");let hd=[{code:11,name:"direction",parser:G},{code:10,name:"position",parser:G},{code:100,name:"subclassMarker",parser:y},...Ue],ah=class{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){ih(this,"parser",ye(hd))}};function oh(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}ih(ah,"ForEntityName","XLINE");let cd={},ud=[{code:170,name:"multileaderType",parser:y},{code:291,name:"doglegEnabled",parser:Be},{code:40,name:"doglegLength",parser:y},{code:172,name:"contentType",parser:y},{code:3,name:"textContent",parser:y},{code:12,name:"textAnchor",parser:G},{code:344,name:"blockHandle",parser:y},{code:15,name:"blockPosition",parser:G},{code:302,name:"leaderSections",parser:function(i,e,t){let s,o={leaderLines:[]};for(;e.hasNext()&&(s=e.next()).code!==303;)switch(s.code){case 10:o.landingPoint=(s.value,ze(e));break;case 11:o.doglegVector=(s.value,ze(e));break;case 40:o.doglegLength=s.value;break;case 304:o.leaderLines.push(function(h,u,g){let b,f={vertices:[]};for(;u.hasNext()&&(b=u.next()).code!==305;)b.code===10&&f.vertices.push((b.value,ze(u)));return f}(0,e))}return o},isMultiple:!0},...Ue];class lh{parseEntity(e,t){let s={};return this.parser(t,e,s),s}constructor(){oh(this,"parser",ye(ud,cd))}}oh(lh,"ForEntityName","MULTILEADER");let dd=Object.fromEntries([al,dl,fl,vl,bl,Xs,wl,Pl,Ml,Cl,Ll,zl,Ks,Rl,pl,lh,Fl,jl,Wl,ql,Xl,$l,Ql,eh,$s,cl,rh,El,ma,Zs,sh,ah].map(i=>[i.ForEntityName,new i]));function hh(i,e){let t=[];for(;!Ae(i,0,"EOF");){if(i.code===0){if(i.value==="ENDBLK"||i.value==="ENDSEC"){e.rewind();break}let s=dd[i.value];if(s){let o=i.value;i=e.next();let h=s.parseEntity(e,i);h.type=o,nl(h),t.push(h)}else e.debug&&console.warn(`Unsupported ENTITY type: ${i.value}`)}i=e.next()}return t}function md(i,e){let t={};for(;!Ae(i,0,"EOF")&&!Ae(i,0,"ENDSEC");){if(Ae(i,0,"BLOCK")){let s=pd(i=e.next(),e);nl(s),s.name&&(t[s.name]=s)}i=e.next()}return t}function pd(i,e){let t={};for(;!Ae(i,0,"EOF");){if(Ae(i,0,"ENDBLK")){for(i=e.next();!Ae(i,0,"EOF");){if(Ae(i,100,"AcDbBlockEnd"))return t;i=e.next()}break}switch(i.code){case 1:t.xrefPath=i.value;break;case 2:t.name=i.value;break;case 3:t.name2=i.value;break;case 5:t.handle=i.value;break;case 8:t.layer=i.value;break;case 10:t.position=ze(e);break;case 67:t.paperSpace=!!i.value&&i.value==1;break;case 70:i.value!==0&&(t.type=i.value);break;case 100:break;case 330:t.ownerHandle=i.value;break;case 0:t.entities=hh(i,e)}i=e.next()}return t}function gd(i,e){let t=null,s={};for(;!Ae(i,0,"EOF")&&!Ae(i,0,"ENDSEC");)i.code===9?t=i.value:i.code===10?s[t]=ze(e):s[t]=i.value,i=e.next();return s}(Ot={})[Ot.NOT_APPLICABLE=0]="NOT_APPLICABLE",Ot[Ot.KEEP_EXISTING=1]="KEEP_EXISTING",Ot[Ot.USE_CLONE=2]="USE_CLONE",Ot[Ot.XREF_VALUE_NAME=3]="XREF_VALUE_NAME",Ot[Ot.VALUE_NAME=4]="VALUE_NAME",Ot[Ot.UNMANGLE_NAME=5]="UNMANGLE_NAME";let pa=[{code:330,name:"ownerObjectId",parser:y},{code:102,parser:dn},{code:102,parser:dn},{code:102,parser:dn},{code:5,name:"handle",parser:y}],fd=[{code:3,name:"entries",parser:(i,e)=>{let t={name:i.value};return(i=e.next()).code===350?t.objectSoftId=i.value:i.code===360?t.objectHardId=i.value:e.rewind(),t},isMultiple:!0},{code:281,name:"recordCloneFlag",parser:y},{code:280,name:"isHardOwned",parser:Be},{code:100,name:"subclassMarker",parser:y},...pa],_d=[{code:330,name:"imageDefReactorIdSoft",isMultiple:!0,parser:y},{code:90,name:"version",parser:y},{code:1,name:"fileName",parser:y},{code:10,name:"size",parser:G},{code:11,name:"sizeOfOnePixel",parser:G},{code:280,name:"isLoaded",parser:y},{code:281,name:"resolutionUnits",parser:y},{code:100,name:"subclassMarker",parser:y}];(an={})[an.NOUNIT=0]="NOUNIT",an[an.CENTIMETERS=2]="CENTIMETERS",an[an.INCH=5]="INCH";(As={})[As.PSLTSCALE=1]="PSLTSCALE",As[As.LIMCHECK=2]="LIMCHECK";(on={})[on.INCHES=0]="INCHES",on[on.MILLIMETERS=1]="MILLIMETERS",on[on.PIXELS=2]="PIXELS";(zt={})[zt.LAST_SCREEN_DISPLAY=0]="LAST_SCREEN_DISPLAY",zt[zt.DRAWING_EXTENTS=1]="DRAWING_EXTENTS",zt[zt.DRAWING_LIMITS=2]="DRAWING_LIMITS",zt[zt.VIEW_SPECIFIED=3]="VIEW_SPECIFIED",zt[zt.WINDOW_SPECIFIED=4]="WINDOW_SPECIFIED",zt[zt.LAYOUT_INFORMATION=5]="LAYOUT_INFORMATION";(Pr={})[Pr.AS_DISPLAYED=0]="AS_DISPLAYED",Pr[Pr.WIREFRAME=1]="WIREFRAME",Pr[Pr.HIDDEN=2]="HIDDEN",Pr[Pr.RENDERED=3]="RENDERED";(Dt={})[Dt.DRAFT=0]="DRAFT",Dt[Dt.PREVIEW=1]="PREVIEW",Dt[Dt.NORMAL=2]="NORMAL",Dt[Dt.PRESENTATION=3]="PRESENTATION",Dt[Dt.MAXIMUM=4]="MAXIMUM",Dt[Dt.CUSTOM=5]="CUSTOM";let ch=[{code:333,name:"shadePlotId",parser:y},{code:149,name:"imageOriginY",parser:y},{code:148,name:"imageOriginX",parser:y},{code:147,name:"scaleFactor",parser:y},{code:78,name:"shadePlotCustomDPI",parser:y},{code:77,name:"shadePlotResolution",parser:y},{code:76,name:"shadePlotMode",parser:y},{code:75,name:"standardScaleType",parser:y},{code:7,name:"currentStyleSheet",parser:y},{code:74,name:"plotType",parser:y},{code:73,name:"plotRotation",parser:y},{code:72,name:"plotPaperUnit",parser:y},{code:70,name:"layoutFlag",parser:y},{code:143,name:"printScaleDenominator",parser:y},{code:142,name:"printScaleNumerator",parser:y},{code:141,name:"windowAreaYMax",parser:y},{code:140,name:"windowAreaXMax",parser:y},{code:49,name:"windowAreaYMin",parser:y},{code:48,name:"windowAreaXMin",parser:y},{code:47,name:"plotOriginY",parser:y},{code:46,name:"plotOriginX",parser:y},{code:45,name:"paperHeight",parser:y},{code:44,name:"paperWidth",parser:y},{code:43,name:"marginTop",parser:y},{code:42,name:"marginRight",parser:y},{code:41,name:"marginBottom",parser:y},{code:40,name:"marginLeft",parser:y},{code:6,name:"plotViewName",parser:y},{code:4,name:"paperSize",parser:y},{code:2,name:"configName",parser:y},{code:1,name:"pageSetupName",parser:y},{code:100,name:"subclassMarker",parser:y},...pa],vd=[{code:346,name:"orthographicUcsId",parser:y},{code:345,name:"namedUcsId",parser:y},{code:331,name:"viewportId",parser:y},{code:330,name:"paperSpaceTableId",parser:y},{code:76,name:"orthographicType",parser:y},{code:17,name:"ucsYAxis",parser:G},{code:16,name:"ucsXAxis",parser:G},{code:13,name:"ucsOrigin",parser:G},{code:146,name:"elevation",parser:y},{code:15,name:"maxExtent",parser:G},{code:14,name:"minExtent",parser:G},{code:12,name:"insertionPoint",parser:G},{code:11,name:"maxLimit",parser:G},{code:10,name:"minLimit",parser:G},{code:71,name:"tabOrder",parser:y},{code:70,name:"controlFlag",parser:y},{code:1,name:"layoutName",parser:y},{code:100,name:"subclassMarker",parser:y},...ch],yd=[{code:40,name:"wcsToOCSTransform",parser:ko},{code:40,name:"ocsToWCSTransform",parser:ko},{code:41,name:"backClippingDistance",parser:y},{code:73,name:"isBackClipping",parser:Be,pushContext:!0},{code:40,name:"frontClippingDistance",parser:y},{code:72,name:"isFrontClipping",parser:Be,pushContext:!0},{code:71,name:"isClipBoundaryDisplayed",parser:Be},{code:11,name:"position",parser:G},{code:210,name:"normal",parser:G},{code:10,name:"boundaryVertices",parser:G,isMultiple:!0},{code:70,name:"boundaryCount",parser:y},{code:100,name:"subclassMarker",parser:y},{code:100},...pa];function ko(i,e){let t=[];for(let s=0;s<3&&Ae(i,40);++s){let o=[];for(let h=0;h<4&&Ae(i,40);++h)o.push(i.value),i=e.next();t.push(o)}return e.rewind(),t}let bd={LAYOUT:vd,PLOTSETTINGS:ch,DICTIONARY:fd,SPATIAL_FILTER:yd,IMAGEDEF:_d};function xd(i,e){let t=[];for(;i.code!==0||!["EOF","ENDSEC"].includes(i.value);){let s=i.value,o=bd[s];if(i.code===0&&(o!=null&&o.length)){let h=ye(o),u={name:s};h(i=e.next(),e,u)?(t.push(u),i=e.peek()):i=e.next()}else i=e.next()}return{byName:du(t,({name:s})=>s)}}let Fn=[{code:100,name:"subclassMarker",parser:y},{code:330,name:"ownerObjectId",parser:y},{code:102,parser(i,e){for(;!Ae(i,0,"EOF")&&!Ae(i,102,"}");)i=e.next()}},{code:5,name:"handle",parser:y}],wd=ye([{code:310,name:"bmpPreview",parser:y},{code:281,name:"scalability",parser:y},{code:280,name:"explodability",parser:y},{code:70,name:"insertionUnits",parser:y},{code:340,name:"layoutObjects",parser:y},{code:2,name:"name",parser:y},{code:100,name:"subclassMarker",parser:y},...Fn]),Ad=[{name:"DIMPOST",code:3},{name:"DIMAPOST",code:4},{name:"DIMBLK_OBSOLETE",code:5},{name:"DIMBLK1_OBSOLETE",code:6},{name:"DIMBLK2_OBSOLETE",code:7},{name:"DIMSCALE",code:40,defaultValue:1},{name:"DIMASZ",code:41,defaultValue:.25},{name:"DIMEXO",code:42,defaultValue:.625,defaultValueImperial:.0625},{name:"DIMDLI",code:43,defaultValue:3.75,defaultValueImperial:.38},{name:"DIMEXE",code:44,defaultValue:2.25,defaultValueImperial:.28},{name:"DIMRND",code:45,defaultValue:0},{name:"DIMDLE",code:46,defaultValue:0},{name:"DIMTP",code:47,defaultValue:0},{name:"DIMTM",code:48,defaultValue:0},{name:"DIMTXT",code:140,defaultValue:2.5,defaultValueImperial:.28},{name:"DIMCEN",code:141,defaultValue:2.5,defaultValueImperial:.09},{name:"DIMTSZ",code:142,defaultValue:0},{name:"DIMALTF",code:143,defaultValue:25.4},{name:"DIMLFAC",code:144,defaultValue:1},{name:"DIMTVP",code:145,defaultValue:0},{name:"DIMTFAC",code:146,defaultValue:1},{name:"DIMGAP",code:147,defaultValue:.625,defaultValueImperial:.09},{name:"DIMALTRND",code:148,defaultValue:0},{name:"DIMTOL",code:71,defaultValue:0,defaultValueImperial:1},{name:"DIMLIM",code:72,defaultValue:0},{name:"DIMTIH",code:73,defaultValue:0,defaultValueImperial:1},{name:"DIMTOH",code:74,defaultValue:0,defaultValueImperial:1},{name:"DIMSE1",code:75,defaultValue:0},{name:"DIMSE2",code:76,defaultValue:0},{name:"DIMTAD",code:77,defaultValue:Io.Above,defaultValueImperial:Io.Center},{name:"DIMZIN",code:78,defaultValue:Nn.Trailing,defaultValueImperial:Nn.Feet},{name:"DIMAZIN",code:79,defaultValue:Qc.None},{name:"DIMALT",code:170,defaultValue:0},{name:"DIMALTD",code:171,defaultValue:3,defaultValueImperial:2},{name:"DIMTOFL",code:172,defaultValue:1,defaultValueImperial:0},{name:"DIMSAH",code:173,defaultValue:0},{name:"DIMTIX",code:174,defaultValue:0},{name:"DIMSOXD",code:175,defaultValue:0},{name:"DIMCLRD",code:176,defaultValue:0},{name:"DIMCLRE",code:177,defaultValue:0},{name:"DIMCLRT",code:178,defaultValue:0},{name:"DIMADEC",code:179},{name:"DIMUNIT",code:270},{name:"DIMDEC",code:271,defaultValue:2,defaultValueImperial:4},{name:"DIMTDEC",code:272,defaultValue:2,defaultValueImperial:4},{name:"DIMALTU",code:273,defaultValue:2},{name:"DIMALTTD",code:274,defaultValue:2,defaultValueImperial:4},{name:"DIMAUNIT",code:275,defaultValue:0},{name:"DIMFRAC",code:276,defaultValue:0},{name:"DIMLUNIT",code:277,defaultValue:2},{name:"DIMDSEP",code:278,defaultValue:",",defaultValueImperial:"."},{name:"DIMJUST",code:280,defaultValue:Jc.Center},{name:"DIMSD1",code:281,defaultValue:0},{name:"DIMSD2",code:282,defaultValue:0},{name:"DIMTOLJ",code:283,defaultValue:eu.Center},{name:"DIMTZIN",code:284,defaultValue:Nn.Trailing,defaultValueImperial:Nn.Feet},{name:"DIMALTZ",code:285,defaultValue:Nn.Trailing},{name:"DIMALTTZ",code:286,defaultValue:Nn.Trailing},{name:"DIMFIT",code:287},{name:"DIMUPT",code:288,defaultValue:0},{name:"DIMATFIT",code:289,defaultValue:3},{name:"DIMTXSTY",code:340},{name:"DIMLDRBLK",code:341},{name:"DIMBLK",code:342},{name:"DIMBLK1",code:343},{name:"DIMBLK2",code:344},{name:"DIMLWD",code:371,defaultValue:-2},{name:"DIMLWD",code:372,defaultValue:-2}],Pd=ye([...Ad.map(i=>({...i,parser:y})),{code:70,name:"standardFlag",parser:y},{code:2,name:"name",parser:y},{code:100,name:"subclassMarker",parser:y},{code:105,name:"handle",parser:y},...Fn.filter(i=>i.code!==5)]),Sd=ye([{code:347,name:"materialObjectId",parser:y},{code:390,name:"plotStyleNameObjectId",parser:y},{code:370,name:"lineweight",parser:y},{code:290,name:"isPlotting",parser:Be},{code:6,name:"lineType",parser:y},{code:62,name:"colorIndex",parser:y},{code:70,name:"standardFlag",parser:y},{code:2,name:"name",parser:y},{code:100,name:"subclassMarker",parser:y},...Fn]);(Sr={})[Sr.NONE=0]="NONE",Sr[Sr.AbsoluteRotation=1]="AbsoluteRotation",Sr[Sr.TextEmbedded=2]="TextEmbedded",Sr[Sr.ShapeEmbedded=4]="ShapeEmbedded";let Id=ye([{code:9,name:"text",parser:y},{code:45,name:"offsetY",parser:y},{code:44,name:"offsetX",parser:y},{code:50,name:"rotation",parser:y},{code:46,name:"scale",parser:y},{code:340,name:"styleObjectId",parser:y},{code:75,name:"shapeNumber",parser:y},{code:74,name:"elementTypeFlag",parser:y},{code:49,name:"elementLength",parser:y}],{elementTypeFlag:0,elementLength:0}),Ed=ye([{code:49,name:"pattern",parser(i,e){let t={};return Id(i,e,t),t},isMultiple:!0},{code:40,name:"totalPatternLength",parser:y},{code:73,name:"numberOfLineTypes",parser:y},{code:72,parser:y},{code:3,name:"description",parser:y},{code:70,name:"standardFlag",parser:y},{code:2,name:"name",parser:y},{code:100,name:"subclassMarker",parser:y},...Fn]),kd=ye([{code:1e3,name:"extendedFont",parser:y},{code:1001},{code:4,name:"bigFont",parser:y},{code:3,name:"font",parser:y},{code:42,name:"lastHeight",parser:y},{code:71,name:"textGenerationFlag",parser:y},{code:50,name:"obliqueAngle",parser:y},{code:41,name:"widthFactor",parser:y},{code:40,name:"fixedTextHeight",parser:y},{code:70,name:"standardFlag",parser:y},{code:2,name:"name",parser:y},{code:100,name:"subclassMarker",parser:y},...Fn]),Md=ye([{code:[63,421,431],name:"ambientColor",parser:y},{code:142,name:"contrast",parser:y},{code:141,name:"brightness",parser:y},{code:282,name:"defaultLightingType",parser:y},{code:292,name:"isDefaultLightingOn",parser:Be},{code:348,name:"visualStyleObjectId",parser:y},{code:333,name:"shadePlotObjectId",parser:y},{code:332,name:"backgroundObjectId",parser:y},{code:61,name:"majorGridLines",parser:y},{code:170,name:"shadePlotSetting",parser:y},{code:146,name:"elevation",parser:y},{code:79,name:"orthographicType",parser:y},{code:112,name:"ucsYAxis",parser:G},{code:111,name:"ucsXAxis",parser:G},{code:110,name:"ucsOrigin",parser:G},{code:74,name:"ucsIconSetting",parser:y},{code:71,name:"viewMode",parser:y},{code:281,name:"renderMode",parser:y},{code:1,name:"styleSheet",parser:y},{code:[331,441],name:"frozenLayers",parser:y,isMultiple:!0},{code:72,name:"circleSides",parser:y},{code:51,name:"viewTwistAngle",parser:y},{code:50,name:"snapRotationAngle",parser:y},{code:45,name:"viewHeight",parser:y},{code:44,name:"backClippingPlane",parser:y},{code:43,name:"frontClippingPlane",parser:y},{code:42,name:"lensLength",parser:y},{code:17,name:"viewTarget",parser:G},{code:16,name:"viewDirectionFromTarget",parser:G},{code:15,name:"gridSpacing",parser:G},{code:14,name:"snapSpacing",parser:G},{code:13,name:"snapBasePoint",parser:G},{code:12,name:"center",parser:G},{code:11,name:"upperRightCorner",parser:G},{code:10,name:"lowerLeftCorner",parser:G},{code:70,name:"standardFlag",parser:y},{code:2,name:"name",parser:y},{code:100,name:"subclassMarker",parser:y},...Fn]),Td={BLOCK_RECORD:wd,DIMSTYLE:Pd,LAYER:Sd,LTYPE:Ed,STYLE:kd,VPORT:Md},Cd=ye([{code:70,name:"maxNumberOfEntries",parser:y},{code:100,name:"subclassMarker",parser:y},{code:330,name:"ownerObjectId",parser:y},{code:102},{code:360,isMultiple:!0},{code:102},{code:5,name:"handle",parser:y},{code:2,name:"name",parser:y}]);function Nd(i,e){var s;let t={};for(;!Ae(i,0,"EOF")&&!Ae(i,0,"ENDSEC");){if(Ae(i,0,"TABLE")){i=e.next();let o={entries:[]};Cd(i,e,o),t[o.name]=o}if(Ae(i,0)&&!Ae(i,0,"ENDTAB")){let o=i.value;i=e.next();let h=Td[o];if(!h){e.debug&&console.warn(`parseTable: Invalid table name '${o}'`),i=e.next();continue}let u={};h(i,e,u),(s=t[o])==null||s.entries.push(u)}i=e.next()}return t}function Ps(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}class Mo{next(){if(!this.hasNext())return this._eof?this.debug&&console.warn("Cannot call 'next' after EOF group has been read"):this.debug&&console.warn("Unexpected end of input: EOF group not read before end of file. Ended on code "+this._data[this._pointer]),{code:0,value:"EOF"};let e=parseInt(this._data[this._pointer++],10),t=To(e,this._data[this._pointer++],this.debug),s={code:e,value:t};return Ae(s,0,"EOF")&&(this._eof=!0),this.lastReadGroup=s,s}peek(){if(!this.hasNext())throw this._eof?Error("Cannot call 'next' after EOF group has been read"):Error("Unexpected end of input: EOF group not read before end of file. Ended on code "+this._data[this._pointer]);let e={code:parseInt(this._data[this._pointer]),value:0};return e.value=To(e.code,this._data[this._pointer+1],this.debug),e}rewind(e){e=e||1,this._pointer=this._pointer-2*e}hasNext(){return!this._eof&&!(this._pointer>this._data.length-2)}isEOF(){return this._eof}constructor(e,t=!1){Ps(this,"_data",void 0),Ps(this,"debug",void 0),Ps(this,"_pointer",void 0),Ps(this,"_eof",void 0),Ps(this,"lastReadGroup",void 0),this._data=e,this.debug=t,this.lastReadGroup={code:0,value:0},this._pointer=0,this._eof=!1}}function To(i,e,t=!1){return i<=9?e:i>=10&&i<=59?parseFloat(e.trim()):i>=60&&i<=99?parseInt(e.trim()):i>=100&&i<=109?e:i>=110&&i<=149?parseFloat(e.trim()):i>=160&&i<=179?parseInt(e.trim()):i>=210&&i<=239?parseFloat(e.trim()):i>=270&&i<=289?parseInt(e.trim()):i>=290&&i<=299?function(s){if(s==="0")return!1;if(s==="1")return!0;throw TypeError("String '"+s+"' cannot be cast to Boolean type")}(e.trim()):i>=300&&i<=369?e:i>=370&&i<=389?parseInt(e.trim()):i>=390&&i<=399?e:i>=400&&i<=409?parseInt(e.trim()):i>=410&&i<=419?e:i>=420&&i<=429?parseInt(e.trim()):i>=430&&i<=439?e:i>=440&&i<=459?parseInt(e.trim()):i>=460&&i<=469?parseFloat(e.trim()):i>=470&&i<=481||i===999||i>=1e3&&i<=1009?e:i>=1010&&i<=1059?parseFloat(e.trim()):i>=1060&&i<=1071?parseInt(e.trim()):(t&&console.warn("WARNING: Group code does not have a defined type: %j",{code:i,value:e}),e)}function sa(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}class Ld{constructor(){sa(this,"encoding","utf-8"),sa(this,"encodingFailureFatal",!1)}}class Od extends EventTarget{parseSync(e,t=!1){let s=new Mo(e.split(/\r\n|\r|\n/g),t);if(!s.hasNext())throw Error("Empty file");return this.parseAll(s)}parseStream(e){let t="",s=this;return new Promise((o,h)=>{e.on("data",u=>{t+=u}),e.on("end",()=>{try{let u=t.split(/\r\n|\r|\n/g),g=new Mo(u);if(!g.hasNext())throw Error("Empty file");o(s.parseAll(g))}catch(u){h(u)}}),e.on("error",u=>{h(u)})})}async parseFromUrl(e,t){let s=await fetch(e,t);if(!s.body)return null;let o=s.body.getReader(),h="";for(;;){let{done:u,value:g}=await o.read();if(u){h+=this._decoder.decode(new ArrayBuffer(0),{stream:!1});break}h+=this._decoder.decode(g,{stream:!0})}return this.parseSync(h)}parseAll(e){let t={header:{},blocks:{},entities:[],tables:{},objects:{byName:{},byTree:void 0}},s=e.next();for(;!Ae(s,0,"EOF");)Ae(s,0,"SECTION")&&(Ae(s=e.next(),2,"HEADER")?(s=e.next(),t.header=gd(s,e)):Ae(s,2,"BLOCKS")?(s=e.next(),t.blocks=md(s,e)):Ae(s,2,"ENTITIES")?(s=e.next(),t.entities=hh(s,e)):Ae(s,2,"TABLES")?(s=e.next(),t.tables=Nd(s,e)):Ae(s,2,"OBJECTS")&&(s=e.next(),t.objects=xd(s,e))),s=e.next();return t}constructor(e=new Ld){super(),sa(this,"_decoder",void 0),this._decoder=new TextDecoder(e.encoding,{fatal:e.encodingFailureFatal})}}var ga=(i=>(i[i.DecimalDegrees=0]="DecimalDegrees",i[i.DegreesMinutesSeconds=1]="DegreesMinutesSeconds",i[i.Gradians=2]="Gradians",i[i.Radians=3]="Radians",i[i.SurveyorsUnits=4]="SurveyorsUnits",i))(ga||{});class Gr{static get instance(){return this._instance||(this._instance=new Gr),this._instance}constructor(){this._blocks=new Map}createKey(e,t){return`${e}_${t}`}set(e,t){return t=t.fastDeepClone(),this._blocks.set(e,t),t}get(e){let t=this._blocks.get(e);return t&&(t=t.fastDeepClone()),t}has(e){return this._blocks.has(e)}clear(){this._blocks.clear()}draw(e,t,s,o=!0,h,u){const g=[];if(t!=null){const b=this.createKey(t.name,s);let f;if(this.has(b))f=this.get(b);else{const A=t.newIterator();for(const x of A)x.color.isByBlock&&s?(Co.copy(x.color),x.color.color=s,this.addEntity(x,g,e),x.color.copy(Co)):this.addEntity(x,g,e);f=e.group(g),f&&o&&this.set(b,f)}return f&&h&&(f.applyMatrix(h),u&&(u.x!=0||u.y!=0||u.z!=1)&&(h.setFromExtrusionDirection(u),f.applyMatrix(h))),f}else return e.group(g)}addEntity(e,t,s){const o=e.draw(s);o&&(this.attachEntityInfo(o,e),t.push(o))}attachEntityInfo(e,t){e.objectId=t.objectId,e.ownerId=t.ownerId,e.layerName=t.layer,e.visible=t.visibility}}const Co=new fn,ei="Continuous",Qs="ByLayer",uh="ByBlock";var cn=(i=>(i[i.EndPoint=1]="EndPoint",i[i.MidPoint=2]="MidPoint",i[i.Center=3]="Center",i[i.Node=4]="Node",i[i.Quadrant=5]="Quadrant",i[i.Insertion=7]="Insertion",i[i.Perpendicular=8]="Perpendicular",i[i.Tangent=9]="Tangent",i[i.Nearest=10]="Nearest",i[i.Centroid=11]="Centroid",i))(cn||{}),fa=(i=>(i[i.Undefined=0]="Undefined",i[i.Inches=1]="Inches",i[i.Feet=2]="Feet",i[i.Miles=3]="Miles",i[i.Millimeters=4]="Millimeters",i[i.Centimeters=5]="Centimeters",i[i.Meters=6]="Meters",i[i.Kilometers=7]="Kilometers",i[i.Microinches=8]="Microinches",i[i.Mils=9]="Mils",i[i.Yards=10]="Yards",i[i.Angstroms=11]="Angstroms",i[i.Nanometers=12]="Nanometers",i[i.Microns=13]="Microns",i[i.Decimeters=14]="Decimeters",i[i.Dekameters=15]="Dekameters",i[i.Hectometers=16]="Hectometers",i[i.Gigameters=17]="Gigameters",i[i.Astronomical=18]="Astronomical",i[i.LightYears=19]="LightYears",i[i.Parsecs=20]="Parsecs",i[i.USSurveyFeet=21]="USSurveyFeet",i[i.USSurveyInch=22]="USSurveyInch",i[i.USSurveyYard=23]="USSurveyYard",i[i.USSurveyMile=24]="USSurveyMile",i[i.Max=24]="Max",i))(fa||{});function zd(i){return i==4||i==5||i==6||i==7||i==12||i==13||i==14||i==15||i==16||i==17}function Dd(i){return i==1||i==2||i==3||i==8||i==9||i==10||i==21}var dh=(i=>(i.ClosedFilled="",i.Dot="_DOT",i.DotSmall="_DOTSMALL",i.DotBlank="_DOTBLANK",i.Origin="_ORIGIN",i.Origin2="_ORIGIN2",i.Open="_OPEN",i.Open90="_OPEN90",i.Open30="_OPEN30",i.Closed="_CLOSED",i.Small="_SMALL",i.None="_NONE",i.Oblique="_OBLIQUE",i.BoxFilled="_BOXFILLED",i.Box="_BOXBLANK",i.ClosedBlank="_CLOSEDBLANK",i.DatumBlank="_DATUMBLANK",i.DatumFilled="_DATUMFILLED",i.Integral="_INTEGRAL",i.ArchTick="_ARCHTICK",i))(dh||{});class Ei{constructor(e){this.i=0,this._records=e,this._keys=Array.from(e.keys())}[Symbol.iterator](){return this}next(){for(;this.i<this._keys.length;){const e=this._records.get(this._keys[this.i]);return this.i+=1,{value:e,done:!1}}return{value:null,done:!0}}}const mh="Load Database";class St extends Zo{constructor(e,t){super(e.stage),this.data=e,this.progress=t}async run(e){const t=ca.getInstance().getEntry(mh),s=Date.now();this.progress&&await this.progress(this.data.progress.value,this.data.stage,"START");const o=await this.data.task(e);if(this.progress){const h=o.data;await this.progress(this.data.progress.value,this.data.stage,"END",h),this.data.progress.value+=this.data.step,this.data.progress.value>100&&(this.data.progress.value=100)}return t&&(t.data[this.name]=Date.now()-s),o}}class ph{constructor(e={}){this.config=e}async read(e,t,s,o){const h={name:mh,data:{total:0},format(){let f="";return Object.keys(this.data).forEach(A=>{A!=="total"&&(f+=`- ${A}: ${this.data[A]} ms
|
|
2
2
|
`)}),f+=`- total: ${this.data.total} ms`,f}};ca.getInstance().collect(h),this.progress=o;const u={value:0},g=new Qo;g.setCompleteCallback(()=>this.onFinished()),g.setErrorCallback(f=>this.onError(f)),g.addTask(new St({stage:"START",step:1,progress:u,task:async f=>f},o)),g.addTask(new St({stage:"PARSE",step:5,progress:u,task:async f=>({model:await this.parse(f)})},o)),g.addTask(new St({stage:"FONT",step:5,progress:u,task:async f=>{const A=this.getFonts(f.model);return{model:f.model,data:A}}},o)),g.addTask(new St({stage:"LTYPE",step:1,progress:u,task:async f=>(this.processLineTypes(f.model,t),f)},o)),g.addTask(new St({stage:"STYLE",step:1,progress:u,task:async f=>(this.processTextStyles(f.model,t),f)},o)),g.addTask(new St({stage:"DIMSTYLE",step:1,progress:u,task:async f=>(this.processDimStyles(f.model,t),f)},o)),g.addTask(new St({stage:"LAYER",step:1,progress:u,task:async f=>(this.processLayers(f.model,t),f)},o)),g.addTask(new St({stage:"VPORT",step:1,progress:u,task:async f=>(this.processViewports(f.model,t),f)},o)),g.addTask(new St({stage:"HEADER",step:1,progress:u,task:async f=>(this.processHeader(f.model,t),f)},o)),g.addTask(new St({stage:"BLOCK_RECORD",step:5,progress:u,task:async f=>(this.processBlockTables(f.model,t),f)},o)),g.addTask(new St({stage:"OBJECT",step:5,progress:u,task:async f=>(this.processObjects(f.model,t),f)},o)),g.addTask(new St({stage:"BLOCK",step:5,progress:u,task:async f=>(await this.processBlocks(f.model,t),f)},o)),g.addTask(new St({stage:"ENTITY",step:100,progress:u,task:async f=>(await this.processEntities(f.model,t,s,u,o),f)},o)),g.addTask(new St({stage:"END",step:0,progress:u,task:async f=>f},o));const b=Date.now();await g.run(e),h.data.total=Date.now()-b}onError(e){if(this.progress){const t=e.task;this.progress(t.data.progress.value,t.data.stage,"ERROR",void 0,e)}console.error(`Error occurred in conversion stage '${e.task.name}': `,e.error),e.task.name!="ENTITY"&&this.onFinished()}onFinished(){this.progress&&(this.progress(100,"END","END"),Gr.instance.clear())}async parse(e,t){throw new Error("Not impelemented yet!")}getFonts(e){throw new Error("Not impelemented yet!")}processLineTypes(e,t){throw new Error("Not impelemented yet!")}processTextStyles(e,t){throw new Error("Not impelemented yet!")}processDimStyles(e,t){throw new Error("Not impelemented yet!")}processLayers(e,t){throw new Error("Not impelemented yet!")}processViewports(e,t){throw new Error("Not impelemented yet!")}processHeader(e,t){throw new Error("Not impelemented yet!")}processBlockTables(e,t){throw new Error("Not impelemented yet!")}processObjects(e,t){throw new Error("Not impelemented yet!")}processBlocks(e,t){throw new Error("Not impelemented yet!")}processEntities(e,t,s,o,h){throw new Error("Not impelemented yet!")}}const ft=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let No=1234567;const _a=Math.PI/180,va=180/Math.PI;function gh(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(ft[i&255]+ft[i>>8&255]+ft[i>>16&255]+ft[i>>24&255]+"-"+ft[e&255]+ft[e>>8&255]+"-"+ft[e>>16&15|64]+ft[e>>24&255]+"-"+ft[t&63|128]+ft[t>>8&255]+"-"+ft[t>>16&255]+ft[t>>24&255]+ft[s&255]+ft[s>>8&255]+ft[s>>16&255]+ft[s>>24&255]).toLowerCase()}function kr(i,e,t){return Math.max(e,Math.min(t,i))}function ya(i,e){return(i%e+e)%e}function fh(i,e,t,s,o){return s+(i-e)*(o-s)/(t-e)}function _h(i,e,t){return i!==e?(t-i)/(e-i):0}function ba(i,e,t){return(1-t)*i+t*e}function vh(i,e,t,s){return ba(i,e,1-Math.exp(-t*s))}function yh(i,e=1){return e-Math.abs(ya(i,e*2)-e)}function bh(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function xh(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function wh(i,e){return i+Math.floor(Math.random()*(e-i+1))}function Ah(i,e){return i+Math.random()*(e-i)}function Ph(i){return i*(.5-Math.random())}function Sh(i){i!==void 0&&(No=i);let e=No+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Ih(i){return i*_a}function Eh(i){return i*va}function kh(i){return(i&i-1)===0&&i!==0}function Mh(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function Th(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function ks(i){const e=Math.PI*2;return(i%e+e)%e}function Ch(i,e,t){return i>e&&i<t||i>t&&i<e}function Nh(i,e,t,s=!1){return i=ks(i),e=ks(e),t=ks(t),s?e>t?i<=e&&i>=t:i<=e||i>=t:e<t?i>=e&&i<=t:i>=e||i<=t}function xa(i){return i=Math.abs(i),i<1?0:Math.ceil(Math.log10(Math.abs(i)+1))}function Lh(i,e=1e-7){const t=xa(i);return Math.max(Math.pow(10,t)*e,e)}const Ee={DEG2RAD:_a,RAD2DEG:va,generateUUID:gh,clamp:kr,euclideanModulo:ya,mapLinear:fh,inverseLerp:_h,lerp:ba,damp:vh,pingpong:yh,smoothstep:bh,smootherstep:xh,randInt:wh,randFloat:Ah,randFloatSpread:Ph,seededRandom:Sh,degToRad:Ih,radToDeg:Eh,isPowerOfTwo:kh,ceilPowerOfTwo:Mh,floorPowerOfTwo:Th,normalizeAngle:ks,isBetween:Ch,isBetweenAngle:Nh,intPartLength:xa,relativeEps:Lh},ia=class Oh{constructor(e,t){this.x=0,this.y=0;const s=+(e!==void 0)+ +(t!==void 0);if(s!==0){if(s===1&&e instanceof Array){this.x=e[0],this.y=e[1];return}if(s===1){const{x:o,y:h}=e;this.x=o,this.y=h;return}if(s===2){this.x=e,this.y=t;return}throw Ut.ILLEGAL_PARAMETERS}}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new Oh(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix2d(e){const t=this.x,s=this.y,o=e.elements;return this.x=o[0]*t+o[3]*s+o[6],this.y=o[1]*t+o[4]*s+o[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(Math.max(-1,Math.min(1,s)))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y;return t*t+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}rotateAround(e,t){const s=Math.cos(t),o=Math.sin(t),h=this.x-e.x,u=this.y-e.y;return this.x=h*s-u*o+e.x,this.y=h*o+u*s+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}relativeEps(e=1e-7){return Math.min(Ee.relativeEps(this.x,e),Ee.relativeEps(this.y,e))}*[Symbol.iterator](){yield this.x,yield this.y}};ia.EMPTY=Object.freeze(new ia(0,0));let $e=ia;const aa=class zh{constructor(e,t,s,o,h,u,g,b,f){this.elements=[1,0,0,0,1,0,0,0,1],e!=null&&t!=null&&s!=null&&o!=null&&h!=null&&u!=null&&g!=null&&b!=null&&f!=null&&this.set(e,t,s,o,h,u,g,b,f)}set(e,t,s,o,h,u,g,b,f){const A=this.elements;return A[0]=e,A[1]=o,A[2]=g,A[3]=t,A[4]=h,A[5]=b,A[6]=s,A[7]=u,A[8]=f,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],this}extractBasis(e,t,s){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,o=t.elements,h=this.elements,u=s[0],g=s[3],b=s[6],f=s[1],A=s[4],x=s[7],E=s[2],M=s[5],z=s[8],D=o[0],U=o[3],B=o[6],ge=o[1],be=o[4],oe=o[7],W=o[2],ce=o[5],se=o[8];return h[0]=u*D+g*ge+b*W,h[3]=u*U+g*be+b*ce,h[6]=u*B+g*oe+b*se,h[1]=f*D+A*ge+x*W,h[4]=f*U+A*be+x*ce,h[7]=f*B+A*oe+x*se,h[2]=E*D+M*ge+z*W,h[5]=E*U+M*be+z*ce,h[8]=E*B+M*oe+z*se,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],s=e[1],o=e[2],h=e[3],u=e[4],g=e[5],b=e[6],f=e[7],A=e[8];return t*u*A-t*g*f-s*h*A+s*g*b+o*h*f-o*u*b}invert(){const e=this.elements,t=e[0],s=e[1],o=e[2],h=e[3],u=e[4],g=e[5],b=e[6],f=e[7],A=e[8],x=A*u-g*f,E=g*b-A*h,M=f*h-u*b,z=t*x+s*E+o*M;if(z===0)return this.set(0,0,0,0,0,0,0,0,0);const D=1/z;return e[0]=x*D,e[1]=(o*f-A*s)*D,e[2]=(g*s-o*u)*D,e[3]=E*D,e[4]=(A*t-o*b)*D,e[5]=(o*h-g*t)*D,e[6]=M*D,e[7]=(s*b-f*t)*D,e[8]=(u*t-s*h)*D,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e.elements[0]=t[0],e.elements[1]=t[3],e.elements[2]=t[6],e.elements[3]=t[1],e.elements[4]=t[4],e.elements[5]=t[7],e.elements[6]=t[2],e.elements[7]=t[5],e.elements[8]=t[8],this}setUvTransform(e,t,s,o,h,u,g){const b=Math.cos(h),f=Math.sin(h);return this.set(s*b,s*f,-s*(b*u+f*g)+u+e,-o*f,o*b,-o*(-f*u+b*g)+g+t,0,0,1),this}scale(e,t){return this.premultiply(Ji.makeScale(e,t)),this}rotate(e){return this.premultiply(Ji.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ji.makeTranslation(e,t)),this}makeTranslation(e,t){return e instanceof $e?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,s,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,s=e.elements;for(let o=0;o<9;o++)if(t[o]!==s[o])return!1;return!0}fromArray(e,t=0){for(let s=0;s<9;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e}clone(){return new zh().fromArray(this.elements)}};aa.IDENTITY=Object.freeze(new aa);let ki=aa;const Ji=new ki,hn=1e-6,nt=2*Math.PI,Rd={x:0,y:0},wa={x:0,y:0,z:0};class Aa{constructor(){this.equalPointTol=hn,this.equalVectorTol=hn}equalPoint2d(e,t){return new $e(e).sub(t).length()<this.equalPointTol}equalPoint3d(e,t){return new Z(e).sub(t).length()<this.equalPointTol}static equalToZero(e,t=hn){return e<t&&e>-t}static equal(e,t,s=hn){return Math.abs(e-t)<s}static great(e,t,s=hn){return e-t>s}static less(e,t,s=hn){return e-t<s}}const Pa=new Aa;function Sa(i,e,t=!1){const s=i.x,o=i.y;let h=!1;const u=e.length;for(let g=0,b=u-1;g<u;b=g++){const f=e[g].x,A=e[g].y,x=e[b].x,E=e[b].y;let M=A>o!=E>o;t&&(M=A>=o!=E>=o),M&&s<(x-f)*(o-A)/(E-A)+f&&(h=!h)}return h}function Dh(i,e){if(i.length===0||e.length===0)return!1;const t=new _t().setFromPoints(i),s=new _t().setFromPoints(e);if(!t.intersectsBox(s))return!1;for(let o=0;o<i.length;){if(Sa(i[o],e,!0))return!0;o<i.length-1&&Pa.equalPoint2d(i[o+1],i[o])&&++o,++o}return!1}const Rh={isPointInPolygon:Sa,isPolygonIntersect:Dh};function Bh(i,e){const t=[],s=e-1,o=i;for(let h=0;h<=o;h++)t.push(0);for(let h=1;h<=s-o;h++)t.push(h);for(let h=0;h<=o;h++)t.push(s-o+1);return t}function Fh(i,e){const t=e.length-1,s=i,o=[0];let h=0;for(let g=1;g<=t;g++){const b=e[g][0]-e[g-1][0],f=e[g][1]-e[g-1][1],A=e[g][2]-e[g-1][2],x=Math.sqrt(b*b+f*f+A*A);h+=x,o.push(h)}const u=[];for(let g=0;g<=s;g++)u.push(0);for(let g=1;g<=t-s;g++){const b=o[g]/h;u.push(b*(t-s+1))}for(let g=0;g<=s;g++)u.push(t-s+1);return u}function Uh(i,e){const t=e.length-1,s=i,o=[0];let h=0;for(let g=1;g<=t;g++){const b=e[g][0]-e[g-1][0],f=e[g][1]-e[g-1][1],A=e[g][2]-e[g-1][2],x=Math.sqrt(b*b+f*f+A*A),E=Math.sqrt(x);h+=E,o.push(h)}const u=[];for(let g=0;g<=s;g++)u.push(0);for(let g=1;g<=t-s;g++){const b=o[g]/h;u.push(b*(t-s+1))}for(let g=0;g<=s;g++)u.push(t-s+1);return u}function ti(i,e,t,s){if(e===0)return t>=s[i]&&t<s[i+1]?1:0;const o=s[i+e]-s[i],h=s[i+e+1]-s[i+1],u=o>1e-10?(t-s[i])/o:0,g=h>1e-10?(s[i+e+1]-t)/h:0;return u*ti(i,e-1,t,s)+g*ti(i+1,e-1,t,s)}function Ms(i,e,t,s,o){const h=s.length-1,u=e;if(i=Math.max(t[u],Math.min(t[h+1],i)),Math.abs(i-t[h+1])<1e-8)return[...s[h]];if(Math.abs(i-t[u])<1e-8)return[...s[0]];const g=[0,0,0];let b=0;for(let f=0;f<=h;f++){const A=ti(f,u,i,t),x=o[f]*A;g[0]+=s[f][0]*x,g[1]+=s[f][1]*x,g[2]+=s[f][2]*x,b+=x}if(b<1e-10){const f=t[t.length-u-1];if(Math.abs(i-f)<1e-8)return[...s[h]];if(Math.abs(i-t[u])<1e-8)return[...s[0]]}return b>1e-10&&(g[0]/=b,g[1]/=b,g[2]/=b),g}function Vh(i,e,t,s){const o=i,h=e[o],u=e[e.length-o-1];let g=0;const b=1e3,f=(u-h)/b;let A=Ms(h,i,e,t,s);for(let D=1;D<=b;D++){const U=h+D*f,B=Ms(U,i,e,t,s),ge=B[0]-A[0],be=B[1]-A[1],oe=B[2]-A[2];g+=Math.sqrt(ge*ge+be*be+oe*oe),A=B}const x=Ms(u,i,e,t,s),E=x[0]-A[0],M=x[1]-A[1],z=x[2]-A[2];return g+=Math.sqrt(E*E+M*M+z*z),g}function Bd(i){return i.map(e=>[...e])}class Wr{constructor(e=0,t=0,s=0,o=1){this._x=e,this._y=t,this._z=s,this._w=o}static slerpFlat(e,t,s,o,h,u,g){let b=s[o+0],f=s[o+1],A=s[o+2],x=s[o+3];const E=h[u+0],M=h[u+1],z=h[u+2],D=h[u+3];if(g===0){e[t+0]=b,e[t+1]=f,e[t+2]=A,e[t+3]=x;return}if(g===1){e[t+0]=E,e[t+1]=M,e[t+2]=z,e[t+3]=D;return}if(x!==D||b!==E||f!==M||A!==z){let U=1-g;const B=b*E+f*M+A*z+x*D,ge=B>=0?1:-1,be=1-B*B;if(be>Number.EPSILON){const W=Math.sqrt(be),ce=Math.atan2(W,B*ge);U=Math.sin(U*ce)/W,g=Math.sin(g*ce)/W}const oe=g*ge;if(b=b*U+E*oe,f=f*U+M*oe,A=A*U+z*oe,x=x*U+D*oe,U===1-g){const W=1/Math.sqrt(b*b+f*f+A*A+x*x);b*=W,f*=W,A*=W,x*=W}}e[t]=b,e[t+1]=f,e[t+2]=A,e[t+3]=x}static multiplyQuaternionsFlat(e,t,s,o,h,u){const g=s[o],b=s[o+1],f=s[o+2],A=s[o+3],x=h[u],E=h[u+1],M=h[u+2],z=h[u+3];return e[t]=g*z+A*x+b*M-f*E,e[t+1]=b*z+A*E+f*x-g*M,e[t+2]=f*z+A*M+g*E-b*x,e[t+3]=A*z-g*x-b*E-f*M,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,s,o){return this._x=e,this._y=t,this._z=s,this._w=o,this._onChangeCallback(),this}clone(){return new Wr(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const s=e.x,o=e.y,h=e.z,u=e.order,g=Math.cos,b=Math.sin,f=g(s/2),A=g(o/2),x=g(h/2),E=b(s/2),M=b(o/2),z=b(h/2);switch(u){case"XYZ":this._x=E*A*x+f*M*z,this._y=f*M*x-E*A*z,this._z=f*A*z+E*M*x,this._w=f*A*x-E*M*z;break;case"YXZ":this._x=E*A*x+f*M*z,this._y=f*M*x-E*A*z,this._z=f*A*z-E*M*x,this._w=f*A*x+E*M*z;break;case"ZXY":this._x=E*A*x-f*M*z,this._y=f*M*x+E*A*z,this._z=f*A*z+E*M*x,this._w=f*A*x-E*M*z;break;case"ZYX":this._x=E*A*x-f*M*z,this._y=f*M*x+E*A*z,this._z=f*A*z-E*M*x,this._w=f*A*x+E*M*z;break;case"YZX":this._x=E*A*x+f*M*z,this._y=f*M*x+E*A*z,this._z=f*A*z-E*M*x,this._w=f*A*x-E*M*z;break;case"XZY":this._x=E*A*x-f*M*z,this._y=f*M*x-E*A*z,this._z=f*A*z+E*M*x,this._w=f*A*x+E*M*z;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+u)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const s=t/2,o=Math.sin(s);return this._x=e.x*o,this._y=e.y*o,this._z=e.z*o,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,s=t[0],o=t[4],h=t[8],u=t[1],g=t[5],b=t[9],f=t[2],A=t[6],x=t[10],E=s+g+x;if(E>0){const M=.5/Math.sqrt(E+1);this._w=.25/M,this._x=(A-b)*M,this._y=(h-f)*M,this._z=(u-o)*M}else if(s>g&&s>x){const M=2*Math.sqrt(1+s-g-x);this._w=(A-b)/M,this._x=.25*M,this._y=(o+u)/M,this._z=(h+f)/M}else if(g>x){const M=2*Math.sqrt(1+g-s-x);this._w=(h-f)/M,this._x=(o+u)/M,this._y=.25*M,this._z=(b+A)/M}else{const M=2*Math.sqrt(1+x-s-g);this._w=(u-o)/M,this._x=(h+f)/M,this._y=(b+A)/M,this._z=.25*M}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let s=e.dot(t)+1;return s<Number.EPSILON?(s=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=s):(this._x=0,this._y=-e.z,this._z=e.y,this._w=s)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=s),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(kr(this.dot(e),-1,1)))}rotateTowards(e,t){const s=this.angleTo(e);if(s===0)return this;const o=Math.min(1,t/s);return this.slerp(e,o),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const s=e._x,o=e._y,h=e._z,u=e._w,g=t._x,b=t._y,f=t._z,A=t._w;return this._x=s*A+u*g+o*f-h*b,this._y=o*A+u*b+h*g-s*f,this._z=h*A+u*f+s*b-o*g,this._w=u*A-s*g-o*b-h*f,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const s=this._x,o=this._y,h=this._z,u=this._w;let g=u*e._w+s*e._x+o*e._y+h*e._z;if(g<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,g=-g):this.copy(e),g>=1)return this._w=u,this._x=s,this._y=o,this._z=h,this;const b=1-g*g;if(b<=Number.EPSILON){const M=1-t;return this._w=M*u+t*this._w,this._x=M*s+t*this._x,this._y=M*o+t*this._y,this._z=M*h+t*this._z,this.normalize(),this}const f=Math.sqrt(b),A=Math.atan2(f,g),x=Math.sin((1-t)*A)/f,E=Math.sin(t*A)/f;return this._w=u*x+this._w*E,this._x=s*x+this._x*E,this._y=o*x+this._y*E,this._z=h*x+this._z*E,this._onChangeCallback(),this}slerpQuaternions(e,t,s){return this.copy(e).slerp(t,s)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),s=Math.random(),o=Math.sqrt(1-s),h=Math.sqrt(s);return this.set(o*Math.sin(e),o*Math.cos(e),h*Math.sin(t),h*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const Bt=class jh{constructor(e,t,s){this.x=0,this.y=0,this.z=0;const o=+(e!==void 0)+ +(t!==void 0)+ +(s!==void 0);if(o!==0){if(o===1&&e instanceof Array){this.x=e[0],this.y=e[1],this.z=e[2];return}if(o===1){const{x:h,y:u,z:g}=e;this.x=h,this.y=u,this.z=g||0;return}if(o===3){this.x=e,this.y=t,this.z=s;return}throw Ut.ILLEGAL_PARAMETERS}}set(e,t,s){return s===void 0&&(s=this.z),this.x=e,this.y=t,this.z=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new jh(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z||0,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z||0,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Lo.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Lo.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,s=this.y,o=this.z,h=e.elements;return this.x=h[0]*t+h[3]*s+h[6]*o,this.y=h[1]*t+h[4]*s+h[7]*o,this.z=h[2]*t+h[5]*s+h[8]*o,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix3d(e){const t=this.x,s=this.y,o=this.z,h=e.elements,u=1/(h[3]*t+h[7]*s+h[11]*o+h[15]);return this.x=(h[0]*t+h[4]*s+h[8]*o+h[12])*u,this.y=(h[1]*t+h[5]*s+h[9]*o+h[13])*u,this.z=(h[2]*t+h[6]*s+h[10]*o+h[14])*u,this}applyQuaternion(e){const t=this.x,s=this.y,o=this.z,h=e.x,u=e.y,g=e.z,b=e.w,f=2*(u*o-g*s),A=2*(g*t-h*o),x=2*(h*s-u*t);return this.x=t+b*f+u*x-g*A,this.y=s+b*A+g*f-h*x,this.z=o+b*x+h*A-u*f,this}transformDirection(e){const t=this.x,s=this.y,o=this.z,h=e.elements;return this.x=h[0]*t+h[4]*s+h[8]*o,this.y=h[1]*t+h[5]*s+h[9]*o,this.z=h[2]*t+h[6]*s+h[10]*o,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isParallelTo(e){const t=this.dot(e),s=this.length(),o=e.length();return Math.abs(t)===s*o}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this.z=e.z+(t.z-e.z)*s,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const s=e.x,o=e.y,h=e.z,u=t.x,g=t.y,b=t.z;return this.x=o*b-h*g,this.y=h*u-s*b,this.z=s*g-o*u,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const s=e.dot(this)/t;return this.copy(e).multiplyScalar(s)}projectOnPlane(e){return ea.copy(this).projectOnVector(e),this.sub(ea)}reflect(e){return this.sub(ea.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(Math.max(-1,Math.min(1,s)))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y,o=this.z-e.z;return t*t+s*s+o*o}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),s=this.setFromMatrixColumn(e,1).length(),o=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=s,this.z=o,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,s=Math.sqrt(1-t*t);return this.x=s*Math.cos(e),this.y=t,this.z=s*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};Bt.X_AXIS=Object.freeze(new Bt(1,0,0)),Bt.NEGATIVE_X_AXIS=Object.freeze(new Bt(-1,0,0)),Bt.Y_AXIS=Object.freeze(new Bt(0,1,0)),Bt.NEGATIVE_Y_AXIS=Object.freeze(new Bt(0,-1,0)),Bt.Z_AXIS=Object.freeze(new Bt(0,0,1)),Bt.NEGATIVE_Z_AXIS=Object.freeze(new Bt(0,0,-1));let Z=Bt;const ea=new Z,Lo=new Wr,oa=class Gh{constructor(e,t,s,o,h,u,g,b,f,A,x,E,M,z,D,U){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!=null&&t!=null&&s!=null&&o!=null&&h!=null&&u!=null&&g!=null&&b!=null&&f!=null&&A!=null&&x!=null&&E!=null&&M!=null&&z!=null&&D!=null&&U!=null&&this.set(e,t,s,o,h,u,g,b,f,A,x,E,M,z,D,U)}set(e,t,s,o,h,u,g,b,f,A,x,E,M,z,D,U){const B=this.elements;return B[0]=e,B[4]=t,B[8]=s,B[12]=o,B[1]=h,B[5]=u,B[9]=g,B[13]=b,B[2]=f,B[6]=A,B[10]=x,B[14]=E,B[3]=M,B[7]=z,B[11]=D,B[15]=U,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Gh().fromArray(this.elements)}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],t[9]=s[9],t[10]=s[10],t[11]=s[11],t[12]=s[12],t[13]=s[13],t[14]=s[14],t[15]=s[15],this}copyPosition(e){const t=this.elements,s=e.elements;return t[12]=s[12],t[13]=s[13],t[14]=s[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}setFromExtrusionDirection(e){if(Pa.equalPoint3d(e,Z.Z_AXIS))this.identity();else{const t=new Z(1,0,0);Math.abs(e.x)<1/64&&Math.abs(e.y)<1/64?t.crossVectors(Z.Y_AXIS,e).normalize():t.crossVectors(Z.Z_AXIS,e).normalize();const s=e.clone().cross(t).normalize();this.set(t.x,t.y,t.z,0,s.x,s.y,s.z,0,e.x,e.y,e.z,0,0,0,0,1)}return this}extractBasis(e,t,s){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this}makeBasis(e,t,s){return this.set(e.x,t.x,s.x,0,e.y,t.y,s.y,0,e.z,t.z,s.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,s=e.elements,o=1/Ln.setFromMatrixColumn(e,0).length(),h=1/Ln.setFromMatrixColumn(e,1).length(),u=1/Ln.setFromMatrixColumn(e,2).length();return t[0]=s[0]*o,t[1]=s[1]*o,t[2]=s[2]*o,t[3]=0,t[4]=s[4]*h,t[5]=s[5]*h,t[6]=s[6]*h,t[7]=0,t[8]=s[8]*u,t[9]=s[9]*u,t[10]=s[10]*u,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Fd,e,Ud)}lookAt(e,t,s){const o=this.elements;return Rt.subVectors(e,t),Rt.lengthSq()===0&&(Rt.z=1),Rt.normalize(),Ur.crossVectors(s,Rt),Ur.lengthSq()===0&&(Math.abs(s.z)===1?Rt.x+=1e-4:Rt.z+=1e-4,Rt.normalize(),Ur.crossVectors(s,Rt)),Ur.normalize(),js.crossVectors(Rt,Ur),o[0]=Ur.x,o[4]=js.x,o[8]=Rt.x,o[1]=Ur.y,o[5]=js.y,o[9]=Rt.y,o[2]=Ur.z,o[6]=js.z,o[10]=Rt.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,o=t.elements,h=this.elements,u=s[0],g=s[4],b=s[8],f=s[12],A=s[1],x=s[5],E=s[9],M=s[13],z=s[2],D=s[6],U=s[10],B=s[14],ge=s[3],be=s[7],oe=s[11],W=s[15],ce=o[0],se=o[4],Ve=o[8],Ye=o[12],We=o[1],xe=o[5],Le=o[9],dt=o[13],mt=o[2],It=o[6],Je=o[10],at=o[14],Q=o[3],Te=o[7],ot=o[11],hr=o[15];return h[0]=u*ce+g*We+b*mt+f*Q,h[4]=u*se+g*xe+b*It+f*Te,h[8]=u*Ve+g*Le+b*Je+f*ot,h[12]=u*Ye+g*dt+b*at+f*hr,h[1]=A*ce+x*We+E*mt+M*Q,h[5]=A*se+x*xe+E*It+M*Te,h[9]=A*Ve+x*Le+E*Je+M*ot,h[13]=A*Ye+x*dt+E*at+M*hr,h[2]=z*ce+D*We+U*mt+B*Q,h[6]=z*se+D*xe+U*It+B*Te,h[10]=z*Ve+D*Le+U*Je+B*ot,h[14]=z*Ye+D*dt+U*at+B*hr,h[3]=ge*ce+be*We+oe*mt+W*Q,h[7]=ge*se+be*xe+oe*It+W*Te,h[11]=ge*Ve+be*Le+oe*Je+W*ot,h[15]=ge*Ye+be*dt+oe*at+W*hr,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],s=e[4],o=e[8],h=e[12],u=e[1],g=e[5],b=e[9],f=e[13],A=e[2],x=e[6],E=e[10],M=e[14],z=e[3],D=e[7],U=e[11],B=e[15];return z*(+h*b*x-o*f*x-h*g*E+s*f*E+o*g*M-s*b*M)+D*(+t*b*M-t*f*E+h*u*E-o*u*M+o*f*A-h*b*A)+U*(+t*f*x-t*g*M-h*u*x+s*u*M+h*g*A-s*f*A)+B*(-o*g*A-t*b*x+t*g*E+o*u*x-s*u*E+s*b*A)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,s){const o=this.elements;return e instanceof Z?(o[12]=e.x,o[13]=e.y,o[14]=e.z):(o[12]=e,o[13]=t,o[14]=s),this}invert(){const e=this.elements,t=e[0],s=e[1],o=e[2],h=e[3],u=e[4],g=e[5],b=e[6],f=e[7],A=e[8],x=e[9],E=e[10],M=e[11],z=e[12],D=e[13],U=e[14],B=e[15],ge=x*U*f-D*E*f+D*b*M-g*U*M-x*b*B+g*E*B,be=z*E*f-A*U*f-z*b*M+u*U*M+A*b*B-u*E*B,oe=A*D*f-z*x*f+z*g*M-u*D*M-A*g*B+u*x*B,W=z*x*b-A*D*b-z*g*E+u*D*E+A*g*U-u*x*U,ce=t*ge+s*be+o*oe+h*W;if(ce===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const se=1/ce;return e[0]=ge*se,e[1]=(D*E*h-x*U*h-D*o*M+s*U*M+x*o*B-s*E*B)*se,e[2]=(g*U*h-D*b*h+D*o*f-s*U*f-g*o*B+s*b*B)*se,e[3]=(x*b*h-g*E*h-x*o*f+s*E*f+g*o*M-s*b*M)*se,e[4]=be*se,e[5]=(A*U*h-z*E*h+z*o*M-t*U*M-A*o*B+t*E*B)*se,e[6]=(z*b*h-u*U*h-z*o*f+t*U*f+u*o*B-t*b*B)*se,e[7]=(u*E*h-A*b*h+A*o*f-t*E*f-u*o*M+t*b*M)*se,e[8]=oe*se,e[9]=(z*x*h-A*D*h-z*s*M+t*D*M+A*s*B-t*x*B)*se,e[10]=(u*D*h-z*g*h+z*s*f-t*D*f-u*s*B+t*g*B)*se,e[11]=(A*g*h-u*x*h-A*s*f+t*x*f+u*s*M-t*g*M)*se,e[12]=W*se,e[13]=(A*D*o-z*x*o+z*s*E-t*D*E-A*s*U+t*x*U)*se,e[14]=(z*g*o-u*D*o-z*s*b+t*D*b+u*s*U-t*g*U)*se,e[15]=(u*x*o-A*g*o+A*s*b-t*x*b-u*s*E+t*g*E)*se,this}scale(e){const t=this.elements,s=e.x,o=e.y,h=e.z;return t[0]*=s,t[4]*=o,t[8]*=h,t[1]*=s,t[5]*=o,t[9]*=h,t[2]*=s,t[6]*=o,t[10]*=h,t[3]*=s,t[7]*=o,t[11]*=h,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],s=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],o=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,s,o))}makeTranslation(e,t,s){return e instanceof Z?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,s,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),s=Math.sin(e);return this.set(1,0,0,0,0,t,-s,0,0,s,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,0,s,0,0,1,0,0,-s,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,0,s,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const s=Math.cos(t),o=Math.sin(t),h=1-s,u=e.x,g=e.y,b=e.z,f=h*u,A=h*g;return this.set(f*u+s,f*g-o*b,f*b+o*g,0,f*g+o*b,A*g+s,A*b-o*u,0,f*b-o*g,A*b+o*u,h*b*b+s,0,0,0,0,1),this}makeScale(e,t,s){return this.set(e,0,0,0,0,t,0,0,0,0,s,0,0,0,0,1),this}makeShear(e,t,s,o,h,u){return this.set(1,s,h,0,e,1,u,0,t,o,1,0,0,0,0,1),this}compose(e,t,s){const o=this.elements,h=t.x,u=t.y,g=t.z,b=t.w,f=h+h,A=u+u,x=g+g,E=h*f,M=h*A,z=h*x,D=u*A,U=u*x,B=g*x,ge=b*f,be=b*A,oe=b*x,W=s.x,ce=s.y,se=s.z;return o[0]=(1-(D+B))*W,o[1]=(M+oe)*W,o[2]=(z-be)*W,o[3]=0,o[4]=(M-oe)*ce,o[5]=(1-(E+B))*ce,o[6]=(U+ge)*ce,o[7]=0,o[8]=(z+be)*se,o[9]=(U-ge)*se,o[10]=(1-(E+D))*se,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,this}decompose(e,t,s){const o=this.elements;let h=Ln.set(o[0],o[1],o[2]).length();const u=Ln.set(o[4],o[5],o[6]).length(),g=Ln.set(o[8],o[9],o[10]).length();this.determinant()<0&&(h=-h),e.x=o[12],e.y=o[13],e.z=o[14],rr.copy(this);const b=1/h,f=1/u,A=1/g;return rr.elements[0]*=b,rr.elements[1]*=b,rr.elements[2]*=b,rr.elements[4]*=f,rr.elements[5]*=f,rr.elements[6]*=f,rr.elements[8]*=A,rr.elements[9]*=A,rr.elements[10]*=A,t.setFromRotationMatrix(rr),s.x=h,s.y=u,s.z=g,this}equals(e){const t=this.elements,s=e.elements;for(let o=0;o<16;o++)if(t[o]!==s[o])return!1;return!0}fromArray(e,t=0){for(let s=0;s<16;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e[t+9]=s[9],e[t+10]=s[10],e[t+11]=s[11],e[t+12]=s[12],e[t+13]=s[13],e[t+14]=s[14],e[t+15]=s[15],e}};oa.IDENTITY=Object.freeze(new oa);let gn=oa;const Ln=new Z,rr=new gn,Fd=new Z(0,0,0),Ud=new Z(1,1,1),Ur=new Z,js=new Z,Rt=new Z;class Re{constructor(e=void 0,t=void 0){this.min=e==null?new Z(1/0,1/0,1/0):new Z(e.x,e.y,e.z),this.max=t==null?new Z(-1/0,-1/0,-1/0):new Z(t.x,t.y,t.z)}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,s=e.length;t<s;t+=3)this.expandByPoint(ta.fromArray(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,s=e.length;t<s;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const s=ta.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(s),this.max.copy(e).add(s),this}clone(){return new Re().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}get center(){return this.isEmpty()?new Z(0,0,0):new Z(0,0,0).addVectors(this.min,this.max).multiplyScalar(.5)}get size(){return this.isEmpty()?new Z(0,0,0):new Z(0,0,0).subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsPlane(e){let t,s;return e.normal.x>0?(t=e.normal.x*this.min.x,s=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,s=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,s+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,s+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,s+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,s+=e.normal.z*this.min.z),t<=-e.constant&&s>=-e.constant}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ta).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Er[0].set(this.min.x,this.min.y,this.min.z).applyMatrix3d(e),Er[1].set(this.min.x,this.min.y,this.max.z).applyMatrix3d(e),Er[2].set(this.min.x,this.max.y,this.min.z).applyMatrix3d(e),Er[3].set(this.min.x,this.max.y,this.max.z).applyMatrix3d(e),Er[4].set(this.max.x,this.min.y,this.min.z).applyMatrix3d(e),Er[5].set(this.max.x,this.min.y,this.max.z).applyMatrix3d(e),Er[6].set(this.max.x,this.max.y,this.min.z).applyMatrix3d(e),Er[7].set(this.max.x,this.max.y,this.max.z).applyMatrix3d(e),this.setFromPoints(Er),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Er=[new Z,new Z,new Z,new Z,new Z,new Z,new Z,new Z],ta=new Z,Oo=new $e;class _t{constructor(e=void 0,t=void 0){this.min=e==null?new $e(1/0,1/0):new $e(e.x,e.y),this.max=t==null?new $e(-1/0,-1/0):new $e(t.x,t.y)}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,s=e.length;t<s;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const s=Oo.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(s),this.max.copy(e).add(s),this}clone(){return new _t().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}get center(){return this.isEmpty()?new $e(0,0):new $e(0,0).addVectors(this.min,this.max).multiplyScalar(.5)}get size(){return this.isEmpty()?new $e(0,0):new $e(0,0).subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Oo).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const zo=new Z,Vd=new Z,jd=new ki;class zs{constructor(e=new Z(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,s,o){return this.normal.set(e,t,s),this.constant=o,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,s){const o=zo.subVectors(s,t).cross(Vd.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(o,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectsBox(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const s=t||jd.getNormalMatrix(e),o=this.coplanarPoint(zo).applyMatrix3d(e),h=this.normal.applyMatrix3(s).normalize();return this.constant=-o.dot(h),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new zs().copy(this)}}class Me extends $e{static pointArrayToNumberArray(e){const t=new Array(e.length*2);return e.forEach((s,o)=>{s.toArray(t,o*2)}),t}}class $ extends Z{static pointArrayToNumberArray(e,t=!0){const s=t?3:2,o=new Array(e.length*s);return e.forEach((h,u)=>{h.toArray(o,u*s)}),o}}const Do=new gn,Ro=new Wr,Wh=class la{constructor(e=0,t=0,s=0,o=la.DEFAULT_ORDER){this._x=e,this._y=t,this._z=s,this._order=o}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,s,o=this._order){return this._x=e,this._y=t,this._z=s,this._order=o,this._onChangeCallback(),this}clone(){return new la(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,s=!0){const o=e.elements,h=o[0],u=o[4],g=o[8],b=o[1],f=o[5],A=o[9],x=o[2],E=o[6],M=o[10];switch(t){case"XYZ":this._y=Math.asin(kr(g,-1,1)),Math.abs(g)<.9999999?(this._x=Math.atan2(-A,M),this._z=Math.atan2(-u,h)):(this._x=Math.atan2(E,f),this._z=0);break;case"YXZ":this._x=Math.asin(-kr(A,-1,1)),Math.abs(A)<.9999999?(this._y=Math.atan2(g,M),this._z=Math.atan2(b,f)):(this._y=Math.atan2(-x,h),this._z=0);break;case"ZXY":this._x=Math.asin(kr(E,-1,1)),Math.abs(E)<.9999999?(this._y=Math.atan2(-x,M),this._z=Math.atan2(-u,f)):(this._y=0,this._z=Math.atan2(b,h));break;case"ZYX":this._y=Math.asin(-kr(x,-1,1)),Math.abs(x)<.9999999?(this._x=Math.atan2(E,M),this._z=Math.atan2(b,h)):(this._x=0,this._z=Math.atan2(-u,f));break;case"YZX":this._z=Math.asin(kr(b,-1,1)),Math.abs(b)<.9999999?(this._x=Math.atan2(-A,f),this._y=Math.atan2(-x,h)):(this._x=0,this._y=Math.atan2(g,M));break;case"XZY":this._z=Math.asin(-kr(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(E,f),this._y=Math.atan2(g,h)):(this._x=Math.atan2(-A,M),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,s===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,s=!0){return Do.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Do,t,s)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Ro.setFromEuler(this),this.setFromQuaternion(Ro,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Wh.DEFAULT_ORDER="XYZ";let Hh=Wh;class qh{constructor(){this._boundingBoxNeedsUpdate=!1}get boundingBoxNeedUpdate(){return this._boundingBoxNeedsUpdate}}class Ia extends qh{translate(e){return this.transform(new ki().makeTranslation(e.x,e.y))}get box(){return(this._box==null||this._boundingBoxNeedsUpdate)&&(this._box=this.calculateBoundingBox(),this._boundingBoxNeedsUpdate=!1),this._box}}class Mi extends Ia{constructor(){super(),this._loops=[]}add(e){this._loops.push(e),this._boundingBoxNeedsUpdate=!0}get loops(){return this._loops}get outter(){if(this._loops.length>0)return this._loops[0]}calculateBoundingBox(){const e=this.outter;return e?e.box:new _t}transform(e){return this._boundingBoxNeedsUpdate=!0,this}getPoints(e){const t=[];for(let s=0;s<this.loops.length;++s){const o=this.loops[s].getPoints(e);t.push(o)}return t}buildHierarchy(){var e;const t=this.getPoints(100),s=this.calculateBoundaryBoxes(t),o=this.sortBoundaryBoxesByAreas(s),h=new Map,u=o.length;for(let b=0;b<u;b++)h.set(o[b],{index:o[b],children:[]});const g={index:-1,children:[]};for(let b=0;b<u;b++){const f=o[b],A=t[f],x=s[f];let E=b+1;for(;E<u;E++){const M=o[E],z=t[M];if(s[M].containsBox(x)&&Rh.isPointInPolygon(A[Ee.randInt(0,A.length-1)],z)){(e=h.get(M))==null||e.children.push(h.get(f));break}}E===u&&g.children.push(h.get(f))}return g}calculateBoundaryBoxes(e){const t=[];return e.forEach(s=>{t.push(new _t().setFromPoints(s))}),t}sortBoundaryBoxesByAreas(e){const t=[];e.forEach((o,h)=>{const u=o.size,g=u.width*u.height;t.push({area:g,index:h})}),t.sort((o,h)=>o.area-h.area);const s=[];return t.forEach(o=>{s.push(o.index)}),s}}class Un extends Ia{constructor(){super(),this.arcLengthDivisions=100}get startPoint(){return this.getPoint(0)}get endPoint(){return this.getPoint(1)}get length(){return this.getLength()}getPoint(e){throw new Error("AcGeCurve2d: .getPoint() not implemented.")}getPointAt(e){const t=this.getUtoTmapping(e);return this.getPoint(t)}getPoints(e=5){const t=[];for(let s=0;s<=e;s++)t.push(this.getPoint(s/e));return t}getSpacedPoints(e=5){const t=[];for(let s=0;s<=e;s++)t.push(this.getPointAt(s/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){const t=[];let s,o=this.getPoint(0),h=0;t.push(0);for(let u=1;u<=e;u++)s=this.getPoint(u/e),h+=s.distanceTo(o),t.push(h),o=s;return t}getUtoTmapping(e,t){const s=this.getLengths();let o=0;const h=s.length;let u;t?u=t:u=e*s[h-1];let g=0,b=h-1,f;for(;g<=b;)if(o=Math.floor(g+(b-g)/2),f=s[o]-u,f<0)g=o+1;else if(f>0)b=o-1;else{b=o;break}if(o=b,s[o]===u)return o/(h-1);const A=s[o],x=s[o+1]-A,E=(u-A)/x;return(o+E)/(h-1)}getTangent(e){let t=e-1e-4,s=e+1e-4;t<0&&(t=0),s>1&&(s=1);const o=this.getPoint(t),h=this.getPoint(s),u=new Me;return u.copy(h).sub(o).normalize(),u}getTangentAt(e){const t=this.getUtoTmapping(e);return this.getTangent(t)}}class Dn extends Un{constructor(e,t,s,o,h){super();const u=+(e!==void 0)+ +(t!==void 0)+ +(s!==void 0)+ +(o!==void 0)+ +(h!==void 0);if(u==3)typeof e=="object"&&typeof t=="object"&&typeof s=="object"?this.createByThreePoints(e,t,s):this.createByStartEndPointsAndBulge(e,t,s);else if(u==5){const g=e;this.center=new Me(g.x,g.y),this.radius=t,this._clockwise=h,this._startAngle=this._clockwise?this._mirrorAngle(Ee.normalizeAngle(s)):Ee.normalizeAngle(s),this._endAngle=this._clockwise?this._mirrorAngle(Ee.normalizeAngle(o)):Ee.normalizeAngle(o)}else throw Ut.ILLEGAL_PARAMETERS}createByThreePoints(e,t,s){const o=(se,Ve)=>({x:(se.x+Ve.x)/2,y:(se.y+Ve.y)/2}),h=(se,Ve)=>(Ve.y-se.y)/(Ve.x-se.x),u=se=>-1/se,g=o(e,t),b=o(t,s),f=h(e,t),A=h(t,s),x=u(f),E=u(A),M=(se,Ve,Ye,We)=>{const xe=(We-Ve)/(se-Ye),Le=se*xe+Ve;return{x:xe,y:Le}},z=g.y-x*g.x,D=b.y-E*b.x,U=M(x,z,E,D),B=Math.sqrt(Math.pow(e.x-U.x,2)+Math.pow(e.y-U.y,2)),ge=(se,Ve)=>Math.atan2(se.y-Ve.y,se.x-Ve.x),be=ge(e,U),oe=ge(t,U),W=ge(s,U),ce=W>be&&W<oe||be>W&&be<oe||oe>W&&oe<be;this.center=U,this.radius=B,this._clockwise=!ce,this._startAngle=be,this._endAngle=W}createByStartEndPointsAndBulge(e,t,s){let o,h,u;s<0?(o=Math.atan(-s)*4,h=new $e(e),u=new $e(t)):(o=Math.atan(s)*4,h=new $e(t),u=new $e(e));const g=new $e().subVectors(u,h),b=g.length(),f=new $e().addVectors(h,g.multiplyScalar(.5)),A=Math.abs(b/2/Math.tan(o/2)),x=g.normalize();let E;if(o<Math.PI){const M=new $e(x.x*Math.cos(Math.PI/2)-x.y*Math.sin(Math.PI/2),x.y*Math.cos(Math.PI/2)+x.x*Math.sin(Math.PI/2));E=f.add(M.multiplyScalar(-A))}else{const M=new $e(x.x*Math.cos(Math.PI/2)-x.y*Math.sin(Math.PI/2),x.y*Math.cos(Math.PI/2)+x.x*Math.sin(Math.PI/2));E=f.add(M.multiplyScalar(A))}s<0?(this._startAngle=Math.atan2(h.y-E.y,h.x-E.x),this._endAngle=Math.atan2(u.y-E.y,u.x-E.x)):(this._startAngle=Math.atan2(u.y-E.y,u.x-E.x),this._endAngle=Math.atan2(h.y-E.y,h.x-E.x)),this._clockwise=s<0,this.center=E,this.radius=u.sub(E).length()}get center(){return this._center}set center(e){this._center=new Me(e.x,e.y),this._boundingBoxNeedsUpdate=!0}get radius(){return this._radius}set radius(e){this._radius=e,this._boundingBoxNeedsUpdate=!0}get startAngle(){return this._clockwise?this._mirrorAngle(this._startAngle):this._startAngle}set startAngle(e){this._startAngle=this._clockwise?this._mirrorAngle(Ee.normalizeAngle(e)):Ee.normalizeAngle(e),this._boundingBoxNeedsUpdate=!0}get endAngle(){return this._clockwise?this._mirrorAngle(this._endAngle):this._endAngle}set endAngle(e){const t=this.startAngle==0&&e==nt?e:Ee.normalizeAngle(e);this._endAngle=this._clockwise?this._mirrorAngle(t):t,this._boundingBoxNeedsUpdate=!0}_mirrorAngle(e){return(360-e*180/Math.PI)%360*Math.PI/180}_getInternalAngle(e){return this._clockwise?this._mirrorAngle(e):e}get deltaAngle(){const e=this._getInternalAngle(this.startAngle),t=this._getInternalAngle(this.endAngle);return this.clockwise?Ee.normalizeAngle(e-t):Ee.normalizeAngle(t-e)}get clockwise(){return this._clockwise}set clockwise(e){this._clockwise=e,this._boundingBoxNeedsUpdate=!0}get startPoint(){return this.getPointAtAngle(this.startAngle)}get endPoint(){return this.getPointAtAngle(this.endAngle)}get midPoint(){const e=this._getInternalAngle(this.startAngle),t=this._getInternalAngle(this.endAngle),s=Ee.normalizeAngle((e+t)/2),o=this._clockwise?this._mirrorAngle(s):s;return this.getPointAtAngle(o)}get closed(){const e=this._getInternalAngle(this.startAngle),t=this._getInternalAngle(this.endAngle);return Math.abs(t-e)/Math.PI%2==0}calculateBoundingBox(){const e=[this.startPoint,this.endPoint],t=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const h of t){const u=this._getInternalAngle(h);Ee.isBetweenAngle(u,this._getInternalAngle(this.startAngle),this._getInternalAngle(this.endAngle),this.clockwise)&&e.push(this.getPointAtAngle(h))}const s=e.map(h=>h.x),o=e.map(h=>h.y);return new _t(new Me(Math.min(...s),Math.min(...o)),new Me(Math.max(...s),Math.max(...o)))}get length(){return Math.abs(this.deltaAngle*this.radius)}transform(e){return this._boundingBoxNeedsUpdate=!0,this}clone(){return new Dn(this.center.clone(),this.radius,this._startAngle,this._endAngle,this.clockwise)}getPointAtAngle(e){const t=this._getInternalAngle(e),s=this.center.x+this.radius*Math.cos(t),o=this.center.y+this.radius*Math.sin(t);return new Me(s,o)}getPoints(e=100){const t=[];let s=this.deltaAngle,o=this._getInternalAngle(this.startAngle);if(this.closed&&(s=nt,o=0),this.clockwise)for(let h=0;h<=e;h++){const u=o-s*(h/e),g=this._clockwise?this._mirrorAngle(u):u,b=this.getPointAtAngle(g);t.push(new Me(b.x,b.y))}else for(let h=0;h<=e;h++){const u=o+s*(h/e),g=this._clockwise?this._mirrorAngle(u):u,b=this.getPointAtAngle(g);t.push(new Me(b.x,b.y))}return t}}class Gd extends qh{translate(e){return this.transform(new gn().makeTranslation(e.x,e.y,e.z))}get box(){return(this._box==null||this._boundingBoxNeedsUpdate)&&(this._box=this.calculateBoundingBox(),this._boundingBoxNeedsUpdate=!1),this._box}}class Ds extends Gd{}class Hr extends Ds{constructor(e,t){super(),this._start=new $(e),this._end=new $(t)}get startPoint(){return this._start}set startPoint(e){this._start.copy(e),this._boundingBoxNeedsUpdate=!0}get endPoint(){return this._end}set endPoint(e){this._end.copy(e),this._boundingBoxNeedsUpdate=!0}get direction(){return new Z().subVectors(this.endPoint,this.startPoint).normalize()}get midPoint(){return new $((this._start.x+this._end.x)/2,(this._start.y+this._end.y)/2,(this._start.z+this._end.z)/2)}get length(){return this.startPoint.distanceTo(this.endPoint)}isPointOnLine(e){return this.project(e).distanceTo(e)<1e-6}at(e,t){return this.delta(t).multiplyScalar(e).add(this._start)}atLength(e,t=!1){if(t){const s=this.delta(ln).normalize();return new $(this._start).addScaledVector(s,e)}else{const s=this.delta(ln).normalize();return new $(this._end).addScaledVector(s,e)}}extend(e,t=!1){if(t){const s=ln.subVectors(this._start,this._end).normalize();this._start=new $(this._start).addScaledVector(s,e)}else{const s=this.delta(ln).normalize();this._end=new $(this._end).addScaledVector(s,e)}return this._boundingBoxNeedsUpdate=!0,this}closestPointToPointParameter(e,t){Bo.subVectors(e,this._start),Gs.subVectors(this.endPoint,this.startPoint);const s=Gs.dot(Gs);let o=Gs.dot(Bo)/s;return t&&(o=Ee.clamp(o,0,1)),o}closestPointToPoint(e,t,s){const o=this.closestPointToPointParameter(e,t);return this.delta(s).multiplyScalar(o).add(this._start)}delta(e){return e.subVectors(this._end,this._start)}distanceSq(){return this._start.distanceToSquared(this._end)}distance(){return this._start.distanceTo(this._end)}project(e){const t=this.direction,s=ln.subVectors(e,this.startPoint).dot(t);return new $().copy(t).multiplyScalar(s).add(this.startPoint)}perpPoint(e){const t=this.direction,s=this.startPoint,o=ln.subVectors(e,s).dot(t),h=ln.copy(t).multiplyScalar(o);return new $().addVectors(s,h)}calculateBoundingBox(){const e=new $(Math.min(this._start.x,this._end.x),Math.min(this._start.y,this._end.y),Math.min(this._start.z,this._end.z)),t=new $(Math.max(this._start.x,this._end.x),Math.max(this._start.y,this._end.y),Math.max(this._start.z,this._end.z));return new Re(e,t)}transform(e){return this._start.applyMatrix3d(e),this._end.applyMatrix3d(e),this._boundingBoxNeedsUpdate=!0,this}get closed(){return!1}copy(e){return this.startPoint=e.startPoint,this.endPoint=e.endPoint,this._boundingBoxNeedsUpdate=!0,this}clone(){return new Hr(this._start.clone(),this._end.clone())}}const ln=new Z,Bo=new Z,Gs=new Z;class mn extends Ds{static computeCenterPoint(e,t,s){const o=new Z().addVectors(e,t).multiplyScalar(.5),h=new Z().addVectors(e,s).multiplyScalar(.5),u=new Z().subVectors(t,e),g=new Z().subVectors(s,e),b=new Z().crossVectors(u,g).normalize();if(b.lengthSq()===0)return console.error("Points are collinear and cannot form a valid arc."),null;const f=new Z().crossVectors(u,b).normalize(),A=new Z().crossVectors(g,b).normalize(),x=f.clone().multiplyScalar(Number.MAX_SAFE_INTEGER),E=A.clone().multiplyScalar(Number.MAX_SAFE_INTEGER),M=new Hr(o,o.clone().add(x)),z=new Hr(h,h.clone().add(E)),D=new Z;return M.closestPointToPoint(z.startPoint,!0,D)?D:(console.error("Cannot find a valid center for the arc."),null)}static createByThreePoints(e,t,s){const o=mn.computeCenterPoint(e,t,s);if(o){const h=o.distanceTo(e),u=new Z().subVectors(e,o),g=new Z().subVectors(t,o),b=Math.atan2(u.y,u.x),f=Math.atan2(g.y,g.x);return new mn(o,h,b,f,Z.Z_AXIS)}}constructor(e,t,s,o,h,u=Z.X_AXIS){super(),this.center=e,this.radius=t,this.startAngle=s,this.endAngle=o,this.normal=h,this.refVec=u,(o-s)%nt==0?(this.startAngle=0,this.endAngle=nt):(this.startAngle=s,this.endAngle=o)}get center(){return this._center}set center(e){this._center=new $(e.x,e.y,e.z||0),this._boundingBoxNeedsUpdate=!0}get radius(){return this._radius}set radius(e){if(e<0)throw Ut.ILLEGAL_PARAMETERS;this._radius=e,this._boundingBoxNeedsUpdate=!0}get startAngle(){return this._startAngle}set startAngle(e){this._startAngle=Ee.normalizeAngle(e),this._boundingBoxNeedsUpdate=!0}get endAngle(){return this._endAngle}set endAngle(e){this._endAngle=this.startAngle==0&&e==nt?e:Ee.normalizeAngle(e),this._boundingBoxNeedsUpdate=!0}get deltaAngle(){return Ee.normalizeAngle(this.endAngle-this.startAngle)}get isLargeArc(){return Math.abs(this.deltaAngle)>Math.PI?1:0}get clockwise(){return this.deltaAngle<=0}get normal(){return this._normal}set normal(e){this._normal=new Z(e.x,e.y,e.z),this._normal.normalize(),this._boundingBoxNeedsUpdate=!0}get refVec(){return this._refVec}set refVec(e){this._refVec=new Z(e.x,e.y,e.z),this._refVec.normalize(),this._boundingBoxNeedsUpdate=!0}get startPoint(){return this.getPointAtAngle(this._startAngle)}get endPoint(){return this.getPointAtAngle(this._endAngle)}get length(){return Math.abs(this.deltaAngle*this.radius)}calculateBoundingBox(){const e=[this.startAngle,this.endAngle];for(let b=0;b<2*Math.PI;b+=Math.PI/2)Ee.isBetweenAngle(b,this.startAngle,this.endAngle)&&e.push(b);let t=1/0,s=1/0,o=1/0,h=-1/0,u=-1/0,g=-1/0;for(const b of e){const f=this.getPointAtAngle(b);f.x<t&&(t=f.x),f.y<s&&(s=f.y),f.z<o&&(o=f.z),f.x>h&&(h=f.x),f.y>u&&(u=f.y),f.z>g&&(g=f.z)}return new Re({x:t,y:s,z:o},{x:h,y:u,z:g})}get closed(){return Math.abs(this.endAngle-this.startAngle)/Math.PI%2==0}getPoints(e){const t=[];let s=this.deltaAngle,o=this.startAngle;this.closed&&(s=nt,o=0);for(let h=0;h<=e;h++){const u=o+s*(h/e),g=this.getPointAtAngle(u);t.push(g)}return t}transform(e){const t=ra.copy(this.refVec).applyAxisAngle(this.normal,this.startAngle).multiplyScalar(this.radius),s=ra.copy(this.refVec).applyAxisAngle(this.normal,this.endAngle).multiplyScalar(this.radius);return this.center.applyMatrix3d(e),t.applyMatrix3d(e),s.applyMatrix3d(e),this.normal.applyMatrix3d(e).normalize(),this.refVec.applyMatrix3d(e).normalize(),this.startAngle=this.getAngle(t),this.endAngle=this.getAngle(s),this._boundingBoxNeedsUpdate=!0,this}copy(e){return this.center=e.center,this.radius=e.radius,this.startAngle=e.startAngle,this.endAngle=e.endAngle,this.normal=e.normal,this.refVec=e.refVec,this._boundingBoxNeedsUpdate=!0,this}clone(){return new mn(this.center.clone(),this.radius,this.startAngle,this.endAngle,this.normal,this.refVec)}getAngle(e){return e.sub(this.center),Math.atan2(e.dot(ra.crossVectors(this.refVec,this.normal)),e.dot(this.refVec))}getPointAtAngle(e){const t=this.normal,s=this.refVec,o={x:t.y*s.z-t.z*s.y,y:t.z*s.x-t.x*s.z,z:t.x*s.y-t.y*s.x},h=this.center,u=this.radius;return new $(h.x+u*(s.x*Math.cos(e)+o.x*Math.sin(e)),h.y+u*(s.y*Math.cos(e)+o.y*Math.sin(e)),h.z+u*(s.z*Math.cos(e)+o.z*Math.sin(e)))}get plane(){const e=new Z(this.center).distanceTo(wa);return new zs(this.normal,e)}}const ra=new Z;class Ti extends Un{constructor(e,t,s,o=0,h=nt,u=!1,g=0){super(),this.center=e,this.majorAxisRadius=t,this.minorAxisRadius=s,(h-o)%nt==0?(this.startAngle=0,this.endAngle=nt):(this.startAngle=o,this.endAngle=h),this.clockwise=u,this.rotation=g}get center(){return this._center}set center(e){this._center=new $(e.x,e.y,e.z||0),this._boundingBoxNeedsUpdate=!0}get majorAxisRadius(){return this._majorAxisRadius}set majorAxisRadius(e){if(e<0)throw Ut.ILLEGAL_PARAMETERS;this._majorAxisRadius=e,this._boundingBoxNeedsUpdate=!0}get minorAxisRadius(){return this._minorAxisRadius}set minorAxisRadius(e){if(e<0)throw Ut.ILLEGAL_PARAMETERS;this._minorAxisRadius=e,this._boundingBoxNeedsUpdate=!0}get startAngle(){return this._startAngle}set startAngle(e){this._startAngle=Ee.normalizeAngle(e),this._boundingBoxNeedsUpdate=!0}get endAngle(){return this._endAngle}set endAngle(e){this._endAngle=this.startAngle==0&&e==nt?e:Ee.normalizeAngle(e),this._boundingBoxNeedsUpdate=!0}get clockwise(){return this._clockwise}set clockwise(e){this._clockwise=e,this._boundingBoxNeedsUpdate=!0}get rotation(){return this._rotation}set rotation(e){this._rotation=e,this._boundingBoxNeedsUpdate=!0}get deltaAngle(){return Ee.normalizeAngle(this.endAngle-this.startAngle)}get isLargeArc(){return Math.abs(this.deltaAngle)>Math.PI?1:0}calculateBoundingBox(){let e=1/0,t=1/0,s=-1/0,o=-1/0;for(let h=0;h<=100;h++){const u=this.getPoint(h/100);e=Math.min(e,u.x),t=Math.min(t,u.y),s=Math.max(s,u.x),o=Math.max(o,u.y)}return new _t({x:e,y:t},{x:s,y:o})}get closed(){return this.deltaAngle==0}getPoint(e){const t=Math.PI*2;let s=this.endAngle-this.startAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=t;for(;s>t;)s-=t;s<Number.EPSILON&&(o?s=0:s=t),this.clockwise===!0&&!o&&(s===t?s=-t:s=s-t);const h=this.startAngle+e*s;let u=this.center.x+this.majorAxisRadius*Math.cos(h),g=this.center.y+this.minorAxisRadius*Math.sin(h);if(this.rotation!==0){const b=Math.cos(this.rotation),f=Math.sin(this.rotation),A=u-this.center.x,x=g-this.center.y;u=A*b-x*f+this.center.x,g=A*f+x*b+this.center.y}return new Me(u,g)}transform(e){return this._boundingBoxNeedsUpdate=!0,this}copy(e){return this.center=e.center,this.majorAxisRadius=e.majorAxisRadius,this.minorAxisRadius=e.minorAxisRadius,this.startAngle=e.startAngle,this.endAngle=e.endAngle,this.clockwise=e.clockwise,this.rotation=e.rotation,this}clone(){return new Ti(this.center,this.majorAxisRadius,this.minorAxisRadius,this.startAngle,this.endAngle,this.clockwise,this.rotation)}}class Ci extends Ds{constructor(e,t,s,o,h,u=0,g=nt){super(),this.center=e,this.normal=t,this.majorAxis=s,this.majorAxisRadius=o,this.minorAxisRadius=h;const b=Math.abs(g-u);Math.abs(b-nt)<1e-10||Math.abs(b-2*nt)<1e-10?(this.startAngle=0,this.endAngle=nt):(this.startAngle=u,this.endAngle=g)}get center(){return this._center}set center(e){this._center=new $(e.x,e.y,e.z||0),this._boundingBoxNeedsUpdate=!0}get majorAxisRadius(){return this._majorAxisRadius}set majorAxisRadius(e){if(e<0)throw Ut.ILLEGAL_PARAMETERS;this._majorAxisRadius=e,this._boundingBoxNeedsUpdate=!0}get minorAxisRadius(){return this._minorAxisRadius}set minorAxisRadius(e){if(e<0)throw Ut.ILLEGAL_PARAMETERS;this._minorAxisRadius=e,this._boundingBoxNeedsUpdate=!0}get startAngle(){return this._startAngle}set startAngle(e){this._startAngle=Ee.normalizeAngle(e),this._boundingBoxNeedsUpdate=!0}get endAngle(){return this._endAngle}set endAngle(e){this._endAngle=this.startAngle==0&&e==nt?e:Ee.normalizeAngle(e),this._boundingBoxNeedsUpdate=!0}get deltaAngle(){const e=this.endAngle-this.startAngle;return Math.abs(e-nt)<1e-10?nt:Ee.normalizeAngle(e)}get isLargeArc(){return Math.abs(this.deltaAngle)>Math.PI?1:0}get clockwise(){return this.deltaAngle<=0}get normal(){return this._normal}set normal(e){this._normal=new Z(e.x,e.y,e.z),this._normal.normalize(),this._boundingBoxNeedsUpdate=!0}get majorAxis(){return this._majorAxis}set majorAxis(e){this._majorAxis=new Z(e.x,e.y,e.z),this._majorAxis.normalize(),this._boundingBoxNeedsUpdate=!0}get minorAxis(){return new Z().crossVectors(this.normal,this.majorAxis).normalize()}get startPoint(){return this.getPointAtAngle(this._startAngle)}get endPoint(){return this.getPointAtAngle(this._endAngle)}get isCircular(){return Aa.equal(this.majorAxisRadius,this.minorAxisRadius)}get length(){if(this.isCircular)return this.majorAxisRadius*Math.abs(this.deltaAngle);const e=1e3,t=this.deltaAngle/e;let s=0,o=this.getPointAtAngle(this.startAngle);for(let h=1;h<=e;h++){const u=this.startAngle+h*t,g=this.getPointAtAngle(u),b=g.x-o.x,f=g.y-o.y,A=g.z-o.z;s+=Math.sqrt(b*b+f*f+A*A),o=g}return s}calculateBoundingBox(){if(this.majorAxis.equals(Z.X_AXIS)||this.majorAxis.equals(Z.Y_AXIS)||this.majorAxis.isParallelTo(Z.X_AXIS)||this.majorAxis.isParallelTo(Z.Y_AXIS)){const e=[this.startAngle,this.endAngle];for(let b=0;b<2*Math.PI;b+=Math.PI/2)Ee.isBetweenAngle(b,this.startAngle,this.endAngle)&&e.push(b);let t=1/0,s=1/0,o=1/0,h=-1/0,u=-1/0,g=-1/0;for(const b of e){const f=this.getPointAtAngle(b);f.x<t&&(t=f.x),f.y<s&&(s=f.y),f.z<o&&(o=f.z),f.x>h&&(h=f.x),f.y>u&&(u=f.y),f.z>g&&(g=f.z)}return new Re({x:t,y:s,z:o},{x:h,y:u,z:g})}else{let e=1/0,t=1/0,s=1/0,o=-1/0,h=-1/0,u=-1/0;for(let g=0;g<=100;g++){const b=this.startAngle+this.deltaAngle*(g/100),f=this.getPointAtAngle(b);e=Math.min(e,f.x),t=Math.min(t,f.y),s=Math.min(s,f.z),o=Math.max(o,f.x),h=Math.max(h,f.y),u=Math.max(u,f.z)}return new Re({x:e,y:t,z:s},{x:o,y:h,z:u})}}get closed(){return this.deltaAngle==0}getPoints(e=100){const t=[];let s=this.deltaAngle,o=this.startAngle;this.closed&&(s=nt,o=0);for(let h=0;h<=e;h++){const u=o+s*(h/e),g=this.getPointAtAngle(u);t.push(g)}return t}getPointAtAngle(e){const t=Math.cos(e),s=Math.sin(e),o=this.minorAxis.clone().multiplyScalar(this.minorAxisRadius).multiplyScalar(s),h=this.majorAxis.clone().multiplyScalar(t*this.majorAxisRadius).add(o);return new $(this.center.x+h.x,this.center.y+h.y,this.center.z+h.z)}contains(e){const t=new Z(e).sub(this.center),s=t.dot(this.majorAxis),o=t.dot(this.minorAxis),h=s/this.majorAxisRadius,u=o/this.minorAxisRadius;return h*h+u*u<=1}transform(e){return this._boundingBoxNeedsUpdate=!0,this}copy(e){return this.center=e.center,this.normal=e.normal,this.majorAxis=e.majorAxis,this.majorAxisRadius=e.majorAxisRadius,this.minorAxisRadius=e.minorAxisRadius,this.startAngle=e.startAngle,this.endAngle=e.endAngle,this._boundingBoxNeedsUpdate=!0,this}clone(){return new Ci(this.center,this.normal,this.majorAxis,this.majorAxisRadius,this.minorAxisRadius,this.startAngle,this.endAngle)}get plane(){const e=new Z(this.center).distanceTo(wa);return new zs(this.normal,e)}}class Rs extends Un{constructor(e=null,t=!1){super(),this._vertices=e||new Array,this._closed=t}get numberOfVertices(){return this._vertices.length}get closed(){return this._closed}get startPoint(){if(this.numberOfVertices>0){const e=this._vertices[0];return new Me(e.x,e.y)}throw new Error("Start point does not exist in an empty polyline.")}get endPoint(){const e=this.numberOfVertices;if(e>0)if(this.closed){const t=this._vertices[0];return new Me(t.x,t.y)}else{const t=this._vertices[e-1];return new Me(t.x,t.y)}throw new Error("End point does not exist in an empty polyline.")}get length(){let e=0;const t=this._vertices.length;for(let s=0;s<t;++s){const o=this._vertices[s];let h=null;if(s<t-1?h=this._vertices[s+1]:s==t-1&&this.closed&&(h=this._vertices[0]),h)if(o.bulge){const u=new Dn(o,h,o.bulge);e+=u.length}else e+=new Me(o.x,o.y).distanceTo(h)}return e}set closed(e){this._closed=e,this._boundingBoxNeedsUpdate=!0}addVertexAt(e,t){e<=0?this._vertices.unshift(t):this._vertices.splice(e,0,t),this._boundingBoxNeedsUpdate=!0}getPointAt(e){const t=this._vertices[e];return new Me(t.x,t.y)}calculateBoundingBox(){const e=this.getPoints(100);return new _t().setFromPoints(e)}transform(e){return this._boundingBoxNeedsUpdate=!0,this}getPoints3d(e,t){const s=[];return this.getPoints(e).forEach(o=>s.push(new $().set(o.x,o.y,t))),s}getPoints(e){const t=[],s=this._vertices.length;for(let o=0;o<s;++o){const h=this._vertices[o];if(h.bulge){let u=null;if(o<s-1?u=this._vertices[o+1]:o==s-1&&this.closed&&(u=this._vertices[0]),u){const g=new Dn(h,u,h.bulge).getPoints(e),b=g.length;for(let f=0;f<b;++f){const A=g[f];t.push(new Me(A.x,A.y))}}}else t.push(new Me(h.x,h.y)),o==s-1&&this.closed&&t.push(t[0])}return t}}class Ni extends Un{constructor(e,t){super(),this._start=new Me(e),this._end=new Me(t)}get startPoint(){return this._start}set startPoint(e){this._start.copy(e),this._boundingBoxNeedsUpdate=!0}get endPoint(){return this._end}set endPoint(e){this._end.copy(e),this._boundingBoxNeedsUpdate=!0}getPoints(){return[this.startPoint,this.endPoint]}get length(){return this.startPoint.distanceTo(this.endPoint)}calculateBoundingBox(){const e=new Me(Math.min(this._start.x,this._end.x),Math.min(this._start.y,this._end.y)),t=new Me(Math.max(this._start.x,this._end.x),Math.max(this._start.y,this._end.y));return new _t(e,t)}transform(e){return this._start.applyMatrix2d(e),this._end.applyMatrix2d(e),this._boundingBoxNeedsUpdate=!0,this}get closed(){return!1}copy(e){return this.startPoint=e.startPoint,this.endPoint=e.endPoint,this._boundingBoxNeedsUpdate=!0,this}clone(){return new Ni(this._start.clone(),this._end.clone())}}class Yh extends Un{constructor(e=[]){super(),this._curves=e}get curves(){return this._curves}add(e){this._curves.push(e),this._boundingBoxNeedsUpdate=!0}get numberOfEdges(){return this._curves.length}get startPoint(){if(this._curves.length>0){const e=this._curves[0].startPoint;return new Me(e.x,e.y)}throw new Error("Start point does not exist in an empty loop.")}get endPoint(){return this.startPoint}get length(){let e=0;return this._curves.forEach(t=>{e+=t.length}),e}calculateBoundingBox(){const e=this.getPoints(100),t=new _t;return t.setFromPoints(e),t}transform(e){return this._boundingBoxNeedsUpdate=!0,this}get closed(){return!0}getPoints(e){const t=[];return this.curves.forEach(s=>{s.getPoints(e).forEach(o=>{t.push(new Me(o.x,o.y))})}),t}}function Wd(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Xh={exports:{}};(function(i,e){(function(t){i.exports=t()})(function(){var t={},s=this;new Function("try {return this===window;}catch(e){ return false;}");var o=new Function("try {return this===global;}catch(e){return false;}"),h=new Function("try {return typeof importScripts === 'function';}catch(e){return false;}");if(o()&&h(),o()||h()){var u=s;if(h()){var g=function(b,f){var A=s;return b.split(".").forEach(function(x){A&&(A=A[x])}),A?A[f]:null};onmessage=function(b){if(!(!b.data.className||!b.data.methodName)){var f=g(b.data.className,b.data.methodName);if(!f)return console.error("could not find "+b.data.className+"."+b.data.methodName);postMessage({result:f.apply(null,b.data.args),id:b.data.id})}}}}return function(b,f,A){f.geom=f.geom||{},f.exe=f.exe||{},f.eval=f.eval||{},f.core=f.core||{},f.promhx=f.promhx||{};var x={},E=function(){return Te.__string_rec(this,"")};function M(r,n){function a(){}a.prototype=r;var l=new a;for(var c in n)l[c]=n[c];return n.toString!==Object.prototype.toString&&(l.toString=n.toString),l}var z=function(){};x.HxOverrides=z,z.__name__=["HxOverrides"],z.strDate=function(r){var n=r.length;switch(n){case 8:var a=r.split(":"),l=new Date;return l.setTime(0),l.setUTCHours(a[0]),l.setUTCMinutes(a[1]),l.setUTCSeconds(a[2]),l;case 10:var c=r.split("-");return new Date(c[0],c[1]-1,c[2],0,0,0);case 19:var d=r.split(" "),p=d[0].split("-"),_=d[1].split(":");return new Date(p[0],p[1]-1,p[2],_[0],_[1],_[2]);default:throw new Q("Invalid date format : "+r)}},z.cca=function(r,n){var a=r.charCodeAt(n);if(a==a)return a},z.substr=function(r,n,a){return n!=null&&n!=0&&a!=null&&a<0?"":(a==null&&(a=r.length),n<0?(n=r.length+n,n<0&&(n=0)):a<0&&(a=r.length+a-n),r.substr(n,a))},z.iter=function(r){return{cur:0,arr:r,hasNext:function(){return this.cur<this.arr.length},next:function(){return this.arr[this.cur++]}}};var D=function(){};x.Lambda=D,D.__name__=["Lambda"],D.fold=function(r,n,a){for(var l=Xt(r)();l.hasNext();){var c=l.next();a=n(c,a)}return a};var U=function(){this.length=0};x.List=U,U.__name__=["List"],U.prototype={add:function(r){var n=[r];this.h==null?this.h=n:this.q[1]=n,this.q=n,this.length++},pop:function(){if(this.h==null)return null;var r=this.h[0];return this.h=this.h[1],this.h==null&&(this.q=null),this.length--,r},isEmpty:function(){return this.h==null},__class__:U},Math.__name__=["Math"];var B=function(){};x.Reflect=B,B.__name__=["Reflect"],B.field=function(r,n){try{return r[n]}catch(a){return a instanceof Q&&(a=a.val),null}},B.callMethod=function(r,n,a){return n.apply(r,a)},B.fields=function(r){var n=[];if(r!=null){var a=Object.prototype.hasOwnProperty;for(var l in r)l!="__id__"&&l!="hx__closures__"&&a.call(r,l)&&n.push(l)}return n},B.isFunction=function(r){return typeof r=="function"&&!(r.__name__||r.__ename__)},B.deleteField=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)?(delete r[n],!0):!1};var ge=function(){};x.Std=ge,ge.__name__=["Std"],ge.string=function(r){return Te.__string_rec(r,"")},ge.parseFloat=function(r){return parseFloat(r)};var be=function(){this.b=""};x.StringBuf=be,be.__name__=["StringBuf"],be.prototype={add:function(r){this.b+=ge.string(r)},__class__:be};var oe=function(){};x.StringTools=oe,oe.__name__=["StringTools"],oe.fastCodeAt=function(r,n){return r.charCodeAt(n)};var W=x.ValueType={__ename__:["ValueType"],__constructs__:["TNull","TInt","TFloat","TBool","TObject","TFunction","TClass","TEnum","TUnknown"]};W.TNull=["TNull",0],W.TNull.toString=E,W.TNull.__enum__=W,W.TInt=["TInt",1],W.TInt.toString=E,W.TInt.__enum__=W,W.TFloat=["TFloat",2],W.TFloat.toString=E,W.TFloat.__enum__=W,W.TBool=["TBool",3],W.TBool.toString=E,W.TBool.__enum__=W,W.TObject=["TObject",4],W.TObject.toString=E,W.TObject.__enum__=W,W.TFunction=["TFunction",5],W.TFunction.toString=E,W.TFunction.__enum__=W,W.TClass=function(r){var n=["TClass",6,r];return n.__enum__=W,n.toString=E,n},W.TEnum=function(r){var n=["TEnum",7,r];return n.__enum__=W,n.toString=E,n},W.TUnknown=["TUnknown",8],W.TUnknown.toString=E,W.TUnknown.__enum__=W;var ce=function(){};x.Type=ce,ce.__name__=["Type"],ce.getClassName=function(r){var n=r.__name__;return n==null?null:n.join(".")},ce.getEnumName=function(r){var n=r.__ename__;return n.join(".")},ce.resolveClass=function(r){var n=x[r];return n==null||!n.__name__?null:n},ce.resolveEnum=function(r){var n=x[r];return n==null||!n.__ename__?null:n},ce.createEmptyInstance=function(r){function n(){}return n.prototype=r.prototype,new n},ce.createEnum=function(r,n,a){var l=B.field(r,n);if(l==null)throw new Q("No such constructor "+n);if(B.isFunction(l)){if(a==null)throw new Q("Constructor "+n+" need parameters");return B.callMethod(r,l,a)}if(a!=null&&a.length!=0)throw new Q("Constructor "+n+" does not need parameters");return l},ce.getEnumConstructs=function(r){var n=r.__constructs__;return n.slice()},ce.typeof=function(r){var n=typeof r;switch(n){case"boolean":return W.TBool;case"string":return W.TClass(String);case"number":return Math.ceil(r)==r%2147483648?W.TInt:W.TFloat;case"object":if(r==null)return W.TNull;var a=r.__enum__;if(a!=null)return W.TEnum(a);var l=Te.getClass(r);return l!=null?W.TClass(l):W.TObject;case"function":return r.__name__||r.__ename__?W.TObject:W.TFunction;case"undefined":return W.TNull;default:return W.TUnknown}};var se=function(){};x["haxe.IMap"]=se,se.__name__=["haxe","IMap"];var Ve=function(r,n){this.high=r,this.low=n};x["haxe._Int64.___Int64"]=Ve,Ve.__name__=["haxe","_Int64","___Int64"],Ve.prototype={__class__:Ve};var Ye=function(){this.buf=new be,this.cache=[],this.useCache=Ye.USE_CACHE,this.useEnumIndex=Ye.USE_ENUM_INDEX,this.shash=new mt,this.scount=0};x["haxe.Serializer"]=Ye,Ye.__name__=["haxe","Serializer"],Ye.prototype={toString:function(){return this.buf.b},serializeString:function(r){var n=this.shash.get(r);if(n!=null){this.buf.b+="R",n==null?this.buf.b+="null":this.buf.b+=""+n;return}this.shash.set(r,this.scount++),this.buf.b+="y",r=encodeURIComponent(r),r.length==null?this.buf.b+="null":this.buf.b+=""+r.length,this.buf.b+=":",r==null?this.buf.b+="null":this.buf.b+=""+r},serializeRef:function(r){for(var n=typeof r,a=0,l=this.cache.length;a<l;){var c=a++,d=this.cache[c];if(typeof d==n&&d==r)return this.buf.b+="r",c==null?this.buf.b+="null":this.buf.b+=""+c,!0}return this.cache.push(r),!1},serializeFields:function(r){for(var n=0,a=B.fields(r);n<a.length;){var l=a[n];++n,this.serializeString(l),this.serialize(B.field(r,l))}this.buf.b+="g"},serialize:function(r){{var n=ce.typeof(r);switch(n[1]){case 0:this.buf.b+="n";break;case 1:var a=r;if(a==0){this.buf.b+="z";return}this.buf.b+="i",a==null?this.buf.b+="null":this.buf.b+=""+a;break;case 2:var l=r;isNaN(l)?this.buf.b+="k":isFinite(l)?(this.buf.b+="d",l==null?this.buf.b+="null":this.buf.b+=""+l):l<0?this.buf.b+="m":this.buf.b+="p";break;case 3:r?this.buf.b+="t":this.buf.b+="f";break;case 6:var c=n[2];if(c==String){this.serializeString(r);return}if(this.useCache&&this.serializeRef(r))return;switch(c){case Array:var d=0;this.buf.b+="a";for(var p=r.length,_=0;_<p;){var v=_++;r[v]==null?d++:(d>0&&(d==1?this.buf.b+="n":(this.buf.b+="u",d==null?this.buf.b+="null":this.buf.b+=""+d),d=0),this.serialize(r[v]))}d>0&&(d==1?this.buf.b+="n":(this.buf.b+="u",d==null?this.buf.b+="null":this.buf.b+=""+d)),this.buf.b+="h";break;case U:this.buf.b+="l";for(var w=r,S=w.h,P=null;S!=null;){var I;P=S[0],S=S[1],I=P,this.serialize(I)}this.buf.b+="h";break;case Date:var k=r;this.buf.b+="v",this.buf.add(k.getTime());break;case mt:this.buf.b+="b";for(var T=r,L=T.keys();L.hasNext();){var N=L.next();this.serializeString(N),this.serialize(Ri[N]!=null?T.getReserved(N):T.h[N])}this.buf.b+="h";break;case xe:this.buf.b+="q";for(var R=r,O=R.keys();O.hasNext();){var F=O.next();this.buf.b+=":",F==null?this.buf.b+="null":this.buf.b+=""+F,this.serialize(R.h[F])}this.buf.b+="h";break;case Le:this.buf.b+="M";for(var V=r,q=V.keys();q.hasNext();){var J=q.next(),H=B.field(J,"__id__");B.deleteField(J,"__id__"),this.serialize(J),J.__id__=H,this.serialize(V.h[J.__id__])}this.buf.b+="h";break;case It:for(var j=r,X=0,ee=j.length-2,te=new be,ie=Ye.BASE64;X<ee;){var he=j.get(X++),ae=j.get(X++),ue=j.get(X++);te.add(ie.charAt(he>>2)),te.add(ie.charAt((he<<4|ae>>4)&63)),te.add(ie.charAt((ae<<2|ue>>6)&63)),te.add(ie.charAt(ue&63))}if(X==ee){var ne=j.get(X++),de=j.get(X++);te.add(ie.charAt(ne>>2)),te.add(ie.charAt((ne<<4|de>>4)&63)),te.add(ie.charAt(de<<2&63))}else if(X==ee+1){var Y=j.get(X++);te.add(ie.charAt(Y>>2)),te.add(ie.charAt(Y<<4&63))}var pe=te.b;this.buf.b+="s",pe.length==null?this.buf.b+="null":this.buf.b+=""+pe.length,this.buf.b+=":",pe==null?this.buf.b+="null":this.buf.b+=""+pe;break;default:this.useCache&&this.cache.pop(),r.hxSerialize!=null?(this.buf.b+="C",this.serializeString(ce.getClassName(c)),this.useCache&&this.cache.push(r),r.hxSerialize(this),this.buf.b+="g"):(this.buf.b+="c",this.serializeString(ce.getClassName(c)),this.useCache&&this.cache.push(r),this.serializeFields(r))}break;case 4:if(Te.__instanceof(r,uo)){var Se=ce.getClassName(r);this.buf.b+="A",this.serializeString(Se)}else if(Te.__instanceof(r,mo))this.buf.b+="B",this.serializeString(ce.getEnumName(r));else{if(this.useCache&&this.serializeRef(r))return;this.buf.b+="o",this.serializeFields(r)}break;case 7:var Ge=n[2];if(this.useCache){if(this.serializeRef(r))return;this.cache.pop()}this.useEnumIndex?this.buf.b+="j":this.buf.b+="w",this.serializeString(ce.getEnumName(Ge)),this.useEnumIndex?(this.buf.b+=":",this.buf.b+=ge.string(r[1])):this.serializeString(r[0]),this.buf.b+=":";var Xe=r.length;this.buf.b+=ge.string(Xe-2);for(var Fe=2;Fe<Xe;){var Ke=Fe++;this.serialize(r[Ke])}this.useCache&&this.cache.push(r);break;case 5:throw new Q("Cannot serialize function");default:throw new Q("Cannot serialize "+ge.string(r))}}},__class__:Ye};var We=function(r){this.buf=r,this.length=r.length,this.pos=0,this.scache=[],this.cache=[];var n=We.DEFAULT_RESOLVER;n==null&&(n=ce,We.DEFAULT_RESOLVER=n),this.setResolver(n)};x["haxe.Unserializer"]=We,We.__name__=["haxe","Unserializer"],We.initCodes=function(){for(var r=[],n=0,a=We.BASE64.length;n<a;){var l=n++;r[We.BASE64.charCodeAt(l)]=l}return r},We.prototype={setResolver:function(r){r==null?this.resolver={resolveClass:function(n){return null},resolveEnum:function(n){return null}}:this.resolver=r},get:function(r){return this.buf.charCodeAt(r)},readDigits:function(){for(var r=0,n=!1,a=this.pos;;){var l=this.buf.charCodeAt(this.pos);if(l!=l)break;if(l==45){if(this.pos!=a)break;n=!0,this.pos++;continue}if(l<48||l>57)break;r=r*10+(l-48),this.pos++}return n&&(r*=-1),r},readFloat:function(){for(var r=this.pos;;){var n=this.buf.charCodeAt(this.pos);if(n>=43&&n<58||n==101||n==69)this.pos++;else break}return ge.parseFloat(z.substr(this.buf,r,this.pos-r))},unserializeObject:function(r){for(;;){if(this.pos>=this.length)throw new Q("Invalid object");if(this.buf.charCodeAt(this.pos)==103)break;var n=this.unserialize();if(typeof n!="string")throw new Q("Invalid object key");var a=this.unserialize();r[n]=a}this.pos++},unserializeEnum:function(r,n){if(this.get(this.pos++)!=58)throw new Q("Invalid enum format");var a=this.readDigits();if(a==0)return ce.createEnum(r,n);for(var l=[];a-- >0;)l.push(this.unserialize());return ce.createEnum(r,n,l)},unserialize:function(){var r=this.get(this.pos++);switch(r){case 110:return null;case 116:return!0;case 102:return!1;case 122:return 0;case 105:return this.readDigits();case 100:return this.readFloat();case 121:var n=this.readDigits();if(this.get(this.pos++)!=58||this.length-this.pos<n)throw new Q("Invalid string length");var a=z.substr(this.buf,this.pos,n);return this.pos+=n,a=decodeURIComponent(a.split("+").join(" ")),this.scache.push(a),a;case 107:return NaN;case 109:return-1/0;case 112:return 1/0;case 97:this.buf;var l=[];for(this.cache.push(l);;){var c=this.buf.charCodeAt(this.pos);if(c==104){this.pos++;break}if(c==117){this.pos++;var d=this.readDigits();l[l.length+d-1]=null}else l.push(this.unserialize())}return l;case 111:var p={};return this.cache.push(p),this.unserializeObject(p),p;case 114:var _=this.readDigits();if(_<0||_>=this.cache.length)throw new Q("Invalid reference");return this.cache[_];case 82:var v=this.readDigits();if(v<0||v>=this.scache.length)throw new Q("Invalid string reference");return this.scache[v];case 120:throw new Q(this.unserialize());case 99:var w=this.unserialize(),S=this.resolver.resolveClass(w);if(S==null)throw new Q("Class not found "+w);var P=ce.createEmptyInstance(S);return this.cache.push(P),this.unserializeObject(P),P;case 119:var I=this.unserialize(),k=this.resolver.resolveEnum(I);if(k==null)throw new Q("Enum not found "+I);var T=this.unserializeEnum(k,this.unserialize());return this.cache.push(T),T;case 106:var L=this.unserialize(),N=this.resolver.resolveEnum(L);if(N==null)throw new Q("Enum not found "+L);this.pos++;var R=this.readDigits(),O=ce.getEnumConstructs(N)[R];if(O==null)throw new Q("Unknown enum index "+L+"@"+R);var F=this.unserializeEnum(N,O);return this.cache.push(F),F;case 108:var V=new U;for(this.cache.push(V),this.buf;this.buf.charCodeAt(this.pos)!=104;)V.add(this.unserialize());return this.pos++,V;case 98:var q=new mt;for(this.cache.push(q),this.buf;this.buf.charCodeAt(this.pos)!=104;){var J=this.unserialize();q.set(J,this.unserialize())}return this.pos++,q;case 113:var H=new xe;this.cache.push(H),this.buf;for(var j=this.get(this.pos++);j==58;){var X=this.readDigits();H.set(X,this.unserialize()),j=this.get(this.pos++)}if(j!=104)throw new Q("Invalid IntMap format");return H;case 77:var ee=new Le;for(this.cache.push(ee),this.buf;this.buf.charCodeAt(this.pos)!=104;){var te=this.unserialize();ee.set(te,this.unserialize())}return this.pos++,ee;case 118:var ie;if(this.buf.charCodeAt(this.pos)>=48&&this.buf.charCodeAt(this.pos)<=57&&this.buf.charCodeAt(this.pos+1)>=48&&this.buf.charCodeAt(this.pos+1)<=57&&this.buf.charCodeAt(this.pos+2)>=48&&this.buf.charCodeAt(this.pos+2)<=57&&this.buf.charCodeAt(this.pos+3)>=48&&this.buf.charCodeAt(this.pos+3)<=57&&this.buf.charCodeAt(this.pos+4)==45){var he=z.substr(this.buf,this.pos,19);ie=z.strDate(he),this.pos+=19}else{var ae=this.readFloat(),ue=new Date;ue.setTime(ae),ie=ue}return this.cache.push(ie),ie;case 115:var ne=this.readDigits(),de=this.buf;if(this.get(this.pos++)!=58||this.length-this.pos<ne)throw new Q("Invalid bytes length");var Y=We.CODES;Y==null&&(Y=We.initCodes(),We.CODES=Y);var pe=this.pos,Se=ne&3,Ge;Ge=(ne>>2)*3+(Se>=2?Se-1:0);for(var Xe=pe+(ne-Se),Fe=It.alloc(Ge),Ke=0;pe<Xe;){var At=Y[oe.fastCodeAt(de,pe++)],Wt=Y[oe.fastCodeAt(de,pe++)];Fe.set(Ke++,At<<2|Wt>>4);var vt=Y[oe.fastCodeAt(de,pe++)];Fe.set(Ke++,Wt<<4|vt>>2);var gt=Y[oe.fastCodeAt(de,pe++)];Fe.set(Ke++,vt<<6|gt)}if(Se>=2){var Pt=Y[oe.fastCodeAt(de,pe++)],Tt=Y[oe.fastCodeAt(de,pe++)];if(Fe.set(Ke++,Pt<<2|Tt>>4),Se==3){var Kt=Y[oe.fastCodeAt(de,pe++)];Fe.set(Ke++,Tt<<4|Kt>>2)}}return this.pos+=ne,this.cache.push(Fe),Fe;case 67:var or=this.unserialize(),$t=this.resolver.resolveClass(or);if($t==null)throw new Q("Class not found "+or);var Zt=ce.createEmptyInstance($t);if(this.cache.push(Zt),Zt.hxUnserialize(this),this.get(this.pos++)!=103)throw new Q("Invalid custom data");return Zt;case 65:var Qt=this.unserialize(),dr=this.resolver.resolveClass(Qt);if(dr==null)throw new Q("Class not found "+Qt);return dr;case 66:var Tn=this.unserialize(),$r=this.resolver.resolveEnum(Tn);if($r==null)throw new Q("Enum not found "+Tn);return $r}throw this.pos--,new Q("Invalid char "+this.buf.charAt(this.pos)+" at position "+this.pos)},__class__:We};var xe=function(){this.h={}};x["haxe.ds.IntMap"]=xe,xe.__name__=["haxe","ds","IntMap"],xe.__interfaces__=[se],xe.prototype={set:function(r,n){this.h[r]=n},remove:function(r){return this.h.hasOwnProperty(r)?(delete this.h[r],!0):!1},keys:function(){var r=[];for(var n in this.h)this.h.hasOwnProperty(n)&&r.push(n|0);return z.iter(r)},__class__:xe};var Le=function(){this.h={},this.h.__keys__={}};x["haxe.ds.ObjectMap"]=Le,Le.__name__=["haxe","ds","ObjectMap"],Le.__interfaces__=[se],Le.prototype={set:function(r,n){var a=r.__id__||(r.__id__=++Le.count);this.h[a]=n,this.h.__keys__[a]=r},keys:function(){var r=[];for(var n in this.h.__keys__)this.h.hasOwnProperty(n)&&r.push(this.h.__keys__[n]);return z.iter(r)},__class__:Le};var dt=x["haxe.ds.Option"]={__ename__:["haxe","ds","Option"],__constructs__:["Some","None"]};dt.Some=function(r){var n=["Some",0,r];return n.__enum__=dt,n.toString=E,n},dt.None=["None",1],dt.None.toString=E,dt.None.__enum__=dt;var mt=function(){this.h={}};x["haxe.ds.StringMap"]=mt,mt.__name__=["haxe","ds","StringMap"],mt.__interfaces__=[se],mt.prototype={set:function(r,n){Ri[r]!=null?this.setReserved(r,n):this.h[r]=n},get:function(r){return Ri[r]!=null?this.getReserved(r):this.h[r]},setReserved:function(r,n){this.rh==null&&(this.rh={}),this.rh["$"+r]=n},getReserved:function(r){return this.rh==null?null:this.rh["$"+r]},keys:function(){var r=this.arrayKeys();return z.iter(r)},arrayKeys:function(){var r=[];for(var n in this.h)this.h.hasOwnProperty(n)&&r.push(n);if(this.rh!=null)for(var n in this.rh)n.charCodeAt(0)==36&&r.push(n.substr(1));return r},__class__:mt};var It=function(r){this.length=r.byteLength,this.b=new Bi(r),this.b.bufferValue=r,r.hxBytes=this,r.bytes=this.b};x["haxe.io.Bytes"]=It,It.__name__=["haxe","io","Bytes"],It.alloc=function(r){return new It(new Us(r))},It.prototype={get:function(r){return this.b[r]},set:function(r,n){this.b[r]=n&255},__class__:It};var Je=x["haxe.io.Error"]={__ename__:["haxe","io","Error"],__constructs__:["Blocked","Overflow","OutsideBounds","Custom"]};Je.Blocked=["Blocked",0],Je.Blocked.toString=E,Je.Blocked.__enum__=Je,Je.Overflow=["Overflow",1],Je.Overflow.toString=E,Je.Overflow.__enum__=Je,Je.OutsideBounds=["OutsideBounds",2],Je.OutsideBounds.toString=E,Je.OutsideBounds.__enum__=Je,Je.Custom=function(r){var n=["Custom",3,r];return n.__enum__=Je,n.toString=E,n};var at=function(){};x["haxe.io.FPHelper"]=at,at.__name__=["haxe","io","FPHelper"],at.i32ToFloat=function(r){var n=1-(r>>>31<<1),a=r>>>23&255,l=r&8388607;return l==0&&a==0?0:n*(1+Math.pow(2,-23)*l)*Math.pow(2,a-127)},at.floatToI32=function(r){if(r==0)return 0;var n;r<0?n=-r:n=r;var a=Math.floor(Math.log(n)/.6931471805599453);a<-127?a=-127:a>128&&(a=128);var l=Math.round((n/Math.pow(2,a)-1)*8388608)&8388607;return(r<0?-2147483648:0)|a+127<<23|l},at.i64ToDouble=function(r,n){var a=1-(n>>>31<<1),l=(n>>20&2047)-1023,c=(n&1048575)*4294967296+(r>>>31)*2147483648+(r&2147483647);return c==0&&l==-1023?0:a*(1+Math.pow(2,-52)*c)*Math.pow(2,l)},at.doubleToI64=function(r){var n=at.i64tmp;if(r==0)n.low=0,n.high=0;else{var a;r<0?a=-r:a=r;var l=Math.floor(Math.log(a)/.6931471805599453),c,d=(a/Math.pow(2,l)-1)*4503599627370496;c=Math.round(d);var p=c|0,_=c/4294967296|0;n.low=p,n.high=(r<0?-2147483648:0)|l+1023<<20|_}return n};var Q=function(r){Error.call(this),this.val=r,this.message=String(r),Error.captureStackTrace&&Error.captureStackTrace(this,Q)};x["js._Boot.HaxeError"]=Q,Q.__name__=["js","_Boot","HaxeError"],Q.__super__=Error,Q.prototype=M(Error.prototype,{__class__:Q});var Te=function(){};x["js.Boot"]=Te,Te.__name__=["js","Boot"],Te.getClass=function(r){if(r instanceof Array&&r.__enum__==null)return Array;var n=r.__class__;if(n!=null)return n;var a=Te.__nativeClassName(r);return a!=null?Te.__resolveNativeClass(a):null},Te.__string_rec=function(r,n){if(r==null)return"null";if(n.length>=5)return"<...>";var a=typeof r;switch(a=="function"&&(r.__name__||r.__ename__)&&(a="object"),a){case"object":if(r instanceof Array){if(r.__enum__){if(r.length==2)return r[0];var l=r[0]+"(";n+=" ";for(var c=2,d=r.length;c<d;){var p=c++;p!=2?l+=","+Te.__string_rec(r[p],n):l+=Te.__string_rec(r[p],n)}return l+")"}var _=r.length,v="[";n+=" ";for(var w=0;w<_;){var S=w++;v+=(S>0?",":"")+Te.__string_rec(r[S],n)}return v+="]",v}var P;try{P=r.toString}catch(N){return N instanceof Q&&(N=N.val),"???"}if(P!=null&&P!=Object.toString&&typeof P=="function"){var I=r.toString();if(I!="[object Object]")return I}var k=null,T=`{
|
|
3
3
|
`;n+=" ";var L=r.hasOwnProperty!=null;for(var k in r)L&&!r.hasOwnProperty(k)||k=="prototype"||k=="__class__"||k=="__super__"||k=="__interfaces__"||k=="__properties__"||(T.length!=2&&(T+=`,
|
|
4
4
|
`),T+=n+k+" : "+Te.__string_rec(r[k],n));return n=n.substring(1),T+=`
|
package/dist/data-model.js
CHANGED
|
@@ -511,7 +511,7 @@ const wo = class Ao {
|
|
|
511
511
|
* @param {number | null} value - The color index to set (0-256).
|
|
512
512
|
*/
|
|
513
513
|
set colorIndex(e) {
|
|
514
|
-
e == null ? this._colorIndex = null : (this._colorIndex = ns(e, 0, 256), this._color = ui[e], this._colorName = this.getColorNameByValue(this._color));
|
|
514
|
+
e == null ? this._colorIndex = null : (this._colorIndex = ns(e, 0, 256), this._colorIndex > 0 && this._colorIndex < 256 ? (this._color = ui[e], this._colorName = this.getColorNameByValue(this._color)) : (this._color = null, this._colorName = null));
|
|
515
515
|
}
|
|
516
516
|
/**
|
|
517
517
|
* Gets the name of the current color.
|
|
@@ -1797,7 +1797,7 @@ function To(i) {
|
|
|
1797
1797
|
(fr = {})[fr.CAST_AND_RECEIVE = 0] = "CAST_AND_RECEIVE", fr[fr.CAST = 1] = "CAST", fr[fr.RECEIVE = 2] = "RECEIVE", fr[fr.IGNORE = 3] = "IGNORE";
|
|
1798
1798
|
let Ue = [...qh, { code: 284, name: "shadowMode", parser: y }, { code: 390, name: "plotStyleHardId", parser: y }, { code: 380, name: "plotStyleType", parser: y }, { code: 440, name: "transparency", parser: y }, { code: 430, name: "colorName", parser: y }, { code: 420, name: "color", parser: y }, { code: 310, name: "proxyEntity", isMultiple: !0, parser: y }, { code: 92, name: "proxyByte", parser: y }, { code: 60, name: "isVisible", parser: Be }, { code: 48, name: "lineTypeScale", parser: y }, { code: 370, name: "lineweight", parser: y }, { code: 62, name: "colorIndex", parser(i, e, t) {
|
|
1799
1799
|
let s = i.value;
|
|
1800
|
-
return t.color = To(Math.abs(s)), s;
|
|
1800
|
+
return s > 0 && s < 256 && (t.color = To(Math.abs(s))), s;
|
|
1801
1801
|
} }, { code: 347, name: "materialObjectHardId", parser: y }, { code: 6, name: "lineType", parser: y }, { code: 8, name: "layer", parser: y }, { code: 410, name: "layoutTabName", parser: y }, { code: 67, name: "isInPaperSpace", parser: Be }, { code: 100 }, { code: 160 }, { code: 330, name: "ownerBlockRecordSoftId", parser: y }, { code: 102, parser: sn }, { code: 102, parser: sn }, { code: 102, parser: sn }, { code: 5, name: "handle", parser: y }];
|
|
1802
1802
|
function Js(i) {
|
|
1803
1803
|
return [{ code: 3, name: i, parser: (e, t, s) => (s._code3text = (s._code3text ?? "") + e.value, s._code3text + (s._code1text ?? "")), isMultiple: !0, isReducible: !0 }, { code: 1, name: i, parser: (e, t, s) => (s._code1text = e.value, (s._code3text ?? "") + s._code1text) }];
|
|
@@ -196,7 +196,7 @@ function pr(e) {
|
|
|
196
196
|
(H = {})[H.CAST_AND_RECEIVE = 0] = "CAST_AND_RECEIVE", H[H.CAST = 1] = "CAST", H[H.RECEIVE = 2] = "RECEIVE", H[H.IGNORE = 3] = "IGNORE";
|
|
197
197
|
let b = [...va, { code: 284, name: "shadowMode", parser: a }, { code: 390, name: "plotStyleHardId", parser: a }, { code: 380, name: "plotStyleType", parser: a }, { code: 440, name: "transparency", parser: a }, { code: 430, name: "colorName", parser: a }, { code: 420, name: "color", parser: a }, { code: 310, name: "proxyEntity", isMultiple: !0, parser: a }, { code: 92, name: "proxyByte", parser: a }, { code: 60, name: "isVisible", parser: f }, { code: 48, name: "lineTypeScale", parser: a }, { code: 370, name: "lineweight", parser: a }, { code: 62, name: "colorIndex", parser(e, r, n) {
|
|
198
198
|
let t = e.value;
|
|
199
|
-
return n.color = pr(Math.abs(t)), t;
|
|
199
|
+
return t > 0 && t < 256 && (n.color = pr(Math.abs(t))), t;
|
|
200
200
|
} }, { code: 347, name: "materialObjectHardId", parser: a }, { code: 6, name: "lineType", parser: a }, { code: 8, name: "layer", parser: a }, { code: 410, name: "layoutTabName", parser: a }, { code: 67, name: "isInPaperSpace", parser: f }, { code: 100 }, { code: 160 }, { code: 330, name: "ownerBlockRecordSoftId", parser: a }, { code: 102, parser: ie }, { code: 102, parser: ie }, { code: 102, parser: ie }, { code: 5, name: "handle", parser: a }];
|
|
201
201
|
function Ue(e) {
|
|
202
202
|
return [{ code: 3, name: e, parser: (r, n, t) => (t._code3text = (t._code3text ?? "") + r.value, t._code3text + (t._code1text ?? "")), isMultiple: !0, isReducible: !0 }, { code: 1, name: e, parser: (r, n, t) => (t._code1text = r.value, (t._code3text ?? "") + t._code1text) }];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlightcad/data-model",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.18",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"require": "./dist/data-model.cjs"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@mlightcad/dxf-json": "1.0.
|
|
35
|
+
"@mlightcad/dxf-json": "1.0.10",
|
|
36
36
|
"uid": "^2.0.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@mlightcad/
|
|
40
|
-
"@mlightcad/
|
|
41
|
-
"@mlightcad/
|
|
39
|
+
"@mlightcad/graphic-interface": "3.0.3",
|
|
40
|
+
"@mlightcad/geometry-engine": "3.0.2",
|
|
41
|
+
"@mlightcad/common": "1.2.1"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"analyze": "pnpm run analyze:lib && pnpm run analyze:worker",
|