efficient-shell 16.4.1 → 16.6.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 (50) hide show
  1. package/dist/{Browser-LCX3F2VY.js → Browser-UHT6QSUN.js} +16 -16
  2. package/dist/{Calculator-ZCDSQCRN.js → Calculator-ZG5RX2HX.js} +22 -22
  3. package/dist/{CurrencyConverter-ZLHZOLYE.js → CurrencyConverter-AHGYTGKM.js} +9 -9
  4. package/dist/{Files-TMEV736Q.js → Files-4HJWEYDE.js} +49 -49
  5. package/dist/{Notepad-EWLJWILB.js → Notepad-GXKGVTNG.js} +8 -8
  6. package/dist/{PomodoroTimer-DIIU6KRF.js → PomodoroTimer-GN2OSLJ6.js} +65 -65
  7. package/dist/{Preview-CG2KGNSM.js → Preview-EN4YCUH5.js} +9 -9
  8. package/dist/Sidebar-JJ35JBFL.js +44 -0
  9. package/dist/{Stock-VW2AUUD6.js → Stock-44BSCZOL.js} +4 -4
  10. package/dist/{Weather-ZGQHMHNW.js → Weather-GNGUF6A4.js} +20 -20
  11. package/dist/{WorldClock-GYRJWYQM.js → WorldClock-EBZJRH5F.js} +7 -7
  12. package/dist/apps/index.js +1 -1
  13. package/dist/bin/browser-check.js +1 -1
  14. package/dist/bin/media-host-check.js +1 -1
  15. package/dist/bin/ui-check.js +1 -1
  16. package/dist/chunk-2NHYLLHO.js +15 -0
  17. package/dist/{chunk-JIHDUZJZ.js → chunk-4BB5DHFX.js} +2 -2
  18. package/dist/{chunk-IXGJTYOG.js → chunk-DX24Q5OR.js} +3 -3
  19. package/dist/chunk-EJTAPBGB.js +89 -0
  20. package/dist/{chunk-HHGSWUGI.js → chunk-H6JJAVYL.js} +1 -1
  21. package/dist/{chunk-UJ5772FB.js → chunk-HOTIZZXC.js} +1 -1
  22. package/dist/{chunk-3UCJ6SGP.js → chunk-MS6IZF6E.js} +1 -1
  23. package/dist/{chunk-5MJO7RMB.js → chunk-N7EZ2BFE.js} +3 -3
  24. package/dist/chunk-OHC6Q4QD.js +1 -0
  25. package/dist/{chunk-KGRJSTPM.js → chunk-ST6FPYJ7.js} +9 -9
  26. package/dist/chunk-VIPNHDD3.js +1 -0
  27. package/dist/{chunk-CUNYWXUT.js → chunk-WAUD3BFJ.js} +1 -1
  28. package/dist/{chunk-QD7IODP2.js → chunk-WD3S3ATX.js} +1 -1
  29. package/dist/chunk-YVXF7L66.js +1 -0
  30. package/dist/engine-4U3WOFMO.js +1 -0
  31. package/dist/forms/MediaLibrary.js +1 -1
  32. package/dist/index.js +80 -80
  33. package/dist/model-stage/index.d.ts +69 -5
  34. package/dist/model-stage/index.js +3 -3
  35. package/dist/routine-index.json +1 -1
  36. package/dist/shell/HelpCenter.d.ts +7 -0
  37. package/dist/shell/HelpCenter.js +1 -1
  38. package/dist/shell/SidebarNav.js +1 -1
  39. package/dist/telemetry/index.js +1 -1
  40. package/dist/ui/index.js +1 -1
  41. package/dist/value-index.json +1 -1
  42. package/dist/version.js +1 -1
  43. package/package.json +1 -1
  44. package/dist/Sidebar-ZSVEL4ZU.js +0 -44
  45. package/dist/chunk-4LXCCZDM.js +0 -1
  46. package/dist/chunk-4MYFHXU7.js +0 -1
  47. package/dist/chunk-KT57MRN4.js +0 -1
  48. package/dist/chunk-RBOGLXMV.js +0 -21
  49. package/dist/chunk-S5JX4IAP.js +0 -89
  50. package/dist/engine-T4D3AZOO.js +0 -1
@@ -1,13 +1,13 @@
1
- import{navIcons as e}from"./chunk-4LXCCZDM.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{isValidElement as n,cloneElement as r}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var a="react-os-shell:spreadsheet-preview-update",s=null,l=0;function d(e){const t=++l,n={token:t,data:e};return s=n,{update(e){s===n&&(n.data=e),"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(a,{detail:{token:t,data:e}}))}}}function c(){return s}function p(e){s===e&&(s=null)}var u={owner:"Owner",editor:"Editor",commenter:"Commenter",viewer:"Viewer"},f=e=>"owner"===e||"editor"===e,h={document:".docx",spreadsheet:".sheet",deck:".slides"},w=class extends Error{limit;used;attempted;constructor(e,t,n){super("Not enough space"),this.name="FilesQuotaError",this.limit=e,this.used=t,this.attempted=n}};function m(e,t){return e&&"/"!==e?e.replace(/\/$/,"")+"/"+t:"/"+t}async function y(e,t){const n=await e.json().catch(()=>({}));return new Error(n.error||`${t} failed (${e.status})`)}function g(e){const t=()=>(e??(("undefined"!=typeof window?window.__REACT_OS_SHELL_FILE_SERVER__:void 0)||"http://localhost:4000").replace(/\/$/,"")).replace(/\/$/,""),n=(e,n={})=>fetch(`${t()}${e}`,{...n,credentials:"include"}),r=e=>({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{async quota(){const e=await n("/api/quota");if(!e.ok)throw await y(e,"Quota");const t=await e.json();return{used:t.used,limit:t.limit}},async list(e){const t=e??"/",r=await n(`/api/files?path=${encodeURIComponent(t)}`);if(!r.ok)throw await y(r,"Listing");const o=await r.json(),i=o.path||t,a=i.split("/").filter(Boolean);return{folder:{id:"/"===i?null:i,name:a[a.length-1]??"",role:"owner",path:[{id:null,name:""},...a.map((e,t)=>({id:"/"+a.slice(0,t+1).join("/"),name:e}))]},entries:(o.entries||[]).map(e=>({id:m(i,e.name),name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modifiedAt}))}},async upload(e,t){const r=new FormData;r.append("file",t);const o=await n(`/api/upload?path=${encodeURIComponent(e??"/")}`,{method:"POST",body:r});if(413===o.status){const e=await o.json().catch(()=>({}));throw new w(e.limit||0,e.used||0,e.attempted||t.size)}if(!o.ok)throw await y(o,"Upload")},async createFolder(e,t){const o=await n("/api/folder",r({path:m(e,t)}));if(!o.ok)throw await y(o,"Create folder")},async rename(e,t){const o=e.replace(/\/[^/]*$/,"")||"/",i=await n("/api/rename",r({from:e,to:m(o,t)}));if(!i.ok)throw await y(i,"Rename")},async remove(e){const t=await n(`/api/files?path=${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await y(t,"Delete")},async read(e){const t=await n(`/api/file?path=${encodeURIComponent(e)}`);if(!t.ok)throw await y(t,"Download");return t.blob()},async trash(){const e=await n("/api/trash");if(!e.ok)throw await y(e,"Listing trash");return(await e.json()).entries||[]},async restore(e){const t=await n("/api/trash/restore",r({id:e}));if(!t.ok)throw await y(t,"Restore")},async purge(e){const t=await n(`/api/trash/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await y(t,"Delete")},async emptyTrash(){const e=await n("/api/trash",{method:"DELETE"});if(!e.ok)throw await y(e,"Empty trash")}}}var x=null;function b(e){x=e}function v(){return x??g()}function _(){return null!==x}var k=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function E(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n);return k[Math.abs(t)%k.length]}var C={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},N={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},j={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},T={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function I({className:e}){/* @__PURE__ */
2
- return o(t,{name:"folder",look:"solid",className:e})}function S(t,n){return n&&e[n]||(t?e[t]:void 0)}var L=/* @__PURE__ */o("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function $({entityType:e,isSelected:t,entityId:a,label:s,fileKind:l}){const d="preview-file"===e&&l,c=d?T[l]:null,p=d?j[l]:null;if("folder"===e)/* @__PURE__ */
3
- return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o(I,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=S(a,s),i=E(a||s||"page");/* @__PURE__ */
4
- return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o("span",{className:`h-11 w-11 rounded-xl bg-gradient-to-br ${i} flex items-center justify-center text-white border border-white/30 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]`,children:e&&n(e)?r(e,{className:"h-7 w-7 text-white"}):L})})}/* @__PURE__ */
1
+ import{navIcons as e}from"./chunk-VIPNHDD3.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{isValidElement as n,cloneElement as r}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var a="react-os-shell:spreadsheet-preview-update",s=null,l=0;function d(e){const t=++l,n={token:t,data:e};return s=n,{update(e){s===n&&(n.data=e),"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(a,{detail:{token:t,data:e}}))}}}function c(){return s}function p(e){s===e&&(s=null)}var u={owner:"Owner",editor:"Editor",commenter:"Commenter",viewer:"Viewer"},f=e=>"owner"===e||"editor"===e,h={document:".docx",spreadsheet:".sheet",deck:".slides"},w=class extends Error{limit;used;attempted;constructor(e,t,n){super("Not enough space"),this.name="FilesQuotaError",this.limit=e,this.used=t,this.attempted=n}};function m(e,t){return e&&"/"!==e?e.replace(/\/$/,"")+"/"+t:"/"+t}async function y(e,t){const n=await e.json().catch(()=>({}));return new Error(n.error||`${t} failed (${e.status})`)}function g(e){const t=()=>(e??(("undefined"!=typeof window?window.__REACT_OS_SHELL_FILE_SERVER__:void 0)||"http://localhost:4000").replace(/\/$/,"")).replace(/\/$/,""),n=(e,n={})=>fetch(`${t()}${e}`,{...n,credentials:"include"}),r=e=>({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{async quota(){const e=await n("/api/quota");if(!e.ok)throw await y(e,"Quota");const t=await e.json();return{used:t.used,limit:t.limit}},async list(e){const t=e??"/",r=await n(`/api/files?path=${encodeURIComponent(t)}`);if(!r.ok)throw await y(r,"Listing");const o=await r.json(),i=o.path||t,a=i.split("/").filter(Boolean);return{folder:{id:"/"===i?null:i,name:a[a.length-1]??"",role:"owner",path:[{id:null,name:""},...a.map((e,t)=>({id:"/"+a.slice(0,t+1).join("/"),name:e}))]},entries:(o.entries||[]).map(e=>({id:m(i,e.name),name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modifiedAt}))}},async upload(e,t){const r=new FormData;r.append("file",t);const o=await n(`/api/upload?path=${encodeURIComponent(e??"/")}`,{method:"POST",body:r});if(413===o.status){const e=await o.json().catch(()=>({}));throw new w(e.limit||0,e.used||0,e.attempted||t.size)}if(!o.ok)throw await y(o,"Upload")},async createFolder(e,t){const o=await n("/api/folder",r({path:m(e,t)}));if(!o.ok)throw await y(o,"Create folder")},async rename(e,t){const o=e.replace(/\/[^/]*$/,"")||"/",i=await n("/api/rename",r({from:e,to:m(o,t)}));if(!i.ok)throw await y(i,"Rename")},async remove(e){const t=await n(`/api/files?path=${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await y(t,"Delete")},async read(e){const t=await n(`/api/file?path=${encodeURIComponent(e)}`);if(!t.ok)throw await y(t,"Download");return t.blob()},async trash(){const e=await n("/api/trash");if(!e.ok)throw await y(e,"Listing trash");return(await e.json()).entries||[]},async restore(e){const t=await n("/api/trash/restore",r({id:e}));if(!t.ok)throw await y(t,"Restore")},async purge(e){const t=await n(`/api/trash/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await y(t,"Delete")},async emptyTrash(){const e=await n("/api/trash",{method:"DELETE"});if(!e.ok)throw await y(e,"Empty trash")}}}var x=null;function b(e){x=e}function v(){return x??g()}function _(){return null!==x}var k=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function E(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n);return k[Math.abs(t)%k.length]}var N={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},C={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},j={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},I={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function T({className:e}){/* @__PURE__ */
2
+ return o(t,{name:"folder",look:"solid",className:e})}function S(t,n){return n&&e[n]||(t?e[t]:void 0)}var $=/* @__PURE__ */o("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function D({entityType:e,isSelected:t,entityId:a,label:s,fileKind:l}){const d="preview-file"===e&&l,c=d?I[l]:null,p=d?j[l]:null;if("folder"===e)/* @__PURE__ */
3
+ return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o(T,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=S(a,s),i=E(a||s||"page");/* @__PURE__ */
4
+ return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o("span",{className:`h-11 w-11 rounded-xl bg-gradient-to-br ${i} flex items-center justify-center text-white border border-white/30 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]`,children:e&&n(e)?r(e,{className:"h-7 w-7 text-white"}):$})})}/* @__PURE__ */
5
5
  return i("div",{className:"w-12 h-12 relative flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:[
6
- /* @__PURE__ */i("svg",{className:`w-10 h-12 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)] ${c??C[e]??"text-gray-500"}`,viewBox:"0 0 40 48",fill:"none",children:[
6
+ /* @__PURE__ */i("svg",{className:`w-10 h-12 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)] ${c??N[e]??"text-gray-500"}`,viewBox:"0 0 40 48",fill:"none",children:[
7
7
  /* @__PURE__ */o("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",fill:"white",fillOpacity:"0.92"}),
8
8
  /* @__PURE__ */o("path",{d:"M26 0l10 10H30a4 4 0 01-4-4V0z",fill:"currentColor",fillOpacity:"0.2"}),
9
9
  /* @__PURE__ */o("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",stroke:"currentColor",strokeWidth:"1.5",strokeOpacity:"0.5"})]}),
10
- /* @__PURE__ */o("span",{className:`absolute inset-0 flex items-center justify-center text-3xs font-bold pt-2 ${c??C[e]??"text-gray-600"}`,children:p??N[e]??e.slice(0,3).toUpperCase()})]})}function R({item:e}){if("folder"===e.entityType)/* @__PURE__ */
11
- return o(I,{className:"h-4 w-4 shrink-0 text-amber-500"});if("page"===e.entityType){const t=S(e.entityId,e.label);/* @__PURE__ */
12
- return o("span",{className:`h-4 w-4 rounded bg-gradient-to-br ${E(e.entityId||e.label||"page")} flex items-center justify-center text-white shrink-0`,children:t&&n(t)?r(t,{className:"h-3 w-3 text-white"}):/* @__PURE__ */o("span",{className:"h-1.5 w-1.5 rounded-[2px] border border-white/80"})})}const i=("preview-file"===e.entityType&&e.fileKind?T[e.fileKind]:C[e.entityType])??"text-gray-400";/* @__PURE__ */
13
- return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function D(e){return"preview-file"===e.entityType&&e.fileKind?j[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":N[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var P=null,V=/* @__PURE__ */new Set;function O(e){P=e,V.forEach(e=>e())}function F(e){return V.add(e),()=>{V.delete(e)}}function A(){return P}var M="__REACT_OS_SHELL_FILES_VIEW__",U="react-os-shell:files-show-trash",z="react-os-shell:files-open-desktop-folder";function W(){"undefined"!=typeof window&&(window[M]="trash",window.dispatchEvent(new CustomEvent(U)))}function H(e){"undefined"!=typeof window&&(window[M]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(z,{detail:{folderId:e}})))}function B(){if("undefined"==typeof window)return null;const e=window[M];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function K(){const e=B();return"undefined"!=typeof window&&(window[M]=null),e}export{R as DesktopItemMiniIcon,h as FILES_OFFICE_EXTENSIONS,z as FILES_OPEN_DESKTOP_FOLDER_EVENT,u as FILES_ROLE_LABELS,U as FILES_SHOW_TRASH_EVENT,$ as FileIconTile,w as FilesQuotaError,I as FolderGlyph,a as SPREADSHEET_PREVIEW_UPDATE_EVENT,p as claimSpreadsheetPreviewStage,K as consumeFilesViewRequest,g as createFileServerStore,D as desktopItemTypeLabel,f as filesRoleWrites,A as getDesktopFoldersSnapshot,v as getFilesStore,_ as hasHostFilesStore,B as peekFilesViewRequest,c as peekSpreadsheetPreviewStage,O as publishDesktopFolders,H as requestFilesDesktopFolderView,W as requestFilesTrashView,b as setFilesStore,d as setSpreadsheetPreview,F as subscribeDesktopFolders};
10
+ /* @__PURE__ */o("span",{className:`absolute inset-0 flex items-center justify-center text-3xs font-bold pt-2 ${c??N[e]??"text-gray-600"}`,children:p??C[e]??e.slice(0,3).toUpperCase()})]})}function L({item:e}){if("folder"===e.entityType)/* @__PURE__ */
11
+ return o(T,{className:"h-4 w-4 shrink-0 text-amber-500"});if("page"===e.entityType){const t=S(e.entityId,e.label);/* @__PURE__ */
12
+ return o("span",{className:`h-4 w-4 rounded bg-gradient-to-br ${E(e.entityId||e.label||"page")} flex items-center justify-center text-white shrink-0`,children:t&&n(t)?r(t,{className:"h-3 w-3 text-white"}):/* @__PURE__ */o("span",{className:"h-1.5 w-1.5 rounded-[2px] border border-white/80"})})}const i=("preview-file"===e.entityType&&e.fileKind?I[e.fileKind]:N[e.entityType])??"text-gray-400";/* @__PURE__ */
13
+ return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function R(e){return"preview-file"===e.entityType&&e.fileKind?j[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":C[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var P=null,V=/* @__PURE__ */new Set;function O(e){P=e,V.forEach(e=>e())}function F(e){return V.add(e),()=>{V.delete(e)}}function A(){return P}var M="__REACT_OS_SHELL_FILES_VIEW__",U="react-os-shell:files-show-trash",z="react-os-shell:files-open-desktop-folder";function H(){"undefined"!=typeof window&&(window[M]="trash",window.dispatchEvent(new CustomEvent(U)))}function W(e){"undefined"!=typeof window&&(window[M]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(z,{detail:{folderId:e}})))}function B(){if("undefined"==typeof window)return null;const e=window[M];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function K(){const e=B();return"undefined"!=typeof window&&(window[M]=null),e}export{L as DesktopItemMiniIcon,h as FILES_OFFICE_EXTENSIONS,z as FILES_OPEN_DESKTOP_FOLDER_EVENT,u as FILES_ROLE_LABELS,U as FILES_SHOW_TRASH_EVENT,D as FileIconTile,w as FilesQuotaError,T as FolderGlyph,a as SPREADSHEET_PREVIEW_UPDATE_EVENT,p as claimSpreadsheetPreviewStage,K as consumeFilesViewRequest,g as createFileServerStore,R as desktopItemTypeLabel,f as filesRoleWrites,A as getDesktopFoldersSnapshot,v as getFilesStore,_ as hasHostFilesStore,B as peekFilesViewRequest,c as peekSpreadsheetPreviewStage,O as publishDesktopFolders,W as requestFilesDesktopFolderView,H as requestFilesTrashView,b as setFilesStore,d as setSpreadsheetPreview,F as subscribeDesktopFolders};
@@ -0,0 +1 @@
1
+ var t={},e=new Proxy(t,{get:(e,r)=>t[r],has:(e,r)=>r in t,ownKeys:()=>Object.keys(t),getOwnPropertyDescriptor(e,r){if(r in t)return{configurable:!0,enumerable:!0,value:t[r]}}});function r(e){for(const e of Object.keys(t))delete t[e];Object.assign(t,e)}var n={},o=[],a={erp:[],system:[],virtual:[],footer:[]},u=42,h=240,s=6,i=49,y=6,c=200,w=420,l="react-os-shell:work-area-changed";function x(){const t=getComputedStyle(document.documentElement),e=parseInt(t.getPropertyValue("--taskbar-height"))||0,r=parseInt(t.getPropertyValue("--taskbar-width"))||0,n=t.getPropertyValue("--taskbar-position")?.trim()||"bottom",o=parseInt(t.getPropertyValue("--sidebar-width"))||0;return{x:("left"===n?r:0)+o,y:"top"===n?e:0,w:window.innerWidth-("left"===n||"right"===n?r:0)-o,h:window.innerHeight-("top"===n||"bottom"===n?e:0)}}function b(t,e,r){const n=r?e.w+280:e.w-280,o=Math.abs(t.w-e.w)<=4||Math.abs(t.w-n)<=4;return Math.abs(t.h-e.h)<=4&&o}var f=["top","left","right","tl","tr","bl","br"];function d(t,e){const r=Math.floor(e.w/2),n=Math.floor(e.h/2);switch(t){case"top":return{x:e.x,y:e.y,w:e.w,h:e.h};case"left":return{x:e.x,y:e.y,w:r,h:e.h};case"right":return{x:e.x+r,y:e.y,w:e.w-r,h:e.h};case"tl":return{x:e.x,y:e.y,w:r,h:n};case"tr":return{x:e.x+r,y:e.y,w:e.w-r,h:n};case"bl":return{x:e.x,y:e.y+n,w:r,h:e.h-n};case"br":return{x:e.x+r,y:e.y+n,w:e.w-r,h:e.h-n}}}function m(t,e){return f.some(r=>{const n=d(r,e);return Math.abs(t.x-n.x)<=1&&Math.abs(t.y-n.y)<=1&&Math.abs(t.w-n.w)<=1&&Math.abs(t.h-n.h)<=1})}function p(t,e,r){if(!m(t,e))return{tl:!1,tr:!1,bl:!1,br:!1};const n=(t,e)=>Math.abs(t-e)<=1,o=(t,e,r)=>t<r&&r<t+e,a=t.x+t.w,u=t.y+t.h,h=(t,e,a,u)=>r.some(r=>n(e(r),t)&&o(r.y,r.h,a+2*u)),s=(t,e,a,u)=>r.some(r=>n(e(r),t)&&o(r.x,r.w,a+2*u)),i=n(t.x,e.x),y=n(a,e.x+e.w),c=n(t.y,e.y),w=n(u,e.y+e.h),l=(e,r)=>h(t.x,t=>t.x+t.w,e,r),x=(t,e)=>h(a,t=>t.x,t,e),b=(e,r)=>s(t.y,t=>t.y+t.h,e,r),f=(t,e)=>s(u,t=>t.y,t,e);return{tl:c&&i||b(t.x,1)||l(t.y,1),tr:c&&y||b(a,-1)||x(t.y,1),bl:w&&i||f(t.x,1)||l(u,-1),br:w&&y||f(a,-1)||x(u,-1)}}function g({over:t,residual:e},r){return e<=1||t-e>=r-2}function M(t,e,r){let n=t;for(const o of r)g(o,e)&&(n=Math.max(n,t+o.over));return Math.ceil(n)}function P(t,e,r,n){const o=Math.min(e,r.w-2*n);if(o<=t.w+1)return t;const a=r.x+n,u=r.x+r.w-n-o,h=Math.min(Math.max(t.x-(o-t.w)/2,a),u);return{...t,x:Math.round(h),w:Math.round(o)}}function v(){return(parseInt(getComputedStyle(document.documentElement).getPropertyValue("--sidebar-width"))||0)>0}function k(){return"undefined"!=typeof document&&"sidebar"===getComputedStyle(document.documentElement).getPropertyValue("--layout-mode")?.trim()}export{s as RAIL_COLLAPSED_INSET,i as RAIL_COLLAPSED_W,w as RAIL_MAX_W,y as RAIL_MENU_GAP,c as RAIL_MIN_W,h as RAIL_W,u as TAB_STRIP_H,l as WORK_AREA_CHANGED_EVENT,b as boxFillsWorkArea,m as boxIsSnapped,x as computeMaximizedBox,P as growBoxToWidth,v as isSidebarStripReserved,e as navIcons,o as navSections,k as readAlwaysMaximizedFlag,g as scrollerIsFluid,n as sectionIcons,r as setShellNavIcons,d as snapZoneBox,p as squareCorners,a as startMenuCategories,M as widthToFit};
@@ -1 +1 @@
1
- import{requestFilesTrashView as n}from"./chunk-KGRJSTPM.js";var e=null;function t(n){e=n}function u(){return e}function r(){n()}var o="/files",i=null,l=null,s=0,c=/* @__PURE__ */new Set,f=()=>{l=i&&{id:i.id,request:i.request},c.forEach(n=>n())};function d(n,e){if(!i||i.id!==n)return;const{resolve:t}=i;i=null,f(),t(e)}function a(n,e){return new Promise(t=>{const u=i;s+=1,i={id:e.requestId??`files-choose-${s}`,request:e,resolve:t},f(),u?.resolve(null),n(o,{reuse:!0})})}function v(n){d(n,null)}function h(){return l}function m(n){return c.add(n),()=>{c.delete(n)}}function q(n,e){d(n,e)}function x(n,e){if(0===n.extensions.length)return!0;const t=e.lastIndexOf(".");return t>0&&n.extensions.includes(e.slice(t+1).toLowerCase())}var w=0;function p(){w+=1;let n=!1;return()=>{n||(n=!0,w-=1,setTimeout(()=>{0===w&&i&&d(i.id,null)},0))}}export{o as FILES_ROUTE,q as answerFilesChoice,x as choiceTakes,a as chooseInFiles,h as getFilesChoice,u as getFilesDemoTree,p as holdFilesChoice,r as openFilesInTrashMode,t as setFilesDemoTree,m as subscribeFilesChoice,v as withdrawFilesChoice};
1
+ import{requestFilesTrashView as n}from"./chunk-ST6FPYJ7.js";var e=null;function t(n){e=n}function u(){return e}function r(){n()}var o="/files",i=null,l=null,s=0,c=/* @__PURE__ */new Set,f=()=>{l=i&&{id:i.id,request:i.request},c.forEach(n=>n())};function d(n,e){if(!i||i.id!==n)return;const{resolve:t}=i;i=null,f(),t(e)}function a(n,e){return new Promise(t=>{const u=i;s+=1,i={id:e.requestId??`files-choose-${s}`,request:e,resolve:t},f(),u?.resolve(null),n(o,{reuse:!0})})}function v(n){d(n,null)}function h(){return l}function m(n){return c.add(n),()=>{c.delete(n)}}function q(n,e){d(n,e)}function x(n,e){if(0===n.extensions.length)return!0;const t=e.lastIndexOf(".");return t>0&&n.extensions.includes(e.slice(t+1).toLowerCase())}var w=0;function p(){w+=1;let n=!1;return()=>{n||(n=!0,w-=1,setTimeout(()=>{0===w&&i&&d(i.id,null)},0))}}export{o as FILES_ROUTE,q as answerFilesChoice,x as choiceTakes,a as chooseInFiles,h as getFilesChoice,u as getFilesDemoTree,p as holdFilesChoice,r as openFilesInTrashMode,t as setFilesDemoTree,m as subscribeFilesChoice,v as withdrawFilesChoice};
@@ -1 +1 @@
1
- import{getFilesStore as e,setSpreadsheetPreview as t}from"./chunk-KGRJSTPM.js";import{setPdfPreview as n}from"./chunk-I4RJAMLJ.js";import{toast_default as i}from"./chunk-VLT4ZEHT.js";var o="react-os-shell:preview-opened";async function a(a){const{filePath:r,filename:l,kind:c,onStaged:s,load:d}=a;try{const a=d?d():e().readShortcut?.(r)??null;let f;if(a)f=await a;else{const e=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(r)}`,{credentials:"include"});if(!e.ok)return i.error(`Download failed (${e.status})`),!1;f=await e.blob()}if("csv"===c){const e=await f.text();t({csv:e,filename:l}),s?.("/spreadsheet")}else{const e=URL.createObjectURL(f);n({url:e,filename:l,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(o,{detail:{filePath:r,filename:l,kind:c}})),!0}catch(e){return i.error(e?.message||"Open failed"),!1}}export{o as PREVIEW_OPENED_EVENT,a as openPreviewFile};
1
+ import{getFilesStore as e,setSpreadsheetPreview as t}from"./chunk-ST6FPYJ7.js";import{setPdfPreview as n}from"./chunk-I4RJAMLJ.js";import{toast_default as i}from"./chunk-VLT4ZEHT.js";var o="react-os-shell:preview-opened";async function a(a){const{filePath:r,filename:l,kind:c,onStaged:s,load:d}=a;try{const a=d?d():e().readShortcut?.(r)??null;let f;if(a)f=await a;else{const e=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(r)}`,{credentials:"include"});if(!e.ok)return i.error(`Download failed (${e.status})`),!1;f=await e.blob()}if("csv"===c){const e=await f.text();t({csv:e,filename:l}),s?.("/spreadsheet")}else{const e=URL.createObjectURL(f);n({url:e,filename:l,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(o,{detail:{filePath:r,filename:l,kind:c}})),!0}catch(e){return i.error(e?.message||"Open failed"),!1}}export{o as PREVIEW_OPENED_EVENT,a as openPreviewFile};
@@ -0,0 +1 @@
1
+ var r="16.6.0",a=r;export{a as APP_VERSION,r as VERSION};
@@ -0,0 +1 @@
1
+ import{triangleSurfaces as e,layerOfSurfaces as t,buildDrawGroups as s,bumpCanvas as i,flakeCanvas as r,framingDistance as n,backplateCanvas as o,orbitOf as a,shortestOrbit as h,orbitOffset as c}from"./chunk-OHC6Q4QD.js";import{fieldOfViewFor as l}from"./chunk-4N24K3UX.js";import{Color as d,Scene as m,PerspectiveCamera as p,Group as u,WebGLRenderer as g,SRGBColorSpace as f,PCFSoftShadowMap as w,PMREMGenerator as b,DirectionalLight as x,Mesh as k,PlaneGeometry as v,ShadowMaterial as y,Box3 as M,Vector3 as P,CanvasTexture as S,RepeatWrapping as C,BufferAttribute as I,MeshPhysicalMaterial as j,EquirectangularReflectionMapping as E,AgXToneMapping as A,ACESFilmicToneMapping as R,NeutralToneMapping as z,Vector2 as T,Raycaster as B,SphereGeometry as U,MeshBasicMaterial as D,BackSide as L,BoxGeometry as O}from"three";import{GLTFLoader as F}from"three/examples/jsm/loaders/GLTFLoader.js";import{RGBELoader as G}from"three/examples/jsm/loaders/RGBELoader.js";import{EffectComposer as H}from"three/examples/jsm/postprocessing/EffectComposer.js";import{RenderPass as W}from"three/examples/jsm/postprocessing/RenderPass.js";import{GTAOPass as Y}from"three/examples/jsm/postprocessing/GTAOPass.js";import{OutputPass as $}from"three/examples/jsm/postprocessing/OutputPass.js";import{MeshoptDecoder as X}from"three/examples/jsm/libs/meshopt_decoder.module.js";import{OrbitControls as _}from"three/examples/jsm/controls/OrbitControls.js";import{Reflector as q}from"three/examples/jsm/objects/Reflector.js";import{RoomEnvironment as N}from"three/examples/jsm/environments/RoomEnvironment.js";var Q={white:16777215,light:15066595,mid:12434874,dark:3815992,black:1052688},Z={sandblast:2,grain:1,brushed:1,radial:1,knurl:3,hammered:1,carbon:2},K=new d(3640029),J=e=>Math.min(1,Math.max(0,e));var V={studio:z,daylight:A,showroom:R,garage:A};var ee=class{renderer;scene=new m;camera=new p(6.9,1,.01,100);controls;pmrem;envCache=/* @__PURE__ */new Map;envWanted="";textureCache=/* @__PURE__ */new Map;backplateImage=null;backplateUrl="";backplateTexture=null;hidden=/* @__PURE__ */new Set;composer=null;gtao=null;size=[1,1];wheel=new u;mesh=null;triSurface=null;sourceIndex=null;surfaceCount=0;radius=.3;groundY=-.3;shadowPlane;reflector=null;key;layers=[];materials=[];selected=/* @__PURE__ */new Set;sceneSettings=null;tween=null;frame=0;userDragging=!1;disposed=!1;onCameraChange=null;constructor(e){this.renderer=new g({canvas:e,antialias:!0,alpha:!0}),this.renderer.outputColorSpace=f,this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=w,this.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio||1)),this.pmrem=new b(this.renderer),this.controls=new _(this.camera,e),this.controls.enablePan=!1,this.controls.enableDamping=!0,this.controls.minPolarAngle=0,this.controls.maxPolarAngle=Math.PI,this.controls.addEventListener("start",()=>{this.userDragging=!0,this.tween=null}),this.controls.addEventListener("end",()=>{this.userDragging=!1}),this.controls.addEventListener("change",()=>this.reportCamera(this.userDragging)),this.key=new x(16777215,.6),this.key.castShadow=!0,this.key.shadow.mapSize.set(2048,2048),this.scene.add(this.key,this.key.target,this.wheel),this.shadowPlane=new k(new v(1,1),new y({opacity:.35})),this.shadowPlane.rotation.x=-Math.PI/2,this.shadowPlane.receiveShadow=!0,this.scene.add(this.shadowPlane),this.loop()}async load(t,s){const i=(new F).setMeshoptDecoder(X),r=await i.loadAsync(t);if(this.disposed)return;let n=null;if(r.scene.traverse(e=>{!n&&e.isMesh&&(n=e)}),!n)throw new Error("The model holds no mesh.");const o=n;o.updateWorldMatrix(!0,!1);const a=o.geometry.clone().applyMatrix4(o.matrixWorld),h=a.getAttribute("_surface");if(!h)throw new Error("The model carries no surface ids.");const c=(new M).setFromBufferAttribute(a.getAttribute("position")),l=c.getCenter(new P);a.translate(-l.x,-l.y,-l.z),this.radius=c.getSize(new P).length()/2,this.groundY=-(c.max.y-c.min.y)/2,function(e){const t=e.getAttribute("position"),s=e.getAttribute("normal"),i=t.count,r=new Float32Array(2*i),n=new Float32Array(2*i);for(let e=0;e<i;e+=1){const i=t.getX(e),o=t.getY(e),a=t.getZ(e),h=s?Math.abs(s.getX(e)):0,c=s?Math.abs(s.getY(e)):0,l=s?Math.abs(s.getZ(e)):1,[d,m]=l>=h&&l>=c?[i,o]:h>=c?[o,a]:[i,a];r[2*e]=d/.05,r[2*e+1]=m/.05,n[2*e]=Math.atan2(o,i)/(2*Math.PI)*8,n[2*e+1]=Math.hypot(i,o)/.1}e.setAttribute("uv",new I(r,2)),e.setAttribute("uv1",new I(n,2))}(a);const d=a.getIndex();this.sourceIndex=d?Array.from(d.array):null;const m=d?d.count/3:a.getAttribute("position").count/3;this.triSurface=e(h.array,this.sourceIndex,m);let p=-1;for(const e of this.triSurface)e>p&&(p=e);this.surfaceCount=Math.max(s,p+1),this.mesh&&(this.wheel.remove(this.mesh),this.mesh.geometry.dispose()),this.mesh=new k(a,[]),this.mesh.castShadow=!0,this.wheel.add(this.mesh),this.placeGround(),this.rebuild()}setLayers(e,t,s){const i=e!==this.layers||s!==this.selected||t.length!==this.materials.length;this.layers=e,this.materials=t,this.selected=s,i?this.rebuild():this.paint()}setHidden(e){e!==this.hidden&&(this.hidden=e,this.rebuild())}texture(e,t,s,i=!1){let r=this.textureCache.get(e);return r||(r=new S(t()),r.wrapS=r.wrapT=C,r.repeat.set(s,s),r.anisotropy=this.renderer.capabilities.getMaxAnisotropy(),i&&(r.colorSpace=f),this.textureCache.set(e,r)),r}rebuild(){if(!this.mesh||!this.triSurface)return;const e=Math.max(1,this.materials.length),i=t(this.surfaceCount,this.layers.slice(0,e-1),e-1),{index:r,groups:n}=s(this.sourceIndex,this.triSurface,i,this.selected,e,this.hidden),o=this.mesh.geometry;o.setIndex(new I(r,1)),o.clearGroups();for(const e of n)o.addGroup(e.start,e.count,e.materialIndex);const a=this.mesh.material;for(;a.length<2*e;)a.push(new j);for(;a.length>2*e;)a.pop()?.dispose();this.paint()}paint(){if(!this.mesh)return;const e=this.mesh.material;this.materials.forEach((t,s)=>{for(const n of[0,1]){const o=e[2*s+n];if(!o)continue;/^#[0-9a-f]{6}$/i.test(t.color)&&o.color.set(t.color),o.metalness=J(t.metallic),o.roughness=J(t.roughness),o.clearcoat=J(t.clearcoat??0),o.clearcoatRoughness=J(t.clearcoatRoughness??0),o.side=2,o.emissive.copy(n?K:new d(0)),o.emissiveIntensity=n?.45:0,o.visible=!1!==t.visible;const a=t.bump&&"none"!==t.bump?t.bump:null;o.bumpMap=a?this.texture(`bump:${a}`,()=>i(a),Z[a]):null,o.bumpMap&&(o.bumpMap.channel="radial"===a?1:0),o.bumpScale=.5+4*J(t.bumpDepth??.3);const h=t.flakes&&"none"!==t.flakes?t.flakes:null;o.normalMap=h?this.texture(`flakes:${h}`,()=>r(h),"fine"===h?24:10):null,o.normalScale.set("coarse"===h?.6:.35,"coarse"===h?.6:.35),o.needsUpdate=!0}})}setScene(e){const t=this.sceneSettings;this.sceneSettings=e;const s=e.environmentUrl||`procedural:${e.environment}`;s!==this.envWanted&&(this.envWanted=s,this.applyEnvironment(this.proceduralEnvironment(e.environment),e.environment),e.environmentUrl&&this.loadEnvironment(e.environmentUrl,e.environment)),this.scene.environmentRotation.set(0,e.environmentRotation*Math.PI/180,0),this.scene.backgroundRotation.set(0,e.environmentRotation*Math.PI/180,0),this.renderer.toneMappingExposure=e.brightness/100;const i=(e.contrast??100)/100;this.key.intensity=.6*i*i,this.scene.environmentIntensity=1.2-.2*i,this.applyBackground(),this.shadowPlane.visible=e.groundShadow;const r=e.shadowSoftness/100;this.shadowPlane.material.opacity=J((e.shadowDarkness??35)/100*(1.4-.6*r)),this.key.shadow.radius=1+14*r,this.key.shadow.blurSamples=16,this.setReflection(e.groundReflection),this.setAmbientOcclusion(Boolean(e.ambientOcclusion)),t?.focalLength!==e.focalLength&&(this.camera.fov=l(e.focalLength),this.camera.updateProjectionMatrix(),this.controls.minDistance=n(this.radius,this.camera.fov)/4,this.controls.maxDistance=2.5*n(this.radius,this.camera.fov))}proceduralEnvironment(e){const t=`procedural:${e}`;let s=this.envCache.get(t);return s||(s=this.pmrem.fromScene(function(e){if("studio"===e)return new N;const t=new m,s=new k(new U(20,32,16),new D({side:L})),i=(e,s,i,r,n)=>{const o=new k(new O(e,s,.1),new D({color:new d(i).multiplyScalar(r)}));o.position.set(...n),o.lookAt(0,0,0),t.add(o)};if("daylight"===e)s.material.color.setHex(12571882),i(30,30,16774368,6,[0,18,4]),i(40,6,10135194,1,[0,-12,0]);else if("showroom"===e)s.material.color.setHex(4210752),i(16,2,16777215,12,[0,14,0]),i(3,10,16777215,6,[12,4,6]),i(3,10,16777215,6,[-12,4,6]);else{s.material.color.setHex(1842204);for(let e=-2;e<=2;e+=1)i(1,12,16777215,8,[4*e,14,0]);i(10,4,16769720,2,[0,2,14])}return t.add(s),t}(e),.04).texture,this.envCache.set(t,s)),s}async loadEnvironment(e,t){let s=this.envCache.get(e);if(!s)try{const t=await(new G).loadAsync(e);if(t.mapping=E,this.disposed)return void t.dispose();s=this.pmrem.fromEquirectangular(t).texture,t.dispose(),this.envCache.set(e,s)}catch{return}this.envWanted!==e||this.disposed||this.applyEnvironment(s,t)}applyEnvironment(e,t){this.scene.environment=e,this.renderer.toneMapping=V[t],this.applyBackground()}applyBackground(){const e=this.sceneSettings;if(!e)return;const t=e.backgroundMode??"colour",s="transparent"===e.background?null:new d(Q[e.background]);if(this.scene.backgroundBlurriness=0,"environment"===t&&this.scene.environment)return this.scene.background=this.scene.environment,void(this.scene.backgroundBlurriness=.02+(e.backgroundBlur??30)/100*.6);if("backplate"===t&&e.backplateUrl){if(e.backplateUrl!==this.backplateUrl){const t=e.backplateUrl;this.backplateUrl=t,this.backplateImage=null;const s=new Image;s.crossOrigin="anonymous",s.onload=()=>{this.disposed||this.backplateUrl!==t||(this.backplateImage=s,this.applyBackground())},s.src=e.backplateUrl}if(this.backplateImage){const[t,i]=this.size;return this.backplateTexture?.dispose(),this.backplateTexture=new S(o(this.backplateImage,t/Math.max(1,i),e.backplateFit??"fill",`#${(s??new d(12434874)).getHexString()}`)),this.backplateTexture.colorSpace=f,void(this.scene.background=this.backplateTexture)}}this.scene.background=s}setAmbientOcclusion(e){if(e&&!this.composer){const[e,t]=this.size;this.composer=new H(this.renderer),this.composer.addPass(new W(this.scene,this.camera)),this.gtao=new Y(this.scene,this.camera,e,t),this.gtao.updateGtaoMaterial({radius:.12*this.radius,distanceFallOff:1,thickness:1}),this.gtao.blendIntensity=.8,this.composer.addPass(this.gtao),this.composer.addPass(new $),this.composer.setPixelRatio(this.renderer.getPixelRatio()),this.composer.setSize(e,t)}else!e&&this.composer&&(this.gtao?.dispose(),this.composer.dispose(),this.composer=null,this.gtao=null)}setReflection(e){if(e&&!this.reflector){const e=12*this.radius;this.reflector=new q(new v(e,e),{textureWidth:1024,textureHeight:1024,color:new d(5592405)}),this.reflector.rotation.x=-Math.PI/2,this.reflector.position.y=this.groundY-5e-4,this.scene.add(this.reflector)}else!e&&this.reflector&&(this.scene.remove(this.reflector),this.reflector.dispose(),this.reflector=null)}placeGround(){const e=12*this.radius;this.shadowPlane.scale.set(e,e,1),this.shadowPlane.position.y=this.groundY,this.reflector&&(this.reflector.position.y=this.groundY-5e-4),this.key.position.set(.6*this.radius,6*this.radius,1.2*this.radius);const t=this.key.shadow.camera;t.left=t.bottom=2*-this.radius,t.right=t.top=2*this.radius,t.far=12*this.radius,t.updateProjectionMatrix(),this.gtao?.updateGtaoMaterial({radius:.12*this.radius})}goTo(e,t=!0){const s=n(this.radius,this.camera.fov);this.controls.target.set(0,0,0);const i=this.camera.position.clone().sub(this.controls.target),r=a([i.x,i.y,i.z]),o=h(r,e);if(!t)return this.camera.position.set(...c(o,s)),this.camera.lookAt(0,0,0),this.controls.update(),void this.reportCamera(!1);this.tween={from:r,to:o,distance:[i.length()||s,s],t:0}}setInteractive(e){this.controls.enabled=e}setPan(e){this.controls.enablePan=e,this.controls.screenSpacePanning=!0}setTurntable(e){this.controls.autoRotate=e,this.controls.autoRotateSpeed=1.2}pick(e,t){if(!this.mesh||!this.triSurface)return null;const s=this.renderer.domElement.getBoundingClientRect(),i=new T((e-s.left)/s.width*2-1,-(t-s.top)/s.height*2+1),r=new B;r.setFromCamera(i,this.camera);const n=r.intersectObject(this.mesh,!1).find(e=>e.face&&!1!==this.mesh?.material[e.face.materialIndex]?.visible);if(!n?.face)return null;const o=this.mesh.geometry.getAttribute("_surface");return Math.round(o.getX(n.face.a))}async renderImage(e,t){const[s,i]=this.size,r=this.scene.background;this.resize(e,e,1),t&&(this.scene.background=null);this.composer&&!t?this.composer?.render():this.renderer.render(this.scene,this.camera);const n=document.createElement("canvas");n.width=n.height=e;const o=n.getContext("2d");if(o&&o.drawImage(this.renderer.domElement,0,0,e,e),this.scene.background=r,this.resize(s,i),!o)throw new Error("This browser cannot draw the image.");return new Promise((e,t)=>n.toBlob(s=>s?e(s):t(new Error("No image.")),"image/png"))}resize(e,t,s){this.size=[e,t];const i=s??Math.min(2,window.devicePixelRatio||1);this.renderer.setPixelRatio(i),this.renderer.setSize(e,t,!1),this.composer?.setPixelRatio(i),this.composer?.setSize(e,t),this.camera.aspect=e/Math.max(1,t),this.camera.updateProjectionMatrix(),this.backplateImage&&this.applyBackground()}reportCamera(e){const t=this.camera.position.clone().sub(this.controls.target);this.onCameraChange?.({...a([t.x,t.y,t.z]),userInteraction:e})}loop=()=>{if(!this.disposed){if(this.frame=requestAnimationFrame(this.loop),this.tween){const e=this.tween;e.t=Math.min(1,e.t+1/24);const t=1-(1-e.t)**3,s={theta:e.from.theta+(e.to.theta-e.from.theta)*t,phi:e.from.phi+(e.to.phi-e.from.phi)*t},i=e.distance[0]+(e.distance[1]-e.distance[0])*t;this.camera.position.set(...c(s,i)),this.camera.lookAt(0,0,0),e.t>=1&&(this.tween=null),this.reportCamera(!1)}this.controls.update(),this.composer?this.composer.render():this.renderer.render(this.scene,this.camera)}};dispose(){this.disposed=!0,cancelAnimationFrame(this.frame),this.controls.dispose(),this.mesh?.geometry.dispose(),this.mesh?.material.forEach(e=>e.dispose()),this.reflector?.dispose(),this.envCache.forEach(e=>e.dispose()),this.textureCache.forEach(e=>e.dispose()),this.backplateTexture?.dispose(),this.gtao?.dispose(),this.composer?.dispose(),this.pmrem.dispose(),this.renderer.dispose()}};export{ee as StageEngine};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{MEDIA_FILES_DRAG_TYPE,MEDIA_FILE_DRAG_TYPE,MEDIA_FOLDER_DRAG_TYPE,MediaLibrary as default,readMediaFileDrag}from"../chunk-5MJO7RMB.js";import"../chunk-BTMZ5MUY.js";import"../chunk-5B7CLXHC.js";import"../chunk-2KD6R2XF.js";import"../chunk-IC72MGON.js";import"../chunk-ONUNFTZD.js";import"../chunk-CGUMJZUB.js";import"../chunk-AYTGYEOI.js";import"../chunk-W3454ZES.js";import"../chunk-SACUSHVN.js";import"../chunk-WREUA43Q.js";import"../chunk-UFJR63AO.js";import"../chunk-GRAFJD3L.js";import"../chunk-F4KB3K3I.js";import"../chunk-B4Y5NGHR.js";import"../chunk-XOEYCDWT.js";import"../chunk-W7HTHKN2.js";import"../chunk-EO5RLFRX.js";import"../chunk-GML6FVPA.js";import"../chunk-6KBDNYRW.js";import"../chunk-2NMW66P5.js";import"../chunk-VLKDWKVR.js";import"../chunk-OLFYNMTD.js";import"../chunk-LACL4MAR.js";import"../chunk-452LT77I.js";import"../chunk-CGZBDI6C.js";import"../chunk-TALQMTCE.js";import"../chunk-EFKJLUYP.js";import"../chunk-MF7OELXP.js";import"../chunk-OSMRYND3.js";import"../chunk-BYTQRQ5P.js";import"../chunk-AYZY3YNC.js";import"../chunk-TAIH2VIW.js";import"../chunk-TAB3K2WF.js";import"../chunk-TNGIXSTM.js";import"../chunk-EIFNESXS.js";import"../chunk-PO2KNVCC.js";import"../chunk-CJ4OEY3T.js";import"../chunk-LLXI57MB.js";import"../chunk-NQWORKZD.js";import"../chunk-VWGWZY7A.js";import"../chunk-DBQNYJZ6.js";import"../chunk-L2WQOJ3T.js";import"../chunk-UGTRSRIW.js";import"../chunk-F3ZOO23R.js";import"../chunk-NJY4HPNB.js";import"../chunk-PM6HY5BH.js";import"../chunk-DWGYC7OD.js";import"../chunk-4YH7U7WL.js";import"../chunk-ABIWAS5K.js";import"../chunk-P56YLT73.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-37FQVY2O.js";import"../chunk-TSZPGDU3.js";import"../chunk-ISVODSRP.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-BWJZTHZ6.js";import"../chunk-FAPZFMS3.js";import"../chunk-CIZAUBWA.js";import"../chunk-PGN5ME7B.js";import"../chunk-5QRHQCRG.js";import"../chunk-62LW225J.js";import"../chunk-TAHHZGRH.js";import"../chunk-KEFNQEXZ.js";import"../chunk-PU2GJVMG.js";import"../chunk-3FININUU.js";import"../chunk-VLT4ZEHT.js";import"../chunk-LYGIOJ3J.js";import"../chunk-MRJKZWWV.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";
2
+ export{MEDIA_FILES_DRAG_TYPE,MEDIA_FILE_DRAG_TYPE,MEDIA_FOLDER_DRAG_TYPE,MediaLibrary as default,readMediaFileDrag}from"../chunk-N7EZ2BFE.js";import"../chunk-BTMZ5MUY.js";import"../chunk-5B7CLXHC.js";import"../chunk-IC72MGON.js";import"../chunk-2KD6R2XF.js";import"../chunk-ONUNFTZD.js";import"../chunk-CGUMJZUB.js";import"../chunk-AYTGYEOI.js";import"../chunk-W3454ZES.js";import"../chunk-SACUSHVN.js";import"../chunk-WREUA43Q.js";import"../chunk-UFJR63AO.js";import"../chunk-GRAFJD3L.js";import"../chunk-F4KB3K3I.js";import"../chunk-B4Y5NGHR.js";import"../chunk-XOEYCDWT.js";import"../chunk-W7HTHKN2.js";import"../chunk-EO5RLFRX.js";import"../chunk-GML6FVPA.js";import"../chunk-6KBDNYRW.js";import"../chunk-2NMW66P5.js";import"../chunk-VLKDWKVR.js";import"../chunk-OLFYNMTD.js";import"../chunk-LACL4MAR.js";import"../chunk-452LT77I.js";import"../chunk-CGZBDI6C.js";import"../chunk-TALQMTCE.js";import"../chunk-EFKJLUYP.js";import"../chunk-MF7OELXP.js";import"../chunk-OSMRYND3.js";import"../chunk-BYTQRQ5P.js";import"../chunk-AYZY3YNC.js";import"../chunk-TAIH2VIW.js";import"../chunk-TAB3K2WF.js";import"../chunk-TNGIXSTM.js";import"../chunk-EIFNESXS.js";import"../chunk-PO2KNVCC.js";import"../chunk-CJ4OEY3T.js";import"../chunk-LLXI57MB.js";import"../chunk-NQWORKZD.js";import"../chunk-VWGWZY7A.js";import"../chunk-DBQNYJZ6.js";import"../chunk-L2WQOJ3T.js";import"../chunk-UGTRSRIW.js";import"../chunk-F3ZOO23R.js";import"../chunk-NJY4HPNB.js";import"../chunk-PM6HY5BH.js";import"../chunk-DWGYC7OD.js";import"../chunk-4YH7U7WL.js";import"../chunk-ABIWAS5K.js";import"../chunk-P56YLT73.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-37FQVY2O.js";import"../chunk-TSZPGDU3.js";import"../chunk-ISVODSRP.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-BWJZTHZ6.js";import"../chunk-FAPZFMS3.js";import"../chunk-CIZAUBWA.js";import"../chunk-PGN5ME7B.js";import"../chunk-5QRHQCRG.js";import"../chunk-62LW225J.js";import"../chunk-TAHHZGRH.js";import"../chunk-KEFNQEXZ.js";import"../chunk-PU2GJVMG.js";import"../chunk-3FININUU.js";import"../chunk-VLT4ZEHT.js";import"../chunk-LYGIOJ3J.js";import"../chunk-MRJKZWWV.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";