import"./rolldown-runtime-DIIn1E2Q.js";import"./vendor-primevue-BDZ_jj__.js";import"./vendor-firebase-D7u00oy9.js";import{q as e}from"./vendor-vue-core-DO0afONr.js";import"./vendor-other-CiPV8GBG.js";import"./useFeatureFlags-CeS8LuDc.js";import"./api-Cw7jP9TY.js";import"./vendor-markdown-Da9QPS2x.js";import"./colorUtil-Bsa2N3Sq.js";import"./i18n-CF_88JEG.js";import"./vendor-reka-ui-B53kLmAc.js";import"./Button-Ca3rDegY.js";import{la as t,sa as n,ur as r}from"./dialogService-CfgsFapJ.js";import"./formatUtil-CeKPWstn.js";import"./dialogStore-G2juoay4.js";import"./userStore-Czt6jT20.js";import"./useErrorHandling-DXaBpHI1.js";import"./extensionStore-MnMxnUwx.js";import"./useExternalLink-BItqlDxr.js";import"./vendor-tiptap-Bk1lVUYZ.js";import"./markdownRendererUtil-_EbNpPBW.js";import"./Popover-CXKWNrM3.js";import"./electronDownloadStore-DudKQmD7.js";import"./vendor-three-ByVNcHWs.js";import"./Load3DControls-DVZXDsO9.js";import"./constants-BUScsz3f.js";import"./Load3dViewerContent-CT6YG_I9.js";import{t as i}from"./Load3D-D4wvyLMa.js";import"./AnimationControls-55ndBLKY.js";import{r as a,t as o}from"./load3dService-CDqzlPgU.js";import"./useLoad3dViewer-jbkITkL8.js";import{n as s}from"./useLoad3d-BegJPxr-.js";import{n as c,t as l}from"./Load3DConfiguration-BOVSiJ3-.js";var u={name:`image`,type:`Preview3D`,isPreview:!0};r().registerExtension({name:`Comfy.SaveGLB`,async beforeRegisterNodeDef(e,t){t.name===`SaveGLB`&&(t.input.required.image=[`PREVIEW_3D`])},getCustomWidgets(){return{PREVIEW_3D(e){let r=new n({node:e,name:u.name,component:i,inputSpec:u,options:{}});return r.type=`load3D`,t(e,r),{widget:r}}}},getNodeMenuItems(e){if(e.constructor.comfyClass!==`SaveGLB`)return[];let t=o().getLoad3d(e);return!t||t.isSplatModel()?[]:c(t)},async nodeCreated(t){if(t.constructor.comfyClass!==`SaveGLB`)return;let[n,r]=t.size;t.setSize([Math.max(n,400),Math.max(r,550)]),await e();let i=t.onExecuted;t.onExecuted=function(e){i?.call(this,e);let n=e[`3d`]?.[0];n&&s(t).waitForLoad3d(e=>{let r=t.widgets?.find(e=>e.name===`image`);if(e&&r){let i=(n.subfolder??``)+`/`+(n.filename??``);r.value=i;let o=new l(e,t.properties),s=n.type,onModelLoaded=()=>{e.removeEventListener(`modelLoadingEnd`,onModelLoaded),a.generateThumbnailIfNeeded(e,i,s)};e.addEventListener(`modelLoadingEnd`,onModelLoaded),o.configureForSaveMesh(s,i)}})}}});
//# sourceMappingURL=saveMesh-CYJcBguh.js.map