marketplacepos 5.41.4 → 5.41.6

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.
Files changed (40) hide show
  1. package/Marketplace/{chunk-Y7VC2AGS.js → chunk-25HVJVYO.js} +1 -1
  2. package/Marketplace/{chunk-EYNCNJ3I.js → chunk-34CTATL6.js} +1 -1
  3. package/Marketplace/{chunk-LFJIZAV2.js → chunk-3OD47PUU.js} +1 -1
  4. package/Marketplace/{chunk-YPM6IC2W.js → chunk-5KHDEW35.js} +1 -1
  5. package/Marketplace/{chunk-OAVAVDIP.js → chunk-73OLUI2Z.js} +1 -1
  6. package/Marketplace/{chunk-K3FQGMAY.js → chunk-743EWFUY.js} +1 -1
  7. package/Marketplace/{chunk-SZ6MQ6EW.js → chunk-AB3DHTC7.js} +1 -1
  8. package/Marketplace/{chunk-742J5UZZ.js → chunk-ACV6YALZ.js} +1 -1
  9. package/Marketplace/{chunk-TXPNZLOJ.js → chunk-BB5SMGW7.js} +1 -1
  10. package/Marketplace/{chunk-5FEQZAWX.js → chunk-CTUXL543.js} +1 -1
  11. package/Marketplace/{chunk-REYGC4GG.js → chunk-DFRA5ORA.js} +1 -1
  12. package/Marketplace/{chunk-B54QGLED.js → chunk-F2X5N2W5.js} +2 -2
  13. package/Marketplace/{chunk-L4JWBBBC.js → chunk-FJVZ33X4.js} +1 -1
  14. package/Marketplace/{chunk-HMB7FZD7.js → chunk-HUEPKUQW.js} +1 -1
  15. package/Marketplace/{chunk-7G53KEUW.js → chunk-HW3FX455.js} +1 -1
  16. package/Marketplace/{chunk-3CZJUTLZ.js → chunk-I4QWUPXR.js} +1 -1
  17. package/Marketplace/{chunk-LEMNVA5V.js → chunk-IHYEQWAY.js} +1 -1
  18. package/Marketplace/{chunk-KOJ2R5XW.js → chunk-IIBM2V3E.js} +1 -1
  19. package/Marketplace/{chunk-DVE7IIN7.js → chunk-IINERY5O.js} +1 -1
  20. package/Marketplace/{chunk-G5CQLP7H.js → chunk-JB6W72VA.js} +1 -1
  21. package/Marketplace/{chunk-7P3SGW2P.js → chunk-LNXJNBJQ.js} +1 -1
  22. package/Marketplace/{chunk-E3HHEPKQ.js → chunk-LQZTRBOB.js} +1 -1
  23. package/Marketplace/{chunk-HUMGZRJQ.js → chunk-NTGWFIOH.js} +1 -1
  24. package/Marketplace/{chunk-O5SSMLCS.js → chunk-OHN3VXQV.js} +1 -1
  25. package/Marketplace/{chunk-SL4ID42P.js → chunk-OIZORVCZ.js} +1 -1
  26. package/Marketplace/{chunk-LJTMOYLO.js → chunk-OOKURHR4.js} +1 -1
  27. package/Marketplace/{chunk-KC2DJUBC.js → chunk-OQNYXG6U.js} +1 -1
  28. package/Marketplace/{chunk-BG6DO7RW.js → chunk-PV6JAW7E.js} +1 -1
  29. package/Marketplace/{chunk-HNYOBOEW.js → chunk-PWJ2Z5EH.js} +2 -2
  30. package/Marketplace/{chunk-QJFAPDI7.js → chunk-SUC77PQU.js} +1 -1
  31. package/Marketplace/{chunk-UUUVVJG4.js → chunk-T6Q5SGJG.js} +1 -1
  32. package/Marketplace/{chunk-VDSO2BHA.js → chunk-UQVGVHST.js} +1 -1
  33. package/Marketplace/{chunk-FX6CFPPN.js → chunk-YJ6KE7ER.js} +1 -1
  34. package/Marketplace/{chunk-GCJBQRHI.js → chunk-Z2PI4IS6.js} +1 -1
  35. package/Marketplace/{chunk-S7LCZRSD.js → chunk-ZOVPSET6.js} +1 -1
  36. package/Marketplace/{chunk-AIIRPK4M.js → chunk-ZSHPWPPL.js} +1 -1
  37. package/Marketplace/{chunk-4S4G5UPJ.js → chunk-ZTQGQXIT.js} +1 -1
  38. package/Marketplace/index.html +2 -2
  39. package/Marketplace/{main-5HHAD6NX.js → main-36VYJM2O.js} +1 -1
  40. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- import"./chunk-XFCMKJV6.js";import{a as ke}from"./chunk-5FEQZAWX.js";import{a as Ge}from"./chunk-77IUCPIQ.js";import"./chunk-OAS72QB2.js";import"./chunk-PQ6Z7K5L.js";import"./chunk-MS4AQ6UA.js";import{b as We}from"./chunk-OLSC6KHB.js";import{b as He}from"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{b as je}from"./chunk-M3SJUKTG.js";import{c as Fe}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a as p}from"./chunk-YPM6IC2W.js";import"./chunk-Q72ZXPDP.js";import"./chunk-ZZVNB72Q.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import{a as $e}from"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{a as we,d as Ee,e as A}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{a as T,b as xe,d as Se,l as Oe}from"./chunk-LEMNVA5V.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{a as De,h as Ve,k as q,n as Ue}from"./chunk-ITTRZMEX.js";import{r as Re,s as R}from"./chunk-TMFFA26Y.js";import{B as Ae,M as G,m as Pe,n as ze,q as Ne,u as Be,v as Le}from"./chunk-WAW37FIG.js";import{h as ve,m as Me,y as L,z as ye}from"./chunk-DPLEMBB4.js";import{e as Ie,f as Te}from"./chunk-PXB4YEY3.js";import{F as _e,H as be,I as Ce,J as W,a as me,d as pe,f as ge,g as he,j as fe,k as ue,n as v}from"./chunk-GPEVUTDI.js";import{Ac as ce,Dc as z,Eb as b,Ec as m,Fb as u,Fc as C,G as Y,Gb as ae,Gc as I,Ka as E,Kb as g,La as X,M as J,Oa as ee,Q as Z,Wa as te,Wb as s,Xb as oe,Yb as D,Zc as j,_b as F,_c as H,ad as N,bc as re,ca as K,f as $,gc as r,hc as l,ic as _,jc as k,ka as f,kc as P,mc as le,md as B,ob as ie,pa as h,qb as o,rc as S,sc as d,v as w,vb as ne,wb as x,ya as M,yc as se,za as y,zc as de}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var V=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[T.dashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/Order",Roles:[T.orderView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[T.orderView]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[T.channelView]},{Icon:"fas fa-file-alt",Title:"Developer",Url:"/menu/log",Roles:[]},{Icon:"fa-solid fa-file-brackets-curly",Title:"JSON Api",Url:"/menu/json-api",Roles:[]},{Icon:"fas fa-bell",Title:"Notification",Url:"/menu/notification",Badge:!0,Roles:[]},{Icon:"fa-solid fa-wand-magic-sparkles",Title:"What`s New",Url:`https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete&v=${xe.version}`,ExternalLink:!0,CustomColor:"#ff2323",Badge:!0,Roles:[]}]}get getMenu(){return this.menus}};var qe="mat-badge-content",tt=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275cmp=b({type:e,selectors:[["ng-component"]],decls:0,vars:0,template:function(i,n){},styles:[`.mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
2
- `],encapsulation:2,changeDetection:0})}return e})(),Qe=(()=>{class e{_ngZone=h(X);_elementRef=h(ee);_ariaDescriber=h(Ae);_renderer=h(ne);_animationMode=h(te,{optional:!0});_idGenerator=h(Le);get color(){return this._color}set color(t){this._setColor(t),this._color=t}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(t){this._updateRenderedContent(t)}_content;get description(){return this._description}set description(t){this._updateDescription(t)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=h(Ne);_document=h(me);constructor(){let t=h(Pe);t.load(tt),t.load(ze)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let t=this._renderer.createElement("span"),i="mat-badge-active";return t.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),t.setAttribute("aria-hidden","true"),t.classList.add(qe),this._animationMode==="NoopAnimations"&&t.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(t),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{t.classList.add(i)})}):t.classList.add(i),t}_updateRenderedContent(t){let i=`${t??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!t||this._isHostInteractive())&&this._removeInlineDescription(),this._description=t,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,t):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(t){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),t&&i.add(`mat-badge-${t}`)}_clearExistingBadges(){let t=this._elementRef.nativeElement.querySelectorAll(`:scope > .${qe}`);for(let i of Array.from(t))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||e)};static \u0275dir=ae({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&D("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",B],disabled:[2,"matBadgeDisabled","disabled",B],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",B]}})}return e})(),Ye=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=u({type:e});static \u0275inj=f({imports:[Be,G,G]})}return e})();function nt(e,a){if(e&1&&(k(0),r(1,"p",23),m(2),l(),P()),e&2){let t=d(3).$implicit;o(2),I(" ",t.Title," ")}}function at(e,a){if(e&1&&(r(0,"p"),m(1),l()),e&2){let t=d(3).$implicit;o(),C(t.Title)}}function ot(e,a){if(e&1&&(r(0,"a",22),_(1,"i"),g(2,nt,3,1,"ng-container",20)(3,at,2,1,"ng-template",null,1,N),l()),e&2){let t=z(4),i=d(2).$implicit;s("href",i.Url,ie),o(),F(i.Icon),o(),s("ngIf",i.Badge)("ngIfElse",t)}}function rt(e,a){if(e&1&&(k(0),g(1,ot,5,5,"a",21),P()),e&2){let t=d().$implicit;o(),s("ngxPermissionsOnly",t.Roles)}}function lt(e,a){if(e&1&&(r(0,"p",23),m(1),l()),e&2){let t=d(4).$implicit;o(),I(" ",t.Title," ")}}function st(e,a){if(e&1&&(r(0,"p"),m(1),l()),e&2){let t=d(4).$implicit;o(),C(t.Title)}}function dt(e,a){if(e&1&&(k(0),g(1,lt,2,1,"p",23),j(2,"async"),g(3,st,2,1,"p"),P()),e&2){let t=d(4);o(),re(H(2,1,t.notifications$)!=0?1:3)}}function ct(e,a){if(e&1&&(r(0,"p"),m(1),l()),e&2){let t=d(3).$implicit;o(),C(t.Title)}}function mt(e,a){if(e&1&&(r(0,"a",25),_(1,"i"),g(2,dt,4,3,"ng-container",20)(3,ct,2,1,"ng-template",null,2,N),l()),e&2){let t=z(4),i=d(2).$implicit,n=d();s("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),o(),F(i.Icon),o(),s("ngIf",i.Badge)("ngIfElse",t)}}function pt(e,a){if(e&1&&g(0,mt,5,6,"a",24),e&2){let t=d().$implicit;s("ngxPermissionsOnly",t.Roles)}}function gt(e,a){if(e&1&&(r(0,"li",19),g(1,rt,2,1,"ng-container",20)(2,pt,1,1,"ng-template",null,0,N),l()),e&2){let t=a.$implicit,i=z(3);o(),s("ngIf",t.ExternalLink)("ngIfElse",i)}}var Je=(()=>{class e{constructor(t,i,n,c){this.toggleSidebarService=t,this.notificationService=i,this.decodeTokenService=n,this.authService=c,this.Menu={},this.isCollapseSidebar=!1,this.token=n.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new V().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(w(t=>t.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(t){if(t){let i,n=t.split(" ");return n.length==1?i=n[0].substring(0,2):i=n.shift().charAt(0)+n.pop().charAt(0),i}}static{this.\u0275fac=function(i){return new(i||e)(x(De),x(ke),x(Se),x(Oe))}}static{this.\u0275cmp=b({type:e,selectors:[["app-menu"]],standalone:!1,decls:23,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(i,n){i&1&&(r(0,"div",3),j(1,"async"),r(2,"div",4)(3,"button",5),S("click",function(){return n.onCallapseSidebar()}),_(4,"i",6),l(),r(5,"div",7)(6,"div",8)(7,"a",9),m(8),l(),r(9,"div",10)(10,"div",11),m(11),l(),_(12,"div",12),r(13,"a",13),S("click",function(){return n.onLogout()}),_(14,"i",14),m(15,"\xA0 "),r(16,"span"),m(17," Log Out"),l()()()()(),r(18,"div",15)(19,"ul",16),g(20,gt,4,2,"li",17),l()()(),r(21,"div",18),_(22,"router-outlet"),l()()),i&2&&(D("nav-open",H(1,7,n.toggleState$)),o(2),s("ngClass",n.isCollapseSidebar?"collapses":""),o(2),s("ngClass",n.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),o(4),I(" ",n.storeName," "),o(3),I(" ",n.token==null?null:n.token.LID," "),o(9),s("ngForOf",n.Menu))},dependencies:[pe,ge,he,_e,be,Ce,Re,Qe,Ie,fe],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]})}}return e})();var ht=[{path:"",component:Je,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"dashboard",loadChildren:()=>import("./chunk-E6HA2AGS.js").then(e=>e.DashboardModule),canActivate:[p],data:{title:"Dashboard"}},{path:"products",loadChildren:()=>import("./chunk-O5SSMLCS.js").then(e=>e.ProductModule),canActivate:[p],data:{title:"Products"}},{path:"inventory",loadChildren:()=>import("./chunk-G5CQLP7H.js").then(e=>e.InventoryRoutingModule),canActivate:[p],data:{title:"Inventory"}},{path:"price",loadChildren:()=>import("./chunk-L4JWBBBC.js").then(e=>e.PriceRoutingModule),canActivate:[p],data:{title:"Price"}},{path:"Order",loadChildren:()=>import("./chunk-HNYOBOEW.js").then(e=>e.OrdersModule),canActivate:[p],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-KOJ2R5XW.js").then(e=>e.ReportModule),canActivate:[p],data:{title:"Report"}},{path:"Logistic",loadChildren:()=>import("./chunk-QJFAPDI7.js").then(e=>e.LogisticModule),canActivate:[p],data:{title:"Logistic"}},{path:"channel",loadChildren:()=>import("./chunk-LFJIZAV2.js").then(e=>e.ChannelsModule),canActivate:[p],data:{title:"Marketplace"}},{path:"log",loadChildren:()=>import("./chunk-S7LCZRSD.js").then(e=>e.LogsModule),canActivate:[p],data:{title:"Orders"}},{path:"notification",loadChildren:()=>import("./chunk-3CZJUTLZ.js").then(e=>e.NotificationModule),canActivate:[p],data:{title:"Push Notification"}},{path:"json-api",loadChildren:()=>import("./chunk-742J5UZZ.js").then(e=>e.routes),canActivate:[p],data:{title:"Json API"}}]}],Ze=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=u({type:e})}static{this.\u0275inj=f({imports:[W.forChild(ht),W]})}}return e})();var ut=["selectId"];function _t(e,a){if(e&1&&(r(0,"span",3),m(1),l()),e&2){let t=a.item,i=d();s("title",t[i.bindLabel]),o(),C(t[i.bindLabel])}}var Ke=(()=>{class e{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new Q,this.selectedChange=new E,this.selectedLabel=new E,this.onOpen=new E}onOpenSelect(){this.onOpen.emit()}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(i,n){if(i&1&&se(ut,7),i&2){let c;de(c=ce())&&(n.ngSelectElement=c.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(i,n){if(i&1){let c=le();r(0,"ng-select",1,0),S("clear",function(){return M(c),y(n.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return M(c),y(n.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return M(c),y(n.onOpenSelect())})("change",function(et){return M(c),y(n.onSelectChange(et))}),g(2,_t,2,2,"ng-template",2),l()}i&2&&(oe("width",n.width),s("appendTo",n.parent)("disabled",n.disabled)("virtualScroll",!0)("typeahead",n.ngSelectInfiniteScroll.input$)("items",n.ngSelectInfiniteScroll.bufferData)("bindLabel",n.bindLabel)("bindValue",n.bindValue)("placeholder",n.placeholder)("ngModel",n.selected)("clearable",n.clearable))},dependencies:[v,A,Ee,we,L,ve,Me],encapsulation:2})}}return e})(),Q=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new $,this._destroy$=new $,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(J(200),Z(),w(a=>(a&&(a=a.toLowerCase()),this.filterData(a))),Y(a=>a!==void 0),K(this._destroy$)).subscribe(a=>{this._dataBuffer=a.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(a){let t=-1,i;return this._data.filter(c=>(i=JSON.stringify(c).toLowerCase(),t=i.indexOf(a),t!==-1||a==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(a){this._data=a||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(a,t){if(Ge.IsNotEmpty(a)){let i=this._data.filter(n=>n[t].toString().toLowerCase().indexOf(a)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(a){this._bufferSize=a}onScrollToEnd(){this.fetchMore()}fetchMore(){let a=this._dataBuffer.length,t=this._data.slice(a,this._bufferSize+a);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(t)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var Xe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=u({type:e})}static{this.\u0275inj=f({imports:[v,L,Ve,Fe,He,$e,je,We,R,q,Ke,A,ye]})}}return e})();var an=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=u({type:e})}static{this.\u0275inj=f({providers:[ue],imports:[v,Ze,Ue,R,Xe,Ye,Te.forChild()]})}}return e})();export{an as MenuModule};
1
+ import"./chunk-XFCMKJV6.js";import{a as ke}from"./chunk-CTUXL543.js";import{a as Ge}from"./chunk-77IUCPIQ.js";import"./chunk-OAS72QB2.js";import"./chunk-PQ6Z7K5L.js";import"./chunk-MS4AQ6UA.js";import{b as We}from"./chunk-OLSC6KHB.js";import{b as He}from"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{b as je}from"./chunk-M3SJUKTG.js";import{c as Fe}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a as p}from"./chunk-5KHDEW35.js";import"./chunk-Q72ZXPDP.js";import"./chunk-ZZVNB72Q.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import{a as $e}from"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{a as we,d as Ee,e as A}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{a as T,b as xe,d as Se,l as Oe}from"./chunk-IHYEQWAY.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{a as De,h as Ve,k as q,n as Ue}from"./chunk-ITTRZMEX.js";import{r as Re,s as R}from"./chunk-TMFFA26Y.js";import{B as Ae,M as G,m as Pe,n as ze,q as Ne,u as Be,v as Le}from"./chunk-WAW37FIG.js";import{h as ve,m as Me,y as L,z as ye}from"./chunk-DPLEMBB4.js";import{e as Ie,f as Te}from"./chunk-PXB4YEY3.js";import{F as _e,H as be,I as Ce,J as W,a as me,d as pe,f as ge,g as he,j as fe,k as ue,n as v}from"./chunk-GPEVUTDI.js";import{Ac as ce,Dc as z,Eb as b,Ec as m,Fb as u,Fc as C,G as Y,Gb as ae,Gc as I,Ka as E,Kb as g,La as X,M as J,Oa as ee,Q as Z,Wa as te,Wb as s,Xb as oe,Yb as D,Zc as j,_b as F,_c as H,ad as N,bc as re,ca as K,f as $,gc as r,hc as l,ic as _,jc as k,ka as f,kc as P,mc as le,md as B,ob as ie,pa as h,qb as o,rc as S,sc as d,v as w,vb as ne,wb as x,ya as M,yc as se,za as y,zc as de}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var V=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[T.dashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/Order",Roles:[T.orderView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[T.orderView]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[T.channelView]},{Icon:"fas fa-file-alt",Title:"Developer",Url:"/menu/log",Roles:[]},{Icon:"fa-solid fa-file-brackets-curly",Title:"JSON Api",Url:"/menu/json-api",Roles:[]},{Icon:"fas fa-bell",Title:"Notification",Url:"/menu/notification",Badge:!0,Roles:[]},{Icon:"fa-solid fa-wand-magic-sparkles",Title:"What`s New",Url:`https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete&v=${xe.version}`,ExternalLink:!0,CustomColor:"#ff2323",Badge:!0,Roles:[]}]}get getMenu(){return this.menus}};var qe="mat-badge-content",tt=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275cmp=b({type:e,selectors:[["ng-component"]],decls:0,vars:0,template:function(i,n){},styles:[`.mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
2
+ `],encapsulation:2,changeDetection:0})}return e})(),Qe=(()=>{class e{_ngZone=h(X);_elementRef=h(ee);_ariaDescriber=h(Ae);_renderer=h(ne);_animationMode=h(te,{optional:!0});_idGenerator=h(Le);get color(){return this._color}set color(t){this._setColor(t),this._color=t}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(t){this._updateRenderedContent(t)}_content;get description(){return this._description}set description(t){this._updateDescription(t)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=h(Ne);_document=h(me);constructor(){let t=h(Pe);t.load(tt),t.load(ze)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let t=this._renderer.createElement("span"),i="mat-badge-active";return t.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),t.setAttribute("aria-hidden","true"),t.classList.add(qe),this._animationMode==="NoopAnimations"&&t.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(t),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{t.classList.add(i)})}):t.classList.add(i),t}_updateRenderedContent(t){let i=`${t??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!t||this._isHostInteractive())&&this._removeInlineDescription(),this._description=t,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,t):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(t){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),t&&i.add(`mat-badge-${t}`)}_clearExistingBadges(){let t=this._elementRef.nativeElement.querySelectorAll(`:scope > .${qe}`);for(let i of Array.from(t))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||e)};static \u0275dir=ae({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&D("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",B],disabled:[2,"matBadgeDisabled","disabled",B],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",B]}})}return e})(),Ye=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=u({type:e});static \u0275inj=f({imports:[Be,G,G]})}return e})();function nt(e,a){if(e&1&&(k(0),r(1,"p",23),m(2),l(),P()),e&2){let t=d(3).$implicit;o(2),I(" ",t.Title," ")}}function at(e,a){if(e&1&&(r(0,"p"),m(1),l()),e&2){let t=d(3).$implicit;o(),C(t.Title)}}function ot(e,a){if(e&1&&(r(0,"a",22),_(1,"i"),g(2,nt,3,1,"ng-container",20)(3,at,2,1,"ng-template",null,1,N),l()),e&2){let t=z(4),i=d(2).$implicit;s("href",i.Url,ie),o(),F(i.Icon),o(),s("ngIf",i.Badge)("ngIfElse",t)}}function rt(e,a){if(e&1&&(k(0),g(1,ot,5,5,"a",21),P()),e&2){let t=d().$implicit;o(),s("ngxPermissionsOnly",t.Roles)}}function lt(e,a){if(e&1&&(r(0,"p",23),m(1),l()),e&2){let t=d(4).$implicit;o(),I(" ",t.Title," ")}}function st(e,a){if(e&1&&(r(0,"p"),m(1),l()),e&2){let t=d(4).$implicit;o(),C(t.Title)}}function dt(e,a){if(e&1&&(k(0),g(1,lt,2,1,"p",23),j(2,"async"),g(3,st,2,1,"p"),P()),e&2){let t=d(4);o(),re(H(2,1,t.notifications$)!=0?1:3)}}function ct(e,a){if(e&1&&(r(0,"p"),m(1),l()),e&2){let t=d(3).$implicit;o(),C(t.Title)}}function mt(e,a){if(e&1&&(r(0,"a",25),_(1,"i"),g(2,dt,4,3,"ng-container",20)(3,ct,2,1,"ng-template",null,2,N),l()),e&2){let t=z(4),i=d(2).$implicit,n=d();s("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),o(),F(i.Icon),o(),s("ngIf",i.Badge)("ngIfElse",t)}}function pt(e,a){if(e&1&&g(0,mt,5,6,"a",24),e&2){let t=d().$implicit;s("ngxPermissionsOnly",t.Roles)}}function gt(e,a){if(e&1&&(r(0,"li",19),g(1,rt,2,1,"ng-container",20)(2,pt,1,1,"ng-template",null,0,N),l()),e&2){let t=a.$implicit,i=z(3);o(),s("ngIf",t.ExternalLink)("ngIfElse",i)}}var Je=(()=>{class e{constructor(t,i,n,c){this.toggleSidebarService=t,this.notificationService=i,this.decodeTokenService=n,this.authService=c,this.Menu={},this.isCollapseSidebar=!1,this.token=n.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new V().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(w(t=>t.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(t){if(t){let i,n=t.split(" ");return n.length==1?i=n[0].substring(0,2):i=n.shift().charAt(0)+n.pop().charAt(0),i}}static{this.\u0275fac=function(i){return new(i||e)(x(De),x(ke),x(Se),x(Oe))}}static{this.\u0275cmp=b({type:e,selectors:[["app-menu"]],standalone:!1,decls:23,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(i,n){i&1&&(r(0,"div",3),j(1,"async"),r(2,"div",4)(3,"button",5),S("click",function(){return n.onCallapseSidebar()}),_(4,"i",6),l(),r(5,"div",7)(6,"div",8)(7,"a",9),m(8),l(),r(9,"div",10)(10,"div",11),m(11),l(),_(12,"div",12),r(13,"a",13),S("click",function(){return n.onLogout()}),_(14,"i",14),m(15,"\xA0 "),r(16,"span"),m(17," Log Out"),l()()()()(),r(18,"div",15)(19,"ul",16),g(20,gt,4,2,"li",17),l()()(),r(21,"div",18),_(22,"router-outlet"),l()()),i&2&&(D("nav-open",H(1,7,n.toggleState$)),o(2),s("ngClass",n.isCollapseSidebar?"collapses":""),o(2),s("ngClass",n.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),o(4),I(" ",n.storeName," "),o(3),I(" ",n.token==null?null:n.token.LID," "),o(9),s("ngForOf",n.Menu))},dependencies:[pe,ge,he,_e,be,Ce,Re,Qe,Ie,fe],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]})}}return e})();var ht=[{path:"",component:Je,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"dashboard",loadChildren:()=>import("./chunk-E6HA2AGS.js").then(e=>e.DashboardModule),canActivate:[p],data:{title:"Dashboard"}},{path:"products",loadChildren:()=>import("./chunk-OHN3VXQV.js").then(e=>e.ProductModule),canActivate:[p],data:{title:"Products"}},{path:"inventory",loadChildren:()=>import("./chunk-JB6W72VA.js").then(e=>e.InventoryRoutingModule),canActivate:[p],data:{title:"Inventory"}},{path:"price",loadChildren:()=>import("./chunk-FJVZ33X4.js").then(e=>e.PriceRoutingModule),canActivate:[p],data:{title:"Price"}},{path:"Order",loadChildren:()=>import("./chunk-PWJ2Z5EH.js").then(e=>e.OrdersModule),canActivate:[p],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-IIBM2V3E.js").then(e=>e.ReportModule),canActivate:[p],data:{title:"Report"}},{path:"Logistic",loadChildren:()=>import("./chunk-SUC77PQU.js").then(e=>e.LogisticModule),canActivate:[p],data:{title:"Logistic"}},{path:"channel",loadChildren:()=>import("./chunk-3OD47PUU.js").then(e=>e.ChannelsModule),canActivate:[p],data:{title:"Marketplace"}},{path:"log",loadChildren:()=>import("./chunk-ZOVPSET6.js").then(e=>e.LogsModule),canActivate:[p],data:{title:"Orders"}},{path:"notification",loadChildren:()=>import("./chunk-I4QWUPXR.js").then(e=>e.NotificationModule),canActivate:[p],data:{title:"Push Notification"}},{path:"json-api",loadChildren:()=>import("./chunk-ACV6YALZ.js").then(e=>e.routes),canActivate:[p],data:{title:"Json API"}}]}],Ze=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=u({type:e})}static{this.\u0275inj=f({imports:[W.forChild(ht),W]})}}return e})();var ut=["selectId"];function _t(e,a){if(e&1&&(r(0,"span",3),m(1),l()),e&2){let t=a.item,i=d();s("title",t[i.bindLabel]),o(),C(t[i.bindLabel])}}var Ke=(()=>{class e{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new Q,this.selectedChange=new E,this.selectedLabel=new E,this.onOpen=new E}onOpenSelect(){this.onOpen.emit()}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(i,n){if(i&1&&se(ut,7),i&2){let c;de(c=ce())&&(n.ngSelectElement=c.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(i,n){if(i&1){let c=le();r(0,"ng-select",1,0),S("clear",function(){return M(c),y(n.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return M(c),y(n.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return M(c),y(n.onOpenSelect())})("change",function(et){return M(c),y(n.onSelectChange(et))}),g(2,_t,2,2,"ng-template",2),l()}i&2&&(oe("width",n.width),s("appendTo",n.parent)("disabled",n.disabled)("virtualScroll",!0)("typeahead",n.ngSelectInfiniteScroll.input$)("items",n.ngSelectInfiniteScroll.bufferData)("bindLabel",n.bindLabel)("bindValue",n.bindValue)("placeholder",n.placeholder)("ngModel",n.selected)("clearable",n.clearable))},dependencies:[v,A,Ee,we,L,ve,Me],encapsulation:2})}}return e})(),Q=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new $,this._destroy$=new $,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(J(200),Z(),w(a=>(a&&(a=a.toLowerCase()),this.filterData(a))),Y(a=>a!==void 0),K(this._destroy$)).subscribe(a=>{this._dataBuffer=a.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(a){let t=-1,i;return this._data.filter(c=>(i=JSON.stringify(c).toLowerCase(),t=i.indexOf(a),t!==-1||a==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(a){this._data=a||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(a,t){if(Ge.IsNotEmpty(a)){let i=this._data.filter(n=>n[t].toString().toLowerCase().indexOf(a)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(a){this._bufferSize=a}onScrollToEnd(){this.fetchMore()}fetchMore(){let a=this._dataBuffer.length,t=this._data.slice(a,this._bufferSize+a);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(t)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var Xe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=u({type:e})}static{this.\u0275inj=f({imports:[v,L,Ve,Fe,He,$e,je,We,R,q,Ke,A,ye]})}}return e})();var an=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=u({type:e})}static{this.\u0275inj=f({providers:[ue],imports:[v,Ze,Ue,R,Xe,Ye,Te.forChild()]})}}return e})();export{an as MenuModule};
@@ -1 +1 @@
1
- import{a as h,b as f}from"./chunk-OE2JYQHN.js";import{a as i}from"./chunk-YPM6IC2W.js";import"./chunk-LEMNVA5V.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import"./chunk-PXB4YEY3.js";import{F as C,J as n,n as o}from"./chunk-GPEVUTDI.js";import{Eb as l,Fb as c,Wb as s,gc as u,hc as d,ic as r,ka as p,qb as m}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var v=(()=>{class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,P){t&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),r(3,"nav-tab",2),d()()(),r(4,"router-outlet")),t&2&&(m(3),s("Tabs",P.priceTabs))},dependencies:[o,f,h,n,C],encapsulation:2})}}return e})();var M=[{path:"",component:v,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-REYGC4GG.js").then(e=>e.PricePosChannelComponent)},canActivate:[i],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-SL4ID42P.js").then(e=>e.CustomChannelPriceComponent)},canActivate:[i],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-FX6CFPPN.js").then(e=>e.PriceSingleChannelComponent)},canActivate:[i],data:{title:"Price Single Channel Comparison"}}]}],j=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=c({type:e})}static{this.\u0275inj=p({imports:[o,n.forChild(M)]})}}return e})();export{j as PriceRoutingModule};
1
+ import{a as h,b as f}from"./chunk-OE2JYQHN.js";import{a as i}from"./chunk-5KHDEW35.js";import"./chunk-IHYEQWAY.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import"./chunk-PXB4YEY3.js";import{F as C,J as n,n as o}from"./chunk-GPEVUTDI.js";import{Eb as l,Fb as c,Wb as s,gc as u,hc as d,ic as r,ka as p,qb as m}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var v=(()=>{class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,P){t&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),r(3,"nav-tab",2),d()()(),r(4,"router-outlet")),t&2&&(m(3),s("Tabs",P.priceTabs))},dependencies:[o,f,h,n,C],encapsulation:2})}}return e})();var M=[{path:"",component:v,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-DFRA5ORA.js").then(e=>e.PricePosChannelComponent)},canActivate:[i],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-OIZORVCZ.js").then(e=>e.CustomChannelPriceComponent)},canActivate:[i],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-YJ6KE7ER.js").then(e=>e.PriceSingleChannelComponent)},canActivate:[i],data:{title:"Price Single Channel Comparison"}}]}],j=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=c({type:e})}static{this.\u0275inj=p({imports:[o,n.forChild(M)]})}}return e})();export{j as PriceRoutingModule};
@@ -1 +1 @@
1
- import{b as qt}from"./chunk-2BBMPSAE.js";import{a as Jt,b as Qt}from"./chunk-E3HMIPER.js";import"./chunk-7GQIIDFF.js";import{b as Yt}from"./chunk-MATSRG2L.js";import"./chunk-V2OJQHE3.js";import"./chunk-6XFYITUD.js";import{a as Xt,b as Ht}from"./chunk-OLSC6KHB.js";import{a as $t,b as Rt}from"./chunk-COBHWPGI.js";import{a as pt,b as Bt,c as Gt,d as st,e as ut}from"./chunk-AIIRPK4M.js";import"./chunk-VETHPEVU.js";import"./chunk-75BDXSG3.js";import"./chunk-6NNAICJE.js";import"./chunk-LPXBSHUI.js";import"./chunk-D54NUPYF.js";import"./chunk-EGTYAIU5.js";import{a as Wt}from"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-4G3QN54S.js";import"./chunk-3RK6DDJD.js";import{a as jt}from"./chunk-62PFQNHJ.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{d as $,e as R}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import"./chunk-LEMNVA5V.js";import{e as et}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as Ut,n as Lt}from"./chunk-ITTRZMEX.js";import{r as Mt,s as Vt}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as K,e as ct,h as U,i as Y,l as mt,m as Nt,n as X,p as H,q as Pt,r as J,s as Ot,t as kt,u as wt,x as Q,y as tt,z as L}from"./chunk-DPLEMBB4.js";import{b as Dt,c as f}from"./chunk-PXB4YEY3.js";import{g as V,j as T,n as S}from"./chunk-GPEVUTDI.js";import{Eb as v,Ec as _,Fc as at,Gc as z,Ic as Ft,Jc as At,K as St,Ka as P,Kb as h,Kc as Et,M as It,Na as ht,Oc as x,Pc as lt,Wb as m,Z,Zc as b,_c as y,bc as g,cc as O,ea as A,ec as k,fc as w,gc as p,hc as l,ic as d,ja as E,jc as D,kc as M,mc as W,pa as u,qb as s,rc as I,sc as r,v as F,xa as N,ya as G,za as j}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var q=function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e}(q||{});var it=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(it||{});var ot=function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e}(ot||{});var Ct=class extends mt{setValue(c,t){if(c instanceof Date){let i=Math.floor(c.getTime()/1e3);super.setValue(i,t)}else super.setValue(c,t)}},gt=(()=>{class e{constructor(){this.shopeeUploadService=u(pt),this.formBuilder=u(Q)}getAttributes(t){return this.shopeeUploadService.getAttributes(t.channelId,t.categoryId).pipe(F(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(t=[]){let i,n;return t=t.map(o=>(i=o?.multi_lang?.find(a=>a.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(a=>(n=a?.multi_lang?.find(C=>C.language=="id"),a.name=n?.value,a)),o.name=i?.value?i?.value:o.name,o)),t}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{if(n=[],o.mandatory&&n.push(ct.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==q.FREE_TEXT_FILED){let a=this.formBuilder.group({unit:new mt(null),value:new mt(null,n)});i.addControl(JSON.stringify(o.attribute_id),a)}else o?.attribute_info?.input_type==q.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ot.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(o.attribute_id),new Ct(null,n)):i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(ft=>parseInt(ft)==C.attribute_id||C.mandatory)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>{switch(o.attribute_info.input_type){case q.MULTI_COMBO_BOX:f.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(a=>i[o.attribute_id]?.findIndex(C=>C==a.value_id)!=-1):o.attribute_value_list=[];break;case q.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ot.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(i[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(a=>a.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(t,i){let n=[];if(f.IsNotEmpty(t)){let o={value_id:0,original_value_name:JSON.stringify(t)};f.IsNotEmpty(i)&&(o.value_unit=i),n=[o]}return n}setSelectedDateAttr(t){let i=[];return f.IsNotEmpty(t)&&(i=[{value_id:0,original_value_name:JSON.stringify(t)}]),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var bt=()=>[];function ie(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function oe(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:lt(4,bt))("placeholder","Pilih "+(t==null?null:t.name))}}function ne(e,c){if(e&1&&d(0,"input",8),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function re(e,c){if(e&1&&(p(0,"option",15),_(1),l()),e&2){let t=c.$implicit;m("value",t),s(),at(t)}}function ae(e,c){if(e&1&&(p(0,"div",10),d(1,"input",12),p(2,"select",13)(3,"option",14),_(4,"Unit"),l(),k(5,re,2,2,"option",15,O),l()()),e&2){let t=r(3).$implicit;m("formGroupName",t.attribute_id),s(),m("placeholder","Isi "+(t==null?null:t.name)),s(2),m("value",null),s(2),w(t==null||t.attribute_info==null?null:t.attribute_info.attribute_unit_list)}}function le(e,c){if(e&1&&d(0,"input",11),e&2){let t=r(3).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function ce(e,c){if(e&1&&h(0,ae,7,3,"div",10)(1,le,1,2,"input",11),e&2){let t=r(2).$implicit,i=r(2);g((t==null||t.attribute_info==null?null:t.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function me(e,c){if(e&1&&d(0,"datepicker",9),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)}}function pe(e,c){if(e&1&&h(0,ne,1,2,"input",8)(1,ce,2,1)(2,me,1,1,"datepicker",9),e&2){let t,i=r().$implicit,n=r(2);g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:t===n.validationType.VALIDATOR_FLOAT_TYPE?1:t===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function se(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:lt(3,bt))("placeholder","Pilih "+(t==null?null:t.name))}}function ue(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:lt(3,bt))("placeholder","Pilih "+(t==null?null:t.name))}}function de(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),h(2,ie,2,0,"span",5),p(3,"span"),_(4),l()(),h(5,oe,1,5,"ng-select",6)(6,pe,3,1)(7,se,1,4,"ng-select",7)(8,ue,1,4,"ng-select",7),l()),e&2){let t,i=c.$implicit,n=r(2);s(2),g(i.mandatory?2:-1),s(2),z(" ",i==null?null:i.name," "),s(),g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:t===n.inputType.FREE_TEXT_FILED?6:t===n.inputType.SINGLE_COMBO_BOX?7:8)}}function _e(e,c){if(e&1&&(D(0),p(1,"form",1)(2,"div",2),k(3,de,9,3,"div",3,O),l()(),M()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var zt=(()=>{class e{constructor(){this.formCategoryService=u(gt),this.attributesChanges=new P,this.inputType=q,this.formatType=it,this.validationType=ot}ngOnChanges(){f.IsNotEmpty(this.categoryId)&&f.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(A(t=>{this.form=this.formCategoryService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[x([gt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,n){i&1&&(h(0,_e,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,T,R,$,L,X,kt,wt,K,Ot,U,Y,H,J,Pt,Wt,Qt,Jt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]})}}return e})();var yt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q),this.uploadProductService=u(ut)}getAttributes(t,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(St(o=>this.uploadProductService.selectedProduct$.pipe(F(a=>(o=this.mappingAttributeSalesProperty(o,a),o)))))}mappingAttributeSalesProperty(t,i){let n=0;return t.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(i),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(t){let i=!1,n=[];return t.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{n=[],o.is_required&&n.push(ct.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(ft=>parseInt(ft)==C.id)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>(f.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(a=>i[o.id]?.includes(a.id)):o.values=o.values.filter(a=>a.id==i[o.id]):i[o.id]&&(o.values=[{id:null,name:i[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function fe(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function he(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function Ce(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function ge(e,c){if(e&1&&d(0,"input",8),e&2){let t=r().$implicit;m("formControlName",t.id)("placeholder",t==null?null:t.name)}}function be(e,c){if(e&1&&(p(0,"small",5),_(1),l()),e&2){let t=r().$implicit;s(),z(" ",t==null?null:t.name," is mandatory ")}}function ye(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),h(2,fe,2,0,"span",5),p(3,"span"),_(4),l()(),h(5,he,1,4,"ng-select",6)(6,Ce,1,3,"ng-select",7)(7,ge,1,2,"input",8)(8,be,2,1,"small",5),l()),e&2){let t=c.$implicit;s(2),g(t.is_required?2:-1),s(2),z(" ",t==null?null:t.name," "),s(),g(t.is_multiple_selection?5:t.values!==null&&t.values.length>0?6:7),s(3),g(t.is_required?8:-1)}}function ve(e,c){if(e&1&&(D(0),p(1,"form",1)(2,"div",2),k(3,ye,9,4,"div",3,O),l()(),M()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var Zt=(()=>{class e{constructor(){this.tiktokAttributeFormService=u(yt),this.attributesChanges=new P}ngOnChanges(){f.IsNotEmpty(this.categoryId)&&f.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(F(t=>t.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(f.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),A(t=>{this.form=this.tiktokAttributeFormService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.tiktokAttributeFormService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([yt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,n){i&1&&(h(0,ve,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,T,R,$,L,X,K,U,Y,H,J,tt],encapsulation:2})}}return e})();var vt=(()=>{class e{constructor(){this.woocommerceUploadService=u(st)}getAttributes(t,i){return this.woocommerceUploadService.getAttributes(t,i).pipe(F(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Kt=(()=>{class e{constructor(){this.wooAttributeFormService=u(vt),this.channelId=ht(),this.categoryId=ht(),this.attributesChanges=new P}ngOnChanges(){f.IsNotEmpty(this.categoryId())&&f.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(t){this.attributesChanges.emit([t.key])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[x([vt]),N],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,n){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2),_(3,"Atribut"),l(),p(4,"ng-select",3),b(5,"async"),I("change",function(a){return n.onSelectAttribute(a)}),l()()()),i&2&&(s(4),m("items",y(5,1,n.attributes$)))},dependencies:[S,T,tt,R,$,L],encapsulation:2})}}return e})();var xt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(F(o=>o))}createFormGroup(t){let i=this.formBuilder.group({});return t.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(t={}){return Object.values(t).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function xe(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),_(2),l(),d(3,"ng-select",5),l()),e&2){let t=c.$implicit;s(2),z(" ",t==null?null:t.variant," "),s(),m("formControlName",t.variant)("items",t.values)("placeholder","Pilih "+(t==null?null:t.variant))}}function Te(e,c){if(e&1&&(D(0),p(1,"form",1)(2,"div",2),k(3,xe,4,4,"div",3,O),l()(),M()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var te=(()=>{class e{constructor(){this.tokpedAttrFormService=u(xt),this.attributesChanges=new P}ngOnInit(){}ngOnChanges(t){f.IsNotEmpty(this.categoryId)&&f.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(A(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let t=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{t=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([xt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,n){i&1&&(h(0,Te,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,T,R,$,L,X,U,Y,H,J],encapsulation:2})}}return e})();var Tt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:t}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(t){let i=this.formBuilder.group({});return Object.keys(t.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function Se(e,c){if(e&1&&(D(0),p(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),_(5," Brand "),l(),d(6,"input",5),l(),p(7,"div",6)(8,"div",4),_(9," Product Type "),l(),d(10,"input",7),l(),p(11,"div",6)(12,"div",4),_(13," Status "),l(),d(14,"ng-select",8),l()()(),M()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(13),m("items",t.Options.StatusOptions)}}var ee=(()=>{class e{constructor(){this.attributesChanges=new P,this.shopifyFormService=u(Tt)}ngOnChanges(t){t.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(A(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(It(500)).subscribe(t=>{this.attributesChanges.emit([t])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[x([Tt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,n){i&1&&(h(0,Se,15,2,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,T,L,X,K,U,Y,H,J,R,$],encapsulation:2})}}return e})();function Ie(e,c){if(e&1&&(p(0,"div",6),d(1,"app-product-card",9),l()),e&2){let t=c.$implicit;s(),m("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("imageForZoom",t==null?null:t.ImageUrl)("code",t==null||t.Variants[0]==null?null:t.Variants[0].Code)("showFooter",!1)}}function Fe(e,c){if(e&1){let t=W();D(0),p(1,"mat-checkbox",21),Et("ngModelChange",function(n){G(t);let o=r().$implicit;return At(o.selected,n)||(o.selected=n),j(n)}),I("ngModelChange",function(){let n=G(t).ngIf,o=r(),a=o.$implicit,C=o.$index,nt=r();return j(nt.onSelectChannel(a,C,n))}),l(),M()}if(e&2){let t=r().$implicit;s(),Ft("ngModel",t.selected)}}function Ae(e,c){if(e&1&&(p(0,"div",18),d(1,"input",22),l()),e&2){let t=r().$implicit,i=r();m("matTooltip",t.type==i.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":t.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Ee(e,c){if(e&1){let t=W();p(0,"app-channel-category-select",23),I("selectedCategory",function(n){G(t);let o=r().$index,a=r();return j(a.onCategoryChange(o,n))}),l()}if(e&2){let t=r().$implicit,i=r();m("disabled",!t.selected||t.selected&&t.type==i.channelType.Lazada)("channelId",t.id)("channelType",t.type)("categoryId",t.categoryId)}}function Ne(e,c){if(e&1){let t=W();p(0,"shopee-attribute-form",27),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)("channelType",t.type)}}function Pe(e,c){if(e&1){let t=W();p(0,"tiktok-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Oe(e,c){if(e&1){let t=W();p(0,"wooocommerce-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function ke(e,c){if(e&1){let t=W();p(0,"tokopedia-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function we(e,c){if(e&1&&(p(0,"div",20)(1,"div",24),h(2,Ne,1,3,"shopee-attribute-form",25)(3,Pe,1,2,"tiktok-attribute-form",26)(4,Oe,1,2,"wooocommerce-attribute-form",26)(5,ke,1,2,"tokopedia-attribute-form",26),l()()),e&2){let t,i=r().$implicit,n=r();s(2),g((t=i.type)===n.channelType.Shopee?2:t===n.channelType.Tiktok?3:t===n.channelType.WooCommerce?4:t===n.channelType.Tokopedia?5:-1)}}function De(e,c){if(e&1){let t=W();p(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),I("attributesChanges",function(n){G(t);let o=r().$index,a=r();return j(a.onAttributesChange(o,n))}),l()()()}if(e&2){let t=r().$implicit;s(2),m("channelId",t.id)}}function Me(e,c){if(e&1&&(p(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),h(6,Fe,2,1,"ng-container",14),b(7,"async"),l(),p(8,"div"),d(9,"app-channel-logo",15),l(),p(10,"div",16)(11,"span"),_(12),l()()()(),p(13,"div",12)(14,"div",17),h(15,Ae,2,1,"div",18)(16,Ee,1,4,"app-channel-category-select",19),l()()(),h(17,we,6,1,"div",20)(18,De,3,1,"div",20),l()()),e&2){let t=c.$implicit,i=r();s(6),m("ngIf",y(7,8,i.defaultCategories$)),s(3),m("typeId",t.type)("showChannelName",!1),s(),m("matTooltip",t.name)("matTooltipShowDelay",2500),s(2),at(t.name),s(3),g(t.type==i.channelType.Shopify||t.type==i.channelType.Plugo?15:16),s(2),g(t.categoryId&&i.channelType.Lazada!=t.type&&t.selected?17:i.channelType.Shopify==t.type&&t.selected?18:-1)}}var Ko=(()=>{class e{constructor(){this.uploadProductService=u(ut),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Dt,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(Z(1))}onCategoryChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.categoryId=i,o.attributes=[]),o)))}onAttributesChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.attributes=i),o)))}onSelectChannel(t,i,n){this.channelProductUploads.update(o=>o.map((a,C)=>{if(C==i&&t.selected){let nt=this.findCategoryByChannelId(t.id,n);a.categoryId=nt?.DefaultCategoryID}return C==i&&!t.selected&&(a.categoryId=null),a}))}findCategoryByChannelId(t,i){return i.find(n=>n.ID===t)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-product-upload"]],features:[x([pt,Bt,Gt,st])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,n){if(i&1&&(p(0,"mainpanel",0)(1,"actions")(2,"button",1),I("click",function(){return n.onUploadProduct()}),d(3,"i",2),_(4," Upload "),l()(),p(5,"content")(6,"div",3)(7,"h3",4),_(8,"Product To Upload"),l(),p(9,"div",5),k(10,Ie,2,7,"div",6,O),b(12,"async"),l(),p(13,"h3",7),_(14,"Channel To Upload"),l(),k(15,Me,19,10,"div",8,O),l()()()),i&2){let o;m("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),m("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),s(8),w(y(12,3,n.selectedProducts$)),s(5),w(n.channelProductUploads())}},dependencies:[S,V,T,Yt,Lt,Ut,Ht,Xt,Rt,$t,tt,U,Nt,Vt,Mt,zt,Zt,Kt,te,ee,jt,qt],encapsulation:2})}}return e})();export{Ko as ProductUploadComponent};
1
+ import{b as qt}from"./chunk-2BBMPSAE.js";import{a as Jt,b as Qt}from"./chunk-E3HMIPER.js";import"./chunk-7GQIIDFF.js";import{b as Yt}from"./chunk-MATSRG2L.js";import"./chunk-V2OJQHE3.js";import"./chunk-6XFYITUD.js";import{a as Xt,b as Ht}from"./chunk-OLSC6KHB.js";import{a as $t,b as Rt}from"./chunk-COBHWPGI.js";import{a as pt,b as Bt,c as Gt,d as st,e as ut}from"./chunk-ZSHPWPPL.js";import"./chunk-VETHPEVU.js";import"./chunk-75BDXSG3.js";import"./chunk-6NNAICJE.js";import"./chunk-LPXBSHUI.js";import"./chunk-D54NUPYF.js";import"./chunk-EGTYAIU5.js";import{a as Wt}from"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-4G3QN54S.js";import"./chunk-3RK6DDJD.js";import{a as jt}from"./chunk-62PFQNHJ.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{d as $,e as R}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import"./chunk-IHYEQWAY.js";import{e as et}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as Ut,n as Lt}from"./chunk-ITTRZMEX.js";import{r as Mt,s as Vt}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as K,e as ct,h as U,i as Y,l as mt,m as Nt,n as X,p as H,q as Pt,r as J,s as Ot,t as kt,u as wt,x as Q,y as tt,z as L}from"./chunk-DPLEMBB4.js";import{b as Dt,c as f}from"./chunk-PXB4YEY3.js";import{g as V,j as T,n as S}from"./chunk-GPEVUTDI.js";import{Eb as v,Ec as _,Fc as at,Gc as z,Ic as Ft,Jc as At,K as St,Ka as P,Kb as h,Kc as Et,M as It,Na as ht,Oc as x,Pc as lt,Wb as m,Z,Zc as b,_c as y,bc as g,cc as O,ea as A,ec as k,fc as w,gc as p,hc as l,ic as d,ja as E,jc as D,kc as M,mc as W,pa as u,qb as s,rc as I,sc as r,v as F,xa as N,ya as G,za as j}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var q=function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e}(q||{});var it=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(it||{});var ot=function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e}(ot||{});var Ct=class extends mt{setValue(c,t){if(c instanceof Date){let i=Math.floor(c.getTime()/1e3);super.setValue(i,t)}else super.setValue(c,t)}},gt=(()=>{class e{constructor(){this.shopeeUploadService=u(pt),this.formBuilder=u(Q)}getAttributes(t){return this.shopeeUploadService.getAttributes(t.channelId,t.categoryId).pipe(F(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(t=[]){let i,n;return t=t.map(o=>(i=o?.multi_lang?.find(a=>a.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(a=>(n=a?.multi_lang?.find(C=>C.language=="id"),a.name=n?.value,a)),o.name=i?.value?i?.value:o.name,o)),t}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{if(n=[],o.mandatory&&n.push(ct.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==q.FREE_TEXT_FILED){let a=this.formBuilder.group({unit:new mt(null),value:new mt(null,n)});i.addControl(JSON.stringify(o.attribute_id),a)}else o?.attribute_info?.input_type==q.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ot.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(o.attribute_id),new Ct(null,n)):i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(ft=>parseInt(ft)==C.attribute_id||C.mandatory)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>{switch(o.attribute_info.input_type){case q.MULTI_COMBO_BOX:f.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(a=>i[o.attribute_id]?.findIndex(C=>C==a.value_id)!=-1):o.attribute_value_list=[];break;case q.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ot.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(i[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(a=>a.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(t,i){let n=[];if(f.IsNotEmpty(t)){let o={value_id:0,original_value_name:JSON.stringify(t)};f.IsNotEmpty(i)&&(o.value_unit=i),n=[o]}return n}setSelectedDateAttr(t){let i=[];return f.IsNotEmpty(t)&&(i=[{value_id:0,original_value_name:JSON.stringify(t)}]),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var bt=()=>[];function ie(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function oe(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:lt(4,bt))("placeholder","Pilih "+(t==null?null:t.name))}}function ne(e,c){if(e&1&&d(0,"input",8),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function re(e,c){if(e&1&&(p(0,"option",15),_(1),l()),e&2){let t=c.$implicit;m("value",t),s(),at(t)}}function ae(e,c){if(e&1&&(p(0,"div",10),d(1,"input",12),p(2,"select",13)(3,"option",14),_(4,"Unit"),l(),k(5,re,2,2,"option",15,O),l()()),e&2){let t=r(3).$implicit;m("formGroupName",t.attribute_id),s(),m("placeholder","Isi "+(t==null?null:t.name)),s(2),m("value",null),s(2),w(t==null||t.attribute_info==null?null:t.attribute_info.attribute_unit_list)}}function le(e,c){if(e&1&&d(0,"input",11),e&2){let t=r(3).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function ce(e,c){if(e&1&&h(0,ae,7,3,"div",10)(1,le,1,2,"input",11),e&2){let t=r(2).$implicit,i=r(2);g((t==null||t.attribute_info==null?null:t.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function me(e,c){if(e&1&&d(0,"datepicker",9),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)}}function pe(e,c){if(e&1&&h(0,ne,1,2,"input",8)(1,ce,2,1)(2,me,1,1,"datepicker",9),e&2){let t,i=r().$implicit,n=r(2);g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:t===n.validationType.VALIDATOR_FLOAT_TYPE?1:t===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function se(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:lt(3,bt))("placeholder","Pilih "+(t==null?null:t.name))}}function ue(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:lt(3,bt))("placeholder","Pilih "+(t==null?null:t.name))}}function de(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),h(2,ie,2,0,"span",5),p(3,"span"),_(4),l()(),h(5,oe,1,5,"ng-select",6)(6,pe,3,1)(7,se,1,4,"ng-select",7)(8,ue,1,4,"ng-select",7),l()),e&2){let t,i=c.$implicit,n=r(2);s(2),g(i.mandatory?2:-1),s(2),z(" ",i==null?null:i.name," "),s(),g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:t===n.inputType.FREE_TEXT_FILED?6:t===n.inputType.SINGLE_COMBO_BOX?7:8)}}function _e(e,c){if(e&1&&(D(0),p(1,"form",1)(2,"div",2),k(3,de,9,3,"div",3,O),l()(),M()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var zt=(()=>{class e{constructor(){this.formCategoryService=u(gt),this.attributesChanges=new P,this.inputType=q,this.formatType=it,this.validationType=ot}ngOnChanges(){f.IsNotEmpty(this.categoryId)&&f.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(A(t=>{this.form=this.formCategoryService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[x([gt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,n){i&1&&(h(0,_e,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,T,R,$,L,X,kt,wt,K,Ot,U,Y,H,J,Pt,Wt,Qt,Jt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]})}}return e})();var yt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q),this.uploadProductService=u(ut)}getAttributes(t,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(St(o=>this.uploadProductService.selectedProduct$.pipe(F(a=>(o=this.mappingAttributeSalesProperty(o,a),o)))))}mappingAttributeSalesProperty(t,i){let n=0;return t.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(i),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(t){let i=!1,n=[];return t.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{n=[],o.is_required&&n.push(ct.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(ft=>parseInt(ft)==C.id)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>(f.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(a=>i[o.id]?.includes(a.id)):o.values=o.values.filter(a=>a.id==i[o.id]):i[o.id]&&(o.values=[{id:null,name:i[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function fe(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function he(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function Ce(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function ge(e,c){if(e&1&&d(0,"input",8),e&2){let t=r().$implicit;m("formControlName",t.id)("placeholder",t==null?null:t.name)}}function be(e,c){if(e&1&&(p(0,"small",5),_(1),l()),e&2){let t=r().$implicit;s(),z(" ",t==null?null:t.name," is mandatory ")}}function ye(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),h(2,fe,2,0,"span",5),p(3,"span"),_(4),l()(),h(5,he,1,4,"ng-select",6)(6,Ce,1,3,"ng-select",7)(7,ge,1,2,"input",8)(8,be,2,1,"small",5),l()),e&2){let t=c.$implicit;s(2),g(t.is_required?2:-1),s(2),z(" ",t==null?null:t.name," "),s(),g(t.is_multiple_selection?5:t.values!==null&&t.values.length>0?6:7),s(3),g(t.is_required?8:-1)}}function ve(e,c){if(e&1&&(D(0),p(1,"form",1)(2,"div",2),k(3,ye,9,4,"div",3,O),l()(),M()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var Zt=(()=>{class e{constructor(){this.tiktokAttributeFormService=u(yt),this.attributesChanges=new P}ngOnChanges(){f.IsNotEmpty(this.categoryId)&&f.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(F(t=>t.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(f.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),A(t=>{this.form=this.tiktokAttributeFormService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.tiktokAttributeFormService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([yt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,n){i&1&&(h(0,ve,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,T,R,$,L,X,K,U,Y,H,J,tt],encapsulation:2})}}return e})();var vt=(()=>{class e{constructor(){this.woocommerceUploadService=u(st)}getAttributes(t,i){return this.woocommerceUploadService.getAttributes(t,i).pipe(F(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Kt=(()=>{class e{constructor(){this.wooAttributeFormService=u(vt),this.channelId=ht(),this.categoryId=ht(),this.attributesChanges=new P}ngOnChanges(){f.IsNotEmpty(this.categoryId())&&f.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(t){this.attributesChanges.emit([t.key])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[x([vt]),N],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,n){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2),_(3,"Atribut"),l(),p(4,"ng-select",3),b(5,"async"),I("change",function(a){return n.onSelectAttribute(a)}),l()()()),i&2&&(s(4),m("items",y(5,1,n.attributes$)))},dependencies:[S,T,tt,R,$,L],encapsulation:2})}}return e})();var xt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(F(o=>o))}createFormGroup(t){let i=this.formBuilder.group({});return t.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(t={}){return Object.values(t).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function xe(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),_(2),l(),d(3,"ng-select",5),l()),e&2){let t=c.$implicit;s(2),z(" ",t==null?null:t.variant," "),s(),m("formControlName",t.variant)("items",t.values)("placeholder","Pilih "+(t==null?null:t.variant))}}function Te(e,c){if(e&1&&(D(0),p(1,"form",1)(2,"div",2),k(3,xe,4,4,"div",3,O),l()(),M()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var te=(()=>{class e{constructor(){this.tokpedAttrFormService=u(xt),this.attributesChanges=new P}ngOnInit(){}ngOnChanges(t){f.IsNotEmpty(this.categoryId)&&f.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(A(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let t=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{t=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([xt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,n){i&1&&(h(0,Te,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,T,R,$,L,X,U,Y,H,J],encapsulation:2})}}return e})();var Tt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:t}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(t){let i=this.formBuilder.group({});return Object.keys(t.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function Se(e,c){if(e&1&&(D(0),p(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),_(5," Brand "),l(),d(6,"input",5),l(),p(7,"div",6)(8,"div",4),_(9," Product Type "),l(),d(10,"input",7),l(),p(11,"div",6)(12,"div",4),_(13," Status "),l(),d(14,"ng-select",8),l()()(),M()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(13),m("items",t.Options.StatusOptions)}}var ee=(()=>{class e{constructor(){this.attributesChanges=new P,this.shopifyFormService=u(Tt)}ngOnChanges(t){t.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(A(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(It(500)).subscribe(t=>{this.attributesChanges.emit([t])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[x([Tt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,n){i&1&&(h(0,Se,15,2,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,T,L,X,K,U,Y,H,J,R,$],encapsulation:2})}}return e})();function Ie(e,c){if(e&1&&(p(0,"div",6),d(1,"app-product-card",9),l()),e&2){let t=c.$implicit;s(),m("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("imageForZoom",t==null?null:t.ImageUrl)("code",t==null||t.Variants[0]==null?null:t.Variants[0].Code)("showFooter",!1)}}function Fe(e,c){if(e&1){let t=W();D(0),p(1,"mat-checkbox",21),Et("ngModelChange",function(n){G(t);let o=r().$implicit;return At(o.selected,n)||(o.selected=n),j(n)}),I("ngModelChange",function(){let n=G(t).ngIf,o=r(),a=o.$implicit,C=o.$index,nt=r();return j(nt.onSelectChannel(a,C,n))}),l(),M()}if(e&2){let t=r().$implicit;s(),Ft("ngModel",t.selected)}}function Ae(e,c){if(e&1&&(p(0,"div",18),d(1,"input",22),l()),e&2){let t=r().$implicit,i=r();m("matTooltip",t.type==i.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":t.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Ee(e,c){if(e&1){let t=W();p(0,"app-channel-category-select",23),I("selectedCategory",function(n){G(t);let o=r().$index,a=r();return j(a.onCategoryChange(o,n))}),l()}if(e&2){let t=r().$implicit,i=r();m("disabled",!t.selected||t.selected&&t.type==i.channelType.Lazada)("channelId",t.id)("channelType",t.type)("categoryId",t.categoryId)}}function Ne(e,c){if(e&1){let t=W();p(0,"shopee-attribute-form",27),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)("channelType",t.type)}}function Pe(e,c){if(e&1){let t=W();p(0,"tiktok-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Oe(e,c){if(e&1){let t=W();p(0,"wooocommerce-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function ke(e,c){if(e&1){let t=W();p(0,"tokopedia-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function we(e,c){if(e&1&&(p(0,"div",20)(1,"div",24),h(2,Ne,1,3,"shopee-attribute-form",25)(3,Pe,1,2,"tiktok-attribute-form",26)(4,Oe,1,2,"wooocommerce-attribute-form",26)(5,ke,1,2,"tokopedia-attribute-form",26),l()()),e&2){let t,i=r().$implicit,n=r();s(2),g((t=i.type)===n.channelType.Shopee?2:t===n.channelType.Tiktok?3:t===n.channelType.WooCommerce?4:t===n.channelType.Tokopedia?5:-1)}}function De(e,c){if(e&1){let t=W();p(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),I("attributesChanges",function(n){G(t);let o=r().$index,a=r();return j(a.onAttributesChange(o,n))}),l()()()}if(e&2){let t=r().$implicit;s(2),m("channelId",t.id)}}function Me(e,c){if(e&1&&(p(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),h(6,Fe,2,1,"ng-container",14),b(7,"async"),l(),p(8,"div"),d(9,"app-channel-logo",15),l(),p(10,"div",16)(11,"span"),_(12),l()()()(),p(13,"div",12)(14,"div",17),h(15,Ae,2,1,"div",18)(16,Ee,1,4,"app-channel-category-select",19),l()()(),h(17,we,6,1,"div",20)(18,De,3,1,"div",20),l()()),e&2){let t=c.$implicit,i=r();s(6),m("ngIf",y(7,8,i.defaultCategories$)),s(3),m("typeId",t.type)("showChannelName",!1),s(),m("matTooltip",t.name)("matTooltipShowDelay",2500),s(2),at(t.name),s(3),g(t.type==i.channelType.Shopify||t.type==i.channelType.Plugo?15:16),s(2),g(t.categoryId&&i.channelType.Lazada!=t.type&&t.selected?17:i.channelType.Shopify==t.type&&t.selected?18:-1)}}var Ko=(()=>{class e{constructor(){this.uploadProductService=u(ut),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Dt,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(Z(1))}onCategoryChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.categoryId=i,o.attributes=[]),o)))}onAttributesChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.attributes=i),o)))}onSelectChannel(t,i,n){this.channelProductUploads.update(o=>o.map((a,C)=>{if(C==i&&t.selected){let nt=this.findCategoryByChannelId(t.id,n);a.categoryId=nt?.DefaultCategoryID}return C==i&&!t.selected&&(a.categoryId=null),a}))}findCategoryByChannelId(t,i){return i.find(n=>n.ID===t)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-product-upload"]],features:[x([pt,Bt,Gt,st])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,n){if(i&1&&(p(0,"mainpanel",0)(1,"actions")(2,"button",1),I("click",function(){return n.onUploadProduct()}),d(3,"i",2),_(4," Upload "),l()(),p(5,"content")(6,"div",3)(7,"h3",4),_(8,"Product To Upload"),l(),p(9,"div",5),k(10,Ie,2,7,"div",6,O),b(12,"async"),l(),p(13,"h3",7),_(14,"Channel To Upload"),l(),k(15,Me,19,10,"div",8,O),l()()()),i&2){let o;m("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),m("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),s(8),w(y(12,3,n.selectedProducts$)),s(5),w(n.channelProductUploads())}},dependencies:[S,V,T,Yt,Lt,Ut,Ht,Xt,Rt,$t,tt,U,Nt,Vt,Mt,zt,Zt,Kt,te,ee,jt,qt],encapsulation:2})}}return e})();export{Ko as ProductUploadComponent};
@@ -1 +1 @@
1
- import{a as _}from"./chunk-KVP6OL4J.js";import"./chunk-77IUCPIQ.js";import{a as ye,b as ge}from"./chunk-OE2JYQHN.js";import"./chunk-7GQIIDFF.js";import"./chunk-VETHPEVU.js";import"./chunk-75BDXSG3.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{a as R}from"./chunk-YPM6IC2W.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import"./chunk-LEMNVA5V.js";import{e as he}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as w,n as ue}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{y as fe}from"./chunk-DPLEMBB4.js";import{c as d}from"./chunk-PXB4YEY3.js";import{F as pe,H as de,J as ce,f as ae,g as F,j as le,k as P,m as me,n as se}from"./chunk-GPEVUTDI.js";import{Eb as T,Ec as p,Fb as Z,Fc as j,Gc as J,Ic as y,Jc as g,Kb as h,Kc as C,Na as V,Pc as re,Uc as oe,Wb as m,Z as Q,Zc as k,_b as $,_c as B,bc as H,cc as ee,ea as z,ec as te,fc as ie,gc as r,hc as a,ic as v,ja as q,ka as X,lc as ne,oa as Y,ob as G,pd as U,qb as l,rc as b,sc as u,vc as K,wb as f}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var Ce=(()=>{class n{constructor(){this.reportTabs=[{Title:"1.Create Order",Url:"/menu/sync-log/order/sync-order"},{Title:"2.Convert Order To Invoice",Url:"/menu/sync-log/order/convert-to-invoice"},{Title:"3.Create Invoice",Url:"/menu/sync-log/order/invoice"},{Title:"4.Create Outbound Logistic",Url:"/menu/sync-log/order/delivery"},{Title:"5.Add Payment",Url:"/menu/sync-log/order/payment"},{Title:"6.Void Invoice",Url:"/menu/sync-log/order/void-invoice"},{Title:"All",Url:"/menu/sync-log/order/all"}]}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=T({type:n,selectors:[["app-order"]],standalone:!1,decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(i,t){i&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),v(3,"nav-tab",2),a()()(),v(4,"router-outlet")),i&2&&(l(3),m("Tabs",t.reportTabs))},dependencies:[ye,pe],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]})}}return n})();var S=class{};var I=(()=>{class n{constructor(e){this.http=e}GetLoader(){return this.http.post("/api/Report/GetLoader",{})}GetSyncOrder(e){return new Promise((i,t)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(s=>{i(s)})})}GetSyncInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/CreateInvoice",JSON.stringify(e)).subscribe(s=>{i(s)})})}GetSyncVoidInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/Void",JSON.stringify(e)).subscribe(s=>{i(s)})})}GetSyncConvertInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/ConvertToInvoice",JSON.stringify(e)).subscribe(s=>{i(s)})})}GetSyncDelivery(e){return new Promise((i,t)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(s=>{i(s)})})}GetSyncPayment(e){return new Promise((i,t)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(s=>{i(s)})})}getAllReport(e){return this.http.post("/api/Report/all",JSON.stringify(e))}static{this.\u0275fac=function(i){return new(i||n)(Y(he))}}static{this.\u0275prov=q({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var O=function(n){return n[n.OK=200]="OK",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.CONFLICT=409]="CONFLICT",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n}(O||{});var De=()=>["/menu/log/order"],Ee=(n,c,e,i,t)=>({responseCode:n,From:c,to:e,actionType:i,ChannelID:t});function Oe(n,c){if(n&1&&(r(0,"th",6)(1,"div",7)(2,"h4"),p(3),a(),r(4,"small",8),p(5),a()()()),n&2){let e=c.$implicit,i=u();l(3),j(e),l(),$(i.getTextBgColor(e)),l(),j(i.getHeaderStatusDesc(e))}}function Re(n,c){if(n&1&&(r(0,"a",12),p(1),k(2,"number"),a()),n&2){let e=u().$implicit,i=u().$implicit,t=u();m("routerLink",re(5,De))("queryParams",oe(6,Ee,e.Key,t.fromQueryParam,t.toQueryParam,t.type,i.ChannelID)),l(),J(" ",B(2,3,e.Value)," ")}}function Le(n,c){n&1&&(r(0,"span",13),p(1,"-"),a())}function xe(n,c){if(n&1&&(r(0,"td",11),h(1,Re,3,12,"a",12)(2,Le,2,0,"span",13),a()),n&2){let e=c.$implicit;l(),H(e.Value?1:2)}}function Me(n,c){if(n&1&&(r(0,"tr")(1,"td")(2,"a",9),v(3,"img",10),a()(),r(4,"td")(5,"div")(6,"a",9),p(7),a()(),r(8,"div"),p(9),a()(),te(10,xe,3,1,"td",11,ee),a()),n&2){let e=c.$implicit,i=u();l(2),K("href",e.Url,G),l(),m("src",i.getChannelLogo(e.Type),G),l(3),K("href",e.Url,G),l(),j(e.Name),l(2),j(e.Url),l(),ie(e.list)}}function ke(n,c){if(n&1&&(r(0,"td",11)(1,"div",17),p(2),k(3,"number"),a()()),n&2){let e=c.$implicit;l(2),J(" ",B(3,1,e.total)," ")}}function Be(n,c){if(n&1&&(r(0,"tfoot")(1,"tr")(2,"td",14)(3,"div",15),p(4,"Total"),a()(),h(5,ke,4,3,"td",16),a()()),n&2){let e=u();l(5),m("ngForOf",e.logsCalculation())}}var D=(()=>{class n{constructor(){this.header=V(),this.result=V(),this.orderedHeader=U(()=>this.header().sort((e,i)=>e-i)),this.logsOrdered=U(()=>{let e=this.result();return e=e.map(i=>(this.orderedHeader().forEach(t=>{i.list.findIndex(o=>o.Key===t)===-1&&i.list.push({Key:t,Value:0}),i.list.sort((o,A)=>o.Key-A.Key)}),i)),e}),this.logsCalculation=U(()=>{let e=this.concatStatusCode(),i=[];return this.orderedHeader().forEach(t=>{let o=e.filter(A=>A.Key===t).reduce((A,we)=>A+we.Value,0);i.push({status:t,total:o})}),i}),this.type=null,this.headerStatus=O,this.listCalculationStatusCode=[]}set from(e){e&&(this.fromQueryParam=new Date(e).toJSON().toString())}set to(e){e&&(this.toQueryParam=new Date(e).toJSON().toString())}getHeaderStatusDesc(e){let i=null;switch(e){case O.BAD_REQUEST:i="BAD REQUEST";break;case O.CONFLICT:i="CONFLICT";break;case O.INTERNAL_SERVER_ERROR:i="INTERNAL SERVER ERROR";break;case O.NOT_FOUND:i="NOT FOUND";break;default:i="OK";break}return i}getTextBgColor(e){let i=null;switch(e){case O.OK:i="bg-success";break;case O.INTERNAL_SERVER_ERROR:i="bg-danger";break;default:i="bg-warning";break}return i}getChannelLogo(e){return d.getChannelLogoByTypeId(e)}concatStatusCode(){return this.logsOrdered().map(e=>e.list).reduce((e,i)=>[...e,...i],[])}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=T({type:n,selectors:[["app-table-report"]],inputs:{header:[1,"header"],result:[1,"result"],from:"from",to:"to",type:"type"},standalone:!1,decls:10,vars:3,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","5%"],["class","text-start","style","width: 10%",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"text-start",2,"width","10%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],[1,"text-start"],[1,"h3","text-primary","fw-bold","ms-1",3,"routerLink","queryParams"],[1,"h3","fw-bold","ms-1"],["colspan","2"],[1,"text-center","h3","fw-bold"],["class","text-start",4,"ngFor","ngForOf"],[1,"d-inline-block","h3","text-primary","fw-bold","ms-1"]],template:function(i,t){i&1&&(r(0,"table",0)(1,"thead",1)(2,"tr"),v(3,"th",2),r(4,"th",3),p(5,"Channel"),a(),h(6,Oe,6,4,"th",4),a()(),r(7,"tbody"),h(8,Me,12,5,"tr",5),a(),h(9,Be,6,1,"tfoot"),a()),i&2&&(l(6),m("ngForOf",t.orderedHeader()),l(2),m("ngForOf",t.logsOrdered()),l(),H(t.logsCalculation().length>0?9:-1))},dependencies:[ae,de,me],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]})}}return n})();function Ne(n,c){if(n&1&&(r(0,"div",7)(1,"div",8),v(2,"app-table-report",9),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",0)}}var ve=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S,this.pageTitle="New Order";let t=new Date;this.maxDate=t,this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-sales-order"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.getChannelLogs()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,Ne,3,5,"div",6),a()()()),i&2&&(m("headerTitle",t.pageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();function We(n,c){if(n&1&&(r(0,"div",7)(1,"div",8),v(2,"app-table-report",9),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",1)}}var Te=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-invoice"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,We,3,5,"div",6),a()()()),i&2&&(m("headerTitle",t.PageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();function Ae(n,c){if(n&1&&(r(0,"div",8)(1,"div",9),v(2,"app-table-report",10),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",3)}}var _e=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S;let t=new Date;this.maxDate=t,this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-delivery"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"filterDate"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div",1)(3,"label",2),p(4,"From/To"),a(),r(5,"div",3)(6,"datepicker",4),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",5),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",6),h(11,Ae,3,5,"div",7),a()()()),i&2&&(m("headerTitle",t.PageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();function je(n,c){if(n&1&&(r(0,"div",7)(1,"div",8),v(2,"app-table-report",9),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",4)}}var Se=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S,this.PageTitle="Completed";let t=new Date;this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-payment"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,je,3,5,"div",6),a()()()),i&2&&(m("headerTitle",t.PageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();function Ge(n,c){n&1&&ne(0)}function Ue(n,c){if(n&1&&(r(0,"div",8)(1,"div",9),v(2,"app-table-report",10),a()()),n&2){let e=c.ngIf,i=u();l(2),m("result",e.Body)("header",e.Header)("from",i.filter==null?null:i.filter.From)("to",i.filter==null?null:i.filter.To)}}var be=(()=>{class n{constructor(e,i){this.reportOrderService=e,this.datePipe=i,this.filter=new S}ngOnInit(){this.initFilter(),this.initLoader()}initFilter(){let e=new Date;this.minDate=d.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`All (${e==null?"":i+"-"} ${t})`}initLoader(){this.pageLoader$=this.reportOrderService.GetLoader().pipe(z(e=>{this.filter=e,this.updatePageTitle(),this.initData()}))}initData(){this.reportData$=this.reportOrderService.getAllReport(this.filter).pipe(Q())}onFilter(){this.updatePageTitle(),this.initData()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-all"]],standalone:!1,decls:15,vars:10,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[4,"ngIf"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,Ge,1,0,"ng-container",6),k(12,"async"),h(13,Ue,3,4,"div",7),k(14,"async"),a()()()),i&2&&(m("headerTitle",t.pageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",B(12,6,t.pageLoader$)),l(2),m("ngIf",B(14,8,t.reportData$)))},dependencies:[F,w,_,D,le],encapsulation:2})}}return n})();function Ve(n,c){if(n&1&&(r(0,"div",7)(1,"div",8),v(2,"app-table-report",9),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",1)}}var Fe=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S,this.PageTitle="Convert Sales Order To Invoice";let t=new Date;this.maxDate=t,this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Convert Sales Order To Invoice (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-convert-invoice"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,Ve,3,5,"div",6),a()()()),i&2&&(m("headerTitle",t.PageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();function He(n,c){if(n&1&&(r(0,"div",7)(1,"div",8),v(2,"app-table-report",9),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",1)}}var Pe=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-void-invoice"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,He,3,5,"div",6),a()()()),i&2&&(m("headerTitle",t.PageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();var Ke=[{path:"",component:Ce,children:[{path:"",redirectTo:"all",pathMatch:"full"},{path:"sync-order",component:ve,canActivate:[R],data:{title:"Sync Order"}},{path:"convert-to-invoice",component:Fe,canActivate:[R],data:{title:"Sync Convert to Invoice"}},{path:"invoice",component:Te,canActivate:[R],data:{title:"Sync Invoice"}},{path:"delivery",component:_e,canActivate:[R],data:{title:"Sync Delivery"}},{path:"payment",component:Se,canActivate:[R],data:{title:"Sync Payment"}},{path:"void-invoice",component:Pe,canActivate:[R],data:{title:"Sync void invoice"}},{path:"all",component:be,canActivate:[R],data:{title:"All Report"}}]}],Gt=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=Z({type:n})}static{this.\u0275inj=X({imports:[se,ge,fe,ue,_,ce.forChild(Ke)]})}}return n})();export{Gt as OrderModule};
1
+ import{a as _}from"./chunk-KVP6OL4J.js";import"./chunk-77IUCPIQ.js";import{a as ye,b as ge}from"./chunk-OE2JYQHN.js";import"./chunk-7GQIIDFF.js";import"./chunk-VETHPEVU.js";import"./chunk-75BDXSG3.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{a as R}from"./chunk-5KHDEW35.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import"./chunk-IHYEQWAY.js";import{e as he}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as w,n as ue}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{y as fe}from"./chunk-DPLEMBB4.js";import{c as d}from"./chunk-PXB4YEY3.js";import{F as pe,H as de,J as ce,f as ae,g as F,j as le,k as P,m as me,n as se}from"./chunk-GPEVUTDI.js";import{Eb as T,Ec as p,Fb as Z,Fc as j,Gc as J,Ic as y,Jc as g,Kb as h,Kc as C,Na as V,Pc as re,Uc as oe,Wb as m,Z as Q,Zc as k,_b as $,_c as B,bc as H,cc as ee,ea as z,ec as te,fc as ie,gc as r,hc as a,ic as v,ja as q,ka as X,lc as ne,oa as Y,ob as G,pd as U,qb as l,rc as b,sc as u,vc as K,wb as f}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var Ce=(()=>{class n{constructor(){this.reportTabs=[{Title:"1.Create Order",Url:"/menu/sync-log/order/sync-order"},{Title:"2.Convert Order To Invoice",Url:"/menu/sync-log/order/convert-to-invoice"},{Title:"3.Create Invoice",Url:"/menu/sync-log/order/invoice"},{Title:"4.Create Outbound Logistic",Url:"/menu/sync-log/order/delivery"},{Title:"5.Add Payment",Url:"/menu/sync-log/order/payment"},{Title:"6.Void Invoice",Url:"/menu/sync-log/order/void-invoice"},{Title:"All",Url:"/menu/sync-log/order/all"}]}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=T({type:n,selectors:[["app-order"]],standalone:!1,decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(i,t){i&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),v(3,"nav-tab",2),a()()(),v(4,"router-outlet")),i&2&&(l(3),m("Tabs",t.reportTabs))},dependencies:[ye,pe],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]})}}return n})();var S=class{};var I=(()=>{class n{constructor(e){this.http=e}GetLoader(){return this.http.post("/api/Report/GetLoader",{})}GetSyncOrder(e){return new Promise((i,t)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(s=>{i(s)})})}GetSyncInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/CreateInvoice",JSON.stringify(e)).subscribe(s=>{i(s)})})}GetSyncVoidInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/Void",JSON.stringify(e)).subscribe(s=>{i(s)})})}GetSyncConvertInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/ConvertToInvoice",JSON.stringify(e)).subscribe(s=>{i(s)})})}GetSyncDelivery(e){return new Promise((i,t)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(s=>{i(s)})})}GetSyncPayment(e){return new Promise((i,t)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(s=>{i(s)})})}getAllReport(e){return this.http.post("/api/Report/all",JSON.stringify(e))}static{this.\u0275fac=function(i){return new(i||n)(Y(he))}}static{this.\u0275prov=q({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var O=function(n){return n[n.OK=200]="OK",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.CONFLICT=409]="CONFLICT",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n}(O||{});var De=()=>["/menu/log/order"],Ee=(n,c,e,i,t)=>({responseCode:n,From:c,to:e,actionType:i,ChannelID:t});function Oe(n,c){if(n&1&&(r(0,"th",6)(1,"div",7)(2,"h4"),p(3),a(),r(4,"small",8),p(5),a()()()),n&2){let e=c.$implicit,i=u();l(3),j(e),l(),$(i.getTextBgColor(e)),l(),j(i.getHeaderStatusDesc(e))}}function Re(n,c){if(n&1&&(r(0,"a",12),p(1),k(2,"number"),a()),n&2){let e=u().$implicit,i=u().$implicit,t=u();m("routerLink",re(5,De))("queryParams",oe(6,Ee,e.Key,t.fromQueryParam,t.toQueryParam,t.type,i.ChannelID)),l(),J(" ",B(2,3,e.Value)," ")}}function Le(n,c){n&1&&(r(0,"span",13),p(1,"-"),a())}function xe(n,c){if(n&1&&(r(0,"td",11),h(1,Re,3,12,"a",12)(2,Le,2,0,"span",13),a()),n&2){let e=c.$implicit;l(),H(e.Value?1:2)}}function Me(n,c){if(n&1&&(r(0,"tr")(1,"td")(2,"a",9),v(3,"img",10),a()(),r(4,"td")(5,"div")(6,"a",9),p(7),a()(),r(8,"div"),p(9),a()(),te(10,xe,3,1,"td",11,ee),a()),n&2){let e=c.$implicit,i=u();l(2),K("href",e.Url,G),l(),m("src",i.getChannelLogo(e.Type),G),l(3),K("href",e.Url,G),l(),j(e.Name),l(2),j(e.Url),l(),ie(e.list)}}function ke(n,c){if(n&1&&(r(0,"td",11)(1,"div",17),p(2),k(3,"number"),a()()),n&2){let e=c.$implicit;l(2),J(" ",B(3,1,e.total)," ")}}function Be(n,c){if(n&1&&(r(0,"tfoot")(1,"tr")(2,"td",14)(3,"div",15),p(4,"Total"),a()(),h(5,ke,4,3,"td",16),a()()),n&2){let e=u();l(5),m("ngForOf",e.logsCalculation())}}var D=(()=>{class n{constructor(){this.header=V(),this.result=V(),this.orderedHeader=U(()=>this.header().sort((e,i)=>e-i)),this.logsOrdered=U(()=>{let e=this.result();return e=e.map(i=>(this.orderedHeader().forEach(t=>{i.list.findIndex(o=>o.Key===t)===-1&&i.list.push({Key:t,Value:0}),i.list.sort((o,A)=>o.Key-A.Key)}),i)),e}),this.logsCalculation=U(()=>{let e=this.concatStatusCode(),i=[];return this.orderedHeader().forEach(t=>{let o=e.filter(A=>A.Key===t).reduce((A,we)=>A+we.Value,0);i.push({status:t,total:o})}),i}),this.type=null,this.headerStatus=O,this.listCalculationStatusCode=[]}set from(e){e&&(this.fromQueryParam=new Date(e).toJSON().toString())}set to(e){e&&(this.toQueryParam=new Date(e).toJSON().toString())}getHeaderStatusDesc(e){let i=null;switch(e){case O.BAD_REQUEST:i="BAD REQUEST";break;case O.CONFLICT:i="CONFLICT";break;case O.INTERNAL_SERVER_ERROR:i="INTERNAL SERVER ERROR";break;case O.NOT_FOUND:i="NOT FOUND";break;default:i="OK";break}return i}getTextBgColor(e){let i=null;switch(e){case O.OK:i="bg-success";break;case O.INTERNAL_SERVER_ERROR:i="bg-danger";break;default:i="bg-warning";break}return i}getChannelLogo(e){return d.getChannelLogoByTypeId(e)}concatStatusCode(){return this.logsOrdered().map(e=>e.list).reduce((e,i)=>[...e,...i],[])}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=T({type:n,selectors:[["app-table-report"]],inputs:{header:[1,"header"],result:[1,"result"],from:"from",to:"to",type:"type"},standalone:!1,decls:10,vars:3,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","5%"],["class","text-start","style","width: 10%",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"text-start",2,"width","10%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],[1,"text-start"],[1,"h3","text-primary","fw-bold","ms-1",3,"routerLink","queryParams"],[1,"h3","fw-bold","ms-1"],["colspan","2"],[1,"text-center","h3","fw-bold"],["class","text-start",4,"ngFor","ngForOf"],[1,"d-inline-block","h3","text-primary","fw-bold","ms-1"]],template:function(i,t){i&1&&(r(0,"table",0)(1,"thead",1)(2,"tr"),v(3,"th",2),r(4,"th",3),p(5,"Channel"),a(),h(6,Oe,6,4,"th",4),a()(),r(7,"tbody"),h(8,Me,12,5,"tr",5),a(),h(9,Be,6,1,"tfoot"),a()),i&2&&(l(6),m("ngForOf",t.orderedHeader()),l(2),m("ngForOf",t.logsOrdered()),l(),H(t.logsCalculation().length>0?9:-1))},dependencies:[ae,de,me],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]})}}return n})();function Ne(n,c){if(n&1&&(r(0,"div",7)(1,"div",8),v(2,"app-table-report",9),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",0)}}var ve=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S,this.pageTitle="New Order";let t=new Date;this.maxDate=t,this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-sales-order"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.getChannelLogs()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,Ne,3,5,"div",6),a()()()),i&2&&(m("headerTitle",t.pageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();function We(n,c){if(n&1&&(r(0,"div",7)(1,"div",8),v(2,"app-table-report",9),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",1)}}var Te=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-invoice"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,We,3,5,"div",6),a()()()),i&2&&(m("headerTitle",t.PageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();function Ae(n,c){if(n&1&&(r(0,"div",8)(1,"div",9),v(2,"app-table-report",10),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",3)}}var _e=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S;let t=new Date;this.maxDate=t,this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-delivery"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"filterDate"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div",1)(3,"label",2),p(4,"From/To"),a(),r(5,"div",3)(6,"datepicker",4),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",5),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",6),h(11,Ae,3,5,"div",7),a()()()),i&2&&(m("headerTitle",t.PageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();function je(n,c){if(n&1&&(r(0,"div",7)(1,"div",8),v(2,"app-table-report",9),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",4)}}var Se=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S,this.PageTitle="Completed";let t=new Date;this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-payment"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,je,3,5,"div",6),a()()()),i&2&&(m("headerTitle",t.PageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();function Ge(n,c){n&1&&ne(0)}function Ue(n,c){if(n&1&&(r(0,"div",8)(1,"div",9),v(2,"app-table-report",10),a()()),n&2){let e=c.ngIf,i=u();l(2),m("result",e.Body)("header",e.Header)("from",i.filter==null?null:i.filter.From)("to",i.filter==null?null:i.filter.To)}}var be=(()=>{class n{constructor(e,i){this.reportOrderService=e,this.datePipe=i,this.filter=new S}ngOnInit(){this.initFilter(),this.initLoader()}initFilter(){let e=new Date;this.minDate=d.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`All (${e==null?"":i+"-"} ${t})`}initLoader(){this.pageLoader$=this.reportOrderService.GetLoader().pipe(z(e=>{this.filter=e,this.updatePageTitle(),this.initData()}))}initData(){this.reportData$=this.reportOrderService.getAllReport(this.filter).pipe(Q())}onFilter(){this.updatePageTitle(),this.initData()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-all"]],standalone:!1,decls:15,vars:10,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[4,"ngIf"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,Ge,1,0,"ng-container",6),k(12,"async"),h(13,Ue,3,4,"div",7),k(14,"async"),a()()()),i&2&&(m("headerTitle",t.pageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",B(12,6,t.pageLoader$)),l(2),m("ngIf",B(14,8,t.reportData$)))},dependencies:[F,w,_,D,le],encapsulation:2})}}return n})();function Ve(n,c){if(n&1&&(r(0,"div",7)(1,"div",8),v(2,"app-table-report",9),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",1)}}var Fe=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S,this.PageTitle="Convert Sales Order To Invoice";let t=new Date;this.maxDate=t,this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Convert Sales Order To Invoice (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-convert-invoice"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,Ve,3,5,"div",6),a()()()),i&2&&(m("headerTitle",t.PageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();function He(n,c){if(n&1&&(r(0,"div",7)(1,"div",8),v(2,"app-table-report",9),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",1)}}var Pe=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-void-invoice"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,He,3,5,"div",6),a()()()),i&2&&(m("headerTitle",t.PageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();var Ke=[{path:"",component:Ce,children:[{path:"",redirectTo:"all",pathMatch:"full"},{path:"sync-order",component:ve,canActivate:[R],data:{title:"Sync Order"}},{path:"convert-to-invoice",component:Fe,canActivate:[R],data:{title:"Sync Convert to Invoice"}},{path:"invoice",component:Te,canActivate:[R],data:{title:"Sync Invoice"}},{path:"delivery",component:_e,canActivate:[R],data:{title:"Sync Delivery"}},{path:"payment",component:Se,canActivate:[R],data:{title:"Sync Payment"}},{path:"void-invoice",component:Pe,canActivate:[R],data:{title:"Sync void invoice"}},{path:"all",component:be,canActivate:[R],data:{title:"All Report"}}]}],Gt=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=Z({type:n})}static{this.\u0275inj=X({imports:[se,ge,fe,ue,_,ce.forChild(Ke)]})}}return n})();export{Gt as OrderModule};
@@ -1 +1 @@
1
- import{a as F}from"./chunk-5FEQZAWX.js";import{a as _t}from"./chunk-7KG3DC5J.js";import{a as k}from"./chunk-4ASUM4N5.js";import{a as dt,b as st,d as ft,e as ut}from"./chunk-6IAGGRZN.js";import{l as pt}from"./chunk-LEMNVA5V.js";import{e as ct}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import{m as B,n as gt}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{h as at,m as rt,y as lt}from"./chunk-DPLEMBB4.js";import{c as mt}from"./chunk-PXB4YEY3.js";import{E as ot,H as L,J as R,d as it,f as nt,g as D,j as M,k as T,m as w,n as P}from"./chunk-GPEVUTDI.js";import{$c as C,Dc as J,Eb as N,Ec as a,Fb as b,Fc as p,Gc as S,Ic as K,Jc as Q,Kb as f,Kc as X,Pc as Y,Qc as Z,Rc as tt,Wb as m,Z as O,Zc as d,_c as h,aa as z,ad as et,ca as q,f as A,gc as o,hc as n,ic as E,jc as u,ka as x,kc as g,mc as W,nb as U,ob as j,qb as r,rc as H,sc as s,v,vc as G,wb as _,ya as I,za as y}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var bt=(e,c)=>({"bg-gradient-danger":e,"bg-gradient-warning":c}),Et=()=>["/menu/notification/detail"],Dt=e=>({ID:e});function Mt(e,c){if(e&1&&(o(0,"span",14),E(1,"img",15),n(),a(2)),e&2){let t=c.item;r(),m("src",t.Img,j)("alt",t.Name),r(),S(" ",t.Name," ")}}function Tt(e,c){if(e&1&&(u(0),a(1),d(2,"number"),o(3,"span"),a(4,"s"),n(),g()),e&2){let t=s().$implicit;r(),S(" ",C(2,1,t.DurationInSecond,"1.1-1")," ")}}function wt(e,c){e&1&&a(0," - ")}function Pt(e,c){if(e&1&&(u(0),o(1,"tr",16)(2,"td")(3,"a",17),E(4,"img",18),o(5,"span"),a(6),n()()(),o(7,"td")(8,"b"),a(9),n(),E(10,"div",19),n(),o(11,"td"),f(12,Tt,5,4,"ng-container",20)(13,wt,1,0,"ng-template",null,0,et),n(),o(15,"td"),a(16),n(),o(17,"td"),a(18),d(19,"date"),n()(),g()),e&2){let t=c.$implicit,i=J(14);r(),m("ngClass",tt(14,bt,t.Status==1,t.Status==0)),r(2),m("routerLink",Y(17,Et))("queryParams",Z(18,Dt,t.ID)),r(),G("src",t.Img,j),r(2),p(t.Name),r(3),p(t.Label),r(),m("innerHTML",t.Message,U),r(2),m("ngIf",t.DurationInSecond)("ngIfElse",i),r(4),p(t.StatusLabel),r(2),p(C(19,11,t.Created,"dd MMM yyyy HH:mm"))}}function Lt(e,c){if(e&1){let t=W();u(0),o(1,"div",6)(2,"div",21)(3,"app-custom-paginator",22),d(4,"async"),d(5,"async"),H("total",function(){I(t);let l=s(2);return y(l.getRowCount())})("next",function(){I(t);let l=s(2);return y(l.getNotifications())})("previous",function(){I(t);let l=s(2);return y(l.getNotifications())}),n()()(),g()}if(e&2){let t=s().ngIf,i=s();r(3),m("filter",i.filter)("totaldata",t==null?null:t.length)("paginationTotal",h(4,4,i.rowCount$))("hasClicked",h(5,6,i.rowCount$))}}function Rt(e,c){if(e&1&&(u(0),f(1,Lt,6,8,"ng-container",13),g()),e&2){let t=c.ngIf;r(),m("ngIf",t.length>0)}}var ht=(()=>{class e{constructor(t,i,l){this.http=t,this.notificationService=i,this.authService=l,this.filter=new _t,this.destroy$=new A,this.channelOptions=l.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(q(this.destroy$)).subscribe(t=>{t.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(t=>{this.filter=t.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let t={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",t).pipe(v(i=>i.Data),v(i=>(i=this.setChannelLogoToNotifications(i),i=this.setTimeToSecond(i),i)),O(1))}setTimeToSecond(t){return t=t.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i)),t}setChannelLogoToNotifications(t){return t=t.map(i=>(i.Img=mt.getChannelLogoByTypeId(i.TypeID),i)),t}getRowCount(){let t={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",t).pipe(v(i=>i.Count),O(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||e)(_(ct),_(F),_(pt))}}static{this.\u0275cmp=N({type:e,selectors:[["app-notification"]],standalone:!1,decls:30,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(i,l){i&1&&(o(0,"mainpanel",1),H("onSubmit",function(){return l.onFilter()}),o(1,"filters")(2,"div")(3,"h6",2),a(4,"Channel"),n(),o(5,"ng-select",3),X("ngModelChange",function($){return Q(l.filter.ChannelID,$)||(l.filter.ChannelID=$),$}),f(6,Mt,3,3,"ng-template",4),n()()(),o(7,"content")(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11)(15,"th"),a(16,"Channel"),n(),o(17,"th"),a(18,"Process"),n(),o(19,"th"),a(20,"Duration"),n(),o(21,"th"),a(22,"Status"),n(),o(23,"th"),a(24,"Created"),n()()(),o(25,"tbody"),f(26,Pt,20,20,"ng-container",12),d(27,"async"),n()()()()(),f(28,Rt,2,1,"ng-container",13),d(29,"async"),n()()()),i&2&&(r(5),m("clearable",!0)("items",l.channelOptions),K("ngModel",l.filter.ChannelID),r(21),m("ngForOf",h(27,5,l.notifications$)),r(2),m("ngIf",h(29,7,l.notifications$)))},dependencies:[it,nt,D,ft,dt,st,at,rt,B,L,k,M,w,T],encapsulation:2})}}return e})();function Ft(e,c){if(e&1&&(o(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),a(4,"Perflog"),n()(),o(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),a(9),n()()()()()()),e&2){let t=s().ngIf;r(9),p(t.Perflog)}}function Bt(e,c){if(e&1&&(u(0),o(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),a(5,"StackTrace"),n()(),o(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),a(10),n()()()()()(),g()),e&2){let t=s().ngIf;r(10),p(t==null?null:t.StackTrace)}}function kt(e,c){if(e&1&&(u(0),o(1,"mainpanel",1)(2,"actions")(3,"a",2),a(4,"Back"),n()(),o(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),a(12,"General"),n()(),o(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),a(18,"Created Date"),n(),o(19,"div")(20,"span"),a(21),d(22,"date"),n()()()(),o(23,"div",10)(24,"div",11)(25,"label"),a(26,"Status"),n(),o(27,"div")(28,"span"),a(29),n()()()()(),o(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),a(34,"Duration"),n(),o(35,"div")(36,"span"),a(37),d(38,"number"),n()()()(),o(39,"div",10)(40,"div",11)(41,"label"),a(42,"Label"),n(),o(43,"div")(44,"span"),a(45),n()()()()()()()()(),o(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),a(51,"Message"),n()(),o(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),a(56),n()()()()()(),f(57,Ft,10,1,"div",16)(58,Bt,11,1,"ng-container",0),n()()()(),g()),e&2){let t=c.ngIf;r(),m("headerTitle","Notification "+t.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),r(20),p(C(22,10,t.Created,"dd MMM yyyy HH:mm:ss")),r(8),p(t.StatusLabel),r(8),S("",C(38,13,t.DurationInSecond,"1.1-1")," s"),r(8),p(t.Label),r(11),p(t.Message),r(),m("ngIf",t==null?null:t.Perflog),r(),m("ngIf",t==null?null:t.StackTrace)}}var vt=(()=>{class e{constructor(t,i){this.activatedRoute=t,this.notificationService=i}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(z(t=>{let i=t.ID;return this.notificationService.getNotificationDetail(i).pipe(v(l=>(l.DurationInSecond=parseInt(l.Duration)/1e3,l)))}))}static{this.\u0275fac=function(i){return new(i||e)(_(ot),_(F))}}static{this.\u0275cmp=N({type:e,selectors:[["app-detail"]],standalone:!1,decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(i,l){i&1&&(f(0,kt,59,16,"ng-container",0),d(1,"async")),i&2&&m("ngIf",h(1,1,l.notification$))},dependencies:[D,B,L,M,w,T],encapsulation:2})}}return e})();var $t=[{path:"",component:ht},{path:"detail",component:vt}],Ct=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=x({imports:[P,R.forChild($t)]})}}return e})();var de=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=x({imports:[P,Ct,ut,lt,gt,R,k]})}}return e})();export{de as NotificationModule};
1
+ import{a as F}from"./chunk-CTUXL543.js";import{a as _t}from"./chunk-7KG3DC5J.js";import{a as k}from"./chunk-4ASUM4N5.js";import{a as dt,b as st,d as ft,e as ut}from"./chunk-6IAGGRZN.js";import{l as pt}from"./chunk-IHYEQWAY.js";import{e as ct}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import{m as B,n as gt}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{h as at,m as rt,y as lt}from"./chunk-DPLEMBB4.js";import{c as mt}from"./chunk-PXB4YEY3.js";import{E as ot,H as L,J as R,d as it,f as nt,g as D,j as M,k as T,m as w,n as P}from"./chunk-GPEVUTDI.js";import{$c as C,Dc as J,Eb as N,Ec as a,Fb as b,Fc as p,Gc as S,Ic as K,Jc as Q,Kb as f,Kc as X,Pc as Y,Qc as Z,Rc as tt,Wb as m,Z as O,Zc as d,_c as h,aa as z,ad as et,ca as q,f as A,gc as o,hc as n,ic as E,jc as u,ka as x,kc as g,mc as W,nb as U,ob as j,qb as r,rc as H,sc as s,v,vc as G,wb as _,ya as I,za as y}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var bt=(e,c)=>({"bg-gradient-danger":e,"bg-gradient-warning":c}),Et=()=>["/menu/notification/detail"],Dt=e=>({ID:e});function Mt(e,c){if(e&1&&(o(0,"span",14),E(1,"img",15),n(),a(2)),e&2){let t=c.item;r(),m("src",t.Img,j)("alt",t.Name),r(),S(" ",t.Name," ")}}function Tt(e,c){if(e&1&&(u(0),a(1),d(2,"number"),o(3,"span"),a(4,"s"),n(),g()),e&2){let t=s().$implicit;r(),S(" ",C(2,1,t.DurationInSecond,"1.1-1")," ")}}function wt(e,c){e&1&&a(0," - ")}function Pt(e,c){if(e&1&&(u(0),o(1,"tr",16)(2,"td")(3,"a",17),E(4,"img",18),o(5,"span"),a(6),n()()(),o(7,"td")(8,"b"),a(9),n(),E(10,"div",19),n(),o(11,"td"),f(12,Tt,5,4,"ng-container",20)(13,wt,1,0,"ng-template",null,0,et),n(),o(15,"td"),a(16),n(),o(17,"td"),a(18),d(19,"date"),n()(),g()),e&2){let t=c.$implicit,i=J(14);r(),m("ngClass",tt(14,bt,t.Status==1,t.Status==0)),r(2),m("routerLink",Y(17,Et))("queryParams",Z(18,Dt,t.ID)),r(),G("src",t.Img,j),r(2),p(t.Name),r(3),p(t.Label),r(),m("innerHTML",t.Message,U),r(2),m("ngIf",t.DurationInSecond)("ngIfElse",i),r(4),p(t.StatusLabel),r(2),p(C(19,11,t.Created,"dd MMM yyyy HH:mm"))}}function Lt(e,c){if(e&1){let t=W();u(0),o(1,"div",6)(2,"div",21)(3,"app-custom-paginator",22),d(4,"async"),d(5,"async"),H("total",function(){I(t);let l=s(2);return y(l.getRowCount())})("next",function(){I(t);let l=s(2);return y(l.getNotifications())})("previous",function(){I(t);let l=s(2);return y(l.getNotifications())}),n()()(),g()}if(e&2){let t=s().ngIf,i=s();r(3),m("filter",i.filter)("totaldata",t==null?null:t.length)("paginationTotal",h(4,4,i.rowCount$))("hasClicked",h(5,6,i.rowCount$))}}function Rt(e,c){if(e&1&&(u(0),f(1,Lt,6,8,"ng-container",13),g()),e&2){let t=c.ngIf;r(),m("ngIf",t.length>0)}}var ht=(()=>{class e{constructor(t,i,l){this.http=t,this.notificationService=i,this.authService=l,this.filter=new _t,this.destroy$=new A,this.channelOptions=l.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(q(this.destroy$)).subscribe(t=>{t.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(t=>{this.filter=t.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let t={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",t).pipe(v(i=>i.Data),v(i=>(i=this.setChannelLogoToNotifications(i),i=this.setTimeToSecond(i),i)),O(1))}setTimeToSecond(t){return t=t.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i)),t}setChannelLogoToNotifications(t){return t=t.map(i=>(i.Img=mt.getChannelLogoByTypeId(i.TypeID),i)),t}getRowCount(){let t={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",t).pipe(v(i=>i.Count),O(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||e)(_(ct),_(F),_(pt))}}static{this.\u0275cmp=N({type:e,selectors:[["app-notification"]],standalone:!1,decls:30,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(i,l){i&1&&(o(0,"mainpanel",1),H("onSubmit",function(){return l.onFilter()}),o(1,"filters")(2,"div")(3,"h6",2),a(4,"Channel"),n(),o(5,"ng-select",3),X("ngModelChange",function($){return Q(l.filter.ChannelID,$)||(l.filter.ChannelID=$),$}),f(6,Mt,3,3,"ng-template",4),n()()(),o(7,"content")(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11)(15,"th"),a(16,"Channel"),n(),o(17,"th"),a(18,"Process"),n(),o(19,"th"),a(20,"Duration"),n(),o(21,"th"),a(22,"Status"),n(),o(23,"th"),a(24,"Created"),n()()(),o(25,"tbody"),f(26,Pt,20,20,"ng-container",12),d(27,"async"),n()()()()(),f(28,Rt,2,1,"ng-container",13),d(29,"async"),n()()()),i&2&&(r(5),m("clearable",!0)("items",l.channelOptions),K("ngModel",l.filter.ChannelID),r(21),m("ngForOf",h(27,5,l.notifications$)),r(2),m("ngIf",h(29,7,l.notifications$)))},dependencies:[it,nt,D,ft,dt,st,at,rt,B,L,k,M,w,T],encapsulation:2})}}return e})();function Ft(e,c){if(e&1&&(o(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),a(4,"Perflog"),n()(),o(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),a(9),n()()()()()()),e&2){let t=s().ngIf;r(9),p(t.Perflog)}}function Bt(e,c){if(e&1&&(u(0),o(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),a(5,"StackTrace"),n()(),o(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),a(10),n()()()()()(),g()),e&2){let t=s().ngIf;r(10),p(t==null?null:t.StackTrace)}}function kt(e,c){if(e&1&&(u(0),o(1,"mainpanel",1)(2,"actions")(3,"a",2),a(4,"Back"),n()(),o(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),a(12,"General"),n()(),o(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),a(18,"Created Date"),n(),o(19,"div")(20,"span"),a(21),d(22,"date"),n()()()(),o(23,"div",10)(24,"div",11)(25,"label"),a(26,"Status"),n(),o(27,"div")(28,"span"),a(29),n()()()()(),o(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),a(34,"Duration"),n(),o(35,"div")(36,"span"),a(37),d(38,"number"),n()()()(),o(39,"div",10)(40,"div",11)(41,"label"),a(42,"Label"),n(),o(43,"div")(44,"span"),a(45),n()()()()()()()()(),o(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),a(51,"Message"),n()(),o(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),a(56),n()()()()()(),f(57,Ft,10,1,"div",16)(58,Bt,11,1,"ng-container",0),n()()()(),g()),e&2){let t=c.ngIf;r(),m("headerTitle","Notification "+t.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),r(20),p(C(22,10,t.Created,"dd MMM yyyy HH:mm:ss")),r(8),p(t.StatusLabel),r(8),S("",C(38,13,t.DurationInSecond,"1.1-1")," s"),r(8),p(t.Label),r(11),p(t.Message),r(),m("ngIf",t==null?null:t.Perflog),r(),m("ngIf",t==null?null:t.StackTrace)}}var vt=(()=>{class e{constructor(t,i){this.activatedRoute=t,this.notificationService=i}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(z(t=>{let i=t.ID;return this.notificationService.getNotificationDetail(i).pipe(v(l=>(l.DurationInSecond=parseInt(l.Duration)/1e3,l)))}))}static{this.\u0275fac=function(i){return new(i||e)(_(ot),_(F))}}static{this.\u0275cmp=N({type:e,selectors:[["app-detail"]],standalone:!1,decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(i,l){i&1&&(f(0,kt,59,16,"ng-container",0),d(1,"async")),i&2&&m("ngIf",h(1,1,l.notification$))},dependencies:[D,B,L,M,w,T],encapsulation:2})}}return e})();var $t=[{path:"",component:ht},{path:"detail",component:vt}],Ct=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=x({imports:[P,R.forChild($t)]})}}return e})();var de=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=x({imports:[P,Ct,ut,lt,gt,R,k]})}}return e})();export{de as NotificationModule};