1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="20c1e231-cc4a-41a3-99db-45e90eb4f663",e._sentryDebugIdIdentifier="sentry-dbid-20c1e231-cc4a-41a3-99db-45e90eb4f663")}catch(B){}import{r as e,j as t}from"./CSvdPb0x.js";import{b as s,y as a,ff as l,ab as o,hk as i,g$ as n,fe as r,yM as d,hc as c,v as m,bh as u,B as p,uj as f,gE as h,dD as y,m as b,cG as x,cF as j,dm as g,ac as S,b5 as D}from"./B97aNPiN.js";import{O as C,S as v}from"./C43MIjsr.js";import{u as w,C as T}from"./C8Pkfv60.js";import{t as k}from"./DoDNGv0-.js";import{R as A}from"./3utiQB6j.js";import"./D6ESIijv.js";const $=({type:e,count:s,onProductsDelete:a,onModalClose:l,isSelectedAll:o,setActiveTab:i})=>{const n=m(),{handleSubmit:r,formState:{isSubmitting:d}}=w(),c=_(s>1,s)[e];return t.jsxs("form",{onSubmit:r(async()=>{o?i(I):(await a(),e!==f&&n.push(`${h[e]}?tab=${e}`))}),children:[t.jsxs("h2",{children:["Delete ",c]}),t.jsxs("p",{className:"large",children:["You are about to delete ",c,". Are you sure you want to Continue?"]}),t.jsx(u,{}),t.jsxs("div",{className:"flex jc-sb",children:[t.jsx(p,{type:"text",onClick:l,children:"Cancel"}),t.jsxs(p,{size:"large",type:"primary",htmlType:"submit",loading:d,children:["Delet",d?"ing":"e"]})]})]})},{Group:E}=A,I="failsafe",z=[{key:x,component:$},{key:j,component:$},{key:f,component:$},{key:g,component:({count:e,isExtensionStore:s,onProductsDelete:a,onModalClose:l,radio:o,isSelectedAll:i,setActiveTab:n,setRadio:r,type:d})=>{const{push:c}=m(),{formState:{isSubmitting:f},handleSubmit:y}=w(),x=_(e>1,e)[d],j=[{value:0,label:"Delete only from AutoDS"},{value:1,label:"Delete from AutoDS and Selling Platform",isDisabled:s}];return t.jsxs("form",{onSubmit:y(async()=>{i?n(I):(await a(),c(h[d]))}),children:[t.jsxs("h2",{children:["Confirm delete (",x,")"]}),t.jsxs("p",{children:["What would you like to do with ",x]}),t.jsx(E,{value:o,onChange:({target:{value:e}})=>r(e),children:b(j,({label:e,value:s,isDisabled:a})=>t.jsx(A,{value:s,disabled:a,children:e},s))}),t.jsx(u,{}),t.jsxs("div",{className:"flex jc-sb",children:[t.jsx(p,{type:"text",onClick:l,children:"Cancel"}),t.jsxs(p,{type:"primary",size:"large",htmlType:"submit",loading:f,children:["Delet",f?"ing":"e"]})]})]})}},{key:I,component:({type:e,count:s,onFailsafeDelete:a,onModalClose:l})=>{const{control:o,formState:{isValid:i,isSubmitting:n},handleSubmit:r}=w({mode:"onChange",defaultValues:{failsafe:""},resolver:k(M)}),d=_(s>1,s)[e];return t.jsxs("form",{onSubmit:r(a),children:[t.jsxs("h2",{children:["Confirm delete (",d,")"]}),t.jsx("p",{className:"m-b-15",children:"Are you sure you want to delete these items?"}),t.jsxs("p",{children:[t.jsx("span",{className:"fz-15",children:d})," will be deleted forever"]}),t.jsx(T,{name:I,control:o,render:e=>t.jsx(y,{size:"large",placeholder:"Type DELETE to confirm",...e})}),t.jsx(u,{}),t.jsxs("div",{className:"flex jc-sb",children:[t.jsx(p,{type:"text",onClick:l,children:"Cancel"}),t.jsxs(p,{size:"large",type:"primary",htmlType:"submit",disabled:!i,loading:n,children:["Delet",n?"ing":"e"]})]})]})}}],M=C().shape({failsafe:v().required().test("is-delete","Type DELETE to confirm",e=>e.toUpperCase()==="delete".toUpperCase())}),_=(e,t)=>
1({[f]:`${e?t:"an"} untracked product${e?"s":""}`,[g]:`${e?t:"a"} product${e?"s":""}`,[x]:`${e?t:"a"} draft${e?"s":""}`,[j]:`${e?t:"a"} scheduled draft${e?"s":""}`}),N=S.div.withConfig({componentId:"sc-d5dl2i-0"})(["width:400px;h2{text-transform:capitalize;}p{color:",";font-family:",";}.ant-radio-wrapper{margin:8px 0;color:",";font-size:",";}"],({theme:e})=>e.colorTextPrimary,({theme:e})=>e.fontInterSemiBold,({theme:e})=>e.colorTextPrimary,({theme:e})=>e.fontSizeMedium),P=m=>{const{activeTab:u,...p}=(({selected:t,setSelected:m,isSelectedAll:u,isBulk:p,type:f,onModalClose:h,dateItemId:y})=>{const b=s(),{count:x}=a(l,{type:f,id:y}),j=a(i,{id:o(t),type:f}),g=a(n,{id:j.autods_store_id}),S=a(r,{type:f,id:y}),[D,C]=e.useState(g?0:1),[v,w]=e.useState(f),T=async()=>{p?(await b(d(t,f,!!D,u,o(S)?.scheduled_datetime)),m([])):await b(c(...t,f,!!D)),h()};return{activeTab:v,setActiveTab:w,radio:D,setRadio:C,isExtensionStore:g,type:f,selected:t,isSelectedAll:u,onModalClose:h,count:u?x:t?.length,onFailsafeDelete:T,onProductsDelete:T}})(m),f=b(z,({key:e,component:s})=>({key:e,label:e,children:t.jsx(s,{...p})}));return t.jsx(N,{children:t.jsx(D,{tabBarStyle:{display:"none"},items:f,activeKey:u,animated:!1,destroyOnHidden:!0})})};export{P as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.