@selvajs/mcp 0.2.0-beta.3 → 0.2.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -135,9 +135,10 @@ that call. `renderViewForm` from `@selvajs/mcp/view` draws the same form in a vi
135
135
 
136
136
  ## Rendering on the server
137
137
 
138
- `captureSolve(response, { view, width, height, grid, look, background, hdr })` from
138
+ `captureSolve(response, { views, width, height, grid, look, background, hdr })` from
139
139
  `@selvajs/mcp/capture` draws a Rhino.Compute response in the same viewer as the 3D view, in a
140
- headless Chromium, and resolves to a base64 PNG for a tool's `images`. `hdr` is the environment
140
+ headless Chromium, and resolves to a base64 PNG per view (`pngs`; `png` is the first) for a
141
+ tool's `images`. The views share one scene, so each extra one costs a render, not a solve. `hdr` is the environment
141
142
  map as a URL; the page loads nothing from an origin, so a `data:` URL is the reliable form. Captures run one at a time on one browser, which closes after
142
143
  two idle minutes. It needs the optional peer `playwright-core` and a browser
143
144
  (`npx playwright install --with-deps chromium`, or `executablePath`); without them it throws
package/dist/capture.d.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  /** A camera direction, as Selva's viewer names them. */
2
2
  export type CaptureView = 'iso' | 'top' | 'front' | 'back' | 'left' | 'right' | 'bottom';
3
3
  export interface CaptureOptions {
4
+ /** One view; ignored when `views` is given. Default `iso`. */
4
5
  view?: CaptureView;
6
+ /** Several views of the one scene, a PNG each, in order. Costs a render each, not a solve. */
7
+ views?: CaptureView[];
5
8
  /** Pixels. Default 1200 × 800. */
6
9
  width?: number;
7
10
  height?: number;
@@ -32,8 +35,10 @@ export interface CaptureOptions {
32
35
  signal?: AbortSignal;
33
36
  }
34
37
  export interface Capture {
35
- /** Base64 PNG. */
38
+ /** Base64 PNG of the first view. */
36
39
  png: string;
40
+ /** Base64 PNG per view, in the order asked. */
41
+ pngs: string[];
37
42
  /** Objects drawn. Zero means the response had no display geometry and `png` is empty. */
38
43
  drawn: number;
39
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"AAEA,wDAAwD;AACxD,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzF,MAAM,WAAW,cAAc;IAC9B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,qGAAqG;IACrG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,OAAO;IACvB,kBAAkB;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,yFAAyF;IACzF,KAAK,EAAE,MAAM,CAAC;CACd;AAED,mFAAmF;AACnF,qBAAa,uBAAwB,SAAQ,KAAK;IACxC,IAAI,SAA6B;CAC1C;AAqDD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,CAc9F"}
1
+ {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"AAEA,wDAAwD;AACxD,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzF,MAAM,WAAW,cAAc;IAC9B,8DAA8D;IAC9D,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,8FAA8F;IAC9F,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;IACtB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,qGAAqG;IACrG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,OAAO;IACvB,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,yFAAyF;IACzF,KAAK,EAAE,MAAM,CAAC;CACd;AAED,mFAAmF;AACnF,qBAAa,uBAAwB,SAAQ,KAAK;IACxC,IAAI,SAA6B;CAC1C;AAqDD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,CAc9F"}
package/dist/capture.js CHANGED
@@ -73,14 +73,15 @@ async function capture(response, options) {
73
73
  await page.setViewportSize({ width: options.width ?? 1200, height: options.height ?? 800 });
74
74
  await page.setContent(html, { waitUntil: 'load' });
75
75
  const hdr = options.hdr ? await options.hdr() : undefined;
76
- return await page.evaluate((req) => globalThis.selvaCapture(req), {
76
+ const { pngs, drawn } = await page.evaluate((req) => globalThis.selvaCapture(req), {
77
77
  response,
78
- view: options.view ?? 'iso',
78
+ views: options.views?.length ? options.views : [options.view ?? 'iso'],
79
79
  grid: options.grid ?? true,
80
80
  look: options.look,
81
81
  background: options.background,
82
82
  hdr
83
83
  });
84
+ return { png: pngs[0] ?? '', pngs, drawn };
84
85
  }
85
86
  finally {
86
87
  options.signal?.removeEventListener('abort', closePage);
@@ -1 +1 @@
1
- {"version":3,"file":"capture.js","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AA4C5C,mFAAmF;AACnF,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACxC,IAAI,GAAG,yBAAyB,CAAC;CAC1C;AAkBD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,4BAA4B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5E,0FAA0F;AAC1F,MAAM,IAAI,GAAG,CAAC,yBAAyB,EAAE,6BAA6B,EAAE,wBAAwB,CAAC,CAAC;AAClG,2EAA2E;AAC3E,MAAM,aAAa,GAAG,OAAO,CAAC;AAE9B,IAAI,OAAqC,CAAC;AAC1C,IAAI,IAA+C,CAAC;AACpD,wFAAwF;AACxF,IAAI,KAAK,GAAqB,OAAO,CAAC,OAAO,EAAE,CAAC;AAEhD,KAAK,UAAU,MAAM,CAAC,cAAkC,EAAE,OAAe;IACxE,6FAA6F;IAC7F,MAAM,IAAI,GAAG,iBAAiB,CAAC;IAC/B,IAAI,QAAkB,CAAC;IACvB,IAAI,CAAC;QACJ,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAA2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AE,CAAC;IAChB,CAAC;AACF,CAAC"}
@@ -6074,7 +6074,7 @@ ${sm}`))})}function lm(e,t){let n=Math.min(1,t.transmission);if(e.userData[zu]=!
6074
6074
  varying vec2 vUv;
6075
6075
  void main() {
6076
6076
  gl_FragColor = texture2D(tFrame, vUv);
6077
- }`};function iC(e){let t=new en(1,1,{type:D,depthBuffer:!1}),n=new wa({...rC,uniforms:{tFrame:{value:null}},depthTest:!1,depthWrite:!1,toneMapped:!1,blending:5,blendSrc:213,blendDst:214}),r=new kv(n),i=(t,i)=>{n.uniforms.tFrame.value=t,n.blendAlpha=i;let a=e.autoClear;e.autoClear=!1,r.render(e),e.autoClear=a},a=()=>{e.setRenderTarget(null),i(t.texture,1)};return{add:(n,r,o,s)=>{(t.width!==o||t.height!==s)&&t.setSize(o,s),e.setRenderTarget(t),i(n,1/(r+1)),a()},present:a,dispose:()=>{t.dispose(),n.dispose(),r.dispose()}}}function aC(e){return e>=2?0:4}function oC(e){let t=e,n=t._overrideVisibility.bind(e),r=t._restoreVisibility.bind(e),i=()=>{};t._overrideVisibility=()=>{n(),i=Vu(e.scene)},t._restoreVisibility=()=>{i(),r()}}function sC(e,t,n,r,i,a){let o=new en(r,i,{type:D}),s=new Nv(e,o);s.renderTarget2.samples=0;let c=e=>{s.readBuffer=o,s.writeBuffer=s.renderTarget2,s.render(e)},l=new Pv(t,n);s.addPass(l);let u=null;(a.ambientOcclusion??!0)&&(u=new Wv(t,n,r,i),u.blendIntensity=a.aoIntensity??1,u.updateGtaoMaterial({screenSpaceRadius:!0}),oC(u),s.addPass(u));let d=null,f=null;if(a.bloom){let{strength:e,radius:t,threshold:n}=a.bloom;d=new Av(nC),s.addPass(d),f=new Qv(new K(r,i),e,t,n),s.addPass(f)}let p=new tC(t,n,r,i,typeof a.edgeDetection==`object`?a.edgeDetection:{});p.enabled=!!a.edgeDetection,s.addPass(p);let m=new Jv;s.addPass(m);let h=new Xv;s.addPass(h),e.toneMapping=a.toneMapping,e.toneMappingExposure=a.toneMappingExposure;let g=null,_=a.aoPixelRatio??1,v=1;if(u){let e=u.setSize.bind(u);u.setSize=(t,n)=>e(Math.max(1,Math.round(t*v)),Math.max(1,Math.round(n*v)))}let y=e=>{v=Math.min(e,_)/e;let t=aC(e);o.samples!==t&&(o.samples=t,o.dispose()),s.setPixelRatio(e)};return y(e.getPixelRatio()),s.setSize(r,i),{render:c,setSize:(e,t,n)=>{y(n),s.setSize(e,t)},setCamera:e=>{if(l.camera=e,p.camera=e,!u)return;u.camera=e;let t=+!!e.isPerspectiveCamera;u.gtaoMaterial.defines.PERSPECTIVE_CAMERA!==t&&(u.gtaoMaterial.defines.PERSPECTIVE_CAMERA=t,u.gtaoMaterial.needsUpdate=!0)},setEdgeDetection:e=>{p.enabled=e},edgeDetectionEnabled:()=>p.enabled,accumulate:t=>{s.renderToScreen=!1,c(0),s.renderToScreen=!0,g??=iC(e);let{texture:n,width:r,height:i}=s.readBuffer;g.add(n,t,r,i)},presentAccumulated:()=>g?.present(),setAoWeight:e=>{u&&(u.enabled=e>0,u.blendIntensity=(a.aoIntensity??1)*e)},dispose:()=>{s.dispose(),g?.dispose(),u?.dispose(),d?.dispose(),f?.dispose(),p.dispose(),m.dispose(),h.dispose()}}}function cC(e){let{renderer:t,scene:n,getActiveCamera:r,getCanvasSize:i,config:a,requestRender:o}=e,s=null,c=!!a.render.ambientOcclusion,l=!1,u=()=>({ambientOcclusion:c,bloom:a.render.bloom,toneMapping:a.render.toneMapping,toneMappingExposure:a.render.toneMappingExposure}),d=u(),f=()=>{let e=u();return e.ambientOcclusion!==d.ambientOcclusion||e.bloom!==d.bloom||e.toneMapping!==d.toneMapping||e.toneMappingExposure!==d.toneMappingExposure},p=()=>{let{width:e,height:o}=i(),s=sC(t,n,r(),Math.max(1,e),Math.max(1,o),{toneMapping:a.render.toneMapping??7,toneMappingExposure:a.render.toneMappingExposure??1,ambientOcclusion:c,aoIntensity:a.render.aoIntensity,aoPixelRatio:a.render.aoPixelRatio,bloom:a.render.bloom,edgeDetection:!1});return s.setSize(Math.max(1,e),Math.max(1,o),a.render.pixelRatio),s},m=()=>{c||l||a.render.bloom?((!s||f())&&(s?.dispose(),s=p(),d=u()),s.setEdgeDetection(l),o()):(s?.dispose(),s=null,o())};return{get:()=>s,sync:m,rebuild:()=>{s?.dispose(),s=null,m()},setAmbientOcclusion:e=>{c=e,m()},setEdgeFallback:e=>{e!==l&&(l=e,m())},isEdgeFallbackActive:()=>l,dispose:()=>{s?.dispose(),s=null}}}function lC(e,t,n){let r=new ly(e,t),i=n.camera.target;return i&&r.target.set(i.x,i.y,i.z),r.enableDamping=n.controls.enableDamping||!1,r.dampingFactor=n.controls.dampingFactor||.05,r.autoRotate=n.controls.autoRotate||!1,r.autoRotateSpeed=n.controls.autoRotateSpeed||.5,r.enableZoom=n.controls.enableZoom??!0,r.enablePan=n.controls.enablePan??!0,r.minDistance=n.controls.minDistance||.001,r.maxDistance=n.controls.maxDistance||1/0,r.screenSpacePanning=!1,r.maxPolarAngle=Math.PI,r.update(),r}function uC(e,t,n,r){if(n.environment.enableEnvironmentLighting){if(Ky(e,t,$y(n.environment.sceneUp??tb)),n.environment.hdrPath===!1){n.events.onReady?.();return}new Sy().load(n.environment.hdrPath||`/baseHDR.hdr`,function(i){if(r()){i.dispose();return}if(!i?.image){wu().warn(`HDR loaded without image data; skipping environment map.`),i?.dispose(),n.events.onReady?.();return}i.mapping=303;let a=new js(t);a.compileEquirectangularShader();let o=a.fromEquirectangular(i).texture;a.dispose(),e.environment=o,e.environmentIntensity=n.environment.environmentIntensity??1;let s=$y(n.environment.sceneUp??tb);e.environmentRotation.copy(s),n.environment.showEnvironment?(e.background=i,e.backgroundRotation.copy(s)):i.dispose(),n.events.onReady?.()},void 0,function(e){r()||(wu().warn(`HDR texture could not be loaded, falling back to basic lighting:`,e),n.events.onReady?.())})}else n.events.onReady?.()}function dC(e,t){let n=t.floor.size,r=new Oi(new pa(n,n),new Ea({color:typeof t.floor.color==`string`?new Z(t.floor.color):t.floor.color,roughness:t.floor.roughness,metalness:t.floor.metalness,side:2}));r.userData.id=`floor`,r.name=`floor`;let i=(t.environment?.sceneUp||tb).clone().normalize();r.quaternion.setFromUnitVectors(new q(0,0,1),i),r.position.set(0,0,0),t.floor.receiveShadow&&t.render.enableShadows&&(r.receiveShadow=!0),e.add(r)}var fC=.75,pC=.6,mC=.2,hC=1,gC=`#ffb020`,_C=[8,16],vC=8,yC=300,bC=30,xC=.35,SC=new Z(`#2f7bff`);function CC(e,t){let n=e.color;return n&&Math.hypot(n.r-t.r,n.g-t.g,n.b-t.b)<xC?SC:t}function wC(e,t,n){let r=CC(e,t);if(n&&`emissive`in e){let t=e;t.emissive=r.clone(),t.emissiveIntensity=pC,t.color.lerp(r,fC),t.metalness=Math.min(t.metalness,mC),t.opacity<hC&&(t.opacity=hC,t.transparent=!1,t.depthWrite=!0)}else`color`in e&&(e.color=r.clone())}function TC(e,t,n,r,i){let a=new Set,o=new Map,s=[],c=null,l=!1,u=new Xo,d=new K,f=()=>n.getActiveCamera(),p=()=>{let e=Cb(t);e.isEmpty()?wu().warn(`No objects to fit to view`):n.frameBounds(e,!1)},m=typeof r.events.selectionColor==`string`?new Z(r.events.selectionColor):r.events.selectionColor instanceof Z?r.events.selectionColor:new Z(`#ff0000`),h=new Z(gC),g=[],_=[],v=(e,n)=>{let r=e;for(;r.parent;)r=r.parent;r!==t&&(n instanceof Jr?n.dispose():n.forEach(e=>e.dispose()))},y=()=>{for(let{restore:e,material:t}of _)e(),t.dispose();_.length=0;for(let{object:e,original:t}of g){let n=e.material;n instanceof Jr&&n.dispose(),e.material=t,v(e,t)}g.length=0},b=e=>{let t=[],n=new Map;for(let{object:r,memberIndex:i}of e){if(i===null){t.push(r);continue}let e=n.get(r);e||n.set(r,e=new Set),e.add(i)}return{whole:t,membersByMesh:n}},x=(e,t=null)=>{if(y(),!e)return;let n=e instanceof An?[{object:e,memberIndex:t}]:e,{whole:r,membersByMesh:i}=b(n);for(let[e,t]of i){if(!(e instanceof Oi)){r.push(e);continue}let n=_h(e).clone();wC(n,h,!0),_.push({restore:gx(e,t,n,`hover`),material:n})}for(let e of r){if(a.has(e))continue;let t=e;if(!(t.material instanceof Jr))continue;let n=vh(t.material);wC(n,h,e instanceof Oi),g.push({object:t,original:t.material}),t.material=n}},S=()=>{for(let{restore:e,material:t}of s)e(),t.dispose();s.length=0,a.forEach(e=>{let t=e;if(o.has(e)){let n=o.get(e),r=t.material;r instanceof Jr?r.dispose():Array.isArray(r)&&r.forEach(e=>e.dispose()),t.material=n,o.delete(e),v(e,n)}}),a.clear(),c=null,l=!1},C=(e,t)=>{if(t&&e instanceof Oi){let n=_h(e).clone();return wC(n,m,!0),s.push({restore:gx(e,t,n),material:n}),!0}let n=e;if(!(n.material instanceof Jr))return!1;let r=vh(n.material);return wC(r,m,e instanceof Oi),o.set(e,n.material),n.material=r,!0},w=e=>{let{whole:t,membersByMesh:n}=b(e);for(let e of t)a.add(e),C(e,null);for(let[e,t]of n)a.add(e),C(e,t)},T=e=>{(e.length!==0||l)&&(y(),S(),w(e),l=e.length>0)},E=null,D=-1,O=()=>{if(E===null||t.children.length!==D){let e=Cb(t);E=e.isEmpty()?1:e.getSize(new q).length(),D=t.children.length}u.params.Points.threshold=E*.01},k=(t,n)=>{let r=e.getBoundingClientRect();d.x=(t-r.left)/r.width*2-1,d.y=-((n-r.top)/r.height)*2+1},A=(e,n)=>(k(e,n),O(),u.setFromCamera(d,f()),Zx(t,u)[0]??null),j=(e,t,n)=>{let r=A(e,t);if(r||!n)return r;for(let n of _C){let r=null;for(let i=0;i<vC;i++){let a=i/vC*Math.PI*2,o=A(e+Math.cos(a)*n,t+Math.sin(a)*n);o&&(!r||o.distance<r.distance)&&(r=o)}if(r)return r}return null},M=null,N=e=>{let t=M;if(M={time:e.timeStamp,x:e.clientX,y:e.clientY},!t)return!1;let n=e.timeStamp-t.time<=yC&&Math.hypot(e.clientX-t.x,e.clientY-t.y)<=bC;return n&&(M=null),n},P=e=>{if(!i.wasTap())return;let n=i.pointerType()!==`mouse`;if(n&&N(e)){I(e.clientX,e.clientY,!0);return}let a=j(e.clientX,e.clientY,n);if(!a){S(),k(e.clientX,e.clientY),r.events?.onBackgroundClicked?.({x:d.x,y:d.y});return}let o=a.object,s=fx(a),u=s?.index??null;(l||c?.object!==o||c.memberIndex!==u)&&(y(),S(),c={object:o,memberIndex:u},w(mx(t,a)),r.events?.onObjectSelected?.(o),s?r.events?.onMeshMetadataClicked?.({source:o.userData?.source,name:s.member.name,layer:s.member.layer,trackingKey:s.member.trackingKey,metadata:s.member.metadata}):o instanceof Oi&&Object.keys(o.userData).length>0&&r.events?.onMeshMetadataClicked?.(o.userData))},F=e=>{i.wasTap()&&i.pointerType()===`mouse`&&I(e.clientX,e.clientY,!1)},I=(e,i,a)=>{let o=j(e,i,a);if(!o){r.events?.enableDoubleClickZoom&&n.frameBounds(Cb(t),!0);return}let s=o.object;if(r.events?.onMeshDoubleClicked?.(s),!r.events?.enableDoubleClickZoom)return;let c=new er;for(let{object:e,memberIndex:n}of mx(t,o)){let t=n===null?null:dx(e)?.[n];c.union(t&&e instanceof Oi?hx(e,t):new er().setFromObject(e))}c.isEmpty()||n.frameBounds(c,!0)},ee=e=>{if(r.events?.enableKeyboardControls)switch(e.key.toLowerCase()){case`f`:e.preventDefault(),p();break;case`escape`:e.preventDefault(),S();break;case` `:e.preventDefault(),p()}};return r.events?.enableClickToFocus&&(e.addEventListener(`click`,P),e.addEventListener(`dblclick`,F)),r.events?.enableKeyboardControls&&(e.setAttribute(`tabindex`,`0`),e.addEventListener(`keydown`,ee)),{dispose:()=>{e.removeEventListener(`click`,P),e.removeEventListener(`dblclick`,F),e.removeEventListener(`keydown`,ee),y(),S()},fitToView:p,clearSelection:S,selectEntries:T,setHover:x}}var EC=5,DC=10,OC=500;function kC(e){let t=new Map,n=`mouse`,r=0,i=0,a=0,o=!1,s=!1,c=e=>{let n=t.get(e.pointerId);n&&(a=Math.max(a,Math.hypot(e.clientX-n.x,e.clientY-n.y)))},l=e=>{t.size===0&&(n=e.pointerType,r=e.timeStamp,i=0,a=0,o=!1),t.set(e.pointerId,{x:e.clientX,y:e.clientY}),i=Math.max(i,t.size)},u=e=>c(e),d=e=>{if(!t.has(e.pointerId)||(c(e),e.type===`pointercancel`&&(o=!0),t.delete(e.pointerId),t.size>0))return;let l=n===`mouse`;s=!o&&i===1&&a<=(l?EC:DC)&&(l||e.timeStamp-r<=OC)},f={capture:!0,passive:!0};return e.addEventListener(`pointerdown`,l,f),e.addEventListener(`pointermove`,u,f),e.addEventListener(`pointerup`,d,f),e.addEventListener(`pointercancel`,d,f),{wasTap:()=>s,pointerType:()=>n,dispose:()=>{e.removeEventListener(`pointerdown`,l,f),e.removeEventListener(`pointermove`,u,f),e.removeEventListener(`pointerup`,d,f),e.removeEventListener(`pointercancel`,d,f)}}}function AC(e,t,n){let r=new bu({antialias:t.render.antialias,canvas:e,alpha:!0,powerPreference:`high-performance`,preserveDrawingBuffer:t.render.preserveDrawingBuffer,logarithmicDepthBuffer:!1}),i=e.parentElement,a=i?i.clientWidth:window.innerWidth,o=i?i.clientHeight:window.innerHeight;return i&&(e.style.width=`100%`,e.style.height=`100%`,e.style.display=`block`),r.setSize(a,o,!1),r.setPixelRatio(n),t.render.enableShadows&&(r.shadowMap.enabled=!0,r.shadowMap.type=3),r.toneMapping=t.render.toneMapping,r.toneMappingExposure=t.render.toneMappingExposure??1,r.outputColorSpace=We,r.sortObjects=!0,r}var jC=function(e,t){let n=rb(t||{}),r=n.environment?.sceneUp||tb,i=n.render.pixelRatio??Math.min(window.devicePixelRatio,2),a=YS(i,Eu(n.look,n.render.lowPower));n.render.pixelRatio=a;let o=QS(n),s=ZS(n,e);s.up.copy(r);let c=AC(e,n,a);Lu(c.capabilities.getMaxAnisotropy()),t?.onMaxAnisotropy?.(c.capabilities.getMaxAnisotropy());let l=lC(s,e,n),u=Ob({scene:o,perspective:s,controls:l,onActiveCameraChange:()=>{},up:r}),d=()=>u.getActiveCamera(),f=!1;uC(o,c,n,()=>f);let p=hb(o,n),m=p.sun,h=()=>{m&&_b(m,Cb(o))};n.floor?.enabled&&dC(o,n);let g=n.floor?.enabled?o.children.find(e=>e.userData.id===`floor`)??null:null,_=n.grid.enabled?zx({cellSize:n.grid.cellSize,majorEvery:n.grid.majorEvery,cellColor:n.grid.cellColor,majorColor:n.grid.majorColor,fadeDistance:n.grid.fadeDistance,plane:n.grid.plane}):null;_&&o.add(_.object);let v=()=>{_&&_.fitToContent(Cb(o))},y=n.gizmo.enabled?ES({camera:s,domElement:e,controller:u}):null,b=n.grid.plane??eb(r),x=new q(+(b===`x`),+(b===`y`),+(b===`z`)),S=r.clone().normalize(),C=n.camera.dynamicNear?yS({camera:s,scene:o,groundNormals:()=>{let e=[];return _?.object.visible&&e.push(x),n.floor.enabled&&g?.visible&&e.push(S),e}}):null,w=Bx(e.parentElement??e,o),T=n.measure.enabled?pS({canvas:e,scene:o,getActiveCamera:d,getViewTarget:()=>l.target,requestRender:()=>j(),labelLayer:w,options:{snapPixels:n.measure.snapPixels,color:n.measure.color,labelClassName:n.measure.labelClassName,displayUnit:n.measure.displayUnit,format:n.measure.format}}):null,E=kC(e),D=n.events.enableEventHandlers===!1?{dispose:()=>{},fitToView:()=>{},clearSelection:()=>{},selectEntries:()=>{},setHover:()=>{}}:TC(e,o,u,n,E),O=TS();T&&O.register({id:`measure`,tool:T,priority:0}),y&&O.register({id:`gizmo`,tool:y,priority:-100});let k=e=>{E.wasTap()&&O.handleClick(e)&&e.stopImmediatePropagation()};e.addEventListener(`click`,k,{capture:!0});let A=e=>O.handleMove(e);e.addEventListener(`mousemove`,A,{passive:!0});let j=()=>{},M=(e,t)=>{Px(e,{color:n.edges.color,darken:n.edges.darken,width:n.edges.width,thresholdAngle:n.edges.thresholdAngle,distanceFade:n.edges.distanceFade,maxTriangles:n.edges.maxTriangles,maxSegments:n.edges.maxSegments,maxOverlays:n.edges.maxOverlays,...t}).then(()=>{N(e),j()})},N=e=>{if(n.edges.screenSpaceFallback===!1)return;let t=!1;e.traverse(e=>{let n=e.userData?.edgesSkipped;(n===`triangle-cap`||n===`overlay-budget`)&&(t=!0)}),ee.setEdgeFallback(t)},P=e=>{Fx(e),ee.setEdgeFallback(!1),j()},F=e.parentElement,I=()=>F?{width:F.clientWidth,height:F.clientHeight}:{width:window.innerWidth,height:window.innerHeight},ee=cC({renderer:c,scene:o,getActiveCamera:d,getCanvasSize:I,config:n,requestRender:()=>j()});ee.sync();let te=XS({scene:o,renderer:c,lights:p,config:n,pipeline:ee,fullPixelRatio:i,requestRender:()=>j()}),ne,re=lb({scene:o,renderer:c,getPipeline:()=>ee.get(),frames:n.render.idleRefineFrames,lightOrbitFrameMs:n.render.lightOrbitFrameMs,jitterLights:e=>{m&&(ne=gb(m,e)),te.jitterEmissiveLights(e)},restoreLights:()=>{ne?.(),te.settleEmissiveLights()}}),{animate:ie,dispose:ae,invalidate:L,renderNow:R}=DS(c,o,s,d,u,l,I,()=>n.render.pixelRatio,n.events.onFrame,_,y,()=>ee.get(),w,C,n.render.onDemand??!0,re);return j=L,ie(),o.up.set(r.x,r.y,r.z),h(),v(),{scene:o,camera:s,controls:l,renderer:c,cameraController:u,grid:_,gizmo:y,measureTool:T,labelLayer:w,tools:O,applyEdges:M,clearEdges:P,invalidate:L,captureImage:(e=`image/png`,t)=>(R(),new Promise(n=>c.domElement.toBlob(n,e,t))),setAmbientOcclusion:ee.setAmbientOcclusion,setLook:te.setLook,syncEmissiveLights:te.syncEmissiveLights,setFillLights:te.setFillLights,setEnvironmentIntensity:te.setEnvironmentIntensity,setToneMappingExposure:te.setToneMappingExposure,setAoIntensity:te.setAoIntensity,getMaterialAppearance:te.getMaterialAppearance,updateShadowBounds:h,updateGridScale:v,dispose:()=>{f||(f=!0,ae(),D.dispose(),E.dispose(),e.removeEventListener(`click`,k,{capture:!0}),e.removeEventListener(`mousemove`,A),T?.dispose(),w?.dispose(),y?.dispose(),_?.dispose(),ee.dispose(),u.dispose(),l.dispose(),c.dispose(),c.forceContextLoss(),$S(o))},fitToView:D.fitToView,clearSelection:D.clearSelection,selectEntries:e=>{D.selectEntries(e),L()},setHover:(e,t)=>{D.setHover(e,t),L()},addUserGeometry:(e,t)=>{e.userData.source=t===void 0?wy:Ey(t),o.add(e),j()},removeUserGeometry:e=>{e.removeFromParent(),Wu(e),j()},clearUserGeometry:e=>{o.children.filter(t=>ky(t,e)).forEach(e=>{e.removeFromParent(),Wu(e)}),j()}}},MC=1e4,NC=()=>new Promise(e=>requestAnimationFrame(()=>e(void 0)));window.selvaCapture=async({response:e,view:t,grid:n,look:r,background:i,hdr:a})=>{let o=document.createElement(`canvas`);o.style.cssText=`display:block;width:100%;height:100%`,document.getElementById(`stage`).append(o);let s,c=new Promise(e=>s=e),l=jC(o,{look:Cy.includes(r)?r:`technical`,onMaxAnisotropy:Ap,environment:{hdrPath:a??!1,...i&&{backgroundColor:i}},events:{enableEventHandlers:!1,onReady:()=>s()}});await Promise.race([c,new Promise(e=>setTimeout(e,MC))]);let u=await Zm(e,{parsing:{material:l.getMaterialAppearance()}});if(yb(l.scene,u,l.camera,l.controls,!1),!u.length)return{png:``,drawn:0};l.grid?.setVisible(n),l.updateGridScale(),l.updateShadowBounds(),l.syncEmissiveLights(),l.cameraController.setView(t,!1),await NC(),await NC();let d=await l.captureImage(`image/png`);if(!d)return{png:``,drawn:u.length};let f=new Uint8Array(await d.arrayBuffer()),p=``;for(let e=0;e<f.length;e+=32768)p+=String.fromCharCode(...f.subarray(e,e+32768));return{png:btoa(p),drawn:u.length}};</script>
6077
+ }`};function iC(e){let t=new en(1,1,{type:D,depthBuffer:!1}),n=new wa({...rC,uniforms:{tFrame:{value:null}},depthTest:!1,depthWrite:!1,toneMapped:!1,blending:5,blendSrc:213,blendDst:214}),r=new kv(n),i=(t,i)=>{n.uniforms.tFrame.value=t,n.blendAlpha=i;let a=e.autoClear;e.autoClear=!1,r.render(e),e.autoClear=a},a=()=>{e.setRenderTarget(null),i(t.texture,1)};return{add:(n,r,o,s)=>{(t.width!==o||t.height!==s)&&t.setSize(o,s),e.setRenderTarget(t),i(n,1/(r+1)),a()},present:a,dispose:()=>{t.dispose(),n.dispose(),r.dispose()}}}function aC(e){return e>=2?0:4}function oC(e){let t=e,n=t._overrideVisibility.bind(e),r=t._restoreVisibility.bind(e),i=()=>{};t._overrideVisibility=()=>{n(),i=Vu(e.scene)},t._restoreVisibility=()=>{i(),r()}}function sC(e,t,n,r,i,a){let o=new en(r,i,{type:D}),s=new Nv(e,o);s.renderTarget2.samples=0;let c=e=>{s.readBuffer=o,s.writeBuffer=s.renderTarget2,s.render(e)},l=new Pv(t,n);s.addPass(l);let u=null;(a.ambientOcclusion??!0)&&(u=new Wv(t,n,r,i),u.blendIntensity=a.aoIntensity??1,u.updateGtaoMaterial({screenSpaceRadius:!0}),oC(u),s.addPass(u));let d=null,f=null;if(a.bloom){let{strength:e,radius:t,threshold:n}=a.bloom;d=new Av(nC),s.addPass(d),f=new Qv(new K(r,i),e,t,n),s.addPass(f)}let p=new tC(t,n,r,i,typeof a.edgeDetection==`object`?a.edgeDetection:{});p.enabled=!!a.edgeDetection,s.addPass(p);let m=new Jv;s.addPass(m);let h=new Xv;s.addPass(h),e.toneMapping=a.toneMapping,e.toneMappingExposure=a.toneMappingExposure;let g=null,_=a.aoPixelRatio??1,v=1;if(u){let e=u.setSize.bind(u);u.setSize=(t,n)=>e(Math.max(1,Math.round(t*v)),Math.max(1,Math.round(n*v)))}let y=e=>{v=Math.min(e,_)/e;let t=aC(e);o.samples!==t&&(o.samples=t,o.dispose()),s.setPixelRatio(e)};return y(e.getPixelRatio()),s.setSize(r,i),{render:c,setSize:(e,t,n)=>{y(n),s.setSize(e,t)},setCamera:e=>{if(l.camera=e,p.camera=e,!u)return;u.camera=e;let t=+!!e.isPerspectiveCamera;u.gtaoMaterial.defines.PERSPECTIVE_CAMERA!==t&&(u.gtaoMaterial.defines.PERSPECTIVE_CAMERA=t,u.gtaoMaterial.needsUpdate=!0)},setEdgeDetection:e=>{p.enabled=e},edgeDetectionEnabled:()=>p.enabled,accumulate:t=>{s.renderToScreen=!1,c(0),s.renderToScreen=!0,g??=iC(e);let{texture:n,width:r,height:i}=s.readBuffer;g.add(n,t,r,i)},presentAccumulated:()=>g?.present(),setAoWeight:e=>{u&&(u.enabled=e>0,u.blendIntensity=(a.aoIntensity??1)*e)},dispose:()=>{s.dispose(),g?.dispose(),u?.dispose(),d?.dispose(),f?.dispose(),p.dispose(),m.dispose(),h.dispose()}}}function cC(e){let{renderer:t,scene:n,getActiveCamera:r,getCanvasSize:i,config:a,requestRender:o}=e,s=null,c=!!a.render.ambientOcclusion,l=!1,u=()=>({ambientOcclusion:c,bloom:a.render.bloom,toneMapping:a.render.toneMapping,toneMappingExposure:a.render.toneMappingExposure}),d=u(),f=()=>{let e=u();return e.ambientOcclusion!==d.ambientOcclusion||e.bloom!==d.bloom||e.toneMapping!==d.toneMapping||e.toneMappingExposure!==d.toneMappingExposure},p=()=>{let{width:e,height:o}=i(),s=sC(t,n,r(),Math.max(1,e),Math.max(1,o),{toneMapping:a.render.toneMapping??7,toneMappingExposure:a.render.toneMappingExposure??1,ambientOcclusion:c,aoIntensity:a.render.aoIntensity,aoPixelRatio:a.render.aoPixelRatio,bloom:a.render.bloom,edgeDetection:!1});return s.setSize(Math.max(1,e),Math.max(1,o),a.render.pixelRatio),s},m=()=>{c||l||a.render.bloom?((!s||f())&&(s?.dispose(),s=p(),d=u()),s.setEdgeDetection(l),o()):(s?.dispose(),s=null,o())};return{get:()=>s,sync:m,rebuild:()=>{s?.dispose(),s=null,m()},setAmbientOcclusion:e=>{c=e,m()},setEdgeFallback:e=>{e!==l&&(l=e,m())},isEdgeFallbackActive:()=>l,dispose:()=>{s?.dispose(),s=null}}}function lC(e,t,n){let r=new ly(e,t),i=n.camera.target;return i&&r.target.set(i.x,i.y,i.z),r.enableDamping=n.controls.enableDamping||!1,r.dampingFactor=n.controls.dampingFactor||.05,r.autoRotate=n.controls.autoRotate||!1,r.autoRotateSpeed=n.controls.autoRotateSpeed||.5,r.enableZoom=n.controls.enableZoom??!0,r.enablePan=n.controls.enablePan??!0,r.minDistance=n.controls.minDistance||.001,r.maxDistance=n.controls.maxDistance||1/0,r.screenSpacePanning=!1,r.maxPolarAngle=Math.PI,r.update(),r}function uC(e,t,n,r){if(n.environment.enableEnvironmentLighting){if(Ky(e,t,$y(n.environment.sceneUp??tb)),n.environment.hdrPath===!1){n.events.onReady?.();return}new Sy().load(n.environment.hdrPath||`/baseHDR.hdr`,function(i){if(r()){i.dispose();return}if(!i?.image){wu().warn(`HDR loaded without image data; skipping environment map.`),i?.dispose(),n.events.onReady?.();return}i.mapping=303;let a=new js(t);a.compileEquirectangularShader();let o=a.fromEquirectangular(i).texture;a.dispose(),e.environment=o,e.environmentIntensity=n.environment.environmentIntensity??1;let s=$y(n.environment.sceneUp??tb);e.environmentRotation.copy(s),n.environment.showEnvironment?(e.background=i,e.backgroundRotation.copy(s)):i.dispose(),n.events.onReady?.()},void 0,function(e){r()||(wu().warn(`HDR texture could not be loaded, falling back to basic lighting:`,e),n.events.onReady?.())})}else n.events.onReady?.()}function dC(e,t){let n=t.floor.size,r=new Oi(new pa(n,n),new Ea({color:typeof t.floor.color==`string`?new Z(t.floor.color):t.floor.color,roughness:t.floor.roughness,metalness:t.floor.metalness,side:2}));r.userData.id=`floor`,r.name=`floor`;let i=(t.environment?.sceneUp||tb).clone().normalize();r.quaternion.setFromUnitVectors(new q(0,0,1),i),r.position.set(0,0,0),t.floor.receiveShadow&&t.render.enableShadows&&(r.receiveShadow=!0),e.add(r)}var fC=.75,pC=.6,mC=.2,hC=1,gC=`#ffb020`,_C=[8,16],vC=8,yC=300,bC=30,xC=.35,SC=new Z(`#2f7bff`);function CC(e,t){let n=e.color;return n&&Math.hypot(n.r-t.r,n.g-t.g,n.b-t.b)<xC?SC:t}function wC(e,t,n){let r=CC(e,t);if(n&&`emissive`in e){let t=e;t.emissive=r.clone(),t.emissiveIntensity=pC,t.color.lerp(r,fC),t.metalness=Math.min(t.metalness,mC),t.opacity<hC&&(t.opacity=hC,t.transparent=!1,t.depthWrite=!0)}else`color`in e&&(e.color=r.clone())}function TC(e,t,n,r,i){let a=new Set,o=new Map,s=[],c=null,l=!1,u=new Xo,d=new K,f=()=>n.getActiveCamera(),p=()=>{let e=Cb(t);e.isEmpty()?wu().warn(`No objects to fit to view`):n.frameBounds(e,!1)},m=typeof r.events.selectionColor==`string`?new Z(r.events.selectionColor):r.events.selectionColor instanceof Z?r.events.selectionColor:new Z(`#ff0000`),h=new Z(gC),g=[],_=[],v=(e,n)=>{let r=e;for(;r.parent;)r=r.parent;r!==t&&(n instanceof Jr?n.dispose():n.forEach(e=>e.dispose()))},y=()=>{for(let{restore:e,material:t}of _)e(),t.dispose();_.length=0;for(let{object:e,original:t}of g){let n=e.material;n instanceof Jr&&n.dispose(),e.material=t,v(e,t)}g.length=0},b=e=>{let t=[],n=new Map;for(let{object:r,memberIndex:i}of e){if(i===null){t.push(r);continue}let e=n.get(r);e||n.set(r,e=new Set),e.add(i)}return{whole:t,membersByMesh:n}},x=(e,t=null)=>{if(y(),!e)return;let n=e instanceof An?[{object:e,memberIndex:t}]:e,{whole:r,membersByMesh:i}=b(n);for(let[e,t]of i){if(!(e instanceof Oi)){r.push(e);continue}let n=_h(e).clone();wC(n,h,!0),_.push({restore:gx(e,t,n,`hover`),material:n})}for(let e of r){if(a.has(e))continue;let t=e;if(!(t.material instanceof Jr))continue;let n=vh(t.material);wC(n,h,e instanceof Oi),g.push({object:t,original:t.material}),t.material=n}},S=()=>{for(let{restore:e,material:t}of s)e(),t.dispose();s.length=0,a.forEach(e=>{let t=e;if(o.has(e)){let n=o.get(e),r=t.material;r instanceof Jr?r.dispose():Array.isArray(r)&&r.forEach(e=>e.dispose()),t.material=n,o.delete(e),v(e,n)}}),a.clear(),c=null,l=!1},C=(e,t)=>{if(t&&e instanceof Oi){let n=_h(e).clone();return wC(n,m,!0),s.push({restore:gx(e,t,n),material:n}),!0}let n=e;if(!(n.material instanceof Jr))return!1;let r=vh(n.material);return wC(r,m,e instanceof Oi),o.set(e,n.material),n.material=r,!0},w=e=>{let{whole:t,membersByMesh:n}=b(e);for(let e of t)a.add(e),C(e,null);for(let[e,t]of n)a.add(e),C(e,t)},T=e=>{(e.length!==0||l)&&(y(),S(),w(e),l=e.length>0)},E=null,D=-1,O=()=>{if(E===null||t.children.length!==D){let e=Cb(t);E=e.isEmpty()?1:e.getSize(new q).length(),D=t.children.length}u.params.Points.threshold=E*.01},k=(t,n)=>{let r=e.getBoundingClientRect();d.x=(t-r.left)/r.width*2-1,d.y=-((n-r.top)/r.height)*2+1},A=(e,n)=>(k(e,n),O(),u.setFromCamera(d,f()),Zx(t,u)[0]??null),j=(e,t,n)=>{let r=A(e,t);if(r||!n)return r;for(let n of _C){let r=null;for(let i=0;i<vC;i++){let a=i/vC*Math.PI*2,o=A(e+Math.cos(a)*n,t+Math.sin(a)*n);o&&(!r||o.distance<r.distance)&&(r=o)}if(r)return r}return null},M=null,N=e=>{let t=M;if(M={time:e.timeStamp,x:e.clientX,y:e.clientY},!t)return!1;let n=e.timeStamp-t.time<=yC&&Math.hypot(e.clientX-t.x,e.clientY-t.y)<=bC;return n&&(M=null),n},P=e=>{if(!i.wasTap())return;let n=i.pointerType()!==`mouse`;if(n&&N(e)){I(e.clientX,e.clientY,!0);return}let a=j(e.clientX,e.clientY,n);if(!a){S(),k(e.clientX,e.clientY),r.events?.onBackgroundClicked?.({x:d.x,y:d.y});return}let o=a.object,s=fx(a),u=s?.index??null;(l||c?.object!==o||c.memberIndex!==u)&&(y(),S(),c={object:o,memberIndex:u},w(mx(t,a)),r.events?.onObjectSelected?.(o),s?r.events?.onMeshMetadataClicked?.({source:o.userData?.source,name:s.member.name,layer:s.member.layer,trackingKey:s.member.trackingKey,metadata:s.member.metadata}):o instanceof Oi&&Object.keys(o.userData).length>0&&r.events?.onMeshMetadataClicked?.(o.userData))},F=e=>{i.wasTap()&&i.pointerType()===`mouse`&&I(e.clientX,e.clientY,!1)},I=(e,i,a)=>{let o=j(e,i,a);if(!o){r.events?.enableDoubleClickZoom&&n.frameBounds(Cb(t),!0);return}let s=o.object;if(r.events?.onMeshDoubleClicked?.(s),!r.events?.enableDoubleClickZoom)return;let c=new er;for(let{object:e,memberIndex:n}of mx(t,o)){let t=n===null?null:dx(e)?.[n];c.union(t&&e instanceof Oi?hx(e,t):new er().setFromObject(e))}c.isEmpty()||n.frameBounds(c,!0)},ee=e=>{if(r.events?.enableKeyboardControls)switch(e.key.toLowerCase()){case`f`:e.preventDefault(),p();break;case`escape`:e.preventDefault(),S();break;case` `:e.preventDefault(),p()}};return r.events?.enableClickToFocus&&(e.addEventListener(`click`,P),e.addEventListener(`dblclick`,F)),r.events?.enableKeyboardControls&&(e.setAttribute(`tabindex`,`0`),e.addEventListener(`keydown`,ee)),{dispose:()=>{e.removeEventListener(`click`,P),e.removeEventListener(`dblclick`,F),e.removeEventListener(`keydown`,ee),y(),S()},fitToView:p,clearSelection:S,selectEntries:T,setHover:x}}var EC=5,DC=10,OC=500;function kC(e){let t=new Map,n=`mouse`,r=0,i=0,a=0,o=!1,s=!1,c=e=>{let n=t.get(e.pointerId);n&&(a=Math.max(a,Math.hypot(e.clientX-n.x,e.clientY-n.y)))},l=e=>{t.size===0&&(n=e.pointerType,r=e.timeStamp,i=0,a=0,o=!1),t.set(e.pointerId,{x:e.clientX,y:e.clientY}),i=Math.max(i,t.size)},u=e=>c(e),d=e=>{if(!t.has(e.pointerId)||(c(e),e.type===`pointercancel`&&(o=!0),t.delete(e.pointerId),t.size>0))return;let l=n===`mouse`;s=!o&&i===1&&a<=(l?EC:DC)&&(l||e.timeStamp-r<=OC)},f={capture:!0,passive:!0};return e.addEventListener(`pointerdown`,l,f),e.addEventListener(`pointermove`,u,f),e.addEventListener(`pointerup`,d,f),e.addEventListener(`pointercancel`,d,f),{wasTap:()=>s,pointerType:()=>n,dispose:()=>{e.removeEventListener(`pointerdown`,l,f),e.removeEventListener(`pointermove`,u,f),e.removeEventListener(`pointerup`,d,f),e.removeEventListener(`pointercancel`,d,f)}}}function AC(e,t,n){let r=new bu({antialias:t.render.antialias,canvas:e,alpha:!0,powerPreference:`high-performance`,preserveDrawingBuffer:t.render.preserveDrawingBuffer,logarithmicDepthBuffer:!1}),i=e.parentElement,a=i?i.clientWidth:window.innerWidth,o=i?i.clientHeight:window.innerHeight;return i&&(e.style.width=`100%`,e.style.height=`100%`,e.style.display=`block`),r.setSize(a,o,!1),r.setPixelRatio(n),t.render.enableShadows&&(r.shadowMap.enabled=!0,r.shadowMap.type=3),r.toneMapping=t.render.toneMapping,r.toneMappingExposure=t.render.toneMappingExposure??1,r.outputColorSpace=We,r.sortObjects=!0,r}var jC=function(e,t){let n=rb(t||{}),r=n.environment?.sceneUp||tb,i=n.render.pixelRatio??Math.min(window.devicePixelRatio,2),a=YS(i,Eu(n.look,n.render.lowPower));n.render.pixelRatio=a;let o=QS(n),s=ZS(n,e);s.up.copy(r);let c=AC(e,n,a);Lu(c.capabilities.getMaxAnisotropy()),t?.onMaxAnisotropy?.(c.capabilities.getMaxAnisotropy());let l=lC(s,e,n),u=Ob({scene:o,perspective:s,controls:l,onActiveCameraChange:()=>{},up:r}),d=()=>u.getActiveCamera(),f=!1;uC(o,c,n,()=>f);let p=hb(o,n),m=p.sun,h=()=>{m&&_b(m,Cb(o))};n.floor?.enabled&&dC(o,n);let g=n.floor?.enabled?o.children.find(e=>e.userData.id===`floor`)??null:null,_=n.grid.enabled?zx({cellSize:n.grid.cellSize,majorEvery:n.grid.majorEvery,cellColor:n.grid.cellColor,majorColor:n.grid.majorColor,fadeDistance:n.grid.fadeDistance,plane:n.grid.plane}):null;_&&o.add(_.object);let v=()=>{_&&_.fitToContent(Cb(o))},y=n.gizmo.enabled?ES({camera:s,domElement:e,controller:u}):null,b=n.grid.plane??eb(r),x=new q(+(b===`x`),+(b===`y`),+(b===`z`)),S=r.clone().normalize(),C=n.camera.dynamicNear?yS({camera:s,scene:o,groundNormals:()=>{let e=[];return _?.object.visible&&e.push(x),n.floor.enabled&&g?.visible&&e.push(S),e}}):null,w=Bx(e.parentElement??e,o),T=n.measure.enabled?pS({canvas:e,scene:o,getActiveCamera:d,getViewTarget:()=>l.target,requestRender:()=>j(),labelLayer:w,options:{snapPixels:n.measure.snapPixels,color:n.measure.color,labelClassName:n.measure.labelClassName,displayUnit:n.measure.displayUnit,format:n.measure.format}}):null,E=kC(e),D=n.events.enableEventHandlers===!1?{dispose:()=>{},fitToView:()=>{},clearSelection:()=>{},selectEntries:()=>{},setHover:()=>{}}:TC(e,o,u,n,E),O=TS();T&&O.register({id:`measure`,tool:T,priority:0}),y&&O.register({id:`gizmo`,tool:y,priority:-100});let k=e=>{E.wasTap()&&O.handleClick(e)&&e.stopImmediatePropagation()};e.addEventListener(`click`,k,{capture:!0});let A=e=>O.handleMove(e);e.addEventListener(`mousemove`,A,{passive:!0});let j=()=>{},M=(e,t)=>{Px(e,{color:n.edges.color,darken:n.edges.darken,width:n.edges.width,thresholdAngle:n.edges.thresholdAngle,distanceFade:n.edges.distanceFade,maxTriangles:n.edges.maxTriangles,maxSegments:n.edges.maxSegments,maxOverlays:n.edges.maxOverlays,...t}).then(()=>{N(e),j()})},N=e=>{if(n.edges.screenSpaceFallback===!1)return;let t=!1;e.traverse(e=>{let n=e.userData?.edgesSkipped;(n===`triangle-cap`||n===`overlay-budget`)&&(t=!0)}),ee.setEdgeFallback(t)},P=e=>{Fx(e),ee.setEdgeFallback(!1),j()},F=e.parentElement,I=()=>F?{width:F.clientWidth,height:F.clientHeight}:{width:window.innerWidth,height:window.innerHeight},ee=cC({renderer:c,scene:o,getActiveCamera:d,getCanvasSize:I,config:n,requestRender:()=>j()});ee.sync();let te=XS({scene:o,renderer:c,lights:p,config:n,pipeline:ee,fullPixelRatio:i,requestRender:()=>j()}),ne,re=lb({scene:o,renderer:c,getPipeline:()=>ee.get(),frames:n.render.idleRefineFrames,lightOrbitFrameMs:n.render.lightOrbitFrameMs,jitterLights:e=>{m&&(ne=gb(m,e)),te.jitterEmissiveLights(e)},restoreLights:()=>{ne?.(),te.settleEmissiveLights()}}),{animate:ie,dispose:ae,invalidate:L,renderNow:R}=DS(c,o,s,d,u,l,I,()=>n.render.pixelRatio,n.events.onFrame,_,y,()=>ee.get(),w,C,n.render.onDemand??!0,re);return j=L,ie(),o.up.set(r.x,r.y,r.z),h(),v(),{scene:o,camera:s,controls:l,renderer:c,cameraController:u,grid:_,gizmo:y,measureTool:T,labelLayer:w,tools:O,applyEdges:M,clearEdges:P,invalidate:L,captureImage:(e=`image/png`,t)=>(R(),new Promise(n=>c.domElement.toBlob(n,e,t))),setAmbientOcclusion:ee.setAmbientOcclusion,setLook:te.setLook,syncEmissiveLights:te.syncEmissiveLights,setFillLights:te.setFillLights,setEnvironmentIntensity:te.setEnvironmentIntensity,setToneMappingExposure:te.setToneMappingExposure,setAoIntensity:te.setAoIntensity,getMaterialAppearance:te.getMaterialAppearance,updateShadowBounds:h,updateGridScale:v,dispose:()=>{f||(f=!0,ae(),D.dispose(),E.dispose(),e.removeEventListener(`click`,k,{capture:!0}),e.removeEventListener(`mousemove`,A),T?.dispose(),w?.dispose(),y?.dispose(),_?.dispose(),ee.dispose(),u.dispose(),l.dispose(),c.dispose(),c.forceContextLoss(),$S(o))},fitToView:D.fitToView,clearSelection:D.clearSelection,selectEntries:e=>{D.selectEntries(e),L()},setHover:(e,t)=>{D.setHover(e,t),L()},addUserGeometry:(e,t)=>{e.userData.source=t===void 0?wy:Ey(t),o.add(e),j()},removeUserGeometry:e=>{e.removeFromParent(),Wu(e),j()},clearUserGeometry:e=>{o.children.filter(t=>ky(t,e)).forEach(e=>{e.removeFromParent(),Wu(e)}),j()}}},MC=1e4,NC=()=>new Promise(e=>requestAnimationFrame(()=>e(void 0)));window.selvaCapture=async({response:e,views:t,grid:n,look:r,background:i,hdr:a})=>{let o=document.createElement(`canvas`);o.style.cssText=`display:block;width:100%;height:100%`,document.getElementById(`stage`).append(o);let s,c=new Promise(e=>s=e),l=jC(o,{look:Cy.includes(r)?r:`technical`,onMaxAnisotropy:Ap,environment:{hdrPath:a??!1,...i&&{backgroundColor:i}},events:{enableEventHandlers:!1,onReady:()=>s()}});await Promise.race([c,new Promise(e=>setTimeout(e,MC))]);let u=await Zm(e,{parsing:{material:l.getMaterialAppearance()}});if(yb(l.scene,u,l.camera,l.controls,!1),!u.length)return{pngs:[],drawn:0};l.grid?.setVisible(n),l.updateGridScale(),l.updateShadowBounds(),l.syncEmissiveLights();let d=[];for(let e of t){l.cameraController.setView(e,!1),await NC(),await NC();let t=await l.captureImage(`image/png`);d.push(t?PC(new Uint8Array(await t.arrayBuffer())):``)}return{pngs:d,drawn:u.length}};function PC(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}</script>
6078
6078
  </head>
6079
6079
  <body>
6080
6080
  <div id="stage"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selvajs/mcp",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "description": "MCP server machinery for Selva hosts: tools over a host's /api/v1, with key auth, error mapping and annotations from its OpenAPI document",
5
5
  "license": "MIT",
6
6
  "author": "VektorNode",