var I=Object.defineProperty;var a=(f,u)=>I(f,"name",{value:u,configurable:!0});import{s as w,u as V}from"./vendor-vue-CXt3ZZQ3.js";import{J as T,ag as z}from"./vendor-primevue-B6rcS73U.js";import{co as S,e as P,d as k,p as E,C as W,q as j,z as F,_ as K}from"./index-2-qFLlQP.js";import{g as L}from"./GraphView-CjDjhvN7.js";import{bx as B,E as s,h as D,l as _,c as C,d as c,z as q,by as p,bg as R,j as y,k as b,q as A,A as G,s as g,u as H,e as J}from"./vendor-other-CSX7WseZ.js";import"./vendor-xterm-CWYFmgbN.js";import"./vendor-three-BKWXAgVe.js";import"./vendor-tiptap-BkFTmTb3.js";import"./UserAvatar.vue_vue_type_script_setup_true_lang-ZL9faEyg.js";import"./index-_AAd9eTu.js";import"./LazyImage.vue_vue_type_script_setup_true_lang-CcI-aYhS.js";import"./keybindingService-CWbdWLPI.js";import"./serverConfigStore-trwJaF_M.js";import"./WidgetInputNumber.vue_vue_type_script_setup_true_lang-aeh2Ot2n.js";import"./widgetPropFilter-CygYoMQt.js";import"./WidgetLayoutField.vue_vue_type_script_setup_true_lang-Dps42A-g.js";import"./WidgetWithControl.vue_vue_type_script_setup_true_lang-COy_p9Eh.js";const O=["aria-label"],U=1,X=B({__name:"BatchCountEdit",setup(f){const u=S(),{batchCount:t}=w(u),v=P(),m=s(()=>v.get("Comfy.QueueButton.BatchCountLimit")),r=a(e=>{let o;if(e){const n=t.value-1;o=Math.min(n*2,m.value)}else{const n=t.value+1;o=Math.floor(n/2)}t.value=o},"handleClick");return(e,o)=>{const n=D("tooltip");return _((c(),C("div",{class:"batch-count","aria-label":e.$t("menu.batchCount")},[q(p(T),{modelValue:p(t),"onUpdate:modelValue":o[0]||(o[0]=h=>R(t)?t.value=h:null),class:"w-14",min:U,max:m.value,fluid:"","show-buttons":"",pt:{incrementButton:{class:"w-6",onmousedown:a(()=>{r(!0)},"onmousedown")},decrementButton:{class:"w-6",onmousedown:a(()=>{r(!1)},"onmousedown")}}},null,8,["modelValue","max","pt"])],8,O)),[[n,{value:e.$t("menu.batchCount"),showDelay:600},void 0,{bottom:!0}]])}}}),Y=k(X,[["__scopeId","data-v-19217ad4"]]),Z={class:"queue-button-group flex"},ee=B({__name:"ComfyQueueButton",setup(f){const u=E(),{mode:t,batchCount:v}=w(S()),m=W(),r=s(()=>L(j.rootGraph,m.nodeDefsByName)),{t:e}=V(),o=s(()=>{const i={disabled:{key:"disabled",label:e("menu.run"),tooltip:e("menu.disabledTooltip"),command:a(()=>{t.value="disabled"},"command")},change:{key:"change",label:`${e("menu.run")} (${e("menu.onChange")})`,tooltip:e("menu.onChangeTooltip"),command:a(()=>{t.value="change"},"command")}};return i.instant={key:"instant",label:`${e("menu.run")} (${e("menu.instant")})`,tooltip:e("menu.instantTooltip"),command:a(()=>{t.value="instant"},"command")},i}),n=s(()=>o.value[t.value]||o.value.disabled),h=s(()=>Object.values(o.value)),M=s(()=>r.value?"icon-[lucide--triangle-alert]":u.shiftDown?"icon-[lucide--list-start]":t.value==="disabled"?"icon-[lucide--play]":t.value==="instant"?"icon-[lucide--fast-forward]":t.value==="change"?"icon-[lucide--step-forward]":"icon-[lucide--play]"),x=s(()=>r.value?e("menu.runWorkflowDisabled"):u.shiftDown?e("menu.runWorkflowFront"):e("menu.runWorkflow")),$=F(),Q=a(async i=>{const d="shiftKey"in i&&i.shiftKey?"Comfy.QueuePromptFront":"Comfy.QueuePrompt";v.value>1,await $.execute(d,{metadata:{subscribe_to_run:!1,trigger_source:"button"}})},"queuePrompt");return(i,N)=>{const d=D("tooltip");return c(),C("div",Z,[_((c(),y(p(z),{class:"comfyui-queue-button",label:String(n.value?.label??""),severity:"primary",size:"small",model:h.value,"data-testid":"queue-button",onClick:Q},{icon:b(()=>[J("i",{class:g(M.value)},null,2)]),item:b(({item:l})=>[_((c(),y(K,{variant:l.key===p(t)?"primary":"secondary",size:"sm",class:"w-full justify-start"},{default:b(()=>[l.icon?(c(),C("i",{key:0,class:g(l.icon)},null,2)):A("",!0),G(" "+H(String(l.label??"")),1)]),_:2},1032,["variant"])),[[d,{value:l.tooltip,showDelay:600}]])]),_:1},8,["label","model"])),[[d,{value:x.value,showDelay:600},void 0,{bottom:!0}]]),q(Y)])}}}),Ce=k(ee,[["__scopeId","data-v-214102f7"]]);export{Ce as default};
//# sourceMappingURL=ComfyQueueButton-BbIk3ALi.js.map
