marketplacepos 5.30.2 → 5.30.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-VRAUYPKY.js → chunk-43HDURFR.js} +1 -1
- package/Marketplace/{chunk-TFGY2CZB.js → chunk-5NSNAB2H.js} +1 -1
- package/Marketplace/{chunk-YVBVZE4E.js → chunk-6642FRHA.js} +1 -1
- package/Marketplace/{chunk-V7DEJOKT.js → chunk-AMYLQSFM.js} +1 -1
- package/Marketplace/{chunk-VAMLKDPP.js → chunk-AWGGAU6G.js} +1 -1
- package/Marketplace/{chunk-7UOJBC4V.js → chunk-AWPYM6B2.js} +1 -1
- package/Marketplace/{chunk-4BUKVDBU.js → chunk-AZJRJRKN.js} +1 -1
- package/Marketplace/chunk-BQMJFUGL.js +1 -0
- package/Marketplace/{chunk-DXYJV443.js → chunk-DIKRHG2S.js} +1 -1
- package/Marketplace/{chunk-FOM2CM2O.js → chunk-EKUGHLK5.js} +1 -1
- package/Marketplace/{chunk-VEZAEJT2.js → chunk-ETA5WDXY.js} +2 -2
- package/Marketplace/{chunk-NLVUCMGP.js → chunk-GCCXYIJA.js} +1 -1
- package/Marketplace/{chunk-DUUSY6VM.js → chunk-GNBPWQY5.js} +1 -1
- package/Marketplace/{chunk-GJ74CI7M.js → chunk-JFOFOC7U.js} +1 -1
- package/Marketplace/{chunk-HUXTG7WF.js → chunk-JMAX5FZR.js} +1 -1
- package/Marketplace/{chunk-2H6ZWOFG.js → chunk-LPELHUZK.js} +1 -1
- package/Marketplace/{chunk-CIRDMGSF.js → chunk-LSFLIL4G.js} +1 -1
- package/Marketplace/{chunk-2RI4B7LO.js → chunk-M6BWEQPC.js} +1 -1
- package/Marketplace/{chunk-UUFP2LR3.js → chunk-NL2XZNGM.js} +1 -1
- package/Marketplace/{chunk-IDQSVSAG.js → chunk-NTF5NCAI.js} +1 -1
- package/Marketplace/{chunk-GBMUF46A.js → chunk-O4TZVGTI.js} +1 -1
- package/Marketplace/{chunk-4JOPLIQJ.js → chunk-OZ6ERKT4.js} +1 -1
- package/Marketplace/{chunk-WHPQD3IT.js → chunk-P3R4ASN3.js} +1 -1
- package/Marketplace/{chunk-2BQOICNG.js → chunk-P5X77GYL.js} +1 -1
- package/Marketplace/{chunk-N32A3EYJ.js → chunk-P64M4BHW.js} +1 -1
- package/Marketplace/{chunk-POBTFM62.js → chunk-Q6HYCWRO.js} +1 -1
- package/Marketplace/{chunk-UWMOSIYY.js → chunk-QN457FLG.js} +1 -1
- package/Marketplace/{chunk-HOQSPMPT.js → chunk-SDM2TXHH.js} +1 -1
- package/Marketplace/chunk-SYW22LZY.js +2 -0
- package/Marketplace/{chunk-MYO55CG2.js → chunk-UTTQ4WRB.js} +1 -1
- package/Marketplace/{chunk-6CB4LR3W.js → chunk-V6EKAE43.js} +1 -1
- package/Marketplace/{chunk-U4LZH7TG.js → chunk-VLHQSOLI.js} +1 -1
- package/Marketplace/{chunk-R6KGFJJ4.js → chunk-YMUN44Z7.js} +1 -1
- package/Marketplace/chunk-YYWSBXIP.js +1 -0
- package/Marketplace/{chunk-L5FWRRHO.js → chunk-ZMWEYDSK.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-LTGHVS57.js → main-6UTPCCYC.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-6YZFSP2B.js +0 -1
- package/Marketplace/chunk-I2TLXLNK.js +0 -1
- package/Marketplace/chunk-J35KGN2V.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as N}from"./chunk-2RI4B7LO.js";import{a as M}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as U}from"./chunk-DLNXH2FE.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Ee,b as Me}from"./chunk-DDHEMRO7.js";import{a as De}from"./chunk-N6IHFFFZ.js";import{a as Ve,b as Te}from"./chunk-PD4CUVAW.js";import"./chunk-GCKSYCMI.js";import{a as be}from"./chunk-N32A3EYJ.js";import"./chunk-ADRVUMMW.js";import{a as Fe}from"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{a as fe,b as xe,d as Se,e as Pe}from"./chunk-CCXKODFV.js";import{j as ue}from"./chunk-VAMLKDPP.js";import{b as de,e as ge}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{d as Ie,l as we,m as ye,n as ve}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{b as oe,c as re,h as le,m as ce,o as se,y as pe}from"./chunk-BSN7ZAXG.js";import{c as me,e as he,f as Ce}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as u,Bd as E,Cd as ie,Da as _,Ea as m,Eb as h,G as A,Gb as p,Gc as v,Hc as T,Ic as X,Id as ae,Jc as Y,Nb as S,Ob as k,Qb as L,Rb as R,Sb as o,Tb as c,Ub as P,Vb as q,Wb as K,Yb as x,Z as $,bc as r,ea as j,ec as H,gb as D,jb as l,kb as f,mc as J,nc as d,oc as B,pa as z,pc as F,rc as I,sc as w,sd as ee,ta as G,tc as y,uc as Z,vc as Q,vd as te,xc as V,yd as ne}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Ue=i=>({"text-decoration-line-through":i}),Oe=i=>({"bg-gradient-warning":i}),We=i=>({"ms-10":i});function Ae(i,s){if(i&1&&(o(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),p("src",t==null?null:t.Img,D),l(),F(" ",t.Name," ")}}function $e(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){_(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),P(1,"i",17),d(2," Update "),c()}}function je(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,$e,3,0,"button",13),o(3,"button",14),u("click",function(){_(t);let n=r(2);return m(n.openExportDialog())}),P(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),p("ngIf",e.productService.hasSelectionVariant(t))}}function ze(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){_(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function Ge(i,s){if(i&1){let t=x();o(0,"input",51),y("ngModelChange",function(n){_(t);let a=r(4).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){_(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function qe(i,s){if(i&1&&h(0,Ge,1,1,"ng-template",26),i&2){let t=r(6);p("ngxPermissionsOnly",V(1,O,t.rolePriceEdit))}}function Ke(i,s){if(i&1){let t=x();q(0),o(1,"img",52),u("click",function(n){_(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),K()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,D)}}function He(i,s){i&1&&P(0,"img",53)}function Je(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),F("(",t.Category,")")}}function Ze(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,qe,1,3,null,26),o(3,"div",46),h(4,Ke,2,1,"ng-container",47)(5,He,1,0,"ng-template",null,0,Y),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,Je,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;p("rowSpan",e.Variants.length),l(2),S((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),p("ngClass",V(8,We,(e.Variants==null?null:e.Variants.length)<=1)),l(),p("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),p("rowSpan",e.Variants.length),l(2),B(e.Name),l(),S(e.Category?10:-1)}}function Qe(i,s){if(i&1){let t=x();o(0,"input",56),y("ngModelChange",function(n){_(t);let a=r(2).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Xe(i,s){if(i&1&&(o(0,"td",54),h(1,Qe,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),S(t.UnitPrice>=0?1:-1)}}function Ye(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function et(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.UnitPrice)," ")}}function tt(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),p("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),D)}}function nt(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){_(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function it(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,Ze,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Xe,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Ye,2,0,"div",36)(11,et,3,3,"div")(12,tt,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,nt,3,3,"div",39),o(16,"div",37)(17,"a",40),P(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=_(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),P(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),S(e==0?1:-1),l(2),B(t.Model),l(2),p("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",V(12,Ue,t.Discontinued)),l(),F(" ",t.Code," "),l(),p("ngxPermissionsOnly",V(14,O,n.rolePriceEdit)),l(3),S((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),p("ngClass",V(16,Oe,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),S(t.Channel.length>0?15:-1),l(2),p("href",t.Channel[0]==null?null:t.Channel[0].Url,D)}}function at(i,s){if(i&1&&L(0,it,22,18,"tr",33,k),i&2){let t=s.$implicit;R(t.Variants)}}function ot(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(n){_(t);let a=r(2);return w(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){_(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,ze,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){_(t);let n=r(2);return m(n.openModalFilter())}),P(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),L(26,at,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){_(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",V(16,O,e.rolePriceEdit)),l(4),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),l(2),F(" ",X(24,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),l(3),R(t),l(2),p("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",T(29,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function rt(i,s){if(i&1){let t=x();o(0,"mainpanel",2),y("textChange",function(n){_(t);let a=r();return w(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){_(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Ae,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,je,7,1,"actions",9),v(16,"async"),h(17,ot,30,18,"content",9),v(18,"async"),c()}if(i&2){let t=r();p("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),p("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),p("ngIf",T(16,9,t.data$)),l(2),p("ngIf",T(18,11,t.data$))}}var zt=(()=>{let s=class s{constructor(e,n,a,g,C,b,W,Le,Re,Be){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=b,this.authService=W,this.mainPanelService=Le,this.exportService=Re,this.decimalPipe=Be,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=_e.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Ne,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(b=>me.IsNotEmpty(b))).subscribe(b=>{this.updateItemAfterDialog(b,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions),b=a.Price?this.decimalPipe.transform(a.Price):a.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${b}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(n){return new(n||s)(f(ge),f(de),f(Ie),f(be),f(Fe),f(N),f(ue),f(we),f(Ee),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Z([U,N,ae("https://res.cloudinary.com/"),E]),Q],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,rt,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",T(1,1,a.loader$))},dependencies:[ie,ee,te,ne,E,ve,ye,Pe,Se,fe,xe,pe,re,se,oe,le,ce,De,ke,Ce,he,Te,Ve],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let i=s;return i})();export{zt as PriceSingleChannelComponent};
|
|
1
|
+
import{a as N}from"./chunk-M6BWEQPC.js";import{a as M}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as U}from"./chunk-DLNXH2FE.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Ee,b as Me}from"./chunk-DDHEMRO7.js";import{a as De}from"./chunk-N6IHFFFZ.js";import{a as Ve,b as Te}from"./chunk-PD4CUVAW.js";import"./chunk-GCKSYCMI.js";import{a as be}from"./chunk-P64M4BHW.js";import"./chunk-ADRVUMMW.js";import{a as Fe}from"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{a as fe,b as xe,d as Se,e as Pe}from"./chunk-CCXKODFV.js";import{j as ue}from"./chunk-AWGGAU6G.js";import{b as de,e as ge}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{d as Ie,l as we,m as ye,n as ve}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{b as oe,c as re,h as le,m as ce,o as se,y as pe}from"./chunk-BSN7ZAXG.js";import{c as me,e as he,f as Ce}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as u,Bd as E,Cd as ie,Da as _,Ea as m,Eb as h,G as A,Gb as p,Gc as v,Hc as T,Ic as X,Id as ae,Jc as Y,Nb as S,Ob as k,Qb as L,Rb as R,Sb as o,Tb as c,Ub as P,Vb as q,Wb as K,Yb as x,Z as $,bc as r,ea as j,ec as H,gb as D,jb as l,kb as f,mc as J,nc as d,oc as B,pa as z,pc as F,rc as I,sc as w,sd as ee,ta as G,tc as y,uc as Z,vc as Q,vd as te,xc as V,yd as ne}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Ue=i=>({"text-decoration-line-through":i}),Oe=i=>({"bg-gradient-warning":i}),We=i=>({"ms-10":i});function Ae(i,s){if(i&1&&(o(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),p("src",t==null?null:t.Img,D),l(),F(" ",t.Name," ")}}function $e(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){_(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),P(1,"i",17),d(2," Update "),c()}}function je(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,$e,3,0,"button",13),o(3,"button",14),u("click",function(){_(t);let n=r(2);return m(n.openExportDialog())}),P(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),p("ngIf",e.productService.hasSelectionVariant(t))}}function ze(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){_(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function Ge(i,s){if(i&1){let t=x();o(0,"input",51),y("ngModelChange",function(n){_(t);let a=r(4).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){_(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function qe(i,s){if(i&1&&h(0,Ge,1,1,"ng-template",26),i&2){let t=r(6);p("ngxPermissionsOnly",V(1,O,t.rolePriceEdit))}}function Ke(i,s){if(i&1){let t=x();q(0),o(1,"img",52),u("click",function(n){_(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),K()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,D)}}function He(i,s){i&1&&P(0,"img",53)}function Je(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),F("(",t.Category,")")}}function Ze(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,qe,1,3,null,26),o(3,"div",46),h(4,Ke,2,1,"ng-container",47)(5,He,1,0,"ng-template",null,0,Y),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,Je,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;p("rowSpan",e.Variants.length),l(2),S((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),p("ngClass",V(8,We,(e.Variants==null?null:e.Variants.length)<=1)),l(),p("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),p("rowSpan",e.Variants.length),l(2),B(e.Name),l(),S(e.Category?10:-1)}}function Qe(i,s){if(i&1){let t=x();o(0,"input",56),y("ngModelChange",function(n){_(t);let a=r(2).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Xe(i,s){if(i&1&&(o(0,"td",54),h(1,Qe,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),S(t.UnitPrice>=0?1:-1)}}function Ye(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function et(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.UnitPrice)," ")}}function tt(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),p("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),D)}}function nt(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){_(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function it(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,Ze,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Xe,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Ye,2,0,"div",36)(11,et,3,3,"div")(12,tt,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,nt,3,3,"div",39),o(16,"div",37)(17,"a",40),P(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=_(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),P(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),S(e==0?1:-1),l(2),B(t.Model),l(2),p("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",V(12,Ue,t.Discontinued)),l(),F(" ",t.Code," "),l(),p("ngxPermissionsOnly",V(14,O,n.rolePriceEdit)),l(3),S((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),p("ngClass",V(16,Oe,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),S(t.Channel.length>0?15:-1),l(2),p("href",t.Channel[0]==null?null:t.Channel[0].Url,D)}}function at(i,s){if(i&1&&L(0,it,22,18,"tr",33,k),i&2){let t=s.$implicit;R(t.Variants)}}function ot(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(n){_(t);let a=r(2);return w(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){_(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,ze,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){_(t);let n=r(2);return m(n.openModalFilter())}),P(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),L(26,at,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){_(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",V(16,O,e.rolePriceEdit)),l(4),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),l(2),F(" ",X(24,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),l(3),R(t),l(2),p("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",T(29,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function rt(i,s){if(i&1){let t=x();o(0,"mainpanel",2),y("textChange",function(n){_(t);let a=r();return w(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){_(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Ae,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,je,7,1,"actions",9),v(16,"async"),h(17,ot,30,18,"content",9),v(18,"async"),c()}if(i&2){let t=r();p("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),p("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),p("ngIf",T(16,9,t.data$)),l(2),p("ngIf",T(18,11,t.data$))}}var zt=(()=>{let s=class s{constructor(e,n,a,g,C,b,W,Le,Re,Be){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=b,this.authService=W,this.mainPanelService=Le,this.exportService=Re,this.decimalPipe=Be,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=_e.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Ne,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(b=>me.IsNotEmpty(b))).subscribe(b=>{this.updateItemAfterDialog(b,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions),b=a.Price?this.decimalPipe.transform(a.Price):a.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${b}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(n){return new(n||s)(f(ge),f(de),f(Ie),f(be),f(Fe),f(N),f(ue),f(we),f(Ee),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Z([U,N,ae("https://res.cloudinary.com/"),E]),Q],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,rt,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",T(1,1,a.loader$))},dependencies:[ie,ee,te,ne,E,ve,ye,Pe,Se,fe,xe,pe,re,se,oe,le,ce,De,ke,Ce,he,Te,Ve],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let i=s;return i})();export{zt as PriceSingleChannelComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-TPGBOTD4.js";import{b as ie}from"./chunk-4LFFAE2I.js";import{a as ee,b as te}from"./chunk-N3TTJVBG.js";import{a as X}from"./chunk-
|
|
1
|
+
import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-TPGBOTD4.js";import{b as ie}from"./chunk-4LFFAE2I.js";import{a as ee,b as te}from"./chunk-N3TTJVBG.js";import{a as X}from"./chunk-YMUN44Z7.js";import{j as Q}from"./chunk-AWGGAU6G.js";import{e as J}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{m as Y,n as Z}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as G,h as z,m as K,y as q}from"./chunk-BSN7ZAXG.js";import"./chunk-64G3XLI6.js";import{n as W,p as j,r as $}from"./chunk-OVEJFFL6.js";import{$b as y,Cd as H,Da as g,Ea as h,Eb as c,Gb as s,Pa as M,Sb as o,Tb as r,Ub as d,Vb as f,Wb as _,Yb as S,bc as u,fb as k,ja as D,jb as p,ka as T,kb as I,mc as v,nc as m,oa as U,oc as O,pc as B,rc as L,sc as F,ta as C,tc as R,ua as N,uc as P,ud as w,vd as V,wd as A,xc as x}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var ge=e=>[e];function he(e,t){if(e&1&&(f(0),o(1,"a",9),m(2),r(),_()),e&2){let a=t.$implicit;p(),s("routerLink",x(2,ge,a.url)),p(),B(" ",a.title,"")}}var ce=(()=>{let t=class t{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=C({type:t,selectors:[["app-download"]],decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(i,l){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),d(3,"nav-tab",2),r()(),o(4,"div")(5,"div",3)(6,"a",4),d(7,"i",5),r(),o(8,"div",6)(9,"div",7),c(10,he,3,4,"ng-container",8),r()()()()(),d(11,"router-outlet")),i&2&&(p(3),s("Tabs",l.tabs),p(7),s("ngForOf",l.moreMenu))},dependencies:[w,ee,W,j]});let e=t;return e})();var E=(()=>{let t=class t{constructor(n){this.httpService=n}download(n){return this.httpService.post("/api/Product/downloadurl",n)}};t.\u0275fac=function(i){return new(i||t)(U(J))},t.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();var Ce=e=>({"background-color":e});function ye(e,t){if(e&1&&(o(0,"th"),m(1),r()),e&2){let a=t.$implicit;p(),O(a.column)}}function ve(e,t){if(e&1&&(f(0),o(1,"td"),d(2,"span",6),r(),_()),e&2){let a=t.$implicit,n=u().$implicit;p(2),s("innerHTML",n[a.prop],k)}}function xe(e,t){if(e&1&&(o(0,"tr",5),c(1,ve,3,1,"ng-container",3),r()),e&2){let a=t.$implicit,n=u();s("ngStyle",x(2,Ce,a.Status>200?"#F4D6D5":"#DEE9C9")),p(),s("ngForOf",n.configs)}}var de=(()=>{let t=class t{constructor(){this.eventClose=new M}ngOnInit(){}onClose(){this.eventClose.emit()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=C({type:t,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(i,l){i&1&&(o(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),c(4,ye,2,1,"th",3),r()(),o(5,"tbody"),c(6,xe,2,4,"tr",4),r()()()),i&2&&(p(4),s("ngForOf",l.configs),p(2),s("ngForOf",l.data))},dependencies:[w,A]});let e=t;return e})();function be(e,t){if(e&1){let a=S();f(0),o(1,"button",15),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onNewStepperState(l))}),d(2,"i",16),m(3," New "),r(),_()}}function Ee(e,t){if(e&1){let a=S();f(0),o(1,"button",15),y("click",function(){g(a),u();let i=v(11);return h(i.previous())}),m(2," Back "),r(),_()}}function Ie(e,t){if(e&1){let a=S();f(0),o(1,"button",17),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onStepperNext(l))}),m(2," Next "),r(),_()}}function De(e,t){if(e&1){let a=S();f(0),o(1,"button",18),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onSubmit(l))}),m(2,"Download"),r(),_()}if(e&2){let a=u();p(),s("disabled",!a.urls)}}function Te(e,t){e&1&&(d(0,"i",19),o(1,"span"),m(2,"Instruction"),r())}function Ue(e,t){e&1&&(o(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),m(4,"Note"),r()(),o(5,"div",24)(6,"ol",25)(7,"li"),m(8," Use this form to Download Products from Tokopedia using product URL "),r(),o(9,"li"),m(10," Copy Product URL from "),o(11,"a",26),m(12,"https://seller.tokopedia.com/ "),r(),m(13," and paste in this form "),r(),o(14,"li"),m(15," Use New Line when you want to input several product URLs "),r()()()()())}function Ne(e,t){e&1&&(d(0,"i",27),o(1,"span"),m(2,"Download"),r())}function Me(e,t){if(e&1){let a=S();o(0,"div",20)(1,"textarea",28),R("ngModelChange",function(i){g(a);let l=u();return F(l.urls,i)||(l.urls=i),h(i)}),r()()}if(e&2){let a=u();p(),s("placeholder",a.urlPlaceholder),L("ngModel",a.urls)}}function ke(e,t){e&1&&(d(0,"i",29),o(1,"span"),m(2,"Finish"),r())}function Oe(e,t){if(e&1&&(o(0,"div",20),d(1,"app-response-api-list",30),r()),e&2){let a=u();p(),s("data",a.downloadResponses)("configs",a.configs)}}function Be(e,t){e&1&&(o(0,"h6"),m(1,"1"),r())}function Le(e,t){e&1&&(o(0,"h6"),m(1,"2"),r())}function Fe(e,t){e&1&&(o(0,"h6"),m(1,"3"),r())}var ue=(()=>{let t=class t{constructor(n,i){this.downloadService=n,this.authService=i,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
|
|
2
2
|
https://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat`,this.currentDomain=this.authService.getDomain()}onStepperChange(n){this.stepperState=n.selectedStep.state}onSubmit(n){let i=this.urls.split(/\r?\n/);this.downloadService.download(i).subscribe(l=>{this.downloadResponses=l,this.mappingLinkToProduct(),this.onStepperNext(n)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(n=>(n.Name=n?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${n.ID}" target="_blank">
|
|
3
3
|
${n?.Name}
|
|
4
4
|
</a>`:"-",n))}onNewStepperState(n){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",n.reset(),this.onStepperNext(n)}onStepperNext(n){n.selected.completed=!0,n.next()}};t.\u0275fac=function(i){return new(i||t)(I(E),I(Q))},t.\u0275cmp=C({type:t,selectors:[["app-by-url"]],features:[P([{provide:ne,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:11,consts:[["stepper",""],["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["linear","",1,"stepper-downloadByUrl",3,"selectionChange","selectedIndex"],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","DOWNLOAD",3,"editable","completed"],["state","FINISH"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"click","disabled"],[1,"fa-solid","fa-info","me-3"],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],[1,"fa-solid","fa-download","me-3"],["name","url","cols","30","rows","25",1,"form-control",3,"ngModelChange","placeholder","ngModel"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],["status","error",3,"data","configs"]],template:function(i,l){if(i&1){let fe=S();o(0,"mainpanel",1)(1,"actions"),c(2,be,4,0,"ng-container",2)(3,Ee,3,0,"ng-container",2)(4,Ie,3,0,"ng-container",2)(5,De,3,1,"ng-container",2),r(),o(6,"content")(7,"div",3)(8,"div",4)(9,"div",5)(10,"mat-stepper",6,0),y("selectionChange",function(_e){return g(fe),h(l.onStepperChange(_e))}),o(12,"mat-step",7),c(13,Te,3,0,"ng-template",8)(14,Ue,16,0,"ng-template",9),r(),o(15,"mat-step",10),c(16,Ne,3,0,"ng-template",8)(17,Me,2,2,"ng-template",9),r(),o(18,"mat-step",11),c(19,ke,3,0,"ng-template",8)(20,Oe,2,2,"ng-template",9),r(),c(21,Be,2,0,"ng-template",12)(22,Le,2,0,"ng-template",13)(23,Fe,2,0,"ng-template",14),r()()()()()()}i&2&&(s("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),s("ngIf",l.stepperState=="FINISH"),p(),s("ngIf",l.stepperState=="DOWNLOAD"),p(),s("ngIf",l.stepperState=="GUIDE"),p(),s("ngIf",l.stepperState=="DOWNLOAD"),p(5),s("selectedIndex",1),p(2),s("editable",l.stepperState!="FINISH")("completed",!0),p(3),s("editable",l.stepperState!="FINISH")("completed",!1))},dependencies:[V,G,z,K,Y,le,oe,pe,re,ae,de],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ct}from"./chunk-HOQSPMPT.js";import{a as Ct}from"./chunk-BQ7NR3ET.js";import{a as ht,b as ft}from"./chunk-UMNGKENU.js";import{f as gt}from"./chunk-HCDKYABV.js";import{b as D,c as E,i as k,j as w}from"./chunk-BO4PPSB5.js";import{t as P}from"./chunk-HUUFOAKH.js";import{X as mt}from"./chunk-E5GGIVK7.js";import{h as st,m as pt}from"./chunk-BSN7ZAXG.js";import{b as m,c as f}from"./chunk-64G3XLI6.js";import{o as dt}from"./chunk-OVEJFFL6.js";import{$b as v,Bd as rt,Da as L,Ea as F,Eb as C,Fb as z,Gb as p,Gc as x,Hc as O,Jc as ot,Nb as G,Ob as et,Qb as nt,Rb as it,Sb as a,Tb as r,Ub as y,Vb as H,Wb as J,Yb as R,Z as X,bc as h,gb as I,jb as l,kb as g,mc as at,nc as s,oc as u,pa as Z,pc as S,rc as V,sc as U,sd as B,ta as T,tc as A,ud as K,v as Q,vd as $,xb as tt,xc as W,yd as lt}from"./chunk-PQDPS2ID.js";function bt(n,d){if(n&1&&(a(0,"mat-option",10)(1,"div",11),y(2,"img",12),a(3,"span"),s(4),r()()()),n&2){let t=d.$implicit;p("value",t.ID)("disabled",t.disabled),l(),p("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),l(),p("src",t.Img,I),l(2),u(t.Name)}}function Tt(n,d){if(n&1){let t=R();a(0,"div",13)(1,"label",14),s(2,"Scan Type"),r(),a(3,"mat-radio-group",15),A("ngModelChange",function(e){L(t);let o=h();return U(o.filter.ScanFull,e)||(o.filter.ScanFull=e),F(e)}),a(4,"mat-radio-button",16),s(5," Full (Include Inactive Products) "),r(),a(6,"mat-radio-button",17),s(7," Active "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.ScanFull),l(),p("value",!0),l(2),p("value",!1)}}function It(n,d){n&1&&(a(0,"span"),s(1,"Never"),r())}function xt(n,d){if(n&1&&(a(0,"span"),s(1),x(2,"async"),r()),n&2){let t=h(2);l(),u(O(2,1,t.lastSync$))}}function Ot(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3)(2,"span",18),s(3,"Last Scan:"),r(),C(4,It,2,0,"span"),x(5,"async"),C(6,xt,3,3,"span"),r(),a(7,"mat-radio-group",19),A("ngModelChange",function(e){L(t);let o=h();return U(o.filter.UpdatedProduct,e)||(o.filter.UpdatedProduct=e),F(e)}),a(8,"mat-radio-button",20),s(9," Scan All Products "),r(),a(10,"mat-radio-button",21),s(11),r()()()}if(n&2){let t=h();l(4),G(O(5,6,t.lastSync$)==null?4:6),l(3),V("ngModel",t.filter.UpdatedProduct),l(),p("value",!1),l(2),p("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),l(),S(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Pt(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3),s(2," Scan Option "),r(),a(3,"mat-radio-group",22),A("ngModelChange",function(e){L(t);let o=h();return U(o.filter.Async,e)||(o.filter.Async=e),F(e)}),a(4,"mat-radio-button",23),s(5," Asynchronous (Get Notified when Complete) "),r(),a(6,"mat-radio-button",24),s(7," Synchronous (Wait until Complete) "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.Async),l(),p("value",!0),l(2),p("value",!1)}}var te=(()=>{let d=class d{constructor(i,e,o){this.dialogRef=i,this.data=e,this.router=o,this.channelService=Z(ct),this.channelType=m,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(i=>(i.disabled=!0,(i.TypeID==m.Tiktok||i.TypeID==m.Tokopedia||i.TypeID==m.Lazada||i.TypeID==m.WooCommerce)&&(i.disabled=!1),i)).sort(i=>i.disabled?1:-1))}onSelectChannel(i){let e=this.filterChannelById(i);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(i)}getLastSync(i){this.lastSync$=this.channelService.getLastSync(i).pipe(Q(e=>(this.selectedChannel.LastSync=e.LastSync,this.setDefaultConfigUpdate(),f.IsNotEmpty(e.LastSync)?f.convertToReadableDate(e.LastSync):null)),X(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==m.Shopee||this.selectedChannel.TypeID==m.Tiktok||this.selectedChannel.TypeID==m.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=m.WooCommerce&&this.selectedChannel?.TypeID!=m.KalCare&&this.selectedChannel?.TypeID!=m.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(i){let e;return this.channelOptions&&(e=this.channelOptions.find(o=>o.ID==i)),e}submit(){this.selectedChannel.TypeID==m.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(i){return f.IsNotEmpty(i)}onClose(){this.dialogRef.close()}};d.\u0275fac=function(e){return new(e||d)(g(D),g(E),g(dt))},d.\u0275cmp=T({type:d,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),s(4,"Select a Channel"),r(),a(5,"mat-form-field",4)(6,"mat-select",5),A("ngModelChange",function(c){return U(o.filter.ChannelID,c)||(o.filter.ChannelID=c),c}),v("ngModelChange",function(c){return o.onSelectChannel(c)}),C(7,bt,5,5,"mat-option",6),r()(),C(8,Tt,8,3,"div",7)(9,Ot,12,8,"div",8)(10,Pt,8,3,"div",9),r()()()),e&2&&(p("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),l(6),p("disabled",o.disabledChannelOption),V("ngModel",o.filter.ChannelID),l(),p("ngForOf",o.channelOptions),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)),l(),G(o.hasScanUpdate&&o.selectedChannel?9:-1),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[K,$,st,pt,ht,ft,gt,Ct,mt,P,w,lt],encapsulation:2});let n=d;return n})();var M=function(n){return n.Tokopedia="https://seller.tokopedia.com",n.Shoope="https://seller.shopee.co.id",n.Tiktok="https://seller-id.tiktok.com",n.WooCommerce="https://woocommerce.dealpos.app",n.Lazada="https://sellercenter.lazada.co.id",n}(M||{});var Dt=n=>({"is-disabled":n});function Et(n,d){if(n&1&&(H(0),a(1,"tr")(2,"td",11),s(3),r(),a(4,"td",11),s(5),r(),a(6,"td",12)(7,"p",13),s(8,"Product Not in Channel!"),r()()(),J()),n&2){let t=h().$implicit;l(3),S(" ",t==null?null:t.Model,""),l(2),S(" ",t==null?null:t.Code,"")}}function kt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Model,"")}}function wt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Code,"")}}function Nt(n,d){if(n&1&&(a(0,"tr"),C(1,kt,2,2,"td",14)(2,wt,2,2,"td",14),a(3,"td",11)(4,"div",15)(5,"a",16),y(6,"img",17),r(),a(7,"div",18),s(8),r()()(),a(9,"td",11),s(10),x(11,"number"),r(),a(12,"td",19),s(13),x(14,"number"),r(),a(15,"td",19)(16,"a",20),y(17,"i",21),a(18,"span",22),s(19,"Edit"),r()()()()),n&2){let t=d.$implicit,i=d.index,e=h(3);l(),p("ngIf",i==0),l(),p("ngIf",i==0),l(3),p("href",t.Url,I)("title",t.Title),l(),p("src",e.getChannelLogo(t.TypeID),I),l(),p("matTooltip",(t==null||t.Name==null?null:t.Name.length)>55?t==null?null:t.Name:""),l(),S(" ",t.Name," "),l(2),u(O(11,12,t.Price)),l(3),u(O(14,14,t.Inventory)),l(3),p("href",e.getHyperlinkSellerCenter(t),I)("ngClass",W(16,Dt,t.TypeID==e.channelType.KalCare))("matTooltip",t.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Vt(n,d){if(n&1&&C(0,Nt,20,18,"tr",9),n&2){let t=h().$implicit;p("ngForOf",t==null?null:t.Channel)}}function Ut(n,d){if(n&1&&(H(0),C(1,Et,9,2,"ng-container",10)(2,Vt,1,1,"ng-template",null,0,ot),J()),n&2){let t=d.$implicit,i=at(3);l(),p("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",i)}}var de=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.channelType=m,this.variants=i.variants,this.title=i.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(i){return f.getChannelLogoByTypeId(i)}getHyperlinkSellerCenter(i){let e="javascript:void(0)";switch(i.TypeID){case m.Shopee:e=`${M.Shoope}/portal/product/${i.ChannelItemID}`;break;case m.Tiktok:e=`${M.Tiktok}/product/edit/${i.ChannelItemID}`;break;case m.Tokopedia:e=`${M.Tokopedia}/edit-product/${i.ChannelItemID}`;break;case m.WooCommerce:e=`${M.WooCommerce}/wp-admin/post.php?post=${i.ChannelItemID}&action=edit`;break;case m.Lazada:e=`${M.Lazada}/apps/product/publish?productId=${i.ChannelItemID}`;break}return e}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(a(0,"modal-material",1),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),s(6," VARIANT "),a(7,"sup"),y(8,"i",6),r()(),a(9,"th",5),s(10,"SKU"),r(),a(11,"th",5),s(12," PRODUCT "),a(13,"sup"),y(14,"i",7),r()(),a(15,"th",5),s(16,"PRICE"),r(),a(17,"th",8),s(18,"INVENTORY"),r(),y(19,"th",5),r()(),a(20,"tbody"),C(21,Ut,4,2,"ng-container",9),r()()()()),e&2&&(p("config",o.modalConfig),l(21),p("ngForOf",o.variants))},dependencies:[B,K,$,P,w,rt],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let n=d;return n})();var At=n=>({"bg-gradient-warning":n});function Lt(n,d){if(n&1&&(a(0,"tr",5)(1,"td"),s(2),r(),a(3,"td",6),s(4),r()()),n&2){let t=d.$implicit;p("matTooltip",t.duplicateMessage),l(2),u(t==null?null:t.Name),l(),p("ngClass",W(4,At,t.isDuplicate)),l(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var Ce=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.variants=tt([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let i=this.data?.variants,e={},o=[],_=i.filter(c=>f.IsEmpty(c.ChannelVariationSKU));i.filter(c=>f.IsNotEmpty(c.ChannelVariationSKU)).forEach((c,b,Y)=>{e[c.ChannelVariationSKU]=Y.filter(N=>N.ChannelVariationSKU===c.ChannelVariationSKU)}),Object.keys(e).forEach(c=>{e[c].length>1&&(e[c]=e[c].map((b,Y,N)=>{let q=`SKU ${b.ChannelVariationSKU} is duplicated with variant`;return N.forEach((j,Mt)=>{j.Name!==b.Name&&(q+=` ${N.length>2?j.Name+(Mt!==N.length-1?",":""):j.Name}`)}),b.duplicateMessage=q,b.isDuplicate=!0,b})),o.push(...e[c])}),o.push(..._),this.variants.set(o)}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variants"]],decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),s(6,"Variant"),r(),a(7,"th",4),s(8,"SKU"),r()()(),a(9,"tbody"),nt(10,Lt,5,6,"tr",5,et),r()()()()),e&2&&(p("config",o.modalConfig),l(10),it(o.variants()))},dependencies:[B,P,w],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]});let n=d;return n})();export{te as a,de as b,Ce as c};
|
|
1
|
+
import{a as ct}from"./chunk-SDM2TXHH.js";import{a as Ct}from"./chunk-BQ7NR3ET.js";import{a as ht,b as ft}from"./chunk-UMNGKENU.js";import{f as gt}from"./chunk-HCDKYABV.js";import{b as D,c as E,i as k,j as w}from"./chunk-BO4PPSB5.js";import{t as P}from"./chunk-HUUFOAKH.js";import{X as mt}from"./chunk-E5GGIVK7.js";import{h as st,m as pt}from"./chunk-BSN7ZAXG.js";import{b as m,c as f}from"./chunk-64G3XLI6.js";import{o as dt}from"./chunk-OVEJFFL6.js";import{$b as v,Bd as rt,Da as L,Ea as F,Eb as C,Fb as z,Gb as p,Gc as x,Hc as O,Jc as ot,Nb as G,Ob as et,Qb as nt,Rb as it,Sb as a,Tb as r,Ub as y,Vb as H,Wb as J,Yb as R,Z as X,bc as h,gb as I,jb as l,kb as g,mc as at,nc as s,oc as u,pa as Z,pc as S,rc as V,sc as U,sd as B,ta as T,tc as A,ud as K,v as Q,vd as $,xb as tt,xc as W,yd as lt}from"./chunk-PQDPS2ID.js";function bt(n,d){if(n&1&&(a(0,"mat-option",10)(1,"div",11),y(2,"img",12),a(3,"span"),s(4),r()()()),n&2){let t=d.$implicit;p("value",t.ID)("disabled",t.disabled),l(),p("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),l(),p("src",t.Img,I),l(2),u(t.Name)}}function Tt(n,d){if(n&1){let t=R();a(0,"div",13)(1,"label",14),s(2,"Scan Type"),r(),a(3,"mat-radio-group",15),A("ngModelChange",function(e){L(t);let o=h();return U(o.filter.ScanFull,e)||(o.filter.ScanFull=e),F(e)}),a(4,"mat-radio-button",16),s(5," Full (Include Inactive Products) "),r(),a(6,"mat-radio-button",17),s(7," Active "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.ScanFull),l(),p("value",!0),l(2),p("value",!1)}}function It(n,d){n&1&&(a(0,"span"),s(1,"Never"),r())}function xt(n,d){if(n&1&&(a(0,"span"),s(1),x(2,"async"),r()),n&2){let t=h(2);l(),u(O(2,1,t.lastSync$))}}function Ot(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3)(2,"span",18),s(3,"Last Scan:"),r(),C(4,It,2,0,"span"),x(5,"async"),C(6,xt,3,3,"span"),r(),a(7,"mat-radio-group",19),A("ngModelChange",function(e){L(t);let o=h();return U(o.filter.UpdatedProduct,e)||(o.filter.UpdatedProduct=e),F(e)}),a(8,"mat-radio-button",20),s(9," Scan All Products "),r(),a(10,"mat-radio-button",21),s(11),r()()()}if(n&2){let t=h();l(4),G(O(5,6,t.lastSync$)==null?4:6),l(3),V("ngModel",t.filter.UpdatedProduct),l(),p("value",!1),l(2),p("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),l(),S(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Pt(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3),s(2," Scan Option "),r(),a(3,"mat-radio-group",22),A("ngModelChange",function(e){L(t);let o=h();return U(o.filter.Async,e)||(o.filter.Async=e),F(e)}),a(4,"mat-radio-button",23),s(5," Asynchronous (Get Notified when Complete) "),r(),a(6,"mat-radio-button",24),s(7," Synchronous (Wait until Complete) "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.Async),l(),p("value",!0),l(2),p("value",!1)}}var te=(()=>{let d=class d{constructor(i,e,o){this.dialogRef=i,this.data=e,this.router=o,this.channelService=Z(ct),this.channelType=m,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(i=>(i.disabled=!0,(i.TypeID==m.Tiktok||i.TypeID==m.Tokopedia||i.TypeID==m.Lazada||i.TypeID==m.WooCommerce)&&(i.disabled=!1),i)).sort(i=>i.disabled?1:-1))}onSelectChannel(i){let e=this.filterChannelById(i);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(i)}getLastSync(i){this.lastSync$=this.channelService.getLastSync(i).pipe(Q(e=>(this.selectedChannel.LastSync=e.LastSync,this.setDefaultConfigUpdate(),f.IsNotEmpty(e.LastSync)?f.convertToReadableDate(e.LastSync):null)),X(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==m.Shopee||this.selectedChannel.TypeID==m.Tiktok||this.selectedChannel.TypeID==m.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=m.WooCommerce&&this.selectedChannel?.TypeID!=m.KalCare&&this.selectedChannel?.TypeID!=m.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(i){let e;return this.channelOptions&&(e=this.channelOptions.find(o=>o.ID==i)),e}submit(){this.selectedChannel.TypeID==m.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(i){return f.IsNotEmpty(i)}onClose(){this.dialogRef.close()}};d.\u0275fac=function(e){return new(e||d)(g(D),g(E),g(dt))},d.\u0275cmp=T({type:d,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),s(4,"Select a Channel"),r(),a(5,"mat-form-field",4)(6,"mat-select",5),A("ngModelChange",function(c){return U(o.filter.ChannelID,c)||(o.filter.ChannelID=c),c}),v("ngModelChange",function(c){return o.onSelectChannel(c)}),C(7,bt,5,5,"mat-option",6),r()(),C(8,Tt,8,3,"div",7)(9,Ot,12,8,"div",8)(10,Pt,8,3,"div",9),r()()()),e&2&&(p("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),l(6),p("disabled",o.disabledChannelOption),V("ngModel",o.filter.ChannelID),l(),p("ngForOf",o.channelOptions),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)),l(),G(o.hasScanUpdate&&o.selectedChannel?9:-1),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[K,$,st,pt,ht,ft,gt,Ct,mt,P,w,lt],encapsulation:2});let n=d;return n})();var M=function(n){return n.Tokopedia="https://seller.tokopedia.com",n.Shoope="https://seller.shopee.co.id",n.Tiktok="https://seller-id.tiktok.com",n.WooCommerce="https://woocommerce.dealpos.app",n.Lazada="https://sellercenter.lazada.co.id",n}(M||{});var Dt=n=>({"is-disabled":n});function Et(n,d){if(n&1&&(H(0),a(1,"tr")(2,"td",11),s(3),r(),a(4,"td",11),s(5),r(),a(6,"td",12)(7,"p",13),s(8,"Product Not in Channel!"),r()()(),J()),n&2){let t=h().$implicit;l(3),S(" ",t==null?null:t.Model,""),l(2),S(" ",t==null?null:t.Code,"")}}function kt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Model,"")}}function wt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Code,"")}}function Nt(n,d){if(n&1&&(a(0,"tr"),C(1,kt,2,2,"td",14)(2,wt,2,2,"td",14),a(3,"td",11)(4,"div",15)(5,"a",16),y(6,"img",17),r(),a(7,"div",18),s(8),r()()(),a(9,"td",11),s(10),x(11,"number"),r(),a(12,"td",19),s(13),x(14,"number"),r(),a(15,"td",19)(16,"a",20),y(17,"i",21),a(18,"span",22),s(19,"Edit"),r()()()()),n&2){let t=d.$implicit,i=d.index,e=h(3);l(),p("ngIf",i==0),l(),p("ngIf",i==0),l(3),p("href",t.Url,I)("title",t.Title),l(),p("src",e.getChannelLogo(t.TypeID),I),l(),p("matTooltip",(t==null||t.Name==null?null:t.Name.length)>55?t==null?null:t.Name:""),l(),S(" ",t.Name," "),l(2),u(O(11,12,t.Price)),l(3),u(O(14,14,t.Inventory)),l(3),p("href",e.getHyperlinkSellerCenter(t),I)("ngClass",W(16,Dt,t.TypeID==e.channelType.KalCare))("matTooltip",t.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Vt(n,d){if(n&1&&C(0,Nt,20,18,"tr",9),n&2){let t=h().$implicit;p("ngForOf",t==null?null:t.Channel)}}function Ut(n,d){if(n&1&&(H(0),C(1,Et,9,2,"ng-container",10)(2,Vt,1,1,"ng-template",null,0,ot),J()),n&2){let t=d.$implicit,i=at(3);l(),p("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",i)}}var de=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.channelType=m,this.variants=i.variants,this.title=i.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(i){return f.getChannelLogoByTypeId(i)}getHyperlinkSellerCenter(i){let e="javascript:void(0)";switch(i.TypeID){case m.Shopee:e=`${M.Shoope}/portal/product/${i.ChannelItemID}`;break;case m.Tiktok:e=`${M.Tiktok}/product/edit/${i.ChannelItemID}`;break;case m.Tokopedia:e=`${M.Tokopedia}/edit-product/${i.ChannelItemID}`;break;case m.WooCommerce:e=`${M.WooCommerce}/wp-admin/post.php?post=${i.ChannelItemID}&action=edit`;break;case m.Lazada:e=`${M.Lazada}/apps/product/publish?productId=${i.ChannelItemID}`;break}return e}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(a(0,"modal-material",1),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),s(6," VARIANT "),a(7,"sup"),y(8,"i",6),r()(),a(9,"th",5),s(10,"SKU"),r(),a(11,"th",5),s(12," PRODUCT "),a(13,"sup"),y(14,"i",7),r()(),a(15,"th",5),s(16,"PRICE"),r(),a(17,"th",8),s(18,"INVENTORY"),r(),y(19,"th",5),r()(),a(20,"tbody"),C(21,Ut,4,2,"ng-container",9),r()()()()),e&2&&(p("config",o.modalConfig),l(21),p("ngForOf",o.variants))},dependencies:[B,K,$,P,w,rt],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let n=d;return n})();var At=n=>({"bg-gradient-warning":n});function Lt(n,d){if(n&1&&(a(0,"tr",5)(1,"td"),s(2),r(),a(3,"td",6),s(4),r()()),n&2){let t=d.$implicit;p("matTooltip",t.duplicateMessage),l(2),u(t==null?null:t.Name),l(),p("ngClass",W(4,At,t.isDuplicate)),l(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var Ce=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.variants=tt([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let i=this.data?.variants,e={},o=[],_=i.filter(c=>f.IsEmpty(c.ChannelVariationSKU));i.filter(c=>f.IsNotEmpty(c.ChannelVariationSKU)).forEach((c,b,Y)=>{e[c.ChannelVariationSKU]=Y.filter(N=>N.ChannelVariationSKU===c.ChannelVariationSKU)}),Object.keys(e).forEach(c=>{e[c].length>1&&(e[c]=e[c].map((b,Y,N)=>{let q=`SKU ${b.ChannelVariationSKU} is duplicated with variant`;return N.forEach((j,Mt)=>{j.Name!==b.Name&&(q+=` ${N.length>2?j.Name+(Mt!==N.length-1?",":""):j.Name}`)}),b.duplicateMessage=q,b.isDuplicate=!0,b})),o.push(...e[c])}),o.push(..._),this.variants.set(o)}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variants"]],decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),s(6,"Variant"),r(),a(7,"th",4),s(8,"SKU"),r()()(),a(9,"tbody"),nt(10,Lt,5,6,"tr",5,et),r()()()()),e&2&&(p("config",o.modalConfig),l(10),it(o.variants()))},dependencies:[B,P,w],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]});let n=d;return n})();export{te as a,de as b,Ce as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as qt}from"./chunk-P2A5AQIO.js";import{a as zt,b as Qt}from"./chunk-LJHZMQZD.js";import"./chunk-MY4B7K3R.js";import{b as Ht}from"./chunk-IJYSJN63.js";import"./chunk-X5Q6FPWS.js";import"./chunk-46AOM3SM.js";import{a as Xt,b as Jt}from"./chunk-JXTGH22T.js";import"./chunk-OULUJ2IO.js";import{a as Bt,b as Rt}from"./chunk-LB6JFX4H.js";import{a as mt,b as Gt,c as jt,d as pt,e as st}from"./chunk-U4LZH7TG.js";import"./chunk-FGPSBTFS.js";import"./chunk-QCC5ZGGN.js";import{a as Yt}from"./chunk-GCKSYCMI.js";import"./chunk-N32A3EYJ.js";import"./chunk-ADRVUMMW.js";import{a as Wt}from"./chunk-PNVJ62RQ.js";import"./chunk-FMV4LYKN.js";import"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{d as R,e as G}from"./chunk-CCXKODFV.js";import"./chunk-VAMLKDPP.js";import{e as nt}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{m as $t,n as Lt}from"./chunk-BO4PPSB5.js";import{t as Vt,u as Dt}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as et,e as ct,h as L,i as X,l as gt,m as Nt,n as J,p as z,q as Ot,r as Q,s as kt,t as wt,u as Mt,x as q,y as it,z as B}from"./chunk-BSN7ZAXG.js";import{b as Ut,c as g}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as A,Ca as O,Cd as F,Da as W,Ea as Y,Eb as h,Gb as s,Gc as v,Hc as y,K as It,M as Ft,Ma as ht,Nb as b,Ob as w,Pa as k,Qb as M,Rb as U,Sb as m,Tb as c,Ub as _,Vb as V,Wb as D,Yb as H,Z as tt,bc as l,ea as P,ja as N,jb as p,nc as f,oc as at,pa as u,pc as Z,rc as At,sc as Et,ta as x,tc as Pt,uc as S,v as E,vc as T,vd as $,wc as lt,yd as I}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var K=function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t}(K||{});var ot=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(ot||{});var Ct=(()=>{let o=class o{constructor(){this.shopeeUploadService=u(mt),this.formBuilder=u(q)}getAttributes(n){return this.shopeeUploadService.getAttributes(n.channelId,n.categoryId).pipe(E(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(n=[]){let i,a;return n=n.map(r=>(i=r?.multi_lang?.find(d=>d.language=="id"),r.attribute_value_list=r?.attribute_value_list?.map(d=>(a=d?.multi_lang?.find(C=>C.language=="id"),d.name=a?.value,d)),r.name=i?.value?i?.value:r.name,r)),n}createFormGroup(n){let i=this.formBuilder.group({}),a=[];return n.forEach(r=>{if(a=[],r.mandatory&&a.push(ct.required),r?.attribute_info?.format_type==ot.FORMAT_QUANTITATIVE_WITH_UNIT&&r?.attribute_info?.input_type==K.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new gt(null),value:new gt(null,a)});i.addControl(JSON.stringify(r.attribute_id),d)}else i.addControl(JSON.stringify(r.attribute_id),this.formBuilder.control(null,a))}),i}getFilteredAttributes(n,i){let a=JSON.parse(JSON.stringify(n)),r=Object.keys(i),d=a.filter(C=>r.findIndex(ft=>parseInt(ft)==C.attribute_id||C.mandatory)!=-1);return d=this.filterSelectedAttributes(d,i),d}filterSelectedAttributes(n,i){return n.map(r=>{switch(r.attribute_info.input_type){case K.MULTI_COMBO_BOX:g.IsNotEmpty(i[r.attribute_id])?r.attribute_value_list=r.attribute_value_list.filter(d=>i[r.attribute_id]?.findIndex(C=>C==d.value_id)!=-1):r.attribute_value_list=[];break;case K.FREE_TEXT_FILED:r.attribute_info.format_type==ot.FORMAT_QUANTITATIVE_WITH_UNIT?r.attribute_value_list=this.setSelectedQuantitativeAttr(i[r.attribute_id]?.value,i[r.attribute_id]?.unit):g.IsNotEmpty(i[r.attribute_id])&&(r.attribute_value_list=[{value_id:0,name:i[r.attribute_id]}]);break;default:r.attribute_value_list=r.attribute_value_list.filter(d=>d.value_id==i[r.attribute_id])}return r}).filter(r=>r?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(n,i){let a=[];return g.IsNotEmpty(n)&&(a=[{value_id:0,original_value_name:JSON.stringify(n),value_unit:i}]),a}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();var bt=function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t}(bt||{});var vt=()=>[];function ne(t,o){t&1&&(m(0,"span",5),f(1,"*"),c())}function oe(t,o){if(t&1&&_(0,"ng-select",6),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:lt(4,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function re(t,o){if(t&1&&_(0,"input",8),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function ae(t,o){if(t&1&&(m(0,"option",15),f(1),c()),t&2){let e=o.$implicit;s("value",e),p(),at(e)}}function le(t,o){if(t&1&&(m(0,"div",10),_(1,"input",12),m(2,"select",13)(3,"option",14),f(4,"Unit"),c(),M(5,ae,2,2,"option",15,w),c()()),t&2){let e=l(3).$implicit;s("formGroupName",e.attribute_id),p(),s("placeholder","Isi "+(e==null?null:e.name)),p(2),s("value",null),p(2),U(e==null||e.attribute_info==null?null:e.attribute_info.attribute_unit_list)}}function ce(t,o){if(t&1&&_(0,"input",11),t&2){let e=l(3).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function me(t,o){if(t&1&&h(0,le,7,3,"div",10)(1,ce,1,2,"input",11),t&2){let e=l(2).$implicit,n=l(2);b((e==null||e.attribute_info==null?null:e.attribute_info.format_type)==n.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function pe(t,o){if(t&1&&_(0,"datepicker",9),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)}}function se(t,o){if(t&1&&h(0,re,1,2,"input",8)(1,me,2,1)(2,pe,1,1,"datepicker",9),t&2){let e,n=l().$implicit,i=l(2);b((e=n==null||n.attribute_info==null?null:n.attribute_info.input_validation_type)===i.validationType.VALIDATOR_STRING_TYPE?0:e===i.validationType.VALIDATOR_FLOAT_TYPE?1:e===i.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function de(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:lt(3,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function ue(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:lt(3,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function _e(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),h(2,ne,2,0,"span",5),m(3,"span"),f(4),c()(),h(5,oe,1,5,"ng-select",6)(6,se,3,1)(7,de,1,4,"ng-select",7)(8,ue,1,4,"ng-select",7),c()),t&2){let e,n=o.$implicit,i=l(2);p(2),b(n.mandatory?2:-1),p(2),Z(" ",n==null?null:n.name," "),p(),b((e=n==null||n.attribute_info==null?null:n.attribute_info.input_type)===i.inputType.MULTI_COMBO_BOX?5:e===i.inputType.FREE_TEXT_FILED?6:e===i.inputType.SINGLE_COMBO_BOX?7:8)}}function fe(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,_e,9,3,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var Zt=(()=>{let o=class o{constructor(){this.formCategoryService=u(Ct),this.attributesChanges=new k,this.inputType=K,this.formatType=ot,this.validationType=bt}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(P(n=>{this.form=this.formCategoryService.createFormGroup(n),this.listenToFormChange(n)}),tt(1)))}listenToFormChange(n){let i=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{i=this.formCategoryService.getFilteredAttributes(n,a),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([Ct]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,a){i&1&&(h(0,fe,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,G,R,B,J,wt,Mt,et,kt,L,X,z,Q,Ot,Yt,Qt,zt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]});let t=o;return t})();var yt=(()=>{let o=class o{constructor(){this.httpService=u(nt),this.formBuilder=u(q),this.uploadProductService=u(st)}getAttributes(n,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:i}]).pipe(It(r=>this.uploadProductService.selectedProduct$.pipe(E(d=>(r=this.mappingAttributeSalesProperty(r,d),r)))))}mappingAttributeSalesProperty(n,i){let a=0;return n.filter(r=>(r.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(r=>(r.type=="SALES_PROPERTY"&&(r.name="Jenis Variant",r.is_multiple_selection=!1,r.is_required=this.isProductHasMoreVariant(i),r.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),r))}isProductHasMoreVariant(n){let i=!1,a=[];return n.forEach(r=>{r.Variants&&a.push(r.Variants.length)}),i=a.some(r=>r>1),i}createFormGroup(n){let i=this.formBuilder.group({}),a=[];return n.forEach(r=>{a=[],r.is_required&&a.push(ct.required),i.addControl(r.id,this.formBuilder.control(null,a))}),i}getFilteredAttributes(n,i){let a=JSON.parse(JSON.stringify(n)),r=Object.keys(i),d=a.filter(C=>r.findIndex(ft=>parseInt(ft)==C.id)!=-1);return d=this.filterSelectedAttributes(d,i),d}filterSelectedAttributes(n,i){return n.map(r=>(g.IsNotEmpty(r.values)?r.is_multiple_selection?r.values=r.values.filter(d=>i[r.id]?.includes(d.id)):r.values=r.values.filter(d=>d.id==i[r.id]):i[r.id]&&(r.values=[{id:null,name:i[r.id]}]),r)).filter(r=>r?.values?.length>0)}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function he(t,o){t&1&&(m(0,"span",5),f(1,"*"),c())}function ge(t,o){if(t&1&&_(0,"ng-select",6),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Ce(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function be(t,o){if(t&1&&_(0,"input",8),t&2){let e=l().$implicit;s("formControlName",e.id)("placeholder",e==null?null:e.name)}}function ve(t,o){if(t&1&&(m(0,"small",5),f(1),c()),t&2){let e=l().$implicit;p(),Z(" ",e==null?null:e.name," is mandatory ")}}function ye(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),h(2,he,2,0,"span",5),m(3,"span"),f(4),c()(),h(5,ge,1,4,"ng-select",6)(6,Ce,1,3,"ng-select",7)(7,be,1,2,"input",8)(8,ve,2,1,"small",5),c()),t&2){let e=o.$implicit;p(2),b(e.is_required?2:-1),p(2),Z(" ",e==null?null:e.name," "),p(),b(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),p(3),b(e.is_required?8:-1)}}function xe(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,ye,9,4,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var Kt=(()=>{let o=class o{constructor(){this.tiktokAttributeFormService=u(yt),this.attributesChanges=new k}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(E(n=>n.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(g.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),P(n=>{this.form=this.tiktokAttributeFormService.createFormGroup(n),this.listenToFormChange(n)}),tt(1)))}listenToFormChange(n){let i=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{i=this.tiktokAttributeFormService.getFilteredAttributes(n,a),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([yt]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,a){i&1&&(h(0,xe,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,G,R,B,J,et,L,X,z,Q,it]});let t=o;return t})();var xt=(()=>{let o=class o{constructor(){this.woocommerceUploadService=u(pt)}getAttributes(n,i){return this.woocommerceUploadService.getAttributes(n,i).pipe(E(a=>a.map(r=>({key:r.name,label:r.name}))))}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();var te=(()=>{let o=class o{constructor(){this.wooAttributeFormService=u(xt),this.channelId=ht(),this.categoryId=ht(),this.attributesChanges=new k}ngOnChanges(){g.IsNotEmpty(this.categoryId())&&g.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(n){this.attributesChanges.emit([n.key])}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([xt]),O,T],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,a){i&1&&(m(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),c(),m(4,"ng-select",3),v(5,"async"),A("change",function(d){return a.onSelectAttribute(d)}),c()()()),i&2&&(p(4),s("items",y(5,1,a.attributes$)))},dependencies:[F,I,it,G,R,B]});let t=o;return t})();var St=(()=>{let o=class o{constructor(){this.httpService=u(nt),this.formBuilder=u(q)}getAttributes(n,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:i}]).pipe(E(r=>r))}createFormGroup(n){let i=this.formBuilder.group({});return n.forEach(a=>{i.addControl(a.variant,this.formBuilder.control(null))}),i}convertAttributes(n={}){return Object.values(n).filter(a=>a!==null).map(a=>JSON.stringify(a))}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function Se(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),f(2),c(),_(3,"ng-select",5),c()),t&2){let e=o.$implicit;p(2),Z(" ",e==null?null:e.variant," "),p(),s("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function Te(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,Se,4,4,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var ee=(()=>{let o=class o{constructor(){this.tokpedAttrFormService=u(St),this.attributesChanges=new k}ngOnInit(){}ngOnChanges(n){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(P(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let n=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{n=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([St]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,a){i&1&&(h(0,Te,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,G,R,B,J,L,X,z,Q]});let t=o;return t})();var Tt=(()=>{let o=class o{constructor(){this.httpService=u(nt),this.formBuilder=u(q)}getAttributes(n){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:n}]).pipe(P(a=>(a.Options.StatusOptions=a.Options.Status.map(r=>({id:r,name:r})),a)))}createFormGroup(n){let i=this.formBuilder.group({});return Object.keys(n.Attribute).forEach(r=>{i.addControl(r,this.formBuilder.control(null))}),i}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function Ie(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),f(5," Brand "),c(),_(6,"input",5),c(),m(7,"div",6)(8,"div",4),f(9," Product Type "),c(),_(10,"input",7),c(),m(11,"div",6)(12,"div",4),f(13," Status "),c(),_(14,"ng-select",8),c()()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(13),s("items",e.Options.StatusOptions)}}var ie=(()=>{let o=class o{constructor(){this.attributesChanges=new k,this.shopifyFormService=u(Tt)}ngOnChanges(n){n.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(P(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Ft(500)).subscribe(n=>{this.attributesChanges.emit([n])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([Tt]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,a){i&1&&(h(0,Ie,15,2,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,B,J,et,L,X,z,Q,G,R]});let t=o;return t})();function Fe(t,o){if(t&1&&(m(0,"div",6),_(1,"app-product-card",9),c()),t&2){let e=o.$implicit;p(),s("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function Ae(t,o){if(t&1){let e=H();V(0),m(1,"mat-checkbox",21),Pt("ngModelChange",function(i){W(e);let a=l().$implicit;return Et(a.selected,i)||(a.selected=i),Y(i)}),A("ngModelChange",function(){let i=W(e).ngIf,a=l(),r=a.$implicit,d=a.$index,C=l();return Y(C.onSelectChannel(r,d,i))}),c(),D()}if(t&2){let e=l().$implicit;p(),At("ngModel",e.selected)}}function Ee(t,o){t&1&&(m(0,"div",18),_(1,"input",22),c())}function Pe(t,o){if(t&1){let e=H();m(0,"app-channel-category-select",23),A("selectedCategory",function(i){W(e);let a=l().$index,r=l();return Y(r.onCategoryChange(a,i))}),c()}if(t&2){let e=l().$implicit,n=l();s("disabled",!e.selected||e.selected&&e.type==n.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function Ne(t,o){if(t&1){let e=H();m(0,"shopee-attribute-form",27),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function Oe(t,o){if(t&1){let e=H();m(0,"tiktok-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function ke(t,o){if(t&1){let e=H();m(0,"wooocommerce-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function we(t,o){if(t&1){let e=H();m(0,"tokopedia-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function Me(t,o){if(t&1&&(m(0,"div",20)(1,"div",24),h(2,Ne,1,3,"shopee-attribute-form",25)(3,Oe,1,2,"tiktok-attribute-form",26)(4,ke,1,2,"wooocommerce-attribute-form",26)(5,we,1,2,"tokopedia-attribute-form",26),c()()),t&2){let e,n=l().$implicit,i=l();p(2),b((e=n.type)===i.channelType.Shopee?2:e===i.channelType.Tiktok?3:e===i.channelType.WooCommerce?4:e===i.channelType.Tokopedia?5:-1)}}function Ue(t,o){if(t&1){let e=H();m(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),A("attributesChanges",function(i){W(e);let a=l().$index,r=l();return Y(r.onAttributesChange(a,i))}),c()()()}if(t&2){let e=l().$implicit;p(2),s("channelId",e.id)}}function Ve(t,o){if(t&1&&(m(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),h(6,Ae,2,1,"ng-container",14),v(7,"async"),c(),m(8,"div"),_(9,"app-channel-logo",15),c(),m(10,"div",16)(11,"span"),f(12),c()()()(),m(13,"div",12)(14,"div",17),h(15,Ee,2,0,"div",18)(16,Pe,1,4,"app-channel-category-select",19),c()()(),h(17,Me,6,1,"div",20)(18,Ue,3,1,"div",20),c()()),t&2){let e=o.$implicit,n=l();p(6),s("ngIf",y(7,8,n.defaultCategories$)),p(3),s("typeId",e.type)("showChannelName",!1),p(),s("matTooltip",e.name)("matTooltipShowDelay",2500),p(2),at(e.name),p(3),b(e.type==n.channelType.Shopify||e.type==n.channelType.Plugo?15:16),p(2),b(e.categoryId&&n.channelType.Lazada!=e.type&&e.selected?17:n.channelType.Shopify==e.type&&e.selected?18:-1)}}var oo=(()=>{let o=class o{constructor(){this.uploadProductService=u(st),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ut,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(tt(1))}onCategoryChange(n,i){this.channelProductUploads.update(a=>a.map((r,d)=>(d==n&&(r.categoryId=i,r.attributes=[]),r)))}onAttributesChange(n,i){this.channelProductUploads.update(a=>a.map((r,d)=>(d==n&&(r.attributes=i),r)))}onSelectChannel(n,i,a){this.channelProductUploads.update(r=>r.map((d,C)=>{if(C==i&&n.selected){let _t=this.findCategoryByChannelId(n.id,a);d.categoryId=_t?.DefaultCategoryID}return C==i&&!n.selected&&(d.categoryId=null),d}))}findCategoryByChannelId(n,i){return i.find(a=>a.ID===n)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["app-product-upload"]],standalone:!0,features:[S([mt,Gt,jt,pt]),T],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltip","Cannot change category, please change category in admin.shopify.com","matTooltipPosition","above"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,a){if(i&1&&(m(0,"mainpanel",0)(1,"actions")(2,"button",1),A("click",function(){return a.onUploadProduct()}),_(3,"i",2),f(4," Upload "),c()(),m(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),c(),m(9,"div",5),M(10,Fe,2,7,"div",6,w),v(12,"async"),c(),m(13,"h3",7),f(14,"Channel To Upload"),c(),M(15,Ve,19,10,"div",8,w),c()()()),i&2){let r;s("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),s("disabled",((r=a.channelProductUploads())==null?null:r.length)==0),p(8),U(y(12,3,a.selectedProducts$)),p(5),U(a.channelProductUploads())}},dependencies:[F,$,I,Ht,Lt,$t,Jt,Xt,Rt,Bt,it,L,Nt,Dt,Vt,Zt,Kt,te,ee,ie,Wt,qt],encapsulation:2});let t=o;return t})();export{oo as ProductUploadComponent};
|
|
1
|
+
import{b as qt}from"./chunk-P2A5AQIO.js";import{a as zt,b as Qt}from"./chunk-LJHZMQZD.js";import"./chunk-MY4B7K3R.js";import{b as Ht}from"./chunk-IJYSJN63.js";import"./chunk-X5Q6FPWS.js";import"./chunk-46AOM3SM.js";import{a as Xt,b as Jt}from"./chunk-JXTGH22T.js";import"./chunk-OULUJ2IO.js";import{a as Bt,b as Rt}from"./chunk-LB6JFX4H.js";import{a as mt,b as Gt,c as jt,d as pt,e as st}from"./chunk-VLHQSOLI.js";import"./chunk-FGPSBTFS.js";import"./chunk-QCC5ZGGN.js";import{a as Yt}from"./chunk-GCKSYCMI.js";import"./chunk-P64M4BHW.js";import"./chunk-ADRVUMMW.js";import{a as Wt}from"./chunk-PNVJ62RQ.js";import"./chunk-FMV4LYKN.js";import"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{d as R,e as G}from"./chunk-CCXKODFV.js";import"./chunk-AWGGAU6G.js";import{e as nt}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{m as $t,n as Lt}from"./chunk-BO4PPSB5.js";import{t as Vt,u as Dt}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as et,e as ct,h as L,i as X,l as gt,m as Nt,n as J,p as z,q as Ot,r as Q,s as kt,t as wt,u as Mt,x as q,y as it,z as B}from"./chunk-BSN7ZAXG.js";import{b as Ut,c as g}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as A,Ca as O,Cd as F,Da as W,Ea as Y,Eb as h,Gb as s,Gc as v,Hc as y,K as It,M as Ft,Ma as ht,Nb as b,Ob as w,Pa as k,Qb as M,Rb as U,Sb as m,Tb as c,Ub as _,Vb as V,Wb as D,Yb as H,Z as tt,bc as l,ea as P,ja as N,jb as p,nc as f,oc as at,pa as u,pc as Z,rc as At,sc as Et,ta as x,tc as Pt,uc as S,v as E,vc as T,vd as $,wc as lt,yd as I}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var K=function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t}(K||{});var ot=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(ot||{});var Ct=(()=>{let o=class o{constructor(){this.shopeeUploadService=u(mt),this.formBuilder=u(q)}getAttributes(n){return this.shopeeUploadService.getAttributes(n.channelId,n.categoryId).pipe(E(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(n=[]){let i,a;return n=n.map(r=>(i=r?.multi_lang?.find(d=>d.language=="id"),r.attribute_value_list=r?.attribute_value_list?.map(d=>(a=d?.multi_lang?.find(C=>C.language=="id"),d.name=a?.value,d)),r.name=i?.value?i?.value:r.name,r)),n}createFormGroup(n){let i=this.formBuilder.group({}),a=[];return n.forEach(r=>{if(a=[],r.mandatory&&a.push(ct.required),r?.attribute_info?.format_type==ot.FORMAT_QUANTITATIVE_WITH_UNIT&&r?.attribute_info?.input_type==K.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new gt(null),value:new gt(null,a)});i.addControl(JSON.stringify(r.attribute_id),d)}else i.addControl(JSON.stringify(r.attribute_id),this.formBuilder.control(null,a))}),i}getFilteredAttributes(n,i){let a=JSON.parse(JSON.stringify(n)),r=Object.keys(i),d=a.filter(C=>r.findIndex(ft=>parseInt(ft)==C.attribute_id||C.mandatory)!=-1);return d=this.filterSelectedAttributes(d,i),d}filterSelectedAttributes(n,i){return n.map(r=>{switch(r.attribute_info.input_type){case K.MULTI_COMBO_BOX:g.IsNotEmpty(i[r.attribute_id])?r.attribute_value_list=r.attribute_value_list.filter(d=>i[r.attribute_id]?.findIndex(C=>C==d.value_id)!=-1):r.attribute_value_list=[];break;case K.FREE_TEXT_FILED:r.attribute_info.format_type==ot.FORMAT_QUANTITATIVE_WITH_UNIT?r.attribute_value_list=this.setSelectedQuantitativeAttr(i[r.attribute_id]?.value,i[r.attribute_id]?.unit):g.IsNotEmpty(i[r.attribute_id])&&(r.attribute_value_list=[{value_id:0,name:i[r.attribute_id]}]);break;default:r.attribute_value_list=r.attribute_value_list.filter(d=>d.value_id==i[r.attribute_id])}return r}).filter(r=>r?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(n,i){let a=[];return g.IsNotEmpty(n)&&(a=[{value_id:0,original_value_name:JSON.stringify(n),value_unit:i}]),a}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();var bt=function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t}(bt||{});var vt=()=>[];function ne(t,o){t&1&&(m(0,"span",5),f(1,"*"),c())}function oe(t,o){if(t&1&&_(0,"ng-select",6),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:lt(4,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function re(t,o){if(t&1&&_(0,"input",8),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function ae(t,o){if(t&1&&(m(0,"option",15),f(1),c()),t&2){let e=o.$implicit;s("value",e),p(),at(e)}}function le(t,o){if(t&1&&(m(0,"div",10),_(1,"input",12),m(2,"select",13)(3,"option",14),f(4,"Unit"),c(),M(5,ae,2,2,"option",15,w),c()()),t&2){let e=l(3).$implicit;s("formGroupName",e.attribute_id),p(),s("placeholder","Isi "+(e==null?null:e.name)),p(2),s("value",null),p(2),U(e==null||e.attribute_info==null?null:e.attribute_info.attribute_unit_list)}}function ce(t,o){if(t&1&&_(0,"input",11),t&2){let e=l(3).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function me(t,o){if(t&1&&h(0,le,7,3,"div",10)(1,ce,1,2,"input",11),t&2){let e=l(2).$implicit,n=l(2);b((e==null||e.attribute_info==null?null:e.attribute_info.format_type)==n.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function pe(t,o){if(t&1&&_(0,"datepicker",9),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)}}function se(t,o){if(t&1&&h(0,re,1,2,"input",8)(1,me,2,1)(2,pe,1,1,"datepicker",9),t&2){let e,n=l().$implicit,i=l(2);b((e=n==null||n.attribute_info==null?null:n.attribute_info.input_validation_type)===i.validationType.VALIDATOR_STRING_TYPE?0:e===i.validationType.VALIDATOR_FLOAT_TYPE?1:e===i.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function de(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:lt(3,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function ue(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:lt(3,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function _e(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),h(2,ne,2,0,"span",5),m(3,"span"),f(4),c()(),h(5,oe,1,5,"ng-select",6)(6,se,3,1)(7,de,1,4,"ng-select",7)(8,ue,1,4,"ng-select",7),c()),t&2){let e,n=o.$implicit,i=l(2);p(2),b(n.mandatory?2:-1),p(2),Z(" ",n==null?null:n.name," "),p(),b((e=n==null||n.attribute_info==null?null:n.attribute_info.input_type)===i.inputType.MULTI_COMBO_BOX?5:e===i.inputType.FREE_TEXT_FILED?6:e===i.inputType.SINGLE_COMBO_BOX?7:8)}}function fe(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,_e,9,3,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var Zt=(()=>{let o=class o{constructor(){this.formCategoryService=u(Ct),this.attributesChanges=new k,this.inputType=K,this.formatType=ot,this.validationType=bt}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(P(n=>{this.form=this.formCategoryService.createFormGroup(n),this.listenToFormChange(n)}),tt(1)))}listenToFormChange(n){let i=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{i=this.formCategoryService.getFilteredAttributes(n,a),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([Ct]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,a){i&1&&(h(0,fe,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,G,R,B,J,wt,Mt,et,kt,L,X,z,Q,Ot,Yt,Qt,zt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]});let t=o;return t})();var yt=(()=>{let o=class o{constructor(){this.httpService=u(nt),this.formBuilder=u(q),this.uploadProductService=u(st)}getAttributes(n,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:i}]).pipe(It(r=>this.uploadProductService.selectedProduct$.pipe(E(d=>(r=this.mappingAttributeSalesProperty(r,d),r)))))}mappingAttributeSalesProperty(n,i){let a=0;return n.filter(r=>(r.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(r=>(r.type=="SALES_PROPERTY"&&(r.name="Jenis Variant",r.is_multiple_selection=!1,r.is_required=this.isProductHasMoreVariant(i),r.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),r))}isProductHasMoreVariant(n){let i=!1,a=[];return n.forEach(r=>{r.Variants&&a.push(r.Variants.length)}),i=a.some(r=>r>1),i}createFormGroup(n){let i=this.formBuilder.group({}),a=[];return n.forEach(r=>{a=[],r.is_required&&a.push(ct.required),i.addControl(r.id,this.formBuilder.control(null,a))}),i}getFilteredAttributes(n,i){let a=JSON.parse(JSON.stringify(n)),r=Object.keys(i),d=a.filter(C=>r.findIndex(ft=>parseInt(ft)==C.id)!=-1);return d=this.filterSelectedAttributes(d,i),d}filterSelectedAttributes(n,i){return n.map(r=>(g.IsNotEmpty(r.values)?r.is_multiple_selection?r.values=r.values.filter(d=>i[r.id]?.includes(d.id)):r.values=r.values.filter(d=>d.id==i[r.id]):i[r.id]&&(r.values=[{id:null,name:i[r.id]}]),r)).filter(r=>r?.values?.length>0)}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function he(t,o){t&1&&(m(0,"span",5),f(1,"*"),c())}function ge(t,o){if(t&1&&_(0,"ng-select",6),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Ce(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function be(t,o){if(t&1&&_(0,"input",8),t&2){let e=l().$implicit;s("formControlName",e.id)("placeholder",e==null?null:e.name)}}function ve(t,o){if(t&1&&(m(0,"small",5),f(1),c()),t&2){let e=l().$implicit;p(),Z(" ",e==null?null:e.name," is mandatory ")}}function ye(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),h(2,he,2,0,"span",5),m(3,"span"),f(4),c()(),h(5,ge,1,4,"ng-select",6)(6,Ce,1,3,"ng-select",7)(7,be,1,2,"input",8)(8,ve,2,1,"small",5),c()),t&2){let e=o.$implicit;p(2),b(e.is_required?2:-1),p(2),Z(" ",e==null?null:e.name," "),p(),b(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),p(3),b(e.is_required?8:-1)}}function xe(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,ye,9,4,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var Kt=(()=>{let o=class o{constructor(){this.tiktokAttributeFormService=u(yt),this.attributesChanges=new k}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(E(n=>n.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(g.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),P(n=>{this.form=this.tiktokAttributeFormService.createFormGroup(n),this.listenToFormChange(n)}),tt(1)))}listenToFormChange(n){let i=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{i=this.tiktokAttributeFormService.getFilteredAttributes(n,a),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([yt]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,a){i&1&&(h(0,xe,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,G,R,B,J,et,L,X,z,Q,it]});let t=o;return t})();var xt=(()=>{let o=class o{constructor(){this.woocommerceUploadService=u(pt)}getAttributes(n,i){return this.woocommerceUploadService.getAttributes(n,i).pipe(E(a=>a.map(r=>({key:r.name,label:r.name}))))}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();var te=(()=>{let o=class o{constructor(){this.wooAttributeFormService=u(xt),this.channelId=ht(),this.categoryId=ht(),this.attributesChanges=new k}ngOnChanges(){g.IsNotEmpty(this.categoryId())&&g.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(n){this.attributesChanges.emit([n.key])}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([xt]),O,T],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,a){i&1&&(m(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),c(),m(4,"ng-select",3),v(5,"async"),A("change",function(d){return a.onSelectAttribute(d)}),c()()()),i&2&&(p(4),s("items",y(5,1,a.attributes$)))},dependencies:[F,I,it,G,R,B]});let t=o;return t})();var St=(()=>{let o=class o{constructor(){this.httpService=u(nt),this.formBuilder=u(q)}getAttributes(n,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:i}]).pipe(E(r=>r))}createFormGroup(n){let i=this.formBuilder.group({});return n.forEach(a=>{i.addControl(a.variant,this.formBuilder.control(null))}),i}convertAttributes(n={}){return Object.values(n).filter(a=>a!==null).map(a=>JSON.stringify(a))}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function Se(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),f(2),c(),_(3,"ng-select",5),c()),t&2){let e=o.$implicit;p(2),Z(" ",e==null?null:e.variant," "),p(),s("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function Te(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,Se,4,4,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var ee=(()=>{let o=class o{constructor(){this.tokpedAttrFormService=u(St),this.attributesChanges=new k}ngOnInit(){}ngOnChanges(n){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(P(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let n=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{n=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([St]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,a){i&1&&(h(0,Te,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,G,R,B,J,L,X,z,Q]});let t=o;return t})();var Tt=(()=>{let o=class o{constructor(){this.httpService=u(nt),this.formBuilder=u(q)}getAttributes(n){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:n}]).pipe(P(a=>(a.Options.StatusOptions=a.Options.Status.map(r=>({id:r,name:r})),a)))}createFormGroup(n){let i=this.formBuilder.group({});return Object.keys(n.Attribute).forEach(r=>{i.addControl(r,this.formBuilder.control(null))}),i}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function Ie(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),f(5," Brand "),c(),_(6,"input",5),c(),m(7,"div",6)(8,"div",4),f(9," Product Type "),c(),_(10,"input",7),c(),m(11,"div",6)(12,"div",4),f(13," Status "),c(),_(14,"ng-select",8),c()()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(13),s("items",e.Options.StatusOptions)}}var ie=(()=>{let o=class o{constructor(){this.attributesChanges=new k,this.shopifyFormService=u(Tt)}ngOnChanges(n){n.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(P(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Ft(500)).subscribe(n=>{this.attributesChanges.emit([n])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([Tt]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,a){i&1&&(h(0,Ie,15,2,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,B,J,et,L,X,z,Q,G,R]});let t=o;return t})();function Fe(t,o){if(t&1&&(m(0,"div",6),_(1,"app-product-card",9),c()),t&2){let e=o.$implicit;p(),s("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function Ae(t,o){if(t&1){let e=H();V(0),m(1,"mat-checkbox",21),Pt("ngModelChange",function(i){W(e);let a=l().$implicit;return Et(a.selected,i)||(a.selected=i),Y(i)}),A("ngModelChange",function(){let i=W(e).ngIf,a=l(),r=a.$implicit,d=a.$index,C=l();return Y(C.onSelectChannel(r,d,i))}),c(),D()}if(t&2){let e=l().$implicit;p(),At("ngModel",e.selected)}}function Ee(t,o){t&1&&(m(0,"div",18),_(1,"input",22),c())}function Pe(t,o){if(t&1){let e=H();m(0,"app-channel-category-select",23),A("selectedCategory",function(i){W(e);let a=l().$index,r=l();return Y(r.onCategoryChange(a,i))}),c()}if(t&2){let e=l().$implicit,n=l();s("disabled",!e.selected||e.selected&&e.type==n.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function Ne(t,o){if(t&1){let e=H();m(0,"shopee-attribute-form",27),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function Oe(t,o){if(t&1){let e=H();m(0,"tiktok-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function ke(t,o){if(t&1){let e=H();m(0,"wooocommerce-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function we(t,o){if(t&1){let e=H();m(0,"tokopedia-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function Me(t,o){if(t&1&&(m(0,"div",20)(1,"div",24),h(2,Ne,1,3,"shopee-attribute-form",25)(3,Oe,1,2,"tiktok-attribute-form",26)(4,ke,1,2,"wooocommerce-attribute-form",26)(5,we,1,2,"tokopedia-attribute-form",26),c()()),t&2){let e,n=l().$implicit,i=l();p(2),b((e=n.type)===i.channelType.Shopee?2:e===i.channelType.Tiktok?3:e===i.channelType.WooCommerce?4:e===i.channelType.Tokopedia?5:-1)}}function Ue(t,o){if(t&1){let e=H();m(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),A("attributesChanges",function(i){W(e);let a=l().$index,r=l();return Y(r.onAttributesChange(a,i))}),c()()()}if(t&2){let e=l().$implicit;p(2),s("channelId",e.id)}}function Ve(t,o){if(t&1&&(m(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),h(6,Ae,2,1,"ng-container",14),v(7,"async"),c(),m(8,"div"),_(9,"app-channel-logo",15),c(),m(10,"div",16)(11,"span"),f(12),c()()()(),m(13,"div",12)(14,"div",17),h(15,Ee,2,0,"div",18)(16,Pe,1,4,"app-channel-category-select",19),c()()(),h(17,Me,6,1,"div",20)(18,Ue,3,1,"div",20),c()()),t&2){let e=o.$implicit,n=l();p(6),s("ngIf",y(7,8,n.defaultCategories$)),p(3),s("typeId",e.type)("showChannelName",!1),p(),s("matTooltip",e.name)("matTooltipShowDelay",2500),p(2),at(e.name),p(3),b(e.type==n.channelType.Shopify||e.type==n.channelType.Plugo?15:16),p(2),b(e.categoryId&&n.channelType.Lazada!=e.type&&e.selected?17:n.channelType.Shopify==e.type&&e.selected?18:-1)}}var oo=(()=>{let o=class o{constructor(){this.uploadProductService=u(st),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ut,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(tt(1))}onCategoryChange(n,i){this.channelProductUploads.update(a=>a.map((r,d)=>(d==n&&(r.categoryId=i,r.attributes=[]),r)))}onAttributesChange(n,i){this.channelProductUploads.update(a=>a.map((r,d)=>(d==n&&(r.attributes=i),r)))}onSelectChannel(n,i,a){this.channelProductUploads.update(r=>r.map((d,C)=>{if(C==i&&n.selected){let _t=this.findCategoryByChannelId(n.id,a);d.categoryId=_t?.DefaultCategoryID}return C==i&&!n.selected&&(d.categoryId=null),d}))}findCategoryByChannelId(n,i){return i.find(a=>a.ID===n)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["app-product-upload"]],standalone:!0,features:[S([mt,Gt,jt,pt]),T],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltip","Cannot change category, please change category in admin.shopify.com","matTooltipPosition","above"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,a){if(i&1&&(m(0,"mainpanel",0)(1,"actions")(2,"button",1),A("click",function(){return a.onUploadProduct()}),_(3,"i",2),f(4," Upload "),c()(),m(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),c(),m(9,"div",5),M(10,Fe,2,7,"div",6,w),v(12,"async"),c(),m(13,"h3",7),f(14,"Channel To Upload"),c(),M(15,Ve,19,10,"div",8,w),c()()()),i&2){let r;s("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),s("disabled",((r=a.channelProductUploads())==null?null:r.length)==0),p(8),U(y(12,3,a.selectedProducts$)),p(5),U(a.channelProductUploads())}},dependencies:[F,$,I,Ht,Lt,$t,Jt,Xt,Rt,Bt,it,L,Nt,Dt,Vt,Zt,Kt,te,ee,ie,Wt,qt],encapsulation:2});let t=o;return t})();export{oo as ProductUploadComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as Q}from"./chunk-E3NPUJ23.js";import{a as We,b as he,c as $e,d as ze,e as pe,f as Ke,g as fe,h as Ge,i as U,j as ge,k as y}from"./chunk-KCDL7SWP.js";import{b as de,c as Y,d as Ue}from"./chunk-64G3XLI6.js";import{o as He}from"./chunk-OVEJFFL6.js";import{Cd as Be,Ed as Le,F as Re,Fd as Fe,G as xe,Kc as Me,Lc as Ne,O as ae,U as _e,Ua as $,Yc as ue,Z as ce,aa as x,ba as le,c as g,ea as L,f as X,j as Ee,ja as A,k as Pe,ka as H,ma as T,n as B,o as F,oa as h,p as _,pa as Oe,q as G,qa as je,sb as z,ua as W,v as D,w as De}from"./chunk-PQDPS2ID.js";import{a as se,i as b}from"./chunk-GNOSNGXM.js";var Ve={production:!0,version:"5.30.
|
|
1
|
+
import{e as Q}from"./chunk-E3NPUJ23.js";import{a as We,b as he,c as $e,d as ze,e as pe,f as Ke,g as fe,h as Ge,i as U,j as ge,k as y}from"./chunk-KCDL7SWP.js";import{b as de,c as Y,d as Ue}from"./chunk-64G3XLI6.js";import{o as He}from"./chunk-OVEJFFL6.js";import{Cd as Be,Ed as Le,F as Re,Fd as Fe,G as xe,Kc as Me,Lc as Ne,O as ae,U as _e,Ua as $,Yc as ue,Z as ce,aa as x,ba as le,c as g,ea as L,f as X,j as Ee,ja as A,k as Pe,ka as H,ma as T,n as B,o as F,oa as h,p as _,pa as Oe,q as G,qa as je,sb as z,ua as W,v as D,w as De}from"./chunk-PQDPS2ID.js";import{a as se,i as b}from"./chunk-GNOSNGXM.js";var Ve={production:!0,version:"5.30.4",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var St="firebase",vt="10.12.1";U(St,vt,"app");var q=new Me("ANGULARFIRE2_VERSION");var kt=(n,o)=>{let t=o?[o]:Ge(),e=[];return t.forEach(r=>{r.container.getProvider(n).instances.forEach(s=>{e.includes(s)||e.push(s)})}),e},V=class{constructor(){return kt(wt)}},wt="app-check";function me(){}var ee=class{zone;delegate;constructor(o,t=Pe){this.zone=o,this.delegate=t}now(){return this.delegate.now()}schedule(o,t,e){let r=this.zone,i=function(s){r.runGuarded(()=>{o.apply(this,[s])})};return this.delegate.schedule(i,t,e)}},Se=class{zone;task=null;constructor(o){this.zone=o}call(o,t){let e=this.unscheduleTask.bind(this);return this.task=this.zone.run(()=>Zone.current.scheduleMacroTask("firebaseZoneBlock",me,{},me,me)),t.pipe(L({next:e,complete:e,error:e})).subscribe(o).add(e)}unscheduleTask(){setTimeout(()=>{this.task!=null&&this.task.state==="scheduled"&&(this.task.invoke(),this.task=null)},10)}},qe=(()=>{class n{ngZone;outsideAngular;insideAngular;constructor(t){this.ngZone=t,this.outsideAngular=t.runOutsideAngular(()=>new ee(Zone.current)),this.insideAngular=t.run(()=>new ee(Zone.current,Ee)),globalThis.\u0275AngularFireScheduler||=this}static \u0275fac=function(e){return new(e||n)(h(z))};static \u0275prov=A({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function At(){let n=globalThis.\u0275AngularFireScheduler;if(!n)throw new Error(`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
|
|
2
2
|
provideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).`);return n}function Je(n){return It(At())(n)}function It(n){return function(t){return t=t.lift(new Se(n.ngZone)),t.pipe(F(n.outsideAngular),B(n.insideAngular))}}var C=function(n){return n.USER="user",n.CHANNELS="channels",n.AUTHORIZATION="Authorization",n.INTERCOM="Intercom",n}(C||{});var Ze=(()=>{let o=class o{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let r=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return r||[]}ParseToken(e){try{let i=e.split(".")[0].replace("-","+").replace("_","/"),s=JSON.parse(window.atob(i)),c=e.split(".")[1].replace("-","+").replace("_","/"),l=JSON.parse(window.atob(c));return l.header=s,l}catch{return!1}}};o.\u0275fac=function(r){return new(r||o)},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let n=o;return n})();var Ct=new Map,yt={activated:!1,tokenObservers:[]},Et={initialized:!1,enabled:!1};function E(n){return Ct.get(n)||Object.assign({},yt)}function tt(){return Et}var Pt="https://content-firebaseappcheck.googleapis.com/v1";var Dt="exchangeDebugToken",Xe={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},bo=24*60*60*1e3;var ke=class{constructor(o,t,e,r,i){if(this.operation=o,this.retryPolicy=t,this.getWaitDuration=e,this.lowerBound=r,this.upperBound=i,this.pending=null,this.nextErrorWaitInterval=r,r>i)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(o){return b(this,null,function*(){this.stop();try{this.pending=new he,this.pending.promise.catch(t=>{}),yield Rt(this.getNextRun(o)),this.pending.resolve(),yield this.pending.promise,this.pending=new he,this.pending.promise.catch(t=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(t){this.retryPolicy(t)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(o){if(o)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let t=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),t}}};function Rt(n){return new Promise(o=>{setTimeout(o,n)})}var xt={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"},j=new ze("appCheck","AppCheck",xt);function nt(n){if(!E(n).activated)throw j.create("use-before-activation",{appName:n.name})}function rt(e,r){return b(this,arguments,function*({url:n,body:o},t){let i={"Content-Type":"application/json"},s=t.getImmediate({optional:!0});if(s){let f=yield s.getHeartbeatsHeader();f&&(i["X-Firebase-Client"]=f)}let a={method:"POST",body:JSON.stringify(o),headers:i},c;try{c=yield fetch(n,a)}catch(f){throw j.create("fetch-network-error",{originalErrorMessage:f?.message})}if(c.status!==200)throw j.create("fetch-status-error",{httpStatus:c.status});let l;try{l=yield c.json()}catch(f){throw j.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=l.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw j.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${l.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:l.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function ot(n,o){let{projectId:t,appId:e,apiKey:r}=n.options;return{url:`${Pt}/projects/${t}/apps/${e}:${Dt}?key=${r}`,body:{debug_token:o}}}var _t="firebase-app-check-database",Ot=1,we="firebase-app-check-store";var te=null;function jt(){return te||(te=new Promise((n,o)=>{try{let t=indexedDB.open(_t,Ot);t.onsuccess=e=>{n(e.target.result)},t.onerror=e=>{var r;o(j.create("storage-open",{originalErrorMessage:(r=e.target.error)===null||r===void 0?void 0:r.message}))},t.onupgradeneeded=e=>{let r=e.target.result;switch(e.oldVersion){case 0:r.createObjectStore(we,{keyPath:"compositeKey"})}}}catch(t){o(j.create("storage-open",{originalErrorMessage:t?.message}))}}),te)}function Mt(n,o){return Nt(Bt(n),o)}function Nt(n,o){return b(this,null,function*(){let e=(yield jt()).transaction(we,"readwrite"),i=e.objectStore(we).put({compositeKey:n,value:o});return new Promise((s,a)=>{i.onsuccess=c=>{s()},e.onerror=c=>{var l;a(j.create("storage-set",{originalErrorMessage:(l=c.target.error)===null||l===void 0?void 0:l.message}))}})})}function Bt(n){return`${n.options.appId}-${n.name}`}var Ae=new Ke("@firebase/app-check");function ve(n,o){return $e()?Mt(n,o).catch(t=>{Ae.warn(`Failed to write token to IndexedDB. Error: ${t}`)}):Promise.resolve()}function it(){return tt().enabled}function st(){return b(this,null,function*(){let n=tt();if(n.enabled&&n.token)return n.token.promise;throw Error(`
|
|
3
3
|
Can't get debug token in production mode.
|
|
4
4
|
`)})}var Lt={error:"UNKNOWN_ERROR"};function Ft(n){return We.encodeString(JSON.stringify(n),!1)}function Ie(n,o=!1){return b(this,null,function*(){let t=n.app;nt(t);let e=E(t),r=e.token,i;if(r&&!J(r)&&(e.token=void 0,r=void 0),!r){let c=yield e.cachedTokenPromise;c&&(J(c)?r=c:yield ve(t,void 0))}if(!o&&r&&J(r))return{token:r.token};let s=!1;if(it()){e.exchangeTokenPromise||(e.exchangeTokenPromise=rt(ot(t,yield st()),n.heartbeatServiceProvider).finally(()=>{e.exchangeTokenPromise=void 0}),s=!0);let c=yield e.exchangeTokenPromise;return yield ve(t,c),e.token=c,{token:c.token}}try{e.exchangeTokenPromise||(e.exchangeTokenPromise=e.provider.getToken().finally(()=>{e.exchangeTokenPromise=void 0}),s=!0),r=yield E(t).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"?Ae.warn(c.message):Ae.error(c),i=c}let a;return r?i?J(r)?a={token:r.token,internalError:i}:a=Qe(i):(a={token:r.token},e.token=r,yield ve(t,r)):a=Qe(i),s&&zt(t,a),a})}function Ht(n){return b(this,null,function*(){let o=n.app;nt(o);let{provider:t}=E(o);if(it()){let e=yield st(),{token:r}=yield rt(ot(o,e),n.heartbeatServiceProvider);return{token:r}}else{let{token:e}=yield t.getToken();return{token:e}}})}function Wt(n,o,t,e){let{app:r}=n,i=E(r),s={next:t,error:e,type:o};if(i.tokenObservers=[...i.tokenObservers,s],i.token&&J(i.token)){let a=i.token;Promise.resolve().then(()=>{t({token:a.token}),Ye(n)}).catch(()=>{})}i.cachedTokenPromise.then(()=>Ye(n))}function at(n,o){let t=E(n),e=t.tokenObservers.filter(r=>r.next!==o);e.length===0&&t.tokenRefresher&&t.tokenRefresher.isRunning()&&t.tokenRefresher.stop(),t.tokenObservers=e}function Ye(n){let{app:o}=n,t=E(o),e=t.tokenRefresher;e||(e=$t(n),t.tokenRefresher=e),!e.isRunning()&&t.isTokenAutoRefreshEnabled&&e.start()}function $t(n){let{app:o}=n;return new ke(()=>b(this,null,function*(){let t=E(o),e;if(t.token?e=yield Ie(n,!0):e=yield Ie(n),e.error)throw e.error;if(e.internalError)throw e.internalError}),()=>!0,()=>{let t=E(o);if(t.token){let e=t.token.issuedAtTimeMillis+(t.token.expireTimeMillis-t.token.issuedAtTimeMillis)*.5+3e5,r=t.token.expireTimeMillis-5*60*1e3;return e=Math.min(e,r),Math.max(0,e-Date.now())}else return 0},Xe.RETRIAL_MIN_WAIT,Xe.RETRIAL_MAX_WAIT)}function zt(n,o){let t=E(n).tokenObservers;for(let e of t)try{e.type==="EXTERNAL"&&o.error!=null?e.error(o.error):e.next(o)}catch{}}function J(n){return n.expireTimeMillis-Date.now()>0}function Qe(n){return{token:Ft(Lt),error:n}}var be=class{constructor(o,t){this.app=o,this.heartbeatServiceProvider=t}_delete(){let{tokenObservers:o}=E(this.app);for(let t of o)at(this.app,t.next);return Promise.resolve()}};function Kt(n,o){return new be(n,o)}function Gt(n){return{getToken:o=>Ie(n,o),getLimitedUseToken:()=>Ht(n),addTokenListener:o=>Wt(n,"INTERNAL",o),removeTokenListener:o=>at(n.app,o)}}var Ut="@firebase/app-check",Vt="0.8.4";var qt="app-check",et="app-check-internal";function Jt(){fe(new pe(qt,n=>{let o=n.getProvider("app").getImmediate(),t=n.getProvider("heartbeat");return Kt(o,t)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((n,o,t)=>{n.getProvider(et).initialize()})),fe(new pe(et,n=>{let o=n.getProvider("app-check").getImmediate();return Gt(o)},"PUBLIC").setInstantiationMode("EXPLICIT")),U(Ut,Vt)}Jt();var Zt=["localhost","0.0.0.0","127.0.0.1"],Mo=typeof window<"u"&&Zt.includes(window.location.hostname);var Yt="firebase",Qt="10.12.1";y.registerVersion(Yt,Qt,"app-compat");var en=["ngOnDestroy"],lt=(n,o,t,e={})=>new Proxy(n,{get:(r,i)=>t.runOutsideAngular(()=>{if(n[i])return e?.spy?.get&&e.spy.get(i,n[i]),n[i];if(en.indexOf(i)>-1)return()=>{};let s=o.toPromise().then(a=>{let c=a?.[i];return typeof c=="function"?c.bind(a):c?.then?c.then(l=>t.run(()=>l)):t.run(()=>c)});return new Proxy(()=>{},{get:(a,c)=>s[c],apply:(a,c,l)=>s.then(d=>{let u=d?.(...l);return e?.spy?.apply&&e.spy.apply(i,l,u),u})})})});var ne=class{constructor(o){return o}},re=new T("angularfire2.app.options"),oe=new T("angularfire2.app.name");function Te(n,o,t){let e=typeof t=="string"&&t||"[DEFAULT]",r=typeof t=="object"&&t||{};r.name=r.name||e;let s=y.apps.filter(a=>a&&a.name===r.name)[0]||o.runOutsideAngular(()=>y.initializeApp(n,r));try{if(JSON.stringify(n)!==JSON.stringify(s.options)){let a=!!module.hot;tn("error",`${s.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new ne(s)}var tn=(n,...o)=>{ue()&&typeof console<"u"&&console[n](...o)},nn={provide:ne,useFactory:Te,deps:[re,z,[new je,oe]]},Uo=(()=>{class n{static initializeApp(t,e){return{ngModule:n,providers:[{provide:re,useValue:t},{provide:oe,useValue:e}]}}constructor(t){y.registerVersion("angularfire",q.full,"core"),y.registerVersion("angularfire",q.full,"app-compat"),y.registerVersion("angular",Ne.full,t.toString())}static \u0275fac=function(e){return new(e||n)(h($))};static \u0275mod=W({type:n});static \u0275inj=H({providers:[nn]})}return n})();function ut(n,o,t,e,r){let[,i,s]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===n)||[];if(i)return rn(r,s)||(ct("error",`${o} was already initialized on the ${t} Firebase App with different settings.${on?" You may need to reload as Firebase is not HMR aware.":""}`),ct("warn",{is:r,was:s})),i;{let a=e();return globalThis.\u0275AngularfireInstanceCache.push([n,a,r]),a}}function rn(n,o){try{return n.toString()===o.toString()}catch{return n===o}}var on=typeof module<"u"&&!!module.hot,ct=(n,...o)=>{ue()&&typeof console<"u"&&console[n](...o)};globalThis.\u0275AngularfireInstanceCache||=[];var sn=new T("angularfire2.auth.use-emulator"),an=new T("angularfire2.auth.settings"),cn=new T("angularfire2.auth.tenant-id"),ln=new T("angularfire2.auth.langugage-code"),un=new T("angularfire2.auth.use-device-language"),dn=new T("angularfire.auth.persistence"),hn=(n,o,t,e,r,i,s,a)=>ut(`${n.name}.auth`,"AngularFireAuth",n.name,()=>{let c=o.runOutsideAngular(()=>n.auth());if(t&&c.useEmulator(...t),e&&(c.tenantId=e),c.languageCode=r,i&&c.useDeviceLanguage(),s)for(let[l,d]of Object.entries(s))c.settings[l]=d;return a&&c.setPersistence(a),c},[t,e,r,i,s,a]),Ce=(()=>{class n{authState;idToken;user;idTokenResult;credential;constructor(t,e,r,i,s,a,c,l,d,u,p,f){let K=new X,M=G(void 0).pipe(B(s.outsideAngular),x(()=>i.runOutsideAngular(()=>import("./chunk-F4WIW6HA.js"))),D(()=>Te(t,i,e)),D(P=>hn(P,i,a,l,d,u,c,p)),ce({bufferSize:1,refCount:!1}));if(Fe(r))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=G(null);else{M.pipe(_e()).subscribe();let P=M.pipe(x(S=>S.getRedirectResult().then(R=>R,()=>null)),Je,ce({bufferSize:1,refCount:!1})),Z=M.pipe(x(S=>new g(R=>({unsubscribe:i.runOutsideAngular(()=>S.onAuthStateChanged(N=>R.next(N),N=>R.error(N),()=>R.complete()))})))),ie=M.pipe(x(S=>new g(R=>({unsubscribe:i.runOutsideAngular(()=>S.onIdTokenChanged(N=>R.next(N),N=>R.error(N),()=>R.complete()))}))));this.authState=P.pipe(le(Z),F(s.outsideAngular),B(s.insideAngular)),this.user=P.pipe(le(ie),F(s.outsideAngular),B(s.insideAngular)),this.idToken=this.user.pipe(x(S=>S?_(S.getIdToken()):G(null))),this.idTokenResult=this.user.pipe(x(S=>S?_(S.getIdTokenResult()):G(null))),this.credential=Re(P,K,this.authState.pipe(xe(S=>!S))).pipe(D(S=>S?.user?S:null),F(s.outsideAngular),B(s.insideAngular))}return lt(this,M,i,{spy:{apply:(P,Z,ie)=>{(P.startsWith("signIn")||P.startsWith("createUser"))&&ie.then(S=>K.next(S))}}})}static \u0275fac=function(e){return new(e||n)(h(re),h(oe,8),h($),h(z),h(qe),h(sn,8),h(an,8),h(cn,8),h(ln,8),h(un,8),h(dn,8),h(V,8))};static \u0275prov=A({token:n,factory:n.\u0275fac,providedIn:"any"})}return n})(),ai=(()=>{class n{constructor(){y.registerVersion("angularfire",q.full,"auth-compat")}static \u0275fac=function(e){return new(e||n)};static \u0275mod=W({type:n});static \u0275inj=H({providers:[Ce]})}return n})();function m(n,o,t,e){return new Promise((r,i)=>{n||i("IndexedDB not available");let s=n.open(o,t),a;s.onsuccess=c=>{a=s.result,r(a)},s.onerror=c=>{i(`IndexedDB error: ${s.error}`)},typeof e=="function"&&(s.onupgradeneeded=c=>{e(c,a)})})}function dt(n,o,t,e,r){if(!n)return;let i=n.open(o,t);i.onupgradeneeded=s=>{let a=s.target.result;e.forEach(l=>{if(!a.objectStoreNames.contains(l.store)){let d=a.createObjectStore(l.store,l.storeConfig);l.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let c=r&&r();c&&Object.keys(c).map(l=>parseInt(l,10)).filter(l=>l>s.oldVersion).sort((l,d)=>l-d).forEach(l=>{c[l](a,i.transaction)}),a.close()},i.onsuccess=s=>{s.target.result.close()}}function fn(n,o,t){if(!n||!o||!t)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(e=>{try{let r=o+1,i=indexedDB.open(n,r);i.onupgradeneeded=s=>{let a=s.target.result;a.deleteObjectStore(t),a.close(),console.log("onupgradeneeded"),e.next(!0),e.complete()},i.onerror=s=>e.error(s)}catch(r){e.error(r)}})}function gn(n,o){return n.objectStoreNames.contains(o)}function I(n,o,t){n||t("You need to use the openDatabase function to create a database before you query it!"),gn(n,o)||t(`objectStore does not exists: ${o}`)}function k(n,o){let t=n.transaction(o.storeName,o.dbMode);return t.onerror=o.error,t.onabort=o.abort,t}function w(n,o,t,e){return{storeName:o,dbMode:n,error:r=>{t(r)},abort:r=>{t(r)}}}var v=function(n){return n.readonly="readonly",n.readwrite="readwrite",n}(v||{}),ht=new T(null),ye=(()=>{class n{constructor(t,e){if(this.dbConfig=t,this.platformId=e,!t.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!t.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=Le(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,dt(this.indexedDB,t.name,t.version,t.objectStoresMeta,t.migrationFactory),m(this.indexedDB,t.name).then(r=>{r.version!==t.version&&(this.dbConfig.version=r.version)}))}createObjectStore(t,e){let r=[t];dt(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,r,e)}add(t,e,r){return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{let c=k(s,w(v.readwrite,t,d=>i.error(d))).objectStore(t),l=r?c.add(e,r):c.add(e);l.onsuccess=d=>b(this,null,function*(){let u=d.target.result,p=c.get(u);p.onsuccess=f=>{i.next(f.target.result),i.complete()}})}).catch(s=>i.error(s))})}bulkAdd(t,e){let r=new Promise((i,s)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{let l=k(a,w(v.readwrite,t,i,s)).objectStore(t),d=e.map(u=>new Promise((p,f)=>{let K=u.key;delete u.key;let M=K?l.add(u,K):l.add(u);M.onsuccess=P=>{let Z=P.target.result;p(Z)}}));i(Promise.all(d))}).catch(a=>s(a))});return _(r)}bulkDelete(t,e){let r=e.map(i=>new Promise((s,a)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(c=>{let l=k(c,w(v.readwrite,t,a,s));l.objectStore(t).delete(i),l.oncomplete=()=>{this.getAll(t).pipe(ae(1)).subscribe(u=>{s(u)})}}).catch(c=>a(c))}));return _(Promise.all(r))}getByKey(t,e){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{let c=k(i,w(v.readonly,t,r.error)).objectStore(t).get(e);c.onsuccess=l=>{r.next(l.target.result),r.complete()},c.onerror=l=>{r.error(l)}}).catch(i=>r.error(i))})}bulkGet(t,e){let r=e.map(i=>this.getByKey(t,i));return new g(i=>{De(r).subscribe(s=>{i.next(s),i.complete()})})}getByID(t,e){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{I(i,t,l=>r.error(l));let c=k(i,w(v.readonly,t,r.error,r.next)).objectStore(t).get(e);c.onsuccess=l=>{r.next(l.target.result)}}).catch(i=>r.error(i))})}getByIndex(t,e,r){return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{I(s,t,u=>i.error(u));let d=k(s,w(v.readonly,t,i.error)).objectStore(t).index(e).get(r);d.onsuccess=u=>{i.next(u.target.result),i.complete()}}).catch(s=>i.error(s))})}getAll(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{I(r,t,c=>e.error(c));let a=k(r,w(v.readonly,t,e.error,e.next)).objectStore(t).getAll();a.onerror=c=>{e.error(c)},a.onsuccess=({target:{result:c}})=>{e.next(c),e.complete()}}).catch(r=>e.error(r))})}update(t,e){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{I(i,t,l=>r.error(l));let a=k(i,w(v.readwrite,t,l=>r.error(l))).objectStore(t),c=a.put(e);c.onsuccess=l=>b(this,null,function*(){let d=l.target.result,u=a.get(d);u.onsuccess=p=>{r.next(p.target.result),r.complete()}})}).catch(i=>r.error(i))})}delete(t,e){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{I(i,t,c=>r.error(c));let s=k(i,w(v.readwrite,t,c=>r.error(c)));s.objectStore(t).delete(e),s.oncomplete=()=>{this.getAll(t).pipe(ae(1)).subscribe(c=>{r.next(c),r.complete()})}}).catch(i=>r.error(i))})}deleteByKey(t,e){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{I(i,t,c=>r.error(c));let s=k(i,w(v.readwrite,t,c=>r.error(c))),a=s.objectStore(t);s.oncomplete=()=>{r.next(!0),r.complete()},a.delete(e)}).catch(i=>r.error(i))})}clear(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{I(r,t,a=>e.error(a));let i=k(r,w(v.readwrite,t,a=>e.error(a)));i.objectStore(t).clear(),i.oncomplete=()=>{e.next(!0),e.complete()}}).catch(r=>e.error(r))})}deleteDatabase(){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(e=>b(this,null,function*(){yield e.close();let r=this.indexedDB.deleteDatabase(this.dbConfig.name);r.onsuccess=()=>{t.next(!0),t.complete()},r.onerror=i=>t.error(i),r.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(e=>t.error(e))})}openCursor(t,e){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{I(i,t,l=>r.error(l));let a=k(i,w(v.readonly,t,r.error)).objectStore(t),c=e===void 0?a.openCursor():a.openCursor(e);c.onsuccess=l=>{r.next(l),r.complete()}}).catch(i=>r.error(i))})}openCursorByIndex(t,e,r,i=v.readonly){let s=new X;return m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{I(a,t,p=>{s.error(p)});let u=k(a,w(i,t,p=>{s.error(p)},()=>{s.next()})).objectStore(t).index(e).openCursor(r);u.onsuccess=p=>{s.next(p)}}).catch(a=>s.error(a)),s}getAllByIndex(t,e,r){let i=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{I(a,t,p=>s.error(p));let u=k(a,w(v.readonly,t,s.error)).objectStore(t).index(e).openCursor(r);u.onsuccess=p=>{let f=p.target.result;f?(i.push(f.value),f.continue()):(s.next(i),s.complete())}}).catch(a=>s.error(a))})}getAllKeysByIndex(t,e,r){let i=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{I(a,t,p=>s.error(p));let u=k(a,w(v.readonly,t,s.error)).objectStore(t).index(e).openKeyCursor(r);u.onsuccess=p=>{let f=p.target.result;f?(i.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(s.next(i),s.complete())}}).catch(a=>s.error(a))})}count(t,e){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{I(i,t,l=>r.error(l));let c=k(i,w(v.readonly,t,r.error)).objectStore(t).count(e);c.onerror=l=>r.error(l),c.onsuccess=l=>{r.next(l.target.result),r.complete()}}).catch(i=>r.error(i))})}countByIndex(t,e,r){return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{I(s,t,u=>i.error(u));let d=k(s,w(v.readonly,t,i.error)).objectStore(t).index(e).count(r);d.onerror=u=>i.error(u),d.onsuccess=u=>{i.next(u.target.result),i.complete()}}).catch(s=>i.error(s))})}deleteObjectStore(t){return fn(this.dbConfig.name,++this.dbConfig.version,t)}}return n.\u0275fac=function(t){return new(t||n)(h(ht),h($))},n.\u0275prov=A({token:n,factory:n.\u0275fac}),n})(),gi=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[ye,{provide:ht,useValue:t}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=W({type:n}),n.\u0275inj=H({imports:[[Be]]}),n})();var pt=(()=>{let o=class o{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,r){let i=this.getKey(r);return this.db.add(this.DATABASE,e,i).pipe(D(s=>e))}getCategoriesByChannelType(e){let r=this.getKey(e);return this.db.getByKey(this.DATABASE,r)}getKey(e){let r="";switch(e){case de.Lazada:r="Lazada";break;case de.Tokopedia:r="Tokopedia";break}return r}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let e=localStorage.getItem("Authorization");return this.hostName=JSON.parse(e)?.Host,this.hostName}};o.\u0275fac=function(r){return new(r||o)(h(ye))},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let n=o;return n})();var ft=(()=>{let o=class o{constructor(){}inititalizeIntercom(){let e=this.getFromLocalStorage();e?.Enabled&&window.Intercom("boot",{app_id:"xv1oomgl",name:e.Name,email:e.Email,created_at:e.Created,user_hash:e.Hash})}shutdown(){this.getFromLocalStorage()?.Enabled&&(window.Intercom("shutdown"),this.clearStorage())}clearStorage(){localStorage.removeItem("Intercom")}updateLocalStorage(e){let r={Enabled:!0};e&&(r=se(se({},r),e)),localStorage.setItem("Intercom",JSON.stringify(r))}getFromLocalStorage(){let e=localStorage.getItem("Intercom");return JSON.parse(e)}hideLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!0}),e.hide_default_launcher=!0,this.updateLocalStorage(e))}showLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!1}),e.hide_default_launcher=!1,this.updateLocalStorage(e))}isHideLauncher(){let e=this.getFromLocalStorage();return Y.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}};o.\u0275fac=function(r){return new(r||o)},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let n=o;return n})();var gt=(()=>{let o=class o{};o.SubmitConfig="/api/Channel/SubmitConfig",o.PosAccountTest="/api/POSAccount/Test",o.PosAccountRemove="/api/POSAccount/Remove",o.PosAccountGetConfig="/api/ChannelLoader/GetConfig",o.ChannelGetLastSyncByID="/api/Channel/GetLastSyncByID",o.GetChannel="/api/Channel/GetChannel",o.GetChannelLoader="/api/ChannelLoader/GetChannelLoader",o.TestShopID="/api/Channel/TestShopID",o.UpdateChannelIndex="/api/Channel/UpdateChannelIndex",o.DeleteChannel="/api/Channel/DeleteChannel",o.GetRegisterByOutletName="/api/Channel/GetRegistersByOutletOrder",o.GetChannelRowCount="/api/Channel/GetCountChannel",o.GetChannelWarehouse="/api/Channel/GetChannelWarehouseLocation",o.UnSynchronizedWarehouse="/api/Channel/UnSynchronizedWarehouse",o.GetChannelDetail="/api/ChannelLoader/GetChannelView",o.GetOrderPreview="/api/Orders/Preview",o.GetOrderPreviewV2="/api/Orders/PreviewV2",o.GetDownloadOrder="/api/Orders/Download",o.GetDownloadOrderV2="/api/Orders/DownloadV2",o.ShopeeV2_URL="/api/ChannelAuthorization/ShopeeV2_URL",o.Tiktok_URL="/api/ChannelAuthorization/Tiktok_URL",o.Lazada_URL="/api/ChannelAuthorization/Lazada_URL",o.AddTokopedia="/api/ChannelAdd/Tokopedia",o.AddShopify="/api/ChannelAdd/AddShopify",o.AddWoocommerce="/api/ChannelAdd/AddWooCommerce",o.AddPlugo="/api/ChannelAdd/Plugo",o.UploadPlugoProduct="/api/product/plugo/AddProduct",o.RefreshToken="/api/RefreshToken",o.RefreshInventory="/api/Inventory/RefreshInventory";let n=o;return n})();var mt=(()=>{let o=class o{constructor(){this.httpService=Oe(Q)}refreshToken(){return this.httpService.get(gt.RefreshToken).pipe(L(e=>{this.updateTokenInLocalStorage(e)}))}updateTokenInLocalStorage(e){this.saveUserToLocalStorage(e),this.saveChannelsToLocalStorage(e.Channels)}saveUserToLocalStorage(e){let r=JSON.stringify(e);localStorage.setItem(C.USER,r)}getUser(){let e=localStorage.getItem(C.USER);return e?JSON.parse(e):null}saveChannelsToLocalStorage(e){let r=JSON.stringify(e);localStorage.setItem(C.CHANNELS,r)}getChannels(){let e=localStorage.getItem(C.CHANNELS);return e?JSON.parse(e):[]}clearStorage(){localStorage.removeItem(C.USER),localStorage.removeItem(C.CHANNELS)}};o.\u0275fac=function(r){return new(r||o)},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let n=o;return n})();var Ni=(()=>{let o=class o{constructor(e,r,i,s,a,c,l,d){this.httpService=e,this.tokenDecodeService=r,this.afAuth=i,this.ngxPermission=s,this.localDataService=a,this.router=c,this.intercomService=l,this.tokenService=d}login(e){return this.httpService.post("/api/token/Login",e).pipe(L(r=>{this.setLocalStorage(r,e.Host,e.Username),this.loadPermissions()}))}getNews(){return this.httpService.get(Ve.news).pipe(D(e=>e?.items?.map(r=>r?.properties)))}loginWithGoogle(e,r){e.preventDefault();let i=new ge;return i.setCustomParameters({prompt:"select_account"}),_(this.afAuth.signInWithPopup(i)).pipe(D(s=>s.credential),D(s=>s.idToken),x(s=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:s,Host:r}))),L(s=>{this.setLocalStorage(s,r,null),this.loadPermissions()}))}setLocalStorage(e,r,i){this.tokenService.updateTokenInLocalStorage(e),localStorage.setItem(C.AUTHORIZATION,JSON.stringify({Host:r,username:i})),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem(C.USER);if(Y.IsNotEmpty(e)){let r=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(r)}}getChannels(){return this.tokenService.getChannels()}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=this.tokenService.getUser(),r=new Date;if(e!=null){let i=new Date(e.Token.expiredAt);return r<i?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem(C.AUTHORIZATION);this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,this.tokenService.clearStorage(),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}};o.\u0275fac=function(r){return new(r||o)(h(Q),h(Ze),h(Ce),h(Ue),h(pt),h(He),h(ft),h(mt))},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let n=o;return n})();export{Ve as a,C as b,Ze as c,Uo as d,ai as e,gi as f,pt as g,gt as h,mt as i,Ni as j};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as he}from"./chunk-DLNXH2FE.js";import{a as oe}from"./chunk-BVIRHZTZ.js";import{a as fe}from"./chunk-N6IHFFFZ.js";import{a as xe,b as Ce}from"./chunk-PD4CUVAW.js";import{c as ue}from"./chunk-ADRVUMMW.js";import{a as ge}from"./chunk-XFTUE2ST.js";import{g as de}from"./chunk-HCDKYABV.js";import{j as ce}from"./chunk-VAMLKDPP.js";import{d as pe,g as se}from"./chunk-BO4PPSB5.js";import{t as _e,u as me}from"./chunk-HUUFOAKH.js";import{b as ee,h as te,m as ne,y as ie}from"./chunk-BSN7ZAXG.js";import{c as re,e as le,f as ae}from"./chunk-64G3XLI6.js";import{$b as T,Bd as J,Cd as Q,Da as g,Ea as u,Eb as p,Gb as m,Gc as $,Hc as j,Ic as q,Jc as w,Ma as B,Nb as v,Ob as E,Pa as U,Qb as M,Rb as V,Sb as c,Tb as _,Ub as I,Vb as C,Wb as f,Xb as R,Yb as h,bc as r,ca as z,ec as H,f as W,gb as S,jb as a,kb as P,mc as b,nc as s,oc as k,pc as y,rc as O,sc as D,sd as K,ta as A,tc as N,ud as X,vc as Z,vd as Y,xc as x,xd as G}from"./chunk-PQDPS2ID.js";var L=e=>[e],Te=e=>({"text-decoration-line-through":e}),be=e=>({"ms-10":e}),ye=e=>({"text-danger":e}),Se=e=>({"bg-gradient-warning":e});function ve(e,l){if(e&1){let n=h();c(0,"mat-slide-toggle",13),T("toggleChange",function(){g(n);let t=r();return t.toggleStatus=!t.toggleStatus,u(t.onToggle())}),c(1,"small",14),s(2),_()()}if(e&2){let n=r();a(2),y(" ",n.productToggleTitle?n.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Ie(e,l){if(e&1){let n=h();c(0,"th")(1,"input",16),N("ngModelChange",function(t){g(n);let o=r(2);return D(o.checkboxState,t)||(o.checkboxState=t),u(t)}),T("ngModelChange",function(){g(n);let t=r(2);return u(t.onCheckboxStateChange())}),_()()}if(e&2){let n=r(2);a(),O("ngModel",n.checkboxState)}}function we(e,l){if(e&1&&(p(0,Ie,2,1,"ng-template",15),c(1,"th",11),s(2,"POS"),_()),e&2){let n=r();m("ngxPermissionsOnly",x(1,L,n.rolePriceEdit))}}function Fe(e,l){if(e&1&&(C(0),c(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),c(5,"div",21),s(6),$(7,"stringLimit"),_()()()(),f()),e&2){let n=l.$implicit;a(3),m("matTooltip",(n.Name==null?null:n.Name.length)>20?n.Name:""),a(),m("src",n==null?null:n.Img,S),a(2),y(" ",q(7,3,n.Name,20)," ")}}function Pe(e,l){e&1&&R(0)}function Ee(e,l){if(e&1&&(C(0),p(1,Pe,1,0,"ng-container",33),f()),e&2){r();let n=b(7);a(),m("ngTemplateOutlet",n)}}function Me(e,l){e&1&&R(0)}function Ve(e,l){if(e&1&&p(0,Me,1,0,"ng-container",33),e&2){r(2);let n=b(7);m("ngTemplateOutlet",n)}}function ke(e,l){if(e&1&&p(0,Ve,1,1,"ng-template",15),e&2){let n=r(4);m("ngxPermissionsOnly",x(1,L,n.rolePriceEdit))}}function Oe(e,l){if(e&1){let n=h();C(0),c(1,"input",34),N("ngModelChange",function(t){g(n);let o=r(4).$implicit;return D(o.selected,t)||(o.selected=t),u(t)}),T("ngModelChange",function(){g(n);let t=r(4).$implicit,o=r();return u(o.onCheckboxStateProduct(t.ID))}),_(),f()}if(e&2){let n=r(4).$implicit;a(),O("ngModel",n.selected),m("disabled",!(n!=null&&n.Category))}}function De(e,l){if(e&1&&p(0,Oe,2,2,"ng-container",22),e&2){let n=r(3).$implicit;m("ngIf",(n==null||n.Variants==null?null:n.Variants.length)>1)}}function Ne(e,l){if(e&1){let n=h();C(0),c(1,"img",35),T("click",function(t){g(n);let o=r(3).$implicit,d=r();return u(d.onZoomImage(t,o==null?null:o.ImageUrl))}),_(),f()}if(e&2){let n=r(3).$implicit;a(),H("src",n==null?null:n.ThumbnailUrl,S)}}function $e(e,l){e&1&&I(0,"img",36)}function Be(e,l){if(e&1&&(C(0),c(1,"td",28)(2,"div",29),p(3,Ee,2,1,"ng-container",30)(4,ke,1,3,"ng-template",null,0,w)(6,De,1,1,"ng-template",null,1,w),c(8,"div",26),p(9,Ne,2,1,"ng-container",30)(10,$e,1,0,"ng-template",null,2,w),_()()(),c(12,"td",31)(13,"div"),s(14),_(),c(15,"small",32),s(16),_()(),f()),e&2){let n=b(5),i=b(11),t=r(2).$implicit,o=r();a(),m("rowSpan",t==null?null:t.Variants.length),a(2),m("ngIf",o.table=="inventory")("ngIfElse",n),a(5),m("ngClass",x(10,be,(t==null||t.Variants==null?null:t.Variants.length)<=1)),a(),m("ngIf",t==null?null:t.ThumbnailUrl)("ngIfElse",i),a(3),m("rowSpan",t==null?null:t.Variants.length),a(2),k(t==null?null:t.Name),a(),m("ngClass",x(12,ye,!(t!=null&&t.Category))),a(),y("(",t!=null&&t.Category?t==null?null:t.Category:"Not Found In POS",")")}}function Ue(e,l){if(e&1&&(c(0,"a",27),I(1,"i",37),_()),e&2){let n=r().$implicit,i=r(2);m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),S)}}function Re(e,l){if(e&1){let n=h();c(0,"input",40),N("ngModelChange",function(t){g(n);let o=r(3).$implicit;return D(o.selected,t)||(o.selected=t),u(t)}),_()}if(e&2){let n=r(3).$implicit,i=r().$implicit;O("ngModel",n.selected),m("disabled",!(i!=null&&i.Category))}}function je(e,l){if(e&1&&(c(0,"td",38),p(1,Re,1,2,"input",39),_()),e&2){let n=r(2).$implicit,i=r(2);a(),m("ngIf",i.printPOS(n)>=0||i.table=="price")}}function Le(e,l){if(e&1&&(p(0,je,2,1,"ng-template",15),c(1,"td",24),s(2),$(3,"number"),_()),e&2){let n=r().$implicit,i=r(2);m("ngxPermissionsOnly",x(4,L,i.rolePriceEdit)),a(2),k(j(3,2,i.printPOS(n)))}}function We(e,l){if(e&1){let n=h();C(0),c(1,"td",41),T("click",function(){g(n);let t=r().$implicit,o=r().$implicit,d=r().$implicit,F=r();return u(F.openTableDialog(d.Name,o,t.ID,d.ChannelItemID))}),c(2,"div",29)(3,"div",42),s(4),$(5,"number"),_(),c(6,"a",43),T("click",function(t){return g(n),u(t==null?null:t.stopPropagation())}),I(7,"i",37),_()()(),f()}if(e&2){let n=l.$implicit,i=r(2).$implicit,t=r(2);a(),m("ngClass",x(5,Se,t.printPOS(i)!=t.printItem(n)&&t.hiddenIPOSInventory()==!1)),a(3),y(" ",j(5,3,t.printItem(n))," "),a(2),m("href",n.Url,S)}}function ze(e,l){e&1&&(c(0,"td",44)(1,"div",29)(2,"span"),s(3,"X"),_()()())}function Ae(e,l){if(e&1&&p(0,We,8,7,"ng-container",30)(1,ze,4,0,"ng-template",null,3,w),e&2){let n=l.$implicit,i=b(2),t=r().$implicit,o=r(2);m("ngIf",o.getItemFromChannel(t,n))("ngIfElse",i)}}function He(e,l){if(e&1&&(c(0,"tr"),p(1,Be,17,14,"ng-container",22),c(2,"td",23),s(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),c(8,"div",21),p(9,Ue,2,1,"a",27),_()()(),p(10,Le,4,6),M(11,Ae,3,2,null,null,E),_()),e&2){let n=l.$implicit,i=l.$index,t=r().$implicit,o=r();a(),m("ngIf",i==0),a(2),k(n==null?null:n.Model),a(2),m("matTooltip",n.Discontinued?o.discontinuedVariantMsg:""),a(),m("ngClass",x(7,Te,n.Discontinued)),a(),y(" ",n.Code," "),a(2),v(t.Category?9:-1),a(),v(o.hiddenIPOSInventory()==!1?10:-1),a(),V(o.channel)}}function Ze(e,l){if(e&1&&(c(0,"tbody"),M(1,He,13,9,"tr",null,E),_()),e&2){let n=l.$implicit;a(),V(n.Variants)}}var bt=(()=>{let l=class l{constructor(i,t,o){this.dialog=i,this.biggerPictureService=t,this.authService=o,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=oe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new U,this.destroy$=new W,this.toggle=new U,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(i){let t=this.data.filter(o=>o.ID==i);t.length>0&&(t=t.map(o=>(o.Variants=o.Variants.map(d=>(d.selected=o.selected,d)),o)))}onCheckboxStateChange(){this.data=this.data.map(i=>(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t)),i))}getItemFromChannel(i,t){return i.Channel.find(d=>re.IsNotEmpty(t.LocationID)?d.LocationID==t.LocationID:d.ChannelID==t.ID)}printItem(i){if(this.table=="inventory")return i.Inventory;if(this.table=="price")return i.Price}openTableDialog(i,t,o,d){this.dialog.open(he,{data:{Name:i,Variant:t,ChannelID:o,Table:this.table,ChannelItemID:d}}).afterClosed().pipe(z(this.destroy$)).subscribe(F=>{F!=null&&this.onSubmit.emit(F)})}printPOS(i){return this.table=="inventory"?i.Inventory?i.Inventory:0:this.table=="price"?i.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(i,t){this.biggerPictureService.openBiggerPicture(i,t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};l.\u0275fac=function(t){return new(t||l)(P(pe),P(ge),P(ce))},l.\u0275cmp=A({type:l,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},standalone:!0,features:[Z],decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(t,o){t&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,ve,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),s(10,"Variant"),_(),c(11,"th",11),s(12,"SKU"),_(),p(13,we,3,3)(14,Fe,8,6,"ng-container",12),_()(),M(15,Ze,3,0,"tbody",null,E),_()()),t&2&&(a(8),v(o.showProductToggle?8:-1),a(5),v(o.hiddenIPOSInventory()==!1?13:-1),a(),m("ngForOf",o.channel),a(),V(o.data))},dependencies:[Q,K,X,Y,G,J,ie,ee,te,ne,Ce,xe,se,de,ue,ae,le,me,_e,fe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]});let e=l;return e})();export{bt as a};
|
|
1
|
+
import{a as he}from"./chunk-DLNXH2FE.js";import{a as oe}from"./chunk-BVIRHZTZ.js";import{a as fe}from"./chunk-N6IHFFFZ.js";import{a as xe,b as Ce}from"./chunk-PD4CUVAW.js";import{c as ue}from"./chunk-ADRVUMMW.js";import{a as ge}from"./chunk-XFTUE2ST.js";import{g as de}from"./chunk-HCDKYABV.js";import{j as ce}from"./chunk-AWGGAU6G.js";import{d as pe,g as se}from"./chunk-BO4PPSB5.js";import{t as _e,u as me}from"./chunk-HUUFOAKH.js";import{b as ee,h as te,m as ne,y as ie}from"./chunk-BSN7ZAXG.js";import{c as re,e as le,f as ae}from"./chunk-64G3XLI6.js";import{$b as T,Bd as J,Cd as Q,Da as g,Ea as u,Eb as p,Gb as m,Gc as $,Hc as j,Ic as q,Jc as w,Ma as B,Nb as v,Ob as E,Pa as U,Qb as M,Rb as V,Sb as c,Tb as _,Ub as I,Vb as C,Wb as f,Xb as R,Yb as h,bc as r,ca as z,ec as H,f as W,gb as S,jb as a,kb as P,mc as b,nc as s,oc as k,pc as y,rc as O,sc as D,sd as K,ta as A,tc as N,ud as X,vc as Z,vd as Y,xc as x,xd as G}from"./chunk-PQDPS2ID.js";var L=e=>[e],Te=e=>({"text-decoration-line-through":e}),be=e=>({"ms-10":e}),ye=e=>({"text-danger":e}),Se=e=>({"bg-gradient-warning":e});function ve(e,l){if(e&1){let n=h();c(0,"mat-slide-toggle",13),T("toggleChange",function(){g(n);let t=r();return t.toggleStatus=!t.toggleStatus,u(t.onToggle())}),c(1,"small",14),s(2),_()()}if(e&2){let n=r();a(2),y(" ",n.productToggleTitle?n.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Ie(e,l){if(e&1){let n=h();c(0,"th")(1,"input",16),N("ngModelChange",function(t){g(n);let o=r(2);return D(o.checkboxState,t)||(o.checkboxState=t),u(t)}),T("ngModelChange",function(){g(n);let t=r(2);return u(t.onCheckboxStateChange())}),_()()}if(e&2){let n=r(2);a(),O("ngModel",n.checkboxState)}}function we(e,l){if(e&1&&(p(0,Ie,2,1,"ng-template",15),c(1,"th",11),s(2,"POS"),_()),e&2){let n=r();m("ngxPermissionsOnly",x(1,L,n.rolePriceEdit))}}function Fe(e,l){if(e&1&&(C(0),c(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),c(5,"div",21),s(6),$(7,"stringLimit"),_()()()(),f()),e&2){let n=l.$implicit;a(3),m("matTooltip",(n.Name==null?null:n.Name.length)>20?n.Name:""),a(),m("src",n==null?null:n.Img,S),a(2),y(" ",q(7,3,n.Name,20)," ")}}function Pe(e,l){e&1&&R(0)}function Ee(e,l){if(e&1&&(C(0),p(1,Pe,1,0,"ng-container",33),f()),e&2){r();let n=b(7);a(),m("ngTemplateOutlet",n)}}function Me(e,l){e&1&&R(0)}function Ve(e,l){if(e&1&&p(0,Me,1,0,"ng-container",33),e&2){r(2);let n=b(7);m("ngTemplateOutlet",n)}}function ke(e,l){if(e&1&&p(0,Ve,1,1,"ng-template",15),e&2){let n=r(4);m("ngxPermissionsOnly",x(1,L,n.rolePriceEdit))}}function Oe(e,l){if(e&1){let n=h();C(0),c(1,"input",34),N("ngModelChange",function(t){g(n);let o=r(4).$implicit;return D(o.selected,t)||(o.selected=t),u(t)}),T("ngModelChange",function(){g(n);let t=r(4).$implicit,o=r();return u(o.onCheckboxStateProduct(t.ID))}),_(),f()}if(e&2){let n=r(4).$implicit;a(),O("ngModel",n.selected),m("disabled",!(n!=null&&n.Category))}}function De(e,l){if(e&1&&p(0,Oe,2,2,"ng-container",22),e&2){let n=r(3).$implicit;m("ngIf",(n==null||n.Variants==null?null:n.Variants.length)>1)}}function Ne(e,l){if(e&1){let n=h();C(0),c(1,"img",35),T("click",function(t){g(n);let o=r(3).$implicit,d=r();return u(d.onZoomImage(t,o==null?null:o.ImageUrl))}),_(),f()}if(e&2){let n=r(3).$implicit;a(),H("src",n==null?null:n.ThumbnailUrl,S)}}function $e(e,l){e&1&&I(0,"img",36)}function Be(e,l){if(e&1&&(C(0),c(1,"td",28)(2,"div",29),p(3,Ee,2,1,"ng-container",30)(4,ke,1,3,"ng-template",null,0,w)(6,De,1,1,"ng-template",null,1,w),c(8,"div",26),p(9,Ne,2,1,"ng-container",30)(10,$e,1,0,"ng-template",null,2,w),_()()(),c(12,"td",31)(13,"div"),s(14),_(),c(15,"small",32),s(16),_()(),f()),e&2){let n=b(5),i=b(11),t=r(2).$implicit,o=r();a(),m("rowSpan",t==null?null:t.Variants.length),a(2),m("ngIf",o.table=="inventory")("ngIfElse",n),a(5),m("ngClass",x(10,be,(t==null||t.Variants==null?null:t.Variants.length)<=1)),a(),m("ngIf",t==null?null:t.ThumbnailUrl)("ngIfElse",i),a(3),m("rowSpan",t==null?null:t.Variants.length),a(2),k(t==null?null:t.Name),a(),m("ngClass",x(12,ye,!(t!=null&&t.Category))),a(),y("(",t!=null&&t.Category?t==null?null:t.Category:"Not Found In POS",")")}}function Ue(e,l){if(e&1&&(c(0,"a",27),I(1,"i",37),_()),e&2){let n=r().$implicit,i=r(2);m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),S)}}function Re(e,l){if(e&1){let n=h();c(0,"input",40),N("ngModelChange",function(t){g(n);let o=r(3).$implicit;return D(o.selected,t)||(o.selected=t),u(t)}),_()}if(e&2){let n=r(3).$implicit,i=r().$implicit;O("ngModel",n.selected),m("disabled",!(i!=null&&i.Category))}}function je(e,l){if(e&1&&(c(0,"td",38),p(1,Re,1,2,"input",39),_()),e&2){let n=r(2).$implicit,i=r(2);a(),m("ngIf",i.printPOS(n)>=0||i.table=="price")}}function Le(e,l){if(e&1&&(p(0,je,2,1,"ng-template",15),c(1,"td",24),s(2),$(3,"number"),_()),e&2){let n=r().$implicit,i=r(2);m("ngxPermissionsOnly",x(4,L,i.rolePriceEdit)),a(2),k(j(3,2,i.printPOS(n)))}}function We(e,l){if(e&1){let n=h();C(0),c(1,"td",41),T("click",function(){g(n);let t=r().$implicit,o=r().$implicit,d=r().$implicit,F=r();return u(F.openTableDialog(d.Name,o,t.ID,d.ChannelItemID))}),c(2,"div",29)(3,"div",42),s(4),$(5,"number"),_(),c(6,"a",43),T("click",function(t){return g(n),u(t==null?null:t.stopPropagation())}),I(7,"i",37),_()()(),f()}if(e&2){let n=l.$implicit,i=r(2).$implicit,t=r(2);a(),m("ngClass",x(5,Se,t.printPOS(i)!=t.printItem(n)&&t.hiddenIPOSInventory()==!1)),a(3),y(" ",j(5,3,t.printItem(n))," "),a(2),m("href",n.Url,S)}}function ze(e,l){e&1&&(c(0,"td",44)(1,"div",29)(2,"span"),s(3,"X"),_()()())}function Ae(e,l){if(e&1&&p(0,We,8,7,"ng-container",30)(1,ze,4,0,"ng-template",null,3,w),e&2){let n=l.$implicit,i=b(2),t=r().$implicit,o=r(2);m("ngIf",o.getItemFromChannel(t,n))("ngIfElse",i)}}function He(e,l){if(e&1&&(c(0,"tr"),p(1,Be,17,14,"ng-container",22),c(2,"td",23),s(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),c(8,"div",21),p(9,Ue,2,1,"a",27),_()()(),p(10,Le,4,6),M(11,Ae,3,2,null,null,E),_()),e&2){let n=l.$implicit,i=l.$index,t=r().$implicit,o=r();a(),m("ngIf",i==0),a(2),k(n==null?null:n.Model),a(2),m("matTooltip",n.Discontinued?o.discontinuedVariantMsg:""),a(),m("ngClass",x(7,Te,n.Discontinued)),a(),y(" ",n.Code," "),a(2),v(t.Category?9:-1),a(),v(o.hiddenIPOSInventory()==!1?10:-1),a(),V(o.channel)}}function Ze(e,l){if(e&1&&(c(0,"tbody"),M(1,He,13,9,"tr",null,E),_()),e&2){let n=l.$implicit;a(),V(n.Variants)}}var bt=(()=>{let l=class l{constructor(i,t,o){this.dialog=i,this.biggerPictureService=t,this.authService=o,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=oe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new U,this.destroy$=new W,this.toggle=new U,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(i){let t=this.data.filter(o=>o.ID==i);t.length>0&&(t=t.map(o=>(o.Variants=o.Variants.map(d=>(d.selected=o.selected,d)),o)))}onCheckboxStateChange(){this.data=this.data.map(i=>(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t)),i))}getItemFromChannel(i,t){return i.Channel.find(d=>re.IsNotEmpty(t.LocationID)?d.LocationID==t.LocationID:d.ChannelID==t.ID)}printItem(i){if(this.table=="inventory")return i.Inventory;if(this.table=="price")return i.Price}openTableDialog(i,t,o,d){this.dialog.open(he,{data:{Name:i,Variant:t,ChannelID:o,Table:this.table,ChannelItemID:d}}).afterClosed().pipe(z(this.destroy$)).subscribe(F=>{F!=null&&this.onSubmit.emit(F)})}printPOS(i){return this.table=="inventory"?i.Inventory?i.Inventory:0:this.table=="price"?i.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(i,t){this.biggerPictureService.openBiggerPicture(i,t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};l.\u0275fac=function(t){return new(t||l)(P(pe),P(ge),P(ce))},l.\u0275cmp=A({type:l,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},standalone:!0,features:[Z],decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(t,o){t&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,ve,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),s(10,"Variant"),_(),c(11,"th",11),s(12,"SKU"),_(),p(13,we,3,3)(14,Fe,8,6,"ng-container",12),_()(),M(15,Ze,3,0,"tbody",null,E),_()()),t&2&&(a(8),v(o.showProductToggle?8:-1),a(5),v(o.hiddenIPOSInventory()==!1?13:-1),a(),m("ngForOf",o.channel),a(),V(o.data))},dependencies:[Q,K,X,Y,G,J,ie,ee,te,ne,Ce,xe,se,de,ue,ae,le,me,_e,fe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]});let e=l;return e})();export{bt as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as u}from"./chunk-N3TTJVBG.js";import{a as f}from"./chunk-
|
|
1
|
+
import{b as u}from"./chunk-N3TTJVBG.js";import{a as f}from"./chunk-YMUN44Z7.js";import"./chunk-AWGGAU6G.js";import"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{n as l}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{y as d}from"./chunk-BSN7ZAXG.js";import"./chunk-64G3XLI6.js";import{n as c,r as m}from"./chunk-OVEJFFL6.js";import{Cd as n,Ub as a,ka as r,ta as s,ua as i}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var M=(()=>{let t=class t{constructor(){}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=s({type:t,selectors:[["app-report"]],decls:1,vars:0,template:function(e,O){e&1&&a(0,"router-outlet")},dependencies:[c],styles:["ul[_ngcontent-%COMP%] > li.dropdown-item[_ngcontent-%COMP%]{font-size:.6875rem!important}"]});let o=t;return o})();var y=[{path:"",component:M,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",loadChildren:()=>import("./chunk-NTF5NCAI.js").then(o=>o.OrderModule),canActivate:[f]}]}],C=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i({type:t}),t.\u0275inj=r({imports:[n,m.forChild(y)]});let o=t;return o})();var b=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i({type:t}),t.\u0275inj=r({imports:[n,u,C,d,l,m]});let o=t;return o})();export{b as ReportModule};
|