import{_ as Tt}from"./TitleBreadcrumb.vue_vue_type_style_index_0_lang-BxraGGjs.js";import{_ as Bt}from"./wenhao-C-cdfRm0.js";import{s as Mt,_ as Lt,c as Ft,a as Nt,b as Ot}from"./storeApi-CK4jcdxX.js";import{av as Qt,aI as ve,I as _e,k as h,X as te,o as d,A as w,a as e,w as t,e as v,t as g,ax as Fe,ae as Se,af as Ee,b as o,N as l,U as ee,bb as At,ak as he,M as Ue,bc as Ht,F as J,B as de,bd as Wt,s as B,d as W,ay as Ie,ag as Ve,ah as Te,c as T,V as qe,f as Re,ab as zt,G as ce,aw as Kt,y as se,aT as Qe,aN as He,aU as We,x as rt,al as qt,R as ze,Q as Xt,Z as Me,be as ct,aF as $t,l as Yt,b3 as jt,bf as yt,aB as ne,z as pe,K as ke,v as ae,p as ie,a1 as Ae,n as be,am as Zt,bg as dt,aG as Gt,aQ as Jt,W as Ke,$ as el}from"./index-CW_ph8U7.js";import{_ as De}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as Le,a as tl}from"./filter-B7bEK2Kt.js";import{o as ll,a as ol}from"./eventBus-B6OcWcK_.js";import{s as Q}from"./shopTypeEnum-5xzXy4lw.js";/* empty css */import{A as al,a as il,b as sl,c as nl}from"./AddonDiyImageTextDialog-CIKFyOHZ.js";import{c as Xe}from"./close-BcCOVtMl.js";import{p as rl}from"./productApi-DlDyLUoc.js";const fe="https://dashboard.jetprintapp.com",Ne=Qt({id:"myProduct",state:()=>({}),actions:{async productPage(A){return console.log("productPage....",A),await ve.post(`${fe}/shopapi/custom/product/page`,A)},async productRemoveBatch(A){return await ve.post(`${fe}/shopapi/custom/product/remove/batch`,A)},async publish(A){return await ve.post(`${fe}/shopapi/custom/product/publish`,A)},async publishStatus(A){return await ve.post(`${fe}/shopapi/custom/product/publishStatus`,A)},async productCount(A){return await ve.post(`${fe}/shopapi/custom/product/count`,A)},async hideOnShopify(A){return await ve.post(`${fe}/shopapi/custom/product/hideOnShopify`,A)},async showOnShopify(A){return await ve.post(`${fe}/shopapi/custom/product/showOnShopify`,A)},async productCopyBatch(A){return await ve.post(`${fe}/shopapi/custom/product/copy/batch`,A)},async skuModify(A){return await ve.post(`${fe}/shopapi/custom/product/sku/modify`,A)}}}),cl=A=>(Ve("data-v-a06dad4c"),A=A(),Te(),A),dl={class:"d-flex align-center"},ul=cl(()=>o("div",{class:"d-flex warn-con"},[o("div",{class:"warn pr-3 pt-1"},[o("img",{src:Bt,alt:""})]),o("div",{class:"desc"}," Due to sales channel limitations some sales channel specific product details like product description text formating and tags might be lost in copy process. ")],-1)),pl={key:0,class:"d-flex pa-3 ps-0"},hl={class:""},vl={class:""},fl={class:"font-weight-medium",style:{"font-size":"16px"}},gl={class:"text-medium-emphasis text-subtitle-2"},ml={class:"ml-auto"},Al={key:0,src:Lt,style:{width:"48px",height:"48px"},alt:""},yl={key:1,src:Ft,style:{width:"48px",height:"48px"},alt:""},_l={key:2,src:Nt,style:{width:"48px",height:"48px"},alt:""},Sl={key:3,src:Ot,style:{width:"48px",height:"48px"},alt:""},wl={class:"btns"},Cl=_e({__name:"CopyProductDialog",emits:["reflash"],setup(A,{expose:z,emit:P}){const K=Mt(),D=h([]);let M=h(!1);h(""),te({});const F=h([]);h(!1);const E=h(""),i=h(!1),y=te({color:"success",msg:"The product has been duplicated",isShow:!1});let H=h(""),R=h("");function Z(){K.shopList({}).then(m=>{D.value=m.data.records})}const O=Ne();function S(){i.value=!0;const m={toStoreId:E.value,customProductIds:F.value,contentType:"application/json;charset=UTF-8"};O.productCopyBatch(m).then(V=>{i.value=!1,V.code==200?(y.color="success",y.msg="The product has been duplicated",y.isShow=!0):(y.color="error",y.msg="Copy failed",y.isShow=!0),I()})}function _(m){M.value=!0,H.value=m.length,F.value=m}const I=()=>{M.value=!1};return Z(),z({openDialog:_,closeDialog:I}),(m,V)=>(d(),w(J,null,[e(Fe,{modelValue:y.isShow,"onUpdate:modelValue":V[0]||(V[0]=C=>y.isShow=C),color:y.color,timeout:3e3,variant:"flat",rounded:"md",location:"top"},{default:t(()=>[v(g(y.msg),1)]),_:1},8,["modelValue","color"]),e(Ie,{modelValue:l(M),"onUpdate:modelValue":V[3]||(V[3]=C=>he(M)?M.value=C:M=C),"max-width":575},{default:t(()=>[e(Se,null,{default:t(()=>[e(Ee,{style:{"padding-top":"24px"}},{default:t(()=>[o("h3",dl,[v("Copy "+g(l(H))+" products to … ",1),e(ee,{src:l(At),width:32,height:32,class:"close",onClick:V[1]||(V[1]=C=>he(M)?M.value=!1:M=!1)},null,8,["src"])]),e(Ue,{class:"mt-4 mb-5"}),ul,e(Ue,{class:"mt-5"}),e(Ht,{class:"scroll",modelValue:E.value,"onUpdate:modelValue":V[2]||(V[2]=C=>E.value=C)},{default:t(()=>[(d(!0),w(J,null,de(D.value,(C,le)=>(d(),w("div",{key:le},[l(R)!=C.shopId?(d(),w("div",pl,[o("div",hl,[e(Wt,{color:"secondary",value:C.shopId,disabled:l(R)==C.shopId},null,8,["value","disabled"])]),o("div",vl,[o("p",fl,g(C.name),1),o("p",gl,g(C.url?C.url:"No Sales Channel"),1)]),o("div",ml,[C.type==1?(d(),w("img",Al)):B("",!0),C.type==2||C.type==4?(d(),w("img",yl)):B("",!0),C.type==3?(d(),w("img",_l)):B("",!0),C.type==5?(d(),w("img",Sl)):B("",!0)])])):B("",!0),e(Ue)]))),128))]),_:1},8,["modelValue"]),o("div",wl,[e(W,{class:"mt-4",color:"lightprimary",onClick:I},{default:t(()=>[v("Cancel")]),_:1}),e(W,{class:"mt-4 ml-4",color:"btnBlue",loading:i.value,disabled:i.value,onClick:S},{default:t(()=>[v("Confirm")]),_:1},8,["loading","disabled"])])]),_:1})]),_:1})]),_:1},8,["modelValue"])],64))}}),Pl=De(Cl,[["__scopeId","data-v-a06dad4c"]]),bl="/assets/none-BLI64MfL.svg",ut="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABLpJREFUaEPdWk9sFFUY/76ppUD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CYII=",kl={PUBLISHED:{text:"已发布",value:2},UNPUBLISHED:{text:"未发布",value:1},HIDDENSTORE:{text:"隐藏在商店",value:3}},N=kl,Ul=A=>(Ve("data-v-0386c8d6"),A=A(),Te(),A),El={class:"position-relative"},Dl={class:"btnleft"},xl={class:"btnright"},Rl=Ul(()=>o("div",{class:"mb-3 font-weight-medium",style:{"font-size":"16px"}},"View",-1)),Il=_e({__name:"PreMainAllDialog",setup(A,{expose:z}){let P=h(!1),K=te([]),D=h(""),M=h(0);function F(R){D.value=R[0],K=R,P.value=!0}const E=()=>{P.value=!1};function i(R){M.value=R}function y(R){R=="left"?M.value>0&&M.value--:R=="right"&&M.value!=K.length-1&&M.value++}z({openDialog:F,closeDialog:E});let H=h("");return H.value=window.innerWidth,window.addEventListener("resize",function(R){H.value=window.innerWidth}),(R,Z)=>{const O=ce("ChevronLeftIcon"),S=ce("ChevronRightIcon");return d(),T(Ie,{modelValue:l(P),"onUpdate:modelValue":Z[3]||(Z[3]=_=>he(P)?P.value=_:P=_),width:l(H)>760?"50%":"375px"},{default:t(()=>[e(Se,null,{default:t(()=>[e(Ee,null,{default:t(()=>[e(ee,{src:l(Xe),width:32,height:32,class:"close",onClick:Z[0]||(Z[0]=_=>he(P)?P.value=!1:P=!1)},null,8,["src"]),e(qe,{class:"mt-4"},{default:t(()=>[e(Re,{cols:"12",lg:"7"},{default:t(()=>[o("div",El,[e(ee,{src:l(K)[l(M)],rounded:""},null,8,["src"]),o("div",Dl,[e(W,{icon:"",variant:"text",onClick:Z[1]||(Z[1]=_=>y("left"))},{default:t(()=>[e(O,{size:"25","stroke-width":"1.5"})]),_:1})]),o("div",xl,[e(W,{icon:"",variant:"text",onClick:Z[2]||(Z[2]=_=>y("right"))},{default:t(()=>[e(S,{size:"25","stroke-width":"1.5"})]),_:1})])])]),_:1}),e(Re,{cols:"12",lg:"5"},{default:t(()=>[Rl,e(qe,null,{default:t(()=>[(d(!0),w(J,null,de(l(K),(_,I)=>(d(),T(Re,{cols:"3",sm:"2",md:"2",lg:"4",key:I,onClick:m=>i(I)},{default:t(()=>[e(ee,{src:_,rounded:"sm",class:zt(I==l(M)?"img-border":"")},null,8,["src","class"])]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue","width"])}}}),Vl=De(Il,[["__scopeId","data-v-0386c8d6"]]),$e=A=>(Ve("data-v-4a950611"),A=A(),Te(),A),Tl={class:"d-flex align-center pt-3 pb-3"},Bl=$e(()=>o("div",{class:"text-medium-emphasis mt-4"},"Please confirm the Retail Price again.",-1)),Ml=$e(()=>o("div",{class:"font-weight-medium mt-4"},"Pricing",-1)),Ll={class:"table mt-4"},Fl=$e(()=>o("div",{class:"d-flex"},[o("div",{class:"line-48 text-subtitle-2",style:{width:"35%","min-width":"150px"}},"Variants"),o("div",{class:"line-48 text-subtitle-2",style:{width:"16%","min-width":"70px"}},"Production Cost(USD)"),o("div",{class:"line-48 text-subtitle-2",style:{width:"16%","min-width":"150px"}},"Retail Price(USD)"),o("div",{class:"line-48 text-subtitle-2",style:{width:"16%","min-width":"150px"}},"Profit(USD)"),o("div",{class:"line-48 text-subtitle-2",style:{width:"16%","min-width":"150px"}},"Profit Margin")],-1)),Nl=["onClick"],Ol={class:"line-48 text-subtitle-2 d-flex align-center",style:{width:"35%","min-width":"150px"}},Ql={class:"line-48 text-subtitle-2",style:{width:"16%","min-width":"70px"}},Hl=["onClick"],Wl=["onUpdate:modelValue","onChange"],zl=["onClick"],Kl={class:"line-48 text-subtitle-2",style:{width:"16%","min-width":"150px"}},ql={class:"line-48 text-subtitle-2",style:{width:"16%","min-width":"150px"}},Xl=["onClick"],$l={class:"line-48 text-subtitle-2 d-flex align-center",style:{width:"35%","padding-left":"30px","min-width":"150px"}},Yl={class:"line-48 text-subtitle-2",style:{width:"16%","min-width":"70px"}},jl=["onClick"],Zl=["onUpdate:modelValue","onChange"],Gl=["onClick"],Jl={class:"line-48 text-subtitle-2",style:{width:"16%","min-width":"150px"}},eo={class:"line-48 text-subtitle-2",style:{width:"16%","min-width":"150px"}},to={class:"d-flex align-center mt-3"},lo={class:"line-48 text-subtitle-2 d-flex align-center",style:{width:"35%","padding-left":"10px","min-width":"150px"}},oo={style:{"margin-left":"60px"}},ao={class:"line-48 text-subtitle-2",style:{width:"16%","min-width":"70px"}},io=["onClick"],so=["onUpdate:modelValue","onChange"],no=["onClick"],ro={class:"line-48 text-subtitle-2",style:{width:"16%","min-width":"150px"}},co={class:"line-48 text-subtitle-2",style:{width:"16%","min-width":"150px"}},uo={class:"btns"},po=_e({__name:"UpdateVariants",setup(A,{expose:z}){const P=Kt("pushProduct"),K=Ne();let D=h(!1),M=h([{nameArr:[{name:"white"},{name:"Gender"},{name:"size"}],production:15,shopping:8.725,retal:15,profit:8.75,profitMargin:"33%",children:[{nameArr:[{name:"Men"},{name:"size"}],production:15,shopping:8.725,retal:15,profit:8.75,profitMargin:"33%",children:[{nameArr:[{name:"Use/Eh35"}],production:15,shopping:8.725,retal:15,profit:8.75,profitMargin:"33%"}]}]},{nameArr:[{name:"Blank"},{name:"Gender"},{name:"size"}],production:15,shopping:8.725,retal:15,profit:8.75,profitMargin:"33%"}]),F=h([11722,11723,11740,11741]),E=h([]),i=h([]),y=h(""),H=h(""),R=te({type:"",msg:"",isShow:!1});function Z(s,u,f,p,b){console.log("skuIds2...",s),console.log("skuMaps2...",u),console.log("skuInfos2...",f),F.value=s,M.value=u,E.value=f,y.value=p,H.value=b,D.value=!0;const x=[];s.forEach(Y=>{f.forEach(a=>{if(Y===a.id&&(a.option1&&typeof a.option1=="string"&&(a.option1=JSON.parse(a.option1)),a.option2&&typeof a.option2=="string"&&(a.option2=JSON.parse(a.option2)),a.option3&&typeof a.option3=="string"&&(a.option3=JSON.parse(a.option3)),a.option1.text)){const q={};if(q.name=a.option1.text,q.price=a.price,q.retailPrice=a.recommendRetailPrice,q.compareAtPrice=a.recommendCompareAtPrice,(!a.option2||!a.option2.text)&&(q.id=a.id),q.profit=a.recommendRetailPrice-a.price,q.profit2=(a.recommendRetailPrice-a.price)/a.recommendRetailPrice,q.children=[],x.push(q),a.option2&&a.option2.text){let X=0;x.forEach(oe=>{if(oe.name===a.option1.text){oe.name===a.option2.text&&(X=X+1,X>0&&console.log(oe.name));const $={};$.name=a.option2.text,$.price=a.price,$.compareAtPrice=a.recommendCompareAtPrice,$.retailPrice=a.recommendRetailPrice,$.name1=a.option1.text,$.profit=a.recommendRetailPrice-a.price,(!a.option3||!a.option3.text)&&($.id=a.id),a.option3&&a.option3.text&&($.isUp=!1),$.profit2=(a.recommendRetailPrice-a.price)/a.recommendRetailPrice,$.children=[];let we=0;if(oe.children.forEach(j=>{if(j.name===a.option2.text&&(we=we+1,a.option3&&a.option3.text)){const ue={};ue.compareAtPrice=a.recommendCompareAtPrice,ue.price=a.price,ue.name=a.option3.text,ue.id=a.id,ue.profit=a.recommendRetailPrice-a.price,ue.profit2=(a.recommendRetailPrice-a.price)/a.recommendRetailPrice,ue.retailPrice=a.recommendRetailPrice,j.children.push(ue)}}),we===0&&oe.children.push($),a.option3&&a.option3.text){const j={};j.compareAtPrice=a.recommendCompareAtPrice,j.price=a.price,j.name=a.option3.text,j.id=a.id,j.profit=a.recommendRetailPrice-a.price,j.profit2=(a.recommendRetailPrice-a.price)/a.recommendRetailPrice,j.retailPrice=a.recommendRetailPrice,$.children.push(j)}}})}}})});const k=()=>{const Y=new Map;for(const a of x)Y.has(a.name)||Y.set(a.name,a);return[...Y.values()]};i.value=k(),console.log("var...",i.value),console.log("variantsList...",i.value)}function O(s,u){i.value[s].retailPrice=u,i.value[s].profit=i.value[s].retailPrice-i.value[s].price;const f=i.value[s].profit/i.value[s].retailPrice;i.value[s].profit2=f.toFixed(1);for(let p=0;p<i.value[s].children.length;p++){i.value[s].children[p].retailPrice=i.value[s].retailPrice,i.value[s].children[p].profit=i.value[s].profit,i.value[s].children[p].profit2=i.value[s].profit2;for(let b=0;b<i.value[s].children[p].children.length;b++)i.value[s].children[p].children[b].retailPrice=i.value[s].retailPrice,i.value[s].children[p].children[b].profit=i.value[s].profit,i.value[s].children[p].children[b].profit2=i.value[s].profit2}}function S(s,u,f){i.value[s].children[u].retailPrice=f,i.value[s].children[u].profit=i.value[s].children[u].retailPrice-i.value[s].children[u].price;const p=i.value[s].children[u].profit/f;i.value[s].children[u].profit2=p.toFixed(1);for(let b=0;b<i.value[s].children[u].children.length;b++)i.value[s].children[u].children[b].retailPrice=i.value[s].children[u].retailPrice,i.value[s].children[u].children[b].profit=i.value[s].children[u].profit,i.value[s].children[u].children[b].profit2=i.value[s].children[u].profit2}function _(s,u,f,p){i.value[s].children[u].children[f].retailPrice=p,i.value[s].children[u].children[f].profit=i.value[s].children[u].children[f].retailPrice-i.value[s].children[u].children[f].price;const b=i.value[s].children[u].children[f].profit/p;i.value[s].children[u].children[f].profit2=b.toFixed(1)}let I=h(!1);function m(){I.value=!0;const s={};s.contentType="application/json;charset=UTF-8",s.customProductId=H.value,s.skuList=[];const u=[];for(let f=0;f<i.value.length;f++)if(i.value[f].id){const p={};p.compareAtPrice=i.value[f].compareAtPrice,p.id=i.value[f].id,p.retailPrice=i.value[f].retailPrice,u.push(p)}else if(i.value[f].children[0].id)for(let p=0;p<i.value[f].children.length;p++){const b={};b.compareAtPrice=i.value[f].children[p].compareAtPrice,b.id=i.value[f].children[p].id,b.retailPrice=i.value[f].children[p].retailPrice,u.push(b)}else for(let p=0;p<i.value[f].children.length;p++)for(let b=0;b<i.value[f].children[p].children.length;b++){const x={};x.compareAtPrice=i.value[f].children[p].children[b].compareAtPrice,x.id=i.value[f].children[p].children[b].id,x.retailPrice=i.value[f].children[p].children[b].retailPrice,u.push(x)}s.skuList=u;try{return K.skuModify(s).then(async f=>{I.value=!1,f.code===200?y.value===N.HIDDENSTORE.value||y.value===N.PUBLISHED.value?P&&P():(C(),R.type="success",R.msg="Success",R.isShow=!0):(C(),R.type="error",R.msg=f.msg,R.isShow=!0)})}finally{I.value=!1}}function V(s){}const C=()=>{D.value=!1};let le=h("");return le.value=window.innerWidth,window.addEventListener("resize",function(s){le.value=window.innerWidth}),z({openDialog:Z,closeDialog:C}),(s,u)=>{const f=ce("ChevronDownIcon"),p=ce("ChevronRightIcon"),b=ce("MinusIcon"),x=ce("PlusIcon");return d(),w(J,null,[e(Fe,{modelValue:l(R).isShow,"onUpdate:modelValue":u[0]||(u[0]=k=>l(R).isShow=k),color:l(R).type,timeout:3e3,variant:"flat",rounded:"md",location:"top"},{default:t(()=>[v(g(l(R).msg),1)]),_:1},8,["modelValue","color"]),e(Ie,{modelValue:l(D),"onUpdate:modelValue":u[2]||(u[2]=k=>he(D)?D.value=k:D=k),"max-width":"60%","min-width":"346px"},{default:t(()=>[e(Se,null,{default:t(()=>[e(Ee,null,{default:t(()=>[o("h3",Tl,[v("Update Variants "),e(ee,{src:l(Xe),width:32,height:32,class:"close",onClick:u[1]||(u[1]=k=>he(D)?D.value=!1:D=!1)},null,8,["src"])]),e(Ue,{class:"mt-4"}),Bl,Ml,o("div",Ll,[Fl,e(Ue,{class:"mt-4"}),(d(!0),w(J,null,de(l(i),(k,Y)=>(d(),w(J,{key:Y},[o("div",{class:"d-flex align-center mt-3",onClick:se(a=>k.isShow=!k.isShow,["stop"])},[o("div",Ol,[k.isShow&&k.children&&k.children.length>0?(d(),T(f,{key:0})):B("",!0),!k.isShow&&k.children&&k.children.length>0?(d(),T(p,{key:1})):B("",!0),v(g(k.name),1)]),o("div",Ql,g(k.price),1),o("div",{class:"line-48 text-subtitle-2 d-flex align-center",style:{width:"16%","min-width":"150px"},onClick:se(V,["stop"])},[e(Qe,{variant:"outlined",size:"small",divided:"",color:"primary",style:{height:"38px"}},{default:t(()=>[o("div",{class:"btn add",onClick:se(a=>O(Y,k.retailPrice-1),["stop"])},[e(b,{size:"18"})],8,Hl),He(o("input",{type:"text",class:"btn-input","onUpdate:modelValue":a=>k.retailPrice=a,onChange:se(a=>O(Y,k.retailPrice),["stop"])},null,40,Wl),[[We,k.retailPrice]]),o("div",{class:"btn del",onClick:se(a=>O(Y,k.retailPrice+1),["stop"])},[e(x,{size:"18"})],8,zl)]),_:2},1024)]),o("div",Kl,g(s.$filters.MoneyFormat(k.profit)),1),o("div",ql,g(s.$filters.RateFormat(k.profit2))+"%",1)],8,Nl),(d(!0),w(J,null,de(k.children,(a,q)=>(d(),w("div",{key:q,style:rt(k.isShow?"display: block":"display: none")},[o("div",{class:"d-flex align-center mt-3",onClick:X=>a.isShow=!a.isShow},[o("div",$l,[a.isShow&&a.children&&a.children.length>0?(d(),T(f,{key:0})):B("",!0),!a.isShow&&a.children&&a.children.length>0?(d(),T(p,{key:1})):B("",!0),o("span",null,g(a.name),1)]),o("div",Yl,g(a.price),1),o("div",{class:"line-48 text-subtitle-2 d-flex align-center",style:{width:"16%","min-width":"150px"},onClick:se(V,["stop"])},[e(Qe,{variant:"outlined",size:"small",divided:"",color:"primary",style:{height:"38px"}},{default:t(()=>[o("div",{class:"btn add",onClick:se(X=>S(Y,q,a.retailPrice-1),["stop"])},[e(b,{size:"18"})],8,jl),He(o("input",{type:"text",class:"btn-input","onUpdate:modelValue":X=>a.retailPrice=X,onChange:se(X=>S(Y,q,a.retailPrice),["stop"])},null,40,Zl),[[We,a.retailPrice]]),o("div",{class:"btn del",onClick:se(X=>S(Y,q,a.retailPrice+1),["stop"])},[e(x,{size:"18"})],8,Gl)]),_:2},1024)]),o("div",Jl,g(s.$filters.MoneyFormat(a.profit)),1),o("div",eo,g(s.$filters.RateFormat(a.profit2))+"%",1)],8,Xl),(d(!0),w(J,null,de(a.children,(X,oe)=>(d(),w("div",{key:oe,style:rt(a.isShow?"display: block":"display: none")},[o("div",to,[o("div",lo,[o("span",oo,g(X.name),1)]),o("div",ao,g(X.price),1),o("div",{class:"line-48 text-subtitle-2",style:{width:"16%","min-width":"150px"},onClick:se(V,["stop"])},[e(Qe,{variant:"outlined",size:"small",divided:"",color:"primary",style:{height:"38px"}},{default:t(()=>[o("div",{class:"btn add",onClick:se($=>_(Y,q,oe,X.retailPrice-1),["stop"])},[e(b,{size:"18"})],8,io),He(o("input",{type:"text",class:"btn-input","onUpdate:modelValue":$=>X.retailPrice=$,onChange:se($=>_(Y,q,oe,X.retailPrice),["stop"])},null,40,so),[[We,X.retailPrice]]),o("div",{class:"btn del",onClick:se($=>_(Y,q,oe,X.retailPrice+1),["stop"])},[e(x,{size:"18"})],8,no)]),_:2},1024)]),o("div",ro,g(s.$filters.MoneyFormat(X.profit)),1),o("div",co,g(s.$filters.RateFormat(X.profit2))+"%",1)])],4))),128))],4))),128))],64))),128))]),o("div",uo,[e(W,{class:"mt-4",color:"lightprimary",onClick:C},{default:t(()=>[v("Cancel")]),_:1}),e(W,{class:"mt-4 ml-4",color:"btnBlue",loading:l(I),onClick:m},{default:t(()=>[v("Update")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["modelValue"])],64)}}}),ho=De(po,[["__scopeId","data-v-4a950611"]]),_t=A=>(Ve("data-v-7332e4d7"),A=A(),Te(),A),vo={class:"d-flex align-center pt-3 pb-3"},fo=_t(()=>o("div",{class:"text-medium-emphasis"},"Please select your variants again to update your product.",-1)),go={class:"title font-weight-medium mt-4",style:{"font-size":"14px"}},mo={class:"checkbox"},Ao=_t(()=>o("div",{class:"clear"},null,-1)),yo={class:"btns"},_o=_e({__name:"SkuUpdate",setup(A,{expose:z}){let P=h(!1),K=h(""),D=h([]),M=h([]),F=h(""),E=h("");te([]);function i(O,S,_){E.value=_,K.value=O,F.value=S,H(O),P.value=!0}const y=()=>{P.value=!1};function H(O){const S=rl(),_={id:O,skuInfos:!0,skuMap:!0};S.blankProductDetail2(_).then(I=>{I.data.skuMaps.forEach(m=>{m.items.forEach(V=>{V.checked=!0,V.option=JSON.parse(V.option)})}),console.log("res.data.skuMaps...",I.data.skuMaps),D.value=I.data.skuMaps,M.value=I.data.skuInfos})}let R=h(null);function Z(){let O=[];D.value.forEach(C=>{C.items.forEach(le=>{le.checked&&O.push(...le.ids)})}),console.log("getIds...",O);for(var S={},_=0;_<O.length;_++){var I=O[_];S[I]?S[I]++:S[I]=1}var m=[];for(var V in S)S.hasOwnProperty(V)&&S[V]>=D.value.length&&m.push(parseInt(V));R.value.openDialog(m,D.value,M.value,F.value,E.value),y(),console.log(m)}return z({openDialog:i,closeDialog:y}),(O,S)=>(d(),w(J,null,[e(ho,{ref_key:"refUpdateVariants",ref:R},null,512),e(Ie,{modelValue:l(P),"onUpdate:modelValue":S[1]||(S[1]=_=>he(P)?P.value=_:P=_),"max-width":"550px"},{default:t(()=>[e(Se,null,{default:t(()=>[e(Ee,null,{default:t(()=>[o("h3",vo,[v("Update Variants "),e(ee,{src:l(Xe),width:32,height:32,class:"close",onClick:S[0]||(S[0]=_=>he(P)?P.value=!1:P=!1)},null,8,["src"])]),fo,(d(!0),w(J,null,de(l(D),(_,I)=>(d(),w("div",{key:I},[o("div",go,g(_.name),1),o("div",mo,[(d(!0),w(J,null,de(_.items,(m,V)=>(d(),w("div",{key:V,style:{float:"left"},class:"mr-5"},[e(qt,{color:"secondary","hide-details":"",modelValue:m.checked,"onUpdate:modelValue":C=>m.checked=C,label:m.option.text},null,8,["modelValue","onUpdate:modelValue","label"])]))),128))]),Ao]))),128)),o("div",yo,[e(W,{class:"mt-4",color:"lightprimary",onClick:y},{default:t(()=>[v("Cancel")]),_:1}),e(W,{class:"mt-4 ml-4",color:"btnBlue",onClick:Z},{default:t(()=>[v("Next")]),_:1})])]),_:1})]),_:1})]),_:1},8,["modelValue"])],64))}}),So=De(_o,[["__scopeId","data-v-7332e4d7"]]),wo={class:"d-flex align-center py-5"},Co=["innerHTML"],Po={class:"d-flex mt-6"},bo=_e({__name:"PushDialog",setup(A,{expose:z}){let P=h(!1),K=h("");function D(){P.value=!1}function M(i){P.value=!0,K.value=i}function F(){window.open("https://apps.shopify.com/jetprint-fulfillment/reviews")}let E=h("");return E.value=window.innerWidth,window.addEventListener("resize",function(i){E.value=window.innerWidth}),z({handleClose:D,handleOpen:M}),(i,y)=>(d(),T(Ie,{modelValue:l(P),"onUpdate:modelValue":y[0]||(y[0]=H=>he(P)?P.value=H:P=H),width:l(E)>760?"600px":"375px"},{default:t(()=>[e(Se,null,{default:t(()=>[e(Ee,null,{default:t(()=>[o("h3",wo,[e(ee,{src:l(At),width:32,height:32,class:"close",onClick:D},null,8,["src"])]),o("p",{class:"mt-4",innerHTML:l(K)},null,8,Co),o("div",Po,[e(W,{class:"ml-auto",size:"large",onClick:F},{default:t(()=>[v("Write a review")]),_:1}),e(W,{class:"ml-6",size:"large",color:"primary",onClick:D},{default:t(()=>[v("OK")]),_:1})])]),_:1})]),_:1})]),_:1},8,["modelValue","width"]))}}),ko=De(bo,[["__scopeId","data-v-0c49c681"]]),ht="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAvFJREFUWEftl91t2zAUhS8F+N0jOJBo+7GeoPEErTdIJ0gyQZwJ6kwQd4JmgyYT1H20roRqg7rPtMXiCmRAS6JISTYQoBEgQLZE8tPhuT9i8MYP9sb54B2w7w79XwpOJpPrPM//IuK6r3J6/MkUHI/Hd1LKJU3MGFvGcXx/CsiTAIZh+DkIgu8mEGPsKo7jb30hewNOp9PR4XD4CQBDANgpIH09R8RNH8hegAruBwCMCCLP8wVjbMcYo//oyIQQ8yzLsq6QvQA556TcB1pcSnmfJEnhwSiKbhhjXxXURkFqdVuxdgbknBPAjVLuIU3T4lofYRiugiC4Vr/XiPilFZl6uBOgGbEAsEHEWd3inHPa6ss+kd0asBSxjR4bjUbDwWBANig82iWyWwGWI1YIMXMFQE2Ut4rsCqCqBoXxaw7arkIN2lp1+liLxhRbTZENAM+WQS/lKnQEGEXRpZEifBY+xzMzM3ceASrP/FGrUlrolBo6UFNipxOEEBembSpbzDn/rbbxGRHnHRZrPcSI9kpGqAAa+Wun3ubsKnLOpS1f1il4BQCPNEBKOU+SxGboI6XIvwDwSY17SdP0yUdK0/dUKsvjKoCmD83yZVtMpRHqZMqR71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5SSt0W15iZUfGVa0fBOI5nSik0Wb3Q1W/sE4aLSk17dO8rmjU37bUtRuZmRITeZq7OQEUE2RY8vGq02bCVbabIyHUfoG2jzQlQb+oD1LC3dHLx6oPm5q5AixaGQnSyt1TFbeFvAL1mZpxQGpdl787J2amK2z6gxfrSUclyAQX4p7hWO9q8MtgG7NNwrSFQO9o6BcTDRAQtSLelWhWNIdA42voAbD2V+CjdOaCLipa9jaOtL8BGFUUEkwMTxMte7zbTVDR1WbRG2/coijBKnZfTidrlaXU58x1tvVhs9MdSRfuOtr4Bd7K43W4fwzD0Gm29AlZUNA69+rtu46TpdNS1FIup4uvWui/lLtnurEisuWtmkdI0/TyZTKCm9+oLUJ/MP+DXBWb2ai3mW/QC6C1Tww3vgPuq+RdEjIY4eSGsdQAAAABJRU5ErkJggg==",Ye=A=>(Ve("data-v-4ebbf130"),A=A(),Te(),A),Uo=Ye(()=>o("div",null,[o("img",{src:bl,style:{width:"283px",height:"283px"},width:283,height:283})],-1)),Eo={class:"filter-column"},Do={class:"d-flex ga-4 align-center productinfo",style:{"max-width":"300px"}},xo=["onClick"],Ro=["src"],Io=["onClick"],Vo={class:"mt-2 text-h5 text-medium-emphasis"},To={key:0},Bo={key:1},Mo={key:2},Lo={class:"mt-2 text-h5 text-medium-emphasis"},Fo=["onClick"],No={class:"filter-column"},Oo={class:"d-flex align-center"},Qo={style:{width:"24px",height:"24px","margin-right":"16px","margin-left":"-40px"}},Ho={class:"d-flex align-center alert"},Wo=Ye(()=>o("span",null,"Some variants are updated,Consider updating this products.",-1)),zo=["onClick"],Ko={key:1,class:"d-inline-block position-relative",style:{top:"6px"}},qo={key:0,class:"ml-auto"},Xo={class:"d-flex ga-2 align-center productinfo"},$o=["src","onClick"],Yo=["onClick"],jo={class:"mt-2 text-h5 text-medium-emphasis",style:{width:"122px"}},Zo={key:0,class:"text-h6",style:{"line-height":"1.2"}},Go={key:1,class:"text-h6",style:{"line-height":"1.2"}},Jo={key:2,class:"text-h6",style:{"line-height":"1.2"}},ea={class:"mt-2 text-h6 text-medium-emphasis",style:{"line-height":"1.2"}},ta=["onClick"],la={class:"d-flex align-center mt-2"},oa={class:"d-flex alert-phone"},aa=Ye(()=>o("span",{style:{"line-height":"1.2"}},"Some variants are updated,Consider updating this products.",-1)),ia=["onClick"],sa={key:1},na={class:"ml-auto d-flex ga-3"},ra={class:"phone-page"},ca=_e({__name:"TableData",props:{searchValue:String,dateStart:String,dateEnd:String},emits:["onCheckList"],setup(A,{expose:z,emit:P}){const K=ze(()=>{let c=[];return f.merchantInfoMutations.currentShop.shopType==Q.GENERAL.value?c=[{text:"Product",value:"Product",width:550},{text:"Custom File",value:"customFile",width:650},{text:"Action",value:"action"}]:c=[{text:"Product",value:"Product"},{text:"Custom File",value:"customFile"},{text:"Status",value:"status"},{text:"Action",value:"action"}],console.log("进来了饿...headers"),c});setTimeout(()=>{x()},50);const D=A,M=P,F=te({productList:[]}),E=h([]);let i=h(!1),y=h({page:1,rowsPerPage:10,total:1}),H=te({title:"Archive Product",message:"Are you sure to archive the selected products? Once done the products cannot be recovered.",isShow:!1}),R=te([]),Z=h(0);const O=h("");let S=te({});const _=Ne();let I=h("");const m=te({color:"",msg:"",isShow:!1});let V=te([{label:"All Product",value:""},{label:"POD Product",value:1},{label:"DIY Product",value:2}]);te([]);let C=h(""),le=h("");const s=h(null);let u=h(!0);const f=Xt(),p=ze(()=>f.merchantInfoMutations),b=ze(()=>f.isPushProduct);Me(()=>y.value.page,c=>{k()}),Me(y,c=>{console.log("进来了饿..."),k()}),Me(()=>E.value,c=>{console.log("itemsSelected...",c),M("onCheckList",c)},{deep:!0}),Me(()=>D.searchValue,c=>{console.log("进来了饿...props.searchValue"),x()},{deep:!0});function x(){console.log("进来了饿...onInit"),y.value.page=1,k(),Y()}function k(){i.value=!0;const c={};return c.current=y.value.page,c.size=y.value.rowsPerPage,c.keyword=D.searchValue,c.status=le.value,c.dateStart=D.dateStart,c.dateEnd=D.dateEnd,c.blankProductTypeCategory=O.value,c.isHiddenInStore=I.value,_.productPage(c).then(r=>{Z.value=r.data.total,i.value=!1,r.data.records?(F.productList=r.data.records,y.value.total=r.data.total%r.data.size==0?r.data.total/r.data.size:Math.floor(r.data.total/r.data.size)+1):F.productList=[],b.value!=0&&oe(b.value)})}function Y(){return _.productCount({blankProductTypeCategory:O.value}).then(c=>{S=c.data})}function a(c){q.value.openDialog(),R=[c],H.title="Archive Product",H.message="Are you sure to archive the selected products? Once done the products cannot be recovered.",H.isShow=!0}const q=h(null);function X(){return _.productRemoveBatch({customProductIdList:R,contentType:"application/json;charset=UTF-8"}).then(c=>{q.value.closeDialog(),m.isShow=!0,m.msg="Remove Success",m.color="success",k()})}function oe(c){return u.value=!0,C.value=c,_.publish({customProductId:c}).then(async r=>{try{if(r.code!=200){f.SET_ISPUSH_PRODUCT(0),m.color="error",m.msg=r.msg,m.isShow=!0;return}await $(r.data.customProductPublishId)}finally{C.value=null}})}function $(c){return _.publishStatus({customProductPublishId:c}).then(async r=>{if(console.log("loopPushProductStatus...",r),r.code!=200){m.color="error",m.msg="push failed",m.isShow=!0,i.value=!1;return}if(r.data.status===2)u.value=!1,i.value=!1,f.SET_ISPUSH_PRODUCT(0),r.data.introduceText&&s.value.handleOpen(r.data.introduceText),x();else if(r.data.status===3){i.value=!1,m.color="error",m.msg=r.data.failReason||"push failed",m.isShow=!0;return}await ct(1e3),u.value&&await $(c)})}function we(c){console.log("进来了饿...handleProductCategory"),O.value=c.value,x()}function j(c){c===""&&(le.value=null,I.value=null),c===1&&(le.value=c,I.value=!1),c===2&&(le.value=c,I.value=!1),c===3&&(le.value=null,I.value=!0),console.log("进来了饿...handleChangeStatu"),x()}function ue(c){return i.value=!0,_.hideOnShopify({customProductId:c}).then(async r=>{r.code===200?(i.value=!1,console.log("进来了饿...hideShopify"),x()):(i.value=!1,m.color="error",m.msg=r.msg,m.isShow=!0)})}function St(c){return _.showOnShopify({customProductId:c}).then(async r=>{r.code===200?(i.value=!1,console.log("进来了饿...showShopify"),x()):(i.value=!1,m.color="error",m.msg=r.msg,m.isShow=!0)})}function je(c){c&&window.open(c)}function wt(c){return i.value=!0,C.value=c,_.publish({customProductId:c}).then(async r=>{try{if(r.code!==200){i.value=!1,m.color="error",m.msg=r.msg,m.isShow=!0;return}await ct(1e3),await $(r.data.customProductPublishId)}finally{C.value=""}})}let Ze=h(null),Ge=h(null),Je=h(null),et=h(null);function tt(c,r,G){c&&c.length>0?Ze.value.openDialog(c):r&&r.length!=0&&G&&G.length!=0?Je.value.openDialog(r,G):r&&r.length!=0&&G!=null?Ge.value.openDialog(r):r==null&&G&&G.length!=0&&et.value.openDialog(G)}let lt=h(null);function ot(c){console.log("props...",c),lt.value.openDialog(c)}let at=h(null);function it(c,r,G){at.value.openDialog(c,r,G)}function Be(c,r){Ke.push({path:"/productSync",query:{customProductId:c,blankProductId:r}})}function st(c,r){Ke.push({path:"/createOrder",query:{id:c,mainImageUrl:r}})}let ge=h(!1),me=h(!1);function Ct(c,r){console.log("handleCheck...",c,r),c==!0?E.value.push(r):E.value.forEach((G,xe)=>{G.id==r.id&&E.value.splice(xe,1)}),E.value.length==y.value.rowsPerPage?(ge.value=!0,me.value=!1):E.value.length>0?(ge.value=!1,me.value=!0):(ge.value=!1,me.value=!1),console.log("itemsSelected...",E)}function Pt(){!ge.value&&me.value==!0||ge.value==!1&&me.value==!1?(F.productList.forEach((c,r)=>{let G=0;E.value.forEach((xe,nt)=>{xe.id==c.id&&G++}),G==0&&E.value.push(c)}),console.log("test...",E.value),ge.value=!0,me.value=!1):(E.value=[],ge.value=!1,me.value=!1)}function bt(c){let r=!1;for(let G of E.value)if(c.id==G.id){r=!0;break}return r}function kt(){Ke.push({path:"/products"})}$t("pushProduct",oe),Yt(()=>{k(),Y()}),z({onInit:x}),ll("refreshMyProductsList",x),jt(()=>{ol("refreshMyProductsList",x)});let Oe=h("");return Oe.value=window.innerWidth,window.addEventListener("resize",function(c){Oe.value=window.innerWidth}),(c,r)=>{const G=ce("ZoomCodeIcon"),xe=ce("DotsIcon"),nt=ce("EasyDataTable");return d(),w(J,null,[e(Fe,{modelValue:m.isShow,"onUpdate:modelValue":r[0]||(r[0]=n=>m.isShow=n),color:m.color,timeout:3e3,variant:"flat",rounded:"md",location:"top"},{default:t(()=>[v(g(m.msg),1)]),_:1},8,["modelValue","color"]),e(ko,{ref_key:"refPushDialog",ref:s},null,512),e(yt,{ref_key:"refTipDialog",ref:q,title:l(H).title,message:l(H).message,onReflash:X},null,8,["title","message"]),e(al,{ref_key:"refAddon",ref:Ze},null,512),e(il,{ref_key:"refAddonDiyImage",ref:Ge},null,512),e(sl,{ref_key:"refAddonDiyImageText",ref:Je},null,512),e(nl,{ref_key:"refAddonDiyText",ref:et},null,512),e(Vl,{ref_key:"refPreMainAllDialog",ref:lt},null,512),e(So,{ref_key:"refSkuUpdate",ref:at},null,512),l(Oe)>980?(d(),T(nt,{key:0,"items-selected":E.value,"onUpdate:itemsSelected":r[5]||(r[5]=n=>E.value=n),headers:K.value,items:F.productList,loading:l(i),"rows-per-page-message":"Products per page","server-options":l(y),"onUpdate:serverOptions":r[6]||(r[6]=n=>he(y)?y.value=n:y=n),"table-class-name":"customize-table action-position","theme-color":"rgb(var(--v-theme-secondary))","server-items-length":l(Z),border:!1},{"empty-message":t(()=>[Uo,e(W,{class:"mt-7",color:"primary",onClick:kt},{default:t(()=>[v("Create Product")]),_:1})]),"header-Product":t(n=>[o("div",Eo,[v(g(n.text)+" ",1),e(Ae,null,{activator:t(({props:U})=>[e(W,{icon:"",variant:"text"},{default:t(()=>[e(ne,{activator:"parent",location:"top"},{default:t(()=>[v("Product Filter")]),_:1}),o("img",pe({src:Le},U,{style:{width:"16px",height:"16px"}}),null,16)]),_:2},1024)]),default:t(()=>[e(ke,null,{default:t(()=>[(d(!0),w(J,null,de(l(V),(U,L)=>(d(),T(ae,{key:L,value:L,color:"secondary",onClick:Ce=>we(U)},{default:t(()=>[e(ie,null,{default:t(()=>[v(g(U.label),1)]),_:2},1024)]),_:2},1032,["value","onClick"]))),128))]),_:1})]),_:1})])]),"item-Product":t(({mainImageUrl:n,title:U,productNo:L,isBlankProductSkuUpdate:Ce,option1Name:Pe,option2Name:ye,option3Name:re,option1Num:Ut,option2Num:Et,option3Num:Dt,imageList:xt,blankProductId:Rt,id:It})=>[o("div",Do,[o("div",{class:"position-relative productimg",onClick:Vt=>ot(xt)},[e(G,{color:"#fff","stroke-width":"1.5",class:"productimg-add"}),o("img",{src:n,style:{width:"82px",height:"82px","border-radius":"12px"},alt:""},null,8,Ro)],8,xo),o("div",null,[o("h3",{class:"text-ellipsis product-title",onClick:Vt=>Be(It,Rt)},g(U),9,Io),o("p",Vo,[Pe?(d(),w("span",To,g(Pe)+" : "+g(Ut),1)):B("",!0),ye?(d(),w("span",Bo," | "+g(ye)+" : "+g(Et),1)):B("",!0),re?(d(),w("span",Mo," | "+g(re)+" : "+g(Dt),1)):B("",!0)]),o("p",Lo,"SKU : "+g(L),1)])])]),"item-customFile":t(({fittingsInfoList:n,imageBoxInfoList:U,inputBoxInfoList:L})=>[n&&n.length!=0||U&&U.length!=0||L&&L.length!=0?(d(),w("p",{key:0,class:"mt-2 text-primary font-weight-medium",style:{cursor:"pointer"},onClick:Ce=>tt(n,U,L)},"Addon",8,Fo)):B("",!0)]),"header-status":t(n=>[o("div",No,[v(g(n.text)+" ",1),p.value.currentShop.shopType===l(Q).SHOPIFY.value||p.value.currentShop.shopType===l(Q).WOOCOMMERCE.value||p.value.currentShop.shopType===l(Q).ETSY.value||p.value.currentShop.shopType===l(Q).NOT_BIND.value?(d(),T(Ae,{key:0},{activator:t(({props:U})=>[e(W,{icon:"",variant:"text"},{default:t(()=>[e(ne,{activator:"parent",location:"top"},{default:t(()=>[v("Status Filter")]),_:1}),o("img",pe({src:Le},U,{style:{width:"16px",height:"16px"}}),null,16)]),_:2},1024)]),default:t(()=>[e(ke,null,{default:t(()=>[e(ae,{color:"secondary",onClick:r[1]||(r[1]=U=>j(""))},{default:t(()=>[e(ie,null,{default:t(()=>[v("All · "+g(l(S).allCount),1)]),_:1})]),_:1}),e(ae,{color:"secondary",onClick:r[2]||(r[2]=U=>j(l(N).UNPUBLISHED.value))},{default:t(()=>[e(ie,null,{default:t(()=>[v("Unpublished · "+g(l(S).unPublishedCount),1)]),_:1})]),_:1}),e(ae,{color:"secondary",onClick:r[3]||(r[3]=U=>j(l(N).PUBLISHED.value))},{default:t(()=>[e(ie,null,{default:t(()=>[v("Published · "+g(l(S).publishedCount),1)]),_:1})]),_:1}),e(ae,{color:"secondary",onClick:r[4]||(r[4]=U=>j(l(N).HIDDENSTORE.value))},{default:t(()=>[e(ie,null,{default:t(()=>[v("Hidden in store · "+g(l(S).hiddenInStoreCount),1)]),_:1})]),_:1})]),_:1})]),_:1})):B("",!0)])]),"item-status":t(({isHiddenInStore:n,status:U,isBlankProductSkuUpdate:L,blankProductId:Ce,id:Pe})=>[o("div",Oo,[o("div",Qo,[L?(d(),T(Ae,{key:0,location:"top center"},{activator:t(({props:ye})=>[o("img",pe({src:ut},ye,{style:{width:"24px",height:"24px","margin-right":"16px"},alt:""}),null,16)]),default:t(()=>[o("div",Ho,[o("img",pe({src:pt},D,{style:{width:"24px",height:"24px","margin-right":"14px"},alt:""}),null,16),Wo,o("a",{onClick:ye=>it(Ce,U,Pe)},"See variants",8,zo)])]),_:2},1024)):B("",!0)]),n?(d(),T(be,{key:0,class:"text-secondary"},{default:t(()=>[v("Hidden in store")]),_:1})):U===l(N).PUBLISHED.value?(d(),T(be,{key:1,class:"text-success"},{default:t(()=>[v("Published")]),_:1})):U===l(N).UNPUBLISHED.value?(d(),T(be,{key:2,class:"text-info"},{default:t(()=>[v("Unpublish")]),_:1})):B("",!0)])]),"item-action":t(({status:n,id:U,isHiddenInStore:L,productStoreUrl:Ce,blankProductId:Pe,mainImageUrl:ye})=>[e(W,{icon:"",variant:"text",onClick:re=>Be(U,Pe)},{default:t(()=>[e(ne,{activator:"parent",location:"top"},{default:t(()=>[v("Edit Design")]),_:1}),e(ee,{src:l(ft),width:20,height:20},null,8,["src"])]),_:2},1032,["onClick"]),e(W,{icon:"",variant:"text",onClick:re=>st(U,ye)},{default:t(()=>[e(ne,{activator:"parent",location:"top"},{default:t(()=>[v("Create an Order")]),_:1}),e(ee,{src:l(ht),width:20,height:20},null,8,["src"])]),_:2},1032,["onClick"]),n===l(N).UNPUBLISHED.value&&p.value.currentShop.shopType===l(Q).SHOPIFY.value||n===l(N).UNPUBLISHED.value&&p.value.currentShop.shopType===l(Q).WOOCOMMERCE.value||n===l(N).UNPUBLISHED.value&&p.value.currentShop.shopType===l(Q).ETSY.value?(d(),T(W,{key:0,icon:"",variant:"text",loading:l(C)==U,onClick:re=>oe(U)},{default:t(()=>[e(ne,{activator:"parent",location:"top"},{default:t(()=>[v("Go to Publish")]),_:1}),e(ee,{src:l(gt),width:20,height:20},null,8,["src"])]),_:2},1032,["loading","onClick"])):(d(),w("div",Ko,[e(ne,{activator:"parent",location:"top"},{default:t(()=>[v("Go to Publish")]),_:1}),e(ee,{src:l(mt),width:20,height:20},null,8,["src"])])),e(W,{icon:"",variant:"text",onClick:re=>a(U)},{default:t(()=>[e(ne,{activator:"parent",location:"top"},{default:t(()=>[v("Archive")]),_:1}),e(ee,{src:l(vt),width:20,height:20},null,8,["src"])]),_:2},1032,["onClick"]),n===l(N).PUBLISHED.value?(d(),T(Ae,{key:2},{activator:t(({props:re})=>[e(W,pe({size:"x-small"},re,{variant:"text"}),{default:t(()=>[e(ne,{activator:"parent",location:"top"},{default:t(()=>[v("Action")]),_:1}),e(xe,{width:"20","stroke-width":"1.5"})]),_:2},1040)]),default:t(()=>[e(ke,null,{default:t(()=>[n===l(N).PUBLISHED.value&&!L?(d(),T(ae,{key:0,link:"",color:"secondary",onClick:re=>ue(U)},{default:t(()=>[e(ie,null,{default:t(()=>[v("Hide on "+g(c.$filters.dictFilter(p.value.currentShop.shopType,l(Q))),1)]),_:1})]),_:2},1032,["onClick"])):B("",!0),n===l(N).PUBLISHED.value&&L?(d(),T(ae,{key:1,link:"",color:"secondary",onClick:re=>St(U)},{default:t(()=>[e(ie,null,{default:t(()=>[v("Show on "+g(c.$filters.dictFilter(p.value.currentShop.shopType,l(Q))),1)]),_:1})]),_:2},1032,["onClick"])):B("",!0),n===l(N).PUBLISHED.value&&(p.value.currentShop.shopType===l(Q).SHOPIFY.value||p.value.currentShop.shopType===l(Q).WOOCOMMERCE.value||p.value.currentShop.shopType===l(Q).ETSY.value)?(d(),T(ae,{key:2,link:"",color:"secondary",onClick:re=>je(Ce)},{default:t(()=>[e(ie,{onClick:je},{default:t(()=>[v("See in store")]),_:1})]),_:2},1032,["onClick"])):B("",!0),n===l(N).UNPUBLISHED.value&&p.value.currentShop.shopType===l(Q).SHOPIFY.value||n===l(N).UNPUBLISHED.value&&p.value.currentShop.shopType===l(Q).WOOCOMMERCE.value||n===l(N).UNPUBLISHED.value&&p.value.currentShop.shopType===l(Q).ETSY.value?(d(),T(ae,{key:3,link:"",color:"secondary",onClick:re=>wt(U),disabled:l(C)===U},{default:t(()=>[e(ie,null,{default:t(()=>[v("Archive")]),_:1})]),_:2},1032,["onClick","disabled"])):B("",!0)]),_:2},1024)]),_:2},1024)):B("",!0)]),_:1},8,["items-selected","headers","items","loading","server-options","server-items-length"])):(d(),T(Se,{key:1,variant:"outlined",style:{padding:"0 0px"}},{default:t(()=>[e(Gt,{class:"py-3",style:{padding:"0 10px"}},{default:t(()=>[e(Zt,{class:"text-h5 d-flex align-center",style:{"font-size":"12px"}},{default:t(()=>[e(dt,{"model-value":l(ge),indeterminate:l(me),color:"secondary","hide-details":"",onClick:Pt},null,8,["model-value","indeterminate"]),v(" Product "),e(Ae,null,{activator:t(({props:n})=>[e(W,{icon:"",variant:"text"},{default:t(()=>[e(ne,{activator:"parent",location:"top"},{default:t(()=>[v("Product")]),_:1}),o("img",pe({src:Le},n,{style:{width:"16px",height:"16px"}}),null,16)]),_:2},1024)]),default:t(()=>[e(ke,null,{default:t(()=>[(d(!0),w(J,null,de(l(V),(n,U)=>(d(),T(ae,{key:U,value:U,color:"secondary",onClick:L=>we(n)},{default:t(()=>[e(ie,null,{default:t(()=>[v(g(n.label),1)]),_:2},1024)]),_:2},1032,["value","onClick"]))),128))]),_:1})]),_:1}),p.value.currentShop.shopType===l(Q).SHOPIFY.value||p.value.currentShop.shopType===l(Q).WOOCOMMERCE.value||p.value.currentShop.shopType===l(Q).ETSY.value||p.value.currentShop.shopType===l(Q).NOT_BIND.value?(d(),w("div",qo,[v(" Status "),e(Ae,null,{activator:t(({props:n})=>[e(W,{icon:"",variant:"text"},{default:t(()=>[e(ne,{activator:"parent",location:"top"},{default:t(()=>[v("Status Filter")]),_:1}),o("img",pe({src:Le},n,{style:{width:"16px",height:"16px"}}),null,16)]),_:2},1024)]),default:t(()=>[e(ke,null,{default:t(()=>[e(ae,{color:"secondary",onClick:r[7]||(r[7]=n=>j(""))},{default:t(()=>[e(ie,null,{default:t(()=>[v("All · "+g(l(S).allCount),1)]),_:1})]),_:1}),e(ae,{color:"secondary",onClick:r[8]||(r[8]=n=>j(l(N).UNPUBLISHED.value))},{default:t(()=>[e(ie,null,{default:t(()=>[v("Unpublished · "+g(l(S).unPublishedCount),1)]),_:1})]),_:1}),e(ae,{color:"secondary",onClick:r[9]||(r[9]=n=>j(l(N).PUBLISHED.value))},{default:t(()=>[e(ie,null,{default:t(()=>[v("Published · "+g(l(S).publishedCount),1)]),_:1})]),_:1}),e(ae,{color:"secondary",onClick:r[10]||(r[10]=n=>j(l(N).HIDDENSTORE.value))},{default:t(()=>[e(ie,null,{default:t(()=>[v("Hidden in store · "+g(l(S).hiddenInStoreCount),1)]),_:1})]),_:1})]),_:1})]),_:1})])):B("",!0)]),_:1}),e(Ee,{style:{padding:"10px 0"}},{default:t(()=>[(d(!0),w(J,null,de(F.productList,(n,U)=>(d(),w(J,{key:U},[o("div",Xo,[o("div",null,[e(dt,{"model-value":bt(n),color:"secondary","hide-details":"","onUpdate:modelValue":L=>Ct(L,n)},null,8,["model-value","onUpdate:modelValue"])]),o("img",{src:n.mainImageUrl,style:{width:"82px",height:"82px","border-radius":"12px"},alt:"",onClick:L=>ot(n.imageList)},null,8,$o),o("div",null,[o("h3",{class:"text-ellipsis2 product-title",onClick:L=>Be(n.id,n.blankProductId)},g(n.title),9,Yo),o("p",jo,[n.option1Name?(d(),w("span",Zo,g(n.option1Name)+" : "+g(n.option1Num),1)):B("",!0),n.option2Name?(d(),w("span",Go," | "+g(n.option2Name)+" : "+g(n.option2Num),1)):B("",!0),n.option3Name?(d(),w("span",Jo," | "+g(n.option3Name)+" : "+g(n.option3Num),1)):B("",!0)]),o("p",ea,"SKU : "+g(n.productNo),1)])]),n.fittingsInfoList&&n.fittingsInfoList.length!=0||n.imageBoxInfoList&&n.imageBoxInfoList.length!=0||n.inputBoxInfoList&&n.inputBoxInfoList.length!=0?(d(),w("p",{key:0,class:"mt-2 text-primary font-weight-medium",onClick:L=>tt(n.fittingsInfoList,n.imageBoxInfoList,n.inputBoxInfoList)},"Addon",8,ta)):B("",!0),o("div",la,[n.isBlankProductSkuUpdate?(d(),T(Ae,{key:0,location:"top center"},{activator:t(({props:L})=>[o("img",pe({src:ut,ref_for:!0},L,{style:{width:"24px",height:"24px","margin-right":"16px"},alt:""}),null,16)]),default:t(()=>[o("div",oa,[o("img",pe({src:pt,ref_for:!0},D,{style:{width:"24px",height:"24px","margin-right":"14px"},alt:""}),null,16),o("div",null,[aa,o("p",{class:"text-secondary mt-4 text-decoration-underline",onClick:L=>it(n.blankProductId,n.status,n.id)},"See variants",8,ia)])])]),_:2},1024)):B("",!0),l(f).merchantInfoMutations.currentShop.shopType!=l(Q).GENERAL.value?(d(),w("div",sa,[n.isHiddenInStore?(d(),T(be,{key:0,class:"text-secondary"},{default:t(()=>[v("Hidden in store")]),_:1})):n.status===l(N).PUBLISHED.value?(d(),T(be,{key:1,class:"text-success"},{default:t(()=>[v("Published")]),_:1})):n.status===l(N).UNPUBLISHED.value?(d(),T(be,{key:2,class:"text-info"},{default:t(()=>[v("Unpublish")]),_:1})):B("",!0)])):B("",!0),o("div",na,[e(ee,{src:l(ft),width:20,height:20,onClick:L=>Be(n.id,n.blankProductId)},null,8,["src","onClick"]),e(ee,{src:l(ht),width:20,height:20,onClick:L=>st(n.id,n.mainImageUrl)},null,8,["src","onClick"]),n.status===l(N).UNPUBLISHED.value&&p.value.currentShop.shopType===l(Q).SHOPIFY.value||n.status===l(N).UNPUBLISHED.value&&p.value.currentShop.shopType===l(Q).WOOCOMMERCE.value||n.status===l(N).UNPUBLISHED.value&&p.value.currentShop.shopType===l(Q).ETSY.value?(d(),T(ee,{key:0,src:l(gt),loading:l(C)==n.id,width:20,height:20,onClick:L=>oe(n.id)},null,8,["src","loading","onClick"])):(d(),T(ee,{key:1,src:l(mt),width:20,height:20},null,8,["src"])),e(ee,{src:l(vt),width:20,height:20,onClick:L=>a(n.id)},null,8,["src","onClick"])])]),e(Ue,{class:"my-4"})],64))),128))]),_:1})]),_:1}),o("div",ra,[e(Jt,{"active-color":"primary",modelValue:l(y).page,"onUpdate:modelValue":r[11]||(r[11]=n=>l(y).page=n),length:l(y).total,"total-visible":2},null,8,["modelValue","length"])])]),_:1}))],64)}}}),da=De(ca,[["__scopeId","data-v-4ebbf130"]]),ua={class:"d-flex ga-2 justify-end"},Pa=_e({__name:"MyProduct",setup(A){const z=Ne(),P=h(""),K=h([]),D=te([{title:"My Products",disabled:!0}]);let M=te([{label:"Last 7 Days",value:7},{label:"Last 14 Days",value:14},{label:"Last Month",value:365},{label:"Custom Date",value:1}]);const F=te({color:"",msg:"",isShow:!1}),E=h(null),i=h(""),y=h(""),H=h(null);function R(s){if(s.value===1){H.value.openDialog();return}let u=Z(s.value);console.log("handleFilter...",u),i.value=u.start,y.value=u.end,setTimeout(()=>{E.value.onInit()},100)}function Z(s){const u=new Date,f=u.getFullYear().toString()+"-"+(u.getMonth()+1).toString().padStart(2,"0")+"-"+u.getDate().toString().padStart(2,"0");return u.setDate(u.getDate()-(s-1)),{start:u.getFullYear().toString()+"-"+(u.getMonth()+1).toString().padStart(2,"0")+"-"+u.getDate().toString().padStart(2,"0"),end:f}}function O(s){console.log("onCheckList...",s),K.value=s}let S=te({title:"Archive Product",message:"Are you sure to archive the selected products? Once done the products cannot be recovered.",isShow:!1});const _=h(null);function I(){_.value.openDialog(),S.title="Archive Products",S.message="Are you sure to archive the selected products? Once done the products cannot be recovered.",S.isShow=!0}function m(){let s=[];return K.value.forEach(u=>{s.push(u.id)}),z.productRemoveBatch({customProductIdList:s,contentType:"application/json;charset=UTF-8"}).then(u=>{K.value=[],_.value.closeDialog(),F.isShow=!0,F.msg="Remove Success",F.color="success",E.value.onInit()})}let V=h(null);function C(){let s=[];K.value.forEach(u=>{s.push(u.id)}),V.value&&V.value.openDialog(s)}function le(s){let u=Date.parse(s[0]),f=Date.parse(s[1]);Number(u)<Number(f)?(i.value=s[0],y.value=s[1]):(i.value=s[1],y.value=s[0]),setTimeout(()=>{E.value.onInit()},100)}return(s,u)=>{const f=ce("CopyIcon"),p=ce("TrashIcon"),b=ce("FilterIcon");return d(),w(J,null,[e(Fe,{modelValue:F.isShow,"onUpdate:modelValue":u[0]||(u[0]=x=>F.isShow=x),color:F.color,timeout:3e3,variant:"flat",rounded:"md",location:"top"},{default:t(()=>[v(g(F.msg),1)]),_:1},8,["modelValue","color"]),e(Tt,{title:"My Products",breadcrumbs:D},null,8,["breadcrumbs"]),e(yt,{ref_key:"refTipDialog",ref:_,title:l(S).title,message:l(S).message,onReflash:m},null,8,["title","message"]),e(Pl,{ref_key:"refCopyProduct",ref:V},null,512),e(Se,{variant:"flat",class:"px-4 py-3"},{default:t(()=>[e(qe,{justify:"space-between",class:"align-center mb-3"},{default:t(()=>[e(Re,{cols:"12",md:"3"},{default:t(()=>[e(el,{type:"text",variant:"outlined","persistent-placeholder":"",placeholder:"Search Product",modelValue:P.value,"onUpdate:modelValue":u[1]||(u[1]=x=>P.value=x),density:"compact","hide-details":"","prepend-inner-icon":"mdi-magnify"},null,8,["modelValue"])]),_:1}),e(Re,{cols:"12",md:"3"},{default:t(()=>[o("div",ua,[o("div",null,[e(ne,{activator:"parent",location:"top"},{default:t(()=>[v("Copy Product")]),_:1}),e(W,{icon:"",variant:"text",disabled:K.value.length==0,onClick:C},{default:t(()=>[e(f,{size:"20","stroke-width":"1.5"})]),_:1},8,["disabled"])]),o("div",null,[e(ne,{activator:"parent",location:"top"},{default:t(()=>[v("Archive Product")]),_:1}),e(W,{icon:"",variant:"text",disabled:K.value.length==0,onClick:I},{default:t(()=>[e(p,{size:"20","stroke-width":"1.5"})]),_:1},8,["disabled"])]),e(Ae,null,{activator:t(({props:x})=>[e(W,pe({icon:"",variant:"text"},x),{default:t(()=>[e(ne,{activator:"parent",location:"top"},{default:t(()=>[v("Time Filter")]),_:1}),e(b,{size:"20","stroke-width":"1.5"})]),_:2},1040)]),default:t(()=>[e(ke,null,{default:t(()=>[(d(!0),w(J,null,de(l(M),(x,k)=>(d(),T(ae,{key:k,value:k,color:"secondary",onClick:Y=>R(x)},{default:t(()=>[e(ie,null,{default:t(()=>[v(g(x.label),1)]),_:2},1024)]),_:2},1032,["value","onClick"]))),128))]),_:1})]),_:1})])]),_:1})]),_:1}),e(da,{ref_key:"refTableData",ref:E,searchValue:P.value,dateStart:i.value,dateEnd:y.value,onOnCheckList:O},null,8,["searchValue","dateStart","dateEnd"]),e(tl,{ref_key:"refCustomDate",ref:H,onOnDate:le},null,512)]),_:1})],64)}}});export{Pa as default};