import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import"./vendor-primevue-DxVRNMbC.js";import"./vendor-firebase-CdLSXhbt.js";import{A as t,D as n,Dt as r,F as i,I as a,It as o,O as s,R as c,Vt as l,_t as u,et as d,g as f,gt as p,it as m,j as h,k as g,pt as _,q as v}from"./vendor-vue-core-X6q-rGJs.js";import"./vendor-other-CyG3qq8S.js";import{t as y}from"./types-DW97iHDr.js";import"./useFeatureFlags-CxRWjdi1.js";import{Tt as b}from"./api-DQLKc1Xa.js";import"./vendor-markdown-Cola12Wc.js";import"./colorUtil-Cth7eqhK.js";import{n as x}from"./vendor-i18n-B5g6Drzm.js";import"./i18n-DjV_9lZM.js";import"./vendor-reka-ui-CHPbCe4i.js";import{t as S}from"./Button-C7dWyQyS.js";import{i as C,t as w}from"./dialogService-Cqui0UMO.js";import"./systemStatsStore-D9aNY5gT.js";import"./useErrorHandling-BFB8eSj5.js";import{t as T}from"./dialogStore-CXD5Bcfy.js";import"./useCopyToClipboard-C74olorb.js";import"./vendor-tiptap-BXSIIPYY.js";import"./markdownRendererUtil-Bm7Umh6C.js";import"./useExternalLink-Cc30SNi3.js";import{a as E,d as D,n as O,o as k,s as A}from"./useConflictDetection-jrmAdTd-.js";var j={class:`flex w-full flex-col gap-2 py-2 px-4`},M={class:`flex flex-col gap-1 text-sm text-muted-foreground`},N={class:`flex items-center gap-1`},P={for:`doNotAskAgainNodes`},F={key:0,class:`flex justify-end gap-1`},I={key:1,class:`flex w-full items-center justify-between gap-2`},L={key:2,class:`flex justify-end gap-1`},R=c({__name:`MissingNodesFooter`,props:{missingNodeTypes:{}},setup(e){let c=T(),{t:R}=x(),z=r(!1);_(z,e=>{C().set(`Comfy.Workflow.ShowMissingNodesWarning`,!e)});let handleGotItClick=()=>{c.closeDialog({key:`global-missing-nodes`})};function openShowMissingNodesSetting(){c.closeDialog({key:`global-missing-nodes`}),w().showSettingsDialog(void 0,`Comfy.Workflow.ShowMissingNodesWarning`)}let{missingNodePacks:B,isLoading:V,error:H}=k(),U=O(),W=E();function handleOpenManager(){W.openManager({initialTab:A.Missing,showToastOnLegacyError:!0})}let G=n(()=>B.value?.length?B.value.some(e=>U.isPackInstalling(e.id)):!1),K=n(()=>W.shouldShowManagerButtons.value),q=n(()=>W.shouldShowInstallButton.value),J=n(()=>e.missingNodeTypes?.some(e=>typeof e==`string`||typeof e==`object`&&!e.isReplaceable)??!1),Y=r(!1);return _(B,e=>{e&&e.length>0&&(Y.value=!0)},{immediate:!0}),_(n(()=>Y.value?!V.value&&!G.value&&B.value?.length===0:!1),async e=>{!y&&e&&q.value&&(await v(),c.closeDialog({key:`global-missing-nodes`}),b().add({severity:`success`,summary:R(`g.success`),detail:R(`manager.allMissingNodesInstalled`),life:3e3}))}),(e,n)=>{let r=m(`i18n-t`);return d(),h(`div`,j,[s(`div`,M,[s(`div`,N,[u(s(`input`,{id:`doNotAskAgainNodes`,"onUpdate:modelValue":n[0]||=e=>z.value=e,type:`checkbox`,class:`h-4 w-4 cursor-pointer`},null,512),[[f,z.value]]),s(`label`,P,l(e.$t(`missingModelsDialog.doNotAskAgain`)),1)]),z.value?(d(),g(r,{key:0,keypath:`missingModelsDialog.reEnableInSettings`,tag:`span`,class:`text-sm text-muted-foreground ml-6`},{link:p(()=>[a(S,{variant:`textonly`,class:`underline cursor-pointer p-0 text-sm text-muted-foreground hover:bg-transparent`,onClick:openShowMissingNodesSetting},{default:p(()=>[i(l(e.$t(`missingModelsDialog.reEnableInSettingsLink`)),1)]),_:1})]),_:1})):t(``,!0)]),J.value?o(y)?(d(),h(`div`,I,[a(S,{variant:`textonly`,size:`sm`,as:`a`,href:`https://www.comfy.org/cloud`,target:`_blank`,rel:`noopener noreferrer`},{default:p(()=>[n[1]||=s(`i`,{class:`icon-[lucide--info]`},null,-1),s(`span`,null,l(e.$t(`missingNodes.cloud.learnMore`)),1)]),_:1}),a(S,{variant:`secondary`,size:`md`,onClick:handleGotItClick},{default:p(()=>[i(l(e.$t(`missingNodes.cloud.gotIt`)),1)]),_:1})])):K.value?(d(),h(`div`,L,[a(S,{variant:`textonly`,onClick:handleOpenManager},{default:p(()=>[i(l(e.$t(`g.openManager`)),1)]),_:1}),q.value?(d(),g(D,{key:0,type:`secondary`,size:`md`,disabled:o(V)||!!o(H)||o(B).length===0||G.value,"is-loading":o(V),"node-packs":o(B),label:o(V)?e.$t(`manager.gettingInfo`):e.$t(`manager.installAllMissingNodes`)},null,8,[`disabled`,`is-loading`,`node-packs`,`label`])):t(``,!0)])):t(``,!0):(d(),h(`div`,F,[a(S,{variant:`secondary`,size:`md`,onClick:handleGotItClick},{default:p(()=>[i(l(e.$t(`nodeReplacement.skipForNow`)),1)]),_:1})]))])}}});export{R as default};
//# sourceMappingURL=MissingNodesFooter-C4U2SZo4.js.map