import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import"./vendor-primevue-DOcVZxnt.js";import"./vendor-firebase-yTFzdAQf.js";import{q as t}from"./vendor-vue-core-CvBSzfTV.js";import"./vendor-other-ZVm7XS8K.js";import"./useFeatureFlags-CMK9o9Rw.js";import"./api-OgmjiUkn.js";import"./colorUtil-C9tyO6rZ.js";import"./i18n-S80A-Sy1.js";import"./vendor-reka-ui-EFkcZtPy.js";import"./Button-C-kbn1lh.js";import{Ar as n,Ut as r,kr as i}from"./dialogService-Dp405gae.js";import"./systemStatsStore-BAnEcJS2.js";import"./useErrorHandling-DfKSzlg9.js";import"./dialogStore-BDXSs8Ic.js";import"./userStore-C5cqCkur.js";import"./useCopyToClipboard-_eFTtqIy.js";import"./vendor-tiptap-BZCaYoPl.js";import"./vendor-markdown-Gcn_JH9N.js";import"./markdownRendererUtil-BD0lrBqH.js";import"./useExternalLink-CZSEXO8Q.js";import"./vendor-three-BAimT_0v.js";import"./Load3DControls-Dwy85lpj.js";import"./constants-BfAw8fYp.js";import"./Load3dViewerContent-ByJn2lJ1.js";import{t as a}from"./Load3D-C1CzEqfd.js";import"./AnimationControls-DreJKHo5.js";import{r as o,t as s}from"./load3dService-EQ3loI-m.js";import"./useLoad3dViewer-v1uCUy1N.js";import{n as c}from"./useLoad3d-CXQpiCjw.js";import{n as l,t as u}from"./Load3DConfiguration-DnOw3oC3.js";var d={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 t=new i({node:e,name:d.name,component:a,inputSpec:d,options:{}});return t.type=`load3D`,n(e,t),{widget:t}}}},getNodeMenuItems(e){if(e.constructor.comfyClass!==`SaveGLB`)return[];let t=s().getLoad3d(e);return!t||t.isSplatModel()?[]:l(t)},async nodeCreated(e){if(e.constructor.comfyClass!==`SaveGLB`)return;let[n,r]=e.size;e.setSize([Math.max(n,400),Math.max(r,550)]),await t();let i=e.onExecuted;e.onExecuted=function(t){i?.call(this,t);let n=t[`3d`]?.[0];n&&c(e).waitForLoad3d(t=>{let r=e.widgets?.find(e=>e.name===`image`);if(t&&r){let i=(n.subfolder??``)+`/`+(n.filename??``);r.value=i;let a=new u(t,e.properties),s=n.type,onModelLoaded=()=>{t.removeEventListener(`modelLoadingEnd`,onModelLoaded),o.generateThumbnailIfNeeded(t,i,s)};t.addEventListener(`modelLoadingEnd`,onModelLoaded),a.configureForSaveMesh(s,i)}})}}});
//# sourceMappingURL=saveMesh-s8sA13Xu.js.map