import{a as D}from"./chunk-YJCJDCVP.js";import{a as _,c as b}from"./chunk-OASPW2P2.js";import{a as c,b as F}from"./chunk-YBFCDINU.js";import{e as y,q as T}from"./chunk-5T3OVTF5.js";import{i as v,p as g,v as w}from"./chunk-PTIJDS6I.js";import{b as u}from"./chunk-Q6LCSRIW.js";import{A as p,v as d}from"./chunk-E24W34C4.js";import{V as f}from"./chunk-EYDNSYYE.js";import{r as C}from"./chunk-T6CC5WUU.js";import{e as Y,g as h}from"./chunk-VKWPEFWQ.js";h();h();async function I(t,e,i){let r=e.themes;e.development&&(r=[(await new D(t).find()).id.toString()]);let n=t.storeFqdn,s=await L(t,{...e,themes:r,development:!1});if(!e.force&&!i&&!await M(s,n))return;await Promise.all(s.map(o=>(y(o)&&v(),T(o.id,t))));let l=e.environment?[{subdued:`Environment: ${e.environment}

`}]:[];d({body:f(s,o=>[...l,`The following themes were deleted from ${n}:`,F(o)],o=>[...l,"The theme",...c(o),`was deleted from ${n}.`])})}async function L(t,e){if(e.selectTheme||e.themes.length>0)return b(t,e);let i=t.storeFqdn;return[await _(t,{header:`Select a theme to delete from ${i}`,filter:{development:e.development}})]}async function M(t,e){let r={message:f(t,n=>[`Delete the following themes from ${e}?`],n=>["Delete",...c(n),`from ${e}?`]),confirmationMessage:"Yes, confirm changes",cancellationMessage:"Cancel"};return t.length>1&&(r.infoTable={"":t.map(c)}),p(r)}var a=Y(C(),1);var O,m=class extends w{async command(e,i,r){let{environment:n,development:s,force:l,theme:o}=e,E=o??[];await I(i,{selectTheme:e["show-all"],environment:n,development:s,themes:E,force:l},r)}};O=m;m.summary="Delete remote themes from the connected store. This command can't be undone.";m.descriptionWithMarkdown=`Deletes a theme from your store.

  You can specify multiple themes by ID. If no theme is specified, then you're prompted to select the theme that you want to delete from the list of themes in your store.

  You're asked to confirm that you want to delete the specified themes before they are deleted. You can skip this confirmation using the \`--force\` flag.`;m.description=O.descriptionWithoutMarkdown();m.flags={...u,...g,development:a.Flags.boolean({char:"d",description:"Delete your development theme.",env:"SHOPIFY_FLAG_DEVELOPMENT"}),"show-all":a.Flags.boolean({char:"a",description:"Include others development themes in theme list.",env:"SHOPIFY_FLAG_SHOW_ALL"}),force:a.Flags.boolean({char:"f",description:"Skip confirmation.",env:"SHOPIFY_FLAG_FORCE"}),theme:a.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID",multiple:!0})};m.multiEnvironmentsFlags=["store","password",["development","theme"]];var V=m;export{V as a};
