efficient-shell 15.9.0 → 16.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +4 -3
  2. package/dist/{Browser-FEZ2X7B5.js → Browser-WDTBITTV.js} +12 -12
  3. package/dist/{Files-DHTF6LGF.js → Files-SVMIMC2S.js} +34 -34
  4. package/dist/{Notepad-KS37VSPL.js → Notepad-LDMCDXVA.js} +8 -8
  5. package/dist/{Preview-NXCA3X4S.js → Preview-2OIC2CV5.js} +20 -20
  6. package/dist/Sidebar-ZSVEL4ZU.js +44 -0
  7. package/dist/apps/index.js +1 -1
  8. package/dist/bin/browser-check.js +1 -1
  9. package/dist/bin/media-host-check.js +1 -1
  10. package/dist/bin/ui-check.js +1 -1
  11. package/dist/chunk-2KD6R2XF.js +2 -0
  12. package/dist/{chunk-YCA2XXAB.js → chunk-H2S75BKK.js} +1 -1
  13. package/dist/{chunk-US7F3NC3.js → chunk-MGGZINTI.js} +1 -1
  14. package/dist/chunk-QCHG5ZKT.js +30 -0
  15. package/dist/chunk-RZVODVGN.js +1 -0
  16. package/dist/{chunk-GYY7GS2I.js → chunk-VUSH7MYA.js} +1 -1
  17. package/dist/{chunk-HPDNKHIO.js → chunk-WSN5J6P4.js} +3 -3
  18. package/dist/{chunk-FUUUPTVN.js → chunk-XN72RFDV.js} +9 -9
  19. package/dist/forms/MediaLibrary.js +1 -1
  20. package/dist/index.d.ts +4 -23
  21. package/dist/index.js +109 -109
  22. package/dist/model-viewer/index.d.ts +122 -16
  23. package/dist/model-viewer/index.js +6 -6
  24. package/dist/routine-index.json +1 -1
  25. package/dist/shell/ResizeHandle.d.ts +4 -1
  26. package/dist/shell/ResizeHandle.js +1 -1
  27. package/dist/shell/SidebarLayout.js +1 -1
  28. package/dist/shell/strings.d.ts +5 -2
  29. package/dist/telemetry/index.js +1 -1
  30. package/dist/templates/ChatTemplate.js +1 -1
  31. package/dist/templates/EmailTemplate.js +1 -1
  32. package/dist/ui/index.js +1 -1
  33. package/dist/value-index.json +1 -1
  34. package/dist/version.js +1 -1
  35. package/package.json +1 -1
  36. package/dist/Sidebar-IU4EG3D3.js +0 -44
  37. package/dist/chunk-PLJB4H3G.js +0 -1
  38. package/dist/chunk-WNHDYTTI.js +0 -2
  39. package/dist/chunk-WUNZBM53.js +0 -28
@@ -1,4 +1,86 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as react from 'react';
2
+
3
+ /**
4
+ * The `<model-viewer>` attributes a `ModelViewer` sets, from its props. Pure,
5
+ * so a spec can check them without a browser that draws.
6
+ */
7
+ /**
8
+ * The light a model is shown in. `studio` is soft and even — the product-render
9
+ * look — `daylight` brighter and warmer, `showroom` bright with harder shadows. Each is model-viewer's own
10
+ * built-in environment, so no picture is fetched from anywhere.
11
+ */
12
+ type ModelViewerLighting = 'studio' | 'daylight' | 'showroom';
13
+ declare const MODEL_VIEWER_LIGHTING: Record<ModelViewerLighting, {
14
+ environment: 'neutral' | 'legacy';
15
+ exposure: string;
16
+ shadowIntensity: string;
17
+ shadowSoftness: string;
18
+ /** Khronos PBR Neutral keeps a product's colours true; AgX rolls bright
19
+ * highlights off the way film does. */
20
+ toneMapping: 'neutral' | 'agx';
21
+ }>;
22
+ interface ModelViewerAttributeProps {
23
+ src: string;
24
+ alt: string;
25
+ poster?: string | null;
26
+ autoRotate?: boolean;
27
+ cameraOrbit?: string;
28
+ /** The closest the camera may turn, model-viewer's `min-camera-orbit`,
29
+ * e.g. `'auto 20deg auto'` keeps it from going over the top. */
30
+ minCameraOrbit?: string;
31
+ /** The furthest it may turn, `max-camera-orbit`, e.g. `'auto 100deg auto'`
32
+ * keeps it from going underneath. */
33
+ maxCameraOrbit?: string;
34
+ lighting?: ModelViewerLighting;
35
+ /** The lens, as a 35 mm-equivalent focal length in millimetres: 50 is a
36
+ * normal lens, 200 a telephoto with little perspective distortion (the
37
+ * product-shot look). Sets model-viewer's `field-of-view`, and lets zoom
38
+ * run from four times closer to two and a half times further out. Default: model-viewer's. */
39
+ focalLength?: number;
40
+ /** Keep the model centred: a right-click or two-finger drag no longer
41
+ * slides it across the frame. Turning and zooming still work. */
42
+ disablePan?: boolean;
43
+ /** Let a person drag to turn and scroll to zoom. On by default; off, the
44
+ * camera moves only when the host turns it (a set of fixed angles). */
45
+ cameraControls?: boolean;
46
+ }
47
+ /** The vertical field of view, in degrees, of a 35 mm-equivalent focal length. */
48
+ declare function fieldOfViewFor(focalLengthMm: number): number;
49
+ declare function modelViewerAttributes(props: ModelViewerAttributeProps): Record<string, string>;
50
+
51
+ /**
52
+ * Recolouring a loaded model's materials by name — what a configurator does
53
+ * when it paints one part of a wheel. Pure over a minimal shape of
54
+ * model-viewer's scene-graph API, so a spec can check it without a GPU.
55
+ */
56
+ /** What one material becomes: a `#rrggbb` colour and its PBR numbers. */
57
+ interface ModelViewerMaterial {
58
+ color: string;
59
+ metallic: number;
60
+ roughness: number;
61
+ /** A clear coat over the paint (KHR_materials_clearcoat), 0–1. */
62
+ clearcoat?: number;
63
+ clearcoatRoughness?: number;
64
+ }
65
+ /** Materials by the name the model gives them. The key `*` applies to every
66
+ * material the map does not name. */
67
+ type ModelViewerMaterials = Record<string, ModelViewerMaterial>;
68
+ /** The part of model-viewer's material API this uses. */
69
+ interface SceneMaterial {
70
+ name: string;
71
+ pbrMetallicRoughness: {
72
+ setBaseColorFactor(rgba: string | [number, number, number, number]): void;
73
+ setMetallicFactor(value: number): void;
74
+ setRoughnessFactor(value: number): void;
75
+ };
76
+ setClearcoatFactor?(value: number): void;
77
+ setClearcoatRoughnessFactor?(value: number): void;
78
+ }
79
+ /**
80
+ * Apply `materials` to a model's materials. Returns the names it painted.
81
+ * A material the map does not name, with no `*` entry, is left as loaded.
82
+ */
83
+ declare function applyMaterials(sceneMaterials: readonly SceneMaterial[], materials: ModelViewerMaterials): string[];
2
84
 
3
85
  /**
4
86
  * Where a viewer is: fetching the viewer or the model (`loading`), drawing the
@@ -21,6 +103,28 @@ interface ModelViewerProps {
21
103
  /** The camera's starting orbit, model-viewer's `camera-orbit`, e.g.
22
104
  * `'30deg 75deg auto'`. Default: model-viewer's own (a front three-quarter). */
23
105
  cameraOrbit?: string;
106
+ /** Limits for the camera, `min-camera-orbit` / `max-camera-orbit`, e.g.
107
+ * `'auto 20deg auto'` and `'auto 100deg auto'` keep a wheel from being
108
+ * turned over the top or seen from underneath. */
109
+ minCameraOrbit?: string;
110
+ maxCameraOrbit?: string;
111
+ /** The light the model is shown in. Default: model-viewer's own. */
112
+ lighting?: ModelViewerLighting;
113
+ /** The lens, a 35 mm-equivalent focal length in mm (200 = telephoto). */
114
+ focalLength?: number;
115
+ /** Keep the model centred: no sliding it across the frame. */
116
+ disablePan?: boolean;
117
+ /** Drag to turn and scroll to zoom. On by default; off, only `goTo` and
118
+ * `cameraOrbit` move the camera. */
119
+ cameraControls?: boolean;
120
+ /** Recolour the model's materials by name (the key `*` for every other
121
+ * one), applied once the model loads and again whenever this changes. A
122
+ * configurator paints one part of a model this way. */
123
+ materials?: ModelViewerMaterials;
124
+ /** Every camera move: where it points now, in degrees (`theta` round the
125
+ * model, positive to the right; `phi` down from straight above), and
126
+ * whether a person dragged it (`userInteraction`) or the host moved it. */
127
+ onCameraChange?: (camera: ModelViewerCamera) => void;
24
128
  /** The folder the Draco decoder is fetched from. The first viewer on a page
25
129
  * sets it for every viewer after. Default `MODEL_VIEWER_DRACO_DECODER_URL`. */
26
130
  dracoDecoderUrl?: string;
@@ -29,6 +133,21 @@ interface ModelViewerProps {
29
133
  className?: string;
30
134
  onStatusChange?: (status: ModelViewerStatus) => void;
31
135
  }
136
+ /** Where the camera points, in degrees. */
137
+ interface ModelViewerCamera {
138
+ theta: number;
139
+ phi: number;
140
+ userInteraction: boolean;
141
+ }
142
+ /** What a host can do to a viewer it holds a ref to. */
143
+ interface ModelViewerHandle {
144
+ /** Turn the camera to an orbit (`'30deg 80deg auto'`), smoothly, from a
145
+ * clean start: the zoom and the point it looks at go back to where they
146
+ * began, and the turn takes the short way round however far a person
147
+ * dragged it. Also returns to the orbit the `cameraOrbit` prop names after
148
+ * a drag away from it, which a prop alone cannot do. */
149
+ goTo(orbit: string): void;
150
+ }
32
151
  /**
33
152
  * A 3D model the viewer can drag to turn: `@google/model-viewer` (WebGL, three.js)
34
153
  * behind a React component, fetched only when one mounts.
@@ -41,20 +160,7 @@ interface ModelViewerProps {
41
160
  * With no WebGL the library is never fetched: the still picture shows, with a
42
161
  * line saying why. A model that fails to load falls back the same way.
43
162
  */
44
- declare function ModelViewer({ src, alt, poster, autoRotate, cameraOrbit, dracoDecoderUrl, className, onStatusChange, }: ModelViewerProps): react_jsx_runtime.JSX.Element;
45
-
46
- /**
47
- * The `<model-viewer>` attributes a `ModelViewer` sets, from its props. Pure,
48
- * so a spec can check them without a browser that draws.
49
- */
50
- interface ModelViewerAttributeProps {
51
- src: string;
52
- alt: string;
53
- poster?: string | null;
54
- autoRotate?: boolean;
55
- cameraOrbit?: string;
56
- }
57
- declare function modelViewerAttributes(props: ModelViewerAttributeProps): Record<string, string>;
163
+ declare const ModelViewer: react.ForwardRefExoticComponent<ModelViewerProps & react.RefAttributes<ModelViewerHandle>>;
58
164
 
59
165
  interface LoadModelViewerOptions {
60
166
  /** The folder holding `draco_decoder.wasm` and `draco_wasm_wrapper.js`.
@@ -120,4 +226,4 @@ declare const MODEL_VIEWER_CSP_SOURCES: {
120
226
  readonly script: readonly ["'wasm-unsafe-eval'"];
121
227
  };
122
228
 
123
- export { type LoadModelViewerOptions, MODEL_VIEWER_CSP_SOURCES, MODEL_VIEWER_DECODER_ORIGIN, MODEL_VIEWER_DRACO_DECODER_URL, ModelViewer, type ModelViewerAttributeProps, type ModelViewerProps, type ModelViewerStatus, arQuickLookSupported, loadModelViewer, modelViewerAttributes, openArQuickLook, webglAvailable };
229
+ export { type LoadModelViewerOptions, MODEL_VIEWER_CSP_SOURCES, MODEL_VIEWER_DECODER_ORIGIN, MODEL_VIEWER_DRACO_DECODER_URL, MODEL_VIEWER_LIGHTING, ModelViewer, type ModelViewerAttributeProps, type ModelViewerCamera, type ModelViewerHandle, type ModelViewerLighting, type ModelViewerMaterial, type ModelViewerMaterials, type ModelViewerProps, type ModelViewerStatus, type SceneMaterial, applyMaterials, arQuickLookSupported, fieldOfViewFor, loadModelViewer, modelViewerAttributes, openArQuickLook, webglAvailable };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import{useShellStrings as e}from"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";import{useRef as t,useState as r,useEffect as o}from"react";import{jsxs as n,jsx as a}from"react/jsx-runtime";var l=["src","alt","poster","camera-controls","touch-action","shadow-intensity","auto-rotate","camera-orbit","interaction-prompt"];function i(e){const t={src:e.src,alt:e.alt,"camera-controls":"","touch-action":"pan-y","shadow-intensity":"1","interaction-prompt":"auto"};return e.poster&&(t.poster=e.poster),e.autoRotate&&(t["auto-rotate"]=""),e.cameraOrbit&&(t["camera-orbit"]=e.cameraOrbit),t}var c="https://www.gstatic.com",s=`${c}/draco/versioned/decoders/1.5.6/`,u={connect:[c],worker:["blob:"],script:["'wasm-unsafe-eval'"]},d=null;function m(e={}){return d??=Promise.resolve().then(()=>{const t=globalThis;return t.ModelViewerElement={...t.ModelViewerElement,dracoDecoderLocation:e.dracoDecoderUrl??s},import("@google/model-viewer")}).then(()=>{}).catch(e=>{throw d=null,e}),d}var f=null;function h(e=globalThis.document){if(!e)return!1;if(null!==f&&e===globalThis.document)return f;let t=!1;try{const r=e.createElement("canvas");t=Boolean(r.getContext("webgl2")??r.getContext("webgl"))}catch{t=!1}return e===globalThis.document&&(f=t),t}var p=/CriOS\/|EdgiOS\/|FxiOS\/|GSA\/|DuckDuckGo\//;function b(e=globalThis.document){if(!e)return!1;const t=e.defaultView?.navigator;if(!t||!function(e){return/iPad|iPhone|iPod/.test(e.userAgent)||"MacIntel"===e.platform&&e.maxTouchPoints>1}(t))return!1;if(p.test(t.userAgent))return!0;const r=e.createElement("a");return Boolean(r.relList?.supports?.("ar"))}function g(e,t=globalThis.document){const r=t.createElement("a");r.setAttribute("rel","ar"),r.setAttribute("href",new URL(e,t.baseURI).toString()),r.style.display="none",r.appendChild(t.createElement("img")),t.body.appendChild(r);try{r.click()}finally{r.remove()}}var v=(...e)=>e.filter(Boolean).join(" ");function w({src:c,alt:s,poster:u,autoRotate:d,cameraOrbit:f,dracoDecoderUrl:p,className:b,onStatusChange:g}){const w=e().modelViewer,y=t(null),x=t(null),[E,A]=r("loading"),[N,O]=r(!1),k=t(g);k.current=g,o(()=>{k.current?.(E)},[E]),o(()=>{if(!h())return void A("still");let e=!0;return m({dracoDecoderUrl:p}).then(()=>{e&&O(!0)}).catch(()=>{e&&A("failed")}),()=>{e=!1}},[]),o(()=>{const e=y.current;if(!N||!e)return;const t=e.ownerDocument.createElement("model-viewer");t.style.width="100%",t.style.height="100%",t.style.setProperty("--poster-color","transparent");const r=()=>A("ready"),o=()=>A("failed");return t.addEventListener("load",r),t.addEventListener("error",o),e.appendChild(t),x.current=t,()=>{t.removeEventListener("load",r),t.removeEventListener("error",o),t.remove(),x.current=null}},[N]),o(()=>{const e=x.current;if(!e)return;const t=i({src:c,alt:s,poster:u,autoRotate:d,cameraOrbit:f});for(const r of l)r in t||e.removeAttribute(r);const r=e.getAttribute("src")!==t.src;for(const[r,o]of Object.entries(t))e.getAttribute(r)!==o&&e.setAttribute(r,o);r&&A("loading")},[N,c,s,u,d,f]);const C="still"===E||"failed"===E;/* @__PURE__ */
3
- return n("div",{className:v("relative overflow-hidden rounded-lg border border-line bg-surface",b),"data-model-viewer":E,children:[
4
- /* @__PURE__ */a("div",{ref:y,className:"absolute inset-0",hidden:C}),"loading"===E&&u&&
5
- /* @__PURE__ */a("img",{src:u,alt:"",className:"pointer-events-none absolute inset-0 h-full w-full object-contain"}),"loading"===E&&/* @__PURE__ */a("p",{role:"status",className:"sr-only",children:w.loading}),C&&
6
- /* @__PURE__ */n("div",{className:"absolute inset-0 flex flex-col",children:[u&&/* @__PURE__ */a("img",{src:u,alt:s,className:"min-h-0 w-full flex-1 object-contain"}),
7
- /* @__PURE__ */a("p",{className:v("shrink-0 p-4 text-center text-sm text-ink-faint",!u&&"grid flex-1 place-items-center"),children:"still"===E?w.noWebgl:w.failed})]})]})}export{u as MODEL_VIEWER_CSP_SOURCES,c as MODEL_VIEWER_DECODER_ORIGIN,s as MODEL_VIEWER_DRACO_DECODER_URL,w as ModelViewer,b as arQuickLookSupported,m as loadModelViewer,i as modelViewerAttributes,g as openArQuickLook,h as webglAvailable};
2
+ import{useShellStrings as e}from"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";import{forwardRef as t,useRef as r,useImperativeHandle as a,useState as n,useEffect as o}from"react";import{jsxs as i,jsx as s}from"react/jsx-runtime";var l={studio:{environment:"neutral",exposure:"1.1",shadowIntensity:"1",shadowSoftness:"1",toneMapping:"neutral"},daylight:{environment:"legacy",exposure:"1",shadowIntensity:"1",shadowSoftness:"0.8",toneMapping:"agx"},showroom:{environment:"neutral",exposure:"1.4",shadowIntensity:"1.2",shadowSoftness:"0.4",toneMapping:"agx"}};function c(e){return 2*Math.atan(24/(2*e))*180/Math.PI}var m=e=>Math.round(100*e)/100+"deg",u=["src","alt","poster","camera-controls","touch-action","shadow-intensity","auto-rotate","camera-orbit","interaction-prompt","min-camera-orbit","max-camera-orbit","environment-image","exposure","shadow-softness","field-of-view","min-field-of-view","max-field-of-view","disable-pan","tone-mapping"];function d(e){const t={src:e.src,alt:e.alt,"shadow-intensity":"1"};if(!1!==e.cameraControls&&(t["camera-controls"]="",t["touch-action"]="pan-y",t["interaction-prompt"]="auto"),e.poster&&(t.poster=e.poster),e.autoRotate&&(t["auto-rotate"]=""),e.cameraOrbit&&(t["camera-orbit"]=e.cameraOrbit),e.minCameraOrbit&&(t["min-camera-orbit"]=e.minCameraOrbit),e.maxCameraOrbit&&(t["max-camera-orbit"]=e.maxCameraOrbit),e.focalLength&&e.focalLength>0){const r=c(e.focalLength);t["field-of-view"]=m(r),t["min-field-of-view"]=m(r/4),t["max-field-of-view"]=m(2.5*r)}if(e.disablePan&&(t["disable-pan"]=""),e.lighting){const r=l[e.lighting];t["environment-image"]=r.environment,t.exposure=r.exposure,t["shadow-intensity"]=r.shadowIntensity,t["shadow-softness"]=r.shadowSoftness,t["tone-mapping"]=r.toneMapping}return t}var h=e=>Math.min(1,Math.max(0,e)),f=/^#[0-9a-f]{6}$/i;function g(e,t){const r=[];for(const a of e){const e=t[a.name]??t["*"];e&&(f.test(e.color)&&a.pbrMetallicRoughness.setBaseColorFactor(e.color),a.pbrMetallicRoughness.setMetallicFactor(h(e.metallic)),a.pbrMetallicRoughness.setRoughnessFactor(h(e.roughness)),a.setClearcoatFactor?.(h(e.clearcoat??0)),a.setClearcoatRoughnessFactor?.(h(e.clearcoatRoughness??0)),r.push(a.name))}return r}var p="https://www.gstatic.com",b=`${p}/draco/versioned/decoders/1.5.6/`,v={connect:[p],worker:["blob:"],script:["'wasm-unsafe-eval'"]},w=null;function x(e={}){return w??=Promise.resolve().then(()=>{const t=globalThis;return t.ModelViewerElement={...t.ModelViewerElement,dracoDecoderLocation:e.dracoDecoderUrl??b},import("@google/model-viewer")}).then(()=>{}).catch(e=>{throw w=null,e}),w}var C=null;function y(e=globalThis.document){if(!e)return!1;if(null!==C&&e===globalThis.document)return C;let t=!1;try{const r=e.createElement("canvas");t=Boolean(r.getContext("webgl2")??r.getContext("webgl"))}catch{t=!1}return e===globalThis.document&&(C=t),t}var M=/CriOS\/|EdgiOS\/|FxiOS\/|GSA\/|DuckDuckGo\//;function O(e=globalThis.document){if(!e)return!1;const t=e.defaultView?.navigator;if(!t||!function(e){return/iPad|iPhone|iPod/.test(e.userAgent)||"MacIntel"===e.platform&&e.maxTouchPoints>1}(t))return!1;if(M.test(t.userAgent))return!0;const r=e.createElement("a");return Boolean(r.relList?.supports?.("ar"))}function P(e,t=globalThis.document){const r=t.createElement("a");r.setAttribute("rel","ar"),r.setAttribute("href",new URL(e,t.baseURI).toString()),r.style.display="none",r.appendChild(t.createElement("img")),t.body.appendChild(r);try{r.click()}finally{r.remove()}}var E=180/Math.PI,L=(...e)=>e.filter(Boolean).join(" "),R=t(function({src:t,alt:l,poster:c,autoRotate:m,cameraOrbit:h,minCameraOrbit:f,maxCameraOrbit:p,lighting:b,focalLength:v,disablePan:w,cameraControls:C,materials:M,onCameraChange:O,dracoDecoderUrl:P,className:R,onStatusChange:I},T){const A=e().modelViewer,S=r(null),j=r(null),N=r(O);N.current=O;const k=r(M);k.current=M,a(T,()=>({goTo(e){const t=j.current;if(!t)return;const r=t.getCameraOrbit?.(),a=/^(-?[\d.]+)deg\b/.exec(e.trim());if(r&&a&&t.jumpCameraToGoal){const e=parseFloat(a[1])*Math.PI/180,n=2*Math.PI,o=e+((r.theta-e)%n+n+Math.PI)%n-Math.PI;t.cameraOrbit=`${o}rad ${r.phi}rad ${r.radius}m`,t.jumpCameraToGoal()}t.cameraTarget="auto auto auto",t.fieldOfView=t.getAttribute("field-of-view")??"auto",t.cameraOrbit=e}}),[]);const[D,F]=n("loading"),[V,G]=n(!1),U=r(I);U.current=I,o(()=>{U.current?.(D)},[D]),o(()=>{if(!y())return void F("still");let e=!0;return x({dracoDecoderUrl:P}).then(()=>{e&&G(!0)}).catch(()=>{e&&F("failed")}),()=>{e=!1}},[]),o(()=>{const e=S.current;if(!V||!e)return;const t=e.ownerDocument.createElement("model-viewer");t.style.width="100%",t.style.height="100%",t.style.setProperty("--poster-color","transparent");const r=()=>{k.current&&t.model&&g(t.model.materials,k.current),F("ready")},a=()=>F("failed"),n=e=>{const r=t.getCameraOrbit?.();if(!r||!N.current)return;const a=e.detail?.source;N.current({theta:r.theta*E,phi:r.phi*E,userInteraction:"user-interaction"===a})};return t.addEventListener("load",r),t.addEventListener("error",a),t.addEventListener("camera-change",n),e.appendChild(t),j.current=t,()=>{t.removeEventListener("load",r),t.removeEventListener("error",a),t.removeEventListener("camera-change",n),t.remove(),j.current=null}},[V]),o(()=>{const e=j.current;if(!e)return;const r=d({src:t,alt:l,poster:c,autoRotate:m,cameraOrbit:h,minCameraOrbit:f,maxCameraOrbit:p,lighting:b,focalLength:v,disablePan:w,cameraControls:C});for(const t of u)t in r||e.removeAttribute(t);const a=e.getAttribute("src")!==r.src;for(const[t,a]of Object.entries(r))e.getAttribute(t)!==a&&e.setAttribute(t,a);a&&F("loading")},[V,t,l,c,m,h,f,p,b,v,w,C]),o(()=>{const e=j.current;"ready"===D&&e?.model&&M&&g(e.model.materials,M)},[D,M]);const $="still"===D||"failed"===D;/* @__PURE__ */
3
+ return i("div",{className:L("relative overflow-hidden rounded-lg border border-line bg-surface",R),"data-model-viewer":D,children:[
4
+ /* @__PURE__ */s("div",{ref:S,className:"absolute inset-0",hidden:$}),"loading"===D&&c&&
5
+ /* @__PURE__ */s("img",{src:c,alt:"",className:"pointer-events-none absolute inset-0 h-full w-full object-contain"}),"loading"===D&&/* @__PURE__ */s("p",{role:"status",className:"sr-only",children:A.loading}),$&&
6
+ /* @__PURE__ */i("div",{className:"absolute inset-0 flex flex-col",children:[c&&/* @__PURE__ */s("img",{src:c,alt:l,className:"min-h-0 w-full flex-1 object-contain"}),
7
+ /* @__PURE__ */s("p",{className:L("shrink-0 p-4 text-center text-sm text-ink-faint",!c&&"grid flex-1 place-items-center"),children:"still"===D?A.noWebgl:A.failed})]})]})});export{v as MODEL_VIEWER_CSP_SOURCES,p as MODEL_VIEWER_DECODER_ORIGIN,b as MODEL_VIEWER_DRACO_DECODER_URL,l as MODEL_VIEWER_LIGHTING,R as ModelViewer,g as applyMaterials,O as arQuickLookSupported,c as fieldOfViewFor,x as loadModelViewer,d as modelViewerAttributes,P as openArQuickLook,y as webglAvailable};