@mlightcad/cad-html-core 1.7.8-preview.5 → 1.7.8-preview.6

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.
@@ -1,16 +1,16 @@
1
- (function(m,I){typeof exports=="object"&&typeof module<"u"?I(exports,require("@mlightcad/three-renderer"),require("three"),require("three/examples/jsm/lines/LineMaterial.js"),require("three/examples/jsm/lines/LineSegments2.js"),require("@mlightcad/data-model")):typeof define=="function"&&define.amd?define(["exports","@mlightcad/three-renderer","three","three/examples/jsm/lines/LineMaterial.js","three/examples/jsm/lines/LineSegments2.js","@mlightcad/data-model"],I):(m=typeof globalThis<"u"?globalThis:m||self,I(m["cad-html-core"]={},m.threeRenderer,m.THREE,m.LineMaterial_js,m.LineSegments2_js,m.dataModel))})(this,(function(m,I,Ci,vr,Si,v){"use strict";function Mi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const E=Mi(Ci);var B=Uint8Array,G=Uint16Array,Jt=Int32Array,rt=new B([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),at=new B([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Qt=new B([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),br=function(e,t){for(var n=new G(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var a=new Jt(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)a[o]=o-n[r]<<5|r;return{b:n,r:a}},xr=br(rt,2),kr=xr.b,en=xr.r;kr[28]=258,en[258]=28;for(var Ar=br(at,0),Pi=Ar.b,Lr=Ar.r,tn=new G(32768),_=0;_<32768;++_){var le=(_&43690)>>1|(_&21845)<<1;le=(le&52428)>>2|(le&13107)<<2,le=(le&61680)>>4|(le&3855)<<4,tn[_]=((le&65280)>>8|(le&255)<<8)>>1}for(var Q=(function(e,t,n){for(var r=e.length,a=0,o=new G(t);a<r;++a)e[a]&&++o[e[a]-1];var i=new G(t);for(a=1;a<t;++a)i[a]=i[a-1]+o[a-1]<<1;var s;if(n){s=new G(1<<t);var l=15-t;for(a=0;a<r;++a)if(e[a])for(var d=a<<4|e[a],c=t-e[a],u=i[e[a]-1]++<<c,f=u|(1<<c)-1;u<=f;++u)s[tn[u]>>l]=d}else for(s=new G(r),a=0;a<r;++a)e[a]&&(s[a]=tn[i[e[a]-1]++]>>15-e[a]);return s}),ce=new B(288),_=0;_<144;++_)ce[_]=8;for(var _=144;_<256;++_)ce[_]=9;for(var _=256;_<280;++_)ce[_]=7;for(var _=280;_<288;++_)ce[_]=8;for(var _e=new B(32),_=0;_<32;++_)_e[_]=5;var _i=Q(ce,9,0),Ii=Q(ce,9,1),Bi=Q(_e,5,0),Ti=Q(_e,5,1),nn=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},q=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},rn=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},an=function(e){return(e+7)/8|0},Ie=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new B(e.subarray(t,n))},zi=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],U=function(e,t,n){var r=new Error(t||zi[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,U),!n)throw r;return r},Er=function(e,t,n,r){var a=e.length,o=r?r.length:0;if(!a||t.f&&!t.l)return n||new B(0);var i=!n,s=i||t.i!=2,l=t.i;i&&(n=new B(a*3));var d=function(tt){var nt=n.length;if(tt>nt){var Pe=new B(Math.max(nt*2,tt));Pe.set(n),n=Pe}},c=t.f||0,u=t.p||0,f=t.b||0,p=t.l,h=t.d,g=t.m,y=t.n,b=a*8;do{if(!p){c=q(e,u,1);var w=q(e,u+1,3);if(u+=3,w)if(w==1)p=Ii,h=Ti,g=9,y=5;else if(w==2){var C=q(e,u,31)+257,P=q(e,u+10,15)+4,L=C+q(e,u+5,31)+1;u+=14;for(var x=new B(L),R=new B(19),O=0;O<P;++O)R[Qt[O]]=q(e,u+O*3,7);u+=P*3;for(var $=nn(R),me=(1<<$)-1,j=Q(R,$,1),O=0;O<L;){var V=j[q(e,u,me)];u+=V&15;var A=V>>4;if(A<16)x[O++]=A;else{var N=0,T=0;for(A==16?(T=3+q(e,u,3),u+=2,N=x[O-1]):A==17?(T=3+q(e,u,7),u+=3):A==18&&(T=11+q(e,u,127),u+=7);T--;)x[O++]=N}}var Y=x.subarray(0,C),X=x.subarray(C);g=nn(Y),y=nn(X),p=Q(Y,g,1),h=Q(X,y,1)}else U(1);else{var A=an(u)+4,k=e[A-4]|e[A-3]<<8,M=A+k;if(M>a){l&&U(0);break}s&&d(f+k),n.set(e.subarray(A,M),f),t.b=f+=k,t.p=u=M*8,t.f=c;continue}if(u>b){l&&U(0);break}}s&&d(f+131072);for(var et=(1<<g)-1,W=(1<<y)-1,se=u;;se=u){var N=p[rn(e,u)&et],Z=N>>4;if(u+=N&15,u>b){l&&U(0);break}if(N||U(2),Z<256)n[f++]=Z;else if(Z==256){se=u,p=null;break}else{var K=Z-254;if(Z>264){var O=Z-257,z=rt[O];K=q(e,u,(1<<z)-1)+kr[O],u+=z}var re=h[rn(e,u)&W],Se=re>>4;re||U(3),u+=re&15;var X=Pi[Se];if(Se>3){var z=at[Se];X+=rn(e,u)&(1<<z)-1,u+=z}if(u>b){l&&U(0);break}s&&d(f+131072);var Me=f+K;if(f<X){var Wt=o-X,qt=Math.min(X,Me);for(Wt+f<0&&U(3);f<qt;++f)n[f]=r[Wt+f]}for(;f<Me;++f)n[f]=n[f-X]}}t.l=p,t.p=se,t.b=f,t.f=c,p&&(c=1,t.m=g,t.d=h,t.n=y)}while(!c);return f!=n.length&&i?Ie(n,0,f):n.subarray(0,f)},ae=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Be=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},on=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var a=n.length,o=n.slice();if(!a)return{t:Pr,l:0};if(a==1){var i=new B(n[0].s+1);return i[n[0].s]=1,{t:i,l:1}}n.sort(function(M,C){return M.f-C.f}),n.push({s:-1,f:25001});var s=n[0],l=n[1],d=0,c=1,u=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};c!=a-1;)s=n[n[d].f<n[u].f?d++:u++],l=n[d!=c&&n[d].f<n[u].f?d++:u++],n[c++]={s:-1,f:s.f+l.f,l:s,r:l};for(var f=o[0].s,r=1;r<a;++r)o[r].s>f&&(f=o[r].s);var p=new G(f+1),h=sn(n[c-1],p,0);if(h>t){var r=0,g=0,y=h-t,b=1<<y;for(o.sort(function(C,P){return p[P.s]-p[C.s]||C.f-P.f});r<a;++r){var w=o[r].s;if(p[w]>t)g+=b-(1<<h-p[w]),p[w]=t;else break}for(g>>=y;g>0;){var A=o[r].s;p[A]<t?g-=1<<t-p[A]++-1:++r}for(;r>=0&&g;--r){var k=o[r].s;p[k]==t&&(--p[k],++g)}h=t}return{t:new B(p),l:h}},sn=function(e,t,n){return e.s==-1?Math.max(sn(e.l,t,n+1),sn(e.r,t,n+1)):t[e.s]=n},Cr=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new G(++t),r=0,a=e[0],o=1,i=function(l){n[r++]=l},s=1;s<=t;++s)if(e[s]==a&&s!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(a),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(a);o=1,a=e[s]}return{c:n.subarray(0,r),n:t}},Te=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Sr=function(e,t,n){var r=n.length,a=an(t+2);e[a]=r&255,e[a+1]=r>>8,e[a+2]=e[a]^255,e[a+3]=e[a+1]^255;for(var o=0;o<r;++o)e[a+o+4]=n[o];return(a+4+r)*8},Mr=function(e,t,n,r,a,o,i,s,l,d,c){ae(t,c++,n),++a[256];for(var u=on(a,15),f=u.t,p=u.l,h=on(o,15),g=h.t,y=h.l,b=Cr(f),w=b.c,A=b.n,k=Cr(g),M=k.c,C=k.n,P=new G(19),L=0;L<w.length;++L)++P[w[L]&31];for(var L=0;L<M.length;++L)++P[M[L]&31];for(var x=on(P,7),R=x.t,O=x.l,$=19;$>4&&!R[Qt[$-1]];--$);var me=d+5<<3,j=Te(a,ce)+Te(o,_e)+i,V=Te(a,f)+Te(o,g)+i+14+3*$+Te(P,R)+2*P[16]+3*P[17]+7*P[18];if(l>=0&&me<=j&&me<=V)return Sr(t,c,e.subarray(l,l+d));var N,T,Y,X;if(ae(t,c,1+(V<j)),c+=2,V<j){N=Q(f,p,0),T=f,Y=Q(g,y,0),X=g;var et=Q(R,O,0);ae(t,c,A-257),ae(t,c+5,C-1),ae(t,c+10,$-4),c+=14;for(var L=0;L<$;++L)ae(t,c+3*L,R[Qt[L]]);c+=3*$;for(var W=[w,M],se=0;se<2;++se)for(var Z=W[se],L=0;L<Z.length;++L){var K=Z[L]&31;ae(t,c,et[K]),c+=R[K],K>15&&(ae(t,c,Z[L]>>5&127),c+=Z[L]>>12)}}else N=_i,T=ce,Y=Bi,X=_e;for(var L=0;L<s;++L){var z=r[L];if(z>255){var K=z>>18&31;Be(t,c,N[K+257]),c+=T[K+257],K>7&&(ae(t,c,z>>23&31),c+=rt[K]);var re=z&31;Be(t,c,Y[re]),c+=X[re],re>3&&(Be(t,c,z>>5&8191),c+=at[re])}else Be(t,c,N[z]),c+=T[z]}return Be(t,c,N[256]),c+T[256]},Fi=new Jt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pr=new B(0),Hi=function(e,t,n,r,a,o){var i=o.z||e.length,s=new B(r+i+5*(1+Math.ceil(i/7e3))+a),l=s.subarray(r,s.length-a),d=o.l,c=(o.r||0)&7;if(t){c&&(l[0]=o.r>>3);for(var u=Fi[t-1],f=u>>13,p=u&8191,h=(1<<n)-1,g=o.p||new G(32768),y=o.h||new G(h+1),b=Math.ceil(n/3),w=2*b,A=function(yr){return(e[yr]^e[yr+1]<<b^e[yr+2]<<w)&h},k=new Jt(25e3),M=new G(288),C=new G(32),P=0,L=0,x=o.i||0,R=0,O=o.w||0,$=0;x+2<i;++x){var me=A(x),j=x&32767,V=y[me];if(g[j]=V,y[me]=j,O<=x){var N=i-x;if((P>7e3||R>24576)&&(N>423||!d)){c=Mr(e,l,0,k,M,C,L,R,$,x-$,c),R=P=L=0,$=x;for(var T=0;T<286;++T)M[T]=0;for(var T=0;T<30;++T)C[T]=0}var Y=2,X=0,et=p,W=j-V&32767;if(N>2&&me==A(x-W))for(var se=Math.min(f,N)-1,Z=Math.min(32767,x),K=Math.min(258,N);W<=Z&&--et&&j!=V;){if(e[x+Y]==e[x+Y-W]){for(var z=0;z<K&&e[x+z]==e[x+z-W];++z);if(z>Y){if(Y=z,X=W,z>se)break;for(var re=Math.min(W,z-2),Se=0,T=0;T<re;++T){var Me=x-W+T&32767,Wt=g[Me],qt=Me-Wt&32767;qt>Se&&(Se=qt,V=Me)}}}j=V,V=g[j],W+=j-V&32767}if(X){k[R++]=268435456|en[Y]<<18|Lr[X];var tt=en[Y]&31,nt=Lr[X]&31;L+=rt[tt]+at[nt],++M[257+tt],++C[nt],O=x+Y,++P}else k[R++]=e[x],++M[e[x]]}}for(x=Math.max(x,O);x<i;++x)k[R++]=e[x],++M[e[x]];c=Mr(e,l,d,k,M,C,L,R,$,x-$,c),d||(o.r=c&7|l[c/8|0]<<3,c-=7,o.h=y,o.p=g,o.i=x,o.w=O)}else{for(var x=o.w||0;x<i+d;x+=65535){var Pe=x+65535;Pe>=i&&(l[c/8|0]=d,Pe=i),c=Sr(l,c+1,e.subarray(x,Pe))}o.i=i}return Ie(s,0,r+an(c)+a)},Oi=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),_r=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Oi[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},Ir=function(e,t,n,r,a){if(!a&&(a={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),i=new B(o.length+e.length);i.set(o),i.set(e,o.length),e=i,a.w=o.length}return Hi(e,t.level==null?6:t.level,t.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,a)},Br=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},ee=function(e,t){return e[t]|e[t+1]<<8},J=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},ln=function(e,t){return J(e,t)+J(e,t+4)*4294967296},F=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Ui=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&F(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},Di=function(e){(e[0]!=31||e[1]!=139||e[2]!=8)&&U(6,"invalid gzip data");var t=e[3],n=10;t&4&&(n+=(e[10]|e[11]<<8)+2);for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(t&2)},Ri=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},Ni=function(e){return 10+(e.filename?e.filename.length+1:0)};function Xi(e,t){return Ir(e,t||{},0,0)}function $i(e,t){return Er(e,{i:2},t&&t.out,t&&t.dictionary)}function Vi(e,t){t||(t={});var n=_r(),r=e.length;n.p(e);var a=Ir(e,t,Ni(t),8),o=a.length;return Ui(a,t),F(a,o-8,n.d()),F(a,o-4,r),a}function Yi(e,t){var n=Di(e);return n+8>e.length&&U(6,"invalid gzip data"),Er(e.subarray(n,-8),{i:2},new B(Ri(e)),t)}var Tr=function(e,t,n,r){for(var a in e){var o=e[a],i=t+a,s=r;Array.isArray(o)&&(s=Br(r,o[1]),o=o[0]),o instanceof B?n[i]=[o,s]:(n[i+="/"]=[new B(0),s],Tr(o,i,n,r))}},zr=typeof TextEncoder<"u"&&new TextEncoder,cn=typeof TextDecoder<"u"&&new TextDecoder,Gi=0;try{cn.decode(Pr,{stream:!0}),Gi=1}catch{}var ji=function(e){for(var t="",n=0;;){var r=e[n++],a=(r>127)+(r>223)+(r>239);if(n+a>e.length)return{s:t,r:Ie(e,n-1)};a?a==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):a&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function ye(e,t){var n;if(zr)return zr.encode(e);for(var r=e.length,a=new B(e.length+(e.length>>1)),o=0,i=function(d){a[o++]=d},n=0;n<r;++n){if(o+5>a.length){var s=new B(o+8+(r-n<<1));s.set(a),a=s}var l=e.charCodeAt(n);l<128||t?i(l):l<2048?(i(192|l>>6),i(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++n)&1023,i(240|l>>18),i(128|l>>12&63),i(128|l>>6&63),i(128|l&63)):(i(224|l>>12),i(128|l>>6&63),i(128|l&63))}return Ie(a,0,o)}function dn(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}else{if(cn)return cn.decode(e);var a=ji(e),o=a.s,n=a.r;return n.length&&U(8),o}}var Zi=function(e,t){return t+30+ee(e,t+26)+ee(e,t+28)},Ki=function(e,t,n){var r=ee(e,t+28),a=dn(e.subarray(t+46,t+46+r),!(ee(e,t+8)&2048)),o=t+46+r,i=J(e,t+20),s=n&&i==4294967295?Wi(e,o):[i,J(e,t+24),J(e,t+42)],l=s[0],d=s[1],c=s[2];return[ee(e,t+10),l,d,a,o+ee(e,t+30)+ee(e,t+32),c]},Wi=function(e,t){for(;ee(e,t)!=1;t+=4+ee(e,t+2));return[ln(e,t+12),ln(e,t+4),ln(e,t+20)]},un=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&U(9),t+=r+4}return t},Fr=function(e,t,n,r,a,o,i,s){var l=r.length,d=n.extra,c=s&&s.length,u=un(d);F(e,t,i!=null?33639248:67324752),t+=4,i!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(o<0&&8),e[t++]=a&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var f=new Date(n.mtime==null?Date.now():n.mtime),p=f.getFullYear()-1980;if((p<0||p>119)&&U(10),F(e,t,p<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),t+=4,o!=-1&&(F(e,t,n.crc),F(e,t+4,o<0?-o-2:o),F(e,t+8,n.size)),F(e,t+12,l),F(e,t+14,u),t+=16,i!=null&&(F(e,t,c),F(e,t+6,n.attrs),F(e,t+10,i),t+=14),e.set(r,t),t+=l,u)for(var h in d){var g=d[h],y=g.length;F(e,t,+h),F(e,t+2,y),e.set(g,t+4),t+=4+y}return c&&(e.set(s,t),t+=c),t},qi=function(e,t,n,r,a){F(e,t,101010256),F(e,t+8,n),F(e,t+10,n),F(e,t+12,r),F(e,t+16,a)};function Ji(e,t){t||(t={});var n={},r=[];Tr(e,"",n,t);var a=0,o=0;for(var i in n){var s=n[i],l=s[0],d=s[1],c=d.level==0?0:8,u=ye(i),f=u.length,p=d.comment,h=p&&ye(p),g=h&&h.length,y=un(d.extra);f>65535&&U(11);var b=c?Xi(l,d):l,w=b.length,A=_r();A.p(l),r.push(Br(d,{size:l.length,crc:A.d(),c:b,f:u,m:h,u:f!=i.length||h&&p.length!=g,o:a,compression:c})),a+=30+f+y+w,o+=76+2*(f+y)+(g||0)+w}for(var k=new B(o+22),M=a,C=o-a,P=0;P<r.length;++P){var u=r[P];Fr(k,u.o,u,u.f,u.u,u.c.length);var L=30+u.f.length+un(u.extra);k.set(u.c,u.o+L),Fr(k,a,u,u.f,u.u,u.c.length,u.o,u.m),a+=16+L+(u.m?u.m.length:0)}return qi(k,a,r.length,C,M),k}function Qi(e,t){for(var n={},r=e.length-22;J(e,r)!=101010256;--r)(!r||e.length-r>65558)&&U(13);var a=ee(e,r+8);if(!a)return{};var o=J(e,r+16),i=o==4294967295||a==65535;if(i){var s=J(e,r-12);i=J(e,s)==101075792,i&&(a=J(e,s+32),o=J(e,s+48))}for(var l=0;l<a;++l){var d=Ki(e,o,i),c=d[0],u=d[1],f=d[2],p=d[3],h=d[4],g=d[5],y=Zi(e,g);o=h,c?c==8?n[p]=$i(e.subarray(y,y+u),{out:new B(f)}):U(14,"unknown compression type "+c):n[p]=Ie(e,y,y+u)}return n}const Hr=512*1024*1024,mn=512*1024*1024;class ot{constructor(){this.chunks=[],this.length=0}writeU8(t){const n=new Uint8Array(1);n[0]=t&255,this.chunks.push(n),this.length+=1}writeU32(t){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t>>>0,!0),this.chunks.push(n),this.length+=4}writeI32(t){const n=new Uint8Array(4);new DataView(n.buffer).setInt32(0,t|0,!0),this.chunks.push(n),this.length+=4}writeF32(t){const n=new Uint8Array(4);new DataView(n.buffer).setFloat32(0,t,!0),this.chunks.push(n),this.length+=4}writeF64(t){const n=new Uint8Array(8);new DataView(n.buffer).setFloat64(0,t,!0),this.chunks.push(n),this.length+=8}writeBytes(t){this.chunks.push(t),this.length+=t.length}writeString(t){const n=ye(t);this.writeU32(n.length),this.writeBytes(n)}writeJson(t){this.writeString(JSON.stringify(t))}writeFloat32Array(t){this.alignTo(4);const n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);this.writeU32(n.length),this.writeBytes(n)}writeUint32Array(t){this.alignTo(4);const n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);this.writeU32(n.length),this.writeBytes(n)}alignTo(t){const n=this.length%t;if(n===0)return;const r=t-n;for(let a=0;a<r;a++)this.writeU8(0)}toUint8Array(){const t=new Uint8Array(this.length);let n=0;for(const r of this.chunks)t.set(r,n),n+=r.length;return t}}class it{constructor(t){this.bytes=t,this.offset=0}ensureAvailable(t){if(t<0||!Number.isFinite(t))throw new Error("Invalid binary length");if(this.offset+t>this.bytes.length)throw new Error("Unexpected end of binary buffer")}readU8(){return this.ensureAvailable(1),this.bytes[this.offset++]}readU32(){this.ensureAvailable(4);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,4).getUint32(0,!0);return this.offset+=4,n}readI32(){this.ensureAvailable(4);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,4).getInt32(0,!0);return this.offset+=4,n}readF32(){this.ensureAvailable(4);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,4).getFloat32(0,!0);return this.offset+=4,n}readF64(){this.ensureAvailable(8);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,8).getFloat64(0,!0);return this.offset+=8,n}readBytes(t){this.ensureAvailable(t);const n=this.bytes.subarray(this.offset,this.offset+t);return this.offset+=t,n}readString(){const t=this.readU32();if(t===0)return"";if(t>Hr)throw new Error("Binary string exceeds size limit");return dn(this.readBytes(t))}readJson(){const t=this.readString();if(t.length===0)throw new Error("Expected JSON payload");return JSON.parse(t)}alignTo(t){const n=this.offset%t;if(n===0)return;const r=t-n;this.ensureAvailable(r),this.offset+=r}readFloat32Array(){this.alignTo(4);const t=this.readU32();if(t===0)return new Float32Array(0);if(t%4!==0)throw new Error("Invalid float32 buffer length");if(t>mn)throw new Error("Float32 buffer exceeds size limit");const n=this.readBytes(t);if(n.byteOffset%4===0)return new Float32Array(n.buffer,n.byteOffset,t/4);const r=new ArrayBuffer(t);return new Uint8Array(r).set(n),new Float32Array(r)}readUint32Array(){this.alignTo(4);const t=this.readU32();if(t===0)return new Uint32Array(0);if(t%4!==0)throw new Error("Invalid uint32 buffer length");if(t>mn)throw new Error("Uint32 buffer exceeds size limit");const n=this.readBytes(t);if(n.byteOffset%4===0)return new Uint32Array(n.buffer,n.byteOffset,t/4);const r=new ArrayBuffer(t);return new Uint8Array(r).set(n),new Uint32Array(r)}}const D=4,st="gzip",Or=512*1024*1024,lt=256*1024*1024;let ze=null;function es(e){ze=e}function ve(e){return{bytes:ze?ze.gzipSync(e):Vi(e),compression:st}}async function pn(e){if(ze)return{bytes:await ze.gzip(e),compression:st};if(typeof CompressionStream>"u")return ve(e);try{const t=new Uint8Array(e.byteLength);t.set(e);const n=new Blob([t]).stream().pipeThrough(new CompressionStream("gzip"));return{bytes:new Uint8Array(await new Response(n).arrayBuffer()),compression:st}}catch{return ve(e)}}function fn(e){return e.byteLength>=2&&e[0]===31&&e[1]===139}function ct(e){if(e.byteLength>lt)throw new Error("Compressed payload exceeds size limit");const t=Yi(e);if(t.byteLength>Or)throw new Error("Decompressed payload exceeds size limit");return t}const dt="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%()*+,-.;=?@[]^_{|}~",hn=new Int16Array(128).fill(-1);for(let e=0;e<dt.length;e++)hn[dt.charCodeAt(e)]=e;function gn(e){const t=(e==null?void 0:e.toLowerCase())??"";return t.includes(";base85")||t.endsWith("base85")?"base85":"base64"}function be(e,t){return t==="base85"?Ur(e):ns(e)}function Fe(e,t){const n=e.length>0&&(e.charCodeAt(0)<=32||e.charCodeAt(e.length-1)<=32)?e.trim():e;return t==="base85"?Dr(n):rs(n)}function Ur(e){const t=e.length;if(t===0)return"";const n=(4-t%4)%4,r=t+n,a=[];for(let i=0;i<r;i+=4){const s=e[i]??0,l=i+1<t?e[i+1]:0,d=i+2<t?e[i+2]:0,c=i+3<t?e[i+3]:0;let u=(s<<24>>>0)+(l<<16)+(d<<8)+c;const f=new Array(5);for(let p=4;p>=0;p--)f[p]=u%85,u=u/85|0;for(let p=0;p<5;p++)a.push(dt[f[p]])}const o=Math.ceil(t*5/4);return a.slice(0,o).join("")}function Dr(e){const t=e.replace(/\s+/g,""),n=t.length;if(n===0)return new Uint8Array(0);const r=Math.floor(n*4/5),a=(5-n%5)%5,o=n+a,i=new Uint8Array(o/5*4),s=dt.length-1;let l=0;for(let d=0;d<o;d+=5){let c=0;for(let u=0;u<5;u++){const f=d+u<n?ts(t.charCodeAt(d+u)):s;c=c*85+f}i[l++]=c>>>24&255,i[l++]=c>>>16&255,i[l++]=c>>>8&255,i[l++]=c&255}return i.subarray(0,r)}function ts(e){if(e<0||e>=hn.length)throw new Error("Invalid base85 character");const t=hn[e];if(t<0)throw new Error("Invalid base85 character");return t}function ns(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function rs(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const ut=1,mt=2,pt=4,ft=8,ht=16,wn=32,gt=1,wt=2,yt=4,vt=8,bt=16,yn=32,xt=64,kt=128;function At(e){let t=256+e.positions.byteLength;return e.indices&&(t+=e.indices.byteLength),e.lineDistances&&(t+=e.lineDistances.byteLength),e.linePattern&&(t+=64+e.linePattern.pattern.length*8),t}function Lt(e){let t=256+e.positions.byteLength;return e.indices&&(t+=e.indices.byteLength),e.gradientPositions&&(t+=e.gradientPositions.byteLength),e.uvs&&(t+=e.uvs.byteLength),e.texture&&(t+=e.texture.bytes.byteLength+64),e.hatchPattern&&(t+=128),e.gradientFill&&(t+=64),t}function vn(e,t){e.writeString(t.layer),e.writeU32(t.color>>>0),e.writeF64(t.offset[0]),e.writeF64(t.offset[1]),e.writeF64(t.offset[2]),e.writeFloat32Array(t.positions);let n=0;t.indices&&t.indices.length>0&&(n|=ut),t.linePattern&&(n|=mt),t.lineDistances&&t.lineDistances.length>0&&(n|=pt),t.lineWidth!=null&&t.lineWidth>0&&(n|=ft),t.renderOrder!=null&&t.renderOrder!==0&&(n|=ht),t.excludeFromOsnap&&(n|=wn),e.writeU8(n),n&ut&&e.writeUint32Array(t.indices),n&mt&&e.writeJson(t.linePattern),n&pt&&e.writeFloat32Array(t.lineDistances),n&ft&&e.writeF32(t.lineWidth),n&ht&&e.writeI32(t.renderOrder)}function bn(e){const t=e.readString(),n=e.readU32(),r=[e.readF64(),e.readF64(),e.readF64()],a=e.readFloat32Array(),o=e.readU8(),i={layer:t,color:n,offset:r,positions:a};return o&ut&&(i.indices=e.readUint32Array()),o&mt&&(i.linePattern=e.readJson()),o&pt&&(i.lineDistances=e.readFloat32Array()),o&ft&&(i.lineWidth=e.readF32()),o&ht&&(i.renderOrder=e.readI32()),o&wn&&(i.excludeFromOsnap=!0),i}function xn(e,t){e.writeString(t.layer),e.writeU32(t.color>>>0),e.writeF64(t.offset[0]),e.writeF64(t.offset[1]),e.writeF64(t.offset[2]),e.writeFloat32Array(t.positions);let n=0;t.indices&&t.indices.length>0&&(n|=gt),t.hatchPattern&&(n|=wt),t.gradientFill&&(n|=yt),t.gradientPositions&&t.gradientPositions.length>0&&(n|=vt),t.side!=null&&(n|=bt),t.points&&(n|=yn),t.renderOrder!=null&&t.renderOrder!==0&&(n|=xt),t.texture&&t.texture.bytes.length>0&&t.uvs&&t.uvs.length>=2&&(n|=kt),e.writeU8(n),n&gt&&e.writeUint32Array(t.indices),n&wt&&e.writeJson(t.hatchPattern),n&yt&&e.writeJson(t.gradientFill),n&vt&&e.writeFloat32Array(t.gradientPositions),n&bt&&e.writeU8(t.side),n&xt&&e.writeI32(t.renderOrder),n&kt&&(e.writeFloat32Array(t.uvs),e.writeString(t.texture.mimeType||"image/png"),e.writeU32(t.texture.bytes.byteLength),e.writeBytes(t.texture.bytes))}function kn(e){const t=e.readString(),n=e.readU32(),r=[e.readF64(),e.readF64(),e.readF64()],a=e.readFloat32Array(),o=e.readU8(),i={layer:t,color:n,offset:r,positions:a};if(o&gt&&(i.indices=e.readUint32Array()),o&wt&&(i.hatchPattern=e.readJson()),o&yt&&(i.gradientFill=e.readJson()),o&vt&&(i.gradientPositions=e.readFloat32Array()),o&bt&&(i.side=e.readU8()),o&yn&&(i.points=!0),o&xt&&(i.renderOrder=e.readI32()),o&kt){i.uvs=e.readFloat32Array();const s=e.readString()||"image/png",l=e.readU32();i.texture={mimeType:s,bytes:e.readBytes(l)}}return i}const Et=1329939265,An=1,Rr=5e5,as=1e5,Nr=1,Xr=2,$r=3,Vr=4,Yr=5,Gr=6,jr=7;function Ln(e){var t;switch(e.kind){case"line":return 37;case"circle":return 30;case"arc":return 46;case"ellipse":return 71;case"point":return 21;case"path":return 10+e.vertices.length*8;case"spline":return 10+(e.controlPoints.length+e.knots.length+e.weights.length+(((t=e.fitPoints)==null?void 0:t.length)??0))*8+16;default:return e}}function Zr(e,t){if(e.length===0)return[];const n=[];let r=[],a=64;const o=()=>{r.length!==0&&(n.push(r),r=[],a=64)};for(const i of e){const s=Ln(i);r.length>0&&a+s>t&&o(),r.push(i),a+=s}return o(),n}function xe(e){const t=new ot;t.writeU32(Et),t.writeU8(An),t.writeU8(0),t.writeU8(0),t.writeU8(0);const n=[],r=new Map,a=o=>{const i=r.get(o);if(i!=null)return i;const s=n.length;return n.push(o),r.set(o,s),s};for(const o of e.primitives)a(o.layer);t.writeU32(n.length);for(const o of n)t.writeString(o);t.writeU32(e.primitives.length);for(const o of e.primitives)is(t,o,a(o.layer));return t.toUint8Array()}function Ct(e){const t=new it(e);if(t.readU32()!==Et)throw new Error("Invalid osnap catalog magic");const r=t.readU8();if(t.readU8(),t.readU8(),t.readU8(),r!==An)throw new Error(`Unsupported osnap catalog version: ${r}`);const a=t.readU32();if(a>as)throw new Error("Osnap layer count exceeds limit");const o=[];for(let l=0;l<a;l++)o.push(t.readString());const i=t.readU32();if(i>Rr)throw new Error("Osnap primitive count exceeds limit");const s=[];for(let l=0;l<i;l++)s.push(ss(t,o));return{primitives:s}}function Kr(e){const t=xe(e),n=ve(t).bytes;return{uncompressed:t,compressed:n}}async function os(e){const t=xe(e),n=(await pn(t)).bytes;return{uncompressed:t,compressed:n}}function Wr(e){return Ct(ct(e))}function qr(e){return fn(e)?Wr(e):Ct(e)}function En(e,t){e.writeU8(t<0?0:1)}function Cn(e){return e.readU8()===0?-1:1}function He(e,t){e.writeU32(t.length);for(const n of t)e.writeF64(n)}function Oe(e){const t=e.readU32();if(t>Rr)throw new Error("Float64 array count exceeds limit");const n=[];for(let r=0;r<t;r++)n.push(e.readF64());return n}function is(e,t,n){switch(t.kind){case"line":e.writeU8(Nr),e.writeU32(n),e.writeF64(t.x0),e.writeF64(t.y0),e.writeF64(t.x1),e.writeF64(t.y1);return;case"circle":e.writeU8(Xr),e.writeU32(n),e.writeF64(t.cx),e.writeF64(t.cy),e.writeF64(t.r),En(e,t.normalSign);return;case"arc":e.writeU8($r),e.writeU32(n),e.writeF64(t.cx),e.writeF64(t.cy),e.writeF64(t.r),e.writeF64(t.startAngle),e.writeF64(t.endAngle),En(e,t.normalSign);return;case"ellipse":e.writeU8(Vr),e.writeU32(n),e.writeF64(t.cx),e.writeF64(t.cy),e.writeF64(t.majorX),e.writeF64(t.majorY),e.writeF64(t.majorR),e.writeF64(t.minorR),e.writeF64(t.startAngle),e.writeF64(t.endAngle),e.writeU8(t.closed?1:0),En(e,t.normalSign??1);return;case"spline":e.writeU8(Yr),e.writeU32(n),He(e,t.controlPoints),e.writeU32(t.degree),He(e,t.knots),He(e,t.weights),e.writeU8(t.closed?1:0),He(e,t.fitPoints??[]);return;case"point":e.writeU8(Gr),e.writeU32(n),e.writeF64(t.x),e.writeF64(t.y);return;case"path":e.writeU8(jr),e.writeU32(n),e.writeU8(t.closed?1:0),He(e,t.vertices);return;default:{const r=t;throw new Error(`Unsupported osnap primitive: ${String(r)}`)}}}function ss(e,t){const n=e.readU8(),r=e.readU32(),a=t[r];if(a==null)throw new Error(`Invalid osnap layer index: ${r}`);switch(n){case Nr:return{kind:"line",layer:a,x0:e.readF64(),y0:e.readF64(),x1:e.readF64(),y1:e.readF64()};case Xr:return{kind:"circle",layer:a,cx:e.readF64(),cy:e.readF64(),r:e.readF64(),normalSign:Cn(e)};case $r:return{kind:"arc",layer:a,cx:e.readF64(),cy:e.readF64(),r:e.readF64(),startAngle:e.readF64(),endAngle:e.readF64(),normalSign:Cn(e)};case Vr:return{kind:"ellipse",layer:a,cx:e.readF64(),cy:e.readF64(),majorX:e.readF64(),majorY:e.readF64(),majorR:e.readF64(),minorR:e.readF64(),startAngle:e.readF64(),endAngle:e.readF64(),closed:e.readU8()!==0,normalSign:Cn(e)};case Yr:{const o=Oe(e),i=e.readU32(),s=Oe(e),l=Oe(e),d=e.readU8()!==0,c=Oe(e);return{kind:"spline",layer:a,controlPoints:o,degree:i,knots:s,weights:l,closed:d,...c.length>0?{fitPoints:c}:{}}}case Gr:return{kind:"point",layer:a,x:e.readF64(),y:e.readF64()};case jr:{const o=e.readU8()!==0,i=Oe(e);return{kind:"path",layer:a,closed:o,vertices:i}}default:throw new Error(`Unsupported osnap primitive kind: ${n}`)}}const Jr=1480934209;function Qr(e){if(e.version!==D)throw new Error(`Unsupported snapshot version: ${e.version}`);const t=new ot;t.writeU32(Jr),t.writeU8(D),t.writeU8(0),t.writeU8(0),t.writeU8(0),t.writeJson(ls(e)),t.writeJson(e.layers),t.writeString(e.activeLayoutBtrId),t.writeU32(e.layouts.length);for(const n of e.layouts)ds(t,n);return t.toUint8Array()}function ea(e){const t=new it(e);if(t.readU32()!==Jr)throw new Error("Invalid snapshot magic");const r=t.readU8();if(t.readU8(),t.readU8(),t.readU8(),r!==D)throw new Error(`Unsupported snapshot version: ${r}`);const a=t.readJson(),o=t.readJson(),i=t.readString(),s=t.readU32(),l=[];for(let d=0;d<s;d++)l.push(ms(t));return cs(l,a.savedViews),{version:D,meta:a,layers:o,layouts:l,activeLayoutBtrId:i}}function ls(e){const t={...e.meta.savedViews??{}};for(const n of e.layouts)n.savedView&&(t[n.btrId]=n.savedView);if(Object.keys(t).length===0){if(e.meta.savedViews==null)return e.meta;const{savedViews:n,...r}=e.meta;return r}return{...e.meta,savedViews:t}}function cs(e,t){if(t)for(const n of e){if(n.savedView)continue;const r=t[n.btrId];r&&(n.savedView=r)}}function ds(e,t){e.writeString(t.btrId),e.writeString(t.name),e.writeU8(t.isModelSpace?1:0),us(e,t.osnap),e.writeJson(t.viewports??null),e.writeU32(t.lineBatches.length);for(const n of t.lineBatches)vn(e,n);e.writeU32(t.meshBatches.length);for(const n of t.meshBatches)xn(e,n)}function us(e,t){if(!t||t.primitives.length===0){e.writeU32(0);return}const n=xe(t);e.writeU32(n.length),e.writeBytes(n)}function ms(e){const t=e.readString(),n=e.readString(),r=e.readU8()!==0,a=fs(e),o=ps(e.readJson()),i=e.readU32(),s=[];for(let c=0;c<i;c++)s.push(bn(e));const l=e.readU32(),d=[];for(let c=0;c<l;c++)d.push(kn(e));return{btrId:t,name:n,isModelSpace:r,lineBatches:s,meshBatches:d,osnap:a,viewports:o}}function ps(e){if(e!=null){if(Array.isArray(e))return e;if(typeof e=="object")return e.viewports??void 0}}function fs(e){const t=e.readU32();if(t===0)return;const n=e.readBytes(t);if(hs(n))return Ct(n);const r=dn(n);if(!(r.length===0||r==="null"))return JSON.parse(r)}function hs(e){return e.length<4?!1:(e[0]|e[1]<<8|e[2]<<16|e[3]<<24)>>>0===Et}const gs="application/vnd.mlightcad.acex-snapshot+binary";function ta(e){if(e.version!==D)throw new Error(`Unsupported snapshot version: ${e.version}`);const t=Qr(e),n=ve(t);return{payload:be(n.bytes,"base85"),compression:n.compression}}function ws(e,t="base85"){return na(ra(e,t))}function na(e){const t=ct(e);return ea(t)}function ra(e,t="base85"){const n=t==="base64"||t==="base85"?t:gn(t);return Fe(e,n)}function aa(){return gs}function te(e,t,n){if(n<=0)return new Float32Array(0);if(e instanceof Float32Array)return e.subarray(t,t+n).slice();const r=new Float32Array(n);for(let a=0;a<n;a++)r[a]=e[t+a];return r}function oa(e,t,n){if(n<=0)return new Uint32Array(0);const r=new Uint32Array(n);for(let a=0;a<n;a++)r[a]=e[t+a];return r}function Sn(e,t){if(t.length===0)return{positions:e,indices:t};let n=0;for(let a=0;a<t.length;a++){const o=t[a];o>n&&(n=o)}const r=(n+1)*3;return r>=e.length?{positions:e,indices:t}:{positions:te(e,0,r),indices:t}}function Ue(e,t){return e+t}const ke={x:0,y:0,z:0};function ia(e){e.updateMatrixWorld(!0);const t=e.matrixWorld.elements;return ke.x=t[12],ke.y=t[13],ke.z=t[14],[ke.x,ke.y,ke.z]}function St(e,t){const n=t.elements,r=e.positions;if(r.length===0)return{positions:new Float32Array(0),indices:e.indices};const a=new Float32Array(r.length);for(let o=0;o<r.length;o+=3){const i=r[o],s=r[o+1],l=r[o+2];a[o]=n[0]*i+n[4]*s+n[8]*l+n[12],a[o+1]=n[1]*i+n[5]*s+n[9]*l+n[13],a[o+2]=n[2]*i+n[6]*s+n[10]*l+n[14]}return{positions:a,indices:e.indices?new Uint32Array(e.indices):void 0}}function sa(e,t){const n=t*3;return Number.isFinite(e[n])&&Number.isFinite(e[n+1])&&Number.isFinite(e[n+2])}function pe(e,t){const n=e.positions,r=n.length/3|0;if(r===0||t<=0)return e;let a=!1;for(let s=0;s<n.length;s++)if(!Number.isFinite(n[s])){a=!0;break}if(!a)return e;const o=e.indices;if(o&&o.length>0){const s=[];for(let u=0;u+t<=o.length;u+=t){let f=!0;for(let p=0;p<t;p++){const h=o[u+p];if(h<0||h>=r||!sa(n,h)){f=!1;break}}if(f)for(let p=0;p<t;p++)s.push(o[u+p])}if(s.length===0)return{positions:new Float32Array(0)};const l=new Int32Array(r);l.fill(-1);const d=[],c=new Uint32Array(s.length);for(let u=0;u<s.length;u++){const f=s[u];let p=l[f];if(p<0){p=d.length/3,l[f]=p;const h=f*3;d.push(n[h],n[h+1],n[h+2])}c[u]=p}return{positions:Float32Array.from(d),indices:c}}const i=[];for(let s=0;s+t<=r;s+=t){let l=!0;for(let d=0;d<t;d++)if(!sa(n,s+d)){l=!1;break}if(l)for(let d=0;d<t;d++){const c=(s+d)*3;i.push(n[c],n[c+1],n[c+2])}}return i.length===0?{positions:new Float32Array(0)}:{positions:Float32Array.from(i)}}function Mt(e){const t=e.positions;if(t.length<3)return{slice:e,offset:[0,0,0]};let n=1/0,r=1/0,a=1/0,o=-1/0,i=-1/0,s=-1/0,l=0;for(let u=0;u<t.length;u+=3){const f=t[u],p=t[u+1],h=t[u+2];!Number.isFinite(f)||!Number.isFinite(p)||!Number.isFinite(h)||(l++,n=Math.min(n,f),r=Math.min(r,p),a=Math.min(a,h),o=Math.max(o,f),i=Math.max(i,p),s=Math.max(s,h))}if(l===0)return{slice:{positions:new Float32Array(0)},offset:[0,0,0]};const d=[(n+o)/2,(r+i)/2,(a+s)/2],c=new Float32Array(t.length);for(let u=0;u<t.length;u+=3){const f=t[u],p=t[u+1],h=t[u+2];if(!Number.isFinite(f)||!Number.isFinite(p)||!Number.isFinite(h)){c[u]=0,c[u+1]=0,c[u+2]=0;continue}c[u]=f-d[0],c[u+1]=p-d[1],c[u+2]=h-d[2]}return{slice:{positions:c,indices:e.indices?new Uint32Array(e.indices):void 0},offset:d}}function la(e,t,n={}){e.updateMatrixWorld(!0);const r=St(t,e.matrixWorld);return Mt(r)}let ca;function ys(e){ca=e}function da(e){const t=e.image;if(!t)return;if(typeof document>"u")return vs(t);const n=document.createElement("canvas"),r=n.getContext("2d");if(!r)return;try{if(t instanceof ImageData)n.width=t.width,n.height=t.height,r.putImageData(t,0,0);else if(ua(t)){n.width=t.width,n.height=t.height;const l=ks(t.data,t.width*t.height),d=new ImageData(new Uint8ClampedArray(l),t.width,t.height);r.putImageData(d,0,0)}else if(bs(t)){const l=xs(t);if(!l)return;n.width=l.width,n.height=l.height,r.drawImage(t,0,0)}else return}catch{return}const a=n.toDataURL("image/png"),o=a.indexOf(",");if(o<0)return;const i=atob(a.slice(o+1)),s=new Uint8Array(i.length);for(let l=0;l<i.length;l++)s[l]=i.charCodeAt(l);return{mimeType:"image/png",bytes:s}}function vs(e){const t=ca;if(!(!t||!ua(e)))try{const n=t(e);return n!=null&&n.byteLength?{mimeType:"image/png",bytes:n}:void 0}catch{return}}function bs(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement}function ua(e){if(!e||typeof e!="object")return!1;const t=e;return t.data!=null&&typeof t.width=="number"&&typeof t.height=="number"&&t.width>=1&&t.height>=1}function xs(e){let t=Number(e.width),n=Number(e.height);if(e instanceof HTMLImageElement?(t=e.naturalWidth||e.width,n=e.naturalHeight||e.height):typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement&&(t=e.videoWidth||e.width,n=e.videoHeight||e.height),!(!Number.isFinite(t)||!Number.isFinite(n)||t<1||n<1))return{width:t,height:n}}function ks(e,t){const n=t*4;if(e instanceof Uint8ClampedArray&&e.length>=n)return e.length===n?e:e.subarray(0,n);const r=new Uint8ClampedArray(n),a=Math.min(n,e.length);for(let o=0;o<a;o++)r[o]=e[o];if(e.length>=t*3&&e.length<n)for(let o=t-1;o>=0;o--){const i=o*3,s=o*4;r[s]=e[i],r[s+1]=e[i+1],r[s+2]=e[i+2],r[s+3]=255}return r}function ma(e,t){const n=e.getAttribute("uv");if(!n||n.count===0||n.itemSize<2)return;const a=Math.floor(t.length/3)*2;if(a<=0)return;const o=n.array;if(!(n.count*n.itemSize<a))return te(o,0,a)}function Mn(e){const t=e;return t.map?!1:t.transparent===!0&&typeof t.opacity=="number"&&t.opacity<.01}function pa(e,t={}){const n=new Blob([e.bytes],{type:e.mimeType||"image/png"}),r=URL.createObjectURL(n),a=new E.TextureLoader().load(r,o=>{var i;URL.revokeObjectURL(r),(i=t.onLoad)==null||i.call(t,o)},void 0,()=>{var o;URL.revokeObjectURL(r),(o=t.onError)==null||o.call(t)});return a.colorSpace=E.SRGBColorSpace,a.needsUpdate=!0,a}function fa(e){e&&(e.bytes=new Uint8Array(0))}const Pn={value:1};function _n(e){const t=e;if(t.isShaderMaterial===!0||e.type==="ShaderMaterial")return t}function ha(e){var o;const t=_n(e);if(!t)return;const n=t.uniforms.pattern,r=t.uniforms.patternLength;if(!n||!r)return;const a=n.value;if(!(!Array.isArray(a)||a.length===0))return{pattern:[...a],patternLength:Number(r.value),viewportScale:Number(((o=t.uniforms.u_viewportScale)==null?void 0:o.value)??1)}}function ga(e){var a;const t=_n(e);if(!t)return;const n=t.uniforms.u_patternLines;if(!n)return;const r=n.value;if(!(!Array.isArray(r)||r.length===0))return{patternAngle:Number(((a=t.uniforms.u_patternAngle)==null?void 0:a.value)??0),patternLines:r.map(As)}}function wa(e){var o,i,s,l,d;const t=_n(e);if(!t||t.uniforms.u_patternLines)return;const n=(o=t.uniforms.u_startColor)==null?void 0:o.value,r=(i=t.uniforms.u_endColor)==null?void 0:i.value,a=t.uniforms.u_gradientType;if(!(!(n!=null&&n.getHex)||a==null))return{startColor:n.getHex(),endColor:((s=r==null?void 0:r.getHex)==null?void 0:s.call(r))??n.getHex(),angle:Number(((l=t.uniforms.u_angle)==null?void 0:l.value)??0),shift:Number(((d=t.uniforms.u_shift)==null?void 0:d.value)??0),gradientType:Number(a.value)}}function As(e){return{angle:e.angle,base:[e.base.x,e.base.y],offset:[e.offset.x,e.offset.y],dashLengths:[...e.dashLengths],patternLength:e.patternLength}}function Ls(e){return{angle:e.angle,base:new E.Vector2(e.base[0],e.base[1]),offset:new E.Vector2(e.offset[0],e.offset[1]),dashLengths:[...e.dashLengths],patternLength:e.patternLength}}function Pt(e){const t=e.length/3;if(t<2)return new Float32Array(0);const n=new Float32Array(t);for(let r=0;r<t;r+=2){r===0?n[r]=0:n[r]=n[r-1];const a=e[r*3],o=e[r*3+1],i=e[r*3+2]??0,s=e[(r+1)*3],l=e[(r+1)*3+1],d=e[(r+1)*3+2]??0,c=s-a,u=l-o,f=d-i;n[r+1]=n[r]+Math.sqrt(c*c+u*u+f*f)}return n}function Es(e){const t=e.getAttribute("lineDistance");if(!t||t.count===0)return;if(e.getIndex()){const d=t.array;return te(d,0,t.count)}const r=e.drawRange,a=t.count,o=Math.max(0,Math.min(Math.floor(r.start),a)),i=Math.max(0,a-o),s=!Number.isFinite(r.count)||r.count<=0?i:Math.min(Math.floor(r.count),i);if(s<=0)return;const l=t.array;return te(l,o,s)}function ya(e,t){const n=e.getAttribute(t);if(!n||n.count===0)return;const r=n.itemSize;if(e.getIndex()){const u=n.array;return te(u,0,n.count*r)}const o=e.drawRange,i=n.count,s=Math.max(0,Math.min(Math.floor(o.start),i)),l=Math.max(0,i-s),d=!Number.isFinite(o.count)||o.count<=0?l:Math.min(Math.floor(o.count),l);if(d<=0)return;const c=n.array;return te(c,s*r,d*r)}function Cs(e,t){if(e.lineWidth!=null&&e.lineWidth>0){const n=new vr.LineMaterial({color:e.color,linewidth:e.lineWidth});return t&&n.resolution.copy(t),n}return e.linePattern?I.AcTrLinePatternShaders.createLineShaderMaterialFromScaledPattern(e.linePattern.pattern,e.linePattern.patternLength,e.color,e.linePattern.viewportScale,Pn):new E.LineBasicMaterial({color:e.color})}function Ss(e){return new E.PointsMaterial({color:e.color,size:1,sizeAttenuation:!1})}function In(e,t){const n=t[0],r=t[1],a=t[4],o=t[5],i=t[12],s=t[13],l=Math.atan2(r,n),d=(f,p)=>[n*f+a*p+i,r*f+o*p+s],c=(f,p)=>[n*f+a*p,r*f+o*p],u=(f,p,h)=>{const g=Math.cos(h),y=Math.sin(h);return[g*f-y*p,y*f+g*p]};return{patternAngle:e.patternAngle,patternLines:e.patternLines.map(f=>{const p=f.angle+e.patternAngle,h=f.angle+l,g=h+e.patternAngle,[y,b]=c(Math.cos(p),Math.sin(p)),w=Math.hypot(y,b),[A,k]=u(f.offset[0],f.offset[1],p),[M,C]=c(A,k),P=u(M,C,-g);return{angle:h,base:d(f.base[0],f.base[1]),offset:P,dashLengths:f.dashLengths.map(L=>L*w),patternLength:f.patternLength*w}})}}function va(e,t){return{patternAngle:e.patternAngle,patternLines:e.patternLines.map(n=>{const r=new E.Vector2(n.base[0]-t[0],n.base[1]-t[1]),a=new E.Vector2(n.offset[0],n.offset[1]);return I.wrapPatternBaseToLocalFrame(r,a,n.angle,e.patternAngle,n.patternLength),{angle:n.angle,base:[r.x,r.y],offset:[n.offset[0],n.offset[1]],dashLengths:[...n.dashLengths],patternLength:n.patternLength}})}}function Ms(e,t={}){if(e.hatchPattern&&e.hatchPattern.patternLines.length>0)try{const n=e.hatchPattern.patternLines.map(Ls);return I.createHatchPatternShaderMaterial(n,e.hatchPattern.patternAngle,Pn,new E.Color(e.color),0,e.side??E.FrontSide)}catch{}if(e.gradientFill&&e.gradientPositions&&e.gradientPositions.length>=2)try{return I.createGradientHatchShaderMaterialFromUniforms(e.gradientFill,e.side??E.FrontSide)}catch{}if(e.texture&&e.uvs&&e.uvs.length>=2){const n=new E.MeshBasicMaterial({color:16777215,side:E.DoubleSide,transparent:!0,opacity:0,depthWrite:!1});return n.map=pa(e.texture,{onLoad:()=>{var r;fa(e.texture),n.opacity=1,n.depthWrite=!0,n.needsUpdate=!0,(r=t.onTextureLoad)==null||r.call(t)}}),n}return new E.MeshBasicMaterial({color:e.color,side:E.DoubleSide})}function Bn(e,t){return!Number.isFinite(e)||e<0?0:Math.min(Math.floor(e),t)}function Tn(e,t,n){const r=Math.max(0,t-n);return!Number.isFinite(e)||e<=0?r:Math.min(Math.floor(e),r)}function De(e){const t=e.getAttribute("position");if(!t)return{positions:new Float32Array(0)};const n=e.drawRange,r=t.array,a=t.itemSize,o=e.getIndex();if(o){const d=te(r,0,t.count*a),c=o.array,u=Bn(n.start,o.count),f=Tn(n.count,o.count,u),p=oa(c,u,f);return Sn(d,p)}const i=Bn(n.start,t.count),s=Tn(n.count,t.count,i);return{positions:te(r,i*a,s*a)}}function _t(e){return I.isBatchGeometryActive(e.flags)&&I.isBatchGeometryVisible(e.flags)}function ba(e){const{count:t}=e.mappingStats;for(let n=0;n<t;n++){let r;try{r=e.getGeometryRangeAt(n)}catch{continue}if(_t(r)&&r.bboxIntersectionCheck)return!0}return!1}function zn(e){return I.getSceneDrawableUserData(e).bboxIntersectionCheck===!0}function It(e,t){const n=t.getAttribute("position");if(!n)return{positions:new Float32Array(0)};const r=n.itemSize,a=n.array,o=t.getIndex(),{count:i}=e.mappingStats;if(o){const u=te(a,0,n.count*r),f=o.array;let p=0;const h=[];for(let b=0;b<i;b++){let w;try{w=e.getGeometryRangeAt(b)}catch{continue}const A=w.indexStart??0,k=w.indexCount??0;!_t(w)||k<=0||(h.push({start:A,count:k}),p+=k)}if(p===0)return{positions:new Float32Array(0)};const g=new Uint32Array(p);let y=0;for(const b of h)for(let w=0;w<b.count;w++)g[y++]=f[b.start+w];return Sn(u,g)}let s=0;const l=[];for(let u=0;u<i;u++){let f;try{f=e.getGeometryRangeAt(u)}catch{continue}if(!_t(f)||f.vertexCount<=0)continue;const p=f.vertexCount*r;l.push({start:f.vertexStart*r,floatCount:p}),s+=p}if(s===0)return{positions:new Float32Array(0)};const d=new Float32Array(s);let c=0;if(a instanceof Float32Array)for(const u of l)d.set(a.subarray(u.start,u.start+u.floatCount),c),c+=u.floatCount;else for(const u of l)for(let f=0;f<u.floatCount;f++)d[c++]=a[u.start+f];return{positions:d}}function xa(e,t,n){e.push(t.getX(n),t.getY(n),t.getZ(n))}function ka(e,t){const n=t.getAttribute("instanceStart"),r=t.getAttribute("instanceEnd");if(!n||!r)return{positions:new Float32Array(0)};const{count:a}=e.mappingStats,o=[];for(let i=0;i<a;i++){let s;try{s=e.getGeometryRangeAt(i)}catch{continue}if(!_t(s)||s.vertexCount<=0)continue;const l=s.vertexStart,d=l+s.vertexCount;for(let c=l;c<d;c++)xa(o,n,c),xa(o,r,c)}return{positions:new Float32Array(o)}}function Ps(e,t){const r=e.instanceCount;if(Number.isFinite(r)&&r>=0)return Math.min(Math.floor(r),t);const a=e.drawRange,o=Bn(a.start,t);return Tn(a.count,t,o)}function _s(e){const t=e.getAttribute("instanceStart"),n=e.getAttribute("instanceEnd");if(!t||!n||t.count===0)return{positions:new Float32Array(0)};const r=Ps(e,t.count);if(r<=0)return{positions:new Float32Array(0)};const a=[];for(let o=0;o<r;o++){const i=[t.getX(o),t.getY(o),t.getZ(o)],s=[n.getX(o),n.getY(o),n.getZ(o)];!i.every(Number.isFinite)||!s.every(Number.isFinite)||a.push(i[0],i[1],i[2],s[0],s[1],s[2])}return{positions:new Float32Array(a)}}function Bt(e,t){let n=e;for(;n&&n!==t;){if(n.visible===!1)return!1;n=n.parent}return!0}function Aa(e){if(e instanceof vr.LineMaterial)return e.linewidth}function Re(e){if("material"in e){const n=e.userData.originalMaterial??e.material;return Array.isArray(n)?n[0]:n}return e.material}function fe(e){var d;const t=I.getMaterialMetadata(e),n=t.layer??"0",r=e;let a=r.color!=null?r.color.getHex():t.color??16777215;const o=ha(e),i=ga(e),s=wa(e);if(e instanceof E.ShaderMaterial||e.type==="ShaderMaterial"){const u=(d=e.uniforms.u_color)==null?void 0:d.value;u!=null&&u.getHex?a=u.getHex():s&&(a=s.startColor)}return{color:a,layer:n,linePattern:o,hatchPattern:i,gradientFill:s,side:!!i||!!s?e.side:void 0}}function Is(e,t){const r=I.getMaterialMetadata(t).drawOrder??e.renderOrder;return r===0?void 0:r}function Ae(e,t,n){const r=Is(t,n);r!=null&&(e.renderOrder=r)}function Bs(e,t){if(!t)return;const n=e.userData.bakedWorldMatrix;return n&&n.length>=16?In(t,n):(e.updateMatrixWorld(!0),In(t,Array.from(e.matrixWorld.elements)))}function Tt(e){return ia(e)}function Fn(e,t,n={}){const r=la(e,t,n);return{...r.slice,offset:r.offset}}function Ts(e){if(e.indices&&e.indices.length>=3)return e;const t=e.positions.length/3|0;if(t<3||t%3!==0)return e;const n=new Uint32Array(t);for(let r=0;r<t;r++)n[r]=r;return{...e,indices:n}}function Ne(e,t,n,r,a,o=!1){o&&(r=Ts(r));const i=fe(t),s=Bs(n,i.hatchPattern),l=s?va(s,a):void 0,d=i.gradientFill?ya(e,"gradientPosition"):void 0,c={layer:i.layer,color:i.color,offset:a,hatchPattern:l,gradientFill:i.gradientFill,gradientPositions:d,side:i.side,...r},u=t;if(u.map){const f=da(u.map),p=ma(e,r.positions);if(!f||!p)return;c.texture=f,c.uvs=p,c.color=16777215,c.side=E.DoubleSide}return Ae(c,n,t),c}function zs(e){const t=ka(e,e.geometry);if(t.positions.length===0)return;const{color:n,layer:r}=fe(e.material),a=Aa(e.material),o={layer:r,color:n,offset:Tt(e),lineWidth:a,...t};return ba(e)&&(o.excludeFromOsnap=!0),Ae(o,e,e.material),o}function Fs(e){const t=It(e,e.geometry);if(t.positions.length===0)return;const{color:n,layer:r,linePattern:a}=fe(e.material),o=a?Pt(t.positions):void 0,i={layer:r,color:n,offset:Tt(e),linePattern:a,lineDistances:o,...t};return ba(e)&&(i.excludeFromOsnap=!0),Ae(i,e,e.material),i}function Hs(e){const t=It(e,e.geometry);if(t.positions.length!==0)return Ne(e.geometry,e.material,e,t,Tt(e),!0)}function Os(e){const t=It(e,e.geometry);if(t.positions.length===0)return;const n=Ne(e.geometry,e.material,e,t,Tt(e));if(n)return{points:!0,...n}}const de=new E.Matrix4,zt=new E.Matrix4,Xe=new E.Object3D;Xe.matrixAutoUpdate=!1;function Us(e){const t=e;return t.isInstancedMesh===!0&&t.instanceMatrix!=null&&typeof t.count=="number"&&t.geometry!=null}function Ds(e){return e.renderOrder<1e4||e.isInstancedMesh===!0?!1:I.getSceneDrawableUserData(e).sharesTemplateGeometry===!0}function Hn(e){const t=e.elements;for(let o=0;o<16;o++)if(!Number.isFinite(t[o]))return!1;const n=Math.hypot(t[0],t[1],t[2]),r=Math.hypot(t[4],t[5],t[6]),a=Math.hypot(t[8],t[9],t[10]);return n+r+a>=1e-8}function La(e,t){var f;const n=pe(De(e.geometry),t),r=n.positions.length;if(r===0)return;e.updateMatrixWorld(!0);const a=e.instanceMatrix.array,o=((f=n.indices)==null?void 0:f.length)??0;let i=0;for(let p=0;p<e.count;p++)de.fromArray(a,p*16),Hn(de)&&i++;if(i===0)return;const s=new Float32Array(i*r),l=n.indices!=null?new Uint32Array(i*o):void 0,d=r/3;let c=0;for(let p=0;p<e.count;p++){if(de.fromArray(a,p*16),!Hn(de))continue;zt.multiplyMatrices(e.matrixWorld,de);const h=St(n,zt);if(s.set(h.positions,c*r),l&&h.indices){const g=c*d;for(let y=0;y<h.indices.length;y++)l[c*o+y]=h.indices[y]+g}c++}const u=Mt(pe({positions:s,indices:l},t));if(u.slice.positions.length!==0)return{slice:u.slice,offset:u.offset}}function Rs(e){const t=fe(e),n=e;return!!(t.hatchPattern||t.gradientFill||n.map)}function Ns(e,t){e.updateMatrixWorld(!0);const n=e.instanceMatrix.array;for(let r=0;r<e.count;r++)de.fromArray(n,r*16),Hn(de)&&(zt.multiplyMatrices(e.matrixWorld,de),t(zt))}function Xs(e,t){const n=La(e,2);if(!n)return;const r=Re(e),{color:a,layer:o,linePattern:i}=fe(r),s=i?Pt(n.slice.positions):void 0,l={layer:o,color:a,offset:n.offset,linePattern:i,lineDistances:s,...n.slice};zn(e)&&(l.excludeFromOsnap=!0),Ae(l,e,r),t.push(l)}function Ea(e,t,n){const r=Re(e);if(!n&&Mn(r))return;if(!n&&Rs(r)){const i=pe(De(e.geometry),3);if(i.positions.length===0)return;Ns(e,s=>{const l=pe(St(i,s),3);if(l.positions.length===0)return;const d=Mt(l);Xe.matrix.copy(s),Xe.matrixWorld.copy(s),Xe.matrixWorldNeedsUpdate=!1;const c=Ne(e.geometry,r,Xe,d.slice,d.offset,!0);c&&t.push(c)});return}const a=La(e,n?1:3);if(!a)return;const o=Ne(e.geometry,r,e,a.slice,a.offset,!n);o&&t.push(n?{...o,points:!0}:o)}function Ft(e){const t=e;return e instanceof Si.LineSegments2||t.isLineSegments2===!0||e.type==="LineSegments2"}function Ca(e){const t=e;return e instanceof E.LineSegments||t.isLineSegments===!0||e.type==="LineSegments"}function Sa(e){const t=e;return e instanceof E.Mesh||t.isMesh===!0||t.isInstancedMesh===!0||e.type==="Mesh"}function Ma(e){const t=[],n=[];return e.traverse(r=>{if(!(I.isHighlightOverlayDescendant(r)||I.isHighlightCloneDrawable(r)||Ds(r))){if(Us(r)){if(!Bt(r,e))return;r.isPoints===!0?Ea(r,n,!0):Ca(r)&&!Ft(r)?Xs(r,t):Sa(r)&&!Ft(r)&&Ea(r,n,!1);return}if(r instanceof I.AcTrBatchedLine){const a=Fs(r);a&&t.push(a);return}if(r instanceof I.AcTrBatchedLine2){const a=zs(r);a&&t.push(a);return}if(r instanceof I.AcTrBatchedMesh){const a=Hs(r);a&&n.push(a);return}if(r instanceof I.AcTrBatchedPoint){const a=Os(r);a&&n.push(a);return}if(Ft(r)){if(!Bt(r,e))return;const a=_s(r.geometry);if(a.positions.length===0)return;const o=Re(r),{color:i,layer:s}=fe(o),{offset:l,...d}=Fn(r,a),c={layer:s,color:i,offset:l,lineWidth:Aa(o),...d};zn(r)&&(c.excludeFromOsnap=!0),Ae(c,r,o),t.push(c)}else if(Ca(r)&&!(r instanceof I.AcTrBatchedLine)){if(!Bt(r,e))return;const a=pe(De(r.geometry),2);if(a.positions.length===0)return;const o=Re(r),{color:i,layer:s,linePattern:l}=fe(o),{offset:d,...c}=Fn(r,a),u=l?Pt(c.positions):void 0,f={layer:s,color:i,offset:d,linePattern:l,lineDistances:u,...c};zn(r)&&(f.excludeFromOsnap=!0),Ae(f,r,o),t.push(f)}else if(Sa(r)&&!Ft(r)&&!(r instanceof I.AcTrBatchedMesh)){if(!Bt(r,e))return;const a=Re(r);if(Mn(a))return;const o=pe(De(r.geometry),3);if(o.positions.length===0)return;const{offset:i,...s}=Fn(r,o),l=Ne(r.geometry,a,r,s,i,!0);l&&n.push(l)}}}),{lineBatches:t,meshBatches:n}}const Pa={size:8,colorCss:"#0080ff",hotColorCss:"#ff0000"};function _a(e){const t=new v.AcCmColor(v.AcCmColorMethod.ByACI,e);return t.cssColor??`rgb(${t.red}, ${t.green}, ${t.blue})`}function $s(e){try{const t=v.AcDbSysVarManager.instance(),n=t.getVar(v.AcDbSystemVariables.GRIPSIZE,e),r=t.getVar(v.AcDbSystemVariables.GRIPCOLOR,e),a=t.getVar(v.AcDbSystemVariables.GRIPHOT,e);return!(n>0)||!Number.isFinite(n)?Pa:{size:n,colorCss:_a(r),hotColorCss:_a(a)}}catch{return Pa}}function On(e,t){const n=e.extmin,r=e.extmax,a=$s(e);return{title:t==null?void 0:t.title,extents:{minX:n.x,minY:n.y,maxX:r.x,maxY:r.y},units:{insunits:e.insunits,lunits:e.lunits,luprec:e.luprec,aunits:e.aunits,auprec:e.auprec,measurement:e.measurement,ltscale:e.ltscale,angbase:e.angbase,angdir:e.angdir},grip:a,background:(t==null?void 0:t.background)??0}}const Vs=["endpoint","midpoint","center","quadrant","intersection","nearest"];function Un(e,t){let n=t-e;for(;n<=0;)n+=v.TAU;for(;n>v.TAU;)n-=v.TAU;return n}function Dn(e,t,n,r,a){const o=a===-1?-1:1;return new v.AcGePoint2d(e+o*n*Math.cos(r),t+n*Math.sin(r))}function Rn(e,t,n,r,a){return Math.atan2(r-t,a*(n-e))}function Ia(e){const t=Dn(e.cx,e.cy,e.r,e.startAngle,e.normalSign),n=Dn(e.cx,e.cy,e.r,e.endAngle,e.normalSign),r=Un(e.startAngle,e.endAngle),a=e.normalSign*Math.tan(r/4);return new v.AcGeCircArc2d(t,n,a)}function Ba(e){return Un(e.startAngle,e.endAngle)}function Ys(e,t){const n=Ba(e),r=e.startAngle+t*n,a=e.normalSign??1,o=e.majorR*Math.cos(r),i=a*e.minorR*Math.sin(r),s=e.majorX,l=e.majorY;return new v.AcGePoint2d(e.cx+o*s-i*l,e.cy+o*l+i*s)}function Ta(e){return e.kind==="circle"?new v.AcGeCircArc2d({x:e.cx,y:e.cy},e.r,0,v.TAU,e.normalSign===-1):Ia(e)}function za(e){const t=Math.atan2(e.majorY,e.majorX);return new v.AcGeEllipseArc2d({x:e.cx,y:e.cy,z:0},e.majorR,e.minorR,e.startAngle,e.endAngle,e.closed,t)}function Fa(e){const t=[];for(let n=0;n+1<e.controlPoints.length;n+=2)t.push({x:e.controlPoints[n],y:e.controlPoints[n+1],z:0});return new v.AcGeNurbsCurve(e.degree,e.knots,t,e.weights.length>0?e.weights:void 0)}function Gs(e){switch(e.kind){case"line":return{kind:"line",curve:new v.AcGeLine2d({x:e.x0,y:e.y0},{x:e.x1,y:e.y1})};case"circle":case"arc":return{kind:"circArc",curve:Ta(e)};case"ellipse":return{kind:"ellipse",curve:za(e)};case"spline":return{kind:"spline",curve:Fa(e)};case"point":return{kind:"point",point:new v.AcGePoint2d(e.x,e.y)};case"path":throw new Error("path primitives must be expanded before curve conversion")}}function Nn(e){return e.z>=0?1:-1}function Ha(e,t,n){if(!(n.radius>0)||!Number.isFinite(n.radius))return;const r=n.clockwise?-1:1,a=n.center.x,o=n.center.y;e.push({kind:"arc",layer:t,cx:a,cy:o,r:n.radius,startAngle:Rn(a,o,n.startPoint.x,n.startPoint.y,r),endAngle:Rn(a,o,n.endPoint.x,n.endPoint.y,r),normalSign:r})}function H(e,t){const n=new E.Vector3(t.x,t.y,t.z??0).applyMatrix4(e);return{x:n.x,y:n.y}}function js(e){const t=e.elements;return new E.Matrix4(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])}function Ht(e,t){return new E.Matrix4().multiplyMatrices(e,js(t))}function Oa(e,t){const n=new E.Vector3(t.x,t.y,t.z??0).transformDirection(e).normalize();return{x:n.x,y:n.y}}function Xn(e){const t=new E.Vector3(e.elements[0],e.elements[1],e.elements[2]).length(),n=new E.Vector3(e.elements[4],e.elements[5],e.elements[6]).length();return v.AcGeTol.equal(t,n,v.FLOAT_TOL*Math.max(t,n,1))}function Zs(e,t){const n=e.tables.blockTable.getIdAt(t);if(n)return n;for(const a of e.tables.blockTable.newIterator())if(a.objectId===t)return a;const r=e.tables.blockTable.modelSpace;if(r.objectId===t)return r}function Ks(e){if(e instanceof v.AcDbLine)return!0;const t=e;return(t.type==="LINE"||t.type==="Line")&&t.startPoint!=null&&t.endPoint!=null}function Ws(e,t,n,r){r.startPoint,r.endPoint}function Ua(e,t){return e.blockTableRecord??(e.blockName?t.tables.blockTable.getAt(e.blockName):void 0)}function qs(e,t){const n=e.dimBlockId;return n?t.tables.blockTable.getAt(n):void 0}function Js(e,t){const r=Ua(e,t);if(r)return r;const a=e.owningBlockRecordId;return a?t.tables.blockTable.getAt(a):void 0}function Da(e){return e.getFullInsertionTransform()}function Qs(e){for(const t of e.newIterator())return!0;return!1}function el(e){return typeof e.getFullInsertionTransform=="function"&&"blockTableRecord"in e}function Kd(e,t,n,r,a){}function Wd(e,t,n,r,a,o){}function ue(e,t,n,r,a){if(r.length<2)return;const o=Xn(n),s=n.elements[0]*n.elements[5]-n.elements[4]*n.elements[1]<0?-1:1,l=[];for(const d of r){const c=H(n,d);let u=d.bulge??0;v.AcGeTol.isPositive(Math.abs(u))&&(u=o?u*s:0),l.push(c.x,c.y,u)}e.push({kind:"path",layer:t,closed:a,vertices:l})}function Ra(e,t){return v.AcGeTol.equal(e.x,t.x)&&v.AcGeTol.equal(e.y,t.y)}function tl(e){return(e.clockwise?-1:1)*Math.tan(e.deltaAngle/4)}function Na(e,t,n,r){if(e.length===0){e.push({x:t.x,y:t.y,z:t.z??0,bulge:r}),e.push({x:n.x,y:n.y,z:n.z??0,bulge:0});return}const a=e[e.length-1];Ra(a,t)?a.bulge=r:(a.bulge=0,e.push({x:t.x,y:t.y,z:t.z??0,bulge:r})),e.push({x:n.x,y:n.y,z:n.z??0,bulge:0})}function Xa(e){return e.length>=2&&Ra(e[0],e[e.length-1])&&e.pop(),e}function $e(e,t,n,r,a){if(r.length<2)return;const o=a?r.length:r.length-1;for(let i=0;i<o;i++)r[i],r[(i+1)%r.length]}function nl(e,t,n,r){const a=[r.startPosition];for(const o of r.segments)a.push(o.position);$e(e,t,n,a,r.closed)}function rl(e,t,n){if(n.vertices.length>=2)return n.vertices;if(n.vertices.length===0)return[];const r=n.vertices[0],a=t.lastLeaderLinePoint??t.landingPoint??e.landingPoint??e.contentBasePosition;if(!a)return n.vertices;const o=r.x-a.x,i=r.y-a.y,s=(r.z??0)-(a.z??0);return Math.hypot(o,i,s)<=v.FLOAT_TOL?n.vertices:[r,a]}function al(e,t,n,r){var o,i;for(const s of r.leaders)for(const l of s.leaderLines){const d=rl(r,s,l);$e(e,t,n,d,!1)}const a=s=>{if(!s)return;const l=H(n,s);e.push({kind:"point",layer:t,x:l.x,y:l.y})};a(r.contentBasePosition),a((o=r.mtextContent)==null?void 0:o.anchorPoint),a((i=r.blockContent)==null?void 0:i.position)}function ol(e,t,n,r){const a=r.numberOfVertices;if(a<2)return;const o=r.elevation,i=r.closed?a:a-1;for(let s=0;s<i;s++){const l=r.getPointAt(s),d=r.getPointAt((s+1)%a),c=r.getBulgeAt(s),u={x:l.x,y:l.y,z:o},f={x:d.x,y:d.y,z:o};if(v.AcGeTol.isPositive(Math.abs(c))){const p=H(n,u),h=H(n,f);Ha(e,t,new v.AcGeCircArc2d(p,h,c))}}}function il(e,t,n,r,a,o){const i=H(n,r),s=new E.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),l={kind:"circle",layer:t,cx:i.x,cy:i.y,r:a*s,normalSign:Nn(o)};e.push(l)}function sl(e,t,n,r){const a=H(n,r.center),o=new E.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),i={kind:"arc",layer:t,cx:a.x,cy:a.y,r:r.radius*o,startAngle:r.startAngle,endAngle:r.endAngle,normalSign:Nn(r.normal)};e.push(i)}function $n(e,t,n,r){const a=H(n,r.center),o=r._geo,i=(o==null?void 0:o.majorAxis)??{x:1,y:0,z:0},s=Oa(n,i),l=Math.hypot(s.x,s.y)||1,d=new E.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),c=new E.Vector3(n.elements[4],n.elements[5],n.elements[6]).length(),u={kind:"ellipse",layer:t,cx:a.x,cy:a.y,majorX:s.x/l,majorY:s.y/l,majorR:r.majorAxisRadius*d,minorR:r.minorAxisRadius*c,startAngle:r.startAngle,endAngle:r.endAngle,closed:r.closed,normalSign:Nn(r.normal)};e.push(u)}function ll(e,t,n,r){var s,l;const a=r._geo;if(!((s=a==null?void 0:a.controlPoints)!=null&&s.length))return;const o=[];for(const d of a.controlPoints){const c=H(n,d);o.push(c.x,c.y)}const i={kind:"spline",layer:t,controlPoints:o,degree:a.degree??3,knots:[...a.knots??[]],weights:[...a.weights??[]],closed:a.closed??!1};if((l=a.fitPoints)!=null&&l.length){i.fitPoints=[];for(const d of a.fitPoints){const c=H(n,d);i.fitPoints.push(c.x,c.y)}}e.push(i)}const $a=1e-6;function cl(e){var r;const t=e.elevation,n=(r=e._geo)==null?void 0:r.vertices;return n&&n.length>1?n.map(a=>({x:a.x,y:a.y,z:t,bulge:a.bulge,startWidth:a.startWidth,endWidth:a.endWidth})):Array.from({length:e.numberOfVertices},(a,o)=>{const i=e.getPoint2dAt(o);return{x:i.x,y:i.y,z:t,bulge:0}})}function dl(e){return e.some(t=>{const n=Math.max(0,t.startWidth??0),r=Math.max(0,t.endWidth??0);return n>$a||r>$a})}function ul(e,t,n,r){const a=cl(r),o=a.length;if(o<2)return;if(dl(a)){ue(e,t,n,a,r.closed);return}const i=r.closed?o:o-1;for(let s=0;s<i;s++){const l=a[s],d=a[(s+1)%o],c=l.bulge??0;if(v.AcGeTol.isPositive(Math.abs(c))){const u=H(n,l),f=H(n,d);Ha(e,t,new v.AcGeCircArc2d(u,f,c))}}}function ml(e,t,n,r,a){const o=H(n,{x:r.center.x,y:r.center.y,z:a}),i=Oa(n,{x:Math.cos(r.rotation),y:Math.sin(r.rotation),z:0}),s=Math.hypot(i.x,i.y)||1,l=new E.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),d=new E.Vector3(n.elements[4],n.elements[5],n.elements[6]).length();e.push({kind:"ellipse",layer:t,cx:o.x,cy:o.y,majorX:i.x/s,majorY:i.y/s,majorR:r.majorAxisRadius*l,minorR:r.minorAxisRadius*d,startAngle:r.startAngle,endAngle:r.endAngle,closed:!1,normalSign:r.clockwise?-1:1})}function pl(e,t,n,r,a){var s;const o=r.numberOfVertices;if(o<2)return;const i=[];for(let l=0;l<o;l++){const d=r.getPointAt(l);i.push({x:d.x,y:d.y,z:a,bulge:((s=r.vertices[l])==null?void 0:s.bulge)??0})}ue(e,t,n,i,r.closed)}function fl(e,t,n,r,a){if(r instanceof v.AcGePolyline2d){pl(e,t,n,r,a);return}if(!(r instanceof v.AcGeLoop2d))return;const o=[];let i=!1;const s=()=>{const d=Xa(o);d.length>=2&&ue(e,t,n,d,!1),o.length=0};for(const d of r.curves)d instanceof v.AcGeLine2d?Na(o,{x:d.startPoint.x,y:d.startPoint.y,z:a},{x:d.endPoint.x,y:d.endPoint.y,z:a},0):d instanceof v.AcGeCircArc2d?Na(o,{x:d.startPoint.x,y:d.startPoint.y,z:a},{x:d.endPoint.x,y:d.endPoint.y,z:a},tl(d)):d instanceof v.AcGeEllipseArc2d&&(i=!0,s(),ml(e,t,n,d,a));const l=Xa(o);l.length>=2&&ue(e,t,n,l,!i)}function hl(e,t,n,r){var i;const a=(i=r._geo)==null?void 0:i.loops;if(!(a!=null&&a.length))return;const o=r.elevation;for(const s of a)fl(e,t,n,s,o)}function gl(e,t,n,r){Ht(n,Da(r));const a=[0];for(let i=0;i<r.numColumns;i++)a.push(a[i]+r.columnWidth(i));const o=[0];for(let i=0;i<r.numRows;i++)o.push(o[i]-r.rowHeight(i));a[a.length-1],o[o.length-1];for(const i of o);for(const i of a);}function wl(e,t,n,r,a,o,i,s=!0){const l=Vn(e.layer,n);if(i&&!i(l))return;const d=Js(e,o);if(d&&!a.has(d.objectId)&&Qs(d)){a.add(d.objectId);const u=Ht(t,Da(e));Ot(d,u,l,r,a,o,i,s),a.delete(d.objectId);return}gl(r,l,t,e);const c=H(t,e.position);r.push({kind:"point",layer:l,x:c.x,y:c.y})}function yl(e,t,n,r){let a=r.boundaryPath();if(a.length>1){const i=a[0],s=a[a.length-1];i.x===s.x&&i.y===s.y&&(i.z??0)===(s.z??0)&&(a=a.slice(0,-1))}a.length>=2&&ue(e,t,n,a,!0);const o=H(n,r.position);e.push({kind:"point",layer:t,x:o.x,y:o.y})}function vl(e,t,n,r){const a=r.position();ue(e,t,n,[a.upperLeft,a.upperRight,a.lowerRight,a.lowerLeft],!0);const o=H(n,r.getLocation());e.push({kind:"point",layer:t,x:o.x,y:o.y})}function bl(e){var n;const t=(n=e.attributeIterator)==null?void 0:n.call(e);return t?typeof t.toArray=="function"?t.toArray():[...t]:[]}function Vn(e,t){return e==="0"?t:e}function Va(e,t,n,r,a,o,i,s=!0){if(!e.visibility)return;const l=Vn(e.layer,n);if(!(i&&!i(l))){if(e instanceof v.AcDbTable){wl(e,t,n,r,a,o,i,s);return}if(el(e)){const d=Ua(e,o);if(!d||a.has(d.objectId))return;a.add(d.objectId);const c=e.getFullInsertionTransform(),u=Math.max(1,e.columnCount??1),f=Math.max(1,e.rowCount??1),p=e.columnSpacing??0,h=e.rowSpacing??0,g=Vn(e.layer,n);for(let y=0;y<f;y++)for(let b=0;b<u;b++){const w=Ht(t,c);(b!==0||y!==0)&&w.multiply(new E.Matrix4().makeTranslation(b*p,y*h,0));const A=H(w,{x:0,y:0,z:0});r.push({kind:"point",layer:g,x:A.x,y:A.y}),Ot(d,w,g,r,a,o,i,s)}for(const y of bl(e))(y instanceof v.AcDbAttribute?y.isInvisible:y.isInvisible)||Va(y,t,g,r,a,o,i,s);a.delete(d.objectId);return}if(e instanceof v.AcDbDimension){const d=e,c=qs(d,o);if(!c||a.has(c.objectId))return;a.add(c.objectId);const u=Ht(t,d.getFullDimBlockTransform());Ot(c,u,l,r,a,o,i,!0),a.delete(c.objectId);return}if(Ks(e)){Ws(r,l,t,e);return}if(e instanceof v.AcDbCircle){Xn(t)?il(r,l,t,e.center,e.radius,e.normal):$n(r,l,t,xl(e));return}if(e instanceof v.AcDbArc){Xn(t)?sl(r,l,t,e):$n(r,l,t,kl(e));return}if(e instanceof v.AcDbEllipse){$n(r,l,t,e);return}if(e instanceof v.AcDbSpline){ll(r,l,t,e);return}if(e instanceof v.AcDbPolyline){ul(r,l,t,e);return}if(e instanceof v.AcDb2dPolyline){ol(r,l,t,e);return}if(e instanceof v.AcDb3dPolyline){const d=[];for(let c=0;c<e.numberOfVertices;c++)d.push(e.getPointAt(c));$e(r,l,t,d,e.closed);return}if(e instanceof v.AcDbHatch){s&&hl(r,l,t,e);return}if(e instanceof v.AcDbRay){e.basePoint,e.unitDir;return}if(e instanceof v.AcDbXline){e.basePoint,e.unitDir;return}if(e instanceof v.AcDbSolid){ue(r,l,t,[e.getPointAt(0),e.getPointAt(1),e.getPointAt(3),e.getPointAt(2)],!0);return}if(e instanceof v.AcDbTrace){s&&ue(r,l,t,[e.getPointAt(0),e.getPointAt(1),e.getPointAt(3),e.getPointAt(2)],!0);return}if(e instanceof v.AcDbFace){const d=e.subGetGripPoints();d.length>=2&&$e(r,l,t,d,d.length>=3);return}if(e instanceof v.AcDbLeader){const d=e.vertices;d.length>=2&&$e(r,l,t,d,!1);return}if(e instanceof v.AcDbMLine){nl(r,l,t,e);return}if(e instanceof v.AcDbMLeader){al(r,l,t,e);return}if(e instanceof v.AcDbText){const d=H(t,e.position);r.push({kind:"point",layer:l,x:d.x,y:d.y});return}if(e instanceof v.AcDbMText){const d=H(t,e.location);r.push({kind:"point",layer:l,x:d.x,y:d.y});return}if(e instanceof v.AcDbOle2Frame){s&&vl(r,l,t,e);return}if(e instanceof v.AcDbRasterImage){s&&yl(r,l,t,e);return}if(e instanceof v.AcDbPoint){const d=H(t,e.position);r.push({kind:"point",layer:l,x:d.x,y:d.y})}}}function Ot(e,t,n,r,a,o,i,s=!0){for(const l of e.newIterator())Va(l,t,n,r,a,o,i,s)}function xl(e){return new v.AcDbEllipse(e.center,e.normal,{x:1,y:0,z:0},e.radius,e.radius,0,v.TAU)}function kl(e){return new v.AcDbEllipse(e.center,e.normal,{x:1,y:0,z:0},e.radius,e.radius,e.startAngle,e.endAngle)}function Ya(e,t,n={}){const r=Zs(e,t);if(!r)return{primitives:[]};const a=[],o=new E.Matrix4;return Ot(r,o,"0",a,new Set,e,n.includeLayer),{primitives:a.filter(i=>i.kind!=="line"&&Al(i))}}function Al(e){switch(e.kind){case"line":return Number.isFinite(e.x0)&&Number.isFinite(e.y0)&&Number.isFinite(e.x1)&&Number.isFinite(e.y1);case"circle":return Number.isFinite(e.cx)&&Number.isFinite(e.cy)&&Number.isFinite(e.r);case"arc":return Number.isFinite(e.cx)&&Number.isFinite(e.cy)&&Number.isFinite(e.r)&&Number.isFinite(e.startAngle)&&Number.isFinite(e.endAngle);case"ellipse":return Number.isFinite(e.cx)&&Number.isFinite(e.cy)&&Number.isFinite(e.majorX)&&Number.isFinite(e.majorY)&&Number.isFinite(e.majorR)&&Number.isFinite(e.minorR)&&Number.isFinite(e.startAngle)&&Number.isFinite(e.endAngle);case"spline":return e.controlPoints.every(t=>Number.isFinite(t))&&e.knots.every(t=>Number.isFinite(t))&&e.weights.every(t=>Number.isFinite(t));case"point":return Number.isFinite(e.x)&&Number.isFinite(e.y);case"path":return e.vertices.length>=6&&e.vertices.length%3===0&&e.vertices.every(t=>Number.isFinite(t));default:return e}}const he=["en","zh","cs","tr","ar"],Yn={en:"EN",zh:"中",cs:"CS",tr:"TR",ar:"AR"},Gn="mlcad-html-locale",Ga={...{en:{toolbar:{viewerTools:"Viewer tools",select:"Select",pan:"Pan",zoom:"Zoom",zoomExtents:"Extents",zoomSmartExtents:"Smart",zoomWindow:"Window",zoomSaved:"Saved",zoomOriginal:"Saved",measureDistance:"Distance",measureContinuous:"Continuous",measureAngle:"Angle",measureArc:"Arc",measureRadius:"Radius",measureArea:"Area",measureCoordinate:"XY",clearMeasurements:"Clear",measureHide:"Hide",measureShow:"Show",measureImport:"Import",measureExport:"Export",measurementPanel:"Results",measure:"Measure",annotation:"Review",markupCloud:"Cloud",markupCallout:"Callout",markupText:"Text",markupRect:"Rect",markupCircle:"Circle",markupArrow:"Arrow",markupStamp:"Stamp",markupPanel:"Results",markupHide:"Hide",markupShow:"Show",clearMarkups:"Clear",markupImport:"Import",markupExport:"Export",snap:"Snap",layers:"Layers",layout:"Layout",settings:"Settings",simulatedMouseOn:"Mouse",simulatedMouseOff:"Loupe",themeLight:"Light",themeDark:"Dark",switchBg:"Background",language:"Language",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",collapse:"Collapse toolbar",expand:"Expand toolbar",moreOverflow:"More tools"},settings:{ortho:"Toggle orthogonal mode",polar:"Polar tracking angles",polarAngles:"Polar tracking angles"},drawStyle:{color:"Color",fontSize:"Text height",pickerTitle:"Select Color",close:"Close",ok:"OK",cancel:"Cancel",index:"Color Index: ",rgb:"RGB: ",input:"Color",inputPlaceholder:"1-255 or #RRGGBB"},shortCutToolbar:{more:"More",undo:"Undo",redo:"Redo",erase:"Delete",collapse:"Collapse toolbar",expand:"Expand toolbar"},textHeight:{title:"Text Height",close:"Close",ok:"OK",cancel:"Cancel",adaptive:"Fit to screen",custom:"Custom text height",customPlaceholder:"World height",fromScreen:"From screen size",fromScreenHint:"Enter how large the text should look on screen at the current zoom. It is converted to a fixed world-space height that stays constant when you zoom later.",screenPxPlaceholder:"Font size",screenUnit:"px",convert:"Convert"},entityPick:{cancel:"Cancel selection"},layers:{title:"Layers",close:"Close layers",showAll:"Show all",hideAll:"Hide all",zoomTo:"Zoom to {name}"},review:{title:"Review",close:"Close review",searchPlaceholder:"Search markups",empty:"No markups yet",type:"Type",status:"Status",author:"Author",summary:"Summary",details:"Details",closeDetails:"Close details",label:"Label",comment:"Comment",zoomTo:"Zoom to",delete:"Delete",clear:"Clear all",statusValues:{open:"Open",question:"Question",answered:"Answered",closed:"Closed"}},measurePanel:{title:"Measurements",close:"Close measurements",filterGroup:"Filter by type",filterDistance:"Distance",filterArc:"Arc",filterRadius:"Radius",filterAngle:"Angle",filterArea:"Area",empty:"No measurements yet",type:"Type",value:"Value",delete:"Delete",clear:"Clear all"},session:{length:"Length",angle:"Angle",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"Confirm",cancel:"Cancel",help:"Help",back:"Back",collapse:"Collapse",expand:"Expand",undo:"Undo"},touchPointTutorial:{title:"How to pick points precisely?",description:"Long-press on the screen for about 0.5 seconds. A cross appears above your finger and follows as you move, snapping to geometry for more accurate picks.",snoozeToday:"Don't remind me today",hideForever:"Don't remind me again",ok:"Got it"},status:{ready:"Ready",zoomWindowHint:"Click two corners to zoom to a window.",measureDistanceHint:"Click two points to measure distance (object snap enabled).",measureContinuousHint:"Tap successive points to measure each segment; tap ✓ to finish. Long-press for precise snap.",measureAreaHint:"Tap polygon vertices; tap ✓ to finish when at least three points are set. Long-press for precise snap.",measureAngleHint:"Click vertex, then two points on each arm (object snap enabled).",measureArcHint:"Click a circle or arc to measure along it, or click start, a point on the arc, then end (object snap enabled). Ctrl (⌘ on Mac) switches major/minor arc.",measureRadiusHint:"Click a circle or arc to measure its radius (object snap enabled).",measureCoordinateHint:"Click a point to read its X/Y coordinates (object snap enabled).",measureExported:"Exported {count} measurement(s).",measureImported:"Imported {count} measurement(s).",measureImportFailed:"Failed to import measurements: {error}",markupCloudHint:"Click two corners to draw a revision cloud.",markupCalloutHint:"Click the leader tip, or the outline of a cloud / rectangle / circle that has no callout, then the text anchor.",markupTextHint:"Click a point to place text.",markupRectHint:"Click two corners to draw a rectangle.",markupCircleHint:"Click the center, then a point on the circumference.",markupArrowHint:"Click the start point, then the arrow tip.",markupStampHint:"Click to place a stamp (cycles approved / rejected / …).",markupArrowEndHint:"Click the arrow tip.",markupRectCornerHint:"Click the opposite corner.",markupCloudCornerHint:"Click the opposite corner.",markupCalloutAnchorHint:"Click the text bubble position.",markupCircleRadiusHint:"Click a point on the circumference.",markupTextPrompt:"Enter markup text",markupTextEditHint:"Type text on the canvas. Enter to finish, Esc to cancel.",markupShapeCalloutHint:"Click to place the text box (leader attaches to the shape). Esc cancels the callout.",markupDefaultLabel:"Note",markupSelected:"Selected markup: {type}",markupSelectedCount:"Selected markups: {count}",markupCount:"Markups: {count}",markupExported:"Exported {count} markup(s).",markupImported:"Imported {count} markup(s).",markupImportFailed:"Failed to import markups: {error}",distance:"Distance: {value}",coordinates:"X: {x} | Y: {y}",angle:"Angle: {value}",arcLength:"Arc length: {length} | Radius: {radius} | Angle: {angle} | Chord: {chord}",radius:"Radius: {value}",continuousTotal:"Total length: {value}",area:"Area: {value}",lengthTotal:"Length total: {value}",areaTotal:"Area total: {value}",zoomLayer:"Zoom: {name}",loadFailed:"Failed to load drawing: {error}",noLayout:"No layout data in snapshot.",loadingChunks:"Loading geometry… {loaded}/{total}",loadingOsnap:"Loading object snap… {loaded}/{total}",buildingOsnap:"Building object snap index…"},package:{title:"Open drawing package",hint:"No drawing.acex.json was found next to this page. Choose a local package folder or enter the manifest URL.",hintUrlOnly:"No drawing.acex.json was found next to this page. Enter the manifest URL to open the package.",chooseFolder:"Choose local folder",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"Open URL",urlRequired:"Please enter a manifest URL.",manifestNotFound:"drawing.acex.json was not found next to this page.",invalidManifest:"The package manifest is invalid or uses an unsupported version: {error}",folderMissingManifest:"The selected folder must contain drawing.acex.json.",folderUnsupported:"This browser cannot open a local package folder. Paste a manifest URL instead.",loadFailed:"Failed to open package: {error}"},access:{title:"Protected drawing",passwordPrompt:"Enter the password to open this file.",passwordPlaceholder:"Password",unlock:"Unlock",passwordRequired:"Please enter a password.",wrongPassword:"Incorrect password. Try again.",expired:"This file has expired and can no longer be opened.",expiredTitle:"File expired",expiredDetail:"This file expired on {time} and can no longer be opened.",expiresAt:"Expires: {time}",badgeExpires:"Expires {time}",badgeCountdown:"Expires in {time}",tooManyAttempts:"Too many incorrect password attempts. Refresh the page to try again."}},zh:{toolbar:{viewerTools:"查看器工具",select:"选择",pan:"平移",zoom:"缩放",zoomExtents:"范围",zoomSmartExtents:"智能",zoomWindow:"窗口",zoomSaved:"保存的视图",zoomOriginal:"保存的视图",measureDistance:"测距离",measureContinuous:"连续测",measureAngle:"测角度",measureArc:"测弧长",measureRadius:"测半径",measureArea:"测面积",measureCoordinate:"测坐标",clearMeasurements:"清除",measureHide:"隐藏",measureShow:"显示",measureImport:"导入",measureExport:"导出",measurementPanel:"看结果",measure:"测量",annotation:"审阅",markupCloud:"云线",markupCallout:"标注",markupText:"文字",markupRect:"矩形",markupCircle:"圆",markupArrow:"箭头",markupStamp:"图章",markupPanel:"看结果",markupHide:"隐藏",markupShow:"显示",clearMarkups:"清除",markupImport:"导入",markupExport:"导出",snap:"捕捉",layers:"图层",layout:"布局",settings:"设置",simulatedMouseOn:"鼠标",simulatedMouseOff:"放大",themeLight:"浅色",themeDark:"深色",switchBg:"背景",language:"语言",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",collapse:"收起工具栏",expand:"展开工具栏",moreOverflow:"更多工具"},settings:{ortho:"切换正交模式",polar:"极轴追踪角度",polarAngles:"极轴追踪角度"},drawStyle:{color:"颜色",fontSize:"字高",pickerTitle:"选择颜色",close:"关闭",ok:"确定",cancel:"取消",index:"颜色索引:",rgb:"RGB:",input:"颜色",inputPlaceholder:"1-255 或 #RRGGBB"},shortCutToolbar:{more:"更多",undo:"撤销",redo:"重做",erase:"删除",collapse:"收起工具栏",expand:"展开工具栏"},textHeight:{title:"字高设置",close:"关闭",ok:"确定",cancel:"取消",adaptive:"自适应屏幕",custom:"自定义字高",customPlaceholder:"世界坐标字高",fromScreen:"按屏幕字号换算",fromScreenHint:"按当前视图缩放,输入希望看到的屏幕字号(像素),换算为固定的世界坐标字高;之后缩放时字的世界高度不变。",screenPxPlaceholder:"屏幕字号",screenUnit:"px",convert:"换算"},entityPick:{cancel:"取消选择"},layers:{title:"图层",close:"关闭图层",showAll:"全部显示",hideAll:"全部隐藏",zoomTo:"缩放到 {name}"},review:{title:"批注",close:"关闭批注面板",searchPlaceholder:"搜索批注",empty:"暂无批注",type:"类型",status:"状态",author:"作者",summary:"摘要",details:"详情",closeDetails:"关闭详情",label:"标签",comment:"评论",zoomTo:"缩放到",delete:"删除",clear:"全部清除",statusValues:{open:"打开",question:"疑问",answered:"已答复",closed:"已关闭"}},measurePanel:{title:"测量",close:"关闭测量面板",filterGroup:"按类型筛选",filterDistance:"距离",filterArc:"弧长",filterRadius:"半径",filterAngle:"角度",filterArea:"面积",empty:"暂无测量",type:"类型",value:"数值",delete:"删除",clear:"全部清除"},session:{length:"长度",angle:"角度",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"确定",cancel:"取消",help:"帮助",back:"返回",collapse:"收起",expand:"展开",undo:"撤销"},touchPointTutorial:{title:"怎样可以精确取点?",description:"手指在屏幕上长按0.5s左右,上方出现十字,手指移动时十字跟随移动并自动捕捉。取点更精准。",snoozeToday:"今日不再提醒",hideForever:"不再提醒",ok:"我知道了"},status:{ready:"就绪",zoomWindowHint:"点击两个角点以窗口缩放。",measureDistanceHint:"点击两点以测量距离(已启用对象捕捉)。",measureContinuousHint:"依次点击多个点测量各段距离,点 ✓ 完成。长按可精确捕捉。",measureAreaHint:"依次点击多边形顶点;至少三点后点 ✓ 完成。长按可精确捕捉。",measureAngleHint:"依次点击顶点与两条边上的点(已启用对象捕捉)。",measureArcHint:"点击圆或圆弧可沿其测量;否则依次点击弧起点、弧上一点与弧端点(已启用对象捕捉)。锁定后按 Ctrl(Mac 为 Control 或 ⌘)可在大弧与小弧之间切换。",measureRadiusHint:"点击圆或圆弧以测量半径(已启用对象捕捉)。",measureCoordinateHint:"点击一点以读取其 X/Y 坐标(已启用对象捕捉)。",measureExported:"已导出 {count} 条测量。",measureImported:"已导入 {count} 条测量。",measureImportFailed:"导入测量失败:{error}",markupCloudHint:"点击两个对角点绘制修订云线。",markupCalloutHint:"先点击引线端点,或点击尚无标注的云线/矩形/圆外框,再点击文字位置。",markupTextHint:"点击一点放置文字。",markupRectHint:"点击两个对角点绘制矩形。",markupCircleHint:"先点击圆心,再点击圆周上一点。",markupArrowHint:"先点击起点,再点击箭头端点。",markupStampHint:"点击放置图章(在批准/拒绝等之间循环)。",markupArrowEndHint:"点击箭头端点。",markupRectCornerHint:"点击对角点。",markupCloudCornerHint:"点击对角点。",markupCalloutAnchorHint:"点击文字气泡位置。",markupCircleRadiusHint:"点击圆周上一点。",markupTextPrompt:"输入批注文字",markupTextEditHint:"在画布上输入文字。Enter 完成,Esc 取消。",markupShapeCalloutHint:"点击放置文本框(引线自动贴到图形)。Esc 取消引线和文本框。",markupDefaultLabel:"批注",markupSelected:"已选批注:{type}",markupSelectedCount:"已选批注:{count} 个",markupCount:"批注数:{count}",markupExported:"已导出 {count} 条批注。",markupImported:"已导入 {count} 条批注。",markupImportFailed:"导入批注失败:{error}",distance:"距离:{value}",coordinates:"X:{x} | Y:{y}",angle:"角度:{value}",arcLength:"弧长:{length} | 半径:{radius} | 总角度:{angle} | 弦长:{chord}",radius:"半径:{value}",continuousTotal:"总长度:{value}",area:"面积:{value}",lengthTotal:"长度合计:{value}",areaTotal:"面积合计:{value}",zoomLayer:"缩放:{name}",loadFailed:"无法加载图纸:{error}",noLayout:"快照中没有布局数据。",loadingChunks:"正在加载几何… {loaded}/{total}",loadingOsnap:"正在加载对象捕捉… {loaded}/{total}",buildingOsnap:"正在构建对象捕捉索引…"},package:{title:"打开图纸包",hint:"当前页面同级目录未找到 drawing.acex.json。请选择本地包文件夹,或输入清单 URL。",hintUrlOnly:"当前页面同级目录未找到 drawing.acex.json。请输入清单 URL 以打开图纸包。",chooseFolder:"选择本地文件夹",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"打开 URL",urlRequired:"请输入清单 URL。",manifestNotFound:"当前页面同级目录未找到 drawing.acex.json。",invalidManifest:"包清单无效或版本不受支持:{error}",folderMissingManifest:"所选文件夹必须包含 drawing.acex.json。",folderUnsupported:"当前浏览器无法选择本地包文件夹,请改为输入清单 URL。",loadFailed:"无法打开图纸包:{error}"},access:{title:"受保护的图纸",passwordPrompt:"请输入密码以打开此文件。",passwordPlaceholder:"密码",unlock:"解锁",passwordRequired:"请输入密码。",wrongPassword:"密码错误,请重试。",expired:"此文件已过期,无法打开。",expiredTitle:"文件已过期",expiredDetail:"此文件已于 {time} 过期,无法打开。",expiresAt:"有效期至:{time}",badgeExpires:"有效期至 {time}",badgeCountdown:"剩余 {time}",tooManyAttempts:"密码错误次数过多,请刷新页面后重新输入。"}},cs:{toolbar:{viewerTools:"Nástroje prohlížeče",select:"Výběr",pan:"Posun",zoom:"Přiblížení",zoomExtents:"Rozsah",zoomSmartExtents:"Chytrý",zoomWindow:"Okno",zoomSaved:"Uložený",zoomOriginal:"Uložený",measureDistance:"Vzdálenost",measureContinuous:"Spojité",measureAngle:"Úhel",measureArc:"Oblouk",measureRadius:"Poloměr",measureArea:"Plocha",measureCoordinate:"Souřadnice",clearMeasurements:"Vymazat",measureHide:"Skrýt",measureShow:"Zobrazit",measureImport:"Import",measureExport:"Export",measurementPanel:"Výsledky",measure:"Měření",annotation:"Kontrola",markupCloud:"Obláček",markupCallout:"Odkaz",markupText:"Text",markupRect:"Obdélník",markupCircle:"Kružnice",markupArrow:"Šipka",markupStamp:"Razítko",markupPanel:"Výsledky",markupHide:"Skrýt",markupShow:"Zobrazit",clearMarkups:"Vymazat",markupImport:"Import",markupExport:"Export",snap:"Uchopit",layers:"Hladiny",layout:"Rozvržení",settings:"Nastavení",simulatedMouseOn:"Myš",simulatedMouseOff:"Lupa",themeLight:"Světlý",themeDark:"Tmavý",switchBg:"Pozadí",language:"Jazyk",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",collapse:"Sbalit panel nástrojů",expand:"Rozbalit panel nástrojů",moreOverflow:"Další nástroje"},settings:{ortho:"Přepnout ortogonální režim",polar:"Úhly polárního trasování",polarAngles:"Úhly polárního trasování"},drawStyle:{color:"Barva",fontSize:"Výška textu",pickerTitle:"Vybrat barvu",close:"Zavřít",ok:"OK",cancel:"Zrušit",index:"Index barvy: ",rgb:"RGB: ",input:"Barva",inputPlaceholder:"1-255 nebo #RRGGBB"},shortCutToolbar:{more:"Více",undo:"Zpět",redo:"Znovu",erase:"Smazat",collapse:"Sbalit panel nástrojů",expand:"Rozbalit panel nástrojů"},textHeight:{title:"Výška textu",close:"Zavřít",ok:"OK",cancel:"Zrušit",adaptive:"Přizpůsobit obrazovce",custom:"Vlastní výška textu",customPlaceholder:"Světová výška",fromScreen:"Ze velikosti na obrazovce",fromScreenHint:"Zadejte, jak velký má text vypadat na obrazovce při aktuálním zoomu. Přepočítá se na pevnou světovou výšku, která se při pozdějším zoomování nemění.",screenPxPlaceholder:"Velikost písma",screenUnit:"px",convert:"Přepočítat"},entityPick:{cancel:"Zrušit výběr"},layers:{title:"Hladiny",close:"Zavřít hladiny",showAll:"Zobrazit vše",hideAll:"Skrýt vše",zoomTo:"Přiblížit na {name}"},review:{title:"Kontrola",close:"Zavřít kontrolu",searchPlaceholder:"Hledat poznámky",empty:"Zatím žádné poznámky",type:"Typ",status:"Stav",author:"Autor",summary:"Souhrn",details:"Podrobnosti",closeDetails:"Zavřít podrobnosti",label:"Popisek",comment:"Komentář",zoomTo:"Přiblížit na",delete:"Odstranit",clear:"Vymazat vše",statusValues:{open:"Otevřeno",question:"Otázka",answered:"Zodpovězeno",closed:"Uzavřeno"}},measurePanel:{title:"Měření",close:"Zavřít měření",filterGroup:"Filtrovat podle typu",filterDistance:"Vzdálenost",filterArc:"Oblouk",filterRadius:"Poloměr",filterAngle:"Úhel",filterArea:"Plocha",empty:"Zatím žádná měření",type:"Typ",value:"Hodnota",delete:"Odstranit",clear:"Vymazat vše"},session:{length:"Délka",angle:"Úhel",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"Potvrdit",cancel:"Zrušit",help:"Nápověda",back:"Zpět",collapse:"Sbalit",expand:"Rozbalit",undo:"Zpět"},touchPointTutorial:{title:"Jak přesně vybrat bod?",description:"Podržte prst na obrazovce asi 0,5 sekundy. Nad prstem se objeví kříž, který při pohybu sleduje prst a přichytává se k geometrii pro přesnější výběr.",snoozeToday:"Dnes už nepřipomínat",hideForever:"Už nepřipomínat",ok:"Rozumím"},status:{ready:"Připraveno",zoomWindowHint:"Klikněte na dva rohy pro přiblížení oknem.",measureDistanceHint:"Klikněte na dva body pro změření vzdálenosti (uchopení objektů zapnuto).",measureContinuousHint:"Klepejte na další body pro měření každého úseku; dokončete klepnutím na ✓. Dlouhé stisknutí pro přesné uchopení.",measureAngleHint:"Klikněte na vrchol, poté na dva body na každém rameni (uchopení objektů zapnuto).",measureArcHint:"Klikněte na kružnici nebo oblouk pro měření podél něj, nebo klikněte na začátek, bod na oblouku a konec (uchopení objektů zapnuto). Ctrl (⌘ na Macu) přepíná velký/malý oblouk.",measureRadiusHint:"Klikněte na kružnici nebo oblouk pro změření poloměru (uchopení objektů zapnuto).",measureAreaHint:"Klepejte na vrcholy mnohoúhelníku; dokončete klepnutím na ✓ po alespoň třech bodech.",measureCoordinateHint:"Klikněte na bod pro zobrazení jeho souřadnic X/Y (uchopení objektů zapnuto).",measureExported:"Exportováno {count} měření.",measureImported:"Importováno {count} měření.",measureImportFailed:"Import měření selhal: {error}",markupCloudHint:"Klikněte na dva rohy pro nakreslení obláčku.",markupCalloutHint:"Klikněte na hrot vodítka, nebo na obrys obláčku/obdélníku/kružnice bez odkazu, a poté na kotvu textu.",markupTextHint:"Klikněte pro umístění textu.",markupRectHint:"Klikněte na dva rohy pro nakreslení obdélníku.",markupCircleHint:"Klikněte na střed a poté na bod na kružnici.",markupArrowHint:"Klikněte na začátek a poté na hrot šipky.",markupStampHint:"Klikněte pro umístění razítka (schváleno / zamítnuto / …).",markupArrowEndHint:"Klikněte na hrot šipky.",markupRectCornerHint:"Klikněte na protilehlý roh.",markupCloudCornerHint:"Klikněte na protilehlý roh.",markupCalloutAnchorHint:"Klikněte na pozici textové bubliny.",markupCircleRadiusHint:"Klikněte na bod na kružnici.",markupTextPrompt:"Zadejte text poznámky",markupTextEditHint:"Pište text přímo na plátno. Enter dokončí, Esc zruší.",markupShapeCalloutHint:"Klikněte pro umístění textového pole (vodítko se připojí k tvaru). Esc zruší odkaz.",markupDefaultLabel:"Poznámka",markupSelected:"Vybraná poznámka: {type}",markupSelectedCount:"Vybrané poznámky: {count}",markupCount:"Poznámky: {count}",markupExported:"Exportováno {count} poznámek.",markupImported:"Importováno {count} poznámek.",markupImportFailed:"Import poznámek selhal: {error}",distance:"Vzdálenost: {value}",coordinates:"X: {x} | Y: {y}",angle:"Úhel: {value}",arcLength:"Délka oblouku: {length} | Poloměr: {radius} | Úhel: {angle} | Tětiva: {chord}",radius:"Poloměr: {value}",continuousTotal:"Celková délka: {value}",area:"Plocha: {value}",lengthTotal:"Celková délka: {value}",areaTotal:"Celková plocha: {value}",zoomLayer:"Zoom: {name}",loadFailed:"Nepodařilo se načíst výkres: {error}",noLayout:"Snímek neobsahuje data rozvržení.",loadingChunks:"Načítání geometrie… {loaded}/{total}",loadingOsnap:"Načítání uchopování… {loaded}/{total}",buildingOsnap:"Sestavování indexu uchopování…"},package:{title:"Otevřít balíček výkresu",hint:"Vedle této stránky nebyl nalezen drawing.acex.json. Vyberte místní složku balíčku nebo zadejte URL manifestu.",hintUrlOnly:"Vedle této stránky nebyl nalezen drawing.acex.json. Zadejte URL manifestu pro otevření balíčku.",chooseFolder:"Vybrat místní složku",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"Otevřít URL",urlRequired:"Zadejte URL manifestu.",manifestNotFound:"drawing.acex.json nebyl vedle této stránky nalezen.",invalidManifest:"Manifest balíčku je neplatný nebo používá nepodporovanou verzi: {error}",folderMissingManifest:"Vybraná složka musí obsahovat drawing.acex.json.",folderUnsupported:"Tento prohlížeč neumí otevřít místní složku balíčku. Zadejte místo toho URL manifestu.",loadFailed:"Nepodařilo se otevřít balíček: {error}"},access:{title:"Chráněný výkres",passwordPrompt:"Zadejte heslo pro otevření tohoto souboru.",passwordPlaceholder:"Heslo",unlock:"Odemknout",passwordRequired:"Zadejte heslo.",wrongPassword:"Nesprávné heslo. Zkuste to znovu.",expired:"Platnost tohoto souboru vypršela a nelze jej otevřít.",expiredTitle:"Soubor vypršel",expiredDetail:"Platnost tohoto souboru vypršela dne {time} a již jej nelze otevřít.",expiresAt:"Platnost do: {time}",badgeExpires:"Platnost do {time}",badgeCountdown:"Vyprší za {time}",tooManyAttempts:"Příliš mnoho nesprávných pokusů o heslo. Obnovte stránku a zkuste to znovu."}},tr:{toolbar:{viewerTools:"Görüntüleyici araçları",select:"Seç",pan:"Kaydır",zoom:"Yakınlaştır",zoomExtents:"Sınırlar",zoomSmartExtents:"Akıllı",zoomWindow:"Pencere",zoomSaved:"Kayıtlı",zoomOriginal:"Kayıtlı",measureDistance:"Mesafe",measureContinuous:"Sürekli",measureAngle:"Açı",measureArc:"Yay",measureRadius:"Yarıçap",measureArea:"Alan",measureCoordinate:"XY",clearMeasurements:"Temizle",measureHide:"Gizle",measureShow:"Göster",measureImport:"İçe aktar",measureExport:"Dışa aktar",measurementPanel:"Sonuç",measure:"Ölçüm",annotation:"İnceleme",markupCloud:"Bulut",markupCallout:"Çağrı",markupText:"Metin",markupRect:"Dörtgen",markupCircle:"Daire",markupArrow:"Ok",markupStamp:"Damga",markupPanel:"Sonuç",markupHide:"Gizle",markupShow:"Göster",clearMarkups:"Temizle",markupImport:"İçe aktar",markupExport:"Dışa aktar",snap:"Yakalama",layers:"Katman",layout:"Düzen",settings:"Ayarlar",simulatedMouseOn:"Fare",simulatedMouseOff:"Büyüteç",themeLight:"Açık",themeDark:"Koyu",switchBg:"Arka plan",language:"Dil",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",collapse:"Araç çubuğunu daralt",expand:"Araç çubuğunu genişlet",moreOverflow:"Diğer araçlar"},settings:{ortho:"Dik modu aç/kapat",polar:"Kutupsal izleme açıları",polarAngles:"Kutupsal izleme açıları"},drawStyle:{color:"Renk",fontSize:"Yazı yüksekliği",pickerTitle:"Renk Seç",close:"Kapat",ok:"Tamam",cancel:"İptal",index:"Renk İndeksi: ",rgb:"RGB: ",input:"Renk",inputPlaceholder:"1-255 veya #RRGGBB"},shortCutToolbar:{more:"Daha fazla",undo:"Geri al",redo:"Yinele",erase:"Sil",collapse:"Araç çubuğunu daralt",expand:"Araç çubuğunu genişlet"},textHeight:{title:"Yazı Yüksekliği",close:"Kapat",ok:"Tamam",cancel:"İptal",adaptive:"Ekrana uyarla",custom:"Özel yazı yüksekliği",customPlaceholder:"Dünya yüksekliği",fromScreen:"Ekran boyutundan",fromScreenHint:"Geçerli yakınlaştırmada ekranda istediğiniz yazı boyutunu girin. Sabit bir dünya yüksekliğine dönüştürülür; sonra yakınlaştırınca bu yükseklik değişmez.",screenPxPlaceholder:"Yazı boyutu",screenUnit:"px",convert:"Dönüştür"},entityPick:{cancel:"Seçimi iptal et"},layers:{title:"Katmanlar",close:"Katmanları kapat",showAll:"Tümünü göster",hideAll:"Tümünü gizle",zoomTo:"{name} katmanına yakınlaştır"},review:{title:"İnceleme",close:"İncelemeyi kapat",searchPlaceholder:"İşaretlerde ara",empty:"Henüz işaret yok",type:"Tür",status:"Durum",author:"Yazar",summary:"Özet",details:"Ayrıntılar",closeDetails:"Ayrıntıları kapat",label:"Etiket",comment:"Yorum",zoomTo:"Yakınlaştır",delete:"Sil",clear:"Tümünü temizle",statusValues:{open:"Açık",question:"Soru",answered:"Yanıtlandı",closed:"Kapalı"}},measurePanel:{title:"Ölçümler",close:"Ölçümleri kapat",filterGroup:"Türe göre filtrele",filterDistance:"Mesafe",filterArc:"Yay",filterRadius:"Yarıçap",filterAngle:"Açı",filterArea:"Alan",empty:"Henüz ölçüm yok",type:"Tür",value:"Değer",delete:"Sil",clear:"Tümünü temizle"},session:{length:"Uzunluk",angle:"Açı",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"Onayla",cancel:"İptal",help:"Yardım",back:"Geri",collapse:"Daralt",expand:"Genişlet",undo:"Geri al"},touchPointTutorial:{title:"Noktalar nasıl hassas seçilir?",description:"Ekranda yaklaşık 0,5 saniye basılı tutun. Parmağınızın üstünde bir artı belirir ve hareket ederken geometriye yapışarak daha doğru seçim yapmanızı sağlar.",snoozeToday:"Bugün tekrar hatırlatma",hideForever:"Bir daha hatırlatma",ok:"Anladım"},status:{ready:"Hazır",zoomWindowHint:"Pencere yakınlaştırmak için iki köşeyi tıklayın.",measureDistanceHint:"Mesafe ölçmek için iki nokta tıklayın (nesne yakalama etkin).",measureContinuousHint:"Her segmenti ölçmek için ardışık noktalar dokunun; bitirmek için ✓. Hassas yakalama için basılı tutun.",measureAngleHint:"Önce köşe noktasını, sonra her koldan birer nokta tıklayın (nesne yakalama etkin).",measureArcHint:"Ölçmek için bir çember veya yaya tıklayın; ya da yay başlangıcı, yay üzerindeki bir nokta ve yay sonunu tıklayın (nesne yakalama etkin). Ctrl (Mac’te ⌘) büyük/küçük yay arasında geçiş yapar.",measureRadiusHint:"Yarıçap ölçmek için bir çember veya yaya tıklayın (nesne yakalama etkin).",measureAreaHint:"Çokgen köşelerini dokunun; en az üç noktadan sonra bitirmek için ✓.",measureCoordinateHint:"X/Y koordinatlarını okumak için bir nokta tıklayın (nesne yakalama etkin).",measureExported:"{count} ölçüm dışa aktarıldı.",measureImported:"{count} ölçüm içe aktarıldı.",measureImportFailed:"Ölçüm içe aktarılamadı: {error}",markupCloudHint:"Revizyon bulutu çizmek için iki köşe tıklayın.",markupCalloutHint:"Lider ucunu veya çağrısı olmayan bulut/dikdörtgen/daire dış çerçevesini tıklayın, ardından metin konumunu tıklayın.",markupTextHint:"Metin yerleştirmek için bir nokta tıklayın.",markupRectHint:"Dikdörtgen çizmek için iki köşe tıklayın.",markupCircleHint:"Önce merkezi, sonra çevre üzerindeki bir noktayı tıklayın.",markupArrowHint:"Önce başlangıcı, sonra ok ucunu tıklayın.",markupStampHint:"Damga yerleştirmek için tıklayın (onaylandı / reddedildi / …).",markupArrowEndHint:"Ok ucunu tıklayın.",markupRectCornerHint:"Karşı köşeyi tıklayın.",markupCloudCornerHint:"Karşı köşeyi tıklayın.",markupCalloutAnchorHint:"Metin balonu konumunu tıklayın.",markupCircleRadiusHint:"Çevre üzerindeki bir noktayı tıklayın.",markupTextPrompt:"İşaretleme metnini girin",markupTextEditHint:"Metni tuval üzerinde yazın. Enter ile bitirin, Esc ile iptal edin.",markupShapeCalloutHint:"Metin kutusunu yerleştirmek için tıklayın (lider şekle bağlanır). Esc çağrıyı iptal eder.",markupDefaultLabel:"Not",markupSelected:"Seçili işaretleme: {type}",markupSelectedCount:"Seçili işaretlemeler: {count}",markupCount:"İşaretlemeler: {count}",markupExported:"{count} işaretleme dışa aktarıldı.",markupImported:"{count} işaretleme içe aktarıldı.",markupImportFailed:"İşaretleme içe aktarılamadı: {error}",distance:"Mesafe: {value}",coordinates:"X: {x} | Y: {y}",angle:"Açı: {value}",arcLength:"Yay uzunluğu: {length} | Yarıçap: {radius} | Açı: {angle} | Kiriş: {chord}",radius:"Yarıçap: {value}",continuousTotal:"Toplam uzunluk: {value}",area:"Alan: {value}",lengthTotal:"Toplam uzunluk: {value}",areaTotal:"Toplam alan: {value}",zoomLayer:"Yakınlaştır: {name}",loadFailed:"Çizim yüklenemedi: {error}",noLayout:"Anlık görüntüde yerleşim verisi yok.",loadingChunks:"Geometri yükleniyor… {loaded}/{total}",loadingOsnap:"Nesne yakalama yükleniyor… {loaded}/{total}",buildingOsnap:"Nesne yakalama dizini oluşturuluyor…"},package:{title:"Çizim paketini aç",hint:"Bu sayfanın yanında drawing.acex.json bulunamadı. Yerel bir paket klasörü seçin veya manifesto URL’sini girin.",hintUrlOnly:"Bu sayfanın yanında drawing.acex.json bulunamadı. Paketi açmak için manifesto URL’sini girin.",chooseFolder:"Yerel klasör seç",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"URL aç",urlRequired:"Lütfen bir manifesto URL’si girin.",manifestNotFound:"Bu sayfanın yanında drawing.acex.json bulunamadı.",invalidManifest:"Paket manifestosu geçersiz veya desteklenmeyen bir sürüm kullanıyor: {error}",folderMissingManifest:"Seçilen klasör drawing.acex.json içermelidir.",folderUnsupported:"Bu tarayıcı yerel paket klasörü açamıyor. Bunun yerine manifesto URL’si yapıştırın.",loadFailed:"Paket açılamadı: {error}"},access:{title:"Korumalı çizim",passwordPrompt:"Bu dosyayı açmak için parolayı girin.",passwordPlaceholder:"Parola",unlock:"Kilidi aç",passwordRequired:"Lütfen bir parola girin.",wrongPassword:"Parola yanlış. Tekrar deneyin.",expired:"Bu dosyanın süresi doldu ve artık açılamaz.",expiredTitle:"Dosyanın süresi doldu",expiredDetail:"Bu dosyanın süresi {time} tarihinde doldu ve artık açılamaz.",expiresAt:"Son geçerlilik: {time}",badgeExpires:"Son geçerlilik {time}",badgeCountdown:"Kalan süre {time}",tooManyAttempts:"Çok fazla yanlış parola denemesi yapıldı. Tekrar denemek için sayfayı yenileyin."}}},ar:{toolbar:{viewerTools:"أدوات العارض",select:"تحديد",pan:"تحريك",zoom:"تكبير/تصغير",zoomExtents:"ملاءمة",zoomSmartExtents:"ذكية",zoomWindow:"نافذة",zoomSaved:"محفوظ",zoomOriginal:"محفوظ",measureDistance:"مسافة",measureContinuous:"مستمر",measureAngle:"زاوية",measureArc:"قوس",measureRadius:"نصف القطر",measureArea:"مساحة",measureCoordinate:"إحداثيات",clearMeasurements:"مسح",measureHide:"إخفاء",measureShow:"إظهار",measureImport:"استيراد",measureExport:"تصدير",measurementPanel:"نتائج",measure:"قياس",annotation:"مراجعة",markupCloud:"سحابة",markupCallout:"تعليق",markupText:"نص",markupRect:"مستطيل",markupCircle:"دائرة",markupArrow:"سهم",markupStamp:"ختم",markupPanel:"نتائج",markupHide:"إخفاء",markupShow:"إظهار",clearMarkups:"مسح",markupImport:"استيراد",markupExport:"تصدير",snap:"التقاط",layers:"طبقات",layout:"تخطيط",settings:"إعدادات",simulatedMouseOn:"ماوس",simulatedMouseOff:"عدسة",themeLight:"فاتح",themeDark:"داكن",switchBg:"خلفية",language:"اللغة",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",collapse:"طي شريط الأدوات",expand:"توسيع شريط الأدوات",moreOverflow:"المزيد من الأدوات"},settings:{ortho:"تبديل الوضع المتعامد",polar:"زوايا التتبع القطبي",polarAngles:"زوايا التتبع القطبي"},drawStyle:{color:"اللون",fontSize:"ارتفاع النص",pickerTitle:"تحديد اللون",close:"إغلاق",ok:"موافق",cancel:"إلغاء",index:"فهرس اللون: ",rgb:"RGB: ",input:"اللون",inputPlaceholder:"1-255 أو #RRGGBB"},textHeight:{title:"ارتفاع النص",close:"إغلاق",ok:"موافق",cancel:"إلغاء",adaptive:"ملاءمة الشاشة",custom:"ارتفاع نص مخصص",customPlaceholder:"ارتفاع العالم",fromScreen:"من حجم الشاشة",fromScreenHint:"أدخل حجم النص المطلوب على الشاشة عند التكبير الحالي. يُحوَّل إلى ارتفاع ثابت في إحداثيات الرسم ويبقى كما هو عند تغيير التكبير لاحقًا.",screenPxPlaceholder:"حجم الخط",screenUnit:"px",convert:"تحويل"},layers:{title:"الطبقات",close:"إغلاق الطبقات",showAll:"إظهار الكل",hideAll:"إخفاء الكل",zoomTo:"تكبير إلى {name}"},review:{title:"مراجعة",close:"إغلاق المراجعة",searchPlaceholder:"البحث في الملاحظات",empty:"لا توجد ملاحظات بعد",type:"النوع",status:"الحالة",author:"المؤلف",summary:"الملخص",details:"التفاصيل",closeDetails:"إغلاق التفاصيل",label:"التسمية",comment:"التعليق",zoomTo:"تكبير إلى",delete:"حذف",clear:"مسح الكل",statusValues:{open:"مفتوح",question:"سؤال",answered:"تمت الإجابة",closed:"مغلق"}},measurePanel:{title:"القياسات",close:"إغلاق القياسات",filterGroup:"التصفية حسب النوع",filterDistance:"مسافة",filterArc:"قوس",filterRadius:"نصف القطر",filterAngle:"زاوية",filterArea:"مساحة",empty:"لا توجد قياسات حتى الآن",type:"النوع",value:"القيمة",delete:"حذف",clear:"مسح الكل"},session:{length:"الطول",angle:"الزاوية",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"تأكيد",cancel:"إلغاء",help:"مساعدة",back:"رجوع",collapse:"طي",expand:"توسيع",undo:"تراجع"},touchPointTutorial:{title:"كيف أختار النقاط بدقة؟",description:"اضغط مطولاً على الشاشة لمدة نصف ثانية تقريباً. يظهر صليب فوق إصبعك ويتبعه أثناء الحركة ويلتقط إلى الهندسة لاختيار أدق.",snoozeToday:"لا تذكرني اليوم",hideForever:"لا تذكرني مرة أخرى",ok:"فهمت"},status:{ready:"جاهز",zoomWindowHint:"انقر على ركنين لتحديد نافذة التكبير.",measureDistanceHint:"انقر على نقطتين لقياس المسافة (التقاط الكائنات مفعّل).",measureContinuousHint:"انقر على نقاط متتالية لقياس كل قطعة؛ انقر ✓ للإنهاء. اضغط مطولاً للالتقاط الدقيق.",measureAngleHint:"انقر على رأس الزاوية، ثم نقطة على كل ضلع (التقاط الكائنات مفعّل).",measureArcHint:"انقر على دائرة أو قوس للقياس عليه، أو انقر على نقطة البداية ثم نقطة على القوس ثم نقطة النهاية (التقاط الكائنات مفعّل). استخدم Ctrl (⌘ على Mac) للتبديل بين القوس الأكبر والأصغر.",measureRadiusHint:"انقر على دائرة أو قوس لقياس نصف القطر (التقاط الكائنات مفعّل).",measureAreaHint:"انقر على رؤوس المضلع؛ انقر ✓ للإنهاء بعد ثلاث نقاط على الأقل.",measureCoordinateHint:"انقر على نقطة لقراءة إحداثيات X/Y الخاصة بها (التقاط الكائنات مفعّل).",measureExported:"تم تصدير {count} من القياسات.",measureImported:"تم استيراد {count} من القياسات.",measureImportFailed:"فشل استيراد القياسات: {error}",markupCloudHint:"انقر على ركنين لرسم سحابة مراجعة.",markupCalloutHint:"انقر على طرف خط الإشارة، أو على إطار سحابة/مستطيل/دائرة بدون تعليق توضيحي، ثم موضع النص.",markupTextHint:"انقر على نقطة لوضع النص.",markupRectHint:"انقر على ركنين لرسم مستطيل.",markupCircleHint:"انقر على المركز، ثم على نقطة على المحيط.",markupArrowHint:"انقر على نقطة البداية، ثم على رأس السهم.",markupStampHint:"انقر لوضع ختم (يتنقل بين معتمد / مرفوض / …).",markupArrowEndHint:"انقر على رأس السهم.",markupRectCornerHint:"انقر على الركن المقابل.",markupCloudCornerHint:"انقر على الركن المقابل.",markupCalloutAnchorHint:"انقر على موضع فقاعة النص.",markupCircleRadiusHint:"انقر على نقطة على المحيط.",markupTextPrompt:"أدخل نص الملاحظة",markupTextEditHint:"اكتب النص على مساحة الرسم. اضغط Enter للإنهاء أو Esc للإلغاء.",markupShapeCalloutHint:"انقر لوضع مربع النص (يتصل خط الإشارة بالشكل). اضغط Esc لإلغاء التعليق التوضيحي.",markupDefaultLabel:"ملاحظة",markupSelected:"الملاحظة المحددة: {type}",markupSelectedCount:"الملاحظات المحددة: {count}",markupCount:"عدد الملاحظات: {count}",markupExported:"تم تصدير {count} من الملاحظات.",markupImported:"تم استيراد {count} من الملاحظات.",markupImportFailed:"فشل استيراد الملاحظات: {error}",distance:"المسافة: {value}",coordinates:"X: {x} | Y: {y}",angle:"الزاوية: {value}",arcLength:"طول القوس: {length} | نصف القطر: {radius} | الزاوية: {angle} | الوتر: {chord}",radius:"نصف القطر: {value}",continuousTotal:"إجمالي الطول: {value}",area:"المساحة: {value}",lengthTotal:"إجمالي الطول: {value}",areaTotal:"إجمالي المساحة: {value}",zoomLayer:"تكبير: {name}",loadFailed:"فشل تحميل الرسم: {error}",noLayout:"لا توجد بيانات تخطيط في اللقطة.",loadingChunks:"جاري تحميل الهندسة… {loaded}/{total}",loadingOsnap:"جاري تحميل الالتقاط… {loaded}/{total}",buildingOsnap:"جاري بناء فهرس الالتقاط…"},package:{title:"فتح حزمة الرسم",hint:"لم يتم العثور على drawing.acex.json بجانب هذه الصفحة. اختر مجلد الحزمة المحلي أو أدخل عنوان URL للقائمة.",hintUrlOnly:"لم يتم العثور على drawing.acex.json بجانب هذه الصفحة. أدخل عنوان URL للقائمة لفتح الحزمة.",chooseFolder:"اختيار مجلد محلي",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"فتح الرابط",urlRequired:"يرجى إدخال عنوان URL للقائمة.",manifestNotFound:"لم يتم العثور على drawing.acex.json بجانب هذه الصفحة.",invalidManifest:"قائمة الحزمة غير صالحة أو تستخدم إصداراً غير مدعوم: {error}",folderMissingManifest:"يجب أن يحتوي المجلد المحدد على drawing.acex.json.",folderUnsupported:"لا يمكن لهذا المتصفح فتح مجلد حزمة محلي. الصق عنوان URL للقائمة بدلاً من ذلك.",loadFailed:"تعذر فتح الحزمة: {error}"},access:{title:"رسم محمي",passwordPrompt:"أدخل كلمة المرور لفتح هذا الملف.",passwordPlaceholder:"كلمة المرور",unlock:"فتح",passwordRequired:"يرجى إدخال كلمة المرور.",wrongPassword:"كلمة المرور غير صحيحة. حاول مرة أخرى.",expired:"انتهت صلاحية هذا الملف ولا يمكن فتحه.",expiredTitle:"انتهت صلاحية الملف",expiredDetail:"انتهت صلاحية هذا الملف في {time} ولا يمكن فتحه.",expiresAt:"ينتهي في: {time}",badgeExpires:"ينتهي في {time}",badgeCountdown:"متبقي {time}",tooManyAttempts:"عدد محاولات إدخال كلمة المرور كبير جدًا. قم بتحديث الصفحة للمحاولة مرة أخرى."}}};function Ll(e){return he.includes(e)}function Le(e){if(e==null||e==="")return null;const t=e.toLowerCase().replace("_","-");for(const n of he)if(t===n||t.startsWith(`${n}-`))return n;return null}function ja(){if(typeof navigator>"u")return"en";const e=[...navigator.languages??[],navigator.language].filter(Boolean);for(const t of e){const n=Le(t);if(n)return n}return"en"}function Za(){if(typeof localStorage<"u")try{const e=localStorage.getItem(Gn),t=Le(e);if(t)return t}catch{}return ja()}function Ka(e,t){const n=t.split(".");let r=e;for(const a of n){if(r==null||typeof r=="string")return;r=r[a]}return typeof r=="string"?r:void 0}function Wa(e,t){return t?e.replace(/\{(\w+)\}/g,(n,r)=>{const a=t[r];return a!=null?String(a):`{${r}}`}):e}class El{constructor(t){this._onChange=null,this._locale=t??Za()}get locale(){return this._locale}get localeBadge(){return Yn[this._locale]}setOnChange(t){this._onChange=t}t(t,n){const r=Ka(Ga[this._locale],t)??Ka(Ga.en,t)??t;return Wa(r,n)}toggleLocale(){const t=he.indexOf(this._locale),n=he[(t+1)%he.length];return this.setLocale(n),n}setLocale(t){var n;if(this._locale!==t){this._locale=t,typeof document<"u"&&(document.documentElement.lang=t);try{typeof localStorage<"u"&&localStorage.setItem(Gn,t)}catch{}this.applyToDocument(),(n=this._onChange)==null||n.call(this)}}applyToDocument(t){if(typeof document>"u")return;const n=t??document;document.documentElement.lang=this._locale,n.querySelectorAll("[data-i18n-text]").forEach(a=>{const o=a.dataset.i18nKey;o&&(a.textContent=this.t(o))}),n.querySelectorAll("[data-i18n-attr]").forEach(a=>{var l;const o=a.dataset.i18nKey,i=((l=a.dataset.i18nAttr)==null?void 0:l.split(/\s+/))??[];if(!o||i.length===0)return;const s=this.t(o);for(const d of i)a.setAttribute(d,s)});const r=document.getElementById("mlcad-lang-badge");r&&(r.textContent=this.localeBadge)}}const jn=1128612673,qa=1e5;function Ve(e){if(e.version!==D)throw new Error(`Unsupported chunk version: ${e.version}`);const t=new ot;t.writeU32(jn),t.writeU8(D),t.writeU8(0),t.writeU8(0),t.writeU8(0),t.writeString(e.layoutBtrId),t.writeU32(e.lineBatches.length);for(const n of e.lineBatches)vn(t,n);t.writeU32(e.meshBatches.length);for(const n of e.meshBatches)xn(t,n);return t.toUint8Array()}function Zn(e){const t=new it(e);if(t.readU32()!==jn)throw new Error("Invalid chunk magic");const r=t.readU8();if(t.readU8(),t.readU8(),t.readU8(),r!==D)throw new Error(`Unsupported chunk version: ${r}`);const a=t.readString(),o=t.readU32();if(o>qa)throw new Error("Chunk line batch count exceeds limit");const i=[];for(let d=0;d<o;d++)i.push(bn(t));const s=t.readU32();if(s>qa)throw new Error("Chunk mesh batch count exceeds limit");const l=[];for(let d=0;d<s;d++)l.push(kn(t));return{version:D,layoutBtrId:a,lineBatches:i,meshBatches:l}}function Ja(e){const t=Ve(e),n=ve(t).bytes;return{uncompressed:t,compressed:n}}async function Cl(e){const t=Ve(e),n=(await pn(t)).bytes;return{uncompressed:t,compressed:n}}function Qa(e){return Zn(ct(e))}function Kn(e){return fn(e)?Qa(e):Zn(e)}const Wn=1,eo=2*1024*1024,Ye=2*1024*1024,Sl=512*1024,to=8*1024*1024,qn=12*1024*1024,no=2*1024*1024,Ut=6;function Dt(e,t,n){const r=e.length,a=r>0?Math.max(1,Math.min(Number.isFinite(t)?Math.floor(t):1,r)):0,o=new Array(r);let i=0,s=0;const l=d=>{const c=Promise.resolve().then(()=>n(e[d],d));c.catch(()=>{}),o[d]=c,i+=1};for(;i<a;)l(i);return{async next(){if(s>=r)return null;const d=s;s+=1;const c=await o[d];return i<r&&l(i),{item:e[d],index:d,bytes:c}}}}const Ml=/^(?:\.[/\\])?[A-Za-z0-9._-]+(?:[/\\][A-Za-z0-9._-]+)*$/;function ro(e){const t=e.trim();return!t||t!==e||t.startsWith("/")||t.startsWith("\\")||t.startsWith("//")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t)||t.includes("..")||t.includes("\\")?!1:Ml.test(t)}function Rt(e,t){if(!ro(e))throw new Error(`Invalid ${t}: must be a relative package path`)}function Ge(e){if(!e||typeof e!="object")throw new Error("Invalid package manifest");const t=e;if(t.format!=="acex-package")throw new Error("Unsupported package format");if(t.packageVersion!==Wn)throw new Error(`Unsupported package version: ${String(t.packageVersion)}`);if(t.snapshotVersion!==D)throw new Error(`Unsupported snapshot version: ${String(t.snapshotVersion)}`);if(!Array.isArray(t.layouts)||!Array.isArray(t.chunks))throw new Error("Invalid package manifest structure");for(const n of t.chunks){if(!n||typeof n!="object")throw new Error("Invalid package chunk entry");Rt(n.href,"chunk href")}for(const n of t.osnapChunks??[]){if(!n||typeof n!="object")throw new Error("Invalid package osnap chunk entry");Rt(n.href,"osnap chunk href")}return t}function ao(e){return{version:D,meta:e.meta,layers:e.layers,activeLayoutBtrId:e.activeLayoutBtrId,layouts:e.layouts.map(t=>({btrId:t.btrId,name:t.name,isModelSpace:t.isModelSpace,lineBatches:[],meshBatches:[],viewports:t.viewports,...t.savedView?{savedView:t.savedView}:{}}))}}function Nt(e,t){Rt(t,"chunk href");let n,r;try{n=new URL(t,e),r=new URL(e)}catch{throw new Error("Invalid chunk or manifest URL")}if(n.protocol!==r.protocol||n.host!==r.host)throw new Error("Chunk URL must share the manifest origin");const a=r.pathname.replace(/[^/]*$/,""),o=n.pathname;if(!o.startsWith(a))throw new Error("Chunk URL escapes package directory");if(o.split("/").includes(".."))throw new Error("Chunk URL escapes package directory");return n.toString()}function oo(e,t){Rt(e,"manifestUrl");let n,r;try{n=new URL(e,t),r=new URL(t)}catch{throw new Error("Invalid manifestUrl")}if(n.protocol!==r.protocol||n.host!==r.host)throw new Error("manifestUrl must be same-origin");return n.toString()}async function Jn(e,t,n){const r=await e(t);if(!r.ok)throw new Error(`Failed to load ${n} (${r.status})`);const a=r.headers.get("content-length");if(a!=null){const i=Number(a);if(Number.isFinite(i)&&i>lt)throw new Error(`${n} exceeds size limit`)}const o=await r.arrayBuffer();if(o.byteLength>lt)throw new Error(`${n} exceeds size limit`);return new Uint8Array(o)}async function Pl(e){var f;const t=e.fetchImpl??Ze,n=e.loadOsnap!==!1,r=e.fetchConcurrency??Ut,a=await t(e.manifestUrl);if(!a.ok)throw new Error(`Failed to load package manifest (${a.status})`);const o=Ge(await a.json()),i=ao(o),s=new Map(i.layouts.map(p=>[p.btrId,p])),l=e.layoutFilter==null?null:e.layoutFilter instanceof Set?e.layoutFilter:new Set(e.layoutFilter),d=o.chunks.filter(p=>l==null||l.has(p.layoutBtrId)),c=Dt(d,r,p=>Jn(t,Nt(e.manifestUrl,p.href),"geometry chunk"));let u=0;for(;;){const p=await c.next();if(!p)break;const h=p.item,g=s.get(h.layoutBtrId);if(!g)throw new Error("Unknown layout for package chunk");const y=Kn(p.bytes);if(y.layoutBtrId!==h.layoutBtrId)throw new Error("Chunk layout mismatch");so(g,y.lineBatches,y.meshBatches),u+=1,await((f=e.onChunk)==null?void 0:f.call(e,g,h,{loadedChunks:u,totalChunks:d.length,layoutBtrId:h.layoutBtrId,chunkId:h.id}))}if(n)for(const p of o.layouts){if(l!=null&&!l.has(p.btrId))continue;const h=s.get(p.btrId);h&&await io(o,e.manifestUrl,p.btrId,h,{fetchImpl:t})}return i}async function _l(e,t,n,r,a={}){var f;const o=a.fetchImpl??Ze,i=a.fetchConcurrency??Ut,s=e.layouts.find(p=>p.btrId===n);if(!s)throw new Error(`Layout not found: ${n}`);const l=new Map(e.chunks.map(p=>[p.id,p])),d=s.chunkIds.map(p=>l.get(p)).filter(p=>p!=null),c=Dt(d,i,p=>Jn(o,Nt(t,p.href),"geometry chunk"));let u=0;for(;;){const p=await c.next();if(!p)break;const h=p.item,g=Kn(p.bytes);so(r,g.lineBatches,g.meshBatches),u+=1,await((f=a.onChunk)==null?void 0:f.call(a,r,h,{loadedChunks:u,totalChunks:d.length,layoutBtrId:n,chunkId:h.id}))}}async function io(e,t,n,r,a={}){var b;if(r.osnap)return;const o=e.layouts.find(w=>w.btrId===n);if(!o)return;const i=o.osnapChunkIds;if(!i||i.length===0)return;const s=new Map((e.osnapChunks??[]).map(w=>[w.id,w])),l=i.map(w=>s.get(w)).filter(w=>w!=null);if(l.length===0)return;const d=a.fetchImpl??Ze,c=a.fetchConcurrency??Ut,u=a.yieldFn??(()=>new Promise(w=>{setTimeout(w,0)})),f=l.reduce((w,A)=>w+A.primitiveCount,0),p=f>0?new Array(f):[];let h=0;const g=Dt(l,c,w=>Jn(d,Nt(t,w.href),"osnap chunk"));let y=0;for(;;){const w=await g.next();if(!w)break;const A=w.item,M=qr(w.bytes).primitives;if(f>0)for(let C=0;C<M.length;C++)p[h++]=M[C];else for(const C of M)p.push(C);y+=1,await((b=a.onChunk)==null?void 0:b.call(a,{loadedChunks:y,totalChunks:l.length,layoutBtrId:n,chunkId:A.id})),await u()}f>0&&h!==f&&(p.length=h),r.osnap={primitives:p}}function so(e,t,n){e.lineBatches.push(...t),e.meshBatches.push(...n)}const ne="drawing.acex.json",Qn=`./${ne}`,lo=["manifest","acex"],je="https://acex-package.invalid/",Ze=(e,t)=>globalThis.fetch(e,t);function Il(e){return e.directoryPicker||e.webkitDirectory}function Bl(e){const t=(e==null?void 0:e.hasDirectoryPicker)??typeof globalThis.showDirectoryPicker=="function",n=(e==null?void 0:e.isSecureContext)??(typeof globalThis.isSecureContext=="boolean"?globalThis.isSecureContext:!0);let r=e==null?void 0:e.supportsWebkitDirectoryAttribute;if(r==null&&(r=!1,typeof document<"u")){const a=document.createElement("input");a.type="file",r="webkitdirectory"in a||"directory"in a}return{directoryPicker:t&&n,webkitDirectory:r}}function co(e){var r;const t=e.startsWith("?")?e.slice(1):e;if(!t)return null;let n;try{n=new URLSearchParams(t)}catch{return null}for(const a of lo){const o=(r=n.get(a))==null?void 0:r.trim();if(o)return o}return null}function Tl(e){var r;const t=co(e.search??"");if(t)return{href:t,fromQuery:!0};const n=(r=e.configManifestUrl)==null?void 0:r.trim();return n?{href:n,fromQuery:!1}:{href:Qn,fromQuery:!1}}function uo(e){return/^https?:\/\//i.test(e.trim())}function zl(e,t){const n=e.trim();if(!n)throw new Error("Missing manifest URL");if(uo(n))try{return new URL(n).toString()}catch{throw new Error("Invalid manifest URL")}return oo(n,t)}async function Fl(e,t=Ze){let n;try{n=await t(e)}catch(a){return{ok:!1,reason:"network",error:a instanceof Error?a:new Error(String(a))}}if(n.status===404||n.status===410)return{ok:!1,reason:"not-found",error:new Error(`Failed to load package manifest (${n.status})`)};if(!n.ok)return{ok:!1,reason:"network",error:new Error(`Failed to load package manifest (${n.status})`)};let r;try{r=await n.json()}catch(a){return{ok:!1,reason:"invalid",error:a instanceof Error?a:new Error("Invalid package manifest JSON")}}try{return{ok:!0,manifest:Ge(r)}}catch(a){return{ok:!1,reason:"invalid",error:a instanceof Error?a:new Error(String(a))}}}function mo(e,t){let n=e.replace(/\\/g,"/").replace(/^\/+/,"");if(t){const r=t.replace(/\\/g,"/").replace(/\/+$/,"");n===r?n="":n.startsWith(`${r}/`)&&(n=n.slice(r.length+1))}return n.replace(/^\.\//,"")}function po(e){const t=[...e].map(o=>o.replace(/\\/g,"/").replace(/^\/+/,"")).filter(Boolean);if(t.length===0)return null;const n=t[0].split("/")[0];return!n||n===ne||!t.every(o=>o.split("/")[0]===n)?null:t.some(o=>o.includes("/"))?n:null}function Hl(e){const t=[...e],n=po(t.map(a=>a.relativePath)),r=new Map;for(const a of t){const o=mo(a.relativePath,n);!o||o.endsWith("/")||r.set(o,a.bytes)}return r}function Ol(e,t){const n=(t==null?void 0:t.manifestFileName)??ne;if(!e.has(n))throw new Error(`Missing ${n} in selected folder`);const r=new URL(n,je).toString(),a=new URL(je).origin;return{manifestUrl:r,fetchImpl:async i=>{const s=new URL(String(i));if(s.origin!==a)return new Response(null,{status:404});const l=decodeURIComponent(s.pathname.replace(/^\/+/,"")),d=e.get(l);if(!d)return new Response(null,{status:404});if(l.endsWith(".json")){const u=new TextDecoder().decode(d);return new Response(u,{status:200,headers:{"Content-Type":"application/json"}})}const c=new Uint8Array(d.byteLength);return c.set(d),new Response(c,{status:200})}}}function Ul(e){return e.has(ne)?ne:null}function er(...e){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 1024 1024">${e.map(n=>`<path fill="currentColor" d="${n}"/>`).join("")}</svg>`}const Dl='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10.4379 15.2979h.002l4.86-4.86-9.722-4.86 4.86 9.72Zm7.562-5.298-3.434 3.434 3.2 3.2-1.132 1.132-3.2-3.2-3.434 3.434-7.6-15.6 15.6 7.6Z"/></svg>',Rl='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M15.08 12.8537l.002-.002V5.5897c0-.422-.652-.414-.652 0v3.466c0 .938-1.482.95-1.482 0v-4.83c0-.414-.6381-.414-.6381 0h-.014v4.83c.014.95-1.482.95-1.482 0V3.4437c0-.42-.638-.414-.638 0v5.612c0 .95-1.494.95-1.494 0V4.2317c0-.408-.64-.42-.64 0v6.756c0 .802-1.094 1.088-1.494.388-.26-.446-.518-.892-.776-1.338-.338-.482-1.1-.15-.794.38.326.566.652 1.132.978 1.698.006.012.014.026.02.04.552.946 1.106 1.89 1.658 2.834.19.3.422.578.666.802h-.006c.672.61 1.528.964 2.418 1.052.888.06 1.7921-.124 2.5601-.612.3-.19.572-.416.816-.68.326-.368.57-.776.734-1.204.176-.482.258-.97.258-1.494Zm-.91-8.608-.004-.002c.958-.38 2.058.244 2.058 1.346v7.266c0 .652-.108 1.29-.332 1.894-.216.564-.53 1.114-.964 1.576-.318.34-.666.632-1.046.884-.978.612-2.1461.862-3.2601.774-1.128-.102-2.228-.564-3.098-1.352-.326-.292-.612-.646-.87-1.034-.558-.96-1.114-1.92-1.672-2.88l-.012-.028c-.326-.568-.652-1.138-.978-1.706-.59-1.018.068-2.186 1.156-2.336.536-.074 1.126.116 1.562.72.026.028.04.062.054.096.04.074.082.146.122.218V4.2337c0-1.176 1.244-1.788 2.202-1.278.42-1.278 2.378-1.264 2.792-.014.9721-.51 2.2221.102 2.2221 1.284v.06c.022-.014.046-.026.068-.04Z"/></svg>',fo='<path fill="currentColor" d="M9.3333 14.125 5.875 10.6667V14.125H9.3333Zm4.7917-3.4583-3.4583 3.4583H14.125V10.6667ZM10.6667 5.875 14.125 9.3333V5.875H10.6667ZM5.875 9.3333 9.3333 5.875H5.875V9.3333Zm9.2083 5.475c1.2333-1.3 1.9083-3.0333 1.9083-4.825-.0083-3.325-2.35-6.1833-5.6083-6.8417C8.125 2.4833 4.85 4.2 3.55 7.2583c-1.3 3.0583-.275 6.6083 2.4583 8.5 2.725 1.8917 6.4167 1.6 8.8167-.6917.0917-.0833.175-.175.2583-.2583Zm1.2583.5917 2.575 2.575c-.3167.3167-.625.625-.9417.9417-.8583-.8583-1.7167-1.7167-2.575-2.575-3.4083 2.9-8.4917 2.5917-11.525-.6917S.9417 7.275 4.1083 4.1083C7.2667.9417 12.3667.8417 15.65 3.875s3.5917 8.1167.6917 11.525Z"/>',Nl=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${fo}</svg>`,ho='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M15.0833 14.8083c1.2333-1.3 1.9083-3.0333 1.9083-4.825-.0083-3.325-2.35-6.1833-5.6083-6.8417C8.125 2.4833 4.85 4.2 3.55 7.2583c-1.3 3.0583-.275 6.6083 2.4583 8.5 2.725 1.8917 6.4167 1.6 8.8167-.6917.0917-.0833.175-.175.2583-.2583Zm1.2583.5917 2.575 2.575c-.3167.3167-.625.625-.9417.9417-.8583-.8583-1.7167-1.7167-2.575-2.575-3.4083 2.9-8.4917 2.5917-11.525-.6917C.8417 12.3667.9417 7.275 4.1083 4.1083 7.2667.9417 12.3667.8417 15.65 3.875s3.5917 8.1167.6917 11.525Zm-3.55-2.6083V7.2083H7.2083v5.5833h5.5833ZM5.875 5.875h8.25v8.25H5.875V5.875Z"/></svg>',Xl='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="m434.8 137.65l-149.36-68.1c-16.19-7.4-42.69-7.4-58.88 0L77.3 137.65c-17.6 8-17.6 21.09 0 29.09l148 67.5c16.89 7.7 44.69 7.7 61.58 0l148-67.5c17.52-8 17.52-21.1-.08-29.09M160 308.52l-82.7 37.11c-17.6 8-17.6 21.1 0 29.1l148 67.5c16.89 7.69 44.69 7.69 61.58 0l148-67.5c17.6-8 17.6-21.1 0-29.1l-79.94-38.47"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="m160 204.48l-82.8 37.16c-17.6 8-17.6 21.1 0 29.1l148 67.49c16.89 7.7 44.69 7.7 61.58 0l148-67.49c17.7-8 17.7-21.1.1-29.1L352 204.48"/></svg>',$l='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><rect x="2" y="2" width="8.2" height="5" rx="1.2" fill="currentColor"/><rect x="2" y="8.5" width="8.2" height="9.5" rx="1.2" fill="currentColor"/><rect x="11.7" y="2" width="6.3" height="10" rx="1.2" fill="currentColor"/><rect x="11.7" y="13.5" width="6.3" height="4.5" rx="1.2" fill="currentColor"/></svg>',Vl='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M1.5 7h17v6h-17ZM4.25 7h1v2.5h-1ZM7.5 7h.75v1.5H7.5ZM10.25 7h1v2.5h-1ZM13.5 7h.75v1.5H13.5ZM16.25 7h1v2.5h-1Z"/></svg>',Yl='<path fill="currentColor" fill-rule="evenodd" d="M2.25 15h15.5v3.4H2.25Zm1.5 0h.7v1.45h-.7Zm2.95 0h.7v1.45h-.7Zm2.95 0h.7v1.45h-.7Zm2.95 0h.7v1.45h-.7Zm2.95 0h.7v1.45h-.7Z"/>',S="var(--el-color-primary, var(--ml-ui-accent, #409eff))";function ge(e){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${e}${Yl}</svg>`}const Gl=ge(`<rect fill="${S}" x="2.9" y="2.5" width="1.25" height="8.8" rx=".2"/><rect fill="${S}" x="15.85" y="2.5" width="1.25" height="8.8" rx=".2"/><path fill="${S}" d="M4.4 6.9 7.2 5.05v3.7Z"/><path fill="${S}" d="M15.6 6.9 12.8 5.05v3.7Z"/><rect fill="${S}" x="6.7" y="6.25" width="6.6" height="1.3"/>`),jl=ge(`<rect fill="${S}" x="2.9" y="2.5" width="1.25" height="8.8" rx=".2"/><rect fill="${S}" x="15.85" y="2.5" width="1.25" height="8.8" rx=".2"/><path fill="${S}" d="M4.4 6.9 7.2 5.05v3.7Z"/><path fill="${S}" d="M15.6 6.9 12.8 5.05v3.7Z"/><rect fill="${S}" x="6.7" y="6.25" width="6.6" height="1.3"/><circle fill="currentColor" cx="10" cy="3.45" r="2.2"/><text x="10" y="4.42" text-anchor="middle" font-size="3.15" font-weight="700" font-family="Arial,Helvetica,sans-serif" fill="${S}">n</text>`),Zl=ge(`<g fill="none" stroke="${S}" stroke-linejoin="miter"><path stroke-width="1.55" stroke-linecap="butt" d="M16.9 12.25H4.9L11.6 3.03"/><path stroke-width="1.7" stroke-linecap="butt" d="M11.05 12.25A6.15 6.15 0 0 0 8.51 7.27"/></g><path fill="${S}" d="M11.05 12.25 9.85 10.55h2.4Z"/><path fill="${S}" d="M8.51 7.27 10.46 7.39 9.23 9.09Z"/>`),Kl=ge(`<path fill="${S}" d="M5 12V4.2A7.8 7.8 0 0 1 12.8 12Z"/>`),Wl=ge(`<g fill="none" stroke-linejoin="miter"><path stroke="currentColor" stroke-width="1.5" stroke-linecap="butt" d="M4.9 11.6A8.3 8.3 0 0 1 13.2 3.3"/><path stroke="currentColor" stroke-width="1.35" stroke-linecap="square" d="M10.4 11.6H13.2V8.8"/><path stroke="currentColor" stroke-width="1.35" stroke-linecap="butt" d="M13.2 11.6v1.7"/><rect stroke="${S}" stroke-width="1.15" x="3.65" y="10.35" width="2.5" height="2.5"/><rect stroke="${S}" stroke-width="1.15" x="11.95" y="2.05" width="2.5" height="2.5"/></g>`),ql=ge(`<circle fill="none" stroke="${S}" stroke-width="1.4" cx="9.1" cy="7.3" r="4.7"/><circle fill="${S}" cx="9.1" cy="7.3" r="1.05"/><path fill="none" stroke="${S}" stroke-width="1.35" stroke-linecap="round" d="M9.1 7.3 13.35 3.7"/><path fill="${S}" d="M13.35 3.7 11.15 4.2 12.55 5.7Z"/>`),Jl=ge(`<g fill="none" stroke="${S}" stroke-linecap="round" stroke-linejoin="round"><path stroke-width="1.4" d="M4 4.8v7.4h7.6"/><path stroke-width="1.2" stroke-dasharray="1.7 1.2" d="M4 6.9h7M11 12.2V6.9"/></g><path fill="${S}" d="M4 2.5 2.45 4.8h3.1ZM13.8 12.2 11.5 10.7v3Z"/><circle fill="${S}" cx="11" cy="6.9" r="1.3"/>`),go='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512" fill="currentColor" aria-hidden="true"><path d="M 459.5 0 L 475.5 0 L 476.5 1 L 479.5 1 L 485.5 3 Q 487.8 6.2 492.5 7 L 501 14.5 L 505 19.5 L 511 32.5 Q 510.2 35.8 512 36.5 L 512 52.5 L 511 53.5 L 511 56.5 L 509 62.5 L 506 68.5 L 493 89.5 L 483 108.5 L 478 115.5 L 472 127.5 L 467 134.5 L 457 153.5 L 452 160.5 L 442 179.5 L 437 186.5 L 431 198.5 L 440 213.5 L 440 215.5 L 443 220.5 L 447 232.5 L 448 240.5 L 449 241.5 L 449 245.5 L 450 246.5 L 450 254.5 L 451 255.5 L 451 274.5 L 450 275.5 L 450 283.5 L 449 284.5 L 449 289.5 L 448 290.5 L 448 294.5 L 447 295.5 L 446 302.5 L 442 314.5 L 438 322.5 L 438 324.5 L 428 345.5 L 428 347.5 L 425 352.5 L 422 361.5 L 418 368.5 L 418 370.5 L 415 375.5 L 412 384.5 L 408 391.5 L 408 393.5 L 405 398.5 L 402 407.5 L 398 414.5 L 395 423.5 L 391 430.5 L 391 432.5 L 381 453.5 L 381 455.5 L 378 460.5 L 375 469.5 L 371 476.5 L 368 485.5 L 361.5 497 L 353.5 501 L 348.5 501 L 347.5 500 L 344.5 500 L 329.5 495 L 326.5 493 L 321.5 492 L 318.5 490 L 303.5 485 L 289.5 478 L 287.5 478 L 282 473.5 L 279 467.5 L 279 459.5 L 280 458.5 L 280 455.5 L 281 454.5 L 281 451.5 L 282 450.5 L 283 442.5 L 284 441.5 L 286 431.5 L 285.5 431 L 281.5 435 L 259.5 455 L 255.5 457 L 246.5 457 L 223.5 444 L 189.5 421 L 155.5 394 L 133 373.5 L 130 367.5 L 130 359.5 L 134 352.5 L 223 233.5 L 242 206.5 L 254.5 192 L 271.5 177 L 285.5 168 L 299.5 161 L 314.5 156 L 317.5 156 L 318.5 155 L 330.5 154 L 331.5 153 L 352.5 153 L 354 151.5 L 356 146.5 L 372 120.5 L 374 115.5 L 387 94.5 L 397 75.5 L 402 68.5 L 408 56.5 L 413 49.5 L 423 30.5 L 431 17.5 L 439.5 9 L 449.5 3 L 455.5 1 L 458.5 1 L 459.5 0 Z M 466 30 L 459 33 L 454 39 L 448 51 L 443 58 L 433 77 L 428 84 L 414 110 L 409 117 L 407 122 L 405 124 L 403 129 L 401 131 L 399 136 L 384 161 L 386 162 L 388 162 L 396 166 L 409 175 L 422 153 L 424 148 L 429 141 L 431 136 L 433 134 L 435 129 L 437 127 L 439 122 L 444 115 L 454 96 L 459 89 L 469 70 L 474 63 L 482 47 L 482 43 L 480 38 L 475 32 L 469 30 L 466 30 Z M 333 183 L 332 184 L 328 184 L 327 185 L 324 185 L 323 186 L 320 186 L 314 188 L 300 195 L 286 205 L 271 220 L 267 225 L 266 228 L 410 310 L 412 307 L 412 305 L 416 296 L 418 285 L 419 284 L 419 279 L 420 278 L 420 252 L 419 251 L 419 246 L 417 241 L 417 238 L 411 224 L 402 211 L 389 198 L 371 188 L 362 185 L 352 184 L 351 183 L 333 183 Z M 248 252 L 195 322 L 193 326 L 172 353 L 167 361 L 194 384 L 228 409 L 249 422 L 256 417 L 303 372 L 310 368 L 318 368 L 322 370 L 328 378 Q 327 381 329 382 L 329 386 L 326 395 L 326 399 L 323 408 L 323 411 L 322 412 L 322 416 L 319 425 L 319 428 L 318 429 L 318 432 L 317 433 L 317 437 L 314 446 L 314 449 L 313 450 L 313 453 L 312 454 L 316 456 L 318 456 L 331 462 L 343 466 L 351 448 L 351 446 L 354 441 L 354 439 L 357 434 L 357 432 L 364 418 L 364 416 L 367 411 L 367 409 L 370 404 L 370 402 L 377 388 L 377 386 L 380 381 L 380 379 L 383 374 L 383 372 L 387 365 L 390 356 L 393 351 L 393 349 L 396 344 L 397 339 L 375 326 L 373 324 L 368 322 L 366 320 L 361 318 L 354 313 L 349 311 L 347 309 L 342 307 L 340 305 L 335 303 L 321 294 L 316 292 L 314 290 L 309 288 L 307 286 L 302 284 L 295 279 L 276 269 L 248 252 Z "/><path d="M 170.5 100 L 179.5 100 Q 185 102 188 106.5 L 190 110.5 L 190 134.5 L 184.5 142 L 177.5 145 L 171.5 145 L 166.5 143 L 162 138.5 L 159 129.5 L 159 115.5 L 160 114.5 Q 159.2 109.7 161 107.5 L 166.5 102 L 170.5 100 Z "/><path d="M 131.5 140 L 151.5 140 L 156.5 142 L 162 147.5 L 164 151.5 L 164 159.5 L 163 162.5 L 158.5 168 L 152.5 171 L 130.5 171 L 124.5 168 L 122 165.5 L 119 159.5 L 119 151.5 Q 121.3 145.3 126.5 142 L 131.5 140 Z "/><path d="M 197.5 140 L 218.5 140 L 223.5 142 L 228 146.5 L 231 152.5 L 231 158.5 L 229 163.5 L 223.5 169 L 218.5 171 L 197.5 171 L 192.5 169 L 188 164.5 L 186 160.5 L 185 153.5 L 188 146.5 L 191.5 143 L 197.5 140 Z "/><path d="M 171.5 166 L 177.5 166 L 180.5 167 L 187 171.5 L 190 176.5 L 190 200.5 Q 188 206 183.5 209 L 179.5 211 L 173.5 212 L 167.5 210 L 161 203.5 Q 159.2 201.3 160 196.5 L 159 195.5 L 159 181.5 L 162 172.5 L 165.5 169 L 171.5 166 Z "/><path d="M 50.5 223 L 60.5 223 L 68 228.5 L 71 234.5 L 71 256.5 Q 69.1 262.6 64.5 266 L 59.5 268 L 51.5 268 Q 45.3 265.7 42 260.5 L 40 255.5 L 40 235.5 L 42 230.5 L 48.5 224 L 50.5 223 Z "/><path d="M 13.5 263 L 30.5 263 Q 31.5 265 35.5 264 L 43 270.5 L 45 274.5 L 45 282.5 Q 43.1 288.6 38.5 292 L 33.5 294 L 10.5 294 Q 5 292 2 287.5 L 0 283.5 L 0 274.5 Q 2.3 268.3 7.5 265 L 13.5 263 Z "/><path d="M 80.5 263 L 97.5 263 L 103.5 265 L 108 268.5 L 111 273.5 L 112 279.5 L 109 287.5 L 104.5 292 L 100.5 294 L 77.5 294 Q 71.3 291.7 68 286.5 L 66 281.5 L 66 276.5 L 69 269.5 L 72.5 266 L 80.5 263 Z "/><path d="M 54.5 289 L 61.5 290 L 69 296.5 L 71 301.5 L 71 322.5 L 69 327.5 L 63.5 333 L 58.5 335 L 53.5 335 L 46.5 332 L 43 328.5 L 40 321.5 L 40 302.5 Q 41.8 301.8 41 298.5 L 46.5 292 L 54.5 289 Z "/><path d="M 98.5 400 L 107.5 402 L 113 407.5 L 115 411.5 L 115 434.5 Q 112.7 440.7 107.5 444 L 101.5 446 L 96.5 446 L 90.5 443 L 87 439.5 L 84 430.5 L 84 415.5 L 85 414.5 Q 84.3 410.3 86 408.5 L 92.5 402 L 98.5 400 Z "/><path d="M 55.5 441 L 77.5 441 L 80.5 442 L 86 446.5 L 89 451.5 L 89 460.5 Q 86.7 466.7 81.5 470 L 76.5 472 L 56.5 472 L 51.5 470 L 46 464.5 L 44 460.5 L 44 452.5 L 45 449.5 L 49.5 444 L 55.5 441 Z "/><path d="M 121.5 441 L 144.5 441 Q 150.7 443.3 154 448.5 L 156 453.5 L 156 458.5 L 154 464.5 L 148.5 470 L 146.5 470 L 143.5 472 L 122.5 472 L 116.5 469 L 113 465.5 L 111 461.5 L 110 455.5 Q 112 454.5 111 450.5 L 117.5 443 L 121.5 441 Z "/><path d="M 96.5 467 L 103.5 467 L 106.5 468 L 113 473.5 L 115 478.5 L 115 501.5 Q 113 507 108.5 510 L 104.5 512 L 95.5 512 Q 89.3 509.7 86 504.5 Q 84.3 502.7 85 498.5 L 84 497.5 L 84 482.5 L 87 473.5 L 91.5 469 L 96.5 467 Z "/></svg>',Ql=go,ec='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7" fill="currentColor"/><rect x="14" y="14" width="7" height="7" fill="none" stroke="currentColor" stroke-width="1"/><path d="M12 4a8 8 0 0 1 7.25 7.25" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><path d="M20.75 10 L17.25 10 L19 12.5 Z" fill="currentColor"/><path d="M12 20a8 8 0 0 1-8-8" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><path d="M6 14 L2.5 14 L4 11 Z" fill="currentColor"/></svg>',tc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" style="fill:none"><g fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12.4 3.25H5.5A2.25 2.25 0 0 0 3.25 5.5v9A2.25 2.25 0 0 0 5.5 16.75h9A2.25 2.25 0 0 0 16.75 14.5V8.6"/><g transform="rotate(45 13.2 6.7)"><rect x="11.7" y="1.55" width="3" height="7.45" rx="1.45"/><path d="M11.7 3.2h3"/><path d="M11.7 9 13.2 12.15 14.7 9"/><rect x="12.8" y="7.05" width="0.8" height="1.2" rx="0.4"/></g></g></svg>',nc='<path fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="butt" stroke-linejoin="miter" d="M2.6 6.8v8.5h5.2l2.2 2.4 2.2-2.4h5.2"/>',wo='<g fill="none" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round" transform="rotate(46 14.8 9)"><rect x="13.65" y="4.7" width="2.3" height="5.6" rx="1.05"/><path d="M13.65 10.3 14.8 12.9 15.95 10.3"/></g>';function Ee(e){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${nc}${e}</svg>`}const rc=Ee('<path fill="currentColor" d="M6.4 12.2c-1.85 0-3.3-1.25-3.3-2.85 0-1.35.95-2.5 2.3-2.8.45-1.7 1.95-2.85 3.7-2.85 1.25 0 2.35.55 3.05 1.45.55-.7 1.45-1.15 2.5-1.15 1.85 0 3.25 1.3 3.25 2.95 0 .3-.05.55-.1.8 1.2.4 2.05 1.4 2.05 2.65 0 1.55-1.5 2.8-3.4 2.8H6.4Z"/>'),ac=Ee(`<rect fill="none" stroke="currentColor" stroke-width="1.35" x="5" y="2.8" width="8.2" height="7.2"/><rect fill="${S}" x="4.2" y="2" width="2" height="2"/><rect fill="${S}" x="12.2" y="9" width="2" height="2"/>${wo}`),oc=Ee(`<ellipse fill="none" stroke="currentColor" stroke-width="1.35" cx="9" cy="6.6" rx="4" ry="3.6"/><rect fill="${S}" x="8" y="2.1" width="2" height="2"/><rect fill="${S}" x="4" y="5.6" width="2" height="2"/>${wo}`),ic=Ee('<path fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" d="M4.4 12.6 10.2 7"/><rect fill="currentColor" x="10.2" y="1.2" width="7.8" height="5.8" rx=".35"/>'),sc=Ee('<path fill="currentColor" fill-rule="evenodd" d="M10 2.2 15.3 13.1h-2.2l-1.05-2.95H7.95L6.9 13.1H4.7L10 2.2Zm0 3.4-1.15 3.2h2.3L10 5.6Z"/>'),lc=Ee('<g transform="rotate(-40 10 7.6)" fill="currentColor"><path d="M3.5 6.75h9V5.15L16.7 7.6 12.5 10.05V8.45h-9Z"/></g>'),cc=er("M624 475.968V640h144a128 128 0 0 1 128 128H128a128 128 0 0 1 128-128h144V475.968a192 192 0 1 1 224 0M128 896v-64h768v64z"),yo=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><rect x="3.5" y="3" width="13" height="14" rx="1.5" fill="none" stroke="currentColor" stroke-width="1.5"/><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M3.5 6.5h13"/><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M6.5 9.5h7M6.5 12h7M6.5 14.5h3.2"/><g fill="none" stroke="${S}" stroke-width="1.7" stroke-linecap="round"><circle cx="14.5" cy="14.7" r="4.2"/><path d="M17.5 17.7 19.5 19.7"/></g></svg>`,dc=yo,uc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" aria-hidden="true"><path stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round" d="M4.5 2h6.4L15.5 6.6V16.5A1.5 1.5 0 0 1 14 18H4.5A1.5 1.5 0 0 1 3 16.5V3.5A1.5 1.5 0 0 1 4.5 2z"/><path stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round" d="M10.9 2v4.6h4.6"/><path stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M10 5.8v6M7.2 9.6 10 12.5l2.8-2.9"/></svg>',mc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" aria-hidden="true"><path stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round" d="M15.5 2H9.1L4.5 6.6V16.5A1.5 1.5 0 0 0 6 18h9.5A1.5 1.5 0 0 0 17 16.5V3.5A1.5 1.5 0 0 0 15.5 2z"/><path stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round" d="M9.1 2v4.6H4.5"/><path stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M10 14.2V8M7.2 10.4 10 7.5l2.8 2.9"/></svg>',pc=go,fc=er("M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"),hc=er("M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176","M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"),gc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="m18.5 10 4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301 14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725 16.676 16.676 0 0 1 3.524 17.273l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877 16.165 16.165 0 0 0 11.91 6.001L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"/></svg>',wc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><circle cx="10" cy="10" r="4" fill="currentColor"/><path fill="none" stroke="currentColor" stroke-width="1.5" d="M10 2v2M10 16v2M2 10h2M16 10h2M4.2 4.2l1.4 1.4M14.4 14.4l1.4 1.4M4.2 15.8l1.4-1.4M14.4 5.6l1.4-1.4"/></svg>',yc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10 3a7 7 0 1 0 0 14 9 9 0 0 1 0-14Z"/></svg>',vc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" d="M10 6.5 5.5 11h9L10 6.5Z"/></svg>',bc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" d="M10 13.5 14.5 9h-9L10 13.5Z"/></svg>',vo='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10 2.6 18 9.8h-2.1V17h-4.4v-4.4H8.5V17H4.1V9.8H2L10 2.6Zm0 1.8L5.3 9.8V15.8h2V11.4h5.4v4.4h2V9.8L10 4.4Z"/></svg>',xc=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${fo}<path fill="${S}" d="M14.85 0.85 15.95 4.05 19.15 5.15 15.95 6.25 14.85 9.45 13.75 6.25 10.55 5.15 13.75 4.05Z"/><path fill="${S}" d="M17.55 8.35 18.15 10.15 19.95 10.75 18.15 11.35 17.55 13.15 16.95 11.35 15.15 10.75 16.95 10.15Z"/></svg>`,kc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M8.08 2.1h3.84l.32 1.52a6.4 6.4 0 0 1 1.36.78l1.48-.64 1.92 1.92-.64 1.48c.3.42.54.88.78 1.36l1.52.32v3.84l-1.52.32a6.4 6.4 0 0 1-.78 1.36l.64 1.48-1.92 1.92-1.48-.64a6.4 6.4 0 0 1-1.36.78l-.32 1.52H8.08l-.32-1.52a6.4 6.4 0 0 1-1.36-.78l-1.48.64-1.92-1.92.64-1.48a6.4 6.4 0 0 1-.78-1.36L1.34 11.92V8.08l1.52-.32c.24-.48.48-.94.78-1.36l-.64-1.48 1.92-1.92 1.48.64c.42-.3.88-.54 1.36-.78L8.08 2.1ZM10 7.2A2.8 2.8 0 1 0 10 12.8 2.8 2.8 0 0 0 10 7.2Z"/></svg>',Ac='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="none" stroke="currentColor" stroke-width="1.5" d="M10 2.5v6M7 5.5h6"/><circle cx="10" cy="14.5" r="3.2" fill="none" stroke="currentColor" stroke-width="1.5"/><circle cx="10" cy="14.5" r="1.1" fill="currentColor"/></svg>',Lc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10.09 3.53 16.09 6.97 10.09 10.29 4.18 7 10.09 3.56M10.09 2.4 2.17 7 3.31 7.65 10.09 11.45 17 7.62 18.17 7 10.08 2.37 10.09 2.4Z"/><path fill="currentColor" d="M10.25 14.83 18.17 10.22 17 9.57 10.22 13.57 3.32 9.59 2.17 10.22 10.25 14.83Z"/><path fill="currentColor" d="M10.25 17.63 18.17 13 17 12.37 10.22 16.37 3.32 12.38 2.17 13 10.25 17.63Z"/></svg>',Ec='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10.09 5.15 16.09 8.59 10.09 11.91 4.18 8.59 10.09 5.15ZM10.09 4 2.17 8.61 3.31 9.25 10.09 13.06 17 9.24 18.16 8.61 10.08 4 10.09 4Z"/><path fill="currentColor" d="M10.25 16.46 18.17 11.85 17 11.2 10.22 15.2 3.32 11.21 2.17 11.85 10.25 16.46Z"/><path fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" d="M3.5 3.5 16.5 16.5"/></svg>',Cc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M2.25 2.25h4.878v4.878H2.25V2.25Zm.978.978v2.924h2.924V3.228H3.228Z"/><path fill="currentColor" d="M5.175 20.773V7.128H4.204V21.75H21.75V4.204H7.128v.971H20.773v15.598H5.175Z"/></svg>',Sc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M3 2H2v16h16v-1H8v-5H3V2zm0 11v4h4v-4H3z"/></svg>',Mc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M16.98 11L18.5 11L18.5 10L16.98 10C16.86 8.13 16.05 6.44 14.8 5.2L16.88 2.83L16.12 2.17L14.05 4.54C12.79 3.57 11.21 3 9.5 3C5.36 3 2 6.36 2 10.5C2 14.64 5.36 18 9.5 18C13.47 18 16.73 14.91 16.98 11ZM15.98 10C15.86 8.43 15.18 7.01 14.14 5.95L10.6 10L15.98 10ZM13.39 5.29L8.4 11L15.98 11C15.73 14.36 12.92 17 9.5 17C5.91 17 3 14.09 3 10.5C3 6.91 5.91 4 9.5 4C10.96 4 12.31 4.48 13.39 5.29Z"/></svg>',Pc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="#e75958" d="M22 12H12l5 8.66A10 10 0 0 0 22 12Z"/><path fill="#814dff" d="M17 20.66 12 12 7 20.66A10 10 0 0 0 17 20.66Z"/><path fill="#13b0ce" d="M7 20.66 12 12H2A10 10 0 0 0 7 20.66Z"/><path fill="#4ecd83" d="M2 12H12L7 3.34A10 10 0 0 0 2 12Z"/><path fill="#ffc33f" d="M7 3.34 12 12l5-8.66A10 10 0 0 0 7 3.34Z"/><path fill="#ff9543" d="M17 3.34 12 12H22A10 10 0 0 0 17 3.34Z"/></svg>',_c=ho,Ic=Jl,Bc=rc,Tc=ac,zc=oc,Fc=fc,bo=hc,Ce={select:Dl,pan:Rl,zoomExtent:Nl,zoomSmart:xc,zoomBox:_c,measureDistance:Gl,measureContinuous:jl,measureAngle:Zl,measureArc:Wl,measureRadius:ql,measureArea:Kl,measureCoordinate:Ic,clearMeasurements:Ql,layer:Xl,layout:$l,zoomWindow:ho,zoomOriginal:vo,zoomSaved:vo,layerOn:Lc,layerOff:Ec,language:gc,osnap:Cc,orthoMode:Sc,polarTracking:Mc,color:Pc,chevronUp:vc,chevronDown:bc,measure:Vl,annotation:tc,markupCloud:Bc,markupCallout:ic,markupText:sc,markupRect:Tc,markupCircle:zc,markupArrow:lc,markupStamp:cc,markupPanel:yo,measurementPanel:dc,markupImport:uc,markupExport:mc,markupShow:Fc,markupHide:bo,markupVisibility:bo,clearMarkups:pc,settings:kc,simulatedMouse:Ac,switchBg:ec,themeLight:wc,themeDark:yc};function tr(e,t,n){const r=Object.entries(n).map(([i,s])=>`${i}="${oe(s)}"`).join(" "),a=n["data-i18n-key"],o=a?`<span class="mlcad-tool-btn-label" data-i18n-key="${oe(a)}" data-i18n-text>${oe(t)}</span>`:"";return`<button type="button" class="mlcad-tool-btn" title="${oe(t)}" aria-label="${oe(t)}" ${r}><span class="mlcad-tool-btn-icon" aria-hidden="true">${e}</span>${o}</button>`}function Hc(e,t,n){const r=Object.entries(n).map(([i,s])=>`${i}="${oe(s)}"`).join(" "),a=n["data-i18n-key"],o=a?` data-i18n-key="${oe(a)}" data-i18n-text`:"";return`<button type="button" class="mlcad-dropdown-item" role="menuitem" title="${oe(t)}" ${r}><span class="mlcad-dropdown-icon" aria-hidden="true">${e}</span><span class="mlcad-dropdown-label"${o}>${oe(t)}</span></button>`}function oe(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}const xo=[90,45,30,23,18,10,5],ko=90,Oc=ko,Uc={en:"toolbar.localeEn",zh:"toolbar.localeZh",cs:"toolbar.localeCs",tr:"toolbar.localeTr",ar:"toolbar.localeAr"},Dc={en:"English",zh:"中文",cs:"Čeština",tr:"Türkçe",ar:"العربية"};function Rc(){return`<div id="mlcad-locale-strip-wrap" hidden>
1
+ (function(m,I){typeof exports=="object"&&typeof module<"u"?I(exports,require("@mlightcad/three-renderer"),require("three"),require("three/examples/jsm/lines/LineMaterial.js"),require("three/examples/jsm/lines/LineSegments2.js"),require("@mlightcad/data-model")):typeof define=="function"&&define.amd?define(["exports","@mlightcad/three-renderer","three","three/examples/jsm/lines/LineMaterial.js","three/examples/jsm/lines/LineSegments2.js","@mlightcad/data-model"],I):(m=typeof globalThis<"u"?globalThis:m||self,I(m["cad-html-core"]={},m.threeRenderer,m.THREE,m.LineMaterial_js,m.LineSegments2_js,m.dataModel))})(this,(function(m,I,Si,vr,Mi,v){"use strict";function _i(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const E=_i(Si);var B=Uint8Array,G=Uint16Array,Jt=Int32Array,at=new B([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ot=new B([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Qt=new B([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),br=function(e,t){for(var n=new G(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var a=new Jt(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)a[o]=o-n[r]<<5|r;return{b:n,r:a}},xr=br(at,2),kr=xr.b,en=xr.r;kr[28]=258,en[258]=28;for(var Ar=br(ot,0),Pi=Ar.b,Lr=Ar.r,tn=new G(32768),P=0;P<32768;++P){var le=(P&43690)>>1|(P&21845)<<1;le=(le&52428)>>2|(le&13107)<<2,le=(le&61680)>>4|(le&3855)<<4,tn[P]=((le&65280)>>8|(le&255)<<8)>>1}for(var Q=(function(e,t,n){for(var r=e.length,a=0,o=new G(t);a<r;++a)e[a]&&++o[e[a]-1];var i=new G(t);for(a=1;a<t;++a)i[a]=i[a-1]+o[a-1]<<1;var s;if(n){s=new G(1<<t);var l=15-t;for(a=0;a<r;++a)if(e[a])for(var c=a<<4|e[a],d=t-e[a],u=i[e[a]-1]++<<d,p=u|(1<<d)-1;u<=p;++u)s[tn[u]>>l]=c}else for(s=new G(r),a=0;a<r;++a)e[a]&&(s[a]=tn[i[e[a]-1]++]>>15-e[a]);return s}),ce=new B(288),P=0;P<144;++P)ce[P]=8;for(var P=144;P<256;++P)ce[P]=9;for(var P=256;P<280;++P)ce[P]=7;for(var P=280;P<288;++P)ce[P]=8;for(var Pe=new B(32),P=0;P<32;++P)Pe[P]=5;var Ii=Q(ce,9,0),Bi=Q(ce,9,1),Ti=Q(Pe,5,0),zi=Q(Pe,5,1),nn=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},q=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},rn=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},an=function(e){return(e+7)/8|0},Ie=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new B(e.subarray(t,n))},Fi=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],U=function(e,t,n){var r=new Error(t||Fi[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,U),!n)throw r;return r},Er=function(e,t,n,r){var a=e.length,o=r?r.length:0;if(!a||t.f&&!t.l)return n||new B(0);var i=!n,s=i||t.i!=2,l=t.i;i&&(n=new B(a*3));var c=function(nt){var rt=n.length;if(nt>rt){var _e=new B(Math.max(rt*2,nt));_e.set(n),n=_e}},d=t.f||0,u=t.p||0,p=t.b||0,f=t.l,h=t.d,g=t.m,y=t.n,b=a*8;do{if(!f){d=q(e,u,1);var w=q(e,u+1,3);if(u+=3,w)if(w==1)f=Bi,h=zi,g=9,y=5;else if(w==2){var C=q(e,u,31)+257,_=q(e,u+10,15)+4,L=C+q(e,u+5,31)+1;u+=14;for(var x=new B(L),R=new B(19),H=0;H<_;++H)R[Qt[H]]=q(e,u+H*3,7);u+=_*3;for(var $=nn(R),me=(1<<$)-1,j=Q(R,$,1),H=0;H<L;){var V=j[q(e,u,me)];u+=V&15;var A=V>>4;if(A<16)x[H++]=A;else{var N=0,T=0;for(A==16?(T=3+q(e,u,3),u+=2,N=x[H-1]):A==17?(T=3+q(e,u,7),u+=3):A==18&&(T=11+q(e,u,127),u+=7);T--;)x[H++]=N}}var Y=x.subarray(0,C),X=x.subarray(C);g=nn(Y),y=nn(X),f=Q(Y,g,1),h=Q(X,y,1)}else U(1);else{var A=an(u)+4,k=e[A-4]|e[A-3]<<8,M=A+k;if(M>a){l&&U(0);break}s&&c(p+k),n.set(e.subarray(A,M),p),t.b=p+=k,t.p=u=M*8,t.f=d;continue}if(u>b){l&&U(0);break}}s&&c(p+131072);for(var tt=(1<<g)-1,W=(1<<y)-1,se=u;;se=u){var N=f[rn(e,u)&tt],Z=N>>4;if(u+=N&15,u>b){l&&U(0);break}if(N||U(2),Z<256)n[p++]=Z;else if(Z==256){se=u,f=null;break}else{var K=Z-254;if(Z>264){var H=Z-257,z=at[H];K=q(e,u,(1<<z)-1)+kr[H],u+=z}var re=h[rn(e,u)&W],Se=re>>4;re||U(3),u+=re&15;var X=Pi[Se];if(Se>3){var z=ot[Se];X+=rn(e,u)&(1<<z)-1,u+=z}if(u>b){l&&U(0);break}s&&c(p+131072);var Me=p+K;if(p<X){var Wt=o-X,qt=Math.min(X,Me);for(Wt+p<0&&U(3);p<qt;++p)n[p]=r[Wt+p]}for(;p<Me;++p)n[p]=n[p-X]}}t.l=f,t.p=se,t.b=p,t.f=d,f&&(d=1,t.m=g,t.d=h,t.n=y)}while(!d);return p!=n.length&&i?Ie(n,0,p):n.subarray(0,p)},ae=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Be=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},on=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var a=n.length,o=n.slice();if(!a)return{t:_r,l:0};if(a==1){var i=new B(n[0].s+1);return i[n[0].s]=1,{t:i,l:1}}n.sort(function(M,C){return M.f-C.f}),n.push({s:-1,f:25001});var s=n[0],l=n[1],c=0,d=1,u=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};d!=a-1;)s=n[n[c].f<n[u].f?c++:u++],l=n[c!=d&&n[c].f<n[u].f?c++:u++],n[d++]={s:-1,f:s.f+l.f,l:s,r:l};for(var p=o[0].s,r=1;r<a;++r)o[r].s>p&&(p=o[r].s);var f=new G(p+1),h=sn(n[d-1],f,0);if(h>t){var r=0,g=0,y=h-t,b=1<<y;for(o.sort(function(C,_){return f[_.s]-f[C.s]||C.f-_.f});r<a;++r){var w=o[r].s;if(f[w]>t)g+=b-(1<<h-f[w]),f[w]=t;else break}for(g>>=y;g>0;){var A=o[r].s;f[A]<t?g-=1<<t-f[A]++-1:++r}for(;r>=0&&g;--r){var k=o[r].s;f[k]==t&&(--f[k],++g)}h=t}return{t:new B(f),l:h}},sn=function(e,t,n){return e.s==-1?Math.max(sn(e.l,t,n+1),sn(e.r,t,n+1)):t[e.s]=n},Cr=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new G(++t),r=0,a=e[0],o=1,i=function(l){n[r++]=l},s=1;s<=t;++s)if(e[s]==a&&s!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(a),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(a);o=1,a=e[s]}return{c:n.subarray(0,r),n:t}},Te=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Sr=function(e,t,n){var r=n.length,a=an(t+2);e[a]=r&255,e[a+1]=r>>8,e[a+2]=e[a]^255,e[a+3]=e[a+1]^255;for(var o=0;o<r;++o)e[a+o+4]=n[o];return(a+4+r)*8},Mr=function(e,t,n,r,a,o,i,s,l,c,d){ae(t,d++,n),++a[256];for(var u=on(a,15),p=u.t,f=u.l,h=on(o,15),g=h.t,y=h.l,b=Cr(p),w=b.c,A=b.n,k=Cr(g),M=k.c,C=k.n,_=new G(19),L=0;L<w.length;++L)++_[w[L]&31];for(var L=0;L<M.length;++L)++_[M[L]&31];for(var x=on(_,7),R=x.t,H=x.l,$=19;$>4&&!R[Qt[$-1]];--$);var me=c+5<<3,j=Te(a,ce)+Te(o,Pe)+i,V=Te(a,p)+Te(o,g)+i+14+3*$+Te(_,R)+2*_[16]+3*_[17]+7*_[18];if(l>=0&&me<=j&&me<=V)return Sr(t,d,e.subarray(l,l+c));var N,T,Y,X;if(ae(t,d,1+(V<j)),d+=2,V<j){N=Q(p,f,0),T=p,Y=Q(g,y,0),X=g;var tt=Q(R,H,0);ae(t,d,A-257),ae(t,d+5,C-1),ae(t,d+10,$-4),d+=14;for(var L=0;L<$;++L)ae(t,d+3*L,R[Qt[L]]);d+=3*$;for(var W=[w,M],se=0;se<2;++se)for(var Z=W[se],L=0;L<Z.length;++L){var K=Z[L]&31;ae(t,d,tt[K]),d+=R[K],K>15&&(ae(t,d,Z[L]>>5&127),d+=Z[L]>>12)}}else N=Ii,T=ce,Y=Ti,X=Pe;for(var L=0;L<s;++L){var z=r[L];if(z>255){var K=z>>18&31;Be(t,d,N[K+257]),d+=T[K+257],K>7&&(ae(t,d,z>>23&31),d+=at[K]);var re=z&31;Be(t,d,Y[re]),d+=X[re],re>3&&(Be(t,d,z>>5&8191),d+=ot[re])}else Be(t,d,N[z]),d+=T[z]}return Be(t,d,N[256]),d+T[256]},Oi=new Jt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),_r=new B(0),Hi=function(e,t,n,r,a,o){var i=o.z||e.length,s=new B(r+i+5*(1+Math.ceil(i/7e3))+a),l=s.subarray(r,s.length-a),c=o.l,d=(o.r||0)&7;if(t){d&&(l[0]=o.r>>3);for(var u=Oi[t-1],p=u>>13,f=u&8191,h=(1<<n)-1,g=o.p||new G(32768),y=o.h||new G(h+1),b=Math.ceil(n/3),w=2*b,A=function(yr){return(e[yr]^e[yr+1]<<b^e[yr+2]<<w)&h},k=new Jt(25e3),M=new G(288),C=new G(32),_=0,L=0,x=o.i||0,R=0,H=o.w||0,$=0;x+2<i;++x){var me=A(x),j=x&32767,V=y[me];if(g[j]=V,y[me]=j,H<=x){var N=i-x;if((_>7e3||R>24576)&&(N>423||!c)){d=Mr(e,l,0,k,M,C,L,R,$,x-$,d),R=_=L=0,$=x;for(var T=0;T<286;++T)M[T]=0;for(var T=0;T<30;++T)C[T]=0}var Y=2,X=0,tt=f,W=j-V&32767;if(N>2&&me==A(x-W))for(var se=Math.min(p,N)-1,Z=Math.min(32767,x),K=Math.min(258,N);W<=Z&&--tt&&j!=V;){if(e[x+Y]==e[x+Y-W]){for(var z=0;z<K&&e[x+z]==e[x+z-W];++z);if(z>Y){if(Y=z,X=W,z>se)break;for(var re=Math.min(W,z-2),Se=0,T=0;T<re;++T){var Me=x-W+T&32767,Wt=g[Me],qt=Me-Wt&32767;qt>Se&&(Se=qt,V=Me)}}}j=V,V=g[j],W+=j-V&32767}if(X){k[R++]=268435456|en[Y]<<18|Lr[X];var nt=en[Y]&31,rt=Lr[X]&31;L+=at[nt]+ot[rt],++M[257+nt],++C[rt],H=x+Y,++_}else k[R++]=e[x],++M[e[x]]}}for(x=Math.max(x,H);x<i;++x)k[R++]=e[x],++M[e[x]];d=Mr(e,l,c,k,M,C,L,R,$,x-$,d),c||(o.r=d&7|l[d/8|0]<<3,d-=7,o.h=y,o.p=g,o.i=x,o.w=H)}else{for(var x=o.w||0;x<i+c;x+=65535){var _e=x+65535;_e>=i&&(l[d/8|0]=c,_e=i),d=Sr(l,d+1,e.subarray(x,_e))}o.i=i}return Ie(s,0,r+an(d)+a)},Ui=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),Pr=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Ui[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},Ir=function(e,t,n,r,a){if(!a&&(a={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),i=new B(o.length+e.length);i.set(o),i.set(e,o.length),e=i,a.w=o.length}return Hi(e,t.level==null?6:t.level,t.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,a)},Br=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},ee=function(e,t){return e[t]|e[t+1]<<8},J=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},ln=function(e,t){return J(e,t)+J(e,t+4)*4294967296},F=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Di=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&F(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},Ri=function(e){(e[0]!=31||e[1]!=139||e[2]!=8)&&U(6,"invalid gzip data");var t=e[3],n=10;t&4&&(n+=(e[10]|e[11]<<8)+2);for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(t&2)},Ni=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},Xi=function(e){return 10+(e.filename?e.filename.length+1:0)};function $i(e,t){return Ir(e,t||{},0,0)}function Vi(e,t){return Er(e,{i:2},t&&t.out,t&&t.dictionary)}function Yi(e,t){t||(t={});var n=Pr(),r=e.length;n.p(e);var a=Ir(e,t,Xi(t),8),o=a.length;return Di(a,t),F(a,o-8,n.d()),F(a,o-4,r),a}function Gi(e,t){var n=Ri(e);return n+8>e.length&&U(6,"invalid gzip data"),Er(e.subarray(n,-8),{i:2},new B(Ni(e)),t)}var Tr=function(e,t,n,r){for(var a in e){var o=e[a],i=t+a,s=r;Array.isArray(o)&&(s=Br(r,o[1]),o=o[0]),o instanceof B?n[i]=[o,s]:(n[i+="/"]=[new B(0),s],Tr(o,i,n,r))}},zr=typeof TextEncoder<"u"&&new TextEncoder,cn=typeof TextDecoder<"u"&&new TextDecoder,ji=0;try{cn.decode(_r,{stream:!0}),ji=1}catch{}var Zi=function(e){for(var t="",n=0;;){var r=e[n++],a=(r>127)+(r>223)+(r>239);if(n+a>e.length)return{s:t,r:Ie(e,n-1)};a?a==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):a&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function ye(e,t){var n;if(zr)return zr.encode(e);for(var r=e.length,a=new B(e.length+(e.length>>1)),o=0,i=function(c){a[o++]=c},n=0;n<r;++n){if(o+5>a.length){var s=new B(o+8+(r-n<<1));s.set(a),a=s}var l=e.charCodeAt(n);l<128||t?i(l):l<2048?(i(192|l>>6),i(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++n)&1023,i(240|l>>18),i(128|l>>12&63),i(128|l>>6&63),i(128|l&63)):(i(224|l>>12),i(128|l>>6&63),i(128|l&63))}return Ie(a,0,o)}function dn(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}else{if(cn)return cn.decode(e);var a=Zi(e),o=a.s,n=a.r;return n.length&&U(8),o}}var Ki=function(e,t){return t+30+ee(e,t+26)+ee(e,t+28)},Wi=function(e,t,n){var r=ee(e,t+28),a=dn(e.subarray(t+46,t+46+r),!(ee(e,t+8)&2048)),o=t+46+r,i=J(e,t+20),s=n&&i==4294967295?qi(e,o):[i,J(e,t+24),J(e,t+42)],l=s[0],c=s[1],d=s[2];return[ee(e,t+10),l,c,a,o+ee(e,t+30)+ee(e,t+32),d]},qi=function(e,t){for(;ee(e,t)!=1;t+=4+ee(e,t+2));return[ln(e,t+12),ln(e,t+4),ln(e,t+20)]},un=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&U(9),t+=r+4}return t},Fr=function(e,t,n,r,a,o,i,s){var l=r.length,c=n.extra,d=s&&s.length,u=un(c);F(e,t,i!=null?33639248:67324752),t+=4,i!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(o<0&&8),e[t++]=a&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var p=new Date(n.mtime==null?Date.now():n.mtime),f=p.getFullYear()-1980;if((f<0||f>119)&&U(10),F(e,t,f<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>1),t+=4,o!=-1&&(F(e,t,n.crc),F(e,t+4,o<0?-o-2:o),F(e,t+8,n.size)),F(e,t+12,l),F(e,t+14,u),t+=16,i!=null&&(F(e,t,d),F(e,t+6,n.attrs),F(e,t+10,i),t+=14),e.set(r,t),t+=l,u)for(var h in c){var g=c[h],y=g.length;F(e,t,+h),F(e,t+2,y),e.set(g,t+4),t+=4+y}return d&&(e.set(s,t),t+=d),t},Ji=function(e,t,n,r,a){F(e,t,101010256),F(e,t+8,n),F(e,t+10,n),F(e,t+12,r),F(e,t+16,a)};function Qi(e,t){t||(t={});var n={},r=[];Tr(e,"",n,t);var a=0,o=0;for(var i in n){var s=n[i],l=s[0],c=s[1],d=c.level==0?0:8,u=ye(i),p=u.length,f=c.comment,h=f&&ye(f),g=h&&h.length,y=un(c.extra);p>65535&&U(11);var b=d?$i(l,c):l,w=b.length,A=Pr();A.p(l),r.push(Br(c,{size:l.length,crc:A.d(),c:b,f:u,m:h,u:p!=i.length||h&&f.length!=g,o:a,compression:d})),a+=30+p+y+w,o+=76+2*(p+y)+(g||0)+w}for(var k=new B(o+22),M=a,C=o-a,_=0;_<r.length;++_){var u=r[_];Fr(k,u.o,u,u.f,u.u,u.c.length);var L=30+u.f.length+un(u.extra);k.set(u.c,u.o+L),Fr(k,a,u,u.f,u.u,u.c.length,u.o,u.m),a+=16+L+(u.m?u.m.length:0)}return Ji(k,a,r.length,C,M),k}function es(e,t){for(var n={},r=e.length-22;J(e,r)!=101010256;--r)(!r||e.length-r>65558)&&U(13);var a=ee(e,r+8);if(!a)return{};var o=J(e,r+16),i=o==4294967295||a==65535;if(i){var s=J(e,r-12);i=J(e,s)==101075792,i&&(a=J(e,s+32),o=J(e,s+48))}for(var l=0;l<a;++l){var c=Wi(e,o,i),d=c[0],u=c[1],p=c[2],f=c[3],h=c[4],g=c[5],y=Ki(e,g);o=h,d?d==8?n[f]=Vi(e.subarray(y,y+u),{out:new B(p)}):U(14,"unknown compression type "+d):n[f]=Ie(e,y,y+u)}return n}const Or=512*1024*1024,mn=512*1024*1024;class it{constructor(){this.chunks=[],this.length=0}writeU8(t){const n=new Uint8Array(1);n[0]=t&255,this.chunks.push(n),this.length+=1}writeU32(t){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t>>>0,!0),this.chunks.push(n),this.length+=4}writeI32(t){const n=new Uint8Array(4);new DataView(n.buffer).setInt32(0,t|0,!0),this.chunks.push(n),this.length+=4}writeF32(t){const n=new Uint8Array(4);new DataView(n.buffer).setFloat32(0,t,!0),this.chunks.push(n),this.length+=4}writeF64(t){const n=new Uint8Array(8);new DataView(n.buffer).setFloat64(0,t,!0),this.chunks.push(n),this.length+=8}writeBytes(t){this.chunks.push(t),this.length+=t.length}writeString(t){const n=ye(t);this.writeU32(n.length),this.writeBytes(n)}writeJson(t){this.writeString(JSON.stringify(t))}writeFloat32Array(t){this.alignTo(4);const n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);this.writeU32(n.length),this.writeBytes(n)}writeUint32Array(t){this.alignTo(4);const n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);this.writeU32(n.length),this.writeBytes(n)}alignTo(t){const n=this.length%t;if(n===0)return;const r=t-n;for(let a=0;a<r;a++)this.writeU8(0)}toUint8Array(){const t=new Uint8Array(this.length);let n=0;for(const r of this.chunks)t.set(r,n),n+=r.length;return t}}class st{constructor(t){this.bytes=t,this.offset=0}ensureAvailable(t){if(t<0||!Number.isFinite(t))throw new Error("Invalid binary length");if(this.offset+t>this.bytes.length)throw new Error("Unexpected end of binary buffer")}readU8(){return this.ensureAvailable(1),this.bytes[this.offset++]}readU32(){this.ensureAvailable(4);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,4).getUint32(0,!0);return this.offset+=4,n}readI32(){this.ensureAvailable(4);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,4).getInt32(0,!0);return this.offset+=4,n}readF32(){this.ensureAvailable(4);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,4).getFloat32(0,!0);return this.offset+=4,n}readF64(){this.ensureAvailable(8);const n=new DataView(this.bytes.buffer,this.bytes.byteOffset+this.offset,8).getFloat64(0,!0);return this.offset+=8,n}readBytes(t){this.ensureAvailable(t);const n=this.bytes.subarray(this.offset,this.offset+t);return this.offset+=t,n}readString(){const t=this.readU32();if(t===0)return"";if(t>Or)throw new Error("Binary string exceeds size limit");return dn(this.readBytes(t))}readJson(){const t=this.readString();if(t.length===0)throw new Error("Expected JSON payload");return JSON.parse(t)}alignTo(t){const n=this.offset%t;if(n===0)return;const r=t-n;this.ensureAvailable(r),this.offset+=r}readFloat32Array(){this.alignTo(4);const t=this.readU32();if(t===0)return new Float32Array(0);if(t%4!==0)throw new Error("Invalid float32 buffer length");if(t>mn)throw new Error("Float32 buffer exceeds size limit");const n=this.readBytes(t);if(n.byteOffset%4===0)return new Float32Array(n.buffer,n.byteOffset,t/4);const r=new ArrayBuffer(t);return new Uint8Array(r).set(n),new Float32Array(r)}readUint32Array(){this.alignTo(4);const t=this.readU32();if(t===0)return new Uint32Array(0);if(t%4!==0)throw new Error("Invalid uint32 buffer length");if(t>mn)throw new Error("Uint32 buffer exceeds size limit");const n=this.readBytes(t);if(n.byteOffset%4===0)return new Uint32Array(n.buffer,n.byteOffset,t/4);const r=new ArrayBuffer(t);return new Uint8Array(r).set(n),new Uint32Array(r)}}const D=4,lt="gzip",Hr=512*1024*1024,ct=256*1024*1024;let ze=null;function ts(e){ze=e}function ve(e){return{bytes:ze?ze.gzipSync(e):Yi(e),compression:lt}}async function fn(e){if(ze)return{bytes:await ze.gzip(e),compression:lt};if(typeof CompressionStream>"u")return ve(e);try{const t=new Uint8Array(e.byteLength);t.set(e);const n=new Blob([t]).stream().pipeThrough(new CompressionStream("gzip"));return{bytes:new Uint8Array(await new Response(n).arrayBuffer()),compression:lt}}catch{return ve(e)}}function pn(e){return e.byteLength>=2&&e[0]===31&&e[1]===139}function dt(e){if(e.byteLength>ct)throw new Error("Compressed payload exceeds size limit");const t=Gi(e);if(t.byteLength>Hr)throw new Error("Decompressed payload exceeds size limit");return t}const ut="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%()*+,-.;=?@[]^_{|}~",hn=new Int16Array(128).fill(-1);for(let e=0;e<ut.length;e++)hn[ut.charCodeAt(e)]=e;function gn(e){const t=(e==null?void 0:e.toLowerCase())??"";return t.includes(";base85")||t.endsWith("base85")?"base85":"base64"}function be(e,t){return t==="base85"?Ur(e):rs(e)}function Fe(e,t){const n=e.length>0&&(e.charCodeAt(0)<=32||e.charCodeAt(e.length-1)<=32)?e.trim():e;return t==="base85"?Dr(n):as(n)}function Ur(e){const t=e.length;if(t===0)return"";const n=(4-t%4)%4,r=t+n,a=[];for(let i=0;i<r;i+=4){const s=e[i]??0,l=i+1<t?e[i+1]:0,c=i+2<t?e[i+2]:0,d=i+3<t?e[i+3]:0;let u=(s<<24>>>0)+(l<<16)+(c<<8)+d;const p=new Array(5);for(let f=4;f>=0;f--)p[f]=u%85,u=u/85|0;for(let f=0;f<5;f++)a.push(ut[p[f]])}const o=Math.ceil(t*5/4);return a.slice(0,o).join("")}function Dr(e){const t=e.replace(/\s+/g,""),n=t.length;if(n===0)return new Uint8Array(0);const r=Math.floor(n*4/5),a=(5-n%5)%5,o=n+a,i=new Uint8Array(o/5*4),s=ut.length-1;let l=0;for(let c=0;c<o;c+=5){let d=0;for(let u=0;u<5;u++){const p=c+u<n?ns(t.charCodeAt(c+u)):s;d=d*85+p}i[l++]=d>>>24&255,i[l++]=d>>>16&255,i[l++]=d>>>8&255,i[l++]=d&255}return i.subarray(0,r)}function ns(e){if(e<0||e>=hn.length)throw new Error("Invalid base85 character");const t=hn[e];if(t<0)throw new Error("Invalid base85 character");return t}function rs(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function as(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const mt=1,ft=2,pt=4,ht=8,gt=16,wn=32,wt=1,yt=2,vt=4,bt=8,xt=16,yn=32,kt=64,At=128;function Lt(e){let t=256+e.positions.byteLength;return e.indices&&(t+=e.indices.byteLength),e.lineDistances&&(t+=e.lineDistances.byteLength),e.linePattern&&(t+=64+e.linePattern.pattern.length*8),t}function Et(e){let t=256+e.positions.byteLength;return e.indices&&(t+=e.indices.byteLength),e.gradientPositions&&(t+=e.gradientPositions.byteLength),e.uvs&&(t+=e.uvs.byteLength),e.texture&&(t+=e.texture.bytes.byteLength+64),e.hatchPattern&&(t+=128),e.gradientFill&&(t+=64),t}function vn(e,t){e.writeString(t.layer),e.writeU32(t.color>>>0),e.writeF64(t.offset[0]),e.writeF64(t.offset[1]),e.writeF64(t.offset[2]),e.writeFloat32Array(t.positions);let n=0;t.indices&&t.indices.length>0&&(n|=mt),t.linePattern&&(n|=ft),t.lineDistances&&t.lineDistances.length>0&&(n|=pt),t.lineWidth!=null&&t.lineWidth>0&&(n|=ht),t.renderOrder!=null&&t.renderOrder!==0&&(n|=gt),t.excludeFromOsnap&&(n|=wn),e.writeU8(n),n&mt&&e.writeUint32Array(t.indices),n&ft&&e.writeJson(t.linePattern),n&pt&&e.writeFloat32Array(t.lineDistances),n&ht&&e.writeF32(t.lineWidth),n&gt&&e.writeI32(t.renderOrder)}function bn(e){const t=e.readString(),n=e.readU32(),r=[e.readF64(),e.readF64(),e.readF64()],a=e.readFloat32Array(),o=e.readU8(),i={layer:t,color:n,offset:r,positions:a};return o&mt&&(i.indices=e.readUint32Array()),o&ft&&(i.linePattern=e.readJson()),o&pt&&(i.lineDistances=e.readFloat32Array()),o&ht&&(i.lineWidth=e.readF32()),o&gt&&(i.renderOrder=e.readI32()),o&wn&&(i.excludeFromOsnap=!0),i}function xn(e,t){e.writeString(t.layer),e.writeU32(t.color>>>0),e.writeF64(t.offset[0]),e.writeF64(t.offset[1]),e.writeF64(t.offset[2]),e.writeFloat32Array(t.positions);let n=0;t.indices&&t.indices.length>0&&(n|=wt),t.hatchPattern&&(n|=yt),t.gradientFill&&(n|=vt),t.gradientPositions&&t.gradientPositions.length>0&&(n|=bt),t.side!=null&&(n|=xt),t.points&&(n|=yn),t.renderOrder!=null&&t.renderOrder!==0&&(n|=kt),t.texture&&t.texture.bytes.length>0&&t.uvs&&t.uvs.length>=2&&(n|=At),e.writeU8(n),n&wt&&e.writeUint32Array(t.indices),n&yt&&e.writeJson(t.hatchPattern),n&vt&&e.writeJson(t.gradientFill),n&bt&&e.writeFloat32Array(t.gradientPositions),n&xt&&e.writeU8(t.side),n&kt&&e.writeI32(t.renderOrder),n&At&&(e.writeFloat32Array(t.uvs),e.writeString(t.texture.mimeType||"image/png"),e.writeU32(t.texture.bytes.byteLength),e.writeBytes(t.texture.bytes))}function kn(e){const t=e.readString(),n=e.readU32(),r=[e.readF64(),e.readF64(),e.readF64()],a=e.readFloat32Array(),o=e.readU8(),i={layer:t,color:n,offset:r,positions:a};if(o&wt&&(i.indices=e.readUint32Array()),o&yt&&(i.hatchPattern=e.readJson()),o&vt&&(i.gradientFill=e.readJson()),o&bt&&(i.gradientPositions=e.readFloat32Array()),o&xt&&(i.side=e.readU8()),o&yn&&(i.points=!0),o&kt&&(i.renderOrder=e.readI32()),o&At){i.uvs=e.readFloat32Array();const s=e.readString()||"image/png",l=e.readU32();i.texture={mimeType:s,bytes:e.readBytes(l)}}return i}const Ct=1329939265,An=1,Rr=5e5,os=1e5,Nr=1,Xr=2,$r=3,Vr=4,Yr=5,Gr=6,jr=7;function Ln(e){var t;switch(e.kind){case"line":return 37;case"circle":return 30;case"arc":return 46;case"ellipse":return 71;case"point":return 21;case"path":return 10+e.vertices.length*8;case"spline":return 10+(e.controlPoints.length+e.knots.length+e.weights.length+(((t=e.fitPoints)==null?void 0:t.length)??0))*8+16;default:return e}}function Zr(e,t){if(e.length===0)return[];const n=[];let r=[],a=64;const o=()=>{r.length!==0&&(n.push(r),r=[],a=64)};for(const i of e){const s=Ln(i);r.length>0&&a+s>t&&o(),r.push(i),a+=s}return o(),n}function xe(e){const t=new it;t.writeU32(Ct),t.writeU8(An),t.writeU8(0),t.writeU8(0),t.writeU8(0);const n=[],r=new Map,a=o=>{const i=r.get(o);if(i!=null)return i;const s=n.length;return n.push(o),r.set(o,s),s};for(const o of e.primitives)a(o.layer);t.writeU32(n.length);for(const o of n)t.writeString(o);t.writeU32(e.primitives.length);for(const o of e.primitives)ss(t,o,a(o.layer));return t.toUint8Array()}function St(e){const t=new st(e);if(t.readU32()!==Ct)throw new Error("Invalid osnap catalog magic");const r=t.readU8();if(t.readU8(),t.readU8(),t.readU8(),r!==An)throw new Error(`Unsupported osnap catalog version: ${r}`);const a=t.readU32();if(a>os)throw new Error("Osnap layer count exceeds limit");const o=[];for(let l=0;l<a;l++)o.push(t.readString());const i=t.readU32();if(i>Rr)throw new Error("Osnap primitive count exceeds limit");const s=[];for(let l=0;l<i;l++)s.push(ls(t,o));return{primitives:s}}function Kr(e){const t=xe(e),n=ve(t).bytes;return{uncompressed:t,compressed:n}}async function is(e){const t=xe(e),n=(await fn(t)).bytes;return{uncompressed:t,compressed:n}}function Wr(e){return St(dt(e))}function qr(e){return pn(e)?Wr(e):St(e)}function En(e,t){e.writeU8(t<0?0:1)}function Cn(e){return e.readU8()===0?-1:1}function Oe(e,t){e.writeU32(t.length);for(const n of t)e.writeF64(n)}function He(e){const t=e.readU32();if(t>Rr)throw new Error("Float64 array count exceeds limit");const n=[];for(let r=0;r<t;r++)n.push(e.readF64());return n}function ss(e,t,n){switch(t.kind){case"line":e.writeU8(Nr),e.writeU32(n),e.writeF64(t.x0),e.writeF64(t.y0),e.writeF64(t.x1),e.writeF64(t.y1);return;case"circle":e.writeU8(Xr),e.writeU32(n),e.writeF64(t.cx),e.writeF64(t.cy),e.writeF64(t.r),En(e,t.normalSign);return;case"arc":e.writeU8($r),e.writeU32(n),e.writeF64(t.cx),e.writeF64(t.cy),e.writeF64(t.r),e.writeF64(t.startAngle),e.writeF64(t.endAngle),En(e,t.normalSign);return;case"ellipse":e.writeU8(Vr),e.writeU32(n),e.writeF64(t.cx),e.writeF64(t.cy),e.writeF64(t.majorX),e.writeF64(t.majorY),e.writeF64(t.majorR),e.writeF64(t.minorR),e.writeF64(t.startAngle),e.writeF64(t.endAngle),e.writeU8(t.closed?1:0),En(e,t.normalSign??1);return;case"spline":e.writeU8(Yr),e.writeU32(n),Oe(e,t.controlPoints),e.writeU32(t.degree),Oe(e,t.knots),Oe(e,t.weights),e.writeU8(t.closed?1:0),Oe(e,t.fitPoints??[]);return;case"point":e.writeU8(Gr),e.writeU32(n),e.writeF64(t.x),e.writeF64(t.y);return;case"path":e.writeU8(jr),e.writeU32(n),e.writeU8(t.closed?1:0),Oe(e,t.vertices);return;default:{const r=t;throw new Error(`Unsupported osnap primitive: ${String(r)}`)}}}function ls(e,t){const n=e.readU8(),r=e.readU32(),a=t[r];if(a==null)throw new Error(`Invalid osnap layer index: ${r}`);switch(n){case Nr:return{kind:"line",layer:a,x0:e.readF64(),y0:e.readF64(),x1:e.readF64(),y1:e.readF64()};case Xr:return{kind:"circle",layer:a,cx:e.readF64(),cy:e.readF64(),r:e.readF64(),normalSign:Cn(e)};case $r:return{kind:"arc",layer:a,cx:e.readF64(),cy:e.readF64(),r:e.readF64(),startAngle:e.readF64(),endAngle:e.readF64(),normalSign:Cn(e)};case Vr:return{kind:"ellipse",layer:a,cx:e.readF64(),cy:e.readF64(),majorX:e.readF64(),majorY:e.readF64(),majorR:e.readF64(),minorR:e.readF64(),startAngle:e.readF64(),endAngle:e.readF64(),closed:e.readU8()!==0,normalSign:Cn(e)};case Yr:{const o=He(e),i=e.readU32(),s=He(e),l=He(e),c=e.readU8()!==0,d=He(e);return{kind:"spline",layer:a,controlPoints:o,degree:i,knots:s,weights:l,closed:c,...d.length>0?{fitPoints:d}:{}}}case Gr:return{kind:"point",layer:a,x:e.readF64(),y:e.readF64()};case jr:{const o=e.readU8()!==0,i=He(e);return{kind:"path",layer:a,closed:o,vertices:i}}default:throw new Error(`Unsupported osnap primitive kind: ${n}`)}}const Jr=1480934209;function Qr(e){if(e.version!==D)throw new Error(`Unsupported snapshot version: ${e.version}`);const t=new it;t.writeU32(Jr),t.writeU8(D),t.writeU8(0),t.writeU8(0),t.writeU8(0),t.writeJson(cs(e)),t.writeJson(e.layers),t.writeString(e.activeLayoutBtrId),t.writeU32(e.layouts.length);for(const n of e.layouts)us(t,n);return t.toUint8Array()}function ea(e){const t=new st(e);if(t.readU32()!==Jr)throw new Error("Invalid snapshot magic");const r=t.readU8();if(t.readU8(),t.readU8(),t.readU8(),r!==D)throw new Error(`Unsupported snapshot version: ${r}`);const a=t.readJson(),o=t.readJson(),i=t.readString(),s=t.readU32(),l=[];for(let c=0;c<s;c++)l.push(fs(t));return ds(l,a.savedViews,a.fitExtents),{version:D,meta:a,layers:o,layouts:l,activeLayoutBtrId:i}}function cs(e){const t={...e.meta.savedViews??{}},n={...e.meta.fitExtents??{}};for(const l of e.layouts)l.savedView&&(t[l.btrId]=l.savedView),l.fitExtents&&(n[l.btrId]=l.fitExtents);const r=Object.keys(t).length>0,a=Object.keys(n).length>0;if(!r&&!a){if(e.meta.savedViews==null&&e.meta.fitExtents==null)return e.meta;const{savedViews:l,fitExtents:c,...d}=e.meta;return d}const{savedViews:o,fitExtents:i,...s}=e.meta;return{...s,...r?{savedViews:t}:{},...a?{fitExtents:n}:{}}}function ds(e,t,n){if(!(!t&&!n))for(const r of e){if(!r.savedView){const a=t==null?void 0:t[r.btrId];a&&(r.savedView=a)}if(!r.fitExtents){const a=n==null?void 0:n[r.btrId];a&&(r.fitExtents=a)}}}function us(e,t){e.writeString(t.btrId),e.writeString(t.name),e.writeU8(t.isModelSpace?1:0),ms(e,t.osnap),e.writeJson(t.viewports??null),e.writeU32(t.lineBatches.length);for(const n of t.lineBatches)vn(e,n);e.writeU32(t.meshBatches.length);for(const n of t.meshBatches)xn(e,n)}function ms(e,t){if(!t||t.primitives.length===0){e.writeU32(0);return}const n=xe(t);e.writeU32(n.length),e.writeBytes(n)}function fs(e){const t=e.readString(),n=e.readString(),r=e.readU8()!==0,a=hs(e),o=ps(e.readJson()),i=e.readU32(),s=[];for(let d=0;d<i;d++)s.push(bn(e));const l=e.readU32(),c=[];for(let d=0;d<l;d++)c.push(kn(e));return{btrId:t,name:n,isModelSpace:r,lineBatches:s,meshBatches:c,osnap:a,viewports:o}}function ps(e){if(e!=null){if(Array.isArray(e))return e;if(typeof e=="object")return e.viewports??void 0}}function hs(e){const t=e.readU32();if(t===0)return;const n=e.readBytes(t);if(gs(n))return St(n);const r=dn(n);if(!(r.length===0||r==="null"))return JSON.parse(r)}function gs(e){return e.length<4?!1:(e[0]|e[1]<<8|e[2]<<16|e[3]<<24)>>>0===Ct}const ws="application/vnd.mlightcad.acex-snapshot+binary";function ta(e){if(e.version!==D)throw new Error(`Unsupported snapshot version: ${e.version}`);const t=Qr(e),n=ve(t);return{payload:be(n.bytes,"base85"),compression:n.compression}}function ys(e,t="base85"){return na(ra(e,t))}function na(e){const t=dt(e);return ea(t)}function ra(e,t="base85"){const n=t==="base64"||t==="base85"?t:gn(t);return Fe(e,n)}function aa(){return ws}function te(e,t,n){if(n<=0)return new Float32Array(0);if(e instanceof Float32Array)return e.subarray(t,t+n).slice();const r=new Float32Array(n);for(let a=0;a<n;a++)r[a]=e[t+a];return r}function oa(e,t,n){if(n<=0)return new Uint32Array(0);const r=new Uint32Array(n);for(let a=0;a<n;a++)r[a]=e[t+a];return r}function Sn(e,t){if(t.length===0)return{positions:e,indices:t};let n=0;for(let a=0;a<t.length;a++){const o=t[a];o>n&&(n=o)}const r=(n+1)*3;return r>=e.length?{positions:e,indices:t}:{positions:te(e,0,r),indices:t}}function Ue(e,t){return e+t}const ke={x:0,y:0,z:0};function ia(e){e.updateMatrixWorld(!0);const t=e.matrixWorld.elements;return ke.x=t[12],ke.y=t[13],ke.z=t[14],[ke.x,ke.y,ke.z]}function Mt(e,t){const n=t.elements,r=e.positions;if(r.length===0)return{positions:new Float32Array(0),indices:e.indices};const a=new Float32Array(r.length);for(let o=0;o<r.length;o+=3){const i=r[o],s=r[o+1],l=r[o+2];a[o]=n[0]*i+n[4]*s+n[8]*l+n[12],a[o+1]=n[1]*i+n[5]*s+n[9]*l+n[13],a[o+2]=n[2]*i+n[6]*s+n[10]*l+n[14]}return{positions:a,indices:e.indices?new Uint32Array(e.indices):void 0}}function sa(e,t){const n=t*3;return Number.isFinite(e[n])&&Number.isFinite(e[n+1])&&Number.isFinite(e[n+2])}function fe(e,t){const n=e.positions,r=n.length/3|0;if(r===0||t<=0)return e;let a=!1;for(let s=0;s<n.length;s++)if(!Number.isFinite(n[s])){a=!0;break}if(!a)return e;const o=e.indices;if(o&&o.length>0){const s=[];for(let u=0;u+t<=o.length;u+=t){let p=!0;for(let f=0;f<t;f++){const h=o[u+f];if(h<0||h>=r||!sa(n,h)){p=!1;break}}if(p)for(let f=0;f<t;f++)s.push(o[u+f])}if(s.length===0)return{positions:new Float32Array(0)};const l=new Int32Array(r);l.fill(-1);const c=[],d=new Uint32Array(s.length);for(let u=0;u<s.length;u++){const p=s[u];let f=l[p];if(f<0){f=c.length/3,l[p]=f;const h=p*3;c.push(n[h],n[h+1],n[h+2])}d[u]=f}return{positions:Float32Array.from(c),indices:d}}const i=[];for(let s=0;s+t<=r;s+=t){let l=!0;for(let c=0;c<t;c++)if(!sa(n,s+c)){l=!1;break}if(l)for(let c=0;c<t;c++){const d=(s+c)*3;i.push(n[d],n[d+1],n[d+2])}}return i.length===0?{positions:new Float32Array(0)}:{positions:Float32Array.from(i)}}function _t(e){const t=e.positions;if(t.length<3)return{slice:e,offset:[0,0,0]};let n=1/0,r=1/0,a=1/0,o=-1/0,i=-1/0,s=-1/0,l=0;for(let u=0;u<t.length;u+=3){const p=t[u],f=t[u+1],h=t[u+2];!Number.isFinite(p)||!Number.isFinite(f)||!Number.isFinite(h)||(l++,n=Math.min(n,p),r=Math.min(r,f),a=Math.min(a,h),o=Math.max(o,p),i=Math.max(i,f),s=Math.max(s,h))}if(l===0)return{slice:{positions:new Float32Array(0)},offset:[0,0,0]};const c=[(n+o)/2,(r+i)/2,(a+s)/2],d=new Float32Array(t.length);for(let u=0;u<t.length;u+=3){const p=t[u],f=t[u+1],h=t[u+2];if(!Number.isFinite(p)||!Number.isFinite(f)||!Number.isFinite(h)){d[u]=0,d[u+1]=0,d[u+2]=0;continue}d[u]=p-c[0],d[u+1]=f-c[1],d[u+2]=h-c[2]}return{slice:{positions:d,indices:e.indices?new Uint32Array(e.indices):void 0},offset:c}}function la(e,t,n={}){e.updateMatrixWorld(!0);const r=Mt(t,e.matrixWorld);return _t(r)}let ca;function vs(e){ca=e}function da(e){const t=e.image;if(!t)return;if(typeof document>"u")return bs(t);const n=document.createElement("canvas"),r=n.getContext("2d");if(!r)return;try{if(t instanceof ImageData)n.width=t.width,n.height=t.height,r.putImageData(t,0,0);else if(ua(t)){n.width=t.width,n.height=t.height;const l=As(t.data,t.width*t.height),c=new ImageData(new Uint8ClampedArray(l),t.width,t.height);r.putImageData(c,0,0)}else if(xs(t)){const l=ks(t);if(!l)return;n.width=l.width,n.height=l.height,r.drawImage(t,0,0)}else return}catch{return}const a=n.toDataURL("image/png"),o=a.indexOf(",");if(o<0)return;const i=atob(a.slice(o+1)),s=new Uint8Array(i.length);for(let l=0;l<i.length;l++)s[l]=i.charCodeAt(l);return{mimeType:"image/png",bytes:s}}function bs(e){const t=ca;if(!(!t||!ua(e)))try{const n=t(e);return n!=null&&n.byteLength?{mimeType:"image/png",bytes:n}:void 0}catch{return}}function xs(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement}function ua(e){if(!e||typeof e!="object")return!1;const t=e;return t.data!=null&&typeof t.width=="number"&&typeof t.height=="number"&&t.width>=1&&t.height>=1}function ks(e){let t=Number(e.width),n=Number(e.height);if(e instanceof HTMLImageElement?(t=e.naturalWidth||e.width,n=e.naturalHeight||e.height):typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement&&(t=e.videoWidth||e.width,n=e.videoHeight||e.height),!(!Number.isFinite(t)||!Number.isFinite(n)||t<1||n<1))return{width:t,height:n}}function As(e,t){const n=t*4;if(e instanceof Uint8ClampedArray&&e.length>=n)return e.length===n?e:e.subarray(0,n);const r=new Uint8ClampedArray(n),a=Math.min(n,e.length);for(let o=0;o<a;o++)r[o]=e[o];if(e.length>=t*3&&e.length<n)for(let o=t-1;o>=0;o--){const i=o*3,s=o*4;r[s]=e[i],r[s+1]=e[i+1],r[s+2]=e[i+2],r[s+3]=255}return r}function ma(e,t){const n=e.getAttribute("uv");if(!n||n.count===0||n.itemSize<2)return;const a=Math.floor(t.length/3)*2;if(a<=0)return;const o=n.array;if(!(n.count*n.itemSize<a))return te(o,0,a)}function Mn(e){const t=e;return t.map?!1:t.transparent===!0&&typeof t.opacity=="number"&&t.opacity<.01}function fa(e,t={}){const n=new Blob([e.bytes],{type:e.mimeType||"image/png"}),r=URL.createObjectURL(n),a=new E.TextureLoader().load(r,o=>{var i;URL.revokeObjectURL(r),(i=t.onLoad)==null||i.call(t,o)},void 0,()=>{var o;URL.revokeObjectURL(r),(o=t.onError)==null||o.call(t)});return a.colorSpace=E.SRGBColorSpace,a.needsUpdate=!0,a}function pa(e){e&&(e.bytes=new Uint8Array(0))}const _n={value:1};function Pn(e){const t=e;if(t.isShaderMaterial===!0||e.type==="ShaderMaterial")return t}function ha(e){var o;const t=Pn(e);if(!t)return;const n=t.uniforms.pattern,r=t.uniforms.patternLength;if(!n||!r)return;const a=n.value;if(!(!Array.isArray(a)||a.length===0))return{pattern:[...a],patternLength:Number(r.value),viewportScale:Number(((o=t.uniforms.u_viewportScale)==null?void 0:o.value)??1)}}function ga(e){var a;const t=Pn(e);if(!t)return;const n=t.uniforms.u_patternLines;if(!n)return;const r=n.value;if(!(!Array.isArray(r)||r.length===0))return{patternAngle:Number(((a=t.uniforms.u_patternAngle)==null?void 0:a.value)??0),patternLines:r.map(Ls)}}function wa(e){var o,i,s,l,c;const t=Pn(e);if(!t||t.uniforms.u_patternLines)return;const n=(o=t.uniforms.u_startColor)==null?void 0:o.value,r=(i=t.uniforms.u_endColor)==null?void 0:i.value,a=t.uniforms.u_gradientType;if(!(!(n!=null&&n.getHex)||a==null))return{startColor:n.getHex(),endColor:((s=r==null?void 0:r.getHex)==null?void 0:s.call(r))??n.getHex(),angle:Number(((l=t.uniforms.u_angle)==null?void 0:l.value)??0),shift:Number(((c=t.uniforms.u_shift)==null?void 0:c.value)??0),gradientType:Number(a.value)}}function Ls(e){return{angle:e.angle,base:[e.base.x,e.base.y],offset:[e.offset.x,e.offset.y],dashLengths:[...e.dashLengths],patternLength:e.patternLength}}function Es(e){return{angle:e.angle,base:new E.Vector2(e.base[0],e.base[1]),offset:new E.Vector2(e.offset[0],e.offset[1]),dashLengths:[...e.dashLengths],patternLength:e.patternLength}}function Pt(e){const t=e.length/3;if(t<2)return new Float32Array(0);const n=new Float32Array(t);for(let r=0;r<t;r+=2){r===0?n[r]=0:n[r]=n[r-1];const a=e[r*3],o=e[r*3+1],i=e[r*3+2]??0,s=e[(r+1)*3],l=e[(r+1)*3+1],c=e[(r+1)*3+2]??0,d=s-a,u=l-o,p=c-i;n[r+1]=n[r]+Math.sqrt(d*d+u*u+p*p)}return n}function Cs(e){const t=e.getAttribute("lineDistance");if(!t||t.count===0)return;if(e.getIndex()){const c=t.array;return te(c,0,t.count)}const r=e.drawRange,a=t.count,o=Math.max(0,Math.min(Math.floor(r.start),a)),i=Math.max(0,a-o),s=!Number.isFinite(r.count)||r.count<=0?i:Math.min(Math.floor(r.count),i);if(s<=0)return;const l=t.array;return te(l,o,s)}function ya(e,t){const n=e.getAttribute(t);if(!n||n.count===0)return;const r=n.itemSize;if(e.getIndex()){const u=n.array;return te(u,0,n.count*r)}const o=e.drawRange,i=n.count,s=Math.max(0,Math.min(Math.floor(o.start),i)),l=Math.max(0,i-s),c=!Number.isFinite(o.count)||o.count<=0?l:Math.min(Math.floor(o.count),l);if(c<=0)return;const d=n.array;return te(d,s*r,c*r)}function Ss(e,t){if(e.lineWidth!=null&&e.lineWidth>0){const n=new vr.LineMaterial({color:e.color,linewidth:e.lineWidth});return t&&n.resolution.copy(t),n}return e.linePattern?I.AcTrLinePatternShaders.createLineShaderMaterialFromScaledPattern(e.linePattern.pattern,e.linePattern.patternLength,e.color,e.linePattern.viewportScale,_n):new E.LineBasicMaterial({color:e.color})}function Ms(e){return new E.PointsMaterial({color:e.color,size:1,sizeAttenuation:!1})}function In(e,t){const n=t[0],r=t[1],a=t[4],o=t[5],i=t[12],s=t[13],l=Math.atan2(r,n),c=(p,f)=>[n*p+a*f+i,r*p+o*f+s],d=(p,f)=>[n*p+a*f,r*p+o*f],u=(p,f,h)=>{const g=Math.cos(h),y=Math.sin(h);return[g*p-y*f,y*p+g*f]};return{patternAngle:e.patternAngle,patternLines:e.patternLines.map(p=>{const f=p.angle+e.patternAngle,h=p.angle+l,g=h+e.patternAngle,[y,b]=d(Math.cos(f),Math.sin(f)),w=Math.hypot(y,b),[A,k]=u(p.offset[0],p.offset[1],f),[M,C]=d(A,k),_=u(M,C,-g);return{angle:h,base:c(p.base[0],p.base[1]),offset:_,dashLengths:p.dashLengths.map(L=>L*w),patternLength:p.patternLength*w}})}}function va(e,t){return{patternAngle:e.patternAngle,patternLines:e.patternLines.map(n=>{const r=new E.Vector2(n.base[0]-t[0],n.base[1]-t[1]),a=new E.Vector2(n.offset[0],n.offset[1]);return I.wrapPatternBaseToLocalFrame(r,a,n.angle,e.patternAngle,n.patternLength),{angle:n.angle,base:[r.x,r.y],offset:[n.offset[0],n.offset[1]],dashLengths:[...n.dashLengths],patternLength:n.patternLength}})}}function _s(e,t={}){if(e.hatchPattern&&e.hatchPattern.patternLines.length>0)try{const n=e.hatchPattern.patternLines.map(Es);return I.createHatchPatternShaderMaterial(n,e.hatchPattern.patternAngle,_n,new E.Color(e.color),0,e.side??E.FrontSide)}catch{}if(e.gradientFill&&e.gradientPositions&&e.gradientPositions.length>=2)try{return I.createGradientHatchShaderMaterialFromUniforms(e.gradientFill,e.side??E.FrontSide)}catch{}if(e.texture&&e.uvs&&e.uvs.length>=2){const n=new E.MeshBasicMaterial({color:16777215,side:E.DoubleSide,transparent:!0,opacity:0,depthWrite:!1});return n.map=fa(e.texture,{onLoad:()=>{var r;pa(e.texture),n.opacity=1,n.depthWrite=!0,n.needsUpdate=!0,(r=t.onTextureLoad)==null||r.call(t)}}),n}return new E.MeshBasicMaterial({color:e.color,side:E.DoubleSide})}function Bn(e,t){return!Number.isFinite(e)||e<0?0:Math.min(Math.floor(e),t)}function Tn(e,t,n){const r=Math.max(0,t-n);return!Number.isFinite(e)||e<=0?r:Math.min(Math.floor(e),r)}function De(e){const t=e.getAttribute("position");if(!t)return{positions:new Float32Array(0)};const n=e.drawRange,r=t.array,a=t.itemSize,o=e.getIndex();if(o){const c=te(r,0,t.count*a),d=o.array,u=Bn(n.start,o.count),p=Tn(n.count,o.count,u),f=oa(d,u,p);return Sn(c,f)}const i=Bn(n.start,t.count),s=Tn(n.count,t.count,i);return{positions:te(r,i*a,s*a)}}function It(e){return I.isBatchGeometryActive(e.flags)&&I.isBatchGeometryVisible(e.flags)}function ba(e){const{count:t}=e.mappingStats;for(let n=0;n<t;n++){let r;try{r=e.getGeometryRangeAt(n)}catch{continue}if(It(r)&&r.bboxIntersectionCheck)return!0}return!1}function zn(e){return I.getSceneDrawableUserData(e).bboxIntersectionCheck===!0}function Bt(e,t){const n=t.getAttribute("position");if(!n)return{positions:new Float32Array(0)};const r=n.itemSize,a=n.array,o=t.getIndex(),{count:i}=e.mappingStats;if(o){const u=te(a,0,n.count*r),p=o.array;let f=0;const h=[];for(let b=0;b<i;b++){let w;try{w=e.getGeometryRangeAt(b)}catch{continue}const A=w.indexStart??0,k=w.indexCount??0;!It(w)||k<=0||(h.push({start:A,count:k}),f+=k)}if(f===0)return{positions:new Float32Array(0)};const g=new Uint32Array(f);let y=0;for(const b of h)for(let w=0;w<b.count;w++)g[y++]=p[b.start+w];return Sn(u,g)}let s=0;const l=[];for(let u=0;u<i;u++){let p;try{p=e.getGeometryRangeAt(u)}catch{continue}if(!It(p)||p.vertexCount<=0)continue;const f=p.vertexCount*r;l.push({start:p.vertexStart*r,floatCount:f}),s+=f}if(s===0)return{positions:new Float32Array(0)};const c=new Float32Array(s);let d=0;if(a instanceof Float32Array)for(const u of l)c.set(a.subarray(u.start,u.start+u.floatCount),d),d+=u.floatCount;else for(const u of l)for(let p=0;p<u.floatCount;p++)c[d++]=a[u.start+p];return{positions:c}}function xa(e,t,n){e.push(t.getX(n),t.getY(n),t.getZ(n))}function ka(e,t){const n=t.getAttribute("instanceStart"),r=t.getAttribute("instanceEnd");if(!n||!r)return{positions:new Float32Array(0)};const{count:a}=e.mappingStats,o=[];for(let i=0;i<a;i++){let s;try{s=e.getGeometryRangeAt(i)}catch{continue}if(!It(s)||s.vertexCount<=0)continue;const l=s.vertexStart,c=l+s.vertexCount;for(let d=l;d<c;d++)xa(o,n,d),xa(o,r,d)}return{positions:new Float32Array(o)}}function Ps(e,t){const r=e.instanceCount;if(Number.isFinite(r)&&r>=0)return Math.min(Math.floor(r),t);const a=e.drawRange,o=Bn(a.start,t);return Tn(a.count,t,o)}function Is(e){const t=e.getAttribute("instanceStart"),n=e.getAttribute("instanceEnd");if(!t||!n||t.count===0)return{positions:new Float32Array(0)};const r=Ps(e,t.count);if(r<=0)return{positions:new Float32Array(0)};const a=[];for(let o=0;o<r;o++){const i=[t.getX(o),t.getY(o),t.getZ(o)],s=[n.getX(o),n.getY(o),n.getZ(o)];!i.every(Number.isFinite)||!s.every(Number.isFinite)||a.push(i[0],i[1],i[2],s[0],s[1],s[2])}return{positions:new Float32Array(a)}}function Tt(e,t){let n=e;for(;n&&n!==t;){if(n.visible===!1)return!1;n=n.parent}return!0}function Aa(e){if(e instanceof vr.LineMaterial)return e.linewidth}function Re(e){if("material"in e){const n=e.userData.originalMaterial??e.material;return Array.isArray(n)?n[0]:n}return e.material}function pe(e){var c;const t=I.getMaterialMetadata(e),n=t.layer??"0",r=e;let a=r.color!=null?r.color.getHex():t.color??16777215;const o=ha(e),i=ga(e),s=wa(e);if(e instanceof E.ShaderMaterial||e.type==="ShaderMaterial"){const u=(c=e.uniforms.u_color)==null?void 0:c.value;u!=null&&u.getHex?a=u.getHex():s&&(a=s.startColor)}return{color:a,layer:n,linePattern:o,hatchPattern:i,gradientFill:s,side:!!i||!!s?e.side:void 0}}function Bs(e,t){const r=I.getMaterialMetadata(t).drawOrder??e.renderOrder;return r===0?void 0:r}function Ae(e,t,n){const r=Bs(t,n);r!=null&&(e.renderOrder=r)}function Ts(e,t){if(!t)return;const n=e.userData.bakedWorldMatrix;return n&&n.length>=16?In(t,n):(e.updateMatrixWorld(!0),In(t,Array.from(e.matrixWorld.elements)))}function zt(e){return ia(e)}function Fn(e,t,n={}){const r=la(e,t,n);return{...r.slice,offset:r.offset}}function zs(e){if(e.indices&&e.indices.length>=3)return e;const t=e.positions.length/3|0;if(t<3||t%3!==0)return e;const n=new Uint32Array(t);for(let r=0;r<t;r++)n[r]=r;return{...e,indices:n}}function Ne(e,t,n,r,a,o=!1){o&&(r=zs(r));const i=pe(t),s=Ts(n,i.hatchPattern),l=s?va(s,a):void 0,c=i.gradientFill?ya(e,"gradientPosition"):void 0,d={layer:i.layer,color:i.color,offset:a,hatchPattern:l,gradientFill:i.gradientFill,gradientPositions:c,side:i.side,...r},u=t;if(u.map){const p=da(u.map),f=ma(e,r.positions);if(!p||!f)return;d.texture=p,d.uvs=f,d.color=16777215,d.side=E.DoubleSide}return Ae(d,n,t),d}function Fs(e){const t=ka(e,e.geometry);if(t.positions.length===0)return;const{color:n,layer:r}=pe(e.material),a=Aa(e.material),o={layer:r,color:n,offset:zt(e),lineWidth:a,...t};return ba(e)&&(o.excludeFromOsnap=!0),Ae(o,e,e.material),o}function Os(e){const t=Bt(e,e.geometry);if(t.positions.length===0)return;const{color:n,layer:r,linePattern:a}=pe(e.material),o=a?Pt(t.positions):void 0,i={layer:r,color:n,offset:zt(e),linePattern:a,lineDistances:o,...t};return ba(e)&&(i.excludeFromOsnap=!0),Ae(i,e,e.material),i}function Hs(e){const t=Bt(e,e.geometry);if(t.positions.length!==0)return Ne(e.geometry,e.material,e,t,zt(e),!0)}function Us(e){const t=Bt(e,e.geometry);if(t.positions.length===0)return;const n=Ne(e.geometry,e.material,e,t,zt(e));if(n)return{points:!0,...n}}const de=new E.Matrix4,Ft=new E.Matrix4,Xe=new E.Object3D;Xe.matrixAutoUpdate=!1;function Ds(e){const t=e;return t.isInstancedMesh===!0&&t.instanceMatrix!=null&&typeof t.count=="number"&&t.geometry!=null}function Rs(e){return e.renderOrder<1e4||e.isInstancedMesh===!0?!1:I.getSceneDrawableUserData(e).sharesTemplateGeometry===!0}function On(e){const t=e.elements;for(let o=0;o<16;o++)if(!Number.isFinite(t[o]))return!1;const n=Math.hypot(t[0],t[1],t[2]),r=Math.hypot(t[4],t[5],t[6]),a=Math.hypot(t[8],t[9],t[10]);return n+r+a>=1e-8}function La(e,t){var p;const n=fe(De(e.geometry),t),r=n.positions.length;if(r===0)return;e.updateMatrixWorld(!0);const a=e.instanceMatrix.array,o=((p=n.indices)==null?void 0:p.length)??0;let i=0;for(let f=0;f<e.count;f++)de.fromArray(a,f*16),On(de)&&i++;if(i===0)return;const s=new Float32Array(i*r),l=n.indices!=null?new Uint32Array(i*o):void 0,c=r/3;let d=0;for(let f=0;f<e.count;f++){if(de.fromArray(a,f*16),!On(de))continue;Ft.multiplyMatrices(e.matrixWorld,de);const h=Mt(n,Ft);if(s.set(h.positions,d*r),l&&h.indices){const g=d*c;for(let y=0;y<h.indices.length;y++)l[d*o+y]=h.indices[y]+g}d++}const u=_t(fe({positions:s,indices:l},t));if(u.slice.positions.length!==0)return{slice:u.slice,offset:u.offset}}function Ns(e){const t=pe(e),n=e;return!!(t.hatchPattern||t.gradientFill||n.map)}function Xs(e,t){e.updateMatrixWorld(!0);const n=e.instanceMatrix.array;for(let r=0;r<e.count;r++)de.fromArray(n,r*16),On(de)&&(Ft.multiplyMatrices(e.matrixWorld,de),t(Ft))}function $s(e,t){const n=La(e,2);if(!n)return;const r=Re(e),{color:a,layer:o,linePattern:i}=pe(r),s=i?Pt(n.slice.positions):void 0,l={layer:o,color:a,offset:n.offset,linePattern:i,lineDistances:s,...n.slice};zn(e)&&(l.excludeFromOsnap=!0),Ae(l,e,r),t.push(l)}function Ea(e,t,n){const r=Re(e);if(!n&&Mn(r))return;if(!n&&Ns(r)){const i=fe(De(e.geometry),3);if(i.positions.length===0)return;Xs(e,s=>{const l=fe(Mt(i,s),3);if(l.positions.length===0)return;const c=_t(l);Xe.matrix.copy(s),Xe.matrixWorld.copy(s),Xe.matrixWorldNeedsUpdate=!1;const d=Ne(e.geometry,r,Xe,c.slice,c.offset,!0);d&&t.push(d)});return}const a=La(e,n?1:3);if(!a)return;const o=Ne(e.geometry,r,e,a.slice,a.offset,!n);o&&t.push(n?{...o,points:!0}:o)}function Ot(e){const t=e;return e instanceof Mi.LineSegments2||t.isLineSegments2===!0||e.type==="LineSegments2"}function Ca(e){const t=e;return e instanceof E.LineSegments||t.isLineSegments===!0||e.type==="LineSegments"}function Sa(e){const t=e;return e instanceof E.Mesh||t.isMesh===!0||t.isInstancedMesh===!0||e.type==="Mesh"}function Ma(e){const t=[],n=[];return e.traverse(r=>{if(!(I.isHighlightOverlayDescendant(r)||I.isHighlightCloneDrawable(r)||Rs(r))){if(Ds(r)){if(!Tt(r,e))return;r.isPoints===!0?Ea(r,n,!0):Ca(r)&&!Ot(r)?$s(r,t):Sa(r)&&!Ot(r)&&Ea(r,n,!1);return}if(r instanceof I.AcTrBatchedLine){const a=Os(r);a&&t.push(a);return}if(r instanceof I.AcTrBatchedLine2){const a=Fs(r);a&&t.push(a);return}if(r instanceof I.AcTrBatchedMesh){const a=Hs(r);a&&n.push(a);return}if(r instanceof I.AcTrBatchedPoint){const a=Us(r);a&&n.push(a);return}if(Ot(r)){if(!Tt(r,e))return;const a=Is(r.geometry);if(a.positions.length===0)return;const o=Re(r),{color:i,layer:s}=pe(o),{offset:l,...c}=Fn(r,a),d={layer:s,color:i,offset:l,lineWidth:Aa(o),...c};zn(r)&&(d.excludeFromOsnap=!0),Ae(d,r,o),t.push(d)}else if(Ca(r)&&!(r instanceof I.AcTrBatchedLine)){if(!Tt(r,e))return;const a=fe(De(r.geometry),2);if(a.positions.length===0)return;const o=Re(r),{color:i,layer:s,linePattern:l}=pe(o),{offset:c,...d}=Fn(r,a),u=l?Pt(d.positions):void 0,p={layer:s,color:i,offset:c,linePattern:l,lineDistances:u,...d};zn(r)&&(p.excludeFromOsnap=!0),Ae(p,r,o),t.push(p)}else if(Sa(r)&&!Ot(r)&&!(r instanceof I.AcTrBatchedMesh)){if(!Tt(r,e))return;const a=Re(r);if(Mn(a))return;const o=fe(De(r.geometry),3);if(o.positions.length===0)return;const{offset:i,...s}=Fn(r,o),l=Ne(r.geometry,a,r,s,i,!0);l&&n.push(l)}}}),{lineBatches:t,meshBatches:n}}const _a={size:8,colorCss:"#0080ff",hotColorCss:"#ff0000"};function Pa(e){const t=new v.AcCmColor(v.AcCmColorMethod.ByACI,e);return t.cssColor??`rgb(${t.red}, ${t.green}, ${t.blue})`}function Vs(e){try{const t=v.AcDbSysVarManager.instance(),n=t.getVar(v.AcDbSystemVariables.GRIPSIZE,e),r=t.getVar(v.AcDbSystemVariables.GRIPCOLOR,e),a=t.getVar(v.AcDbSystemVariables.GRIPHOT,e);return!(n>0)||!Number.isFinite(n)?_a:{size:n,colorCss:Pa(r),hotColorCss:Pa(a)}}catch{return _a}}function Hn(e,t){const n=e.extmin,r=e.extmax,a=Vs(e);return{title:t==null?void 0:t.title,extents:{minX:n.x,minY:n.y,maxX:r.x,maxY:r.y},units:{insunits:e.insunits,lunits:e.lunits,luprec:e.luprec,aunits:e.aunits,auprec:e.auprec,measurement:e.measurement,ltscale:e.ltscale,angbase:e.angbase,angdir:e.angdir},grip:a,background:(t==null?void 0:t.background)??0}}const Ys=["endpoint","midpoint","center","quadrant","intersection","nearest"];function Un(e,t){let n=t-e;for(;n<=0;)n+=v.TAU;for(;n>v.TAU;)n-=v.TAU;return n}function Dn(e,t,n,r,a){const o=a===-1?-1:1;return new v.AcGePoint2d(e+o*n*Math.cos(r),t+n*Math.sin(r))}function Rn(e,t,n,r,a){return Math.atan2(r-t,a*(n-e))}function Ia(e){const t=Dn(e.cx,e.cy,e.r,e.startAngle,e.normalSign),n=Dn(e.cx,e.cy,e.r,e.endAngle,e.normalSign),r=Un(e.startAngle,e.endAngle),a=e.normalSign*Math.tan(r/4);return new v.AcGeCircArc2d(t,n,a)}function Ba(e){return Un(e.startAngle,e.endAngle)}function Gs(e,t){const n=Ba(e),r=e.startAngle+t*n,a=e.normalSign??1,o=e.majorR*Math.cos(r),i=a*e.minorR*Math.sin(r),s=e.majorX,l=e.majorY;return new v.AcGePoint2d(e.cx+o*s-i*l,e.cy+o*l+i*s)}function Ta(e){return e.kind==="circle"?new v.AcGeCircArc2d({x:e.cx,y:e.cy},e.r,0,v.TAU,e.normalSign===-1):Ia(e)}function za(e){const t=Math.atan2(e.majorY,e.majorX);return new v.AcGeEllipseArc2d({x:e.cx,y:e.cy,z:0},e.majorR,e.minorR,e.startAngle,e.endAngle,e.closed,t)}function Fa(e){const t=[];for(let n=0;n+1<e.controlPoints.length;n+=2)t.push({x:e.controlPoints[n],y:e.controlPoints[n+1],z:0});return new v.AcGeNurbsCurve(e.degree,e.knots,t,e.weights.length>0?e.weights:void 0)}function js(e){switch(e.kind){case"line":return{kind:"line",curve:new v.AcGeLine2d({x:e.x0,y:e.y0},{x:e.x1,y:e.y1})};case"circle":case"arc":return{kind:"circArc",curve:Ta(e)};case"ellipse":return{kind:"ellipse",curve:za(e)};case"spline":return{kind:"spline",curve:Fa(e)};case"point":return{kind:"point",point:new v.AcGePoint2d(e.x,e.y)};case"path":throw new Error("path primitives must be expanded before curve conversion")}}function Nn(e){return e.z>=0?1:-1}function Oa(e,t,n){if(!(n.radius>0)||!Number.isFinite(n.radius))return;const r=n.clockwise?-1:1,a=n.center.x,o=n.center.y;e.push({kind:"arc",layer:t,cx:a,cy:o,r:n.radius,startAngle:Rn(a,o,n.startPoint.x,n.startPoint.y,r),endAngle:Rn(a,o,n.endPoint.x,n.endPoint.y,r),normalSign:r})}function O(e,t){const n=new E.Vector3(t.x,t.y,t.z??0).applyMatrix4(e);return{x:n.x,y:n.y}}function Zs(e){const t=e.elements;return new E.Matrix4(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])}function Ht(e,t){return new E.Matrix4().multiplyMatrices(e,Zs(t))}function Ha(e,t){const n=new E.Vector3(t.x,t.y,t.z??0).transformDirection(e).normalize();return{x:n.x,y:n.y}}function Xn(e){const t=new E.Vector3(e.elements[0],e.elements[1],e.elements[2]).length(),n=new E.Vector3(e.elements[4],e.elements[5],e.elements[6]).length();return v.AcGeTol.equal(t,n,v.FLOAT_TOL*Math.max(t,n,1))}function Ks(e,t){const n=e.tables.blockTable.getIdAt(t);if(n)return n;for(const a of e.tables.blockTable.newIterator())if(a.objectId===t)return a;const r=e.tables.blockTable.modelSpace;if(r.objectId===t)return r}function Ws(e){if(e instanceof v.AcDbLine)return!0;const t=e;return(t.type==="LINE"||t.type==="Line")&&t.startPoint!=null&&t.endPoint!=null}function qs(e,t,n,r){r.startPoint,r.endPoint}function Ua(e,t){return e.blockTableRecord??(e.blockName?t.tables.blockTable.getAt(e.blockName):void 0)}function Js(e,t){const n=e.dimBlockId;return n?t.tables.blockTable.getAt(n):void 0}function Qs(e,t){const r=Ua(e,t);if(r)return r;const a=e.owningBlockRecordId;return a?t.tables.blockTable.getAt(a):void 0}function Da(e){return e.getFullInsertionTransform()}function el(e){for(const t of e.newIterator())return!0;return!1}function tl(e){return typeof e.getFullInsertionTransform=="function"&&"blockTableRecord"in e}function Jd(e,t,n,r,a){}function Qd(e,t,n,r,a,o){}function ue(e,t,n,r,a){if(r.length<2)return;const o=Xn(n),s=n.elements[0]*n.elements[5]-n.elements[4]*n.elements[1]<0?-1:1,l=[];for(const c of r){const d=O(n,c);let u=c.bulge??0;v.AcGeTol.isPositive(Math.abs(u))&&(u=o?u*s:0),l.push(d.x,d.y,u)}e.push({kind:"path",layer:t,closed:a,vertices:l})}function Ra(e,t){return v.AcGeTol.equal(e.x,t.x)&&v.AcGeTol.equal(e.y,t.y)}function nl(e){return(e.clockwise?-1:1)*Math.tan(e.deltaAngle/4)}function Na(e,t,n,r){if(e.length===0){e.push({x:t.x,y:t.y,z:t.z??0,bulge:r}),e.push({x:n.x,y:n.y,z:n.z??0,bulge:0});return}const a=e[e.length-1];Ra(a,t)?a.bulge=r:(a.bulge=0,e.push({x:t.x,y:t.y,z:t.z??0,bulge:r})),e.push({x:n.x,y:n.y,z:n.z??0,bulge:0})}function Xa(e){return e.length>=2&&Ra(e[0],e[e.length-1])&&e.pop(),e}function $e(e,t,n,r,a){if(r.length<2)return;const o=a?r.length:r.length-1;for(let i=0;i<o;i++)r[i],r[(i+1)%r.length]}function rl(e,t,n,r){const a=[r.startPosition];for(const o of r.segments)a.push(o.position);$e(e,t,n,a,r.closed)}function al(e,t,n){if(n.vertices.length>=2)return n.vertices;if(n.vertices.length===0)return[];const r=n.vertices[0],a=t.lastLeaderLinePoint??t.landingPoint??e.landingPoint??e.contentBasePosition;if(!a)return n.vertices;const o=r.x-a.x,i=r.y-a.y,s=(r.z??0)-(a.z??0);return Math.hypot(o,i,s)<=v.FLOAT_TOL?n.vertices:[r,a]}function ol(e,t,n,r){var o,i;for(const s of r.leaders)for(const l of s.leaderLines){const c=al(r,s,l);$e(e,t,n,c,!1)}const a=s=>{if(!s)return;const l=O(n,s);e.push({kind:"point",layer:t,x:l.x,y:l.y})};a(r.contentBasePosition),a((o=r.mtextContent)==null?void 0:o.anchorPoint),a((i=r.blockContent)==null?void 0:i.position)}function il(e,t,n,r){const a=r.numberOfVertices;if(a<2)return;const o=r.elevation,i=r.closed?a:a-1;for(let s=0;s<i;s++){const l=r.getPointAt(s),c=r.getPointAt((s+1)%a),d=r.getBulgeAt(s),u={x:l.x,y:l.y,z:o},p={x:c.x,y:c.y,z:o};if(v.AcGeTol.isPositive(Math.abs(d))){const f=O(n,u),h=O(n,p);Oa(e,t,new v.AcGeCircArc2d(f,h,d))}}}function sl(e,t,n,r,a,o){const i=O(n,r),s=new E.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),l={kind:"circle",layer:t,cx:i.x,cy:i.y,r:a*s,normalSign:Nn(o)};e.push(l)}function ll(e,t,n,r){const a=O(n,r.center),o=new E.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),i={kind:"arc",layer:t,cx:a.x,cy:a.y,r:r.radius*o,startAngle:r.startAngle,endAngle:r.endAngle,normalSign:Nn(r.normal)};e.push(i)}function $n(e,t,n,r){const a=O(n,r.center),o=r._geo,i=(o==null?void 0:o.majorAxis)??{x:1,y:0,z:0},s=Ha(n,i),l=Math.hypot(s.x,s.y)||1,c=new E.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),d=new E.Vector3(n.elements[4],n.elements[5],n.elements[6]).length(),u={kind:"ellipse",layer:t,cx:a.x,cy:a.y,majorX:s.x/l,majorY:s.y/l,majorR:r.majorAxisRadius*c,minorR:r.minorAxisRadius*d,startAngle:r.startAngle,endAngle:r.endAngle,closed:r.closed,normalSign:Nn(r.normal)};e.push(u)}function cl(e,t,n,r){var s,l;const a=r._geo;if(!((s=a==null?void 0:a.controlPoints)!=null&&s.length))return;const o=[];for(const c of a.controlPoints){const d=O(n,c);o.push(d.x,d.y)}const i={kind:"spline",layer:t,controlPoints:o,degree:a.degree??3,knots:[...a.knots??[]],weights:[...a.weights??[]],closed:a.closed??!1};if((l=a.fitPoints)!=null&&l.length){i.fitPoints=[];for(const c of a.fitPoints){const d=O(n,c);i.fitPoints.push(d.x,d.y)}}e.push(i)}const $a=1e-6;function dl(e){var r;const t=e.elevation,n=(r=e._geo)==null?void 0:r.vertices;return n&&n.length>1?n.map(a=>({x:a.x,y:a.y,z:t,bulge:a.bulge,startWidth:a.startWidth,endWidth:a.endWidth})):Array.from({length:e.numberOfVertices},(a,o)=>{const i=e.getPoint2dAt(o);return{x:i.x,y:i.y,z:t,bulge:0}})}function ul(e){return e.some(t=>{const n=Math.max(0,t.startWidth??0),r=Math.max(0,t.endWidth??0);return n>$a||r>$a})}function ml(e,t,n,r){const a=dl(r),o=a.length;if(o<2)return;if(ul(a)){ue(e,t,n,a,r.closed);return}const i=r.closed?o:o-1;for(let s=0;s<i;s++){const l=a[s],c=a[(s+1)%o],d=l.bulge??0;if(v.AcGeTol.isPositive(Math.abs(d))){const u=O(n,l),p=O(n,c);Oa(e,t,new v.AcGeCircArc2d(u,p,d))}}}function fl(e,t,n,r,a){const o=O(n,{x:r.center.x,y:r.center.y,z:a}),i=Ha(n,{x:Math.cos(r.rotation),y:Math.sin(r.rotation),z:0}),s=Math.hypot(i.x,i.y)||1,l=new E.Vector3(n.elements[0],n.elements[1],n.elements[2]).length(),c=new E.Vector3(n.elements[4],n.elements[5],n.elements[6]).length();e.push({kind:"ellipse",layer:t,cx:o.x,cy:o.y,majorX:i.x/s,majorY:i.y/s,majorR:r.majorAxisRadius*l,minorR:r.minorAxisRadius*c,startAngle:r.startAngle,endAngle:r.endAngle,closed:!1,normalSign:r.clockwise?-1:1})}function pl(e,t,n,r,a){var s;const o=r.numberOfVertices;if(o<2)return;const i=[];for(let l=0;l<o;l++){const c=r.getPointAt(l);i.push({x:c.x,y:c.y,z:a,bulge:((s=r.vertices[l])==null?void 0:s.bulge)??0})}ue(e,t,n,i,r.closed)}function hl(e,t,n,r,a){if(r instanceof v.AcGePolyline2d){pl(e,t,n,r,a);return}if(!(r instanceof v.AcGeLoop2d))return;const o=[];let i=!1;const s=()=>{const c=Xa(o);c.length>=2&&ue(e,t,n,c,!1),o.length=0};for(const c of r.curves)c instanceof v.AcGeLine2d?Na(o,{x:c.startPoint.x,y:c.startPoint.y,z:a},{x:c.endPoint.x,y:c.endPoint.y,z:a},0):c instanceof v.AcGeCircArc2d?Na(o,{x:c.startPoint.x,y:c.startPoint.y,z:a},{x:c.endPoint.x,y:c.endPoint.y,z:a},nl(c)):c instanceof v.AcGeEllipseArc2d&&(i=!0,s(),fl(e,t,n,c,a));const l=Xa(o);l.length>=2&&ue(e,t,n,l,!i)}function gl(e,t,n,r){var i;const a=(i=r._geo)==null?void 0:i.loops;if(!(a!=null&&a.length))return;const o=r.elevation;for(const s of a)hl(e,t,n,s,o)}function wl(e,t,n,r){Ht(n,Da(r));const a=[0];for(let i=0;i<r.numColumns;i++)a.push(a[i]+r.columnWidth(i));const o=[0];for(let i=0;i<r.numRows;i++)o.push(o[i]-r.rowHeight(i));a[a.length-1],o[o.length-1];for(const i of o);for(const i of a);}function yl(e,t,n,r,a,o,i,s=!0){const l=Vn(e.layer,n);if(i&&!i(l))return;const c=Qs(e,o);if(c&&!a.has(c.objectId)&&el(c)){a.add(c.objectId);const u=Ht(t,Da(e));Ut(c,u,l,r,a,o,i,s),a.delete(c.objectId);return}wl(r,l,t,e);const d=O(t,e.position);r.push({kind:"point",layer:l,x:d.x,y:d.y})}function vl(e,t,n,r){let a=r.boundaryPath();if(a.length>1){const i=a[0],s=a[a.length-1];i.x===s.x&&i.y===s.y&&(i.z??0)===(s.z??0)&&(a=a.slice(0,-1))}a.length>=2&&ue(e,t,n,a,!0);const o=O(n,r.position);e.push({kind:"point",layer:t,x:o.x,y:o.y})}function bl(e,t,n,r){const a=r.position();ue(e,t,n,[a.upperLeft,a.upperRight,a.lowerRight,a.lowerLeft],!0);const o=O(n,r.getLocation());e.push({kind:"point",layer:t,x:o.x,y:o.y})}function xl(e){var n;const t=(n=e.attributeIterator)==null?void 0:n.call(e);return t?typeof t.toArray=="function"?t.toArray():[...t]:[]}function Vn(e,t){return e==="0"?t:e}function Va(e,t,n,r,a,o,i,s=!0){if(!e.visibility)return;const l=Vn(e.layer,n);if(!(i&&!i(l))){if(e instanceof v.AcDbTable){yl(e,t,n,r,a,o,i,s);return}if(tl(e)){const c=Ua(e,o);if(!c||a.has(c.objectId))return;a.add(c.objectId);const d=e.getFullInsertionTransform(),u=Math.max(1,e.columnCount??1),p=Math.max(1,e.rowCount??1),f=e.columnSpacing??0,h=e.rowSpacing??0,g=Vn(e.layer,n);for(let y=0;y<p;y++)for(let b=0;b<u;b++){const w=Ht(t,d);(b!==0||y!==0)&&w.multiply(new E.Matrix4().makeTranslation(b*f,y*h,0));const A=O(w,{x:0,y:0,z:0});r.push({kind:"point",layer:g,x:A.x,y:A.y}),Ut(c,w,g,r,a,o,i,s)}for(const y of xl(e))(y instanceof v.AcDbAttribute?y.isInvisible:y.isInvisible)||Va(y,t,g,r,a,o,i,s);a.delete(c.objectId);return}if(e instanceof v.AcDbDimension){const c=e,d=Js(c,o);if(!d||a.has(d.objectId))return;a.add(d.objectId);const u=Ht(t,c.getFullDimBlockTransform());Ut(d,u,l,r,a,o,i,!0),a.delete(d.objectId);return}if(Ws(e)){qs(r,l,t,e);return}if(e instanceof v.AcDbCircle){Xn(t)?sl(r,l,t,e.center,e.radius,e.normal):$n(r,l,t,kl(e));return}if(e instanceof v.AcDbArc){Xn(t)?ll(r,l,t,e):$n(r,l,t,Al(e));return}if(e instanceof v.AcDbEllipse){$n(r,l,t,e);return}if(e instanceof v.AcDbSpline){cl(r,l,t,e);return}if(e instanceof v.AcDbPolyline){ml(r,l,t,e);return}if(e instanceof v.AcDb2dPolyline){il(r,l,t,e);return}if(e instanceof v.AcDb3dPolyline){const c=[];for(let d=0;d<e.numberOfVertices;d++)c.push(e.getPointAt(d));$e(r,l,t,c,e.closed);return}if(e instanceof v.AcDbHatch){s&&gl(r,l,t,e);return}if(e instanceof v.AcDbRay){e.basePoint,e.unitDir;return}if(e instanceof v.AcDbXline){e.basePoint,e.unitDir;return}if(e instanceof v.AcDbSolid){ue(r,l,t,[e.getPointAt(0),e.getPointAt(1),e.getPointAt(3),e.getPointAt(2)],!0);return}if(e instanceof v.AcDbTrace){s&&ue(r,l,t,[e.getPointAt(0),e.getPointAt(1),e.getPointAt(3),e.getPointAt(2)],!0);return}if(e instanceof v.AcDbFace){const c=e.subGetGripPoints();c.length>=2&&$e(r,l,t,c,c.length>=3);return}if(e instanceof v.AcDbLeader){const c=e.vertices;c.length>=2&&$e(r,l,t,c,!1);return}if(e instanceof v.AcDbMLine){rl(r,l,t,e);return}if(e instanceof v.AcDbMLeader){ol(r,l,t,e);return}if(e instanceof v.AcDbText){const c=O(t,e.position);r.push({kind:"point",layer:l,x:c.x,y:c.y});return}if(e instanceof v.AcDbMText){const c=O(t,e.location);r.push({kind:"point",layer:l,x:c.x,y:c.y});return}if(e instanceof v.AcDbOle2Frame){s&&bl(r,l,t,e);return}if(e instanceof v.AcDbRasterImage){s&&vl(r,l,t,e);return}if(e instanceof v.AcDbPoint){const c=O(t,e.position);r.push({kind:"point",layer:l,x:c.x,y:c.y})}}}function Ut(e,t,n,r,a,o,i,s=!0){for(const l of e.newIterator())Va(l,t,n,r,a,o,i,s)}function kl(e){return new v.AcDbEllipse(e.center,e.normal,{x:1,y:0,z:0},e.radius,e.radius,0,v.TAU)}function Al(e){return new v.AcDbEllipse(e.center,e.normal,{x:1,y:0,z:0},e.radius,e.radius,e.startAngle,e.endAngle)}function Ya(e,t,n={}){const r=Ks(e,t);if(!r)return{primitives:[]};const a=[],o=new E.Matrix4;return Ut(r,o,"0",a,new Set,e,n.includeLayer),{primitives:a.filter(i=>i.kind!=="line"&&Ll(i))}}function Ll(e){switch(e.kind){case"line":return Number.isFinite(e.x0)&&Number.isFinite(e.y0)&&Number.isFinite(e.x1)&&Number.isFinite(e.y1);case"circle":return Number.isFinite(e.cx)&&Number.isFinite(e.cy)&&Number.isFinite(e.r);case"arc":return Number.isFinite(e.cx)&&Number.isFinite(e.cy)&&Number.isFinite(e.r)&&Number.isFinite(e.startAngle)&&Number.isFinite(e.endAngle);case"ellipse":return Number.isFinite(e.cx)&&Number.isFinite(e.cy)&&Number.isFinite(e.majorX)&&Number.isFinite(e.majorY)&&Number.isFinite(e.majorR)&&Number.isFinite(e.minorR)&&Number.isFinite(e.startAngle)&&Number.isFinite(e.endAngle);case"spline":return e.controlPoints.every(t=>Number.isFinite(t))&&e.knots.every(t=>Number.isFinite(t))&&e.weights.every(t=>Number.isFinite(t));case"point":return Number.isFinite(e.x)&&Number.isFinite(e.y);case"path":return e.vertices.length>=6&&e.vertices.length%3===0&&e.vertices.every(t=>Number.isFinite(t));default:return e}}const he=["en","zh","cs","tr","ar"],Yn={en:"EN",zh:"中",cs:"CS",tr:"TR",ar:"AR"},Gn="mlcad-html-locale",Ga={...{en:{toolbar:{viewerTools:"Viewer tools",select:"Select",pan:"Pan",zoom:"Zoom",zoomExtents:"Extents",zoomSmartExtents:"Smart",zoomWindow:"Window",zoomSaved:"Saved",zoomOriginal:"Saved",measureDistance:"Distance",measureContinuous:"Continuous",measureAngle:"Angle",measureArc:"Arc",measureRadius:"Radius",measureArea:"Area",measureCoordinate:"XY",clearMeasurements:"Clear",measureHide:"Hide",measureShow:"Show",measureImport:"Import",measureExport:"Export",measurementPanel:"Results",measure:"Measure",annotation:"Review",markupCloud:"Cloud",markupCallout:"Callout",markupText:"Text",markupRect:"Rect",markupCircle:"Circle",markupArrow:"Arrow",markupStamp:"Stamp",markupPanel:"Results",markupHide:"Hide",markupShow:"Show",clearMarkups:"Clear",markupImport:"Import",markupExport:"Export",snap:"Snap",layers:"Layers",layout:"Layout",settings:"Settings",simulatedMouseOn:"Mouse",simulatedMouseOff:"Loupe",themeLight:"Light",themeDark:"Dark",switchBg:"Background",language:"Language",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",collapse:"Collapse toolbar",expand:"Expand toolbar",moreOverflow:"More tools"},settings:{ortho:"Toggle orthogonal mode",polar:"Polar tracking angles",polarAngles:"Polar tracking angles"},drawStyle:{color:"Color",fontSize:"Text height",pickerTitle:"Select Color",close:"Close",ok:"OK",cancel:"Cancel",index:"Color Index: ",rgb:"RGB: ",input:"Color",inputPlaceholder:"1-255 or #RRGGBB"},shortCutToolbar:{more:"More",undo:"Undo",redo:"Redo",erase:"Delete",collapse:"Collapse toolbar",expand:"Expand toolbar"},textHeight:{title:"Text Height",close:"Close",ok:"OK",cancel:"Cancel",adaptive:"Fit to screen",custom:"Custom text height",customPlaceholder:"World height",fromScreen:"From screen size",fromScreenHint:"Enter how large the text should look on screen at the current zoom. It is converted to a fixed world-space height that stays constant when you zoom later.",screenPxPlaceholder:"Font size",screenUnit:"px",convert:"Convert"},entityPick:{cancel:"Cancel selection"},layers:{title:"Layers",close:"Close layers",showAll:"Show all",hideAll:"Hide all",zoomTo:"Zoom to {name}"},review:{title:"Review",close:"Close review",searchPlaceholder:"Search markups",empty:"No markups yet",type:"Type",status:"Status",author:"Author",summary:"Summary",details:"Details",closeDetails:"Close details",label:"Label",comment:"Comment",zoomTo:"Zoom to",delete:"Delete",clear:"Clear all",statusValues:{open:"Open",question:"Question",answered:"Answered",closed:"Closed"}},measurePanel:{title:"Measurements",close:"Close measurements",filterGroup:"Filter by type",filterDistance:"Distance",filterArc:"Arc",filterRadius:"Radius",filterAngle:"Angle",filterArea:"Area",empty:"No measurements yet",type:"Type",value:"Value",delete:"Delete",clear:"Clear all"},session:{length:"Length",angle:"Angle",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"Confirm",cancel:"Cancel",help:"Help",back:"Back",collapse:"Collapse",expand:"Expand",undo:"Undo"},touchPointTutorial:{title:"How to pick points precisely?",description:"Long-press on the screen for about 0.5 seconds. A cross appears above your finger and follows as you move, snapping to geometry for more accurate picks.",snoozeToday:"Don't remind me today",hideForever:"Don't remind me again",ok:"Got it"},status:{ready:"Ready",zoomWindowHint:"Click two corners to zoom to a window.",measureDistanceHint:"Click two points to measure distance (object snap enabled).",measureContinuousHint:"Tap successive points to measure each segment; tap ✓ to finish. Long-press for precise snap.",measureAreaHint:"Tap polygon vertices; tap ✓ to finish when at least three points are set. Long-press for precise snap.",measureAngleHint:"Click vertex, then two points on each arm (object snap enabled).",measureArcHint:"Click a circle or arc to measure along it, or click start, a point on the arc, then end (object snap enabled). Ctrl (⌘ on Mac) switches major/minor arc.",measureRadiusHint:"Click a circle or arc to measure its radius (object snap enabled).",measureCoordinateHint:"Click a point to read its X/Y coordinates (object snap enabled).",measureExported:"Exported {count} measurement(s).",measureImported:"Imported {count} measurement(s).",measureImportFailed:"Failed to import measurements: {error}",markupCloudHint:"Click two corners to draw a revision cloud.",markupCalloutHint:"Click the leader tip, or the outline of a cloud / rectangle / circle that has no callout, then the text anchor.",markupTextHint:"Click a point to place text.",markupRectHint:"Click two corners to draw a rectangle.",markupCircleHint:"Click the center, then a point on the circumference.",markupArrowHint:"Click the start point, then the arrow tip.",markupStampHint:"Click to place a stamp (cycles approved / rejected / …).",markupArrowEndHint:"Click the arrow tip.",markupRectCornerHint:"Click the opposite corner.",markupCloudCornerHint:"Click the opposite corner.",markupCalloutAnchorHint:"Click the text bubble position.",markupCircleRadiusHint:"Click a point on the circumference.",markupTextPrompt:"Enter markup text",markupTextEditHint:"Type text on the canvas. Enter to finish, Esc to cancel.",markupShapeCalloutHint:"Click to place the text box (leader attaches to the shape). Esc cancels the callout.",markupDefaultLabel:"Note",markupSelected:"Selected markup: {type}",markupSelectedCount:"Selected markups: {count}",markupCount:"Markups: {count}",markupExported:"Exported {count} markup(s).",markupImported:"Imported {count} markup(s).",markupImportFailed:"Failed to import markups: {error}",distance:"Distance: {value}",coordinates:"X: {x} | Y: {y}",angle:"Angle: {value}",arcLength:"Arc length: {length} | Radius: {radius} | Angle: {angle} | Chord: {chord}",radius:"Radius: {value}",continuousTotal:"Total length: {value}",area:"Area: {value}",lengthTotal:"Length total: {value}",areaTotal:"Area total: {value}",zoomLayer:"Zoom: {name}",loadFailed:"Failed to load drawing: {error}",noLayout:"No layout data in snapshot.",loadingChunks:"Loading geometry… {loaded}/{total}",loadingOsnap:"Loading object snap… {loaded}/{total}",buildingOsnap:"Building object snap index…"},package:{title:"Open drawing package",hint:"No drawing.acex.json was found next to this page. Choose a local package folder or enter the manifest URL.",hintUrlOnly:"No drawing.acex.json was found next to this page. Enter the manifest URL to open the package.",chooseFolder:"Choose local folder",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"Open URL",urlRequired:"Please enter a manifest URL.",manifestNotFound:"drawing.acex.json was not found next to this page.",invalidManifest:"The package manifest is invalid or uses an unsupported version: {error}",folderMissingManifest:"The selected folder must contain drawing.acex.json.",folderUnsupported:"This browser cannot open a local package folder. Paste a manifest URL instead.",loadFailed:"Failed to open package: {error}"},access:{title:"Protected drawing",passwordPrompt:"Enter the password to open this file.",passwordPlaceholder:"Password",unlock:"Unlock",passwordRequired:"Please enter a password.",wrongPassword:"Incorrect password. Try again.",expired:"This file has expired and can no longer be opened.",expiredTitle:"File expired",expiredDetail:"This file expired on {time} and can no longer be opened.",expiresAt:"Expires: {time}",badgeExpires:"Expires {time}",badgeCountdown:"Expires in {time}",tooManyAttempts:"Too many incorrect password attempts. Refresh the page to try again."}},zh:{toolbar:{viewerTools:"查看器工具",select:"选择",pan:"平移",zoom:"缩放",zoomExtents:"范围",zoomSmartExtents:"智能",zoomWindow:"窗口",zoomSaved:"保存的视图",zoomOriginal:"保存的视图",measureDistance:"测距离",measureContinuous:"连续测",measureAngle:"测角度",measureArc:"测弧长",measureRadius:"测半径",measureArea:"测面积",measureCoordinate:"测坐标",clearMeasurements:"清除",measureHide:"隐藏",measureShow:"显示",measureImport:"导入",measureExport:"导出",measurementPanel:"看结果",measure:"测量",annotation:"审阅",markupCloud:"云线",markupCallout:"标注",markupText:"文字",markupRect:"矩形",markupCircle:"圆",markupArrow:"箭头",markupStamp:"图章",markupPanel:"看结果",markupHide:"隐藏",markupShow:"显示",clearMarkups:"清除",markupImport:"导入",markupExport:"导出",snap:"捕捉",layers:"图层",layout:"布局",settings:"设置",simulatedMouseOn:"鼠标",simulatedMouseOff:"放大",themeLight:"浅色",themeDark:"深色",switchBg:"背景",language:"语言",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",collapse:"收起工具栏",expand:"展开工具栏",moreOverflow:"更多工具"},settings:{ortho:"切换正交模式",polar:"极轴追踪角度",polarAngles:"极轴追踪角度"},drawStyle:{color:"颜色",fontSize:"字高",pickerTitle:"选择颜色",close:"关闭",ok:"确定",cancel:"取消",index:"颜色索引:",rgb:"RGB:",input:"颜色",inputPlaceholder:"1-255 或 #RRGGBB"},shortCutToolbar:{more:"更多",undo:"撤销",redo:"重做",erase:"删除",collapse:"收起工具栏",expand:"展开工具栏"},textHeight:{title:"字高设置",close:"关闭",ok:"确定",cancel:"取消",adaptive:"自适应屏幕",custom:"自定义字高",customPlaceholder:"世界坐标字高",fromScreen:"按屏幕字号换算",fromScreenHint:"按当前视图缩放,输入希望看到的屏幕字号(像素),换算为固定的世界坐标字高;之后缩放时字的世界高度不变。",screenPxPlaceholder:"屏幕字号",screenUnit:"px",convert:"换算"},entityPick:{cancel:"取消选择"},layers:{title:"图层",close:"关闭图层",showAll:"全部显示",hideAll:"全部隐藏",zoomTo:"缩放到 {name}"},review:{title:"批注",close:"关闭批注面板",searchPlaceholder:"搜索批注",empty:"暂无批注",type:"类型",status:"状态",author:"作者",summary:"摘要",details:"详情",closeDetails:"关闭详情",label:"标签",comment:"评论",zoomTo:"缩放到",delete:"删除",clear:"全部清除",statusValues:{open:"打开",question:"疑问",answered:"已答复",closed:"已关闭"}},measurePanel:{title:"测量",close:"关闭测量面板",filterGroup:"按类型筛选",filterDistance:"距离",filterArc:"弧长",filterRadius:"半径",filterAngle:"角度",filterArea:"面积",empty:"暂无测量",type:"类型",value:"数值",delete:"删除",clear:"全部清除"},session:{length:"长度",angle:"角度",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"确定",cancel:"取消",help:"帮助",back:"返回",collapse:"收起",expand:"展开",undo:"撤销"},touchPointTutorial:{title:"怎样可以精确取点?",description:"手指在屏幕上长按0.5s左右,上方出现十字,手指移动时十字跟随移动并自动捕捉。取点更精准。",snoozeToday:"今日不再提醒",hideForever:"不再提醒",ok:"我知道了"},status:{ready:"就绪",zoomWindowHint:"点击两个角点以窗口缩放。",measureDistanceHint:"点击两点以测量距离(已启用对象捕捉)。",measureContinuousHint:"依次点击多个点测量各段距离,点 ✓ 完成。长按可精确捕捉。",measureAreaHint:"依次点击多边形顶点;至少三点后点 ✓ 完成。长按可精确捕捉。",measureAngleHint:"依次点击顶点与两条边上的点(已启用对象捕捉)。",measureArcHint:"点击圆或圆弧可沿其测量;否则依次点击弧起点、弧上一点与弧端点(已启用对象捕捉)。锁定后按 Ctrl(Mac 为 Control 或 ⌘)可在大弧与小弧之间切换。",measureRadiusHint:"点击圆或圆弧以测量半径(已启用对象捕捉)。",measureCoordinateHint:"点击一点以读取其 X/Y 坐标(已启用对象捕捉)。",measureExported:"已导出 {count} 条测量。",measureImported:"已导入 {count} 条测量。",measureImportFailed:"导入测量失败:{error}",markupCloudHint:"点击两个对角点绘制修订云线。",markupCalloutHint:"先点击引线端点,或点击尚无标注的云线/矩形/圆外框,再点击文字位置。",markupTextHint:"点击一点放置文字。",markupRectHint:"点击两个对角点绘制矩形。",markupCircleHint:"先点击圆心,再点击圆周上一点。",markupArrowHint:"先点击起点,再点击箭头端点。",markupStampHint:"点击放置图章(在批准/拒绝等之间循环)。",markupArrowEndHint:"点击箭头端点。",markupRectCornerHint:"点击对角点。",markupCloudCornerHint:"点击对角点。",markupCalloutAnchorHint:"点击文字气泡位置。",markupCircleRadiusHint:"点击圆周上一点。",markupTextPrompt:"输入批注文字",markupTextEditHint:"在画布上输入文字。Enter 完成,Esc 取消。",markupShapeCalloutHint:"点击放置文本框(引线自动贴到图形)。Esc 取消引线和文本框。",markupDefaultLabel:"批注",markupSelected:"已选批注:{type}",markupSelectedCount:"已选批注:{count} 个",markupCount:"批注数:{count}",markupExported:"已导出 {count} 条批注。",markupImported:"已导入 {count} 条批注。",markupImportFailed:"导入批注失败:{error}",distance:"距离:{value}",coordinates:"X:{x} | Y:{y}",angle:"角度:{value}",arcLength:"弧长:{length} | 半径:{radius} | 总角度:{angle} | 弦长:{chord}",radius:"半径:{value}",continuousTotal:"总长度:{value}",area:"面积:{value}",lengthTotal:"长度合计:{value}",areaTotal:"面积合计:{value}",zoomLayer:"缩放:{name}",loadFailed:"无法加载图纸:{error}",noLayout:"快照中没有布局数据。",loadingChunks:"正在加载几何… {loaded}/{total}",loadingOsnap:"正在加载对象捕捉… {loaded}/{total}",buildingOsnap:"正在构建对象捕捉索引…"},package:{title:"打开图纸包",hint:"当前页面同级目录未找到 drawing.acex.json。请选择本地包文件夹,或输入清单 URL。",hintUrlOnly:"当前页面同级目录未找到 drawing.acex.json。请输入清单 URL 以打开图纸包。",chooseFolder:"选择本地文件夹",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"打开 URL",urlRequired:"请输入清单 URL。",manifestNotFound:"当前页面同级目录未找到 drawing.acex.json。",invalidManifest:"包清单无效或版本不受支持:{error}",folderMissingManifest:"所选文件夹必须包含 drawing.acex.json。",folderUnsupported:"当前浏览器无法选择本地包文件夹,请改为输入清单 URL。",loadFailed:"无法打开图纸包:{error}"},access:{title:"受保护的图纸",passwordPrompt:"请输入密码以打开此文件。",passwordPlaceholder:"密码",unlock:"解锁",passwordRequired:"请输入密码。",wrongPassword:"密码错误,请重试。",expired:"此文件已过期,无法打开。",expiredTitle:"文件已过期",expiredDetail:"此文件已于 {time} 过期,无法打开。",expiresAt:"有效期至:{time}",badgeExpires:"有效期至 {time}",badgeCountdown:"剩余 {time}",tooManyAttempts:"密码错误次数过多,请刷新页面后重新输入。"}},cs:{toolbar:{viewerTools:"Nástroje prohlížeče",select:"Výběr",pan:"Posun",zoom:"Přiblížení",zoomExtents:"Rozsah",zoomSmartExtents:"Chytrý",zoomWindow:"Okno",zoomSaved:"Uložený",zoomOriginal:"Uložený",measureDistance:"Vzdálenost",measureContinuous:"Spojité",measureAngle:"Úhel",measureArc:"Oblouk",measureRadius:"Poloměr",measureArea:"Plocha",measureCoordinate:"Souřadnice",clearMeasurements:"Vymazat",measureHide:"Skrýt",measureShow:"Zobrazit",measureImport:"Import",measureExport:"Export",measurementPanel:"Výsledky",measure:"Měření",annotation:"Kontrola",markupCloud:"Obláček",markupCallout:"Odkaz",markupText:"Text",markupRect:"Obdélník",markupCircle:"Kružnice",markupArrow:"Šipka",markupStamp:"Razítko",markupPanel:"Výsledky",markupHide:"Skrýt",markupShow:"Zobrazit",clearMarkups:"Vymazat",markupImport:"Import",markupExport:"Export",snap:"Uchopit",layers:"Hladiny",layout:"Rozvržení",settings:"Nastavení",simulatedMouseOn:"Myš",simulatedMouseOff:"Lupa",themeLight:"Světlý",themeDark:"Tmavý",switchBg:"Pozadí",language:"Jazyk",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",collapse:"Sbalit panel nástrojů",expand:"Rozbalit panel nástrojů",moreOverflow:"Další nástroje"},settings:{ortho:"Přepnout ortogonální režim",polar:"Úhly polárního trasování",polarAngles:"Úhly polárního trasování"},drawStyle:{color:"Barva",fontSize:"Výška textu",pickerTitle:"Vybrat barvu",close:"Zavřít",ok:"OK",cancel:"Zrušit",index:"Index barvy: ",rgb:"RGB: ",input:"Barva",inputPlaceholder:"1-255 nebo #RRGGBB"},shortCutToolbar:{more:"Více",undo:"Zpět",redo:"Znovu",erase:"Smazat",collapse:"Sbalit panel nástrojů",expand:"Rozbalit panel nástrojů"},textHeight:{title:"Výška textu",close:"Zavřít",ok:"OK",cancel:"Zrušit",adaptive:"Přizpůsobit obrazovce",custom:"Vlastní výška textu",customPlaceholder:"Světová výška",fromScreen:"Ze velikosti na obrazovce",fromScreenHint:"Zadejte, jak velký má text vypadat na obrazovce při aktuálním zoomu. Přepočítá se na pevnou světovou výšku, která se při pozdějším zoomování nemění.",screenPxPlaceholder:"Velikost písma",screenUnit:"px",convert:"Přepočítat"},entityPick:{cancel:"Zrušit výběr"},layers:{title:"Hladiny",close:"Zavřít hladiny",showAll:"Zobrazit vše",hideAll:"Skrýt vše",zoomTo:"Přiblížit na {name}"},review:{title:"Kontrola",close:"Zavřít kontrolu",searchPlaceholder:"Hledat poznámky",empty:"Zatím žádné poznámky",type:"Typ",status:"Stav",author:"Autor",summary:"Souhrn",details:"Podrobnosti",closeDetails:"Zavřít podrobnosti",label:"Popisek",comment:"Komentář",zoomTo:"Přiblížit na",delete:"Odstranit",clear:"Vymazat vše",statusValues:{open:"Otevřeno",question:"Otázka",answered:"Zodpovězeno",closed:"Uzavřeno"}},measurePanel:{title:"Měření",close:"Zavřít měření",filterGroup:"Filtrovat podle typu",filterDistance:"Vzdálenost",filterArc:"Oblouk",filterRadius:"Poloměr",filterAngle:"Úhel",filterArea:"Plocha",empty:"Zatím žádná měření",type:"Typ",value:"Hodnota",delete:"Odstranit",clear:"Vymazat vše"},session:{length:"Délka",angle:"Úhel",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"Potvrdit",cancel:"Zrušit",help:"Nápověda",back:"Zpět",collapse:"Sbalit",expand:"Rozbalit",undo:"Zpět"},touchPointTutorial:{title:"Jak přesně vybrat bod?",description:"Podržte prst na obrazovce asi 0,5 sekundy. Nad prstem se objeví kříž, který při pohybu sleduje prst a přichytává se k geometrii pro přesnější výběr.",snoozeToday:"Dnes už nepřipomínat",hideForever:"Už nepřipomínat",ok:"Rozumím"},status:{ready:"Připraveno",zoomWindowHint:"Klikněte na dva rohy pro přiblížení oknem.",measureDistanceHint:"Klikněte na dva body pro změření vzdálenosti (uchopení objektů zapnuto).",measureContinuousHint:"Klepejte na další body pro měření každého úseku; dokončete klepnutím na ✓. Dlouhé stisknutí pro přesné uchopení.",measureAngleHint:"Klikněte na vrchol, poté na dva body na každém rameni (uchopení objektů zapnuto).",measureArcHint:"Klikněte na kružnici nebo oblouk pro měření podél něj, nebo klikněte na začátek, bod na oblouku a konec (uchopení objektů zapnuto). Ctrl (⌘ na Macu) přepíná velký/malý oblouk.",measureRadiusHint:"Klikněte na kružnici nebo oblouk pro změření poloměru (uchopení objektů zapnuto).",measureAreaHint:"Klepejte na vrcholy mnohoúhelníku; dokončete klepnutím na ✓ po alespoň třech bodech.",measureCoordinateHint:"Klikněte na bod pro zobrazení jeho souřadnic X/Y (uchopení objektů zapnuto).",measureExported:"Exportováno {count} měření.",measureImported:"Importováno {count} měření.",measureImportFailed:"Import měření selhal: {error}",markupCloudHint:"Klikněte na dva rohy pro nakreslení obláčku.",markupCalloutHint:"Klikněte na hrot vodítka, nebo na obrys obláčku/obdélníku/kružnice bez odkazu, a poté na kotvu textu.",markupTextHint:"Klikněte pro umístění textu.",markupRectHint:"Klikněte na dva rohy pro nakreslení obdélníku.",markupCircleHint:"Klikněte na střed a poté na bod na kružnici.",markupArrowHint:"Klikněte na začátek a poté na hrot šipky.",markupStampHint:"Klikněte pro umístění razítka (schváleno / zamítnuto / …).",markupArrowEndHint:"Klikněte na hrot šipky.",markupRectCornerHint:"Klikněte na protilehlý roh.",markupCloudCornerHint:"Klikněte na protilehlý roh.",markupCalloutAnchorHint:"Klikněte na pozici textové bubliny.",markupCircleRadiusHint:"Klikněte na bod na kružnici.",markupTextPrompt:"Zadejte text poznámky",markupTextEditHint:"Pište text přímo na plátno. Enter dokončí, Esc zruší.",markupShapeCalloutHint:"Klikněte pro umístění textového pole (vodítko se připojí k tvaru). Esc zruší odkaz.",markupDefaultLabel:"Poznámka",markupSelected:"Vybraná poznámka: {type}",markupSelectedCount:"Vybrané poznámky: {count}",markupCount:"Poznámky: {count}",markupExported:"Exportováno {count} poznámek.",markupImported:"Importováno {count} poznámek.",markupImportFailed:"Import poznámek selhal: {error}",distance:"Vzdálenost: {value}",coordinates:"X: {x} | Y: {y}",angle:"Úhel: {value}",arcLength:"Délka oblouku: {length} | Poloměr: {radius} | Úhel: {angle} | Tětiva: {chord}",radius:"Poloměr: {value}",continuousTotal:"Celková délka: {value}",area:"Plocha: {value}",lengthTotal:"Celková délka: {value}",areaTotal:"Celková plocha: {value}",zoomLayer:"Zoom: {name}",loadFailed:"Nepodařilo se načíst výkres: {error}",noLayout:"Snímek neobsahuje data rozvržení.",loadingChunks:"Načítání geometrie… {loaded}/{total}",loadingOsnap:"Načítání uchopování… {loaded}/{total}",buildingOsnap:"Sestavování indexu uchopování…"},package:{title:"Otevřít balíček výkresu",hint:"Vedle této stránky nebyl nalezen drawing.acex.json. Vyberte místní složku balíčku nebo zadejte URL manifestu.",hintUrlOnly:"Vedle této stránky nebyl nalezen drawing.acex.json. Zadejte URL manifestu pro otevření balíčku.",chooseFolder:"Vybrat místní složku",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"Otevřít URL",urlRequired:"Zadejte URL manifestu.",manifestNotFound:"drawing.acex.json nebyl vedle této stránky nalezen.",invalidManifest:"Manifest balíčku je neplatný nebo používá nepodporovanou verzi: {error}",folderMissingManifest:"Vybraná složka musí obsahovat drawing.acex.json.",folderUnsupported:"Tento prohlížeč neumí otevřít místní složku balíčku. Zadejte místo toho URL manifestu.",loadFailed:"Nepodařilo se otevřít balíček: {error}"},access:{title:"Chráněný výkres",passwordPrompt:"Zadejte heslo pro otevření tohoto souboru.",passwordPlaceholder:"Heslo",unlock:"Odemknout",passwordRequired:"Zadejte heslo.",wrongPassword:"Nesprávné heslo. Zkuste to znovu.",expired:"Platnost tohoto souboru vypršela a nelze jej otevřít.",expiredTitle:"Soubor vypršel",expiredDetail:"Platnost tohoto souboru vypršela dne {time} a již jej nelze otevřít.",expiresAt:"Platnost do: {time}",badgeExpires:"Platnost do {time}",badgeCountdown:"Vyprší za {time}",tooManyAttempts:"Příliš mnoho nesprávných pokusů o heslo. Obnovte stránku a zkuste to znovu."}},tr:{toolbar:{viewerTools:"Görüntüleyici araçları",select:"Seç",pan:"Kaydır",zoom:"Yakınlaştır",zoomExtents:"Sınırlar",zoomSmartExtents:"Akıllı",zoomWindow:"Pencere",zoomSaved:"Kayıtlı",zoomOriginal:"Kayıtlı",measureDistance:"Mesafe",measureContinuous:"Sürekli",measureAngle:"Açı",measureArc:"Yay",measureRadius:"Yarıçap",measureArea:"Alan",measureCoordinate:"XY",clearMeasurements:"Temizle",measureHide:"Gizle",measureShow:"Göster",measureImport:"İçe aktar",measureExport:"Dışa aktar",measurementPanel:"Sonuç",measure:"Ölçüm",annotation:"İnceleme",markupCloud:"Bulut",markupCallout:"Çağrı",markupText:"Metin",markupRect:"Dörtgen",markupCircle:"Daire",markupArrow:"Ok",markupStamp:"Damga",markupPanel:"Sonuç",markupHide:"Gizle",markupShow:"Göster",clearMarkups:"Temizle",markupImport:"İçe aktar",markupExport:"Dışa aktar",snap:"Yakalama",layers:"Katman",layout:"Düzen",settings:"Ayarlar",simulatedMouseOn:"Fare",simulatedMouseOff:"Büyüteç",themeLight:"Açık",themeDark:"Koyu",switchBg:"Arka plan",language:"Dil",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",collapse:"Araç çubuğunu daralt",expand:"Araç çubuğunu genişlet",moreOverflow:"Diğer araçlar"},settings:{ortho:"Dik modu aç/kapat",polar:"Kutupsal izleme açıları",polarAngles:"Kutupsal izleme açıları"},drawStyle:{color:"Renk",fontSize:"Yazı yüksekliği",pickerTitle:"Renk Seç",close:"Kapat",ok:"Tamam",cancel:"İptal",index:"Renk İndeksi: ",rgb:"RGB: ",input:"Renk",inputPlaceholder:"1-255 veya #RRGGBB"},shortCutToolbar:{more:"Daha fazla",undo:"Geri al",redo:"Yinele",erase:"Sil",collapse:"Araç çubuğunu daralt",expand:"Araç çubuğunu genişlet"},textHeight:{title:"Yazı Yüksekliği",close:"Kapat",ok:"Tamam",cancel:"İptal",adaptive:"Ekrana uyarla",custom:"Özel yazı yüksekliği",customPlaceholder:"Dünya yüksekliği",fromScreen:"Ekran boyutundan",fromScreenHint:"Geçerli yakınlaştırmada ekranda istediğiniz yazı boyutunu girin. Sabit bir dünya yüksekliğine dönüştürülür; sonra yakınlaştırınca bu yükseklik değişmez.",screenPxPlaceholder:"Yazı boyutu",screenUnit:"px",convert:"Dönüştür"},entityPick:{cancel:"Seçimi iptal et"},layers:{title:"Katmanlar",close:"Katmanları kapat",showAll:"Tümünü göster",hideAll:"Tümünü gizle",zoomTo:"{name} katmanına yakınlaştır"},review:{title:"İnceleme",close:"İncelemeyi kapat",searchPlaceholder:"İşaretlerde ara",empty:"Henüz işaret yok",type:"Tür",status:"Durum",author:"Yazar",summary:"Özet",details:"Ayrıntılar",closeDetails:"Ayrıntıları kapat",label:"Etiket",comment:"Yorum",zoomTo:"Yakınlaştır",delete:"Sil",clear:"Tümünü temizle",statusValues:{open:"Açık",question:"Soru",answered:"Yanıtlandı",closed:"Kapalı"}},measurePanel:{title:"Ölçümler",close:"Ölçümleri kapat",filterGroup:"Türe göre filtrele",filterDistance:"Mesafe",filterArc:"Yay",filterRadius:"Yarıçap",filterAngle:"Açı",filterArea:"Alan",empty:"Henüz ölçüm yok",type:"Tür",value:"Değer",delete:"Sil",clear:"Tümünü temizle"},session:{length:"Uzunluk",angle:"Açı",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"Onayla",cancel:"İptal",help:"Yardım",back:"Geri",collapse:"Daralt",expand:"Genişlet",undo:"Geri al"},touchPointTutorial:{title:"Noktalar nasıl hassas seçilir?",description:"Ekranda yaklaşık 0,5 saniye basılı tutun. Parmağınızın üstünde bir artı belirir ve hareket ederken geometriye yapışarak daha doğru seçim yapmanızı sağlar.",snoozeToday:"Bugün tekrar hatırlatma",hideForever:"Bir daha hatırlatma",ok:"Anladım"},status:{ready:"Hazır",zoomWindowHint:"Pencere yakınlaştırmak için iki köşeyi tıklayın.",measureDistanceHint:"Mesafe ölçmek için iki nokta tıklayın (nesne yakalama etkin).",measureContinuousHint:"Her segmenti ölçmek için ardışık noktalar dokunun; bitirmek için ✓. Hassas yakalama için basılı tutun.",measureAngleHint:"Önce köşe noktasını, sonra her koldan birer nokta tıklayın (nesne yakalama etkin).",measureArcHint:"Ölçmek için bir çember veya yaya tıklayın; ya da yay başlangıcı, yay üzerindeki bir nokta ve yay sonunu tıklayın (nesne yakalama etkin). Ctrl (Mac’te ⌘) büyük/küçük yay arasında geçiş yapar.",measureRadiusHint:"Yarıçap ölçmek için bir çember veya yaya tıklayın (nesne yakalama etkin).",measureAreaHint:"Çokgen köşelerini dokunun; en az üç noktadan sonra bitirmek için ✓.",measureCoordinateHint:"X/Y koordinatlarını okumak için bir nokta tıklayın (nesne yakalama etkin).",measureExported:"{count} ölçüm dışa aktarıldı.",measureImported:"{count} ölçüm içe aktarıldı.",measureImportFailed:"Ölçüm içe aktarılamadı: {error}",markupCloudHint:"Revizyon bulutu çizmek için iki köşe tıklayın.",markupCalloutHint:"Lider ucunu veya çağrısı olmayan bulut/dikdörtgen/daire dış çerçevesini tıklayın, ardından metin konumunu tıklayın.",markupTextHint:"Metin yerleştirmek için bir nokta tıklayın.",markupRectHint:"Dikdörtgen çizmek için iki köşe tıklayın.",markupCircleHint:"Önce merkezi, sonra çevre üzerindeki bir noktayı tıklayın.",markupArrowHint:"Önce başlangıcı, sonra ok ucunu tıklayın.",markupStampHint:"Damga yerleştirmek için tıklayın (onaylandı / reddedildi / …).",markupArrowEndHint:"Ok ucunu tıklayın.",markupRectCornerHint:"Karşı köşeyi tıklayın.",markupCloudCornerHint:"Karşı köşeyi tıklayın.",markupCalloutAnchorHint:"Metin balonu konumunu tıklayın.",markupCircleRadiusHint:"Çevre üzerindeki bir noktayı tıklayın.",markupTextPrompt:"İşaretleme metnini girin",markupTextEditHint:"Metni tuval üzerinde yazın. Enter ile bitirin, Esc ile iptal edin.",markupShapeCalloutHint:"Metin kutusunu yerleştirmek için tıklayın (lider şekle bağlanır). Esc çağrıyı iptal eder.",markupDefaultLabel:"Not",markupSelected:"Seçili işaretleme: {type}",markupSelectedCount:"Seçili işaretlemeler: {count}",markupCount:"İşaretlemeler: {count}",markupExported:"{count} işaretleme dışa aktarıldı.",markupImported:"{count} işaretleme içe aktarıldı.",markupImportFailed:"İşaretleme içe aktarılamadı: {error}",distance:"Mesafe: {value}",coordinates:"X: {x} | Y: {y}",angle:"Açı: {value}",arcLength:"Yay uzunluğu: {length} | Yarıçap: {radius} | Açı: {angle} | Kiriş: {chord}",radius:"Yarıçap: {value}",continuousTotal:"Toplam uzunluk: {value}",area:"Alan: {value}",lengthTotal:"Toplam uzunluk: {value}",areaTotal:"Toplam alan: {value}",zoomLayer:"Yakınlaştır: {name}",loadFailed:"Çizim yüklenemedi: {error}",noLayout:"Anlık görüntüde yerleşim verisi yok.",loadingChunks:"Geometri yükleniyor… {loaded}/{total}",loadingOsnap:"Nesne yakalama yükleniyor… {loaded}/{total}",buildingOsnap:"Nesne yakalama dizini oluşturuluyor…"},package:{title:"Çizim paketini aç",hint:"Bu sayfanın yanında drawing.acex.json bulunamadı. Yerel bir paket klasörü seçin veya manifesto URL’sini girin.",hintUrlOnly:"Bu sayfanın yanında drawing.acex.json bulunamadı. Paketi açmak için manifesto URL’sini girin.",chooseFolder:"Yerel klasör seç",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"URL aç",urlRequired:"Lütfen bir manifesto URL’si girin.",manifestNotFound:"Bu sayfanın yanında drawing.acex.json bulunamadı.",invalidManifest:"Paket manifestosu geçersiz veya desteklenmeyen bir sürüm kullanıyor: {error}",folderMissingManifest:"Seçilen klasör drawing.acex.json içermelidir.",folderUnsupported:"Bu tarayıcı yerel paket klasörü açamıyor. Bunun yerine manifesto URL’si yapıştırın.",loadFailed:"Paket açılamadı: {error}"},access:{title:"Korumalı çizim",passwordPrompt:"Bu dosyayı açmak için parolayı girin.",passwordPlaceholder:"Parola",unlock:"Kilidi aç",passwordRequired:"Lütfen bir parola girin.",wrongPassword:"Parola yanlış. Tekrar deneyin.",expired:"Bu dosyanın süresi doldu ve artık açılamaz.",expiredTitle:"Dosyanın süresi doldu",expiredDetail:"Bu dosyanın süresi {time} tarihinde doldu ve artık açılamaz.",expiresAt:"Son geçerlilik: {time}",badgeExpires:"Son geçerlilik {time}",badgeCountdown:"Kalan süre {time}",tooManyAttempts:"Çok fazla yanlış parola denemesi yapıldı. Tekrar denemek için sayfayı yenileyin."}}},ar:{toolbar:{viewerTools:"أدوات العارض",select:"تحديد",pan:"تحريك",zoom:"تكبير/تصغير",zoomExtents:"ملاءمة",zoomSmartExtents:"ذكية",zoomWindow:"نافذة",zoomSaved:"محفوظ",zoomOriginal:"محفوظ",measureDistance:"مسافة",measureContinuous:"مستمر",measureAngle:"زاوية",measureArc:"قوس",measureRadius:"نصف القطر",measureArea:"مساحة",measureCoordinate:"إحداثيات",clearMeasurements:"مسح",measureHide:"إخفاء",measureShow:"إظهار",measureImport:"استيراد",measureExport:"تصدير",measurementPanel:"نتائج",measure:"قياس",annotation:"مراجعة",markupCloud:"سحابة",markupCallout:"تعليق",markupText:"نص",markupRect:"مستطيل",markupCircle:"دائرة",markupArrow:"سهم",markupStamp:"ختم",markupPanel:"نتائج",markupHide:"إخفاء",markupShow:"إظهار",clearMarkups:"مسح",markupImport:"استيراد",markupExport:"تصدير",snap:"التقاط",layers:"طبقات",layout:"تخطيط",settings:"إعدادات",simulatedMouseOn:"ماوس",simulatedMouseOff:"عدسة",themeLight:"فاتح",themeDark:"داكن",switchBg:"خلفية",language:"اللغة",localeEn:"English",localeZh:"中文",localeCs:"Čeština",localeTr:"Türkçe",localeAr:"العربية",collapse:"طي شريط الأدوات",expand:"توسيع شريط الأدوات",moreOverflow:"المزيد من الأدوات"},settings:{ortho:"تبديل الوضع المتعامد",polar:"زوايا التتبع القطبي",polarAngles:"زوايا التتبع القطبي"},drawStyle:{color:"اللون",fontSize:"ارتفاع النص",pickerTitle:"تحديد اللون",close:"إغلاق",ok:"موافق",cancel:"إلغاء",index:"فهرس اللون: ",rgb:"RGB: ",input:"اللون",inputPlaceholder:"1-255 أو #RRGGBB"},textHeight:{title:"ارتفاع النص",close:"إغلاق",ok:"موافق",cancel:"إلغاء",adaptive:"ملاءمة الشاشة",custom:"ارتفاع نص مخصص",customPlaceholder:"ارتفاع العالم",fromScreen:"من حجم الشاشة",fromScreenHint:"أدخل حجم النص المطلوب على الشاشة عند التكبير الحالي. يُحوَّل إلى ارتفاع ثابت في إحداثيات الرسم ويبقى كما هو عند تغيير التكبير لاحقًا.",screenPxPlaceholder:"حجم الخط",screenUnit:"px",convert:"تحويل"},layers:{title:"الطبقات",close:"إغلاق الطبقات",showAll:"إظهار الكل",hideAll:"إخفاء الكل",zoomTo:"تكبير إلى {name}"},review:{title:"مراجعة",close:"إغلاق المراجعة",searchPlaceholder:"البحث في الملاحظات",empty:"لا توجد ملاحظات بعد",type:"النوع",status:"الحالة",author:"المؤلف",summary:"الملخص",details:"التفاصيل",closeDetails:"إغلاق التفاصيل",label:"التسمية",comment:"التعليق",zoomTo:"تكبير إلى",delete:"حذف",clear:"مسح الكل",statusValues:{open:"مفتوح",question:"سؤال",answered:"تمت الإجابة",closed:"مغلق"}},measurePanel:{title:"القياسات",close:"إغلاق القياسات",filterGroup:"التصفية حسب النوع",filterDistance:"مسافة",filterArc:"قوس",filterRadius:"نصف القطر",filterAngle:"زاوية",filterArea:"مساحة",empty:"لا توجد قياسات حتى الآن",type:"النوع",value:"القيمة",delete:"حذف",clear:"مسح الكل"},session:{length:"الطول",angle:"الزاوية",dx:"ΔX",dy:"ΔY",x:"X",y:"Y",confirm:"تأكيد",cancel:"إلغاء",help:"مساعدة",back:"رجوع",collapse:"طي",expand:"توسيع",undo:"تراجع"},touchPointTutorial:{title:"كيف أختار النقاط بدقة؟",description:"اضغط مطولاً على الشاشة لمدة نصف ثانية تقريباً. يظهر صليب فوق إصبعك ويتبعه أثناء الحركة ويلتقط إلى الهندسة لاختيار أدق.",snoozeToday:"لا تذكرني اليوم",hideForever:"لا تذكرني مرة أخرى",ok:"فهمت"},status:{ready:"جاهز",zoomWindowHint:"انقر على ركنين لتحديد نافذة التكبير.",measureDistanceHint:"انقر على نقطتين لقياس المسافة (التقاط الكائنات مفعّل).",measureContinuousHint:"انقر على نقاط متتالية لقياس كل قطعة؛ انقر ✓ للإنهاء. اضغط مطولاً للالتقاط الدقيق.",measureAngleHint:"انقر على رأس الزاوية، ثم نقطة على كل ضلع (التقاط الكائنات مفعّل).",measureArcHint:"انقر على دائرة أو قوس للقياس عليه، أو انقر على نقطة البداية ثم نقطة على القوس ثم نقطة النهاية (التقاط الكائنات مفعّل). استخدم Ctrl (⌘ على Mac) للتبديل بين القوس الأكبر والأصغر.",measureRadiusHint:"انقر على دائرة أو قوس لقياس نصف القطر (التقاط الكائنات مفعّل).",measureAreaHint:"انقر على رؤوس المضلع؛ انقر ✓ للإنهاء بعد ثلاث نقاط على الأقل.",measureCoordinateHint:"انقر على نقطة لقراءة إحداثيات X/Y الخاصة بها (التقاط الكائنات مفعّل).",measureExported:"تم تصدير {count} من القياسات.",measureImported:"تم استيراد {count} من القياسات.",measureImportFailed:"فشل استيراد القياسات: {error}",markupCloudHint:"انقر على ركنين لرسم سحابة مراجعة.",markupCalloutHint:"انقر على طرف خط الإشارة، أو على إطار سحابة/مستطيل/دائرة بدون تعليق توضيحي، ثم موضع النص.",markupTextHint:"انقر على نقطة لوضع النص.",markupRectHint:"انقر على ركنين لرسم مستطيل.",markupCircleHint:"انقر على المركز، ثم على نقطة على المحيط.",markupArrowHint:"انقر على نقطة البداية، ثم على رأس السهم.",markupStampHint:"انقر لوضع ختم (يتنقل بين معتمد / مرفوض / …).",markupArrowEndHint:"انقر على رأس السهم.",markupRectCornerHint:"انقر على الركن المقابل.",markupCloudCornerHint:"انقر على الركن المقابل.",markupCalloutAnchorHint:"انقر على موضع فقاعة النص.",markupCircleRadiusHint:"انقر على نقطة على المحيط.",markupTextPrompt:"أدخل نص الملاحظة",markupTextEditHint:"اكتب النص على مساحة الرسم. اضغط Enter للإنهاء أو Esc للإلغاء.",markupShapeCalloutHint:"انقر لوضع مربع النص (يتصل خط الإشارة بالشكل). اضغط Esc لإلغاء التعليق التوضيحي.",markupDefaultLabel:"ملاحظة",markupSelected:"الملاحظة المحددة: {type}",markupSelectedCount:"الملاحظات المحددة: {count}",markupCount:"عدد الملاحظات: {count}",markupExported:"تم تصدير {count} من الملاحظات.",markupImported:"تم استيراد {count} من الملاحظات.",markupImportFailed:"فشل استيراد الملاحظات: {error}",distance:"المسافة: {value}",coordinates:"X: {x} | Y: {y}",angle:"الزاوية: {value}",arcLength:"طول القوس: {length} | نصف القطر: {radius} | الزاوية: {angle} | الوتر: {chord}",radius:"نصف القطر: {value}",continuousTotal:"إجمالي الطول: {value}",area:"المساحة: {value}",lengthTotal:"إجمالي الطول: {value}",areaTotal:"إجمالي المساحة: {value}",zoomLayer:"تكبير: {name}",loadFailed:"فشل تحميل الرسم: {error}",noLayout:"لا توجد بيانات تخطيط في اللقطة.",loadingChunks:"جاري تحميل الهندسة… {loaded}/{total}",loadingOsnap:"جاري تحميل الالتقاط… {loaded}/{total}",buildingOsnap:"جاري بناء فهرس الالتقاط…"},package:{title:"فتح حزمة الرسم",hint:"لم يتم العثور على drawing.acex.json بجانب هذه الصفحة. اختر مجلد الحزمة المحلي أو أدخل عنوان URL للقائمة.",hintUrlOnly:"لم يتم العثور على drawing.acex.json بجانب هذه الصفحة. أدخل عنوان URL للقائمة لفتح الحزمة.",chooseFolder:"اختيار مجلد محلي",urlPlaceholder:"https://example.com/drawing.acex.json",openUrl:"فتح الرابط",urlRequired:"يرجى إدخال عنوان URL للقائمة.",manifestNotFound:"لم يتم العثور على drawing.acex.json بجانب هذه الصفحة.",invalidManifest:"قائمة الحزمة غير صالحة أو تستخدم إصداراً غير مدعوم: {error}",folderMissingManifest:"يجب أن يحتوي المجلد المحدد على drawing.acex.json.",folderUnsupported:"لا يمكن لهذا المتصفح فتح مجلد حزمة محلي. الصق عنوان URL للقائمة بدلاً من ذلك.",loadFailed:"تعذر فتح الحزمة: {error}"},access:{title:"رسم محمي",passwordPrompt:"أدخل كلمة المرور لفتح هذا الملف.",passwordPlaceholder:"كلمة المرور",unlock:"فتح",passwordRequired:"يرجى إدخال كلمة المرور.",wrongPassword:"كلمة المرور غير صحيحة. حاول مرة أخرى.",expired:"انتهت صلاحية هذا الملف ولا يمكن فتحه.",expiredTitle:"انتهت صلاحية الملف",expiredDetail:"انتهت صلاحية هذا الملف في {time} ولا يمكن فتحه.",expiresAt:"ينتهي في: {time}",badgeExpires:"ينتهي في {time}",badgeCountdown:"متبقي {time}",tooManyAttempts:"عدد محاولات إدخال كلمة المرور كبير جدًا. قم بتحديث الصفحة للمحاولة مرة أخرى."}}};function El(e){return he.includes(e)}function Le(e){if(e==null||e==="")return null;const t=e.toLowerCase().replace("_","-");for(const n of he)if(t===n||t.startsWith(`${n}-`))return n;return null}function ja(){if(typeof navigator>"u")return"en";const e=[...navigator.languages??[],navigator.language].filter(Boolean);for(const t of e){const n=Le(t);if(n)return n}return"en"}function Za(){if(typeof localStorage<"u")try{const e=localStorage.getItem(Gn),t=Le(e);if(t)return t}catch{}return ja()}function Ka(e,t){const n=t.split(".");let r=e;for(const a of n){if(r==null||typeof r=="string")return;r=r[a]}return typeof r=="string"?r:void 0}function Wa(e,t){return t?e.replace(/\{(\w+)\}/g,(n,r)=>{const a=t[r];return a!=null?String(a):`{${r}}`}):e}class Cl{constructor(t){this._onChange=null,this._locale=t??Za()}get locale(){return this._locale}get localeBadge(){return Yn[this._locale]}setOnChange(t){this._onChange=t}t(t,n){const r=Ka(Ga[this._locale],t)??Ka(Ga.en,t)??t;return Wa(r,n)}toggleLocale(){const t=he.indexOf(this._locale),n=he[(t+1)%he.length];return this.setLocale(n),n}setLocale(t){var n;if(this._locale!==t){this._locale=t,typeof document<"u"&&(document.documentElement.lang=t);try{typeof localStorage<"u"&&localStorage.setItem(Gn,t)}catch{}this.applyToDocument(),(n=this._onChange)==null||n.call(this)}}applyToDocument(t){if(typeof document>"u")return;const n=t??document;document.documentElement.lang=this._locale,n.querySelectorAll("[data-i18n-text]").forEach(a=>{const o=a.dataset.i18nKey;o&&(a.textContent=this.t(o))}),n.querySelectorAll("[data-i18n-attr]").forEach(a=>{var l;const o=a.dataset.i18nKey,i=((l=a.dataset.i18nAttr)==null?void 0:l.split(/\s+/))??[];if(!o||i.length===0)return;const s=this.t(o);for(const c of i)a.setAttribute(c,s)});const r=document.getElementById("mlcad-lang-badge");r&&(r.textContent=this.localeBadge)}}const jn=1128612673,qa=1e5;function Ve(e){if(e.version!==D)throw new Error(`Unsupported chunk version: ${e.version}`);const t=new it;t.writeU32(jn),t.writeU8(D),t.writeU8(0),t.writeU8(0),t.writeU8(0),t.writeString(e.layoutBtrId),t.writeU32(e.lineBatches.length);for(const n of e.lineBatches)vn(t,n);t.writeU32(e.meshBatches.length);for(const n of e.meshBatches)xn(t,n);return t.toUint8Array()}function Zn(e){const t=new st(e);if(t.readU32()!==jn)throw new Error("Invalid chunk magic");const r=t.readU8();if(t.readU8(),t.readU8(),t.readU8(),r!==D)throw new Error(`Unsupported chunk version: ${r}`);const a=t.readString(),o=t.readU32();if(o>qa)throw new Error("Chunk line batch count exceeds limit");const i=[];for(let c=0;c<o;c++)i.push(bn(t));const s=t.readU32();if(s>qa)throw new Error("Chunk mesh batch count exceeds limit");const l=[];for(let c=0;c<s;c++)l.push(kn(t));return{version:D,layoutBtrId:a,lineBatches:i,meshBatches:l}}function Ja(e){const t=Ve(e),n=ve(t).bytes;return{uncompressed:t,compressed:n}}async function Sl(e){const t=Ve(e),n=(await fn(t)).bytes;return{uncompressed:t,compressed:n}}function Qa(e){return Zn(dt(e))}function Kn(e){return pn(e)?Qa(e):Zn(e)}const Wn=1,eo=2*1024*1024,Ye=2*1024*1024,Ml=512*1024,to=8*1024*1024,qn=12*1024*1024,no=2*1024*1024,Dt=6;function Rt(e,t,n){const r=e.length,a=r>0?Math.max(1,Math.min(Number.isFinite(t)?Math.floor(t):1,r)):0,o=new Array(r);let i=0,s=0;const l=c=>{const d=Promise.resolve().then(()=>n(e[c],c));d.catch(()=>{}),o[c]=d,i+=1};for(;i<a;)l(i);return{async next(){if(s>=r)return null;const c=s;s+=1;const d=await o[c];return i<r&&l(i),{item:e[c],index:c,bytes:d}}}}const _l=/^(?:\.[/\\])?[A-Za-z0-9._-]+(?:[/\\][A-Za-z0-9._-]+)*$/;function ro(e){const t=e.trim();return!t||t!==e||t.startsWith("/")||t.startsWith("\\")||t.startsWith("//")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t)||t.includes("..")||t.includes("\\")?!1:_l.test(t)}function Nt(e,t){if(!ro(e))throw new Error(`Invalid ${t}: must be a relative package path`)}function Ge(e){if(!e||typeof e!="object")throw new Error("Invalid package manifest");const t=e;if(t.format!=="acex-package")throw new Error("Unsupported package format");if(t.packageVersion!==Wn)throw new Error(`Unsupported package version: ${String(t.packageVersion)}`);if(t.snapshotVersion!==D)throw new Error(`Unsupported snapshot version: ${String(t.snapshotVersion)}`);if(!Array.isArray(t.layouts)||!Array.isArray(t.chunks))throw new Error("Invalid package manifest structure");for(const n of t.chunks){if(!n||typeof n!="object")throw new Error("Invalid package chunk entry");Nt(n.href,"chunk href")}for(const n of t.osnapChunks??[]){if(!n||typeof n!="object")throw new Error("Invalid package osnap chunk entry");Nt(n.href,"osnap chunk href")}return t}function ao(e){return{version:D,meta:e.meta,layers:e.layers,activeLayoutBtrId:e.activeLayoutBtrId,layouts:e.layouts.map(t=>({btrId:t.btrId,name:t.name,isModelSpace:t.isModelSpace,lineBatches:[],meshBatches:[],viewports:t.viewports,...t.savedView?{savedView:t.savedView}:{},...t.fitExtents?{fitExtents:t.fitExtents}:{}}))}}function Xt(e,t){Nt(t,"chunk href");let n,r;try{n=new URL(t,e),r=new URL(e)}catch{throw new Error("Invalid chunk or manifest URL")}if(n.protocol!==r.protocol||n.host!==r.host)throw new Error("Chunk URL must share the manifest origin");const a=r.pathname.replace(/[^/]*$/,""),o=n.pathname;if(!o.startsWith(a))throw new Error("Chunk URL escapes package directory");if(o.split("/").includes(".."))throw new Error("Chunk URL escapes package directory");return n.toString()}function oo(e,t){Nt(e,"manifestUrl");let n,r;try{n=new URL(e,t),r=new URL(t)}catch{throw new Error("Invalid manifestUrl")}if(n.protocol!==r.protocol||n.host!==r.host)throw new Error("manifestUrl must be same-origin");return n.toString()}async function Jn(e,t,n){const r=await e(t);if(!r.ok)throw new Error(`Failed to load ${n} (${r.status})`);const a=r.headers.get("content-length");if(a!=null){const i=Number(a);if(Number.isFinite(i)&&i>ct)throw new Error(`${n} exceeds size limit`)}const o=await r.arrayBuffer();if(o.byteLength>ct)throw new Error(`${n} exceeds size limit`);return new Uint8Array(o)}async function Pl(e){var p;const t=e.fetchImpl??Ze,n=e.loadOsnap!==!1,r=e.fetchConcurrency??Dt,a=await t(e.manifestUrl);if(!a.ok)throw new Error(`Failed to load package manifest (${a.status})`);const o=Ge(await a.json()),i=ao(o),s=new Map(i.layouts.map(f=>[f.btrId,f])),l=e.layoutFilter==null?null:e.layoutFilter instanceof Set?e.layoutFilter:new Set(e.layoutFilter),c=o.chunks.filter(f=>l==null||l.has(f.layoutBtrId)),d=Rt(c,r,f=>Jn(t,Xt(e.manifestUrl,f.href),"geometry chunk"));let u=0;for(;;){const f=await d.next();if(!f)break;const h=f.item,g=s.get(h.layoutBtrId);if(!g)throw new Error("Unknown layout for package chunk");const y=Kn(f.bytes);if(y.layoutBtrId!==h.layoutBtrId)throw new Error("Chunk layout mismatch");so(g,y.lineBatches,y.meshBatches),u+=1,await((p=e.onChunk)==null?void 0:p.call(e,g,h,{loadedChunks:u,totalChunks:c.length,layoutBtrId:h.layoutBtrId,chunkId:h.id}))}if(n)for(const f of o.layouts){if(l!=null&&!l.has(f.btrId))continue;const h=s.get(f.btrId);h&&await io(o,e.manifestUrl,f.btrId,h,{fetchImpl:t})}return i}async function Il(e,t,n,r,a={}){var p;const o=a.fetchImpl??Ze,i=a.fetchConcurrency??Dt,s=e.layouts.find(f=>f.btrId===n);if(!s)throw new Error(`Layout not found: ${n}`);const l=new Map(e.chunks.map(f=>[f.id,f])),c=s.chunkIds.map(f=>l.get(f)).filter(f=>f!=null),d=Rt(c,i,f=>Jn(o,Xt(t,f.href),"geometry chunk"));let u=0;for(;;){const f=await d.next();if(!f)break;const h=f.item,g=Kn(f.bytes);so(r,g.lineBatches,g.meshBatches),u+=1,await((p=a.onChunk)==null?void 0:p.call(a,r,h,{loadedChunks:u,totalChunks:c.length,layoutBtrId:n,chunkId:h.id}))}}async function io(e,t,n,r,a={}){var b;if(r.osnap)return;const o=e.layouts.find(w=>w.btrId===n);if(!o)return;const i=o.osnapChunkIds;if(!i||i.length===0)return;const s=new Map((e.osnapChunks??[]).map(w=>[w.id,w])),l=i.map(w=>s.get(w)).filter(w=>w!=null);if(l.length===0)return;const c=a.fetchImpl??Ze,d=a.fetchConcurrency??Dt,u=a.yieldFn??(()=>new Promise(w=>{setTimeout(w,0)})),p=l.reduce((w,A)=>w+A.primitiveCount,0),f=p>0?new Array(p):[];let h=0;const g=Rt(l,d,w=>Jn(c,Xt(t,w.href),"osnap chunk"));let y=0;for(;;){const w=await g.next();if(!w)break;const A=w.item,M=qr(w.bytes).primitives;if(p>0)for(let C=0;C<M.length;C++)f[h++]=M[C];else for(const C of M)f.push(C);y+=1,await((b=a.onChunk)==null?void 0:b.call(a,{loadedChunks:y,totalChunks:l.length,layoutBtrId:n,chunkId:A.id})),await u()}p>0&&h!==p&&(f.length=h),r.osnap={primitives:f}}function so(e,t,n){e.lineBatches.push(...t),e.meshBatches.push(...n)}const ne="drawing.acex.json",Qn=`./${ne}`,lo=["manifest","acex"],je="https://acex-package.invalid/",Ze=(e,t)=>globalThis.fetch(e,t);function Bl(e){return e.directoryPicker||e.webkitDirectory}function Tl(e){const t=(e==null?void 0:e.hasDirectoryPicker)??typeof globalThis.showDirectoryPicker=="function",n=(e==null?void 0:e.isSecureContext)??(typeof globalThis.isSecureContext=="boolean"?globalThis.isSecureContext:!0);let r=e==null?void 0:e.supportsWebkitDirectoryAttribute;if(r==null&&(r=!1,typeof document<"u")){const a=document.createElement("input");a.type="file",r="webkitdirectory"in a||"directory"in a}return{directoryPicker:t&&n,webkitDirectory:r}}function co(e){var r;const t=e.startsWith("?")?e.slice(1):e;if(!t)return null;let n;try{n=new URLSearchParams(t)}catch{return null}for(const a of lo){const o=(r=n.get(a))==null?void 0:r.trim();if(o)return o}return null}function zl(e){var r;const t=co(e.search??"");if(t)return{href:t,fromQuery:!0};const n=(r=e.configManifestUrl)==null?void 0:r.trim();return n?{href:n,fromQuery:!1}:{href:Qn,fromQuery:!1}}function uo(e){return/^https?:\/\//i.test(e.trim())}function Fl(e,t){const n=e.trim();if(!n)throw new Error("Missing manifest URL");if(uo(n))try{return new URL(n).toString()}catch{throw new Error("Invalid manifest URL")}return oo(n,t)}async function Ol(e,t=Ze){let n;try{n=await t(e)}catch(a){return{ok:!1,reason:"network",error:a instanceof Error?a:new Error(String(a))}}if(n.status===404||n.status===410)return{ok:!1,reason:"not-found",error:new Error(`Failed to load package manifest (${n.status})`)};if(!n.ok)return{ok:!1,reason:"network",error:new Error(`Failed to load package manifest (${n.status})`)};let r;try{r=await n.json()}catch(a){return{ok:!1,reason:"invalid",error:a instanceof Error?a:new Error("Invalid package manifest JSON")}}try{return{ok:!0,manifest:Ge(r)}}catch(a){return{ok:!1,reason:"invalid",error:a instanceof Error?a:new Error(String(a))}}}function mo(e,t){let n=e.replace(/\\/g,"/").replace(/^\/+/,"");if(t){const r=t.replace(/\\/g,"/").replace(/\/+$/,"");n===r?n="":n.startsWith(`${r}/`)&&(n=n.slice(r.length+1))}return n.replace(/^\.\//,"")}function fo(e){const t=[...e].map(o=>o.replace(/\\/g,"/").replace(/^\/+/,"")).filter(Boolean);if(t.length===0)return null;const n=t[0].split("/")[0];return!n||n===ne||!t.every(o=>o.split("/")[0]===n)?null:t.some(o=>o.includes("/"))?n:null}function Hl(e){const t=[...e],n=fo(t.map(a=>a.relativePath)),r=new Map;for(const a of t){const o=mo(a.relativePath,n);!o||o.endsWith("/")||r.set(o,a.bytes)}return r}function Ul(e,t){const n=(t==null?void 0:t.manifestFileName)??ne;if(!e.has(n))throw new Error(`Missing ${n} in selected folder`);const r=new URL(n,je).toString(),a=new URL(je).origin;return{manifestUrl:r,fetchImpl:async i=>{const s=new URL(String(i));if(s.origin!==a)return new Response(null,{status:404});const l=decodeURIComponent(s.pathname.replace(/^\/+/,"")),c=e.get(l);if(!c)return new Response(null,{status:404});if(l.endsWith(".json")){const u=new TextDecoder().decode(c);return new Response(u,{status:200,headers:{"Content-Type":"application/json"}})}const d=new Uint8Array(c.byteLength);return d.set(c),new Response(d,{status:200})}}}function Dl(e){return e.has(ne)?ne:null}function er(...e){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 1024 1024">${e.map(n=>`<path fill="currentColor" d="${n}"/>`).join("")}</svg>`}const Rl='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10.4379 15.2979h.002l4.86-4.86-9.722-4.86 4.86 9.72Zm7.562-5.298-3.434 3.434 3.2 3.2-1.132 1.132-3.2-3.2-3.434 3.434-7.6-15.6 15.6 7.6Z"/></svg>',Nl='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M15.08 12.8537l.002-.002V5.5897c0-.422-.652-.414-.652 0v3.466c0 .938-1.482.95-1.482 0v-4.83c0-.414-.6381-.414-.6381 0h-.014v4.83c.014.95-1.482.95-1.482 0V3.4437c0-.42-.638-.414-.638 0v5.612c0 .95-1.494.95-1.494 0V4.2317c0-.408-.64-.42-.64 0v6.756c0 .802-1.094 1.088-1.494.388-.26-.446-.518-.892-.776-1.338-.338-.482-1.1-.15-.794.38.326.566.652 1.132.978 1.698.006.012.014.026.02.04.552.946 1.106 1.89 1.658 2.834.19.3.422.578.666.802h-.006c.672.61 1.528.964 2.418 1.052.888.06 1.7921-.124 2.5601-.612.3-.19.572-.416.816-.68.326-.368.57-.776.734-1.204.176-.482.258-.97.258-1.494Zm-.91-8.608-.004-.002c.958-.38 2.058.244 2.058 1.346v7.266c0 .652-.108 1.29-.332 1.894-.216.564-.53 1.114-.964 1.576-.318.34-.666.632-1.046.884-.978.612-2.1461.862-3.2601.774-1.128-.102-2.228-.564-3.098-1.352-.326-.292-.612-.646-.87-1.034-.558-.96-1.114-1.92-1.672-2.88l-.012-.028c-.326-.568-.652-1.138-.978-1.706-.59-1.018.068-2.186 1.156-2.336.536-.074 1.126.116 1.562.72.026.028.04.062.054.096.04.074.082.146.122.218V4.2337c0-1.176 1.244-1.788 2.202-1.278.42-1.278 2.378-1.264 2.792-.014.9721-.51 2.2221.102 2.2221 1.284v.06c.022-.014.046-.026.068-.04Z"/></svg>',po='<path fill="currentColor" d="M9.3333 14.125 5.875 10.6667V14.125H9.3333Zm4.7917-3.4583-3.4583 3.4583H14.125V10.6667ZM10.6667 5.875 14.125 9.3333V5.875H10.6667ZM5.875 9.3333 9.3333 5.875H5.875V9.3333Zm9.2083 5.475c1.2333-1.3 1.9083-3.0333 1.9083-4.825-.0083-3.325-2.35-6.1833-5.6083-6.8417C8.125 2.4833 4.85 4.2 3.55 7.2583c-1.3 3.0583-.275 6.6083 2.4583 8.5 2.725 1.8917 6.4167 1.6 8.8167-.6917.0917-.0833.175-.175.2583-.2583Zm1.2583.5917 2.575 2.575c-.3167.3167-.625.625-.9417.9417-.8583-.8583-1.7167-1.7167-2.575-2.575-3.4083 2.9-8.4917 2.5917-11.525-.6917S.9417 7.275 4.1083 4.1083C7.2667.9417 12.3667.8417 15.65 3.875s3.5917 8.1167.6917 11.525Z"/>',Xl=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${po}</svg>`,ho='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M15.0833 14.8083c1.2333-1.3 1.9083-3.0333 1.9083-4.825-.0083-3.325-2.35-6.1833-5.6083-6.8417C8.125 2.4833 4.85 4.2 3.55 7.2583c-1.3 3.0583-.275 6.6083 2.4583 8.5 2.725 1.8917 6.4167 1.6 8.8167-.6917.0917-.0833.175-.175.2583-.2583Zm1.2583.5917 2.575 2.575c-.3167.3167-.625.625-.9417.9417-.8583-.8583-1.7167-1.7167-2.575-2.575-3.4083 2.9-8.4917 2.5917-11.525-.6917C.8417 12.3667.9417 7.275 4.1083 4.1083 7.2667.9417 12.3667.8417 15.65 3.875s3.5917 8.1167.6917 11.525Zm-3.55-2.6083V7.2083H7.2083v5.5833h5.5833ZM5.875 5.875h8.25v8.25H5.875V5.875Z"/></svg>',$l='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="m434.8 137.65l-149.36-68.1c-16.19-7.4-42.69-7.4-58.88 0L77.3 137.65c-17.6 8-17.6 21.09 0 29.09l148 67.5c16.89 7.7 44.69 7.7 61.58 0l148-67.5c17.52-8 17.52-21.1-.08-29.09M160 308.52l-82.7 37.11c-17.6 8-17.6 21.1 0 29.1l148 67.5c16.89 7.69 44.69 7.69 61.58 0l148-67.5c17.6-8 17.6-21.1 0-29.1l-79.94-38.47"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="m160 204.48l-82.8 37.16c-17.6 8-17.6 21.1 0 29.1l148 67.49c16.89 7.7 44.69 7.7 61.58 0l148-67.49c17.7-8 17.7-21.1.1-29.1L352 204.48"/></svg>',Vl='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><rect x="2" y="2" width="8.2" height="5" rx="1.2" fill="currentColor"/><rect x="2" y="8.5" width="8.2" height="9.5" rx="1.2" fill="currentColor"/><rect x="11.7" y="2" width="6.3" height="10" rx="1.2" fill="currentColor"/><rect x="11.7" y="13.5" width="6.3" height="4.5" rx="1.2" fill="currentColor"/></svg>',Yl='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M1.5 7h17v6h-17ZM4.25 7h1v2.5h-1ZM7.5 7h.75v1.5H7.5ZM10.25 7h1v2.5h-1ZM13.5 7h.75v1.5H13.5ZM16.25 7h1v2.5h-1Z"/></svg>',Gl='<path fill="currentColor" fill-rule="evenodd" d="M2.25 15h15.5v3.4H2.25Zm1.5 0h.7v1.45h-.7Zm2.95 0h.7v1.45h-.7Zm2.95 0h.7v1.45h-.7Zm2.95 0h.7v1.45h-.7Zm2.95 0h.7v1.45h-.7Z"/>',S="var(--el-color-primary, var(--ml-ui-accent, #409eff))";function ge(e){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${e}${Gl}</svg>`}const jl=ge(`<rect fill="${S}" x="2.9" y="2.5" width="1.25" height="8.8" rx=".2"/><rect fill="${S}" x="15.85" y="2.5" width="1.25" height="8.8" rx=".2"/><path fill="${S}" d="M4.4 6.9 7.2 5.05v3.7Z"/><path fill="${S}" d="M15.6 6.9 12.8 5.05v3.7Z"/><rect fill="${S}" x="6.7" y="6.25" width="6.6" height="1.3"/>`),Zl=ge(`<rect fill="${S}" x="2.9" y="2.5" width="1.25" height="8.8" rx=".2"/><rect fill="${S}" x="15.85" y="2.5" width="1.25" height="8.8" rx=".2"/><path fill="${S}" d="M4.4 6.9 7.2 5.05v3.7Z"/><path fill="${S}" d="M15.6 6.9 12.8 5.05v3.7Z"/><rect fill="${S}" x="6.7" y="6.25" width="6.6" height="1.3"/><circle fill="currentColor" cx="10" cy="3.45" r="2.2"/><text x="10" y="4.42" text-anchor="middle" font-size="3.15" font-weight="700" font-family="Arial,Helvetica,sans-serif" fill="${S}">n</text>`),Kl=ge(`<g fill="none" stroke="${S}" stroke-linejoin="miter"><path stroke-width="1.55" stroke-linecap="butt" d="M16.9 12.25H4.9L11.6 3.03"/><path stroke-width="1.7" stroke-linecap="butt" d="M11.05 12.25A6.15 6.15 0 0 0 8.51 7.27"/></g><path fill="${S}" d="M11.05 12.25 9.85 10.55h2.4Z"/><path fill="${S}" d="M8.51 7.27 10.46 7.39 9.23 9.09Z"/>`),Wl=ge(`<path fill="${S}" d="M5 12V4.2A7.8 7.8 0 0 1 12.8 12Z"/>`),ql=ge(`<g fill="none" stroke-linejoin="miter"><path stroke="currentColor" stroke-width="1.5" stroke-linecap="butt" d="M4.9 11.6A8.3 8.3 0 0 1 13.2 3.3"/><path stroke="currentColor" stroke-width="1.35" stroke-linecap="square" d="M10.4 11.6H13.2V8.8"/><path stroke="currentColor" stroke-width="1.35" stroke-linecap="butt" d="M13.2 11.6v1.7"/><rect stroke="${S}" stroke-width="1.15" x="3.65" y="10.35" width="2.5" height="2.5"/><rect stroke="${S}" stroke-width="1.15" x="11.95" y="2.05" width="2.5" height="2.5"/></g>`),Jl=ge(`<circle fill="none" stroke="${S}" stroke-width="1.4" cx="9.1" cy="7.3" r="4.7"/><circle fill="${S}" cx="9.1" cy="7.3" r="1.05"/><path fill="none" stroke="${S}" stroke-width="1.35" stroke-linecap="round" d="M9.1 7.3 13.35 3.7"/><path fill="${S}" d="M13.35 3.7 11.15 4.2 12.55 5.7Z"/>`),Ql=ge(`<g fill="none" stroke="${S}" stroke-linecap="round" stroke-linejoin="round"><path stroke-width="1.4" d="M4 4.8v7.4h7.6"/><path stroke-width="1.2" stroke-dasharray="1.7 1.2" d="M4 6.9h7M11 12.2V6.9"/></g><path fill="${S}" d="M4 2.5 2.45 4.8h3.1ZM13.8 12.2 11.5 10.7v3Z"/><circle fill="${S}" cx="11" cy="6.9" r="1.3"/>`),go='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512" fill="currentColor" aria-hidden="true"><path d="M 459.5 0 L 475.5 0 L 476.5 1 L 479.5 1 L 485.5 3 Q 487.8 6.2 492.5 7 L 501 14.5 L 505 19.5 L 511 32.5 Q 510.2 35.8 512 36.5 L 512 52.5 L 511 53.5 L 511 56.5 L 509 62.5 L 506 68.5 L 493 89.5 L 483 108.5 L 478 115.5 L 472 127.5 L 467 134.5 L 457 153.5 L 452 160.5 L 442 179.5 L 437 186.5 L 431 198.5 L 440 213.5 L 440 215.5 L 443 220.5 L 447 232.5 L 448 240.5 L 449 241.5 L 449 245.5 L 450 246.5 L 450 254.5 L 451 255.5 L 451 274.5 L 450 275.5 L 450 283.5 L 449 284.5 L 449 289.5 L 448 290.5 L 448 294.5 L 447 295.5 L 446 302.5 L 442 314.5 L 438 322.5 L 438 324.5 L 428 345.5 L 428 347.5 L 425 352.5 L 422 361.5 L 418 368.5 L 418 370.5 L 415 375.5 L 412 384.5 L 408 391.5 L 408 393.5 L 405 398.5 L 402 407.5 L 398 414.5 L 395 423.5 L 391 430.5 L 391 432.5 L 381 453.5 L 381 455.5 L 378 460.5 L 375 469.5 L 371 476.5 L 368 485.5 L 361.5 497 L 353.5 501 L 348.5 501 L 347.5 500 L 344.5 500 L 329.5 495 L 326.5 493 L 321.5 492 L 318.5 490 L 303.5 485 L 289.5 478 L 287.5 478 L 282 473.5 L 279 467.5 L 279 459.5 L 280 458.5 L 280 455.5 L 281 454.5 L 281 451.5 L 282 450.5 L 283 442.5 L 284 441.5 L 286 431.5 L 285.5 431 L 281.5 435 L 259.5 455 L 255.5 457 L 246.5 457 L 223.5 444 L 189.5 421 L 155.5 394 L 133 373.5 L 130 367.5 L 130 359.5 L 134 352.5 L 223 233.5 L 242 206.5 L 254.5 192 L 271.5 177 L 285.5 168 L 299.5 161 L 314.5 156 L 317.5 156 L 318.5 155 L 330.5 154 L 331.5 153 L 352.5 153 L 354 151.5 L 356 146.5 L 372 120.5 L 374 115.5 L 387 94.5 L 397 75.5 L 402 68.5 L 408 56.5 L 413 49.5 L 423 30.5 L 431 17.5 L 439.5 9 L 449.5 3 L 455.5 1 L 458.5 1 L 459.5 0 Z M 466 30 L 459 33 L 454 39 L 448 51 L 443 58 L 433 77 L 428 84 L 414 110 L 409 117 L 407 122 L 405 124 L 403 129 L 401 131 L 399 136 L 384 161 L 386 162 L 388 162 L 396 166 L 409 175 L 422 153 L 424 148 L 429 141 L 431 136 L 433 134 L 435 129 L 437 127 L 439 122 L 444 115 L 454 96 L 459 89 L 469 70 L 474 63 L 482 47 L 482 43 L 480 38 L 475 32 L 469 30 L 466 30 Z M 333 183 L 332 184 L 328 184 L 327 185 L 324 185 L 323 186 L 320 186 L 314 188 L 300 195 L 286 205 L 271 220 L 267 225 L 266 228 L 410 310 L 412 307 L 412 305 L 416 296 L 418 285 L 419 284 L 419 279 L 420 278 L 420 252 L 419 251 L 419 246 L 417 241 L 417 238 L 411 224 L 402 211 L 389 198 L 371 188 L 362 185 L 352 184 L 351 183 L 333 183 Z M 248 252 L 195 322 L 193 326 L 172 353 L 167 361 L 194 384 L 228 409 L 249 422 L 256 417 L 303 372 L 310 368 L 318 368 L 322 370 L 328 378 Q 327 381 329 382 L 329 386 L 326 395 L 326 399 L 323 408 L 323 411 L 322 412 L 322 416 L 319 425 L 319 428 L 318 429 L 318 432 L 317 433 L 317 437 L 314 446 L 314 449 L 313 450 L 313 453 L 312 454 L 316 456 L 318 456 L 331 462 L 343 466 L 351 448 L 351 446 L 354 441 L 354 439 L 357 434 L 357 432 L 364 418 L 364 416 L 367 411 L 367 409 L 370 404 L 370 402 L 377 388 L 377 386 L 380 381 L 380 379 L 383 374 L 383 372 L 387 365 L 390 356 L 393 351 L 393 349 L 396 344 L 397 339 L 375 326 L 373 324 L 368 322 L 366 320 L 361 318 L 354 313 L 349 311 L 347 309 L 342 307 L 340 305 L 335 303 L 321 294 L 316 292 L 314 290 L 309 288 L 307 286 L 302 284 L 295 279 L 276 269 L 248 252 Z "/><path d="M 170.5 100 L 179.5 100 Q 185 102 188 106.5 L 190 110.5 L 190 134.5 L 184.5 142 L 177.5 145 L 171.5 145 L 166.5 143 L 162 138.5 L 159 129.5 L 159 115.5 L 160 114.5 Q 159.2 109.7 161 107.5 L 166.5 102 L 170.5 100 Z "/><path d="M 131.5 140 L 151.5 140 L 156.5 142 L 162 147.5 L 164 151.5 L 164 159.5 L 163 162.5 L 158.5 168 L 152.5 171 L 130.5 171 L 124.5 168 L 122 165.5 L 119 159.5 L 119 151.5 Q 121.3 145.3 126.5 142 L 131.5 140 Z "/><path d="M 197.5 140 L 218.5 140 L 223.5 142 L 228 146.5 L 231 152.5 L 231 158.5 L 229 163.5 L 223.5 169 L 218.5 171 L 197.5 171 L 192.5 169 L 188 164.5 L 186 160.5 L 185 153.5 L 188 146.5 L 191.5 143 L 197.5 140 Z "/><path d="M 171.5 166 L 177.5 166 L 180.5 167 L 187 171.5 L 190 176.5 L 190 200.5 Q 188 206 183.5 209 L 179.5 211 L 173.5 212 L 167.5 210 L 161 203.5 Q 159.2 201.3 160 196.5 L 159 195.5 L 159 181.5 L 162 172.5 L 165.5 169 L 171.5 166 Z "/><path d="M 50.5 223 L 60.5 223 L 68 228.5 L 71 234.5 L 71 256.5 Q 69.1 262.6 64.5 266 L 59.5 268 L 51.5 268 Q 45.3 265.7 42 260.5 L 40 255.5 L 40 235.5 L 42 230.5 L 48.5 224 L 50.5 223 Z "/><path d="M 13.5 263 L 30.5 263 Q 31.5 265 35.5 264 L 43 270.5 L 45 274.5 L 45 282.5 Q 43.1 288.6 38.5 292 L 33.5 294 L 10.5 294 Q 5 292 2 287.5 L 0 283.5 L 0 274.5 Q 2.3 268.3 7.5 265 L 13.5 263 Z "/><path d="M 80.5 263 L 97.5 263 L 103.5 265 L 108 268.5 L 111 273.5 L 112 279.5 L 109 287.5 L 104.5 292 L 100.5 294 L 77.5 294 Q 71.3 291.7 68 286.5 L 66 281.5 L 66 276.5 L 69 269.5 L 72.5 266 L 80.5 263 Z "/><path d="M 54.5 289 L 61.5 290 L 69 296.5 L 71 301.5 L 71 322.5 L 69 327.5 L 63.5 333 L 58.5 335 L 53.5 335 L 46.5 332 L 43 328.5 L 40 321.5 L 40 302.5 Q 41.8 301.8 41 298.5 L 46.5 292 L 54.5 289 Z "/><path d="M 98.5 400 L 107.5 402 L 113 407.5 L 115 411.5 L 115 434.5 Q 112.7 440.7 107.5 444 L 101.5 446 L 96.5 446 L 90.5 443 L 87 439.5 L 84 430.5 L 84 415.5 L 85 414.5 Q 84.3 410.3 86 408.5 L 92.5 402 L 98.5 400 Z "/><path d="M 55.5 441 L 77.5 441 L 80.5 442 L 86 446.5 L 89 451.5 L 89 460.5 Q 86.7 466.7 81.5 470 L 76.5 472 L 56.5 472 L 51.5 470 L 46 464.5 L 44 460.5 L 44 452.5 L 45 449.5 L 49.5 444 L 55.5 441 Z "/><path d="M 121.5 441 L 144.5 441 Q 150.7 443.3 154 448.5 L 156 453.5 L 156 458.5 L 154 464.5 L 148.5 470 L 146.5 470 L 143.5 472 L 122.5 472 L 116.5 469 L 113 465.5 L 111 461.5 L 110 455.5 Q 112 454.5 111 450.5 L 117.5 443 L 121.5 441 Z "/><path d="M 96.5 467 L 103.5 467 L 106.5 468 L 113 473.5 L 115 478.5 L 115 501.5 Q 113 507 108.5 510 L 104.5 512 L 95.5 512 Q 89.3 509.7 86 504.5 Q 84.3 502.7 85 498.5 L 84 497.5 L 84 482.5 L 87 473.5 L 91.5 469 L 96.5 467 Z "/></svg>',ec=go,tc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7" fill="currentColor"/><rect x="14" y="14" width="7" height="7" fill="none" stroke="currentColor" stroke-width="1"/><path d="M12 4a8 8 0 0 1 7.25 7.25" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><path d="M20.75 10 L17.25 10 L19 12.5 Z" fill="currentColor"/><path d="M12 20a8 8 0 0 1-8-8" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"/><path d="M6 14 L2.5 14 L4 11 Z" fill="currentColor"/></svg>',nc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" style="fill:none"><g fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12.4 3.25H5.5A2.25 2.25 0 0 0 3.25 5.5v9A2.25 2.25 0 0 0 5.5 16.75h9A2.25 2.25 0 0 0 16.75 14.5V8.6"/><g transform="rotate(45 13.2 6.7)"><rect x="11.7" y="1.55" width="3" height="7.45" rx="1.45"/><path d="M11.7 3.2h3"/><path d="M11.7 9 13.2 12.15 14.7 9"/><rect x="12.8" y="7.05" width="0.8" height="1.2" rx="0.4"/></g></g></svg>',rc='<path fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="butt" stroke-linejoin="miter" d="M2.6 6.8v8.5h5.2l2.2 2.4 2.2-2.4h5.2"/>',wo='<g fill="none" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round" transform="rotate(46 14.8 9)"><rect x="13.65" y="4.7" width="2.3" height="5.6" rx="1.05"/><path d="M13.65 10.3 14.8 12.9 15.95 10.3"/></g>';function Ee(e){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${rc}${e}</svg>`}const ac=Ee('<path fill="currentColor" d="M6.4 12.2c-1.85 0-3.3-1.25-3.3-2.85 0-1.35.95-2.5 2.3-2.8.45-1.7 1.95-2.85 3.7-2.85 1.25 0 2.35.55 3.05 1.45.55-.7 1.45-1.15 2.5-1.15 1.85 0 3.25 1.3 3.25 2.95 0 .3-.05.55-.1.8 1.2.4 2.05 1.4 2.05 2.65 0 1.55-1.5 2.8-3.4 2.8H6.4Z"/>'),oc=Ee(`<rect fill="none" stroke="currentColor" stroke-width="1.35" x="5" y="2.8" width="8.2" height="7.2"/><rect fill="${S}" x="4.2" y="2" width="2" height="2"/><rect fill="${S}" x="12.2" y="9" width="2" height="2"/>${wo}`),ic=Ee(`<ellipse fill="none" stroke="currentColor" stroke-width="1.35" cx="9" cy="6.6" rx="4" ry="3.6"/><rect fill="${S}" x="8" y="2.1" width="2" height="2"/><rect fill="${S}" x="4" y="5.6" width="2" height="2"/>${wo}`),sc=Ee('<path fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" d="M4.4 12.6 10.2 7"/><rect fill="currentColor" x="10.2" y="1.2" width="7.8" height="5.8" rx=".35"/>'),lc=Ee('<path fill="currentColor" fill-rule="evenodd" d="M10 2.2 15.3 13.1h-2.2l-1.05-2.95H7.95L6.9 13.1H4.7L10 2.2Zm0 3.4-1.15 3.2h2.3L10 5.6Z"/>'),cc=Ee('<g transform="rotate(-40 10 7.6)" fill="currentColor"><path d="M3.5 6.75h9V5.15L16.7 7.6 12.5 10.05V8.45h-9Z"/></g>'),dc=er("M624 475.968V640h144a128 128 0 0 1 128 128H128a128 128 0 0 1 128-128h144V475.968a192 192 0 1 1 224 0M128 896v-64h768v64z"),yo=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><rect x="3.5" y="3" width="13" height="14" rx="1.5" fill="none" stroke="currentColor" stroke-width="1.5"/><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M3.5 6.5h13"/><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M6.5 9.5h7M6.5 12h7M6.5 14.5h3.2"/><g fill="none" stroke="${S}" stroke-width="1.7" stroke-linecap="round"><circle cx="14.5" cy="14.7" r="4.2"/><path d="M17.5 17.7 19.5 19.7"/></g></svg>`,uc=yo,mc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" aria-hidden="true"><path stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round" d="M4.5 2h6.4L15.5 6.6V16.5A1.5 1.5 0 0 1 14 18H4.5A1.5 1.5 0 0 1 3 16.5V3.5A1.5 1.5 0 0 1 4.5 2z"/><path stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round" d="M10.9 2v4.6h4.6"/><path stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M10 5.8v6M7.2 9.6 10 12.5l2.8-2.9"/></svg>',fc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" aria-hidden="true"><path stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round" d="M15.5 2H9.1L4.5 6.6V16.5A1.5 1.5 0 0 0 6 18h9.5A1.5 1.5 0 0 0 17 16.5V3.5A1.5 1.5 0 0 0 15.5 2z"/><path stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round" d="M9.1 2v4.6H4.5"/><path stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M10 14.2V8M7.2 10.4 10 7.5l2.8 2.9"/></svg>',pc=go,hc=er("M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"),gc=er("M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176","M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"),wc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="m18.5 10 4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301 14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725 16.676 16.676 0 0 1 3.524 17.273l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877 16.165 16.165 0 0 0 11.91 6.001L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"/></svg>',yc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><circle cx="10" cy="10" r="4" fill="currentColor"/><path fill="none" stroke="currentColor" stroke-width="1.5" d="M10 2v2M10 16v2M2 10h2M16 10h2M4.2 4.2l1.4 1.4M14.4 14.4l1.4 1.4M4.2 15.8l1.4-1.4M14.4 5.6l1.4-1.4"/></svg>',vc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10 3a7 7 0 1 0 0 14 9 9 0 0 1 0-14Z"/></svg>',bc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" d="M10 6.5 5.5 11h9L10 6.5Z"/></svg>',xc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" d="M10 13.5 14.5 9h-9L10 13.5Z"/></svg>',vo='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10 2.6 18 9.8h-2.1V17h-4.4v-4.4H8.5V17H4.1V9.8H2L10 2.6Zm0 1.8L5.3 9.8V15.8h2V11.4h5.4v4.4h2V9.8L10 4.4Z"/></svg>',kc=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">${po}<path fill="${S}" d="M14.85 0.85 15.95 4.05 19.15 5.15 15.95 6.25 14.85 9.45 13.75 6.25 10.55 5.15 13.75 4.05Z"/><path fill="${S}" d="M17.55 8.35 18.15 10.15 19.95 10.75 18.15 11.35 17.55 13.15 16.95 11.35 15.15 10.75 16.95 10.15Z"/></svg>`,Ac='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M8.08 2.1h3.84l.32 1.52a6.4 6.4 0 0 1 1.36.78l1.48-.64 1.92 1.92-.64 1.48c.3.42.54.88.78 1.36l1.52.32v3.84l-1.52.32a6.4 6.4 0 0 1-.78 1.36l.64 1.48-1.92 1.92-1.48-.64a6.4 6.4 0 0 1-1.36.78l-.32 1.52H8.08l-.32-1.52a6.4 6.4 0 0 1-1.36-.78l-1.48.64-1.92-1.92.64-1.48a6.4 6.4 0 0 1-.78-1.36L1.34 11.92V8.08l1.52-.32c.24-.48.48-.94.78-1.36l-.64-1.48 1.92-1.92 1.48.64c.42-.3.88-.54 1.36-.78L8.08 2.1ZM10 7.2A2.8 2.8 0 1 0 10 12.8 2.8 2.8 0 0 0 10 7.2Z"/></svg>',Lc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="none" stroke="currentColor" stroke-width="1.5" d="M10 2.5v6M7 5.5h6"/><circle cx="10" cy="14.5" r="3.2" fill="none" stroke="currentColor" stroke-width="1.5"/><circle cx="10" cy="14.5" r="1.1" fill="currentColor"/></svg>',Ec='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10.09 3.53 16.09 6.97 10.09 10.29 4.18 7 10.09 3.56M10.09 2.4 2.17 7 3.31 7.65 10.09 11.45 17 7.62 18.17 7 10.08 2.37 10.09 2.4Z"/><path fill="currentColor" d="M10.25 14.83 18.17 10.22 17 9.57 10.22 13.57 3.32 9.59 2.17 10.22 10.25 14.83Z"/><path fill="currentColor" d="M10.25 17.63 18.17 13 17 12.37 10.22 16.37 3.32 12.38 2.17 13 10.25 17.63Z"/></svg>',Cc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10.09 5.15 16.09 8.59 10.09 11.91 4.18 8.59 10.09 5.15ZM10.09 4 2.17 8.61 3.31 9.25 10.09 13.06 17 9.24 18.16 8.61 10.08 4 10.09 4Z"/><path fill="currentColor" d="M10.25 16.46 18.17 11.85 17 11.2 10.22 15.2 3.32 11.21 2.17 11.85 10.25 16.46Z"/><path fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" d="M3.5 3.5 16.5 16.5"/></svg>',Sc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M2.25 2.25h4.878v4.878H2.25V2.25Zm.978.978v2.924h2.924V3.228H3.228Z"/><path fill="currentColor" d="M5.175 20.773V7.128H4.204V21.75H21.75V4.204H7.128v.971H20.773v15.598H5.175Z"/></svg>',Mc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M3 2H2v16h16v-1H8v-5H3V2zm0 11v4h4v-4H3z"/></svg>',_c='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M16.98 11L18.5 11L18.5 10L16.98 10C16.86 8.13 16.05 6.44 14.8 5.2L16.88 2.83L16.12 2.17L14.05 4.54C12.79 3.57 11.21 3 9.5 3C5.36 3 2 6.36 2 10.5C2 14.64 5.36 18 9.5 18C13.47 18 16.73 14.91 16.98 11ZM15.98 10C15.86 8.43 15.18 7.01 14.14 5.95L10.6 10L15.98 10ZM13.39 5.29L8.4 11L15.98 11C15.73 14.36 12.92 17 9.5 17C5.91 17 3 14.09 3 10.5C3 6.91 5.91 4 9.5 4C10.96 4 12.31 4.48 13.39 5.29Z"/></svg>',Pc='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="#e75958" d="M22 12H12l5 8.66A10 10 0 0 0 22 12Z"/><path fill="#814dff" d="M17 20.66 12 12 7 20.66A10 10 0 0 0 17 20.66Z"/><path fill="#13b0ce" d="M7 20.66 12 12H2A10 10 0 0 0 7 20.66Z"/><path fill="#4ecd83" d="M2 12H12L7 3.34A10 10 0 0 0 2 12Z"/><path fill="#ffc33f" d="M7 3.34 12 12l5-8.66A10 10 0 0 0 7 3.34Z"/><path fill="#ff9543" d="M17 3.34 12 12H22A10 10 0 0 0 17 3.34Z"/></svg>',Ic=ho,Bc=Ql,Tc=ac,zc=oc,Fc=ic,Oc=hc,bo=gc,Ce={select:Rl,pan:Nl,zoomExtent:Xl,zoomSmart:kc,zoomBox:Ic,measureDistance:jl,measureContinuous:Zl,measureAngle:Kl,measureArc:ql,measureRadius:Jl,measureArea:Wl,measureCoordinate:Bc,clearMeasurements:ec,layer:$l,layout:Vl,zoomWindow:ho,zoomOriginal:vo,zoomSaved:vo,layerOn:Ec,layerOff:Cc,language:wc,osnap:Sc,orthoMode:Mc,polarTracking:_c,color:Pc,chevronUp:bc,chevronDown:xc,measure:Yl,annotation:nc,markupCloud:Tc,markupCallout:sc,markupText:lc,markupRect:zc,markupCircle:Fc,markupArrow:cc,markupStamp:dc,markupPanel:yo,measurementPanel:uc,markupImport:mc,markupExport:fc,markupShow:Oc,markupHide:bo,markupVisibility:bo,clearMarkups:pc,settings:Ac,simulatedMouse:Lc,switchBg:tc,themeLight:yc,themeDark:vc};function tr(e,t,n){const r=Object.entries(n).map(([i,s])=>`${i}="${oe(s)}"`).join(" "),a=n["data-i18n-key"],o=a?`<span class="mlcad-tool-btn-label" data-i18n-key="${oe(a)}" data-i18n-text>${oe(t)}</span>`:"";return`<button type="button" class="mlcad-tool-btn" title="${oe(t)}" aria-label="${oe(t)}" ${r}><span class="mlcad-tool-btn-icon" aria-hidden="true">${e}</span>${o}</button>`}function Hc(e,t,n){const r=Object.entries(n).map(([i,s])=>`${i}="${oe(s)}"`).join(" "),a=n["data-i18n-key"],o=a?` data-i18n-key="${oe(a)}" data-i18n-text`:"";return`<button type="button" class="mlcad-dropdown-item" role="menuitem" title="${oe(t)}" ${r}><span class="mlcad-dropdown-icon" aria-hidden="true">${e}</span><span class="mlcad-dropdown-label"${o}>${oe(t)}</span></button>`}function oe(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}const xo=[90,45,30,23,18,10,5],ko=90,Uc=ko,Dc={en:"toolbar.localeEn",zh:"toolbar.localeZh",cs:"toolbar.localeCs",tr:"toolbar.localeTr",ar:"toolbar.localeAr"},Rc={en:"English",zh:"中文",cs:"Čeština",tr:"Türkçe",ar:"العربية"};function Nc(){return`<div id="mlcad-locale-strip-wrap" hidden>
2
2
  <div id="mlcad-locale-strip" role="toolbar" data-i18n-attr="aria-label" data-i18n-key="toolbar.language" aria-label="Language">
3
- ${he.map(t=>{const n=Dc[t],r=Uc[t],a=Yn[t];return`<button type="button" class="mlcad-tool-btn mlcad-locale-option" data-locale="${t}" data-i18n-key="${r}" data-i18n-attr="title aria-label" title="${n}" aria-label="${n}"><span class="mlcad-tool-btn-icon" aria-hidden="true"><span class="mlcad-locale-option-badge">${a}</span></span><span class="mlcad-tool-btn-label" data-i18n-key="${r}" data-i18n-text>${n}</span></button>`}).join("")}
3
+ ${he.map(t=>{const n=Rc[t],r=Dc[t],a=Yn[t];return`<button type="button" class="mlcad-tool-btn mlcad-locale-option" data-locale="${t}" data-i18n-key="${r}" data-i18n-attr="title aria-label" title="${n}" aria-label="${n}"><span class="mlcad-tool-btn-icon" aria-hidden="true"><span class="mlcad-locale-option-badge">${a}</span></span><span class="mlcad-tool-btn-label" data-i18n-key="${r}" data-i18n-text>${n}</span></button>`}).join("")}
4
4
  </div>
5
5
  </div>`}function nr(){return`<div id="mlcad-polar-angles" role="group" data-i18n-attr="aria-label" data-i18n-key="settings.polarAngles" aria-label="Polar tracking angles" hidden>
6
6
  ${xo.map(t=>`<button type="button" class="mlcad-tool-btn mlcad-settings-option-btn mlcad-polar-angle-btn" data-polar-ang="${t}" title="${t}°" aria-label="${t}°"><span class="mlcad-settings-option-indicator" aria-hidden="true"></span><span class="mlcad-settings-option-text">${t}°</span></button>`).join("")}
7
- </div>`}function Nc(){return`<div id="mlcad-snap-strip-wrap" hidden>
7
+ </div>`}function Xc(){return`<div id="mlcad-snap-strip-wrap" hidden>
8
8
  <div id="mlcad-snap-strip" role="toolbar" data-i18n-attr="aria-label" data-i18n-key="toolbar.snap" aria-label="Object snap">
9
9
  ${tr(Ce.orthoMode,"Orthogonal mode",{id:"mlcad-ortho-btn","data-toggle":"ortho","data-i18n-key":"settings.ortho","data-i18n-attr":"title aria-label"})}
10
10
  ${tr(Ce.polarTracking,"Polar tracking",{id:"mlcad-polar-btn","data-toggle":"polar","data-i18n-key":"settings.polar","data-i18n-attr":"title aria-label"})}
11
11
  </div>
12
12
  ${nr()}
13
- </div>`}const Ao=600,Lo=960,Xt=`
13
+ </div>`}const Ao=600,Lo=960,Eo=1.231,$c=13,$t=`
14
14
  :root {
15
15
  --mlcad-ui-bg: rgba(24, 26, 30, 0.94);
16
16
  --mlcad-ui-bg-elevated: rgba(32, 35, 40, 0.98);
@@ -860,7 +860,8 @@
860
860
  pointer-events: none;
861
861
  }
862
862
  .mlcad-measure-badge--coordinate {
863
- transform: translate(-50%, calc(-50% - 16px));
863
+ /* em so the lift tracks the capsule when text height changes. */
864
+ transform: translate(-50%, calc(-50% - ${Eo}em));
864
865
  }
865
866
  .mlcad-measure-badge.mlcad-measure-selected {
866
867
  /* Hard ring at half original em thickness + soft glow */
@@ -1392,7 +1393,7 @@
1392
1393
  visibility: hidden !important;
1393
1394
  pointer-events: none !important;
1394
1395
  }
1395
- `;function $t(e,t="measure",n=!0){const r=t==="measure"?`${nr()}${$c()}${Xc()}`:"";return`
1396
+ `;function Vt(e,t="measure",n=!0){const r=t==="measure"?`${nr()}${Yc()}${Vc()}`:"";return`
1396
1397
  <div id="mlcad-loading" aria-hidden="true" style="background:${e}">
1397
1398
  <div class="mlcad-loading-spinner"></div>
1398
1399
  <div id="mlcad-access-gate" hidden>
@@ -1446,7 +1447,7 @@
1446
1447
  `}function rr(e,t,n){return`<div class="mlcad-drawer-sheet-chrome">
1447
1448
  <div class="mlcad-drawer-grabber" role="separator" aria-orientation="horizontal"></div>
1448
1449
  <button type="button" class="mlcad-drawer-sheet-close" id="${e}" data-i18n-key="${t}" data-i18n-attr="aria-label" aria-label="${n}">${Ce.chevronDown}</button>
1449
- </div>`}function Xc(){return`<div id="mlcad-review-drawer" role="dialog" data-i18n-attr="aria-label" data-i18n-key="review.title" aria-label="Review" hidden>
1450
+ </div>`}function Vc(){return`<div id="mlcad-review-drawer" role="dialog" data-i18n-attr="aria-label" data-i18n-key="review.title" aria-label="Review" hidden>
1450
1451
  ${rr("mlcad-review-sheet-close","review.close","Close review")}
1451
1452
  <div class="mlcad-drawer-header">
1452
1453
  <span data-i18n-key="review.title" data-i18n-text>Review</span>
@@ -1495,7 +1496,7 @@
1495
1496
  <button type="button" class="mlcad-review-delete" data-i18n-key="review.delete" data-i18n-text>Delete</button>
1496
1497
  </div>
1497
1498
  </div>
1498
- </div>`}function $c(){return`<div id="mlcad-measure-drawer" role="dialog" data-i18n-attr="aria-label" data-i18n-key="measurePanel.title" aria-label="Measurements" hidden>
1499
+ </div>`}function Yc(){return`<div id="mlcad-measure-drawer" role="dialog" data-i18n-attr="aria-label" data-i18n-key="measurePanel.title" aria-label="Measurements" hidden>
1499
1500
  ${rr("mlcad-measure-sheet-close","measurePanel.close","Close measurements")}
1500
1501
  <div class="mlcad-drawer-header">
1501
1502
  <span data-i18n-key="measurePanel.title" data-i18n-text>Measurements</span>
@@ -1523,53 +1524,53 @@
1523
1524
  <tbody></tbody>
1524
1525
  </table>
1525
1526
  </div>
1526
- </div>`}function Vc(e,t){var h;const n=t.title??e.meta.title??"CAD Drawing",r=t.encoded??ta(e),a=t.viewerRuntime,o=aa(),i=r.compression,s=((h=t.accessManifest)==null?void 0:h.encrypted)===!0,l=`#${e.meta.background.toString(16).padStart(6,"0")}`,d=Le(e.meta.locale)??"en",c=e.meta.viewerMode??"measure",u=e.meta.exportLayouts!==!1,f=t.accessManifest?` <script id="mlcad-access" type="application/json">${So(JSON.stringify(t.accessManifest))}<\/script>
1527
- `:"",p=s?`${o}+aes-gcm;base85`:`${o}+${i};base85`;return`<!DOCTYPE html>
1528
- <html lang="${d}">
1527
+ </div>`}function Gc(e,t){var h;const n=t.title??e.meta.title??"CAD Drawing",r=t.encoded??ta(e),a=t.viewerRuntime,o=aa(),i=r.compression,s=((h=t.accessManifest)==null?void 0:h.encrypted)===!0,l=`#${e.meta.background.toString(16).padStart(6,"0")}`,c=Le(e.meta.locale)??"en",d=e.meta.viewerMode??"measure",u=e.meta.exportLayouts!==!1,p=t.accessManifest?` <script id="mlcad-access" type="application/json">${Mo(JSON.stringify(t.accessManifest))}<\/script>
1528
+ `:"",f=s?`${o}+aes-gcm;base85`:`${o}+${i};base85`;return`<!DOCTYPE html>
1529
+ <html lang="${c}">
1529
1530
  <head>
1530
1531
  <meta charset="utf-8" />
1531
1532
  <meta name="viewport" content="width=device-width, initial-scale=1" />
1532
1533
  <meta name="generator" content="mlightcad-cad-html-plugin" />
1533
- <title>${Eo(n)}</title>
1534
- <style>${Xt}</style>
1534
+ <title>${Co(n)}</title>
1535
+ <style>${$t}</style>
1535
1536
  </head>
1536
1537
  <body>
1537
- ${$t(l,c,u)}
1538
- ${f} <script id="mlcad-snapshot" type="${p}">${r.payload}<\/script>
1539
- <script>${Co(a)}<\/script>
1538
+ ${Vt(l,d,u)}
1539
+ ${p} <script id="mlcad-snapshot" type="${f}">${r.payload}<\/script>
1540
+ <script>${So(a)}<\/script>
1540
1541
  </body>
1541
- </html>`}function ar(e,t){var c;const n=t.title??e.meta.title??"CAD Drawing",r=t.viewerRuntime,a=`#${e.meta.background.toString(16).padStart(6,"0")}`,o=Le(e.meta.locale)??"en",i=e.meta.viewerMode??"measure",s=e.meta.exportLayouts!==!1,l=(c=t.manifestUrl)==null?void 0:c.trim(),d=JSON.stringify(l&&l!==Qn?{manifestUrl:l}:{});return`<!DOCTYPE html>
1542
+ </html>`}function ar(e,t){var d;const n=t.title??e.meta.title??"CAD Drawing",r=t.viewerRuntime,a=`#${e.meta.background.toString(16).padStart(6,"0")}`,o=Le(e.meta.locale)??"en",i=e.meta.viewerMode??"measure",s=e.meta.exportLayouts!==!1,l=(d=t.manifestUrl)==null?void 0:d.trim(),c=JSON.stringify(l&&l!==Qn?{manifestUrl:l}:{});return`<!DOCTYPE html>
1542
1543
  <html lang="${o}">
1543
1544
  <head>
1544
1545
  <meta charset="utf-8" />
1545
1546
  <meta name="viewport" content="width=device-width, initial-scale=1" />
1546
1547
  <meta name="generator" content="mlightcad-cad-html-plugin" />
1547
- <title>${Eo(n)}</title>
1548
- <style>${Xt}</style>
1548
+ <title>${Co(n)}</title>
1549
+ <style>${$t}</style>
1549
1550
  </head>
1550
1551
  <body>
1551
- ${$t(a,i,s)}
1552
- <script id="mlcad-package" type="application/json">${So(d)}<\/script>
1553
- <script>${Co(r)}<\/script>
1552
+ ${Vt(a,i,s)}
1553
+ <script id="mlcad-package" type="application/json">${Mo(c)}<\/script>
1554
+ <script>${So(r)}<\/script>
1554
1555
  </body>
1555
- </html>`}function Eo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Co(e){return e.replace(/<\/script/gi,"<\\/script")}function So(e){return e.replace(/</g,"\\u003c")}const Mo=1,Po=600*1e3,Yc=1e5,Gc=16,or=12,jc={en:"en",zh:"zh-CN",cs:"cs",tr:"tr",ar:"ar"};function Zc(e,t=Date.now(),n){return e==="never"?null:e==="custom"?n??null:t+e*24*60*60*1e3}function ir(e){var n;const t=!!((n=e.password)!=null&&n.trim());return e.expiresAt!=null||t}function Kc(e,t=Date.now()){return e.expiresAt!=null&&t>e.expiresAt}function Wc(e,t=Date.now()){const n=e-t;return n>0&&n<=Po}function qc(e,t="en"){const n=jc[t]??t;try{return new Date(e).toLocaleString(n,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return new Date(e).toISOString()}}function Jc(e){const t=Math.max(0,Math.ceil(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),a=t%60,o=String(r).padStart(2,"0"),i=String(a).padStart(2,"0");return n>0?`${n}:${o}:${i}`:`${r}:${i}`}function Qc(e){const t=e==null?void 0:e.trim();if(!t)return null;try{const n=JSON.parse(t);return(n==null?void 0:n.v)!==Mo?null:n}catch{return null}}function Ke(e){var n;if(!ir(e))return;const t=!!((n=e.password)!=null&&n.trim());return{v:Mo,expiresAt:e.expiresAt,encrypted:t,...t&&e.salt?{salt:e.salt}:{}}}async function Vt(e,t){const n=t!=null&&t.trim()?new Uint8Array(zo(t)):crypto.getRandomValues(new Uint8Array(Gc));return{key:await nd(e,n),salt:To(n)}}async function Yt(e,t){const n=crypto.getRandomValues(new Uint8Array(or)),r=new Uint8Array(t),a=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:n},e,r)),o=new Uint8Array(n.length+a.length);return o.set(n,0),o.set(a,n.length),o}async function Gt(e,t){const n=new Uint8Array(t.subarray(0,or)),r=new Uint8Array(t.subarray(or));return new Uint8Array(await crypto.subtle.decrypt({name:"AES-GCM",iv:n},e,r))}async function _o(e,t,n="base85"){const{key:r,salt:a}=await Vt(e),o=Fe(t,n),i=await Yt(r,o);return{encryptedPayload:be(i,n),salt:a}}async function ed(e,t,n,r="base85"){const{key:a}=await Vt(e,n),o=await Gt(a,Fe(t,r));return be(o,r)}function Io(e){return To(e)}function Bo(e){return zo(e)}async function td(e,t){var r;if(!ir(t))return{encoded:e};const n=(r=t.password)==null?void 0:r.trim();if(n){const{encryptedPayload:a,salt:o}=await _o(n,e.payload);return{encoded:{payload:a,compression:e.compression},manifest:Ke({expiresAt:t.expiresAt,password:n,salt:o})}}return{encoded:e,manifest:Ke({expiresAt:t.expiresAt})}}async function nd(e,t){const n=new TextEncoder,r=await crypto.subtle.importKey("raw",n.encode(e),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:new Uint8Array(t),iterations:Yc,hash:"SHA-256"},r,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}function To(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function zo(e){const t=atob(e.trim()),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const rd=256;function Fo(e,t=Ye){return!(t>0)||At(e)<=t?[e]:e.indices&&e.indices.length>=2?od(e,t):ad(e,t)}function Ho(e,t=Ye){return e.texture?[e]:!(t>0)||Lt(e)<=t?[e]:e.points?sd(e,t):!e.indices||e.indices.length<3?Uo(e,t):cd(e,t)}function Oo(e){return e.linePattern?64+e.linePattern.pattern.length*8:0}function sr(e){return(e.hatchPattern?128:0)+(e.gradientFill?64:0)}function We(e,t,n){const r=e-rd-t;return r<n?1:Math.max(1,Math.floor(r/n))}function ad(e,t){var s;const n=(((s=e.lineDistances)==null?void 0:s.length)??0)>=2,r=24+(n?8:0),a=We(t,Oo(e),r),o=e.positions.length/6|0;if(o<=1)return[e];const i=[];for(let l=0;l<o;l+=a){const d=Math.min(a,o-l),c=l*6,u={layer:e.layer,color:e.color,offset:e.offset,positions:e.positions.slice(c,c+d*6)};if(No(e,u),n&&e.lineDistances){const f=l*2;u.lineDistances=e.lineDistances.slice(f,f+d*2)}i.push(u)}return i.length>0?i:[e]}function od(e,t){var s;const n=e.indices,a=32+((((s=e.lineDistances)==null?void 0:s.length)??0)>0?8:0),o=We(t,Oo(e),a),i=[];for(let l=0;l+1<n.length;){const d=Math.min(o*2,n.length-l),c=d-d%2;if(c<2)break;i.push(id(e,l,c)),l+=c}return i.length>0?i:[e]}function id(e,t,n){const r=Ro(e.positions,e.indices.subarray(t,t+n),e.lineDistances?[e.lineDistances]:[],[1]),a={layer:e.layer,color:e.color,offset:e.offset,positions:r.positions,indices:r.indices};return No(e,a),r.attributes[0]&&r.attributes[0].length>0&&(a.lineDistances=r.attributes[0]),a}function sd(e,t){return e.indices&&e.indices.length>0?ld(e,t):Uo(e,t)}function ld(e,t){const n=e.indices,r=16+(e.uvs?8:0)+(e.gradientPositions?8:0),a=We(t,sr(e),r),o=[];for(let i=0;i<n.length;){const s=Math.min(a,n.length-i);if(s<1)break;o.push(Do(e,i,s)),i+=s}return o.length>0?o:[e]}function Uo(e,t){const n=e.positions.length/3|0;if(n<=1)return[e];const r=12+(e.uvs?8:0)+(e.gradientPositions?8:0),a=We(t,sr(e),r),o=e.points?1:3,i=Math.max(o,a-a%o),s=[];for(let l=0;l<n;l+=i){const d=Math.min(i,n-l),c=d-d%o;if(c<o)break;s.push(dd(e,l,c))}return s.length>0?s:[e]}function cd(e,t){const n=e.indices,r=48+(e.uvs?24:0)+(e.gradientPositions?24:0),a=We(t,sr(e),r),o=[];for(let i=0;i+2<n.length;){const s=Math.min(a*3,n.length-i),l=s-s%3;if(l<3)break;o.push(Do(e,i,l)),i+=l}return o.length>0?o:[e]}function dd(e,t,n){const r=t*3,a={layer:e.layer,color:e.color,offset:e.offset,positions:e.positions.slice(r,r+n*3)};return Xo(e,a),e.uvs&&(a.uvs=e.uvs.slice(t*2,(t+n)*2)),e.gradientPositions&&(a.gradientPositions=e.gradientPositions.slice(t*2,(t+n)*2)),a}function Do(e,t,n){const r=[],a=[];e.uvs&&(r.push(e.uvs),a.push(2)),e.gradientPositions&&(r.push(e.gradientPositions),a.push(2));const o=Ro(e.positions,e.indices.subarray(t,t+n),r,a),i={layer:e.layer,color:e.color,offset:e.offset,positions:o.positions,indices:o.indices};Xo(e,i);let s=0;return e.uvs&&(i.uvs=o.attributes[s++]),e.gradientPositions&&(i.gradientPositions=o.attributes[s]),i}function Ro(e,t,n,r){const a=new Map,o=[],i=new Uint32Array(t.length),s=n.map(()=>[]);for(let l=0;l<t.length;l++){const d=t[l];let c=a.get(d);if(c==null){c=a.size,a.set(d,c);const u=d*3;o.push(e[u]??0,e[u+1]??0,e[u+2]??0);for(let f=0;f<n.length;f++){const p=r[f],h=n[f],g=d*p;for(let y=0;y<p;y++)s[f].push(h[g+y]??0)}}i[l]=c}return{positions:Float32Array.from(o),indices:i,attributes:s.map(l=>Float32Array.from(l))}}function No(e,t){e.linePattern&&(t.linePattern=e.linePattern),e.lineWidth!=null&&(t.lineWidth=e.lineWidth),e.renderOrder!=null&&(t.renderOrder=e.renderOrder),e.excludeFromOsnap&&(t.excludeFromOsnap=!0)}function Xo(e,t){e.hatchPattern&&(t.hatchPattern=e.hatchPattern),e.gradientFill&&(t.gradientFill=e.gradientFill),e.side!=null&&(t.side=e.side),e.renderOrder!=null&&(t.renderOrder=e.renderOrder),e.points&&(t.points=!0)}function $o(e,t,n=Ye){const r=[];let a={lineBatches:[],meshBatches:[],estimatedBytes:64};const o=()=>{a.lineBatches.length===0&&a.meshBatches.length===0&&r.length>0||(r.push(a),a={lineBatches:[],meshBatches:[],estimatedBytes:64})},i=d=>{const c=At(d);a.estimatedBytes+c>t&&(a.lineBatches.length>0||a.meshBatches.length>0)&&o(),a.lineBatches.push(d),a.estimatedBytes+=c},s=d=>{const c=Lt(d);a.estimatedBytes+c>t&&(a.lineBatches.length>0||a.meshBatches.length>0)&&o(),a.meshBatches.push(d),a.estimatedBytes+=c},l=Math.min(t,n);for(const d of e.lineBatches)for(const c of Fo(d,l))i(c);for(const d of e.meshBatches)for(const c of Ho(d,l))s(c);return(r.length===0||a.lineBatches.length>0||a.meshBatches.length>0)&&o(),r.length===0&&r.push({lineBatches:[],meshBatches:[],estimatedBytes:64}),r}function Vo(e,t){if(e.version!==D)throw new Error(`Unsupported snapshot version: ${e.version}`);const n=t.maxChunkBytes??eo,r=t.maxBatchBytes??Ye,a=t.maxOsnapChunkBytes??n,o=t.compressChunks!==!1,i=o?"acex.gz":"acex",s=o?"osnap.gz":"osnap",l=ne,d=hd(e.layouts,e.activeLayoutBtrId),c=[],u=[],f=new Map;return d.forEach((p,h)=>{var A;f.set(p.btrId,h);const g=$o(p,n,r),y=[];g.forEach((k,M)=>{const C=`L${h}-${String(M).padStart(3,"0")}`,P=`chunks/${C}.${i}`;y.push(C),c.push({kind:"geometry",id:C,href:P,layoutBtrId:p.btrId,lineBatchCount:k.lineBatches.length,meshBatchCount:k.meshBatches.length,chunk:{version:D,layoutBtrId:p.btrId,lineBatches:k.lineBatches,meshBatches:k.meshBatches}})});const b={btrId:p.btrId,name:p.name,isModelSpace:p.isModelSpace,viewports:p.viewports,...p.savedView?{savedView:p.savedView}:{},chunkIds:y},w=(A=p.osnap)==null?void 0:A.primitives;if(w&&w.length>0){const k=Zr(w,a),M=[];k.forEach((C,P)=>{const L=`L${h}-osnap-${String(P).padStart(3,"0")}`,x=`chunks/${L}.${s}`;M.push(L),c.push({kind:"osnap",id:L,href:x,layoutBtrId:p.btrId,primitiveCount:C.length,primitives:C})}),b.osnapChunkIds=M}u.push(b)}),{jobs:c,layoutRefs:u,layoutIndexByBtrId:f,manifestFileName:l,compressChunks:o}}function Yo(e,t,n,r,a){var g,y;const o=[],i=[],s=[];for(const b of a){const{job:w,uncompressedByteLength:A,compressed:k}=b;s.push({path:w.href,bytes:k}),w.kind==="geometry"?o.push({id:w.id,href:w.href,layoutBtrId:w.layoutBtrId,byteLength:A,compressedByteLength:k.byteLength,lineBatchCount:w.lineBatchCount,meshBatchCount:w.meshBatchCount}):i.push({id:w.id,href:w.href,layoutBtrId:w.layoutBtrId,byteLength:A,compressedByteLength:k.byteLength,primitiveCount:w.primitiveCount})}const l=e.layouts.map(b=>{const w=n.get(b.btrId);return t[w]}),d=new Set(((g=l.find(b=>b.btrId===e.activeLayoutBtrId))==null?void 0:g.chunkIds)??[]),c=[...o.filter(b=>d.has(b.id)),...o.filter(b=>!d.has(b.id))],u=new Set(((y=l.find(b=>b.btrId===e.activeLayoutBtrId))==null?void 0:y.osnapChunkIds)??[]),f=[...i.filter(b=>u.has(b.id)),...i.filter(b=>!u.has(b.id))],p={format:"acex-package",packageVersion:Wn,snapshotVersion:D,meta:e.meta,layers:e.layers,activeLayoutBtrId:e.activeLayoutBtrId,layouts:l,chunks:c,...f.length>0?{osnapChunks:f}:{}},h=`${JSON.stringify(p)}
1556
- `;return s.unshift({path:r,bytes:ye(h)}),{manifest:p,manifestFileName:r,files:s}}function ud(e,t){if(e.kind==="geometry"){if(!t){const i=Ve(e.chunk);return{job:e,uncompressedByteLength:i.byteLength,compressed:i}}const{uncompressed:a,compressed:o}=Ja(e.chunk);return{job:e,uncompressedByteLength:a.byteLength,compressed:o}}if(!t){const a=xe({primitives:e.primitives});return{job:e,uncompressedByteLength:a.byteLength,compressed:a}}const{uncompressed:n,compressed:r}=Kr({primitives:e.primitives});return{job:e,uncompressedByteLength:n.byteLength,compressed:r}}async function md(e,t){if(e.kind==="geometry"){if(!t){const i=Ve(e.chunk);return{job:e,uncompressedByteLength:i.byteLength,compressed:i}}const{uncompressed:a,compressed:o}=await Cl(e.chunk);return{job:e,uncompressedByteLength:a.byteLength,compressed:o}}if(!t){const a=xe({primitives:e.primitives});return{job:e,uncompressedByteLength:a.byteLength,compressed:a}}const{uncompressed:n,compressed:r}=await os({primitives:e.primitives});return{job:e,uncompressedByteLength:n.byteLength,compressed:r}}function Go(e,t={}){const{jobs:n,layoutRefs:r,layoutIndexByBtrId:a,manifestFileName:o,compressChunks:i}=Vo(e,t),s=n.map(l=>ud(l,i));return Yo(e,r,a,o,s)}async function lr(e,t={}){const{jobs:n,layoutRefs:r,layoutIndexByBtrId:a,manifestFileName:o,compressChunks:i}=Vo(e,t),s=await Promise.all(n.map(l=>md(l,i)));return Yo(e,r,a,o,s)}function pd(e,t){const n=Go(e,t),r=ar(e,{title:e.meta.title,viewerRuntime:t.viewerRuntime,...t.manifestUrl?{manifestUrl:t.manifestUrl}:{}});return{html:r,manifest:n.manifest,manifestFileName:n.manifestFileName,files:[{path:"viewer.html",bytes:ye(r)},...n.files]}}async function fd(e,t){const n=await lr(e,t),r=ar(e,{title:e.meta.title,viewerRuntime:t.viewerRuntime,...t.manifestUrl?{manifestUrl:t.manifestUrl}:{}});return{html:r,manifest:n.manifest,manifestFileName:n.manifestFileName,files:[{path:"viewer.html",bytes:ye(r)},...n.files]}}function hd(e,t){const n=e.find(a=>a.btrId===t),r=e.filter(a=>a.btrId!==t);return n?[n,...r]:[...e]}const jo="application/vnd.mlightcad.acex-chunk;base85",gd="application/vnd.mlightcad.acex-chunk;base64",Zo="application/vnd.mlightcad.acex-chunk+aes-gcm;base85",wd="application/vnd.mlightcad.acex-chunk+aes-gcm;base64",ie="data-acex-href";function Ko(e){var n;let t=0;for(const r of e.layouts){for(const o of r.lineBatches)t+=At(o);for(const o of r.meshBatches)t+=Lt(o);const a=(n=r.osnap)==null?void 0:n.primitives;if(a)for(const o of a)t+=Ln(o)}return t}function yd(e,t=to){return Ko(e)>=t}async function vd(e,t){var y;const n=t.title??e.meta.title??"CAD Drawing",r=t.viewerRuntime,a=`#${e.meta.background.toString(16).padStart(6,"0")}`,o=Le(e.meta.locale)??"en",i=e.meta.viewerMode??"measure",s=e.meta.exportLayouts!==!1,l=t.expiresAt??null,d=((y=t.password)==null?void 0:y.trim())||void 0,c={maxChunkBytes:t.maxChunkBytes??qn,maxBatchBytes:t.maxBatchBytes??t.maxChunkBytes??qn,maxOsnapChunkBytes:t.maxOsnapChunkBytes??no},u=await lr(e,c);let f,p,h;if(d){const{key:b,salt:w}=await Vt(d);f=Ke({expiresAt:l,password:d,salt:w});const A=new TextEncoder().encode(`${JSON.stringify(u.manifest)}
1557
- `),k=await Yt(b,A);p={mode:"embedded",encrypted:!0,encryptedManifest:Io(k)},h=await xd(u.files,b)}else f=Ke({expiresAt:l}),p={mode:"embedded",manifest:u.manifest},h=bd(u.files);const g=f?` <script id="mlcad-access" type="application/json">${ei(JSON.stringify(f))}<\/script>
1556
+ </html>`}function Co(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function So(e){return e.replace(/<\/script/gi,"<\\/script")}function Mo(e){return e.replace(/</g,"\\u003c")}const _o=1,Po=600*1e3,jc=1e5,Zc=16,or=12,Kc={en:"en",zh:"zh-CN",cs:"cs",tr:"tr",ar:"ar"};function Wc(e,t=Date.now(),n){return e==="never"?null:e==="custom"?n??null:t+e*24*60*60*1e3}function ir(e){var n;const t=!!((n=e.password)!=null&&n.trim());return e.expiresAt!=null||t}function qc(e,t=Date.now()){return e.expiresAt!=null&&t>e.expiresAt}function Jc(e,t=Date.now()){const n=e-t;return n>0&&n<=Po}function Qc(e,t="en"){const n=Kc[t]??t;try{return new Date(e).toLocaleString(n,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return new Date(e).toISOString()}}function ed(e){const t=Math.max(0,Math.ceil(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),a=t%60,o=String(r).padStart(2,"0"),i=String(a).padStart(2,"0");return n>0?`${n}:${o}:${i}`:`${r}:${i}`}function td(e){const t=e==null?void 0:e.trim();if(!t)return null;try{const n=JSON.parse(t);return(n==null?void 0:n.v)!==_o?null:n}catch{return null}}function Ke(e){var n;if(!ir(e))return;const t=!!((n=e.password)!=null&&n.trim());return{v:_o,expiresAt:e.expiresAt,encrypted:t,...t&&e.salt?{salt:e.salt}:{}}}async function Yt(e,t){const n=t!=null&&t.trim()?new Uint8Array(Fo(t)):crypto.getRandomValues(new Uint8Array(Zc));return{key:await ad(e,n),salt:zo(n)}}async function Gt(e,t){const n=crypto.getRandomValues(new Uint8Array(or)),r=new Uint8Array(t),a=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:n},e,r)),o=new Uint8Array(n.length+a.length);return o.set(n,0),o.set(a,n.length),o}async function jt(e,t){const n=new Uint8Array(t.subarray(0,or)),r=new Uint8Array(t.subarray(or));return new Uint8Array(await crypto.subtle.decrypt({name:"AES-GCM",iv:n},e,r))}async function Io(e,t,n="base85"){const{key:r,salt:a}=await Yt(e),o=Fe(t,n),i=await Gt(r,o);return{encryptedPayload:be(i,n),salt:a}}async function nd(e,t,n,r="base85"){const{key:a}=await Yt(e,n),o=await jt(a,Fe(t,r));return be(o,r)}function Bo(e){return zo(e)}function To(e){return Fo(e)}async function rd(e,t){var r;if(!ir(t))return{encoded:e};const n=(r=t.password)==null?void 0:r.trim();if(n){const{encryptedPayload:a,salt:o}=await Io(n,e.payload);return{encoded:{payload:a,compression:e.compression},manifest:Ke({expiresAt:t.expiresAt,password:n,salt:o})}}return{encoded:e,manifest:Ke({expiresAt:t.expiresAt})}}async function ad(e,t){const n=new TextEncoder,r=await crypto.subtle.importKey("raw",n.encode(e),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:new Uint8Array(t),iterations:jc,hash:"SHA-256"},r,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}function zo(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Fo(e){const t=atob(e.trim()),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const od=256;function Oo(e,t=Ye){return!(t>0)||Lt(e)<=t?[e]:e.indices&&e.indices.length>=2?sd(e,t):id(e,t)}function Ho(e,t=Ye){return e.texture?[e]:!(t>0)||Et(e)<=t?[e]:e.points?cd(e,t):!e.indices||e.indices.length<3?Do(e,t):ud(e,t)}function Uo(e){return e.linePattern?64+e.linePattern.pattern.length*8:0}function sr(e){return(e.hatchPattern?128:0)+(e.gradientFill?64:0)}function We(e,t,n){const r=e-od-t;return r<n?1:Math.max(1,Math.floor(r/n))}function id(e,t){var s;const n=(((s=e.lineDistances)==null?void 0:s.length)??0)>=2,r=24+(n?8:0),a=We(t,Uo(e),r),o=e.positions.length/6|0;if(o<=1)return[e];const i=[];for(let l=0;l<o;l+=a){const c=Math.min(a,o-l),d=l*6,u={layer:e.layer,color:e.color,offset:e.offset,positions:e.positions.slice(d,d+c*6)};if(Xo(e,u),n&&e.lineDistances){const p=l*2;u.lineDistances=e.lineDistances.slice(p,p+c*2)}i.push(u)}return i.length>0?i:[e]}function sd(e,t){var s;const n=e.indices,a=32+((((s=e.lineDistances)==null?void 0:s.length)??0)>0?8:0),o=We(t,Uo(e),a),i=[];for(let l=0;l+1<n.length;){const c=Math.min(o*2,n.length-l),d=c-c%2;if(d<2)break;i.push(ld(e,l,d)),l+=d}return i.length>0?i:[e]}function ld(e,t,n){const r=No(e.positions,e.indices.subarray(t,t+n),e.lineDistances?[e.lineDistances]:[],[1]),a={layer:e.layer,color:e.color,offset:e.offset,positions:r.positions,indices:r.indices};return Xo(e,a),r.attributes[0]&&r.attributes[0].length>0&&(a.lineDistances=r.attributes[0]),a}function cd(e,t){return e.indices&&e.indices.length>0?dd(e,t):Do(e,t)}function dd(e,t){const n=e.indices,r=16+(e.uvs?8:0)+(e.gradientPositions?8:0),a=We(t,sr(e),r),o=[];for(let i=0;i<n.length;){const s=Math.min(a,n.length-i);if(s<1)break;o.push(Ro(e,i,s)),i+=s}return o.length>0?o:[e]}function Do(e,t){const n=e.positions.length/3|0;if(n<=1)return[e];const r=12+(e.uvs?8:0)+(e.gradientPositions?8:0),a=We(t,sr(e),r),o=e.points?1:3,i=Math.max(o,a-a%o),s=[];for(let l=0;l<n;l+=i){const c=Math.min(i,n-l),d=c-c%o;if(d<o)break;s.push(md(e,l,d))}return s.length>0?s:[e]}function ud(e,t){const n=e.indices,r=48+(e.uvs?24:0)+(e.gradientPositions?24:0),a=We(t,sr(e),r),o=[];for(let i=0;i+2<n.length;){const s=Math.min(a*3,n.length-i),l=s-s%3;if(l<3)break;o.push(Ro(e,i,l)),i+=l}return o.length>0?o:[e]}function md(e,t,n){const r=t*3,a={layer:e.layer,color:e.color,offset:e.offset,positions:e.positions.slice(r,r+n*3)};return $o(e,a),e.uvs&&(a.uvs=e.uvs.slice(t*2,(t+n)*2)),e.gradientPositions&&(a.gradientPositions=e.gradientPositions.slice(t*2,(t+n)*2)),a}function Ro(e,t,n){const r=[],a=[];e.uvs&&(r.push(e.uvs),a.push(2)),e.gradientPositions&&(r.push(e.gradientPositions),a.push(2));const o=No(e.positions,e.indices.subarray(t,t+n),r,a),i={layer:e.layer,color:e.color,offset:e.offset,positions:o.positions,indices:o.indices};$o(e,i);let s=0;return e.uvs&&(i.uvs=o.attributes[s++]),e.gradientPositions&&(i.gradientPositions=o.attributes[s]),i}function No(e,t,n,r){const a=new Map,o=[],i=new Uint32Array(t.length),s=n.map(()=>[]);for(let l=0;l<t.length;l++){const c=t[l];let d=a.get(c);if(d==null){d=a.size,a.set(c,d);const u=c*3;o.push(e[u]??0,e[u+1]??0,e[u+2]??0);for(let p=0;p<n.length;p++){const f=r[p],h=n[p],g=c*f;for(let y=0;y<f;y++)s[p].push(h[g+y]??0)}}i[l]=d}return{positions:Float32Array.from(o),indices:i,attributes:s.map(l=>Float32Array.from(l))}}function Xo(e,t){e.linePattern&&(t.linePattern=e.linePattern),e.lineWidth!=null&&(t.lineWidth=e.lineWidth),e.renderOrder!=null&&(t.renderOrder=e.renderOrder),e.excludeFromOsnap&&(t.excludeFromOsnap=!0)}function $o(e,t){e.hatchPattern&&(t.hatchPattern=e.hatchPattern),e.gradientFill&&(t.gradientFill=e.gradientFill),e.side!=null&&(t.side=e.side),e.renderOrder!=null&&(t.renderOrder=e.renderOrder),e.points&&(t.points=!0)}function Vo(e,t,n=Ye){const r=[];let a={lineBatches:[],meshBatches:[],estimatedBytes:64};const o=()=>{a.lineBatches.length===0&&a.meshBatches.length===0&&r.length>0||(r.push(a),a={lineBatches:[],meshBatches:[],estimatedBytes:64})},i=c=>{const d=Lt(c);a.estimatedBytes+d>t&&(a.lineBatches.length>0||a.meshBatches.length>0)&&o(),a.lineBatches.push(c),a.estimatedBytes+=d},s=c=>{const d=Et(c);a.estimatedBytes+d>t&&(a.lineBatches.length>0||a.meshBatches.length>0)&&o(),a.meshBatches.push(c),a.estimatedBytes+=d},l=Math.min(t,n);for(const c of e.lineBatches)for(const d of Oo(c,l))i(d);for(const c of e.meshBatches)for(const d of Ho(c,l))s(d);return(r.length===0||a.lineBatches.length>0||a.meshBatches.length>0)&&o(),r.length===0&&r.push({lineBatches:[],meshBatches:[],estimatedBytes:64}),r}function Yo(e,t){if(e.version!==D)throw new Error(`Unsupported snapshot version: ${e.version}`);const n=t.maxChunkBytes??eo,r=t.maxBatchBytes??Ye,a=t.maxOsnapChunkBytes??n,o=t.compressChunks!==!1,i=o?"acex.gz":"acex",s=o?"osnap.gz":"osnap",l=ne,c=wd(e.layouts,e.activeLayoutBtrId),d=[],u=[],p=new Map;return c.forEach((f,h)=>{var A;p.set(f.btrId,h);const g=Vo(f,n,r),y=[];g.forEach((k,M)=>{const C=`L${h}-${String(M).padStart(3,"0")}`,_=`chunks/${C}.${i}`;y.push(C),d.push({kind:"geometry",id:C,href:_,layoutBtrId:f.btrId,lineBatchCount:k.lineBatches.length,meshBatchCount:k.meshBatches.length,chunk:{version:D,layoutBtrId:f.btrId,lineBatches:k.lineBatches,meshBatches:k.meshBatches}})});const b={btrId:f.btrId,name:f.name,isModelSpace:f.isModelSpace,viewports:f.viewports,...f.savedView?{savedView:f.savedView}:{},...f.fitExtents?{fitExtents:f.fitExtents}:{},chunkIds:y},w=(A=f.osnap)==null?void 0:A.primitives;if(w&&w.length>0){const k=Zr(w,a),M=[];k.forEach((C,_)=>{const L=`L${h}-osnap-${String(_).padStart(3,"0")}`,x=`chunks/${L}.${s}`;M.push(L),d.push({kind:"osnap",id:L,href:x,layoutBtrId:f.btrId,primitiveCount:C.length,primitives:C})}),b.osnapChunkIds=M}u.push(b)}),{jobs:d,layoutRefs:u,layoutIndexByBtrId:p,manifestFileName:l,compressChunks:o}}function Go(e,t,n,r,a){var g,y;const o=[],i=[],s=[];for(const b of a){const{job:w,uncompressedByteLength:A,compressed:k}=b;s.push({path:w.href,bytes:k}),w.kind==="geometry"?o.push({id:w.id,href:w.href,layoutBtrId:w.layoutBtrId,byteLength:A,compressedByteLength:k.byteLength,lineBatchCount:w.lineBatchCount,meshBatchCount:w.meshBatchCount}):i.push({id:w.id,href:w.href,layoutBtrId:w.layoutBtrId,byteLength:A,compressedByteLength:k.byteLength,primitiveCount:w.primitiveCount})}const l=e.layouts.map(b=>{const w=n.get(b.btrId);return t[w]}),c=new Set(((g=l.find(b=>b.btrId===e.activeLayoutBtrId))==null?void 0:g.chunkIds)??[]),d=[...o.filter(b=>c.has(b.id)),...o.filter(b=>!c.has(b.id))],u=new Set(((y=l.find(b=>b.btrId===e.activeLayoutBtrId))==null?void 0:y.osnapChunkIds)??[]),p=[...i.filter(b=>u.has(b.id)),...i.filter(b=>!u.has(b.id))],f={format:"acex-package",packageVersion:Wn,snapshotVersion:D,meta:e.meta,layers:e.layers,activeLayoutBtrId:e.activeLayoutBtrId,layouts:l,chunks:d,...p.length>0?{osnapChunks:p}:{}},h=`${JSON.stringify(f)}
1557
+ `;return s.unshift({path:r,bytes:ye(h)}),{manifest:f,manifestFileName:r,files:s}}function fd(e,t){if(e.kind==="geometry"){if(!t){const i=Ve(e.chunk);return{job:e,uncompressedByteLength:i.byteLength,compressed:i}}const{uncompressed:a,compressed:o}=Ja(e.chunk);return{job:e,uncompressedByteLength:a.byteLength,compressed:o}}if(!t){const a=xe({primitives:e.primitives});return{job:e,uncompressedByteLength:a.byteLength,compressed:a}}const{uncompressed:n,compressed:r}=Kr({primitives:e.primitives});return{job:e,uncompressedByteLength:n.byteLength,compressed:r}}async function pd(e,t){if(e.kind==="geometry"){if(!t){const i=Ve(e.chunk);return{job:e,uncompressedByteLength:i.byteLength,compressed:i}}const{uncompressed:a,compressed:o}=await Sl(e.chunk);return{job:e,uncompressedByteLength:a.byteLength,compressed:o}}if(!t){const a=xe({primitives:e.primitives});return{job:e,uncompressedByteLength:a.byteLength,compressed:a}}const{uncompressed:n,compressed:r}=await is({primitives:e.primitives});return{job:e,uncompressedByteLength:n.byteLength,compressed:r}}function jo(e,t={}){const{jobs:n,layoutRefs:r,layoutIndexByBtrId:a,manifestFileName:o,compressChunks:i}=Yo(e,t),s=n.map(l=>fd(l,i));return Go(e,r,a,o,s)}async function lr(e,t={}){const{jobs:n,layoutRefs:r,layoutIndexByBtrId:a,manifestFileName:o,compressChunks:i}=Yo(e,t),s=await Promise.all(n.map(l=>pd(l,i)));return Go(e,r,a,o,s)}function hd(e,t){const n=jo(e,t),r=ar(e,{title:e.meta.title,viewerRuntime:t.viewerRuntime,...t.manifestUrl?{manifestUrl:t.manifestUrl}:{}});return{html:r,manifest:n.manifest,manifestFileName:n.manifestFileName,files:[{path:"viewer.html",bytes:ye(r)},...n.files]}}async function gd(e,t){const n=await lr(e,t),r=ar(e,{title:e.meta.title,viewerRuntime:t.viewerRuntime,...t.manifestUrl?{manifestUrl:t.manifestUrl}:{}});return{html:r,manifest:n.manifest,manifestFileName:n.manifestFileName,files:[{path:"viewer.html",bytes:ye(r)},...n.files]}}function wd(e,t){const n=e.find(a=>a.btrId===t),r=e.filter(a=>a.btrId!==t);return n?[n,...r]:[...e]}const Zo="application/vnd.mlightcad.acex-chunk;base85",yd="application/vnd.mlightcad.acex-chunk;base64",Ko="application/vnd.mlightcad.acex-chunk+aes-gcm;base85",vd="application/vnd.mlightcad.acex-chunk+aes-gcm;base64",ie="data-acex-href";function Wo(e){var n;let t=0;for(const r of e.layouts){for(const o of r.lineBatches)t+=Lt(o);for(const o of r.meshBatches)t+=Et(o);const a=(n=r.osnap)==null?void 0:n.primitives;if(a)for(const o of a)t+=Ln(o)}return t}function bd(e,t=to){return Wo(e)>=t}async function xd(e,t){var y;const n=t.title??e.meta.title??"CAD Drawing",r=t.viewerRuntime,a=`#${e.meta.background.toString(16).padStart(6,"0")}`,o=Le(e.meta.locale)??"en",i=e.meta.viewerMode??"measure",s=e.meta.exportLayouts!==!1,l=t.expiresAt??null,c=((y=t.password)==null?void 0:y.trim())||void 0,d={maxChunkBytes:t.maxChunkBytes??qn,maxBatchBytes:t.maxBatchBytes??t.maxChunkBytes??qn,maxOsnapChunkBytes:t.maxOsnapChunkBytes??no},u=await lr(e,d);let p,f,h;if(c){const{key:b,salt:w}=await Yt(c);p=Ke({expiresAt:l,password:c,salt:w});const A=new TextEncoder().encode(`${JSON.stringify(u.manifest)}
1558
+ `),k=await Gt(b,A);f={mode:"embedded",encrypted:!0,encryptedManifest:Bo(k)},h=await Ad(u.files,b)}else p=Ke({expiresAt:l}),f={mode:"embedded",manifest:u.manifest},h=kd(u.files);const g=p?` <script id="mlcad-access" type="application/json">${ti(JSON.stringify(p))}<\/script>
1558
1559
  `:"";return`<!DOCTYPE html>
1559
1560
  <html lang="${o}">
1560
1561
  <head>
1561
1562
  <meta charset="utf-8" />
1562
1563
  <meta name="viewport" content="width=device-width, initial-scale=1" />
1563
1564
  <meta name="generator" content="mlightcad-cad-html-plugin" />
1564
- <title>${Jo(n)}</title>
1565
- <style>${Xt}</style>
1565
+ <title>${Qo(n)}</title>
1566
+ <style>${$t}</style>
1566
1567
  </head>
1567
1568
  <body>
1568
- ${$t(a,i,s)}
1569
- ${g} <script id="mlcad-package" type="application/json">${ei(JSON.stringify(p))}<\/script>
1570
- ${h} <script>${Sd(r)}<\/script>
1569
+ ${Vt(a,i,s)}
1570
+ ${g} <script id="mlcad-package" type="application/json">${ti(JSON.stringify(f))}<\/script>
1571
+ ${h} <script>${_d(r)}<\/script>
1571
1572
  </body>
1572
- </html>`}function bd(e){const t=[];for(const n of e)n.path!==ne&&t.push(` <script type="${jo}" ${ie}="${Qo(n.path)}">${be(n.bytes,"base85")}<\/script>
1573
- `);return t.join("")}async function xd(e,t){const n=[];for(const r of e){if(r.path===ne)continue;const a=await Yt(t,r.bytes);n.push(` <script type="${Zo}" ${ie}="${Qo(r.path)}">${be(a,"base85")}<\/script>
1574
- `)}return n.join("")}function cr(e){const t=e.textContent??"";if(t.length===0)return;const n=t.charCodeAt(0)<=32||t.charCodeAt(t.length-1)<=32?t.trim():t;if(n.length===0)return;const r=gn(e.getAttribute("type"));return Fe(n,r)}function kd(e){const t=e==null?void 0:e.trim();if(!t)return null;try{const n=JSON.parse(t);return(n==null?void 0:n.mode)!=="embedded"?null:n.encrypted===!0?typeof n.encryptedManifest!="string"?null:n:n.manifest?{mode:"embedded",manifest:Ge(n.manifest)}:null}catch{return null}}function Ad(e=document){const t=new Map;return e.querySelectorAll(`script[${ie}]`).forEach(r=>{var i;const a=(i=r.getAttribute(ie))==null?void 0:i.trim();if(!a)return;const o=cr(r);o&&t.set(a,o)}),t}function Ld(e,t=document){var r;const n=t.querySelectorAll(`script[${ie}]`);for(let a=0;a<n.length;a++){const o=n[a];if(((r=o.getAttribute(ie))==null?void 0:r.trim())===e)return cr(o)}}function Wo(e,t=document){var r;const n=t.querySelectorAll(`script[${ie}]`);for(let a=0;a<n.length;a++){const o=n[a];if(((r=o.getAttribute(ie))==null?void 0:r.trim())!==e)continue;const s=cr(o);return s?(o.remove(),s):void 0}}function Ed(e){const t=e.root??document,n=new Map;return qo({manifest:e.manifest,decryptKey:e.decryptKey,getChunk:async r=>{const a=n.get(r);if(a)return a;const o=Wo(r,t);return o&&n.set(r,o),o}})}function qo(e){const t=ne,n=new URL(t,je).toString(),r=new URL(je).origin,a=`${JSON.stringify(e.manifest)}
1575
- `,o=e.decryptKey??null,i=e.consumeOnFetch!==!1,s=e.chunkBytes,l=e.getChunk;return{manifestUrl:n,fetchImpl:async c=>{const u=new URL(String(c));if(u.origin!==r)return new Response(null,{status:404});const f=decodeURIComponent(u.pathname.replace(/^\/+/,""));if(f===t)return new Response(a,{status:200,headers:{"Content-Type":"application/json"}});let p;if(l?p=await l(f):s&&(p=s.get(f)),!p)return new Response(null,{status:404});const h=o?await Gt(o,p):p;return i&&s&&s.delete(f),new Response(h,{status:200})}}}async function Cd(e,t){const n=await Gt(t,Bo(e)),r=new TextDecoder().decode(n);return Ge(JSON.parse(r))}function Jo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Qo(e){return Jo(e).replace(/'/g,"&#39;")}function Sd(e){return e.replace(/<\/script/gi,"<\\/script")}function ei(e){return e.replace(/</g,"\\u003c")}function ti(e){return!e||e.startsWith("/")||e.includes("\\")||e.includes("\0")?!1:e.split("/").every(n=>n.length>0&&n!=="."&&n!==".."&&/^[A-Za-z0-9._-]+$/.test(n))}function Md(e){return e.endsWith(".gz")}function Pd(e){const t={};for(const n of e.files){if(!ti(n.path))throw new Error(`Unsafe package path: ${n.path}`);Md(n.path)?t[n.path]=[n.bytes,{level:0}]:t[n.path]=[n.bytes,{level:6}]}return Ji(t)}function _d(e){const t=Qi(e),n=[];for(const[r,a]of Object.entries(t)){if(!ti(r))throw new Error("Unsafe path in package archive");n.push({path:r,bytes:a})}return n}const qe=0,jt=16777215;function ni(e){return e==="white"||e==="space"?e:"black"}function ri(e){return e==="white"?jt:qe}function dr(e,t,n){return e==="space"?t?qe:jt:n>>>0}function ai(e){const t=e>>>0,n=t>>16&255,r=t>>8&255,a=t&255;return(n*299+r*587+a*114)/1e3>=128}function Id(e){const t=e>>>0,n=t>>16&255,r=t>>8&255,a=t&255,o=Math.max(n,r,a),i=Math.min(n,r,a);return o-i>16?null:o<=40?jt:i>=215?qe:null}function Zt(e){return Id(e)??e}function oi(e,t,n){if(ai(t)!==ai(n)){for(const r of e.lineBatches)r.color=Zt(r.color);for(const r of e.meshBatches){if(r.texture)continue;r.color=Zt(r.color);const a=r.gradientFill;a&&(a.startColor=Zt(a.startColor),a.endColor=Zt(a.endColor))}}}function ii(e,t,n){const r=n>>>0;e.meta.background=r;for(const a of e.layouts)oi(a,t,r)}function Bd(e,t,n){const r=ni(n);if(e.meta.backgroundMode=r,r==="space"){for(const o of e.layouts)oi(o,t,dr("space",o.isModelSpace,0));const a=e.layouts.find(o=>o.btrId===e.activeLayoutBtrId);e.meta.background=dr("space",a==null||a.isModelSpace,qe);return}ii(e,t,ri(r)),e.meta.backgroundMode=r}const Td="guide/magnifier.html",ur="https://mlightcad.com/cad-viewer/docs/";let mr=pr(ur);function si(){return mr}function zd(e){mr=pr(e)}function Fd(e,t){const n=t.toLowerCase().split(/[-_]/)[0],r=!n||n==="en"?"":`/${n}`,a=e.replace(/^\/+/,"");return`${mr}${r}/${a}`}function pr(e){const t=e.trim();return t?t.replace(/\/+$/,""):ur.replace(/\/+$/,"")}function fr(e,t){if(e.length<8)return e;const n=e.map(h=>({value:t==="x"?(h.minX+h.maxX)/2:(h.minY+h.maxY)/2,box:h})).sort((h,g)=>h.value-g.value),r=n[n.length-1].value-n[0].value;if(!(r>0))return e;let a=0,o=0;for(let h=1;h<n.length;h++){const g=n[h].value-n[h-1].value;g>a&&(a=g,o=h)}if(a<r*.2)return e;const i=n.slice(0,o),s=n.slice(o),l=i.length>=s.length?i:s,d=e.map(h=>Math.max(h.maxX-h.minX,h.maxY-h.minY,1e-9));d.sort((h,g)=>h-g);const c=d[Math.floor(d.length/2)]||1,u=[];for(let h=1;h<l.length;h++)u.push(l[h].value-l[h-1].value);u.sort((h,g)=>h-g);const f=u.length>0&&u[Math.floor(u.length/2)]||c,p=Math.max(f*10,c*20);return a<p?e:l.map(h=>h.box)}function li(e){if(e.length===0)return null;const t=ci(e);if(e.length<8)return t;let n=e.slice(),r=-1;for(;n.length!==r;)r=n.length,n=fr(n,"x"),n=fr(n,"y");return ci(n)??t}function ci(e){if(e.length===0)return null;let t=1/0,n=1/0,r=-1/0,a=-1/0;for(const o of e)o.minX<t&&(t=o.minX),o.minY<n&&(n=o.minY),o.maxX>r&&(r=o.maxX),o.maxY>a&&(a=o.maxY);return!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(a)?null:{minX:t,minY:n,maxX:r,maxY:a}}function Je(){return{minX:0,minY:0,maxX:0,maxY:0,valid:!1}}function di(e,t,n){if(t.length<3)return;const r=n[0],a=n[1];for(let o=0;o+2<t.length;o+=3){const i=Ue(t[o],r),s=Ue(t[o+1],a);e.valid?(i<e.minX&&(e.minX=i),i>e.maxX&&(e.maxX=i),s<e.minY&&(e.minY=s),s>e.maxY&&(e.maxY=s)):(e.minX=e.maxX=i,e.minY=e.maxY=s,e.valid=!0)}}function we(e,t){di(e,t.positions,t.offset)}function Qe(e){return e.valid?{minX:e.minX,minY:e.minY,maxX:e.maxX,maxY:e.maxY}:null}function ui(e,t){const n=Je();for(const r of e)we(n,r);for(const r of t)we(n,r);return Qe(n)}function hr(e,t){return e?t?{minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}:e:t??null}function mi(e){if(!e||e.length===0)return null;let t=null;for(const n of e)t=hr(t,n.paper);return t}function Kt(e){return hr(ui(e.lineBatches,e.meshBatches),mi(e.viewports))}function Hd(e,t){return Kt(e)??t??{minX:0,minY:0,maxX:1,maxY:1}}function pi(e){const t=[],n=r=>{if(r.positions.length<3)return;const a=Je();we(a,r);const o=Qe(a);o&&t.push({layer:r.layer,extents:o})};for(const r of e.lineBatches)n(r);for(const r of e.meshBatches)n(r);return t}function fi(e,t){var c;const n=t==null?void 0:t.isLayerVisible,r=e.filter(u=>!n||n(u.layer));if(r.length===0&&!((c=t==null?void 0:t.viewports)!=null&&c.length))return null;const a=r.map(u=>Math.max(u.extents.maxX-u.extents.minX,u.extents.maxY-u.extents.minY,1e-9));for(const u of(t==null?void 0:t.viewports)??[])a.push(Math.max(u.paper.maxX-u.paper.minX,u.paper.maxY-u.paper.minY,1e-9));a.sort((u,f)=>u-f);const o=a[Math.floor(a.length/2)]||1,i=Math.max(o*50,1e10),s=[],l=(t==null?void 0:t.sampleFromLayout)!=null;for(const u of r){if(Math.max(u.extents.maxX-u.extents.minX,u.extents.maxY-u.extents.minY)>=i){if(l){const p=t.sampleFromLayout,h=hi(p.lineBatches,u)??hi(p.meshBatches,u);if(h&&h.positions.length>=3){Rd(h,s);continue}}continue}s.push(u.extents)}for(const u of(t==null?void 0:t.viewports)??[])s.push(u.paper);const d=Od(s);return li(d.length>0?d:s)}function Od(e){if(e.length<2)return e;const t=e.map(c=>({x:(c.minX+c.maxX)/2,y:(c.minY+c.maxY)/2,box:c})),n=t.map(c=>c.x).sort((c,u)=>c-u),r=t.map(c=>c.y).sort((c,u)=>c-u),a=n[Math.floor(n.length/2)],o=r[Math.floor(r.length/2)],i=e.map(c=>Math.max(c.maxX-c.minX,c.maxY-c.minY,1e-9));i.sort((c,u)=>c-u);const s=i[Math.floor(i.length/2)]||1,l=Math.max(s*50,1e10),d=t.filter(c=>Math.hypot(c.x-a,c.y-o)<=l);return d.length>0?d.map(c=>c.box):e}function hi(e,t){for(const n of e){if(n.layer!==t.layer||n.positions.length<3)continue;const r=Je();we(r,n);const a=Qe(r);if(a&&a.minX===t.extents.minX&&a.minY===t.extents.minY&&a.maxX===t.extents.maxX&&a.maxY===t.extents.maxY)return n}}function Ud(e,t){const n=pi(e);return fi(n,{isLayerVisible:t,viewports:e.viewports,sampleFromLayout:e})??Kt(e)}const Dd=256;function Rd(e,t){const n=e.positions,r=e.offset,a=Math.floor(n.length/3);if(a<=0)return;const o=Math.max(1,Math.ceil(a/Dd));for(let i=0;i<a;i+=o){const s=i*3,l=Ue(n[s],r[0]),d=Ue(n[s+1],r[1]);!Number.isFinite(l)||!Number.isFinite(d)||t.push({minX:l,minY:d,maxX:l,maxY:d})}}function Nd(e,t){const n=new Map,r=o=>{let i=n.get(o);return i||(i=Je(),n.set(o,i)),i};for(const o of e)we(r(o.layer),o);for(const o of t)we(r(o.layer),o);const a=new Map;for(const[o,i]of n)a.set(o,Qe(i));return a}function gi(e,t,n){if(n)return;const r=$d(e,t);if(!(r!=null&&r.newIterator))return;const a=[];for(const o of r.newIterator()){if(!(o instanceof v.AcDbViewport)||I.AcTrViewportView.isDefaultPaperSpaceViewport(o)||typeof o.toGiViewport!="function")continue;const i=o.toGiViewport(),s=i.box,l=i.viewBox,d=wi(s),c=wi(l);if(!d||!c)continue;const u=Number.isFinite(i.viewTwistAngle)?i.viewTwistAngle:o.viewTwistAngle,f=Xd(i,o),p={paper:d,model:c};Number.isFinite(u)&&Math.abs(u)>1e-12&&(p.twist=u),f.length>0&&(p.frozenLayers=f),a.push(p)}return a.length>0?a:void 0}function Xd(e,t){var i;const n=e.frozenLayers;if(n&&n.length>0)return[...n];const r=t.frozenLayerIds;if(!(r!=null&&r.length))return[];const a=(i=t.database)==null?void 0:i.tables.layerTable;if(!a)return[];const o=[];for(const s of r){const l=a.getIdAt(s);l&&o.push(l.name)}return o}function wi(e){if(typeof e.isEmpty=="function"&&e.isEmpty())return;const t=e.min.x,n=e.min.y,r=e.max.x,a=e.max.y;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(a)||r-t<=0||a-n<=0))return{minX:t,minY:n,maxX:r,maxY:a}}function $d(e,t){var o;const n=(o=e.tables)==null?void 0:o.blockTable;if(!n)return;const r=typeof n.getIdAt=="function"?n.getIdAt(t):void 0;if(r)return r;if(typeof n.newIterator=="function"){for(const i of n.newIterator())if(i.objectId===t)return i}const a=n.modelSpace;if((a==null?void 0:a.objectId)===t)return a}const yi=16/9;function vi(e,t,n,r=yi){var i,s,l,d;const a=Number.isFinite(r)&&r>0?r:yi;if(n){const c=(l=(s=(i=e.tables)==null?void 0:i.viewportTable)==null?void 0:s.getActiveVportBox)==null?void 0:l.call(s,a);return bi(c)}const o=(d=e.objects)==null?void 0:d.layout;if(o!=null&&o.newIterator){for(const c of o.newIterator())if(c.blockTableRecordId===t)return bi(c.limits)}}function bi(e){if(!e||typeof e.isEmpty=="function"&&e.isEmpty())return;const t=e.min.x,n=e.min.y,r=e.max.x,a=e.max.y;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(a)||r-t<=0||a-n<=0))return{minX:t,minY:n,maxX:r,maxY:a}}function gr(e){var r;const t=(r=e.objects)==null?void 0:r.layout;if(!(t!=null&&t.newIterator))return[];const n=[];for(const a of t.newIterator()){const o=a.blockTableRecordId;o&&n.push({name:a.layoutName||o,tabOrder:a.tabOrder??0,blockTableRecordId:o})}return n.sort((a,o)=>a.tabOrder-o.tabOrder),n}function Vd(e,t,n={}){return Gd(e,t,n)}async function Yd(e,t,n={}){const r=n.yieldBetweenLayouts;r&&await r();const a=n.exportInvisibleLayers!==!1,o=n.exportLayouts!==!1,i=a?void 0:h=>wr(t,h,a),s=On(e,{title:n.title,background:n.background}),l=xi(t,a),d=gr(e),c=new Map(d.map(h=>[h.blockTableRecordId,h.name])),u=Li(t,o),f=Ai(t,d,o),p=[];for(const h of f)p.push(Ei(e,t,h,c,n,i)),r&&await r();return{version:D,meta:ki(s,n,p,u),layers:l,layouts:p,activeLayoutBtrId:u}}function Gd(e,t,n){const r=n.exportInvisibleLayers!==!1,a=n.exportLayouts!==!1,o=r?void 0:p=>wr(t,p,r),i=On(e,{title:n.title,background:n.background}),s=xi(t,r),l=gr(e),d=new Map(l.map(p=>[p.blockTableRecordId,p.name])),c=Li(t,a),u=Ai(t,l,a),f=[];for(const p of u)f.push(Ei(e,t,p,d,n,o));return{version:D,meta:ki(i,n,f,c),layers:s,layouts:f,activeLayoutBtrId:c}}function xi(e,t){const n=[];for(const r of e.layers)wr(e,r.name,t)&&n.push({name:r.name,color:r.color,visible:r.visible});return n}function ki(e,t,n,r){const a=n.find(s=>s.btrId===r)??n[0],o=a?Kt(a):null,i=t.initialView??"fit";return{title:e.title,createdAt:new Date().toISOString(),extents:e.extents,viewExtents:o??void 0,units:e.units,grip:e.grip,background:e.background,locale:t.locale??"en",initialView:i,viewState:i==="current"?t.viewState:void 0,viewerMode:t.viewerMode??"measure",exportLayouts:t.exportLayouts!==!1,docsBaseUrl:t.docsBaseUrl??si()}}function jd(e){return(e.viewerMode??"measure")==="measure"}function wr(e,t,n){if(n)return!0;const r=e.layers.find(a=>a.name===t);return r?r.visible:!0}function Ai(e,t,n){if(!n){const i=e.layouts.find(s=>s.btrId===e.modelSpaceBtrId);return i?[i]:[]}const r=new Map(e.layouts.map(i=>[i.btrId,i])),a=new Set,o=[];for(const i of t){if(a.has(i.blockTableRecordId))continue;a.add(i.blockTableRecordId);const s=r.get(i.blockTableRecordId);o.push(s??{btrId:i.blockTableRecordId,name:i.name,isModelSpace:i.blockTableRecordId===e.modelSpaceBtrId,layers:[]})}for(const i of e.layouts)a.has(i.btrId)||(a.add(i.btrId),o.push(i));return o}function Li(e,t){return t&&e.activeLayoutBtrId||e.modelSpaceBtrId}function Ei(e,t,n,r,a,o){const i=[],s=[];for(const u of n.layers){if(o&&!o(u.name))continue;const f=Ma(u.root);i.push(...f.lineBatches),s.push(...f.meshBatches)}const l=n.isModelSpace||n.btrId===t.modelSpaceBtrId,d=vi(e,n.btrId,l,a.canvasAspectRatio);let c;if(jd(a)){const u=performance.now();c=Ya(e,n.btrId,{includeLayer:o}),console.log(`[chtml] osnap catalog ${r.get(n.btrId)??n.name??n.btrId}: ${(performance.now()-u).toFixed(0)} ms (${(c==null?void 0:c.primitives.length)??0} primitives)`)}return{btrId:n.btrId,name:r.get(n.btrId)??n.name??Zd(e,n.btrId),isModelSpace:l,lineBatches:i,meshBatches:s,osnap:c,viewports:gi(e,n.btrId,l),...d?{savedView:d}:{}}}function Zd(e,t){var r;const n=(r=e.tables)==null?void 0:r.blockTable;if(n!=null&&n.newIterator){for(const a of n.newIterator())if(a.objectId===t)return a.name}return t}m.ACEC_CHUNK_MAGIC=jn,m.ACEO_OSNAP_MAGIC=Et,m.ACEO_OSNAP_VERSION=An,m.ACEX_DEFAULT_CHUNK_MAX_BYTES=eo,m.ACEX_DEFAULT_DOCS_BASE_URL=ur,m.ACEX_DEFAULT_MANIFEST_FILE=ne,m.ACEX_DEFAULT_MANIFEST_HREF=Qn,m.ACEX_DEFAULT_OSNAP_CHUNK_MAX_BYTES=Sl,m.ACEX_DEFAULT_OSNAP_MODES=Vs,m.ACEX_DEFAULT_POLAR_ANGLE=Oc,m.ACEX_DOCS_PATH_MAGNIFIER=Td,m.ACEX_EMBEDDED_CHUNK_ENCRYPTED_MIME=Zo,m.ACEX_EMBEDDED_CHUNK_ENCRYPTED_MIME_BASE64=wd,m.ACEX_EMBEDDED_CHUNK_HREF_ATTR=ie,m.ACEX_EMBEDDED_CHUNK_MAX_BYTES=qn,m.ACEX_EMBEDDED_CHUNK_MIME=jo,m.ACEX_EMBEDDED_CHUNK_MIME_BASE64=gd,m.ACEX_EMBEDDED_CHUNK_THRESHOLD_BYTES=to,m.ACEX_EMBEDDED_OSNAP_CHUNK_MAX_BYTES=no,m.ACEX_GEOMETRY_CHUNK_FETCH_CONCURRENCY=Ut,m.ACEX_HTML_BACKGROUND_BLACK=qe,m.ACEX_HTML_BACKGROUND_WHITE=jt,m.ACEX_HTML_EXPIRY_COUNTDOWN_MS=Po,m.ACEX_HTML_LOCALES=he,m.ACEX_HTML_LOCALE_BADGES=Yn,m.ACEX_HTML_LOCALE_STORAGE_KEY=Gn,m.ACEX_HTML_SHELL_CSS=Xt,m.ACEX_MANIFEST_QUERY_KEYS=lo,m.ACEX_MAX_BINARY_ARRAY_BYTES=mn,m.ACEX_MAX_BINARY_STRING_BYTES=Hr,m.ACEX_MAX_COMPRESSED_BYTES=lt,m.ACEX_MAX_DECOMPRESSED_BYTES=Or,m.ACEX_MAX_GEOMETRY_BATCH_BYTES=Ye,m.ACEX_ORTHO_POLAR_ANGLE=ko,m.ACEX_PACKAGE_DIRECTORY_ORIGIN=je,m.ACEX_PACKAGE_VERSION=Wn,m.ACEX_POLAR_ANGLE_INCREMENTS=xo,m.ACEX_SNAPSHOT_COMPRESSION=st,m.ACEX_SNAPSHOT_VERSION=D,m.AcExBinaryReader=it,m.AcExBinaryWriter=ot,m.AcExCameraZoomUniform=Pn,m.AcExHtmlI18n=El,m.AcExHtmlIcons=Ce,m.F_LINE_DISTANCES=pt,m.F_LINE_EXCLUDE_OSNAP=wn,m.F_LINE_INDICES=ut,m.F_LINE_PATTERN=mt,m.F_LINE_RENDER_ORDER=ht,m.F_LINE_WIDTH=ft,m.F_MESH_GRADIENT_FILL=yt,m.F_MESH_GRADIENT_POS=vt,m.F_MESH_HATCH=wt,m.F_MESH_INDICES=gt,m.F_MESH_POINTS=yn,m.F_MESH_RENDER_ORDER=xt,m.F_MESH_SIDE=bt,m.F_MESH_TEXTURE=kt,m.ML_UI_COMPACT_MAX_WIDTH=Lo,m.ML_UI_MOBILE_MAX_WIDTH=Ao,m.acExHtmlBackgroundRgb=ri,m.acExHtmlBase64ToBytes=Bo,m.acExHtmlBase85ToBytes=Dr,m.acExHtmlBytesToBase64=Io,m.acExHtmlBytesToBase85=Ur,m.acExHtmlBytesToText=be,m.acExHtmlLayoutBackground=dr,m.acExHtmlTextToBytes=Fe,m.acexDocsUrl=Fd,m.acexDropdownItem=Hc,m.acexGetDocsBaseUrl=si,m.acexGlobalFetch=Ze,m.acexSetDocsBaseUrl=zd,m.acexToolbarButton=tr,m.applyAcExHtmlBackground=Bd,m.arcToAcGe=Ia,m.arcWcsPoint=Dn,m.bakePlainDrawableSlice=St,m.buildAcExHtmlAccessManifest=Ke,m.buildAcExHtmlLocaleStrip=Rc,m.buildAcExHtmlPolarAnglesPanel=nr,m.buildAcExHtmlShellBody=$t,m.buildAcExHtmlSnapStrip=Nc,m.buildAcExPackage=pd,m.buildAcExPackageAsync=fd,m.buildAcExPackageData=Go,m.buildAcExPackageDataAsync=lr,m.buildOsnapCatalog=Ya,m.buildPackageDirectoryFileMap=Hl,m.buildSnapshotFromExportScene=Vd,m.buildSnapshotFromExportSceneAsync=Yd,m.buildViewerMetadata=On,m.canOpenLocalPackageFolder=Il,m.captureAcExSavedViewExtents=vi,m.chooseInitialManifestHref=Tl,m.circleOrArcToAcGe=Ta,m.collectAcExEmbeddedChunkBytes=Ad,m.collectBatchesFromObject3D=Ma,m.collectLayoutBatchExtentEntries=pi,m.collectLayoutViewports=gi,m.compactIndexedSlice=Sn,m.compressSnapshotBinary=ve,m.compressSnapshotBinaryAsync=pn,m.computeIntelligentExtentsFromBatchEntries=fi,m.computeIntelligentLayoutExtents=Ud,m.computeLayerExtentsMap=Nd,m.computeLayoutExtents=ui,m.computeLayoutViewExtents=Kt,m.computeLineDistancesForSegments=Pt,m.computeViewportPaperExtents=mi,m.consumeAcExEmbeddedChunkFromDom=Wo,m.copyFloat32Range=te,m.copyUint32Range=oa,m.createAcExDomEmbeddedPackageFetch=Ed,m.createAcExEmbeddedPackageFetch=qo,m.createAcExHtmlAccessKey=Vt,m.createAcExOrderedBytePrefetcher=Dt,m.createEmptyExtents=Je,m.createPackageDirectoryFetch=Ol,m.createTextureFromExportedBytes=pa,m.createViewerLineMaterial=Cs,m.createViewerMeshMaterial=Ms,m.createViewerPointsMaterial=Ss,m.decodeChunkBinary=Zn,m.decodeChunkGzip=Qa,m.decodeChunkPayload=Kn,m.decodeOsnapCatalogBinary=Ct,m.decodeOsnapCatalogGzip=Wr,m.decodeOsnapCatalogPayload=qr,m.decodeSnapshot=ws,m.decodeSnapshotBinary=ea,m.decodeSnapshotFromCompressedBytes=na,m.decompressSnapshotBinary=ct,m.decryptAcExEmbeddedManifest=Cd,m.decryptAcExHtmlBytes=Gt,m.decryptAcExHtmlSnapshotPayload=ed,m.detectAcExHtmlLocale=Za,m.detectBrowserAcExHtmlLocale=ja,m.detectLocalFolderOpenSupport=Bl,m.detectSharedDirectoryRoot=po,m.ellipseArcDelta=Ba,m.ellipsePointAtNormalized=Ys,m.ellipseToAcGe=za,m.encodeChunkBinary=Ve,m.encodeChunkGzip=Ja,m.encodeOsnapCatalogBinary=xe,m.encodeOsnapCatalogGzip=Kr,m.encodeSnapshot=ta,m.encodeSnapshotBinary=Qr,m.encodeTextureForExport=da,m.encryptAcExHtmlBytes=Yt,m.encryptAcExHtmlSnapshotPayload=_o,m.estimateAcExSnapshotGeometryBytes=Ko,m.estimateLineBatchBytes=At,m.estimateMeshBatchBytes=Lt,m.estimateOsnapPrimitiveBytes=Ln,m.expandExtentsFromBatch=we,m.expandExtentsFromPositions=di,m.exportActiveBatchedLine2Slice=ka,m.exportActiveBatchedSlice=It,m.exportBufferGeometrySlice=De,m.exportLineDistanceSlice=Es,m.exportPlainDrawableSlice=la,m.exportUvsForPositionSlice=ma,m.exportVertexAttributeSlice=ya,m.extractGradientFill=wa,m.extractHatchPattern=ga,m.extractLinePattern=ha,m.findDefaultManifestInDirectory=Ul,m.formatAcExHtmlCountdown=Jc,m.formatAcExHtmlExpiresAt=qc,m.formatAcExHtmlMessage=Wa,m.isAbsoluteHttpUrl=uo,m.isAcExHtmlAccessExpired=Kc,m.isAcExHtmlExpiryCountdownActive=Wc,m.isAcExHtmlLocale=Ll,m.isGzipPayload=fn,m.isSafePackageHref=ro,m.isTransparentImagePlaceholder=Mn,m.listDatabaseLayouts=gr,m.loadAcExPackage=Pl,m.loadAcExPackageLayout=_l,m.loadAcExPackageLayoutOsnap=io,m.needsAcExHtmlAccessControl=ir,m.normalizeAcExDocsBaseUrl=pr,m.normalizeArcDelta=Un,m.normalizePackageDirectoryPath=mo,m.omitNonFinitePrimitives=pe,m.packHtml=Vc,m.packHtmlEmbeddedPackage=vd,m.packHtmlPackage=ar,m.parseAcExEmbeddedPackageConfig=kd,m.parseAcExHtmlAccessManifest=Qc,m.parseAcExHtmlBinaryEncoding=gn,m.parseAcExPackageManifest=Ge,m.primitiveToAcGeCurve=Gs,m.probePackageManifest=Fl,m.protectAcExHtmlEncodedSnapshot=td,m.readAcExEmbeddedChunkFromDom=Ld,m.readBatchWorldOffset=ia,m.readLineBatch=bn,m.readManifestUrlFromSearchParams=co,m.readMeshBatch=kn,m.rebaseHatchPatternToLocalOffset=va,m.rebasePlainDrawableSliceAroundCentroid=Mt,m.releaseExportedTextureBytes=fa,m.remapAcExSnapshotForegroundForBackground=ii,m.resolveAcApHtmlExpiresAt=Zc,m.resolveAcExHtmlBackground=ni,m.resolveAcExHtmlLocale=Le,m.resolveChunkUrl=Nt,m.resolveLayoutViewExtents=Hd,m.resolvePackageManifestUrl=oo,m.resolveViewerManifestUrl=zl,m.setAcExSnapshotCompressor=es,m.setHeadlessPngEncoder=ys,m.shouldEmbedAcExChunks=yd,m.snapshotMimeType=aa,m.snapshotPayloadToCompressedBytes=ra,m.snapshotSkeletonFromManifest=ao,m.splineToAcGe=Fa,m.splitDominantCluster=fr,m.splitLayoutIntoSlices=$o,m.splitLineBatch=Fo,m.splitMeshBatch=Ho,m.splitOsnapPrimitives=Zr,m.toExtents=Qe,m.toWcsCoord=Ue,m.transformHatchPatternToWorldSpace=In,m.unionDominantCluster=li,m.unionExtents=hr,m.unzipAcExPackageFiles=_d,m.wcsPointToOcsArcAngle=Rn,m.writeLineBatch=vn,m.writeMeshBatch=xn,m.zipAcExPackageFiles=Pd,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})}));
1573
+ </html>`}function kd(e){const t=[];for(const n of e)n.path!==ne&&t.push(` <script type="${Zo}" ${ie}="${ei(n.path)}">${be(n.bytes,"base85")}<\/script>
1574
+ `);return t.join("")}async function Ad(e,t){const n=[];for(const r of e){if(r.path===ne)continue;const a=await Gt(t,r.bytes);n.push(` <script type="${Ko}" ${ie}="${ei(r.path)}">${be(a,"base85")}<\/script>
1575
+ `)}return n.join("")}function cr(e){const t=e.textContent??"";if(t.length===0)return;const n=t.charCodeAt(0)<=32||t.charCodeAt(t.length-1)<=32?t.trim():t;if(n.length===0)return;const r=gn(e.getAttribute("type"));return Fe(n,r)}function Ld(e){const t=e==null?void 0:e.trim();if(!t)return null;try{const n=JSON.parse(t);return(n==null?void 0:n.mode)!=="embedded"?null:n.encrypted===!0?typeof n.encryptedManifest!="string"?null:n:n.manifest?{mode:"embedded",manifest:Ge(n.manifest)}:null}catch{return null}}function Ed(e=document){const t=new Map;return e.querySelectorAll(`script[${ie}]`).forEach(r=>{var i;const a=(i=r.getAttribute(ie))==null?void 0:i.trim();if(!a)return;const o=cr(r);o&&t.set(a,o)}),t}function Cd(e,t=document){var r;const n=t.querySelectorAll(`script[${ie}]`);for(let a=0;a<n.length;a++){const o=n[a];if(((r=o.getAttribute(ie))==null?void 0:r.trim())===e)return cr(o)}}function qo(e,t=document){var r;const n=t.querySelectorAll(`script[${ie}]`);for(let a=0;a<n.length;a++){const o=n[a];if(((r=o.getAttribute(ie))==null?void 0:r.trim())!==e)continue;const s=cr(o);return s?(o.remove(),s):void 0}}function Sd(e){const t=e.root??document,n=new Map;return Jo({manifest:e.manifest,decryptKey:e.decryptKey,getChunk:async r=>{const a=n.get(r);if(a)return a;const o=qo(r,t);return o&&n.set(r,o),o}})}function Jo(e){const t=ne,n=new URL(t,je).toString(),r=new URL(je).origin,a=`${JSON.stringify(e.manifest)}
1576
+ `,o=e.decryptKey??null,i=e.consumeOnFetch!==!1,s=e.chunkBytes,l=e.getChunk;return{manifestUrl:n,fetchImpl:async d=>{const u=new URL(String(d));if(u.origin!==r)return new Response(null,{status:404});const p=decodeURIComponent(u.pathname.replace(/^\/+/,""));if(p===t)return new Response(a,{status:200,headers:{"Content-Type":"application/json"}});let f;if(l?f=await l(p):s&&(f=s.get(p)),!f)return new Response(null,{status:404});const h=o?await jt(o,f):f;return i&&s&&s.delete(p),new Response(h,{status:200})}}}async function Md(e,t){const n=await jt(t,To(e)),r=new TextDecoder().decode(n);return Ge(JSON.parse(r))}function Qo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function ei(e){return Qo(e).replace(/'/g,"&#39;")}function _d(e){return e.replace(/<\/script/gi,"<\\/script")}function ti(e){return e.replace(/</g,"\\u003c")}function ni(e){return!e||e.startsWith("/")||e.includes("\\")||e.includes("\0")?!1:e.split("/").every(n=>n.length>0&&n!=="."&&n!==".."&&/^[A-Za-z0-9._-]+$/.test(n))}function Pd(e){return e.endsWith(".gz")}function Id(e){const t={};for(const n of e.files){if(!ni(n.path))throw new Error(`Unsafe package path: ${n.path}`);Pd(n.path)?t[n.path]=[n.bytes,{level:0}]:t[n.path]=[n.bytes,{level:6}]}return Qi(t)}function Bd(e){const t=es(e),n=[];for(const[r,a]of Object.entries(t)){if(!ni(r))throw new Error("Unsafe path in package archive");n.push({path:r,bytes:a})}return n}const qe=0,Zt=16777215;function ri(e){return e==="white"||e==="space"?e:"black"}function ai(e){return e==="white"?Zt:qe}function dr(e,t,n){return e==="space"?t?qe:Zt:n>>>0}function oi(e){const t=e>>>0,n=t>>16&255,r=t>>8&255,a=t&255;return(n*299+r*587+a*114)/1e3>=128}function Td(e){const t=e>>>0,n=t>>16&255,r=t>>8&255,a=t&255,o=Math.max(n,r,a),i=Math.min(n,r,a);return o-i>16?null:o<=40?Zt:i>=215?qe:null}function Kt(e){return Td(e)??e}function ii(e,t,n){if(oi(t)!==oi(n)){for(const r of e.lineBatches)r.color=Kt(r.color);for(const r of e.meshBatches){if(r.texture)continue;r.color=Kt(r.color);const a=r.gradientFill;a&&(a.startColor=Kt(a.startColor),a.endColor=Kt(a.endColor))}}}function si(e,t,n){const r=n>>>0;e.meta.background=r;for(const a of e.layouts)ii(a,t,r)}function zd(e,t,n){const r=ri(n);if(e.meta.backgroundMode=r,r==="space"){for(const o of e.layouts)ii(o,t,dr("space",o.isModelSpace,0));const a=e.layouts.find(o=>o.btrId===e.activeLayoutBtrId);e.meta.background=dr("space",a==null||a.isModelSpace,qe);return}si(e,t,ai(r)),e.meta.backgroundMode=r}const Fd="guide/magnifier.html",ur="https://mlightcad.com/cad-viewer/docs/";let mr=fr(ur);function li(){return mr}function Od(e){mr=fr(e)}function Hd(e,t){const n=t.toLowerCase().split(/[-_]/)[0],r=!n||n==="en"?"":`/${n}`,a=e.replace(/^\/+/,"");return`${mr}${r}/${a}`}function fr(e){const t=e.trim();return t?t.replace(/\/+$/,""):ur.replace(/\/+$/,"")}function pr(e,t){if(e.length<8)return e;const n=e.map(h=>({value:t==="x"?(h.minX+h.maxX)/2:(h.minY+h.maxY)/2,box:h})).sort((h,g)=>h.value-g.value),r=n[n.length-1].value-n[0].value;if(!(r>0))return e;let a=0,o=0;for(let h=1;h<n.length;h++){const g=n[h].value-n[h-1].value;g>a&&(a=g,o=h)}if(a<r*.2)return e;const i=n.slice(0,o),s=n.slice(o),l=i.length>=s.length?i:s,c=e.map(h=>Math.max(h.maxX-h.minX,h.maxY-h.minY,1e-9));c.sort((h,g)=>h-g);const d=c[Math.floor(c.length/2)]||1,u=[];for(let h=1;h<l.length;h++)u.push(l[h].value-l[h-1].value);u.sort((h,g)=>h-g);const p=u.length>0&&u[Math.floor(u.length/2)]||d,f=Math.max(p*10,d*20);return a<f?e:l.map(h=>h.box)}function ci(e){if(e.length===0)return null;const t=di(e);if(e.length<8)return t;let n=e.slice(),r=-1;for(;n.length!==r;)r=n.length,n=pr(n,"x"),n=pr(n,"y");return di(n)??t}function di(e){if(e.length===0)return null;let t=1/0,n=1/0,r=-1/0,a=-1/0;for(const o of e)o.minX<t&&(t=o.minX),o.minY<n&&(n=o.minY),o.maxX>r&&(r=o.maxX),o.maxY>a&&(a=o.maxY);return!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(a)?null:{minX:t,minY:n,maxX:r,maxY:a}}function Je(){return{minX:0,minY:0,maxX:0,maxY:0,valid:!1}}function ui(e,t,n){if(t.length<3)return;const r=n[0],a=n[1];for(let o=0;o+2<t.length;o+=3){const i=Ue(t[o],r),s=Ue(t[o+1],a);e.valid?(i<e.minX&&(e.minX=i),i>e.maxX&&(e.maxX=i),s<e.minY&&(e.minY=s),s>e.maxY&&(e.maxY=s)):(e.minX=e.maxX=i,e.minY=e.maxY=s,e.valid=!0)}}function we(e,t){ui(e,t.positions,t.offset)}function Qe(e){return e.valid?{minX:e.minX,minY:e.minY,maxX:e.maxX,maxY:e.maxY}:null}function mi(e,t){const n=Je();for(const r of e)we(n,r);for(const r of t)we(n,r);return Qe(n)}function hr(e,t){return e?t?{minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}:e:t??null}function fi(e){if(!e||e.length===0)return null;let t=null;for(const n of e)t=hr(t,n.paper);return t}function et(e){return hr(mi(e.lineBatches,e.meshBatches),fi(e.viewports))}function Ud(e,t){return e.fitExtents??et(e)??t??{minX:0,minY:0,maxX:1,maxY:1}}function Dd(e,t){return e.btrId===t.activeLayoutBtrId?t.meta.viewExtents??e.savedView??t.meta.extents:e.savedView??t.meta.extents}function pi(e){const t=[],n=r=>{if(r.positions.length<3)return;const a=Je();we(a,r);const o=Qe(a);o&&t.push({layer:r.layer,extents:o})};for(const r of e.lineBatches)n(r);for(const r of e.meshBatches)n(r);return t}function hi(e,t){var d;const n=t==null?void 0:t.isLayerVisible,r=e.filter(u=>!n||n(u.layer));if(r.length===0&&!((d=t==null?void 0:t.viewports)!=null&&d.length))return null;const a=r.map(u=>Math.max(u.extents.maxX-u.extents.minX,u.extents.maxY-u.extents.minY,1e-9));for(const u of(t==null?void 0:t.viewports)??[])a.push(Math.max(u.paper.maxX-u.paper.minX,u.paper.maxY-u.paper.minY,1e-9));a.sort((u,p)=>u-p);const o=a[Math.floor(a.length/2)]||1,i=Math.max(o*50,1e10),s=[],l=(t==null?void 0:t.sampleFromLayout)!=null;for(const u of r){if(Math.max(u.extents.maxX-u.extents.minX,u.extents.maxY-u.extents.minY)>=i){if(l){const f=t.sampleFromLayout,h=gi(f.lineBatches,u)??gi(f.meshBatches,u);if(h&&h.positions.length>=3){$d(h,s);continue}}continue}s.push(u.extents)}for(const u of(t==null?void 0:t.viewports)??[])s.push(u.paper);const c=Rd(s);return ci(c.length>0?c:s)}function Rd(e){if(e.length<2)return e;const t=e.map(d=>({x:(d.minX+d.maxX)/2,y:(d.minY+d.maxY)/2,box:d})),n=t.map(d=>d.x).sort((d,u)=>d-u),r=t.map(d=>d.y).sort((d,u)=>d-u),a=n[Math.floor(n.length/2)],o=r[Math.floor(r.length/2)],i=e.map(d=>Math.max(d.maxX-d.minX,d.maxY-d.minY,1e-9));i.sort((d,u)=>d-u);const s=i[Math.floor(i.length/2)]||1,l=Math.max(s*50,1e10),c=t.filter(d=>Math.hypot(d.x-a,d.y-o)<=l);return c.length>0?c.map(d=>d.box):e}function gi(e,t){for(const n of e){if(n.layer!==t.layer||n.positions.length<3)continue;const r=Je();we(r,n);const a=Qe(r);if(a&&a.minX===t.extents.minX&&a.minY===t.extents.minY&&a.maxX===t.extents.maxX&&a.maxY===t.extents.maxY)return n}}function Nd(e,t){const n=pi(e);return hi(n,{isLayerVisible:t,viewports:e.viewports,sampleFromLayout:e})??et(e)}const Xd=256;function $d(e,t){const n=e.positions,r=e.offset,a=Math.floor(n.length/3);if(a<=0)return;const o=Math.max(1,Math.ceil(a/Xd));for(let i=0;i<a;i+=o){const s=i*3,l=Ue(n[s],r[0]),c=Ue(n[s+1],r[1]);!Number.isFinite(l)||!Number.isFinite(c)||t.push({minX:l,minY:c,maxX:l,maxY:c})}}function Vd(e,t){const n=new Map,r=o=>{let i=n.get(o);return i||(i=Je(),n.set(o,i)),i};for(const o of e)we(r(o.layer),o);for(const o of t)we(r(o.layer),o);const a=new Map;for(const[o,i]of n)a.set(o,Qe(i));return a}function wi(e,t,n){if(n)return;const r=Gd(e,t);if(!(r!=null&&r.newIterator))return;const a=[];for(const o of r.newIterator()){if(!(o instanceof v.AcDbViewport)||I.AcTrViewportView.isDefaultPaperSpaceViewport(o)||typeof o.toGiViewport!="function")continue;const i=o.toGiViewport(),s=i.box,l=i.viewBox,c=yi(s),d=yi(l);if(!c||!d)continue;const u=Number.isFinite(i.viewTwistAngle)?i.viewTwistAngle:o.viewTwistAngle,p=Yd(i,o),f={paper:c,model:d};Number.isFinite(u)&&Math.abs(u)>1e-12&&(f.twist=u),p.length>0&&(f.frozenLayers=p),a.push(f)}return a.length>0?a:void 0}function Yd(e,t){var i;const n=e.frozenLayers;if(n&&n.length>0)return[...n];const r=t.frozenLayerIds;if(!(r!=null&&r.length))return[];const a=(i=t.database)==null?void 0:i.tables.layerTable;if(!a)return[];const o=[];for(const s of r){const l=a.getIdAt(s);l&&o.push(l.name)}return o}function yi(e){if(typeof e.isEmpty=="function"&&e.isEmpty())return;const t=e.min.x,n=e.min.y,r=e.max.x,a=e.max.y;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(a)||r-t<=0||a-n<=0))return{minX:t,minY:n,maxX:r,maxY:a}}function Gd(e,t){var o;const n=(o=e.tables)==null?void 0:o.blockTable;if(!n)return;const r=typeof n.getIdAt=="function"?n.getIdAt(t):void 0;if(r)return r;if(typeof n.newIterator=="function"){for(const i of n.newIterator())if(i.objectId===t)return i}const a=n.modelSpace;if((a==null?void 0:a.objectId)===t)return a}const vi=16/9;function bi(e,t,n,r=vi){var i,s,l,c;const a=Number.isFinite(r)&&r>0?r:vi;if(n){const d=(l=(s=(i=e.tables)==null?void 0:i.viewportTable)==null?void 0:s.getActiveVportBox)==null?void 0:l.call(s,a);return xi(d)}const o=(c=e.objects)==null?void 0:c.layout;if(o!=null&&o.newIterator){for(const d of o.newIterator())if(d.blockTableRecordId===t)return xi(d.limits)}}function xi(e){if(!e||typeof e.isEmpty=="function"&&e.isEmpty())return;const t=e.min.x,n=e.min.y,r=e.max.x,a=e.max.y;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(a)||r-t<=0||a-n<=0))return{minX:t,minY:n,maxX:r,maxY:a}}function gr(e){var r;const t=(r=e.objects)==null?void 0:r.layout;if(!(t!=null&&t.newIterator))return[];const n=[];for(const a of t.newIterator()){const o=a.blockTableRecordId;o&&n.push({name:a.layoutName||o,tabOrder:a.tabOrder??0,blockTableRecordId:o})}return n.sort((a,o)=>a.tabOrder-o.tabOrder),n}function jd(e,t,n={}){return Kd(e,t,n)}async function Zd(e,t,n={}){const r=n.yieldBetweenLayouts;r&&await r();const a=n.exportInvisibleLayers!==!1,o=n.exportLayouts!==!1,i=a?void 0:h=>wr(t,h,a),s=Hn(e,{title:n.title,background:n.background}),l=ki(t,a),c=gr(e),d=new Map(c.map(h=>[h.blockTableRecordId,h.name])),u=Ei(t,o),p=Li(t,c,o),f=[];for(const h of p)f.push(Ci(e,t,h,d,n,i)),r&&await r();return{version:D,meta:Ai(s,n,f,u),layers:l,layouts:f,activeLayoutBtrId:u}}function Kd(e,t,n){const r=n.exportInvisibleLayers!==!1,a=n.exportLayouts!==!1,o=r?void 0:f=>wr(t,f,r),i=Hn(e,{title:n.title,background:n.background}),s=ki(t,r),l=gr(e),c=new Map(l.map(f=>[f.blockTableRecordId,f.name])),d=Ei(t,a),u=Li(t,l,a),p=[];for(const f of u)p.push(Ci(e,t,f,c,n,o));return{version:D,meta:Ai(i,n,p,d),layers:s,layouts:p,activeLayoutBtrId:d}}function ki(e,t){const n=[];for(const r of e.layers)wr(e,r.name,t)&&n.push({name:r.name,color:r.color,visible:r.visible});return n}function Ai(e,t,n,r){const a=n.find(s=>s.btrId===r)??n[0],o=a?et(a):null,i=t.initialView??"fit";return{title:e.title,createdAt:new Date().toISOString(),extents:e.extents,viewExtents:o??void 0,units:e.units,grip:e.grip,background:e.background,locale:t.locale??"en",initialView:i,viewState:i==="current"?t.viewState:void 0,viewerMode:t.viewerMode??"measure",exportLayouts:t.exportLayouts!==!1,docsBaseUrl:t.docsBaseUrl??li()}}function Wd(e){return(e.viewerMode??"measure")==="measure"}function wr(e,t,n){if(n)return!0;const r=e.layers.find(a=>a.name===t);return r?r.visible:!0}function Li(e,t,n){if(!n){const i=e.layouts.find(s=>s.btrId===e.modelSpaceBtrId);return i?[i]:[]}const r=new Map(e.layouts.map(i=>[i.btrId,i])),a=new Set,o=[];for(const i of t){if(a.has(i.blockTableRecordId))continue;a.add(i.blockTableRecordId);const s=r.get(i.blockTableRecordId);o.push(s??{btrId:i.blockTableRecordId,name:i.name,isModelSpace:i.blockTableRecordId===e.modelSpaceBtrId,layers:[]})}for(const i of e.layouts)a.has(i.btrId)||(a.add(i.btrId),o.push(i));return o}function Ei(e,t){return t&&e.activeLayoutBtrId||e.modelSpaceBtrId}function Ci(e,t,n,r,a,o){const i=[],s=[];for(const f of n.layers){if(o&&!o(f.name))continue;const h=Ma(f.root);i.push(...h.lineBatches),s.push(...h.meshBatches)}const l=n.isModelSpace||n.btrId===t.modelSpaceBtrId,c=bi(e,n.btrId,l,a.canvasAspectRatio),d=wi(e,n.btrId,l),u=et({lineBatches:i,meshBatches:s,viewports:d})??void 0;let p;if(Wd(a)){const f=performance.now();p=Ya(e,n.btrId,{includeLayer:o}),console.log(`[chtml] osnap catalog ${r.get(n.btrId)??n.name??n.btrId}: ${(performance.now()-f).toFixed(0)} ms (${(p==null?void 0:p.primitives.length)??0} primitives)`)}return{btrId:n.btrId,name:r.get(n.btrId)??n.name??qd(e,n.btrId),isModelSpace:l,lineBatches:i,meshBatches:s,osnap:p,viewports:d,...c?{savedView:c}:{},...u?{fitExtents:u}:{}}}function qd(e,t){var r;const n=(r=e.tables)==null?void 0:r.blockTable;if(n!=null&&n.newIterator){for(const a of n.newIterator())if(a.objectId===t)return a.name}return t}m.ACEC_CHUNK_MAGIC=jn,m.ACEO_OSNAP_MAGIC=Ct,m.ACEO_OSNAP_VERSION=An,m.ACEX_COORDINATE_BADGE_LIFT_EM=Eo,m.ACEX_COORDINATE_BADGE_REF_FONT_PX=$c,m.ACEX_DEFAULT_CHUNK_MAX_BYTES=eo,m.ACEX_DEFAULT_DOCS_BASE_URL=ur,m.ACEX_DEFAULT_MANIFEST_FILE=ne,m.ACEX_DEFAULT_MANIFEST_HREF=Qn,m.ACEX_DEFAULT_OSNAP_CHUNK_MAX_BYTES=Ml,m.ACEX_DEFAULT_OSNAP_MODES=Ys,m.ACEX_DEFAULT_POLAR_ANGLE=Uc,m.ACEX_DOCS_PATH_MAGNIFIER=Fd,m.ACEX_EMBEDDED_CHUNK_ENCRYPTED_MIME=Ko,m.ACEX_EMBEDDED_CHUNK_ENCRYPTED_MIME_BASE64=vd,m.ACEX_EMBEDDED_CHUNK_HREF_ATTR=ie,m.ACEX_EMBEDDED_CHUNK_MAX_BYTES=qn,m.ACEX_EMBEDDED_CHUNK_MIME=Zo,m.ACEX_EMBEDDED_CHUNK_MIME_BASE64=yd,m.ACEX_EMBEDDED_CHUNK_THRESHOLD_BYTES=to,m.ACEX_EMBEDDED_OSNAP_CHUNK_MAX_BYTES=no,m.ACEX_GEOMETRY_CHUNK_FETCH_CONCURRENCY=Dt,m.ACEX_HTML_BACKGROUND_BLACK=qe,m.ACEX_HTML_BACKGROUND_WHITE=Zt,m.ACEX_HTML_EXPIRY_COUNTDOWN_MS=Po,m.ACEX_HTML_LOCALES=he,m.ACEX_HTML_LOCALE_BADGES=Yn,m.ACEX_HTML_LOCALE_STORAGE_KEY=Gn,m.ACEX_HTML_SHELL_CSS=$t,m.ACEX_MANIFEST_QUERY_KEYS=lo,m.ACEX_MAX_BINARY_ARRAY_BYTES=mn,m.ACEX_MAX_BINARY_STRING_BYTES=Or,m.ACEX_MAX_COMPRESSED_BYTES=ct,m.ACEX_MAX_DECOMPRESSED_BYTES=Hr,m.ACEX_MAX_GEOMETRY_BATCH_BYTES=Ye,m.ACEX_ORTHO_POLAR_ANGLE=ko,m.ACEX_PACKAGE_DIRECTORY_ORIGIN=je,m.ACEX_PACKAGE_VERSION=Wn,m.ACEX_POLAR_ANGLE_INCREMENTS=xo,m.ACEX_SNAPSHOT_COMPRESSION=lt,m.ACEX_SNAPSHOT_VERSION=D,m.AcExBinaryReader=st,m.AcExBinaryWriter=it,m.AcExCameraZoomUniform=_n,m.AcExHtmlI18n=Cl,m.AcExHtmlIcons=Ce,m.F_LINE_DISTANCES=pt,m.F_LINE_EXCLUDE_OSNAP=wn,m.F_LINE_INDICES=mt,m.F_LINE_PATTERN=ft,m.F_LINE_RENDER_ORDER=gt,m.F_LINE_WIDTH=ht,m.F_MESH_GRADIENT_FILL=vt,m.F_MESH_GRADIENT_POS=bt,m.F_MESH_HATCH=yt,m.F_MESH_INDICES=wt,m.F_MESH_POINTS=yn,m.F_MESH_RENDER_ORDER=kt,m.F_MESH_SIDE=xt,m.F_MESH_TEXTURE=At,m.ML_UI_COMPACT_MAX_WIDTH=Lo,m.ML_UI_MOBILE_MAX_WIDTH=Ao,m.acExHtmlBackgroundRgb=ai,m.acExHtmlBase64ToBytes=To,m.acExHtmlBase85ToBytes=Dr,m.acExHtmlBytesToBase64=Bo,m.acExHtmlBytesToBase85=Ur,m.acExHtmlBytesToText=be,m.acExHtmlLayoutBackground=dr,m.acExHtmlTextToBytes=Fe,m.acexDocsUrl=Hd,m.acexDropdownItem=Hc,m.acexGetDocsBaseUrl=li,m.acexGlobalFetch=Ze,m.acexSetDocsBaseUrl=Od,m.acexToolbarButton=tr,m.applyAcExHtmlBackground=zd,m.arcToAcGe=Ia,m.arcWcsPoint=Dn,m.bakePlainDrawableSlice=Mt,m.buildAcExHtmlAccessManifest=Ke,m.buildAcExHtmlLocaleStrip=Nc,m.buildAcExHtmlPolarAnglesPanel=nr,m.buildAcExHtmlShellBody=Vt,m.buildAcExHtmlSnapStrip=Xc,m.buildAcExPackage=hd,m.buildAcExPackageAsync=gd,m.buildAcExPackageData=jo,m.buildAcExPackageDataAsync=lr,m.buildOsnapCatalog=Ya,m.buildPackageDirectoryFileMap=Hl,m.buildSnapshotFromExportScene=jd,m.buildSnapshotFromExportSceneAsync=Zd,m.buildViewerMetadata=Hn,m.canOpenLocalPackageFolder=Bl,m.captureAcExSavedViewExtents=bi,m.chooseInitialManifestHref=zl,m.circleOrArcToAcGe=Ta,m.collectAcExEmbeddedChunkBytes=Ed,m.collectBatchesFromObject3D=Ma,m.collectLayoutBatchExtentEntries=pi,m.collectLayoutViewports=wi,m.compactIndexedSlice=Sn,m.compressSnapshotBinary=ve,m.compressSnapshotBinaryAsync=fn,m.computeIntelligentExtentsFromBatchEntries=hi,m.computeIntelligentLayoutExtents=Nd,m.computeLayerExtentsMap=Vd,m.computeLayoutExtents=mi,m.computeLayoutViewExtents=et,m.computeLineDistancesForSegments=Pt,m.computeViewportPaperExtents=fi,m.consumeAcExEmbeddedChunkFromDom=qo,m.copyFloat32Range=te,m.copyUint32Range=oa,m.createAcExDomEmbeddedPackageFetch=Sd,m.createAcExEmbeddedPackageFetch=Jo,m.createAcExHtmlAccessKey=Yt,m.createAcExOrderedBytePrefetcher=Rt,m.createEmptyExtents=Je,m.createPackageDirectoryFetch=Ul,m.createTextureFromExportedBytes=fa,m.createViewerLineMaterial=Ss,m.createViewerMeshMaterial=_s,m.createViewerPointsMaterial=Ms,m.decodeChunkBinary=Zn,m.decodeChunkGzip=Qa,m.decodeChunkPayload=Kn,m.decodeOsnapCatalogBinary=St,m.decodeOsnapCatalogGzip=Wr,m.decodeOsnapCatalogPayload=qr,m.decodeSnapshot=ys,m.decodeSnapshotBinary=ea,m.decodeSnapshotFromCompressedBytes=na,m.decompressSnapshotBinary=dt,m.decryptAcExEmbeddedManifest=Md,m.decryptAcExHtmlBytes=jt,m.decryptAcExHtmlSnapshotPayload=nd,m.detectAcExHtmlLocale=Za,m.detectBrowserAcExHtmlLocale=ja,m.detectLocalFolderOpenSupport=Tl,m.detectSharedDirectoryRoot=fo,m.ellipseArcDelta=Ba,m.ellipsePointAtNormalized=Gs,m.ellipseToAcGe=za,m.encodeChunkBinary=Ve,m.encodeChunkGzip=Ja,m.encodeOsnapCatalogBinary=xe,m.encodeOsnapCatalogGzip=Kr,m.encodeSnapshot=ta,m.encodeSnapshotBinary=Qr,m.encodeTextureForExport=da,m.encryptAcExHtmlBytes=Gt,m.encryptAcExHtmlSnapshotPayload=Io,m.estimateAcExSnapshotGeometryBytes=Wo,m.estimateLineBatchBytes=Lt,m.estimateMeshBatchBytes=Et,m.estimateOsnapPrimitiveBytes=Ln,m.expandExtentsFromBatch=we,m.expandExtentsFromPositions=ui,m.exportActiveBatchedLine2Slice=ka,m.exportActiveBatchedSlice=Bt,m.exportBufferGeometrySlice=De,m.exportLineDistanceSlice=Cs,m.exportPlainDrawableSlice=la,m.exportUvsForPositionSlice=ma,m.exportVertexAttributeSlice=ya,m.extractGradientFill=wa,m.extractHatchPattern=ga,m.extractLinePattern=ha,m.findDefaultManifestInDirectory=Dl,m.formatAcExHtmlCountdown=ed,m.formatAcExHtmlExpiresAt=Qc,m.formatAcExHtmlMessage=Wa,m.isAbsoluteHttpUrl=uo,m.isAcExHtmlAccessExpired=qc,m.isAcExHtmlExpiryCountdownActive=Jc,m.isAcExHtmlLocale=El,m.isGzipPayload=pn,m.isSafePackageHref=ro,m.isTransparentImagePlaceholder=Mn,m.listDatabaseLayouts=gr,m.loadAcExPackage=Pl,m.loadAcExPackageLayout=Il,m.loadAcExPackageLayoutOsnap=io,m.needsAcExHtmlAccessControl=ir,m.normalizeAcExDocsBaseUrl=fr,m.normalizeArcDelta=Un,m.normalizePackageDirectoryPath=mo,m.omitNonFinitePrimitives=fe,m.packHtml=Gc,m.packHtmlEmbeddedPackage=xd,m.packHtmlPackage=ar,m.parseAcExEmbeddedPackageConfig=Ld,m.parseAcExHtmlAccessManifest=td,m.parseAcExHtmlBinaryEncoding=gn,m.parseAcExPackageManifest=Ge,m.primitiveToAcGeCurve=js,m.probePackageManifest=Ol,m.protectAcExHtmlEncodedSnapshot=rd,m.readAcExEmbeddedChunkFromDom=Cd,m.readBatchWorldOffset=ia,m.readLineBatch=bn,m.readManifestUrlFromSearchParams=co,m.readMeshBatch=kn,m.rebaseHatchPatternToLocalOffset=va,m.rebasePlainDrawableSliceAroundCentroid=_t,m.releaseExportedTextureBytes=pa,m.remapAcExSnapshotForegroundForBackground=si,m.resolveAcApHtmlExpiresAt=Wc,m.resolveAcExHtmlBackground=ri,m.resolveAcExHtmlLocale=Le,m.resolveChunkUrl=Xt,m.resolveLayoutFallbackExtents=Dd,m.resolveLayoutViewExtents=Ud,m.resolvePackageManifestUrl=oo,m.resolveViewerManifestUrl=Fl,m.setAcExSnapshotCompressor=ts,m.setHeadlessPngEncoder=vs,m.shouldEmbedAcExChunks=bd,m.snapshotMimeType=aa,m.snapshotPayloadToCompressedBytes=ra,m.snapshotSkeletonFromManifest=ao,m.splineToAcGe=Fa,m.splitDominantCluster=pr,m.splitLayoutIntoSlices=Vo,m.splitLineBatch=Oo,m.splitMeshBatch=Ho,m.splitOsnapPrimitives=Zr,m.toExtents=Qe,m.toWcsCoord=Ue,m.transformHatchPatternToWorldSpace=In,m.unionDominantCluster=ci,m.unionExtents=hr,m.unzipAcExPackageFiles=Bd,m.wcsPointToOcsArcAngle=Rn,m.writeLineBatch=vn,m.writeMeshBatch=xn,m.zipAcExPackageFiles=Id,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})}));