import{y as dt,a2 as gt,a4 as Tt,aq as it,aZ as kt,a_ as wt,h as O,a$ as At,b0 as at,g as It,I as lt,aw as Pt,ax as pt,az as Mt,b1 as rt,V as St}from"./model.vue.d813c242.js";import"./entry.c4818dcd.js";class ft extends gt{constructor(E){super(E),this.defaultDPI=90,this.defaultUnit="px"}load(E,q,L,N){const I=this,J=new Tt(I.manager);J.setPath(I.path),J.setRequestHeader(I.requestHeader),J.setWithCredentials(I.withCredentials),J.load(E,function(tt){try{q(I.parse(tt))}catch($){N?N($):console.error($),I.manager.itemError(E)}},L,N)}parse(E){const q=this;function L(i,r){if(i.nodeType!==1)return;const t=y(i);let o=!1,c=null;switch(i.nodeName){case"svg":break;case"style":I(i);break;case"g":r=z(i,r);break;case"path":r=z(i,r),i.hasAttribute("d")&&(c=N(i));break;case"rect":r=z(i,r),c=$(i);break;case"polygon":r=z(i,r),c=Y(i);break;case"polyline":r=z(i,r),c=_(i);break;case"circle":r=z(i,r),c=G(i);break;case"ellipse":r=z(i,r),c=W(i);break;case"line":r=z(i,r),c=et(i);break;case"defs":o=!0;break;case"use":r=z(i,r);const k=(i.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),m=i.viewportElement.getElementById(k);m?L(m,r):console.warn("SVGLoader: 'use node' references non-existent node id: "+k);break}c&&(r.fill!==void 0&&r.fill!=="none"&&c.color.setStyle(r.fill),M(c,D),H.push(c),c.userData={node:i,style:r});const s=i.childNodes;for(let a=0;a0?D.copy(d[d.length-1]):D.identity())}function N(i){const r=new rt,t=new O,o=new O,c=new O;let s=!0,a=!1;const m=i.getAttribute("d").match(/[a-df-z][^a-df-z]*/ig);for(let T=0,h=m.length;T0&&(t.copy(c),r.currentPath.currentPoint.copy(t),s=!0);break;default:console.warn(V)}a=!1}return r}function I(i){if(!(!i.sheet||!i.sheet.cssRules||!i.sheet.cssRules.length))for(let r=0;rc.trim());for(let c=0;ca!==""));R[o[c]]=Object.assign(R[o[c]]||{},s)}}}function J(i,r,t,o,c,s,a,k){if(r==0||t==0){i.lineTo(k.x,k.y);return}o=o*Math.PI/180,r=Math.abs(r),t=Math.abs(t);const m=(a.x-k.x)/2,T=(a.y-k.y)/2,h=Math.cos(o)*m+Math.sin(o)*T,V=-Math.sin(o)*m+Math.cos(o)*T;let u=r*r,p=t*t;const n=h*h,e=V*V,b=n/u+e/p;if(b>1){const ht=Math.sqrt(b);r=ht*r,t=ht*t,u=r*r,p=t*t}const j=u*e+p*n,X=(u*p-j)/j;let K=Math.sqrt(Math.max(0,X));c===s&&(K=-K);const st=K*r*V/t,ct=-K*t*h/r,xt=Math.cos(o)*st-Math.sin(o)*ct+(a.x+k.x)/2,mt=Math.sin(o)*st+Math.cos(o)*ct+(a.y+k.y)/2,yt=tt(1,0,(h-st)/r,(V-ct)/t),bt=tt((h-st)/r,(V-ct)/t,(-h-st)/r,(-V-ct)/t)%(Math.PI*2);i.currentPath.absellipse(xt,mt,r,t,yt,yt+bt,s===0,o)}function tt(i,r,t,o){const c=i*t+r*o,s=Math.sqrt(i*i+r*r)*Math.sqrt(t*t+o*o);let a=Math.acos(Math.max(-1,Math.min(1,c/s)));return i*o-r*t<0&&(a=-a),a}function $(i){const r=x(i.getAttribute("x")||0),t=x(i.getAttribute("y")||0),o=x(i.getAttribute("rx")||i.getAttribute("ry")||0),c=x(i.getAttribute("ry")||i.getAttribute("rx")||0),s=x(i.getAttribute("width")),a=x(i.getAttribute("height")),k=1-.551915024494,m=new rt;return m.moveTo(r+o,t),m.lineTo(r+s-o,t),(o!==0||c!==0)&&m.bezierCurveTo(r+s-o*k,t,r+s,t+c*k,r+s,t+c),m.lineTo(r+s,t+a-c),(o!==0||c!==0)&&m.bezierCurveTo(r+s,t+a-c*k,r+s-o*k,t+a,r+s-o,t+a),m.lineTo(r+o,t+a),(o!==0||c!==0)&&m.bezierCurveTo(r+o*k,t+a,r,t+a-c*k,r,t+a-c),m.lineTo(r,t+c),(o!==0||c!==0)&&m.bezierCurveTo(r,t+c*k,r+o*k,t,r+o,t),m}function Y(i){function r(s,a,k){const m=x(a),T=x(k);c===0?o.moveTo(m,T):o.lineTo(m,T),c++}const t=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,o=new rt;let c=0;return i.getAttribute("points").replace(t,r),o.currentPath.autoClose=!0,o}function _(i){function r(s,a,k){const m=x(a),T=x(k);c===0?o.moveTo(m,T):o.lineTo(m,T),c++}const t=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,o=new rt;let c=0;return i.getAttribute("points").replace(t,r),o.currentPath.autoClose=!1,o}function G(i){const r=x(i.getAttribute("cx")||0),t=x(i.getAttribute("cy")||0),o=x(i.getAttribute("r")||0),c=new at;c.absarc(r,t,o,0,Math.PI*2);const s=new rt;return s.subPaths.push(c),s}function W(i){const r=x(i.getAttribute("cx")||0),t=x(i.getAttribute("cy")||0),o=x(i.getAttribute("rx")||0),c=x(i.getAttribute("ry")||0),s=new at;s.absellipse(r,t,o,c,0,Math.PI*2);const a=new rt;return a.subPaths.push(s),a}function et(i){const r=x(i.getAttribute("x1")||0),t=x(i.getAttribute("y1")||0),o=x(i.getAttribute("x2")||0),c=x(i.getAttribute("y2")||0),s=new rt;return s.moveTo(r,t),s.lineTo(o,c),s.currentPath.autoClose=!1,s}function z(i,r){r=Object.assign({},r);let t={};if(i.hasAttribute("class")){const a=i.getAttribute("class").split(/\s/).filter(Boolean).map(k=>k.trim());for(let k=0;k0&&r.premultiply(d[d.length-1]),D.copy(r),d.push(r),r}function g(i){const r=new it,t=F;if(i.nodeName==="use"&&(i.hasAttribute("x")||i.hasAttribute("y"))){const o=x(i.getAttribute("x")),c=x(i.getAttribute("y"));r.translate(o,c)}if(i.hasAttribute("transform")){const o=i.getAttribute("transform").split(")");for(let c=o.length-1;c>=0;c--){const s=o[c].trim();if(s==="")continue;const a=s.indexOf("("),k=s.length;if(a>0&&a=1){const h=T[0];let V=h;T.length>=2&&(V=T[1]),t.translate(h,V)}break;case"rotate":if(T.length>=1){let h=0,V=0,u=0;h=-T[0]*Math.PI/180,T.length>=3&&(V=T[1],u=T[2]),v.identity().translate(-V,-u),Z.identity().rotate(h),nt.multiplyMatrices(Z,v),v.identity().translate(V,u),t.multiplyMatrices(v,nt)}break;case"scale":if(T.length>=1){const h=T[0];let V=h;T.length>=2&&(V=T[1]),t.scale(h,V)}break;case"skewX":T.length===1&&t.set(1,Math.tan(T[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":T.length===1&&t.set(1,0,0,Math.tan(T[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":T.length===6&&t.set(T[0],T[2],T[4],T[1],T[3],T[5],0,0,1);break}}r.premultiply(t)}}return r}function M(i,r){function t(s){l.set(s.x,s.y,1).applyMatrix3(r),s.set(l.x,l.y)}const o=S(r),c=i.subPaths;for(let s=0,a=c.length;s=1||nt<0||nt>1)return null;if(d===0&&v===0){for(let A=0;A<2;A++)if(J(A===0?C:x,f,w),N.loc==L.ORIGIN){const l=A===0?C:x;return{x:l.x,y:l.y,t:N.t}}else if(N.loc==L.BETWEEN){const l=+(y+N.t*(g-y)).toPrecision(10),D=+(P+N.t*(B-P)).toPrecision(10);return{x:l,y:D,t:N.t}}return null}else{for(let D=0;D<2;D++)if(J(D===0?C:x,f,w),N.loc==L.ORIGIN){const U=D===0?C:x;return{x:U.x,y:U.y,t:N.t}}const A=+(y+Z*(g-y)).toPrecision(10),l=+(P+Z*(B-P)).toPrecision(10);return{x:A,y:l,t:Z}}}function J(f,w,C){const x=C.x-w.x,y=C.y-w.y,g=f.x-w.x,M=f.y-w.y,S=x*M-g*y;if(f.x===w.x&&f.y===w.y){N.loc=L.ORIGIN,N.t=0;return}if(f.x===C.x&&f.y===C.y){N.loc=L.DESTINATION,N.t=1;return}if(S<-Number.EPSILON){N.loc=L.LEFT;return}if(S>Number.EPSILON){N.loc=L.RIGHT;return}if(x*g<0||y*M<0){N.loc=L.BEHIND;return}if(Math.sqrt(x*x+y*y)R.t<=H.t+Number.EPSILON&&R.t>=H.t-Number.EPSILON)===void 0&&(C.push(H),x.push(new O(H.x,H.y)))}}return x}function $(f,w,C){const x=new O;w.getCenter(x);const y=[];return C.forEach(g=>{g.boundingBox.containsPoint(x)&&tt(f,g.points).forEach(S=>{y.push({identifier:g.identifier,isCW:g.isCW,point:S})})}),y.sort((g,M)=>g.point.x-M.point.x),y}function Y(f,w,C,x,y){(y==null||y==="")&&(y="nonzero");const g=new O;f.boundingBox.getCenter(g);const M=[new O(C,g.y),new O(x,g.y)],S=$(M,f.boundingBox,w);S.sort((F,v)=>F.point.x-v.point.x);const P=[],B=[];S.forEach(F=>{F.identifier===f.identifier?P.push(F):B.push(F)});const H=P[0].point.x,R=[];let d=0;for(;d0&&R[R.length-1]===B[d].identifier?R.pop():R.push(B[d].identifier),d++;if(R.push(f.identifier),y==="evenodd"){const F=R.length%2===0,v=R[R.length-2];return{identifier:f.identifier,isHole:F,for:v}}else if(y==="nonzero"){let F=!0,v=null,Z=null;for(let nt=0;nt{const w=f.getPoints();let C=-999999999,x=999999999,y=-999999999,g=999999999;for(let M=0;MC&&(C=S.y),S.yy&&(y=S.x),S.x=g&&(G=g-1),{curves:f.curves,points:w,isCW:kt.isClockWise(w),identifier:_++,boundingBox:new wt(new O(g,x),new O(y,C))}});et=et.filter(f=>f.points.length>1);const z=et.map(f=>Y(f,et,G,W,E.userData.style.fillRule)),Q=[];return et.forEach(f=>{if(!z[f.identifier].isHole){const C=new At;C.curves=f.curves,z.filter(y=>y.isHole&&y.for===f.identifier).forEach(y=>{const g=et[y.identifier],M=new at;M.curves=g.curves,C.holes.push(M)}),Q.push(C)}}),Q}static getStrokeStyle(E,q,L,N,I){return E=E!==void 0?E:1,q=q!==void 0?q:"#000",L=L!==void 0?L:"miter",N=N!==void 0?N:"butt",I=I!==void 0?I:4,{strokeColor:q,strokeWidth:E,strokeLineJoin:L,strokeLineCap:N,strokeMiterLimit:I}}static pointsToStroke(E,q,L,N){const I=[],J=[],tt=[];if(ft.pointsToStrokeWithBuffers(E,q,L,N,I,J,tt)===0)return null;const $=new It;return $.setAttribute("position",new lt(I,3)),$.setAttribute("normal",new lt(J,3)),$.setAttribute("uv",new lt(tt,2)),$}static pointsToStrokeWithBuffers(E,q,L,N,I,J,tt,$){const Y=new O,_=new O,G=new O,W=new O,et=new O,z=new O,Q=new O,f=new O,w=new O,C=new O,x=new O,y=new O,g=new O,M=new O,S=new O,P=new O,B=new O;L=L!==void 0?L:12,N=N!==void 0?N:.001,$=$!==void 0?$:0,E=V(E);const H=E.length;if(H<2)return 0;const R=E[0].equals(E[H-1]);let d,F=E[0],v;const Z=q.strokeWidth/2,nt=1/(H-1);let A=0,l,D,U,ot,i=!1,r=0,t=$*3,o=$*2;c(E[0],E[1],Y).multiplyScalar(Z),f.copy(E[0]).sub(Y),w.copy(E[0]).add(Y),C.copy(f),x.copy(w);for(let u=1;u=N&&n.push(u[e]);return n.push(u[u.length-1]),n}}}const Nt=new Map,Et=new ft;var Lt=ut=>dt(Nt,ut,()=>new Promise((E,q)=>{Pt(),Et.load(ut,L=>{pt(),E(Object.freeze(L))},Mt,()=>{pt(),q()})}));export{Lt as default};