marketplacepos 2.9.2 → 2.9.3

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.
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e,h={},v={};function r(e){var n=v[e];if(void 0!==n)return n.exports;var t=v[e]={id:e,loaded:!1,exports:{}};return h[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=h,e=[],r.O=(n,t,f,o)=>{if(!t){var a=1/0;for(c=0;c<e.length;c++){for(var[t,f,o]=e[c],b=!0,d=0;d<t.length;d++)(!1&o||a>=o)&&Object.keys(r.O).every(u=>r.O[u](t[d]))?t.splice(d--,1):(b=!1,o<a&&(a=o));if(b){e.splice(c--,1);var s=f();void 0!==s&&(n=s)}}return n}o=o||0;for(var c=e.length;c>0&&e[c-1][2]>o;c--)e[c]=e[c-1];e[c]=[t,f,o]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},(()=>{var n,e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;r.t=function(t,f){if(1&f&&(t=this(t)),8&f||"object"==typeof t&&t&&(4&f&&t.__esModule||16&f&&"function"==typeof t.then))return t;var o=Object.create(null);r.r(o);var c={};n=n||[null,e({}),e([]),e(e)];for(var a=2&f&&t;"object"==typeof a&&!~n.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(b=>c[b]=()=>t[b]);return c.default=()=>t,r.d(o,c),o}})(),r.d=(e,n)=>{for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((n,t)=>(r.f[t](e,n),n),[])),r.u=e=>(592===e?"common":e)+"."+{46:"40ebac81bd0fb91b",53:"3655b31ecb37ade9",213:"d00d0a3f05c831f7",277:"e644e3531765ce65",360:"8279e3b4ceab63e1",369:"a12060880985ee8f",378:"7f743ac9660ec6e6",379:"aad8784dbdb3dd33",392:"f4537160149f627a",395:"2943aa5a44308399",397:"8ba047b91801962d",425:"03f8f97da7452806",455:"c9dd08adf08a1b65",481:"64ffd74d20798f93",501:"7645c32a140dd7f8",512:"52dc49022c04fa43",533:"cc5ab7f3ce13770c",545:"4809f373cc63f3b4",592:"af67cc08f47a8d44",655:"ae475c8285604367",717:"5d253da5bb63552f",739:"0de1f18deac0ed90",767:"d939ac65d1cb16fb",859:"3a4d26983bbb5254",874:"5b06431d2b5a1e8f",913:"ec8155bc121fb0a6",993:"5c22ca4b00b8c459",997:"1e5281aa64540dee"}[e]+".js",r.miniCssF=e=>{},r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="pos-marketplace:";r.l=(t,f,o,c)=>{if(e[t])e[t].push(f);else{var a,b;if(void 0!==o)for(var d=document.getElementsByTagName("script"),s=0;s<d.length;s++){var i=d[s];if(i.getAttribute("src")==t||i.getAttribute("data-webpack")==n+o){a=i;break}}a||(b=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",n+o),a.src=r.tu(t)),e[t]=[f];var p=(g,u)=>{a.onerror=a.onload=null,clearTimeout(l);var _=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),_&&_.forEach(y=>y(u)),g)return g(u)},l=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),b&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:n=>n},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="https://cdn.jsdelivr.net/npm/marketplacepos@2.9.3/Marketplace/",(()=>{var e={666:0};r.f.j=(f,o)=>{var c=r.o(e,f)?e[f]:void 0;if(0!==c)if(c)o.push(c[2]);else if(666!=f){var a=new Promise((i,p)=>c=e[f]=[i,p]);o.push(c[2]=a);var b=r.p+r.u(f),d=new Error;r.l(b,i=>{if(r.o(e,f)&&(0!==(c=e[f])&&(e[f]=void 0),c)){var p=i&&("load"===i.type?"missing":i.type),l=i&&i.target&&i.target.src;d.message="Loading chunk "+f+" failed.\n("+p+": "+l+")",d.name="ChunkLoadError",d.type=p,d.request=l,c[1](d)}},"chunk-"+f,f)}else e[f]=0},r.O.j=f=>0===e[f];var n=(f,o)=>{var d,s,[c,a,b]=o,i=0;if(c.some(l=>0!==e[l])){for(d in a)r.o(a,d)&&(r.m[d]=a[d]);if(b)var p=b(r)}for(f&&f(o);i<c.length;i++)r.o(e,s=c[i])&&e[s]&&e[s][0](),e[s]=0;return r.O(p)},t=self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))})()})();
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"marketplacepos","version":"2.9.2"}
1
+ {"name":"marketplacepos","version":"2.9.3"}
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[213],{8231:(A,I,s)=>{s.d(I,{j:()=>m});var S=s(5412),g=s(1889),c=s(9694),D=s(6779),t=s(4650),f=s(284),P=s(6895),e=s(4006),n=s(1948),a=s(9549),l=s(4385),r=s(3238),d=s(266),_=s(6401);function E(h,i){if(1&h&&(t.TgZ(0,"mat-option",9)(1,"div",10),t._UZ(2,"img",11),t.TgZ(3,"span"),t._uU(4),t.qZA()()()),2&h){const o=i.$implicit;t.Q6J("value",o.ID)("disabled",o.disabled),t.xp6(1),t.Q6J("matTooltip",o.disabled?"Single Product Scan disabled for this type of Channel":null),t.xp6(1),t.Q6J("src",o.Img,t.LSH),t.xp6(2),t.Oqu(o.Name)}}function O(h,i){if(1&h){const o=t.EpF();t.TgZ(0,"div")(1,"h5",12),t._uU(2,"Scan Type"),t.qZA(),t.TgZ(3,"mat-radio-group",13),t.NdJ("ngModelChange",function(p){t.CHM(o);const C=t.oxw();return t.KtG(C.filter.ScanFull=p)}),t.TgZ(4,"mat-radio-button",14),t._uU(5," Full (Include Inactive Products) "),t.qZA(),t.TgZ(6,"mat-radio-button",15),t._uU(7," Active "),t.qZA()()()}if(2&h){const o=t.oxw();t.xp6(3),t.Q6J("ngModel",o.filter.ScanFull),t.xp6(1),t.Q6J("value",!0),t.xp6(2),t.Q6J("value",!1)}}function T(h,i){if(1&h){const o=t.EpF();t.TgZ(0,"div",16)(1,"h5",3),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"mat-radio-group",17),t.NdJ("ngModelChange",function(p){t.CHM(o);const C=t.oxw();return t.KtG(C.filter.UpdatedProduct=p)}),t.TgZ(5,"mat-radio-button",18),t._uU(6," Scan All Products "),t.qZA(),t.TgZ(7,"mat-radio-button",19),t._uU(8," Scan Updated Products "),t.qZA()()()}if(2&h){const o=t.oxw();t.xp6(2),t.hij(" Last Scan: ",t.xi3(3,4,o.selectedChannel.LastSync,"dd MMMM yyyy HH:mm")," "),t.xp6(2),t.Q6J("ngModel",o.filter.UpdatedProduct),t.xp6(1),t.Q6J("value",!1),t.xp6(2),t.Q6J("value",!0)}}function U(h,i){if(1&h){const o=t.EpF();t.TgZ(0,"div",16)(1,"h5",3),t._uU(2," Scan Option "),t.qZA(),t.TgZ(3,"mat-radio-group",20),t.NdJ("ngModelChange",function(p){t.CHM(o);const C=t.oxw();return t.KtG(C.filter.Async=p)}),t.TgZ(4,"mat-radio-button",21),t._uU(5," Asynchronous (Get Notified when Complete) "),t.qZA(),t.TgZ(6,"mat-radio-button",22),t._uU(7," Synchronous (Wait until Complete) "),t.qZA()()()}if(2&h){const o=t.oxw();t.xp6(3),t.Q6J("ngModel",o.filter.Async),t.xp6(1),t.Q6J("value",!0),t.xp6(2),t.Q6J("value",!1)}}class m{constructor(i,o,u){this.dialogRef=i,this.data=o,this.router=u,this.channelType=c.x,this.disabledChannelOption=!1,this.filter={ChannelID:g.g.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=!!g.g.IsNotEmpty(o.isSingleChannel)&&this.data.isSingleChannel,this.disabledChannelOption=!g.g.IsEmpty(o.disabledChannelOption)&&this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new D.O,this.modalConfig.title="Scan Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1,1==this.channelOptions.length&&(this.filter.ChannelID=this.data.channelOptions[0].ID,this.selectedChannel=this.data.channelOptions[0])}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(i=>(i.disabled=!0,(i.TypeID==c.x.Tiktok||i.TypeID==c.x.Tokopedia||i.TypeID==c.x.Lazada)&&(i.disabled=!1),i)).sort(i=>i.disabled?1:-1))}onSelectChannel(i){let o=this.filterChannelById(i);this.selectedChannel=1==this.channelOptions.length?this.channelOptions[0]:o,this.filter.Async=!0,o&&o.TypeID==c.x.Tokopedia?(this.filter.ScanFull=!0,this.isTokopedia=!0):(this.filter.ScanFull=!1,this.isTokopedia=!1),this.iniHasScanUpdate(),this.setDefaultConfigUpdate()}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&g.g.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==c.x.ShopeeV2||this.selectedChannel.TypeID==c.x.Tiktok||this.selectedChannel.TypeID==c.x.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.hasScanUpdate=!(this.selectedChannel?.TypeID==c.x.WooCommerce||this.selectedChannel?.TypeID==c.x.KalCare||this.selectedChannel?.TypeID==c.x.None||!g.g.IsNotEmpty(this.selectedChannel?.LastSync)||this.isSingleChannel)}filterChannelById(i){let o;return this.channelOptions&&(o=this.channelOptions.find(u=>u.ID==i)),o}submit(){this.selectedChannel.TypeID==c.x.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):(this.beforeSubmit(),this.dialogRef.close(this.filter))}beforeSubmit(){this.filter.UpdatedProduct&&(this.filter.Async=!1)}isNotEmpty(i){return g.g.IsNotEmpty(i)}onClose(){this.dialogRef.close()}}m.\u0275fac=function(i){return new(i||m)(t.Y36(S.so),t.Y36(S.WI),t.Y36(f.F0))},m.\u0275cmp=t.Xpm({type:m,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"mx-4"],[1,"mb-3","fw-normal"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"disabled","ngModel","ngModelChange"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],[4,"ngIf"],["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,"mb-3","fw-normal","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModel","ngModelChange"],["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,"mt-8"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModel","ngModelChange"],["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","matTooltip","Scan only products that have been updated since the last channel scan",1,"me-5",3,"value"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModel","ngModelChange"],["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(i,o){1&i&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),t.TgZ(1,"div",1)(2,"div",2)(3,"h5",3),t._uU(4,"Select a Channel"),t.qZA(),t.TgZ(5,"mat-form-field",4)(6,"mat-select",5),t.NdJ("ngModelChange",function(p){return o.filter.ChannelID=p})("ngModelChange",function(p){return o.onSelectChannel(p)}),t.YNc(7,E,5,5,"mat-option",6),t.qZA()(),t.YNc(8,O,8,3,"div",7),t.YNc(9,T,9,7,"div",8),t.YNc(10,U,8,3,"div",8),t.qZA()()()),2&i&&(t.Q6J("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),t.xp6(6),t.Q6J("disabled",o.disabledChannelOption)("ngModel",o.filter.ChannelID),t.xp6(1),t.Q6J("ngForOf",o.channelOptions),t.xp6(1),t.Q6J("ngIf",!o.isSingleChannel&&!o.isTokopedia&&o.isNotEmpty(o.filter.ChannelID)),t.xp6(1),t.Q6J("ngIf",o.hasScanUpdate),t.xp6(1),t.Q6J("ngIf",!(null!=o.filter&&o.filter.UpdatedProduct)&&!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[P.sg,P.O5,e.JJ,e.On,n.VQ,n.U0,a.KE,l.gD,r.ey,d.gM,_.M,P.uU],encapsulation:2})},9425:(A,I,s)=>{s.d(I,{b:()=>m});var S=s(1135),g=s(7579),c=s(2722),D=s(9300),t=s(4351),f=s(4004),P=s(4482),e=s(5403),n=s(8421),a=s(4671),l=s(5032),r=s(3269),_=s(5026),E=s(8505),O=s(4782),T=s(4650),U=s(1318);class m{constructor(i){this.http=i,this.pagination$=new S.X(null),this.destroy$=new g.x,this.data$=this.paginationFunction()}onNextPage(i){i.PageNumber+=1,this.pagination$.next(i)}setPageNumberFooter(i){this.footerPageNumber=i.PageNumber}setPaginationButtonState(i,o){this.disableNextButton=0==o||!(o<i.RowCount*i.PageNumber)}resetToFirstPage(i){i.PageNumber=1,this.pagination$.next(i),this.hideCount=!0,this.goToLastPage=!1}getAllData(i,o){i.RowCount=o,this.pagination$.next(i),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new S.X(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe((0,c.R)(this.destroy$),(0,D.h)(i=>null!=i),(0,t.b)(i=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(i)).pipe((0,f.U)(o=>o.Data))),function d(...h){const i=(0,r.jO)(h);return(0,P.e)((o,u)=>{const p=h.length,C=new Array(p);let M=h.map(()=>!1),N=!1;for(let v=0;v<p;v++)(0,n.Xf)(h[v]).subscribe((0,e.x)(u,y=>{C[v]=y,!N&&!M[v]&&(M[v]=!0,(N=M.every(a.y))&&(M=null))},l.Z));o.subscribe((0,e.x)(u,v=>{if(N){const y=[v,...C];u.next(i?i(...y):y)}}))})}(this.pagination$),(0,_.R)((i,o)=>{const[u,p]=i,[C]=o;return 1==p.PageNumber?[C,p]:[u.concat(C),p]}),(0,E.b)(([i,o])=>{this.setPageNumberFooter(o),this.setPaginationButtonState(o,i.length)}),(0,f.U)(([i])=>i),(0,O.d)())}}m.\u0275fac=function(i){return new(i||m)(T.LFG(U.O))},m.\u0275prov=T.Yz7({token:m,factory:m.\u0275fac,providedIn:"root"})},6082:(A,I,s)=>{s.d(I,{M:()=>f});var S=s(8505),g=s(1889),c=s(4650),D=s(1318),t=s(7185);class f{constructor(e,n){this.httpService=e,this.toastrService=n}loader(e=g.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:e})}LoadInPOS(e=g.g.GuidEMpty){return this.httpService.post("/api/product/LoadInPOS",{ID:e})}filterChannelByTypeId(e,n){return e.filter(a=>-1!==n.findIndex(l=>a.TypeID==l))}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(e){return this.httpService.post("/api/product/TotalProductLive",{ID:e})}clearCacheChannel(e){return this.httpService.post("/api/Channel/ClearCacheChannel",{ID:e})}uploadSingleProduct(e,n){return this.httpService.post("api/product/UploadMultipleChannel",{Channel:n,Products:e})}uploadMultipleProduct(e,n){return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",{Channel:n,Products:e})}scanSingle(e,n){return this.httpService.post("/api/product/ScanSingle",{ID:e,SKU:n})}scanNotInChannel(e){return this.httpService.post("/api/product/ScanNotinChannel",{ID:e})}findAllSoldInChannel(e){return this.httpService.post("/api/product/GetSoldInChannel",e)}scanAll(e,n,a,l=!1){return this.httpService.post("/api/product/ScanOptimized",{ID:e,ScanFull:n,UpdatedProduct:a,Async:l})}scanCompareToPos(e){return this.httpService.post("/api/product/CompareMarketplaceToPOS",e)}getVariantCodesProduct(e){return e.Variants.map(a=>a.Code)}downloadMultipleProduct(e){let n=e.map(a=>({ChannelItemID:a.ChannelItemID,ChannelID:a.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",n).pipe((0,S.b)(a=>{this.toastrService.success(`${a.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(e){return this.httpService.post("/api/product/DownloadProductFromChannel",{ChannelItemID:e.ChannelItemID,ChannelID:e.ChannelID}).pipe((0,S.b)(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(e=[]){let n=[];return e.forEach(a=>{a.Variants.forEach(l=>{n=[...n,l.Code]})}),n}filterUnselectedChannel(e,n){let l,a=[];if(e.forEach(r=>{a=[...a,...r.Channel]}),a&&0!=a.length){let r=[];l=n.filter(d=>(r=a.filter(_=>_.ChannelID==d.ID),r.length!==e.length))}else l=n;return l}findChannelById(e,n){return n.find(a=>a.ID==e)}sortChannel(e=[]){return e.sort((n,a)=>n.TypeID<a.TypeID?1:n.TypeID===a.TypeID?0:-1)}hasSelection(e=[]){return this.selectedProduct(e).length>0}selectedProduct(e=[]){return e.filter(n=>n.selected)}hasSelectionVariant(e){return this.selectedVariantProduct(e).length>0}selectedVariantProduct(e){let n=[];return e.forEach(a=>{n=[...n,...null!=a.Variants?a.Variants.filter(l=>l.selected):""]}),n}getChannelProduct(e){const n=e.Variants;let a=[];for(let l of n)if(null!=l.Channel)for(let r of l.Channel)0==a.filter(d=>d.ChannelID==r.ChannelID).length&&a.push(r);return this.sortChannel(a)}successToastrScanAllProduct(e,n,a){if(a){const l=e?.NotInPOS?.Product?e?.NotInPOS?.Product:0,r=e?.InChannel?.Product?e?.InChannel?.Product:0;this.toastrService.success(`\n ${l+r} found in ${n.Name} </br>\n (${r} In POS + ${l} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastrService.success(`${e.InChannel?e.InChannel.Product:0} product updates in ${n.Name} </br> \n since ${e.LastUpdate}`,"Scan Complete!",{enableHtml:!0})}checkProductHasScanButton(e,n){let a;return e.map(l=>(l.Channel=this.getChannelProduct(l),a=this.filterUnselectedChannel([l],n),l.hasScan=a.length>0,l))}checkProductHasUploadBtn(e,n){let a;return e.map(l=>(l.Channel=this.getChannelProduct(l),a=this.filterUnselectedChannel([l],n),l.hasUpload=a.length>0,l))}showToastrUploadMultiple(e=[]){let n=[],a=[];if(e.forEach(l=>{"string"==typeof l?.Response?a=[...a,`<li>${l.Response}</li>`]:(l?.Response?.Success.forEach(r=>{n=[...n,`<li>Product ${r} was <b>successfully</b> uploaded to ${l.Name}</li>`]}),l?.Response.Fail.forEach(r=>{a=[...a,`<li>${r}</li>`]}))}),a.length>0&&n.length>0){const l=[...n,...a];this.toastrService.warning(this.concatMessage(l),"Warning!",{enableHtml:!0})}else n.length>0&&0==a.length?this.toastrService.success(this.concatMessage(n),"Success",{enableHtml:!0}):this.toastrService.error(this.concatMessage(a),"Error",{enableHtml:!0})}concatMessage(e=[]){let n="";return e.forEach(a=>{n+=a}),`<ol>${n}</ol>`}showToastrSuccessUploadSingle(e,n){let a=e.filter(d=>0==d.Status),l=e.filter(d=>1==d.Status),r=this.generateToastrMessage(a,l,n);this.toastrService.success(r.message,"Success",{enableHtml:!0})}showToastErrorUploadSingle(e,n){let a=e?.error?.Message.filter(d=>0==d.Status),l=e?.error?.Message.filter(d=>1==d.Status),r=this.generateToastrMessage(a,l,n);"WARNING"==r.status?this.toastrService.warning(r.message,"Warning!",{enableHtml:!0}):this.toastrService.error(r.message,`Error - ${e.status}`,{enableHtml:!0})}generateToastrMessage(e,n,a){let r,l="";return 0==e.length&&n.length>0?(r="SUCCESS",l=this.createSuccessResponse(n,a)):e.length>0&&0==n.length?(r="ERROR",l=this.createErrResponse(e,a)):(r="WARNING",l=`${this.createSuccessResponse(n,a)} ${this.createErrResponse(e,a)}`),l=`<ol>${l}</ol>`,{status:r,message:l}}createErrResponse(e,n){let a="";return e.forEach((l,r)=>{a+=`<li><b>${l.Response}</b> for ${n.Name} in ${l.Name}</li>`}),a}createSuccessResponse(e,n){let a="";return e.forEach((l,r)=>{a+=`<li>Product ${n.Name} was <b>successfully</b> uploaded to ${l.Name}</li>`}),a}getHostName(){if(g.g.IsEmpty(this.hostName)){const e=localStorage.getItem("Authorization");this.hostName=JSON.parse(e)?.Host}return this.hostName}}f.\u0275fac=function(e){return new(e||f)(c.LFG(D.O),c.LFG(t._W))},f.\u0275prov=c.Yz7({token:f,factory:f.\u0275fac,providedIn:"root"})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[379],{2379:(X,$,d)=>{d.r($),d.d($,{OrdersModule:()=>q});var u=d(6895),f=d(284),U=d(8703),e=d(4650),B=d(2937);class Z{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[U.G.downloadOrder]}]}ngOnInit(){}}Z.\u0275fac=function(n){return new(n||Z)},Z.\u0275cmp=e.Xpm({type:Z,selectors:[["app-orders"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(n,t){1&n&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&n&&(e.xp6(3),e.Q6J("Tabs",t.ObjectOrderTabs)("usePermissions",!0))},dependencies:[B.e,f.lC]});var m=d(1889),l=d(4782),s=d(8505),r=d(9694),p=d(9568),g=d(2428),_=d(5412),h=d(4006),K=d(6709);class k{constructor(n){this.dialogRef=n,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}}k.\u0275fac=function(n){return new(n||k)(e.Y36(_.so))},k.\u0275cmp=e.Xpm({type:k,selectors:[["app-print-tokopedia"]],decls:17,vars:1,consts:[[1,"container-fluid"],["mat-dialog-title","",1,"text-center","mb-8","fw-bold"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"ngModel","ngModelChange"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center","mt-6"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0)(1,"h2",1),e._uU(2,"Cetak label pesanan"),e.qZA(),e.TgZ(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),e._uU(7,"Kamu akan mencetak label yang berisi detail pesanan"),e.qZA(),e.TgZ(8,"div",5)(9,"mat-checkbox",6),e.NdJ("ngModelChange",function(o){return t.tandaiSudahDicetak=o}),e.qZA(),e.TgZ(10,"span",7),e._uU(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),e.qZA()()()()(),e.TgZ(12,"mat-dialog-actions",8)(13,"button",9),e.NdJ("click",function(){return t.onCancel()}),e._uU(14,"Cancel"),e.qZA(),e.TgZ(15,"button",10),e.NdJ("click",function(){return t.onPrint()}),e._uU(16,"Cetak Pesanan"),e.qZA()()()),2&n&&(e.xp6(9),e.Q6J("ngModel",t.tandaiSudahDicetak))},dependencies:[h.JJ,h.On,K.oG,_.uh,_.xY,_.H8]});var V=d(4004),ee=d(9300),te=d(3900),S=d(1318),j=d(7185);class I{constructor(){}convertToCSV(n,t){let i;if("string"==typeof n)i=n;else{var o="object"==typeof n?n:JSON.parse(n);i=this.transformToCSVStringFormat(o)}this.downloadCSV(i,t)}transformToCSVStringFormat(n){if(!n||!n.length)return;const i=Object.keys(n[0]);return n.map(c=>i.map(O=>{let v=null==c[O]?"":c[O];return v=v instanceof Date?v.toLocaleString():v.toString().replace(/"/g,'""'),v.search(/("|,|\n)/g)>=0&&(v=`"${v}"`),v}).join(",")).join("\n")}downloadCSV(n,t){var i=new Blob([n],{type:"text/csv;charset=utf8;"}),o=document.createElement("a");o.setAttribute("href",window.URL.createObjectURL(i)),o.setAttribute("download",t),document.body.appendChild(o),o.click(),document.body.removeChild(o)}}I.\u0275fac=function(n){return new(n||I)},I.\u0275prov=e.Yz7({token:I,factory:I.\u0275fac,providedIn:"root"});class x{constructor(n,t,i,o){this.http=n,this.dialog=t,this.toastr=i,this.exportService=o}loadInitialPage(){return this.http.post("/api/ordersLoader/GetOrder",{})}getNewOrders(n){return this.http.post("/api/orders/GetNewOrder",n).pipe((0,V.U)(t=>t.Data))}getTotalNewOrders(n){return this.http.post("/api/orders/GetCountNewOrder",{ListChannelID:n}).pipe((0,V.U)(i=>i.Count))}printShippingLabelTokopedia(n){const t={OrderNumber:n,Printed:!0};this.dialog.open(k).afterClosed().pipe((0,ee.h)(i=>void 0!==i),(0,te.w)(i=>(t.Printed=i,this.http.post("api/v1/Shippinglabel/Tokopedia",t)))).subscribe(i=>{const o=window.open("about:blank","_blank");o.document.write(i),o.document.close()})}printShippingLabelTiktok(n,t){this.http.post("api/v1/Shippinglabel/Tiktok",{ShopID:t,OrderNumber:n}).subscribe(o=>{null!=o.data?window.open(o.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print")})}printShippingLabelShopee(n,t){this.http.post("api/v1/Shippinglabel/shopee/DownloadShipping",{ShopID:t,OrderNumber:n}).subscribe(o=>{var c=Uint8Array.from(atob(o),v=>v.charCodeAt(0)),O=new Blob([c],{type:"octet/stream"});m.g.openDownloadFile(O,`${n}.pdf`)})}printShippingLabelLazada(n,t){this.http.post("api/v1/Shippinglabel/Lazada/DownloadShipping",{ShopID:t,OrderNumber:n}).subscribe(o=>{null!=o.result.data?window.open(o.result.data.pdf_url,"_blank"):this.toastr.error(o.message,"Cannot Print")})}exportOrders(n,t){return this.http.post("api/Orders/ExportOrder",n).pipe((0,s.b)(i=>{this.exportService.convertToCSV(i,t)}))}}x.\u0275fac=function(n){return new(n||x)(e.LFG(S.O),e.LFG(_.uw),e.LFG(j._W),e.LFG(I))},x.\u0275prov=e.Yz7({token:x,factory:x.\u0275fac});class y{constructor(n,t){this.http=n,this.toastr=t}acceptTokopediaOrders(n){return this.http.post("/api/Orders/AcceptOrderTokopedia",n).pipe((0,s.b)(t=>{this.tokopediaAcceptOrderHandler(t)}))}tokopediaAcceptOrderHandler(n){const t=n.filter(o=>0==o.Status),i=n.filter(o=>1==o.Status);if(0==t.length&&i.length>0){let o=`<ol>${this.generateSuccessMessage(i)}</ol>`;this.toastr.success(o,"Success",{enableHtml:!0})}else if(t.length>0&&i.length>0){let o=`<ol>\n ${this.generateSuccessMessage(i)}\n ${this.generateErrorMessage(t)}\n </ol>`;this.toastr.warning(o,"Warning",{enableHtml:!0})}else{let o=`<ol>${this.generateErrorMessage(t)}</ol>`;this.toastr.error(o,"Error",{enableHtml:!0})}}generateSuccessMessage(n){let t="";return n.forEach(i=>{t+=`<li><b>${i.OrderNumber}</b> was successfully Accept</li>`}),t}generateErrorMessage(n){let t="";return n.forEach(i=>{t+=`<li><b>${i.OrderNumber}</b> ${i.Message}</li>`}),t}}y.\u0275fac=function(n){return new(n||y)(e.LFG(S.O),e.LFG(j._W))},y.\u0275prov=e.Yz7({token:y,factory:y.\u0275fac});var w=d(7481),T=d(8796),A=d(2594);class b{constructor(){}set typeId(n){this.channelLogo=m.g.getChannelLogoByTypeId(n),this.initChannelName(n)}initChannelName(n){switch(n){case r.x.Tokopedia:this.channelName="Tokopedia";break;case r.x.Tiktok:this.channelName="Tiktok";break;case r.x.WooCommerce:this.channelName="WooCommerce";break;case r.x.ShopeeV2:this.channelName="Shopee";break;case r.x.Lazada:this.channelName="Lazada";break;case r.x.KalCare:this.channelName="Kalcare"}}}b.\u0275fac=function(n){return new(n||b)},b.\u0275cmp=e.Xpm({type:b,selectors:[["app-channel-logo"]],inputs:{typeId:"typeId"},decls:4,vars:2,consts:[[1,"d-flex","align-items-center"],[2,"width","20px",3,"src"],[1,"ms-3","fw-normal"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e._UZ(1,"img",1),e.TgZ(2,"span",2),e._uU(3),e.qZA()()),2&n&&(e.xp6(1),e.Q6J("src",t.channelLogo,e.LSH),e.xp6(2),e.Oqu(t.channelName))}});var N=d(9640);function ne(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"button",11),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().ngIf,c=e.oxw();return e.KtG(c.onAcceptOrder(o))}),e._UZ(2,"i",12),e._uU(3," Accept "),e.qZA(),e.BQk()}}function ae(a,n){if(1&a&&(e.ynx(0),e.YNc(1,ne,4,0,"ng-container",1),e.BQk()),2&a){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.isTokopediaAvailable&&t.isTokopediaSelected)}}function ie(a,n){if(1&a&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}function oe(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"th",25)(2,"input",26),e.NdJ("ngModelChange",function(o){e.CHM(t);const c=e.oxw(3);return e.KtG(c.isCheckAll=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(2).ngIf,c=e.oxw();return e.KtG(c.onSelectAllOrderData(o))}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw(3);e.xp6(2),e.Q6J("ngModel",t.isCheckAll)}}function re(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"input",26),e.NdJ("ngModelChange",function(o){e.CHM(t);const c=e.oxw(2).$implicit;return e.KtG(c.selected=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(4).ngIf,c=e.oxw();return e.KtG(c.onSelectOrderData(o))}),e.qZA(),e.BQk()}if(2&a){const t=e.oxw(2).$implicit;e.xp6(1),e.Q6J("ngModel",t.selected)}}function le(a,n){if(1&a&&(e.ynx(0),e.TgZ(1,"td"),e.YNc(2,re,2,1,"ng-container",1),e.qZA(),e.BQk()),2&a){const t=e.oxw().$implicit,i=e.oxw(3);e.xp6(2),e.Q6J("ngIf",t.Type==i.tokopediaType)}}function se(a,n){if(1&a&&(e.ynx(0),e.TgZ(1,"span"),e._uU(2),e.qZA(),e.BQk()),2&a){const t=e.oxw().$implicit;e.xp6(2),e.Oqu(t.Number)}}function pe(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(3);e.Q6J("href",i.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function ce(a,n){if(1&a&&(e.TgZ(0,"tr"),e.YNc(1,le,3,1,"ng-container",1),e.TgZ(2,"td"),e._uU(3),e.qZA(),e.TgZ(4,"td"),e.YNc(5,se,3,1,"ng-container",15),e.YNc(6,pe,2,2,"ng-template",null,27,e.W1O),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.ALo(12,"date"),e.qZA(),e.TgZ(13,"td"),e._UZ(14,"app-channel-logo",28),e.qZA()()),2&a){const t=n.$implicit,i=e.MAs(7),o=e.oxw(3);e.xp6(1),e.Q6J("ngIf",o.isTokopediaAvailable),e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",t.ID==o.guidEmpty)("ngIfElse",i),e.xp6(4),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.xi3(12,7,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.Type)}}function de(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",16)(2,"table",17)(3,"thead",18)(4,"tr",19),e.YNc(5,oe,3,1,"ng-container",1),e.TgZ(6,"th",20),e._uU(7,"Outlet"),e.qZA(),e.TgZ(8,"th",21),e._uU(9,"Order number"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Customer"),e.qZA(),e.TgZ(12,"th",22),e._uU(13,"Created On"),e.qZA(),e.TgZ(14,"th",22),e._uU(15,"Channel"),e.qZA()()(),e.TgZ(16,"tbody"),e.YNc(17,ce,15,10,"tr",23),e.qZA()(),e.TgZ(18,"app-mat-paginator-no-count",24),e.NdJ("total",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.getPaginatonTotal())})("next",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onNextPage())})("previous",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onPreviousPage())}),e.ALo(19,"async"),e.ALo(20,"async"),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw().ngIf,i=e.oxw();let o;e.xp6(5),e.Q6J("ngIf",i.isTokopediaAvailable&&t),e.xp6(12),e.Q6J("ngForOf",t),e.xp6(1),e.Q6J("filter",i.filter)("totaldata",null==(o=e.lcZ(19,5,i.newOrdersData$))?null:o.length)("paginationTotal",e.lcZ(20,7,i.paginationTotal$))}}function ue(a,n){if(1&a&&(e.ynx(0),e.YNc(1,de,21,9,"ng-container",15),e.BQk()),2&a){const t=n.ngIf;e.oxw();const i=e.MAs(26);e.xp6(1),e.Q6J("ngIf",(null==t?null:t.length)>0)("ngIfElse",i)}}function ge(a,n){1&a&&(e.TgZ(0,"div",30),e._UZ(1,"app-empty-state"),e.qZA())}class L{constructor(n,t,i,o,c){this.localDataService=n,this.channelService=t,this.orderService=i,this.toastr=o,this.acceptOrderService=c,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=m.g.GuidEMpty,this.tokopediaType=r.x.Tokopedia,this.isTokopediaSelected=!1,this.isTokopediaAvailable=!1,this.isCheckAll=!1}ngOnInit(){this.initLoadPage()}initLoadPage(){this.orderService.loadInitialPage().subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.getNewOrders()})}getNewOrders(){this.newOrdersData$=this.orderService.getNewOrders({PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).pipe((0,l.d)(),(0,s.b)(t=>{t.filter(o=>o.Type==r.x.Tokopedia)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID).pipe((0,l.d)())}onNextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getNewOrders()}onPreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getNewOrders()}onSelectOrderData(n){this.isTokopediaSelected=!1,n.filter(i=>i.selected).length>0&&(this.isTokopediaSelected=!0)}onSelectAllOrderData(n){n=n.map(t=>(t.Type==r.x.Tokopedia&&(t.selected=this.isCheckAll),t)),this.onSelectOrderData(n)}onAcceptOrder(n){let t=this.getSelectedTokopediaOrders(n);this.acceptOrderService.acceptTokopediaOrders(t).subscribe(i=>{this.isTokopediaSelected=!1,location.reload()})}getSelectedTokopediaOrders(n){return n.filter(i=>i.selected).map(i=>i.Number)}}function he(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"number"),e.qZA()()),2&a){const t=n.$implicit;e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(5,3,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(8,5,t.Price))}}function _e(a,n){if(1&a&&(e.TgZ(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),e._uU(5,"Outlet Info"),e.qZA()(),e.TgZ(6,"div",4)(7,"div",9),e._uU(8," Outlet : "),e.qZA(),e.TgZ(9,"div",9),e._uU(10),e.qZA()(),e.TgZ(11,"div",4)(12,"div",9),e._uU(13," Date : "),e.qZA(),e.TgZ(14,"div",9),e._uU(15),e.ALo(16,"date"),e.qZA()(),e.TgZ(17,"div",4)(18,"div",9),e._uU(19," Status : "),e.qZA(),e.TgZ(20,"div",9),e._uU(21),e.qZA()(),e.TgZ(22,"div",4)(23,"div",9),e._uU(24," Tax Type : "),e.qZA(),e.TgZ(25,"div",9),e._uU(26),e.qZA()(),e.TgZ(27,"div",4)(28,"div",9),e._uU(29," Due Date : "),e.qZA(),e.TgZ(30,"div",9),e._uU(31),e.ALo(32,"date"),e.qZA()()(),e.TgZ(33,"div",6)(34,"div",7)(35,"h3",8),e._uU(36,"Customer Info"),e.qZA()(),e.TgZ(37,"div",4)(38,"div",9),e._uU(39," Name : "),e.qZA(),e.TgZ(40,"div",9),e._uU(41),e.qZA()(),e.TgZ(42,"div",4)(43,"div",9),e._uU(44," Email : "),e.qZA(),e.TgZ(45,"div",9),e._uU(46),e.qZA()(),e.TgZ(47,"div",4)(48,"div",9),e._uU(49," Mobile : "),e.qZA(),e.TgZ(50,"div",9),e._uU(51),e.qZA()()()(),e.TgZ(52,"div",10)(53,"h3",11),e._uU(54,"Products Sold"),e.qZA(),e.TgZ(55,"div",12)(56,"table",13)(57,"thead",14)(58,"tr",15)(59,"th"),e._uU(60,"Code"),e.qZA(),e.TgZ(61,"th"),e._uU(62,"Quantity"),e.qZA(),e.TgZ(63,"th"),e._uU(64,"Price"),e.qZA()()(),e.TgZ(65,"tbody"),e.YNc(66,he,9,7,"tr",16),e.qZA()()()()()),2&a){const t=e.oxw();e.xp6(10),e.hij(" ",t.model.Outlet," "),e.xp6(5),e.hij(" ",e.xi3(16,9,t.model.Date,"dd MMM yyyy")," "),e.xp6(6),e.hij(" ",t.model.Delivery," "),e.xp6(5),e.hij(" ",t.model.TaxType," "),e.xp6(5),e.hij(" ",e.xi3(32,12,t.model.DueDate,"dd MMM yyyy")," "),e.xp6(10),e.hij(" ",t.model.Customer.Name," "),e.xp6(5),e.hij(" ",t.model.Customer.Email," "),e.xp6(5),e.hij(" ",t.model.Customer.Mobile," "),e.xp6(15),e.Q6J("ngForOf",t.model.Variants)}}L.\u0275fac=function(n){return new(n||L)(e.Y36(p.T),e.Y36(g.T),e.Y36(x),e.Y36(j._W),e.Y36(y))},L.\u0275cmp=e.Xpm({type:L,selectors:[["app-new-order"]],decls:27,vars:13,consts:[["headerTitle","1 - New Order","searchBoxPlaceHolder","Search Orders...",3,"hideSearchBox","onSubmit"],[4,"ngIf"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["EMPTY_STATE",""],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-check"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[2,"width","5px"],["type","checkbox",3,"ngModel","ngModelChange"],["NOT_EMPTY",""],[3,"typeId"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(){return t.getNewOrders()}),e.TgZ(1,"actions"),e.YNc(2,ae,2,1,"ng-container",1),e.ALo(3,"async"),e.qZA(),e.TgZ(4,"filters")(5,"div",2)(6,"div")(7,"h6"),e._uU(8,"Channel"),e.qZA(),e.TgZ(9,"ng-select",3),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(10,ie,3,2,"ng-template",4),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Number"),e.qZA(),e.TgZ(14,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(15,"div")(16,"h6"),e._uU(17,"Page Size"),e.qZA(),e.TgZ(18,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(19,"content")(20,"div",7)(21,"div",8)(22,"div",9),e.YNc(23,ue,2,2,"ng-container",1),e.ALo(24,"async"),e.YNc(25,ge,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n&&(e.Q6J("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",e.lcZ(3,9,t.newOrdersData$)),e.xp6(7),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",e.lcZ(24,11,t.newOrdersData$)))},dependencies:[u.sg,u.O5,h.Fj,h.wV,h.Wl,h.JJ,h.On,w.p,T.w9,T.ir,A.n,b,N.s,u.Ov,u.uU]});const me=function(){return["/menu/Order"]};class J{constructor(n,t){this.http=n,this.url=t,this.number=this.url.snapshot.queryParams.Number,this.outlet=this.url.snapshot.queryParams.Outlet}ngOnInit(){this.Load()}Load(){this.http.post("/api/orders/GetInvoiceDetail",{Number:this.number,Outlet:this.outlet}).subscribe(t=>{this.model=t})}}function fe(a,n){if(1&a&&(e.TgZ(0,"span",11),e._UZ(1,"img",12),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}J.\u0275fac=function(n){return new(n||J)(e.Y36(S.O),e.Y36(f.gz))},J.\u0275cmp=e.Xpm({type:J,selectors:[["app-detail-order"]],decls:7,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-secondary","btn-fill","btn-lg","me-3",3,"routerLink"],[1,"container"],["class","row",4,"ngIf"],[1,"row"],[1,"col-4"],[1,"border","my-3","py-3","col-12"],[1,"row","m-2"],[1,"text-center"],[1,"col"],[1,"col-8"],[1,"text-center","my-3","py-3"],[1,"table-responsive"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"a",1),e._uU(3,"Back"),e.qZA()(),e.TgZ(4,"content")(5,"div",2),e.YNc(6,_e,67,15,"div",3),e.qZA()()()),2&n&&(e.Q6J("headerTitle","Order #"+t.number)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(5,me)),e.xp6(4),e.Q6J("ngIf",t.model))},dependencies:[u.sg,u.O5,w.p,f.rH,u.JJ,u.uU]});const Te=function(){return["/menu/Order/detail"]},Ce=function(a,n){return{Number:a,Outlet:n}};function Ze(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Te))("queryParams",e.WLB(4,Ce,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function xe(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(2);e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function be(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"a",31),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,c=e.oxw(2);return e.KtG(c.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",32),e.qZA()}}function ve(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ze,2,7,"a",24),e.YNc(5,xe,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",26),e.qZA(),e.TgZ(16,"td",27),e.YNc(17,be,2,0,"a",28),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==i.channelType.ShopeeV2||t.TypeID==i.channelType.Tokopedia||t.TypeID==i.channelType.Tiktok||t.TypeID==i.channelType.Lazada)}}function Se(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr",16)(5,"th",17),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",19),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",20),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",20),e._uU(16,"Channel"),e.qZA(),e._UZ(17,"th",21),e.qZA()(),e.TgZ(18,"tbody"),e.YNc(19,ve,18,13,"tr",22),e.qZA()(),e.TgZ(20,"app-mat-paginator-no-count",23),e.NdJ("total",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.StoreRowsCountAPIResult())})("next",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.NextPage())})("previous",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(19),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal)}}function we(a,n){1&a&&(e.TgZ(0,"div",33),e._UZ(1,"app-empty-state"),e.qZA())}class Q{constructor(n,t,i,o,c){this.http=n,this.localDataService=t,this.dialog=i,this.orderService=o,this.channelService=c,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0,this.checkboxState=!1,this.channelType=r.x}ngOnInit(){this.Load()}getChannelLogo(n){return m.g.getChannelLogoByTypeId(n)}hasGuidEmpty(n){return n==m.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetReadyToShip",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}onPrintShippingLabel(n,t,i){switch(i){case r.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case r.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case r.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t);break;case r.x.Lazada:this.orderService.printShippingLabelLazada(n,t)}}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Unsent",ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}function De(a,n){if(1&a&&(e.TgZ(0,"span",11),e._UZ(1,"img",12),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}Q.\u0275fac=function(n){return new(n||Q)(e.Y36(S.O),e.Y36(p.T),e.Y36(_.uw),e.Y36(x),e.Y36(g.T))},Q.\u0275cmp=e.Xpm({type:Q,selectors:[["app-ready-to-ship"]],decls:23,vars:8,consts:[["headerTitle","2 - Ready to Ship","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container","",1,""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","60px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(7,fe,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(16,"content")(17,"div",6)(18,"div",7)(19,"div",8),e.YNc(20,Se,21,4,"ng-container",9),e.YNc(21,we,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(22);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",i)}},dependencies:[u.sg,u.O5,h.Fj,h.wV,h.JJ,h.On,w.p,f.rH,T.w9,T.ir,A.n,b,N.s,u.JJ,u.uU]});const ye=function(){return["/menu/Order/detail"]},Ae=function(a,n){return{Number:a,Outlet:n}};function Ne(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,ye))("queryParams",e.WLB(4,Ae,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Pe(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(2);e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Oe(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"a",31),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,c=e.oxw(2);return e.KtG(c.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",32),e.qZA()}}function Ie(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ne,2,7,"a",24),e.YNc(5,Pe,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",26),e.qZA(),e.TgZ(16,"td",27),e.YNc(17,Oe,2,0,"a",28),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==i.channelType.ShopeeV2||t.TypeID==i.channelType.Tokopedia||t.TypeID==i.channelType.Tiktok||t.TypeID==i.channelType.Lazada)}}function Me(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr",16)(5,"th",17),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",19),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",20),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",20),e._uU(16,"Channel"),e.qZA(),e._UZ(17,"th",21),e.qZA()(),e.TgZ(18,"tbody"),e.YNc(19,Ie,18,13,"tr",22),e.qZA()(),e.TgZ(20,"app-mat-paginator-no-count",23),e.NdJ("total",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.StoreRowsCountAPIResult())})("next",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.NextPage())})("previous",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(19),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal)}}function qe(a,n){1&a&&(e.TgZ(0,"div",33),e._UZ(1,"app-empty-state"),e.qZA())}class E{constructor(n,t,i,o){this.http=n,this.localDataService=t,this.orderService=i,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0,this.channelType=r.x}ngOnInit(){this.Load()}getChannelLogo(n){return m.g.getChannelLogoByTypeId(n)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}hasGuidEmpty(n){return n==m.g.GuidEMpty}Get(n){this.http.post("api/orders/GetShipped",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}onPrintShippingLabel(n,t,i){switch(i){case r.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case r.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case r.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t);break;case r.x.Lazada:this.orderService.printShippingLabelLazada(n,t)}}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}E.\u0275fac=function(n){return new(n||E)(e.Y36(S.O),e.Y36(p.T),e.Y36(x),e.Y36(g.T))},E.\u0275cmp=e.Xpm({type:E,selectors:[["app-shipped"]],decls:23,vars:8,consts:[["headerTitle","3 - Shipped","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","60px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(7,De,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(16,"content")(17,"div",6)(18,"div",7)(19,"div",8),e.YNc(20,Me,21,4,"ng-container",9),e.YNc(21,qe,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(22);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",i)}},dependencies:[u.sg,u.O5,h.Fj,h.wV,h.JJ,h.On,w.p,f.rH,T.w9,T.ir,A.n,b,N.s,u.JJ,u.uU]});var Ue=d(501);function ke(a,n){if(1&a&&(e.TgZ(0,"span",11),e._UZ(1,"img",12),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}const Le=function(){return["/menu/Order/detail"]},Je=function(a,n){return{Number:a,Outlet:n}};function Qe(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Le))("queryParams",e.WLB(4,Je,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Ee(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(2);e.Q6J("href",i.customerInfoUrl+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Ye(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"a",31),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,c=e.oxw(2);return e.KtG(c.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",32),e.qZA()}}function Ge(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Qe,2,7,"a",24),e.YNc(5,Ee,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",26),e.qZA(),e.TgZ(16,"td",27),e.YNc(17,Ye,2,0,"a",28),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==i.channelType.ShopeeV2||t.TypeID==i.channelType.Tokopedia||t.TypeID==i.channelType.Tiktok)}}function Fe(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr",16)(5,"th",17),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",19),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",20),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",20),e._uU(16,"Channel"),e.qZA(),e._UZ(17,"th",21),e.qZA()(),e.TgZ(18,"tbody"),e.YNc(19,Ge,18,13,"tr",22),e.qZA()(),e.TgZ(20,"app-mat-paginator-no-count",23),e.NdJ("total",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.StoreRowsCountAPIResult())})("next",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.NextPage())})("previous",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(19),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal)}}function He(a,n){1&a&&(e.TgZ(0,"div",33),e._UZ(1,"app-empty-state"),e.qZA())}class Y{constructor(n,t,i,o){this.http=n,this.orderService=t,this.authService=i,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0,this.channelType=r.x}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==m.g.GuidEMpty}getChannelLogo(n){return m.g.getChannelLogoByTypeId(n)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.customerInfoUrl=`${this.authService.getDomain()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetDelivered ",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Paid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}onPrintShippingLabel(n,t,i){switch(i){case r.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case r.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case r.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t)}}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}function Re(a,n){if(1&a&&(e.TgZ(0,"span",11),e._UZ(1,"img",12),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}Y.\u0275fac=function(n){return new(n||Y)(e.Y36(S.O),e.Y36(x),e.Y36(Ue.e),e.Y36(g.T))},Y.\u0275cmp=e.Xpm({type:Y,selectors:[["app-delivered"]],decls:23,vars:9,consts:[["headerTitle","4 - Completed","searchBoxPlaceHolder","Search ...",3,"hideSearchBox","onSubmit"],["container","",1,""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","60px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(7,ke,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(16,"content")(17,"div",6)(18,"div",7)(19,"div",8),e.YNc(20,Fe,21,4,"ng-container",9),e.YNc(21,He,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(22);e.Q6J("hideSearchBox",!0),e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",i)}},dependencies:[u.sg,u.O5,h.Fj,h.wV,h.JJ,h.On,w.p,f.rH,T.w9,T.ir,A.n,b,N.s,u.JJ,u.uU]});const ze=function(){return["/menu/Order/detail"]},$e=function(a,n){return{Number:a,Outlet:n}};function Be(a,n){if(1&a&&(e.TgZ(0,"a",27),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,ze))("queryParams",e.WLB(4,$e,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function je(a,n){if(1&a&&(e.TgZ(0,"a",28),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(2);e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Ke(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Be,2,7,"a",24),e.YNc(5,je,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._uU(15),e.qZA(),e.TgZ(16,"td"),e._UZ(17,"app-channel-logo",26),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Oqu(t.State),e.xp6(2),e.Q6J("typeId",t.TypeID)}}function Ve(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr",16)(5,"th",17),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",19),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",20),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",21),e._uU(16,"Status"),e.qZA(),e.TgZ(17,"th",20),e._uU(18,"Channel"),e.qZA()()(),e.TgZ(19,"tbody"),e.YNc(20,Ke,18,13,"tr",22),e.qZA()(),e.TgZ(21,"app-mat-paginator-no-count",23),e.NdJ("total",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.StoreRowsCountAPIResult())})("next",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.NextPage())})("previous",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(20),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal)}}function We(a,n){1&a&&(e.TgZ(0,"div",29),e._UZ(1,"app-empty-state"),e.qZA())}class G{constructor(n,t,i){this.http=n,this.localDataService=t,this.channelService=i,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==m.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetAll ",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter=n,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!1,ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}function Xe(a,n){if(1&a&&(e.TgZ(0,"span",11),e._UZ(1,"img",12),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}G.\u0275fac=function(n){return new(n||G)(e.Y36(S.O),e.Y36(p.T),e.Y36(g.T))},G.\u0275cmp=e.Xpm({type:G,selectors:[["app-all-order"]],decls:23,vars:8,consts:[["headerTitle","All","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","135px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(7,Re,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(16,"content")(17,"div",6)(18,"div",7)(19,"div",8),e.YNc(20,Ve,22,4,"ng-container",9),e.YNc(21,We,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(22);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",i)}},dependencies:[u.sg,u.O5,h.Fj,h.wV,h.JJ,h.On,w.p,f.rH,T.w9,T.ir,A.n,b,N.s,u.JJ,u.uU]});const et=function(){return["/menu/Order/detail"]},tt=function(a,n){return{Number:a,Outlet:n}};function nt(a,n){if(1&a&&(e.TgZ(0,"a",26),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,et))("queryParams",e.WLB(4,tt,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function at(a,n){if(1&a&&(e.TgZ(0,"a",27),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(2);e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function it(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,nt,2,7,"a",23),e.YNc(5,at,2,2,"a",24),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",25),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,7,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,9,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID)}}function ot(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr",16)(5,"th",17),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",19),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",20),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",20),e._uU(16,"Channel"),e.qZA()()(),e.TgZ(17,"tbody"),e.YNc(18,it,16,12,"tr",21),e.qZA()(),e.TgZ(19,"app-mat-paginator-no-count",22),e.NdJ("total",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.StoreRowsCountAPIResult())})("next",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.NextPage())})("previous",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(18),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal)}}function rt(a,n){1&a&&(e.TgZ(0,"div",28),e._UZ(1,"app-empty-state"),e.qZA())}class F{constructor(n,t,i){this.http=n,this.localDataService=t,this.channelService=i,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==m.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetCancelled ",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!0,ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}getChannelLogo(n){return m.g.getChannelLogoByTypeId(n)}}F.\u0275fac=function(n){return new(n||F)(e.Y36(S.O),e.Y36(p.T),e.Y36(g.T))},F.\u0275cmp=e.Xpm({type:F,selectors:[["app-cancelled"]],decls:23,vars:8,consts:[["headerTitle","99 - Cancelled","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container","",1,""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(7,Xe,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(16,"content")(17,"div",6)(18,"div",7)(19,"div",8),e.YNc(20,ot,20,4,"ng-container",9),e.YNc(21,rt,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(22);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",i)}},dependencies:[u.sg,u.O5,h.Fj,h.wV,h.JJ,h.On,w.p,f.rH,T.w9,T.ir,A.n,b,N.s,u.JJ,u.uU]});var lt=d(2138),P=(()=>{return(a=P||(P={}))[a.DoNothing=0]="DoNothing",a[a.New=1]="New",a[a.Update=2]="Update",P;var a})(),st=d(6082),H=d(9602),R=d(8425),W=d(266);function pt(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",28)(2,"button",29),e.NdJ("click",function(){e.CHM(t),e.oxw();const o=e.MAs(11);return e.KtG(o.previous())}),e._uU(3," Back "),e.qZA(),e.TgZ(4,"button",30),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),c=e.MAs(11);return e.KtG(o.onNext(c))}),e._uU(5," Next "),e.qZA(),e.TgZ(6,"button",31),e._UZ(7,"b",32),e.qZA(),e.TgZ(8,"ul",33)(9,"li",34)(10,"a",35),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.exportOrders())}),e._uU(11," Export "),e.qZA()()()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(4),e.Q6J("disabled",t.checkDisabledNextFilter())}}function ct(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"button",36),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),c=e.MAs(11);return e.KtG(o.onNext(c))}),e._uU(1," Next "),e.qZA()}if(2&a){const t=e.oxw();e.Q6J("disabled",t.checkDisabledNextFilter())}}function dt(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),c=e.MAs(11);return e.KtG(o.onNew(c))}),e._UZ(1,"i",38),e._uU(2," New "),e.qZA()}}function ut(a,n){1&a&&e._uU(0,"Filter")}function gt(a,n){if(1&a&&(e.TgZ(0,"ng-option",39),e._UZ(1,"img",40),e._uU(2),e.qZA()),2&a){const t=n.$implicit;e.Q6J("value",t.ID),e.xp6(1),e.s9C("src",t.Img,e.LSH),e.xp6(1),e.hij("",t.Name," ")}}function ht(a,n){1&a&&e._uU(0,"Preview")}function _t(a,n){if(1&a&&(e.TgZ(0,"th",58),e._uU(1),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Oqu(0==t.getTypeID()?"Last Status Update":"Created Date")}}function mt(a,n){if(1&a&&(e.TgZ(0,"td"),e._uU(1),e.ALo(2,"date"),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.Date,"dd MMM yyyy HH:mm:ss"),"")}}function ft(a,n){if(1&a&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",t.ActionString," ")}}function Tt(a,n){if(1&a&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&a){const t=n.$implicit;e.xp6(1),e.hij("",t," ")}}function Ct(a,n){if(1&a&&(e.TgZ(0,"ul",63),e.YNc(1,Tt,2,1,"li",59),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.ActionString)}}function Zt(a,n){if(1&a&&(e.TgZ(0,"span",64),e._UZ(1,"i",65),e.qZA()),2&a){const t=e.oxw().$implicit;e.hYB("title","Delivery : ",t.DeliveryState," \nPayment : ",t.PaymentState,"")}}const xt=function(a,n){return{"over-due-today":a,"over-due":n}};function bt(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.YNc(5,mt,3,4,"td",1),e.TgZ(6,"td")(7,"span"),e._uU(8),e.qZA(),e._uU(9),e.qZA(),e.TgZ(10,"td",60)(11,"span"),e._uU(12),e.qZA(),e._uU(13),e.qZA(),e.TgZ(14,"td"),e.YNc(15,ft,2,1,"span",1),e.YNc(16,Ct,2,1,"ul",61),e.qZA(),e.TgZ(17,"td"),e.YNc(18,Zt,2,2,"span",62),e.qZA()()),2&a){const t=n.$implicit,i=n.index,o=e.oxw(3);e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Oqu(t.Number),e.xp6(1),e.Q6J("ngIf",o.getTypeID()!=o.channelType.ShopeeV2),e.xp6(3),e.hij("",t.ChannelStatus," - "),e.xp6(1),e.Oqu(t.ChannelStatusDescription),e.xp6(1),e.Q6J("ngClass",e.WLB(12,xt,(null==t?null:t.Action)==o.actionPreviewOrder.Update,(null==t?null:t.Action)==o.actionPreviewOrder.New))("matTooltip",91==t.POSStatus||"Conflict"==t.POSStatusDescription?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),e.xp6(2),e.hij("",t.POSStatus," - "),e.xp6(1),e.hij("",t.POSStatusDescription," "),e.xp6(2),e.Q6J("ngIf",1==t.ActionString.length),e.xp6(1),e.Q6J("ngIf",t.ActionString.length>1),e.xp6(2),e.Q6J("ngIf",99!=t.ChannelStatus&&99!=t.POSStatus)}}function vt(a,n){if(1&a&&(e.ynx(0),e.YNc(1,bt,19,15,"tr",59),e.BQk()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.displayedPreviewData)}}function St(a,n){1&a&&(e.TgZ(0,"tr",66)(1,"td",67)(2,"div",68),e._UZ(3,"i",69),e.qZA(),e.TgZ(4,"h4",70),e._uU(5,"There is no order to processed"),e.qZA()()())}function wt(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"div",41)(1,"div",42)(2,"div",43)(3,"ul",44)(4,"li",45)(5,"button",46),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.ALL))}),e._uU(6),e.qZA()(),e.TgZ(7,"li",45)(8,"button",47),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.SYNC))}),e._uU(9),e.qZA()(),e.TgZ(10,"li",45)(11,"button",48),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.WRONG))}),e._uU(12),e.qZA()(),e.TgZ(13,"li",45)(14,"button",49),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.UNSYNC))}),e._uU(15),e.qZA()()()(),e.TgZ(16,"table",50)(17,"thead",51)(18,"tr"),e._UZ(19,"th",52),e.TgZ(20,"th",53),e._uU(21,"Number"),e.qZA(),e.YNc(22,_t,2,1,"th",54),e.TgZ(23,"th",55),e._uU(24,"Channel Status"),e.qZA(),e.TgZ(25,"th",55),e._uU(26,"POS Status"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Action"),e.qZA(),e._UZ(29,"th",52),e.qZA()(),e.TgZ(30,"tbody"),e.YNc(31,vt,2,1,"ng-container",56),e.YNc(32,St,6,0,"ng-template",null,57,e.W1O),e.qZA()()()()}if(2&a){const t=e.MAs(33),i=e.oxw();e.xp6(5),e.Q6J("ngClass","all"==i.pillStatus?"btn-secondary text-white":"btn-outline-dark"),e.xp6(1),e.hij("All (",i.allData,")"),e.xp6(2),e.Q6J("ngClass","sync"==i.pillStatus?"btn-success":"btn-outline-success"),e.xp6(1),e.hij("Existing (",i.syncData,")"),e.xp6(2),e.Q6J("ngClass","wrong"==i.pillStatus?"btn-warning text-white":"btn-outline-warning"),e.xp6(1),e.hij("Wrong Status (",i.wrongData,")"),e.xp6(2),e.Q6J("ngClass","unsync"==i.pillStatus?"btn-danger":"btn-outline-danger"),e.xp6(1),e.hij("Missing (",i.unsyncData,")"),e.xp6(7),e.Q6J("ngIf",i.getTypeID()!=i.channelType.ShopeeV2),e.xp6(9),e.Q6J("ngIf",i.displayedPreviewData.length>0)("ngIfElse",t)}}function Dt(a,n){1&a&&e._uU(0,"Finish")}const yt=function(a){return{"over-due":a}};function At(a,n){if(1&a&&(e.TgZ(0,"tr",73)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA()()),2&a){const t=n.$implicit,i=n.index;e.Q6J("ngClass",e.VKq(5,yt,t.Exception)),e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Status),e.xp6(2),e.Oqu(t.Exception)}}function Nt(a,n){if(1&a&&(e.ynx(0),e.YNc(1,At,9,7,"tr",72),e.BQk()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.downloadData)}}function Pt(a,n){1&a&&(e.TgZ(0,"tr",66)(1,"td",67)(2,"div",68),e._UZ(3,"i",69),e.qZA(),e.TgZ(4,"h4",70),e._uU(5,"There is no order to processed"),e.qZA()()())}function Ot(a,n){if(1&a&&(e.TgZ(0,"div",41)(1,"div",42)(2,"table",50)(3,"thead",51)(4,"tr"),e._UZ(5,"th",52),e.TgZ(6,"th"),e._uU(7,"Order Number"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Status"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Exception"),e.qZA()()(),e.TgZ(12,"tbody"),e.YNc(13,Nt,2,1,"ng-container",56),e.YNc(14,Pt,6,0,"ng-template",null,71,e.W1O),e.qZA()()()()),2&a){const t=e.MAs(15),i=e.oxw();e.xp6(13),e.Q6J("ngIf",(null==i.downloadData?null:i.downloadData.length)>0)("ngIfElse",t)}}function It(a,n){1&a&&e._UZ(0,"i",74)}function Mt(a,n){1&a&&e._UZ(0,"i",75)}function qt(a,n){1&a&&e._UZ(0,"i",76)}var C=(()=>{return(a=C||(C={})).ALL="all",a.SYNC="sync",a.WRONG="wrong",a.UNSYNC="unsync",C;var a})();class z{constructor(n,t,i,o,c,O){this.http=n,this.toastr=t,this.datePipe=i,this.url=o,this.productService=c,this.orderService=O,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=r.x,this.previewStatus=C,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=P}ngOnInit(){this.initPageLoader(),this.url.queryParams.subscribe(n=>{this.channelID=n.ChannelID,this.startDate=new Date(n.Date),this.endDate=new Date(n.Date)})}initPageLoader(){this.productService.loader().subscribe(n=>{this.channelOptions=n.Options.Channel})}onDownload(n){this.http.post("/api/Orders/Download",{ID:this.channelID,From:this.startDate,To:this.endDate,ListPreview:this.downloadedPreviewData}).subscribe(i=>{this.downloadData=i.Body,this.onStepperNext(n)})}onPreview(n){this.validateDatePreview()&&this.http.post("/api/Orders/Preview",{ID:this.channelID,From:this.startDate,To:this.endDate}).subscribe(i=>{0!=i.length?(this.previewData=i,this.groupingPreviewData(),this.filterPreviewData(C.ALL),this.initLengthStatusData(),this.onStepperNext(n)):this.toastrEmptyPreview()})}toastrEmptyPreview(){this.toastr.info("There is no orders from "+this.datePipe.transform(this.startDate,"dd MMM yyyy")+" to "+this.datePipe.transform(this.endDate,"dd MMM yyyy")+" !","No Orders!")}validateDatePreview(){let n=!0;return m.g.getDaysDiff(this.startDate,this.endDate)>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Failed"),n=!1),n}setPageTitle(n){this.pageTitle=`\n ${n} (${this.getDateTitle()})\n `}getDateTitle(){const n=m.g.formatTitleFromDate(new Date(this.startDate),new Date(this.endDate)),t=this.datePipe.transform(this.startDate,n);return`${null==n?"":t+"-"} ${this.datePipe.transform(this.endDate,"dd MMM yyyy")}`}onNew(n){this.channelID=null,this.startDate=null,this.endDate=null,this.pageTitle="Download to POS",n.reset()}groupingPreviewData(){let n=this.filterDataByStatus(C.UNSYNC),t=this.filterDataByStatus(C.WRONG);this.downloadedPreviewData=[...n,...t]}filterDataByStatus(n){let t=[];switch(n){case C.ALL:t=this.previewData;break;case C.SYNC:t=this.previewData.filter(i=>i.Action==P.DoNothing);break;case C.WRONG:t=this.previewData.filter(i=>i.Action==P.Update);break;case C.UNSYNC:t=this.previewData.filter(i=>i.Action==P.New)}return t}filterPreviewData(n){this.pillStatus=n,this.displayedPreviewData=this.filterDataByStatus(n)}initLengthStatusData(){this.wrongData=this.filterDataByStatus(C.WRONG).length,this.allData=this.previewData.length,this.syncData=this.filterDataByStatus(C.SYNC).length,this.unsyncData=this.filterDataByStatus(C.UNSYNC).length}getTypeID(){var n=this.channelOptions.find(t=>t.ID==this.channelID)?.TypeID;return n??0}onStepperChange(n){this.currentState=n.selectedStep.state}onStepperNext(n){n.selected.completed=!0,n.next()}onNext(n){switch(this.currentState){case"filter":this.onPreview(n);break;case"preview":this.onDownload(n)}}stepChange(n){switch(n?.selectedStep?.state){case"filter":this.pageTitle="Download To POS",this.resetPreviewData();break;case"preview":let t=this.productService.findChannelById(this.channelID,this.channelOptions);this.setPageTitle(`Preview ${t?.Name}`);break;case"finish":this.setPageTitle("Download")}}resetPreviewData(){this.displayedPreviewData=[],this.previewData=[],this.initLengthStatusData()}checkDisabledNextFilter(){let n=!m.g.isValidDate(this.startDate)||!m.g.isValidDate(this.endDate),t=m.g.IsEmpty(this.channelID);return n||t}exportOrders(){let n={ID:this.channelID,From:this.startDate,To:this.endDate};const t=`Orders ${this.getDateTitle()}`;this.orderService.exportOrders(n,t).subscribe()}}z.\u0275fac=function(n){return new(n||z)(e.Y36(S.O),e.Y36(j._W),e.Y36(u.uU),e.Y36(f.gz),e.Y36(st.M),e.Y36(x))},z.\u0275cmp=e.Xpm({type:z,selectors:[["app-download"]],features:[e._Bn([{provide:lt.gx,useValue:{displayDefaultIndicatorType:!1}}])],decls:47,vars:20,consts:[[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2","type","button",3,"disabled","click",4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2",3,"click",4,"ngIf"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["labelPosition","bottom","linear","",1,"w-100","stepper-download",3,"ngClass","selectionChange"],["stepper",""],["state","filter",3,"editable","completed"],["matStepLabel",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-6"],[1,"text-muted"],["appendTo","body",3,"clearable","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-1rem"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModel","ngModelChange","click"],["matEndDate","","placeholder","End date",3,"ngModel","ngModelChange","click"],["picker",""],["state","preview",3,"editable","completed"],["class","row pt-2",4,"ngIf"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","border-end-0",3,"disabled","click"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-end",2,"min-width","85px !important"],[1,"dropdown-item"],[3,"click"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"disabled","click"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"nav","nav-pills"],[1,"nav-item","mx-3"],[1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["EMPTY",""],["width","15%"],[4,"ngFor","ngForOf"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],["EMPTY_DOWNLOAD",""],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"fa-solid","fa-filter"],[1,"fa-solid","fa-file"],[1,"fa-sharp","fa-solid","fa-flag"]],template:function(n,t){if(1&n){const i=e.EpF();e.TgZ(0,"mainpanel",0)(1,"actions"),e.YNc(2,pt,12,1,"ng-container",1),e.YNc(3,ct,2,1,"button",2),e.YNc(4,dt,3,0,"button",3),e.qZA(),e.TgZ(5,"content")(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7)(10,"mat-stepper",8,9),e.NdJ("selectionChange",function(c){return t.stepChange(c)})("selectionChange",function(c){return t.onStepperChange(c)}),e.TgZ(12,"mat-step",10),e.YNc(13,ut,1,0,"ng-template",11),e.TgZ(14,"div",12)(15,"div",6)(16,"div",5)(17,"div",13)(18,"h5"),e._uU(19,"Select a Channel"),e.qZA(),e.TgZ(20,"p",14),e._uU(21,"Select Channel want to download order"),e.qZA()(),e.TgZ(22,"div",13)(23,"ng-select",15),e.NdJ("ngModelChange",function(c){return t.channelID=c}),e.YNc(24,gt,3,3,"ng-option",16),e.qZA()()(),e.TgZ(25,"div",17)(26,"div",13)(27,"h5"),e._uU(28,"Date Range"),e.qZA(),e.TgZ(29,"p",14),e._uU(30,"Select transaction date of the channel you want to download (Max 2 Weeks)"),e.qZA()(),e.TgZ(31,"div",13)(32,"div",6)(33,"mat-date-range-input",18)(34,"input",19),e.NdJ("ngModelChange",function(c){return t.startDate=c})("click",function(){e.CHM(i);const c=e.MAs(37);return e.KtG(c.open())}),e.qZA(),e.TgZ(35,"input",20),e.NdJ("ngModelChange",function(c){return t.endDate=c})("click",function(){e.CHM(i);const c=e.MAs(37);return e.KtG(c.open())}),e.qZA()(),e._UZ(36,"mat-date-range-picker",null,21),e.qZA()()()()()(),e.TgZ(38,"mat-step",22),e.YNc(39,ht,1,0,"ng-template",11),e.YNc(40,wt,34,11,"div",23),e.qZA(),e.TgZ(41,"mat-step",24),e.YNc(42,Dt,1,0,"ng-template",11),e.YNc(43,Ot,16,2,"div",23),e.qZA(),e.YNc(44,It,1,0,"ng-template",25),e.YNc(45,Mt,1,0,"ng-template",26),e.YNc(46,qt,1,0,"ng-template",27),e.qZA()()()()()()()}if(2&n){const i=e.MAs(11),o=e.MAs(37);e.Q6J("headerTitle",t.pageTitle)("description",t.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("ngIf","preview"==t.currentState),e.xp6(1),e.Q6J("ngIf","filter"==t.currentState),e.xp6(1),e.Q6J("ngIf","finish"==t.currentState),e.xp6(6),e.s9C("ngClass","last-edited-step-"+i.selectedIndex),e.xp6(2),e.Q6J("editable","finish"!=t.currentState)("completed",!1),e.xp6(11),e.Q6J("clearable",!1)("ngModel",t.channelID),e.xp6(1),e.Q6J("ngForOf",t.channelOptions),e.xp6(9),e.Q6J("rangePicker",o),e.xp6(1),e.Q6J("ngModel",t.startDate),e.xp6(1),e.Q6J("ngModel",t.endDate),e.xp6(3),e.Q6J("editable","finish"!=t.currentState)("completed",!1),e.xp6(2),e.Q6J("ngIf","preview"==t.currentState),e.xp6(3),e.Q6J("ngIf","finish"==t.currentState)}},dependencies:[u.mk,u.sg,u.O5,h.Fj,h.JJ,h.On,w.p,T.w9,T.jq,H.wx,H.zY,H.By,H._g,R.C0,R.VY,R.Vq,R.z9,W.gM,u.uU],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container mat-step-header>div.mat-step-label{padding-top:8px} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}"]});var D=d(8063);const Ut=[{path:"",component:Z,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:L,canActivate:[D.a],data:{title:"New Order"}},{path:"detail",component:J,canActivate:[D.a],data:{title:"Orders detail"}},{path:"ready_to_ship",component:Q,canActivate:[D.a],data:{title:"Ready To Ship"}},{path:"Shipped",component:E,canActivate:[D.a],data:{title:"Shipped"}},{path:"Delivered",component:Y,canActivate:[D.a],data:{title:"Delivered"}},{path:"All",component:G,canActivate:[D.a],data:{title:"All Order"}},{path:"Cancelled",component:F,canActivate:[D.a],data:{title:"Cancelled"}},{path:"Download",component:z,canActivate:[D.a],data:{title:"Download"}}]}];class M{}M.\u0275fac=function(n){return new(n||M)},M.\u0275mod=e.oAB({type:M}),M.\u0275inj=e.cJS({imports:[u.ez,f.Bz.forChild(Ut)]});var kt=d(8739),Lt=d(3238),Jt=d(1108),Qt=d(4385);class q{}q.\u0275fac=function(n){return new(n||q)},q.\u0275mod=e.oAB({type:q}),q.\u0275inj=e.cJS({providers:[x,y],imports:[u.ez,h.u5,M,B.Z,w.R,kt.TU,f.Bz,T.A0,H.FA,Lt.XK,A.n,R.T5,W.AV,Jt.f,K.p9,_.Is,Qt.LD,N.s]})},6082:(X,$,d)=>{d.d($,{M:()=>Z});var u=d(8505),f=d(1889),U=d(4650),e=d(1318),B=d(7185);class Z{constructor(l,s){this.httpService=l,this.toastrService=s}loader(l=f.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:l})}LoadInPOS(l=f.g.GuidEMpty){return this.httpService.post("/api/product/LoadInPOS",{ID:l})}filterChannelByTypeId(l,s){return l.filter(r=>-1!==s.findIndex(p=>r.TypeID==p))}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(l){return this.httpService.post("/api/product/TotalProductLive",{ID:l})}clearCacheChannel(l){return this.httpService.post("/api/Channel/ClearCacheChannel",{ID:l})}uploadSingleProduct(l,s){return this.httpService.post("api/product/UploadMultipleChannel",{Channel:s,Products:l})}uploadMultipleProduct(l,s){return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",{Channel:s,Products:l})}scanSingle(l,s){return this.httpService.post("/api/product/ScanSingle",{ID:l,SKU:s})}scanNotInChannel(l){return this.httpService.post("/api/product/ScanNotinChannel",{ID:l})}findAllSoldInChannel(l){return this.httpService.post("/api/product/GetSoldInChannel",l)}scanAll(l,s,r,p=!1){return this.httpService.post("/api/product/ScanOptimized",{ID:l,ScanFull:s,UpdatedProduct:r,Async:p})}scanCompareToPos(l){return this.httpService.post("/api/product/CompareMarketplaceToPOS",l)}getVariantCodesProduct(l){return l.Variants.map(r=>r.Code)}downloadMultipleProduct(l){let s=l.map(r=>({ChannelItemID:r.ChannelItemID,ChannelID:r.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",s).pipe((0,u.b)(r=>{this.toastrService.success(`${r.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(l){return this.httpService.post("/api/product/DownloadProductFromChannel",{ChannelItemID:l.ChannelItemID,ChannelID:l.ChannelID}).pipe((0,u.b)(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(l=[]){let s=[];return l.forEach(r=>{r.Variants.forEach(p=>{s=[...s,p.Code]})}),s}filterUnselectedChannel(l,s){let p,r=[];if(l.forEach(g=>{r=[...r,...g.Channel]}),r&&0!=r.length){let g=[];p=s.filter(_=>(g=r.filter(h=>h.ChannelID==_.ID),g.length!==l.length))}else p=s;return p}findChannelById(l,s){return s.find(r=>r.ID==l)}sortChannel(l=[]){return l.sort((s,r)=>s.TypeID<r.TypeID?1:s.TypeID===r.TypeID?0:-1)}hasSelection(l=[]){return this.selectedProduct(l).length>0}selectedProduct(l=[]){return l.filter(s=>s.selected)}hasSelectionVariant(l){return this.selectedVariantProduct(l).length>0}selectedVariantProduct(l){let s=[];return l.forEach(r=>{s=[...s,...null!=r.Variants?r.Variants.filter(p=>p.selected):""]}),s}getChannelProduct(l){const s=l.Variants;let r=[];for(let p of s)if(null!=p.Channel)for(let g of p.Channel)0==r.filter(_=>_.ChannelID==g.ChannelID).length&&r.push(g);return this.sortChannel(r)}successToastrScanAllProduct(l,s,r){if(r){const p=l?.NotInPOS?.Product?l?.NotInPOS?.Product:0,g=l?.InChannel?.Product?l?.InChannel?.Product:0;this.toastrService.success(`\n ${p+g} found in ${s.Name} </br>\n (${g} In POS + ${p} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastrService.success(`${l.InChannel?l.InChannel.Product:0} product updates in ${s.Name} </br> \n since ${l.LastUpdate}`,"Scan Complete!",{enableHtml:!0})}checkProductHasScanButton(l,s){let r;return l.map(p=>(p.Channel=this.getChannelProduct(p),r=this.filterUnselectedChannel([p],s),p.hasScan=r.length>0,p))}checkProductHasUploadBtn(l,s){let r;return l.map(p=>(p.Channel=this.getChannelProduct(p),r=this.filterUnselectedChannel([p],s),p.hasUpload=r.length>0,p))}showToastrUploadMultiple(l=[]){let s=[],r=[];if(l.forEach(p=>{"string"==typeof p?.Response?r=[...r,`<li>${p.Response}</li>`]:(p?.Response?.Success.forEach(g=>{s=[...s,`<li>Product ${g} was <b>successfully</b> uploaded to ${p.Name}</li>`]}),p?.Response.Fail.forEach(g=>{r=[...r,`<li>${g}</li>`]}))}),r.length>0&&s.length>0){const p=[...s,...r];this.toastrService.warning(this.concatMessage(p),"Warning!",{enableHtml:!0})}else s.length>0&&0==r.length?this.toastrService.success(this.concatMessage(s),"Success",{enableHtml:!0}):this.toastrService.error(this.concatMessage(r),"Error",{enableHtml:!0})}concatMessage(l=[]){let s="";return l.forEach(r=>{s+=r}),`<ol>${s}</ol>`}showToastrSuccessUploadSingle(l,s){let r=l.filter(_=>0==_.Status),p=l.filter(_=>1==_.Status),g=this.generateToastrMessage(r,p,s);this.toastrService.success(g.message,"Success",{enableHtml:!0})}showToastErrorUploadSingle(l,s){let r=l?.error?.Message.filter(_=>0==_.Status),p=l?.error?.Message.filter(_=>1==_.Status),g=this.generateToastrMessage(r,p,s);"WARNING"==g.status?this.toastrService.warning(g.message,"Warning!",{enableHtml:!0}):this.toastrService.error(g.message,`Error - ${l.status}`,{enableHtml:!0})}generateToastrMessage(l,s,r){let g,p="";return 0==l.length&&s.length>0?(g="SUCCESS",p=this.createSuccessResponse(s,r)):l.length>0&&0==s.length?(g="ERROR",p=this.createErrResponse(l,r)):(g="WARNING",p=`${this.createSuccessResponse(s,r)} ${this.createErrResponse(l,r)}`),p=`<ol>${p}</ol>`,{status:g,message:p}}createErrResponse(l,s){let r="";return l.forEach((p,g)=>{r+=`<li><b>${p.Response}</b> for ${s.Name} in ${p.Name}</li>`}),r}createSuccessResponse(l,s){let r="";return l.forEach((p,g)=>{r+=`<li>Product ${s.Name} was <b>successfully</b> uploaded to ${p.Name}</li>`}),r}getHostName(){if(f.g.IsEmpty(this.hostName)){const l=localStorage.getItem("Authorization");this.hostName=JSON.parse(l)?.Host}return this.hostName}}Z.\u0275fac=function(l){return new(l||Z)(U.LFG(e.O),U.LFG(B._W))},Z.\u0275prov=U.Yz7({token:Z,factory:Z.\u0275fac,providedIn:"root"})}}]);