marketplacepos 3.18.0 → 3.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/chunk-3ORAGDUV.js +1 -0
- package/Marketplace/{chunk-5T3BQNT6.js → chunk-3UKBESDQ.js} +1 -1
- package/Marketplace/{chunk-5RS36M3W.js → chunk-3XWOT6GZ.js} +1 -1
- package/Marketplace/{chunk-C62XLEFW.js → chunk-3ZQBMP7R.js} +1 -1
- package/Marketplace/chunk-4ULJZM2I.js +1 -0
- package/Marketplace/{chunk-POFMDL5L.js → chunk-626K5IHH.js} +1 -1
- package/Marketplace/chunk-6UK5EDKC.js +5 -0
- package/Marketplace/{chunk-HDP6YJ5R.js → chunk-7M25O454.js} +1 -1
- package/Marketplace/{chunk-5B6FNQOB.js → chunk-AHA2WBEK.js} +1 -1
- package/Marketplace/{chunk-D5XULRZS.js → chunk-AKJ4XG6V.js} +1 -1
- package/Marketplace/{chunk-63QD35VV.js → chunk-ATJPUUZQ.js} +1 -1
- package/Marketplace/{chunk-6SHHVYL6.js → chunk-BTXJZOGD.js} +1 -1
- package/Marketplace/{chunk-O323NMVX.js → chunk-CDMK5VJH.js} +1 -1
- package/Marketplace/{chunk-WTYYEYYS.js → chunk-CU5GN2LS.js} +1 -1
- package/Marketplace/{chunk-QPH4XFGN.js → chunk-DBJI2JPD.js} +1 -1
- package/Marketplace/{chunk-WJRDWY5K.js → chunk-DS2GU2CN.js} +1 -1
- package/Marketplace/chunk-DSIVJYMI.js +1 -0
- package/Marketplace/chunk-EJ55MBM5.js +2 -0
- package/Marketplace/{chunk-QVCJCYVC.js → chunk-FMYZSZEX.js} +1 -1
- package/Marketplace/{chunk-RVJCYVRR.js → chunk-FXSAT7QD.js} +1 -1
- package/Marketplace/{chunk-P4LC252I.js → chunk-GXTFTALU.js} +1 -1
- package/Marketplace/{chunk-CCGY3SGF.js → chunk-H7PPNAHJ.js} +1 -1
- package/Marketplace/chunk-ILWNPZBQ.js +1 -0
- package/Marketplace/{chunk-JA6YU65N.js → chunk-JIBUH2RU.js} +1 -1
- package/Marketplace/{chunk-F32X4UUF.js → chunk-JKF36COK.js} +1 -1
- package/Marketplace/{chunk-RKRJ4JOF.js → chunk-K6H25CD6.js} +1 -1
- package/Marketplace/{chunk-LPS2CHAH.js → chunk-KG4XWHUW.js} +1 -1
- package/Marketplace/{chunk-OXSGKWPW.js → chunk-KRKQFGMS.js} +1 -1
- package/Marketplace/chunk-LDQFATAB.js +3 -0
- package/Marketplace/{chunk-FONTS7CQ.js → chunk-LDUXYVRJ.js} +1 -1
- package/Marketplace/chunk-LE57WB57.js +1 -0
- package/Marketplace/{chunk-AO22A2PN.js → chunk-LVFJFYVO.js} +1 -1
- package/Marketplace/{chunk-6NFPCNPI.js → chunk-NF2ANZGK.js} +1 -1
- package/Marketplace/{chunk-AAFEUTPF.js → chunk-NVF24LK5.js} +1 -1
- package/Marketplace/{chunk-DBBHNJFV.js → chunk-NW6ISHTY.js} +1 -1
- package/Marketplace/chunk-OIQXRKAG.js +1 -0
- package/Marketplace/chunk-P3AZ2BMM.js +1 -0
- package/Marketplace/{chunk-BI5MTVCX.js → chunk-PMMMRQTF.js} +1 -1
- package/Marketplace/{chunk-SKTTDASB.js → chunk-PYBQPNRY.js} +1 -1
- package/Marketplace/{chunk-J3ATGPY6.js → chunk-QZM3EEDZ.js} +1 -1
- package/Marketplace/{chunk-2FI33IHG.js → chunk-R6PEAOIJ.js} +1 -1
- package/Marketplace/{chunk-64DIERLC.js → chunk-RA4WGOOW.js} +1 -1
- package/Marketplace/{chunk-P6UIWSMI.js → chunk-S36U4I4O.js} +1 -1
- package/Marketplace/chunk-T2C7GSKK.js +1 -0
- package/Marketplace/{chunk-G52YHYPD.js → chunk-ULQRFCCE.js} +1 -1
- package/Marketplace/{chunk-6IZO4UK3.js → chunk-VVBW74PO.js} +1 -1
- package/Marketplace/{chunk-5BU6HQXL.js → chunk-WH3FZ3VM.js} +1 -1
- package/Marketplace/{chunk-WONQYZFA.js → chunk-WVKDNFEM.js} +1 -1
- package/Marketplace/chunk-X4WLRMDP.js +1 -0
- package/Marketplace/{chunk-SQCMDWE5.js → chunk-XUJOOOT7.js} +1 -1
- package/Marketplace/{chunk-YLIFCNKK.js → chunk-ZDLDOZUM.js} +1 -1
- package/Marketplace/index.html +3 -3
- package/Marketplace/{main-ZA64OH5W.js → main-GCBPO674.js} +1 -1
- package/Marketplace/{styles-AJ4ALOFG.css → styles-RZHRYK3K.css} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-2AMEIUWK.js +0 -1
- package/Marketplace/chunk-2HLJYECZ.js +0 -1
- package/Marketplace/chunk-6OGERROP.js +0 -1
- package/Marketplace/chunk-BFLBYMTB.js +0 -5
- package/Marketplace/chunk-DPZZV2TL.js +0 -1
- package/Marketplace/chunk-KG27JWOX.js +0 -2
- package/Marketplace/chunk-L4A3FRTR.js +0 -1
- package/Marketplace/chunk-R5BHUH4C.js +0 -1
- package/Marketplace/chunk-R5CG7RZC.js +0 -3
- package/Marketplace/chunk-YKILFBLW.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b}from"./chunk-
|
|
1
|
+
import{a as v,b}from"./chunk-K6H25CD6.js";import{a as r}from"./chunk-DBJI2JPD.js";import"./chunk-DS2GU2CN.js";import"./chunk-NVF24LK5.js";import"./chunk-KCDL7SWP.js";import"./chunk-CTKEWRX4.js";import"./chunk-GXHE2CDH.js";import"./chunk-X4WLRMDP.js";import{$a as u,Dc as o,Ia as s,Qb as f,Vc as h,Zc as i,aa as l,ga as m,ha as c,lb as d,mb as C,nb as a}from"./chunk-HSFUKC7R.js";import"./chunk-GNOSNGXM.js";var T=(()=>{let e=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"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=m({type:e,selectors:[["app-price"]],standalone:!0,features:[f],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,g){n&1&&(d(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),C()()(),a(4,"router-outlet")),n&2&&(s(3),u("Tabs",g.priceTabs))},dependencies:[o,b,v,i,h],encapsulation:2});let t=e;return t})();var P=[{path:"",component:T,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-ILWNPZBQ.js").then(t=>t.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-QZM3EEDZ.js").then(t=>t.CustomChannelPriceComponent)},canActivate:[r],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-VVBW74PO.js").then(t=>t.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=c({type:e}),e.\u0275inj=l({imports:[o,i.forChild(P)]});let t=e;return t})();export{D as PriceRoutingModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as he}from"./chunk-3ORAGDUV.js";import{a as oe}from"./chunk-BVIRHZTZ.js";import{a as fe}from"./chunk-GP6U42SV.js";import{a as xe,b as Ce}from"./chunk-W3POM6UQ.js";import{c as ue}from"./chunk-73DE2GZF.js";import{a as ge}from"./chunk-3ZQBMP7R.js";import{g as de}from"./chunk-6NTRXLMW.js";import{g as ce}from"./chunk-DS2GU2CN.js";import{d as pe,g as se}from"./chunk-3XWOT6GZ.js";import{t as _e,u as me}from"./chunk-CTKEWRX4.js";import{b as ee,h as te,m as ne,y as ie}from"./chunk-O5MOPAT5.js";import{c as re,e as le,f as ae}from"./chunk-X4WLRMDP.js";import{$a as m,$b as j,Cc as J,Dc as Q,Ha as v,Hb as b,Ia as a,Ib as s,Ja as F,Jb as k,Kb as S,Mb as O,Nb as D,Ob as N,Qb as Z,Sb as T,V as z,Za as p,_b as $,ac as q,bc as y,c as W,ga as A,gb as P,hb as E,jb as M,kb as V,lb as c,mb as _,nb as I,oa as g,ob as x,pa as u,pb as C,qb as R,rb as f,tc as K,ub as h,vc as X,wb as r,wc as Y,xa as B,yc as G,za as U,zb as H}from"./chunk-HSFUKC7R.js";var L=t=>[t],Te=t=>({"text-decoration-line-through":t}),be=t=>({"ms-10":t}),Se=t=>({"bg-gradient-warning":t});function ve(t,l){if(t&1){let n=f();c(0,"mat-slide-toggle",13),h("toggleChange",function(){g(n);let e=r();return e.toggleStatus=!e.toggleStatus,u(e.onToggle())}),c(1,"small",14),s(2),_()()}if(t&2){let n=r();a(2),S(" ",n.productToggleTitle?n.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Ie(t,l){if(t&1){let n=f();c(0,"th")(1,"input",16),N("ngModelChange",function(e){g(n);let o=r(2);return D(o.checkboxState,e)||(o.checkboxState=e),u(e)}),h("ngModelChange",function(){g(n);let e=r(2);return u(e.onCheckboxStateChange())}),_()()}if(t&2){let n=r(2);a(),O("ngModel",n.checkboxState)}}function ye(t,l){if(t&1&&(p(0,Ie,2,1,"ng-template",15),c(1,"th",11),s(2,"POS"),_()),t&2){let n=r();m("ngxPermissionsOnly",T(1,L,n.rolePriceEdit))}}function we(t,l){if(t&1&&(x(0),c(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),c(5,"div",21),s(6),$(7,"stringLimit"),_()()()(),C()),t&2){let n=l.$implicit;a(3),m("matTooltip",(n.Name==null?null:n.Name.length)>20?n.Name:""),a(),m("src",n==null?null:n.Img,v),a(2),S(" ",q(7,3,n.Name,20)," ")}}function Fe(t,l){t&1&&R(0)}function Pe(t,l){if(t&1&&(x(0),p(1,Fe,1,0,"ng-container",34),C()),t&2){r();let n=b(7);a(),m("ngTemplateOutlet",n)}}function Ee(t,l){t&1&&R(0)}function Me(t,l){if(t&1&&p(0,Ee,1,0,"ng-container",34),t&2){r(2);let n=b(7);m("ngTemplateOutlet",n)}}function Ve(t,l){if(t&1&&p(0,Me,1,1,"ng-template",15),t&2){let n=r(4);m("ngxPermissionsOnly",T(1,L,n.rolePriceEdit))}}function ke(t,l){if(t&1){let n=f();x(0),c(1,"input",35),N("ngModelChange",function(e){g(n);let o=r(4).$implicit;return D(o.selected,e)||(o.selected=e),u(e)}),h("ngModelChange",function(){g(n);let e=r(4).$implicit,o=r();return u(o.onCheckboxStateProduct(e.ID))}),_(),C()}if(t&2){let n=r(4).$implicit;a(),O("ngModel",n.selected)}}function Oe(t,l){if(t&1&&p(0,ke,2,1,"ng-container",22),t&2){let n=r(3).$implicit;m("ngIf",(n==null||n.Variants==null?null:n.Variants.length)>1)}}function De(t,l){if(t&1){let n=f();x(0),c(1,"img",36),h("click",function(e){g(n);let o=r(3).$implicit,d=r();return u(d.onZoomImage(e,o==null?null:o.ImageUrl))}),_(),C()}if(t&2){let n=r(3).$implicit;a(),H("src",n==null?null:n.ThumbnailUrl,v)}}function Ne(t,l){t&1&&I(0,"img",37)}function $e(t,l){if(t&1&&(x(0),c(1,"td",29)(2,"div",30),p(3,Pe,2,1,"ng-container",31)(4,Ve,1,3,"ng-template",null,0,y)(6,Oe,1,1,"ng-template",null,1,y),c(8,"div",26),p(9,De,2,1,"ng-container",31)(10,Ne,1,0,"ng-template",null,2,y),_()()(),c(12,"td",32)(13,"div"),s(14),_(),c(15,"small",33),s(16),_()(),C()),t&2){let n=b(5),i=b(11),e=r(2).$implicit,o=r();a(),m("rowSpan",e==null?null:e.Variants.length),a(2),m("ngIf",o.table=="inventory")("ngIfElse",n),a(5),m("ngClass",T(9,be,(e==null||e.Variants==null?null:e.Variants.length)<=1)),a(),m("ngIf",e==null?null:e.ThumbnailUrl)("ngIfElse",i),a(3),m("rowSpan",e==null?null:e.Variants.length),a(2),k(e==null?null:e.Name),a(2),S("(",e==null?null:e.Category,")")}}function Be(t,l){if(t&1){let n=f();c(0,"input",16),N("ngModelChange",function(e){g(n);let o=r(3).$implicit;return D(o.selected,e)||(o.selected=e),u(e)}),_()}if(t&2){let n=r(3).$implicit;O("ngModel",n.selected)}}function Ue(t,l){if(t&1&&(c(0,"td",38),p(1,Be,1,1,"input",39),_()),t&2){let n=r(2).$implicit,i=r(2);a(),m("ngIf",i.printPOS(n)>=0||i.table=="price")}}function Re(t,l){if(t&1&&(p(0,Ue,2,1,"ng-template",15),c(1,"td",24),s(2),$(3,"number"),_()),t&2){let n=r().$implicit,i=r(2);m("ngxPermissionsOnly",T(4,L,i.rolePriceEdit)),a(2),k(j(3,2,i.printPOS(n)))}}function je(t,l){if(t&1){let n=f();x(0),c(1,"td",40),h("click",function(){g(n);let e=r().$implicit,o=r().$implicit,d=r().$implicit,w=r();return u(w.openTableDialog(d.Name,o,e.ID,d.ChannelItemID))}),c(2,"div",30)(3,"div",41),s(4),$(5,"number"),_(),c(6,"a",42),h("click",function(e){return g(n),u(e==null?null:e.stopPropagation())}),I(7,"i",28),_()()(),C()}if(t&2){let n=l.$implicit,i=r(2).$implicit,e=r(2);a(),m("ngClass",T(5,Se,e.printPOS(i)!=e.printItem(n)&&e.hiddenIPOSInventory()==!1)),a(3),S(" ",j(5,3,e.printItem(n))," "),a(2),m("href",n.Url,v)}}function Le(t,l){t&1&&(c(0,"td",43)(1,"div",30)(2,"span"),s(3,"X"),_()()())}function We(t,l){if(t&1&&p(0,je,8,7,"ng-container",31)(1,Le,4,0,"ng-template",null,3,y),t&2){let n=l.$implicit,i=b(2),e=r().$implicit,o=r(2);m("ngIf",o.getItemFromChannel(e,n))("ngIfElse",i)}}function ze(t,l){if(t&1&&(c(0,"tr"),p(1,$e,17,11,"ng-container",22),c(2,"td",23),s(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),c(8,"div",21)(9,"a",27),I(10,"i",28),_()()()(),p(11,Re,4,6),M(12,We,3,2,null,null,E),_()),t&2){let n=l.$implicit,i=l.$index,e=r(2);a(),m("ngIf",i==0),a(2),k(n==null?null:n.Model),a(2),m("matTooltip",n.Discontinued?e.discontinuedVariantMsg:""),a(),m("ngClass",T(7,Te,n.Discontinued)),a(),S(" ",n.Code," "),a(2),m("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),v),a(2),P(e.hiddenIPOSInventory()==!1?11:-1),a(),V(e.channel)}}function Ae(t,l){if(t&1&&(c(0,"tbody"),M(1,ze,14,9,"tr",null,E),_()),t&2){let n=l.$implicit;a(),V(n.Variants)}}var ht=(()=>{let l=class l{constructor(i,e,o){this.dialog=i,this.biggerPictureService=e,this.authService=o,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=oe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new U,this.destroy$=new W,this.toggle=new U,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(i){let e=this.data.filter(o=>o.ID==i);e.length>0&&(e=e.map(o=>(o.Variants=o.Variants.map(d=>(d.selected=o.selected,d)),o)))}onCheckboxStateChange(){this.data=this.data.map(i=>(i.Variants=i.Variants.map(e=>(e.selected=this.checkboxState,e)),i))}getItemFromChannel(i,e){return i.Channel.find(d=>re.IsNotEmpty(e.LocationID)?d.LocationID==e.LocationID:d.ChannelID==e.ID)}printItem(i){if(this.table=="inventory")return i.Inventory;if(this.table=="price")return i.Price}openTableDialog(i,e,o,d){this.dialog.open(he,{data:{Name:i,Variant:e,ChannelID:o,Table:this.table,ChannelItemID:d}}).afterClosed().pipe(z(this.destroy$)).subscribe(w=>{w!=null&&this.onSubmit.emit(w)})}printPOS(i){return this.table=="inventory"?i.Inventory?i.Inventory:0:this.table=="price"?i.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(i,e){this.biggerPictureService.openBiggerPicture(i,e)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};l.\u0275fac=function(e){return new(e||l)(F(pe),F(ge),F(ce))},l.\u0275cmp=A({type:l,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},standalone:!0,features:[Z],decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(e,o){e&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,ve,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),s(10,"Variant"),_(),c(11,"th",11),s(12,"SKU"),_(),p(13,ye,3,3)(14,we,8,6,"ng-container",12),_()(),M(15,Ae,3,0,"tbody",null,E),_()()),e&2&&(a(8),P(o.showProductToggle?8:-1),a(5),P(o.hiddenIPOSInventory()==!1?13:-1),a(),m("ngForOf",o.channel),a(),V(o.data))},dependencies:[Q,K,X,Y,G,J,ie,ee,te,ne,Ce,xe,se,de,ue,ae,le,me,_e,fe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]});let t=l;return t})();export{ht as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as P}from"./chunk-
|
|
1
|
+
import{a as P}from"./chunk-AHA2WBEK.js";import"./chunk-NVF24LK5.js";import{m as C,n as B}from"./chunk-3XWOT6GZ.js";import"./chunk-CTKEWRX4.js";import"./chunk-GXHE2CDH.js";import"./chunk-O5MOPAT5.js";import{$a as u,$b as m,Ac as _,Bc as D,Cc as R,Dc as b,Ia as a,Ib as n,Ja as c,Jb as p,Kb as S,Q as f,Qb as I,Uc as M,Xc as L,Za as g,Zc as A,_b as s,ac as v,ga as h,lb as t,mb as i,q as y,wc as x,zc as E}from"./chunk-HSFUKC7R.js";import"./chunk-GNOSNGXM.js";function j(d,l){if(d&1&&(t(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"h5"),n(6,"General"),i()(),t(7,"div",8)(8,"div",9)(9,"div",10)(10,"div",11)(11,"label"),n(12,"Created"),i(),t(13,"div")(14,"span"),n(15),s(16,"date"),i()()()(),t(17,"div",10)(18,"div",11)(19,"label"),n(20,"Duration"),i(),t(21,"div")(22,"span"),n(23),s(24,"number"),i()()()(),t(25,"div",10)(26,"div",11)(27,"label"),n(28,"Response Code"),i(),t(29,"div")(30,"span"),n(31),i()()()()()()()()(),t(32,"div",4)(33,"div",10)(34,"div",6)(35,"div",7)(36,"h5"),n(37,"Request"),i()(),t(38,"div",8)(39,"div",12)(40,"div",13)(41,"pre"),n(42),s(43,"json"),i()()()()()(),t(44,"div",10)(45,"div",6)(46,"div",7)(47,"h5"),n(48,"Response"),i()(),t(49,"div",8)(50,"div",14)(51,"div",13)(52,"pre"),n(53),s(54,"json"),i()()()()()()()()),d&2){let e=l.ngIf;a(15),p(v(16,5,e==null?null:e._source["@timestamp"],"dd MMM yyyy HH:mm:ss")),a(8),S("",v(24,8,e==null?null:e.DurationInSecond,"1.1-1")," s"),a(8),p(e==null||e._source==null||e._source.log==null?null:e._source.log.respCode),a(11),p(m(43,11,e==null||e._source==null||e._source.log==null?null:e._source.log.req)),a(11),p(m(54,13,e==null||e._source==null||e._source.log==null?null:e._source.log.res))}}var J=(()=>{let l=class l{constructor(r,o){this.inventoryAsyncServiceLog=r,this.activatedRoute=o}ngOnInit(){let r=this.activatedRoute.snapshot.queryParams;this.initInventoryLog(r?.ID)}initInventoryLog(r){this.inventoryLog$=this.inventoryAsyncServiceLog.getInventoryAsyncLogDetail(r).pipe(y(o=>(o.hits[0].DurationInSecond=parseInt(o.hits[0]._source?.Duration)/1e3,o?.hits[0])),f(1))}};l.\u0275fac=function(o){return new(o||l)(c(P),c(M))},l.\u0275cmp=h({type:l,selectors:[["app-inventory-async-detail"]],standalone:!0,features:[I],decls:7,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory-async",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],[1,"col-sm-12"],[1,"form-group"],[1,"col-sm-12","mt-2"]],template:function(o,w){o&1&&(t(0,"mainpanel",0)(1,"actions")(2,"a",1),n(3,"Back"),i()(),t(4,"content"),g(5,j,55,15,"div",2),s(6,"async"),i()()),o&2&&(u("headerTitle","Sync Inventory Async")("hideSearchBox",!0)("hideSearchDropdown",!0),a(5),u("ngIf",m(6,4,w.inventoryLog$)))},dependencies:[b,x,E,D,R,_,B,C,A,L]});let d=l;return d})();export{J as InventoryAsyncDetailComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as g}from"./chunk-
|
|
1
|
+
import{b as g}from"./chunk-NVF24LK5.js";import{$ as o,ca as l}from"./chunk-HSFUKC7R.js";var d=(()=>{let s=class s{constructor(e){this.toastrService=e}showToastrUpdateInventory(e,t,r){let a=t.length>0,i=r.length>0;if(!i&&a&&this.toastrService.success(`${this.generateSuccessMessage(t.length)}`,"Success",{enableHtml:!0}),i&&a){let c=`<li>${this.generateSuccessMessage(t.length)}</li>`,h=this.generateErrorMessage(e,r),u=`<ol>${c} ${h}</ol>`;this.toastrService.warning(u,"Warning",{enableHtml:!0})}if(i&&!a){let c=`<ol>${this.generateErrorMessage(e,r)}</ol>`;this.toastrService.error(c,"Error",{enableHtml:!0})}}generateSuccessMessage(e){return`
|
|
2
2
|
<div>
|
|
3
3
|
<span class="fw-bold">Successfully</span> updated ${e} variants in 1 channels
|
|
4
4
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as w,$a as l,E as ht,Fa as vt,Ga as Q,Ia as a,Ib as g,Ic as _t,Ja as b,Jc as Ct,Kb as y,Kc as bt,Ma as gt,Pa as U,Qb as K,Sc as yt,Ua as A,Za as H,_a as E,aa as dt,ab as M,ad as It,b as ct,ba as pt,bd as tt,c as C,ca as m,da as x,db as f,ed as B,fd as F,ga as L,gc as S,ha as mt,hd as et,j as ut,ka as ft,lb as d,mb as v,nb as R,oa as G,ob as Y,p as Z,pa as $,pb as q,rb as J,rc as W,tb as Tt,ua as N,ub as j,wb as c,wc as X}from"./chunk-HSFUKC7R.js";import{a as u,b as I}from"./chunk-GNOSNGXM.js";var wt=["toast-component",""];function At(s,n){if(s&1){let e=J();d(0,"button",5),j("click",function(){G(e);let i=c();return $(i.remove())}),d(1,"span",6),g(2,"\xD7"),v()()}}function Ht(s,n){if(s&1&&(Y(0),g(1),q()),s&2){let e=c(2);a(),y("[",e.duplicatesCount+1,"]")}}function Et(s,n){if(s&1&&(d(0,"div"),g(1),H(2,Ht,2,1,"ng-container",4),v()),s&2){let e=c();f(e.options.titleClass),E("aria-label",e.title),a(),y(" ",e.title," "),a(),l("ngIf",e.duplicatesCount)}}function Mt(s,n){if(s&1&&R(0,"div",7),s&2){let e=c();f(e.options.messageClass),l("innerHTML",e.message,Q)}}function Rt(s,n){if(s&1&&(d(0,"div",8),g(1),v()),s&2){let e=c();f(e.options.messageClass),E("aria-label",e.message),a(),y(" ",e.message," ")}}function jt(s,n){if(s&1&&(d(0,"div"),R(1,"div",9),v()),s&2){let e=c();a(),M("width",e.width()+"%")}}function Nt(s,n){if(s&1){let e=J();d(0,"button",5),j("click",function(){G(e);let i=c();return $(i.remove())}),d(1,"span",6),g(2,"\xD7"),v()()}}function St(s,n){if(s&1&&(Y(0),g(1),q()),s&2){let e=c(2);a(),y("[",e.duplicatesCount+1,"]")}}function Bt(s,n){if(s&1&&(d(0,"div"),g(1),H(2,St,2,1,"ng-container",4),v()),s&2){let e=c();f(e.options.titleClass),E("aria-label",e.title),a(),y(" ",e.title," "),a(),l("ngIf",e.duplicatesCount)}}function Ft(s,n){if(s&1&&R(0,"div",7),s&2){let e=c();f(e.options.messageClass),l("innerHTML",e.message,Q)}}function Pt(s,n){if(s&1&&(d(0,"div",8),g(1),v()),s&2){let e=c();f(e.options.messageClass),E("aria-label",e.message),a(),y(" ",e.message," ")}}function kt(s,n){if(s&1&&(d(0,"div"),R(1,"div",9),v()),s&2){let e=c();a(),M("width",e.width()+"%")}}var it=class{_attachedHost;component;viewContainerRef;injector;constructor(n,e){this.component=n,this.injector=e}attach(n,e){return this._attachedHost=n,n.attach(this,e)}detach(){let n=this._attachedHost;if(n)return this._attachedHost=void 0,n.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(n){this._attachedHost=n}},st=class{_attachedPortal;_disposeFn;attach(n,e){return this._attachedPortal=n,this.attachComponentPortal(n,e)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(n){this._disposeFn=n}},nt=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new C;_activate=new C;_manualClose=new C;_resetTimeout=new C;_countDuplicate=new C;constructor(n){this._overlayRef=n}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(n,e){n&&this._resetTimeout.next(),e&&this._countDuplicate.next(++this.duplicatesCount)}},D=class{toastId;config;message;title;toastType;toastRef;_onTap=new C;_onAction=new C;constructor(n,e,t,i,o,r){this.toastId=n,this.config=e,this.message=t,this.title=i,this.toastType=o,this.toastRef=r,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(n){this._onAction.next(n)}onAction(){return this._onAction.asObservable()}},xt={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},Dt=new pt("ToastConfig"),ot=class extends st{_hostDomElement;_componentFactoryResolver;_appRef;constructor(n,e,t){super(),this._hostDomElement=n,this._componentFactoryResolver=e,this._appRef=t}attachComponentPortal(n,e){let t=this._componentFactoryResolver.resolveComponentFactory(n.component),i;return i=t.create(n.injector),this._appRef.attachView(i.hostView),this.setDisposeFn(()=>{this._appRef.detachView(i.hostView),i.destroy()}),e?this._hostDomElement.insertBefore(this._getComponentRootNode(i),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(i)),i}_getComponentRootNode(n){return n.hostView.rootNodes[0]}},Vt=(()=>{class s{_document=x(W);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e=this._document.createElement("div");e.classList.add("overlay-container"),e.setAttribute("aria-live","polite"),this._document.body.appendChild(e),this._containerElement=e}static \u0275fac=function(t){return new(t||s)};static \u0275prov=w({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),at=class{_portalHost;constructor(n){this._portalHost=n}attach(n,e=!0){return this._portalHost.attach(n,e)}detach(){return this._portalHost.detach()}},zt=(()=>{class s{_overlayContainer=x(Vt);_componentFactoryResolver=x(gt);_appRef=x(S);_document=x(W);_paneElements=new Map;create(e,t){return this._createOverlayRef(this.getPaneElement(e,t))}getPaneElement(e="",t){return this._paneElements.get(t)||this._paneElements.set(t,{}),this._paneElements.get(t)[e]||(this._paneElements.get(t)[e]=this._createPaneElement(e,t)),this._paneElements.get(t)[e]}_createPaneElement(e,t){let i=this._document.createElement("div");return i.id="toast-container",i.classList.add(e),i.classList.add("toast-container"),t?t.getContainerElement().appendChild(i):this._overlayContainer.getContainerElement().appendChild(i),i}_createPortalHost(e){return new ot(e,this._componentFactoryResolver,this._appRef)}_createOverlayRef(e){return new at(this._createPortalHost(e))}static \u0275fac=function(t){return new(t||s)};static \u0275prov=w({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),P=(()=>{class s{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(e,t,i,o,r){this.overlay=t,this._injector=i,this.sanitizer=o,this.ngZone=r,this.toastrConfig=u(u({},e.default),e.config),e.config.iconClasses&&(this.toastrConfig.iconClasses=u(u({},e.default.iconClasses),e.config.iconClasses))}show(e,t,i={},o=""){return this._preBuildNotification(o,e,t,this.applyConfig(i))}success(e,t,i={}){let o=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}error(e,t,i={}){let o=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}info(e,t,i={}){let o=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}warning(e,t,i={}){let o=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}clear(e){for(let t of this.toasts)if(e!==void 0){if(t.toastId===e){t.toastRef.manualClose();return}}else t.toastRef.manualClose()}remove(e){let t=this._findToast(e);if(!t||(t.activeToast.toastRef.close(),this.toasts.splice(t.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let i=this.toasts[this.currentlyActive].toastRef;i.isInactive()||(this.currentlyActive=this.currentlyActive+1,i.activate())}return!0}findDuplicate(e="",t="",i,o){let{includeTitleDuplicates:r}=this.toastrConfig;for(let p of this.toasts){let T=r&&p.title===e;if((!r||T)&&p.message===t)return p.toastRef.onDuplicate(i,o),p}return null}applyConfig(e={}){return u(u({},this.toastrConfig),e)}_findToast(e){for(let t=0;t<this.toasts.length;t++)if(this.toasts[t].toastId===e)return{index:t,activeToast:this.toasts[t]};return null}_preBuildNotification(e,t,i,o){return o.onActivateTick?this.ngZone.run(()=>this._buildNotification(e,t,i,o)):this._buildNotification(e,t,i,o)}_buildNotification(e,t,i,o){if(!o.toastComponent)throw new Error("toastComponent required");let r=this.findDuplicate(i,t,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&i||t)&&this.toastrConfig.preventDuplicates&&r!==null)return r;this.previousToastMessage=t;let p=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(p=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let T=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let h=t;t&&o.enableHtml&&(h=this.sanitizer.sanitize(vt.HTML,t));let _=new nt(T),O=new D(this.index,o,h,i,e,_),k=[{provide:D,useValue:O}],rt=N.create({providers:k,parent:this._injector}),V=new it(o.toastComponent,rt),lt=T.attach(V,o.newestOnTop);_.componentInstance=lt.instance;let z={toastId:this.index,title:i||"",message:t||"",toastRef:_,onShown:_.afterActivate(),onHidden:_.afterClosed(),onTap:O.onTap(),onAction:O.onAction(),portal:lt};return p||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{z.toastRef.activate()})),this.toasts.push(z),z}static \u0275fac=function(t){return new(t||s)(m(Dt),m(zt),m(N),m(yt),m(U))};static \u0275prov=w({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),Zt=(()=>{class s{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=A(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if(this.state().value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(e,t,i){this.toastrService=e,this.toastPackage=t,this.ngZone=i,this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state=A({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(e=>I(u({},e),{value:"active"})),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let e=new Date().getTime(),t=this.hideTime-e;this.width.set(t/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(i=>100-i),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(e=>I(u({},e),{value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state().value!=="removed"&&(clearTimeout(this.timeout),this.state.update(e=>I(u({},e),{value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state().value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state().value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state().value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(e),t)):this.timeout=setTimeout(()=>e(),t)}outsideInterval(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(e),t)):this.intervalId=setInterval(()=>e(),t)}runInsideAngular(e){this.ngZone?this.ngZone.run(()=>e()):e()}static \u0275fac=function(t){return new(t||s)(b(P),b(D),b(U))};static \u0275cmp=L({type:s,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(t,i){t&1&&j("click",function(){return i.tapToast()})("mouseenter",function(){return i.stickAround()})("mouseleave",function(){return i.delayedHideToast()}),t&2&&(Tt("@flyInOut",i._state),f(i.toastClasses),M("display",i.displayStyle))},standalone:!0,features:[K],attrs:wt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,i){t&1&&H(0,At,3,0,"button",0)(1,Et,3,5,"div",1)(2,Mt,1,3,"div",2)(3,Rt,2,4,"div",3)(4,jt,2,2,"div",4),t&2&&(l("ngIf",i.options.closeButton),a(),l("ngIf",i.title),a(),l("ngIf",i.message&&i.options.enableHtml),a(),l("ngIf",i.message&&!i.options.enableHtml),a(),l("ngIf",i.options.progressBar))},dependencies:[X],encapsulation:2,data:{animation:[It("flyInOut",[F("inactive",B({opacity:0})),F("active",B({opacity:1})),F("removed",B({opacity:0})),et("inactive => active",tt("{{ easeTime }}ms {{ easing }}")),et("active => removed",tt("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return s})(),Lt=I(u({},xt),{toastComponent:Zt}),Gt=(s={})=>ft([{provide:Dt,useValue:{default:Lt,config:s}}]),le=(()=>{class s{static forRoot(e={}){return{ngModule:s,providers:[Gt(e)]}}static \u0275fac=function(t){return new(t||s)};static \u0275mod=mt({type:s});static \u0275inj=dt({})}return s})();var $t=(()=>{class s{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=A(-1);toastClasses="";get displayStyle(){return this.state()==="inactive"?"none":null}state=A("inactive");timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(e,t,i){this.toastrService=e,this.toastPackage=t,this.appRef=i,this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.set("active"),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let e=new Date().getTime(),t=this.hideTime-e;this.width.set(t/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(i=>100-i),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.set("active"),this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.state.set("removed"),this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state()!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state()==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(t){return new(t||s)(b(P),b(D),b(S))};static \u0275cmp=L({type:s,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(t,i){t&1&&j("click",function(){return i.tapToast()})("mouseenter",function(){return i.stickAround()})("mouseleave",function(){return i.delayedHideToast()}),t&2&&(f(i.toastClasses),M("display",i.displayStyle))},standalone:!0,features:[K],attrs:wt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,i){t&1&&H(0,Nt,3,0,"button",0)(1,Bt,3,5,"div",1)(2,Ft,1,3,"div",2)(3,Pt,2,4,"div",3)(4,kt,2,2,"div",4),t&2&&(l("ngIf",i.options.closeButton),a(),l("ngIf",i.title),a(),l("ngIf",i.message&&i.options.enableHtml),a(),l("ngIf",i.message&&!i.options.enableHtml),a(),l("ngIf",i.options.progressBar))},dependencies:[X],encapsulation:2,changeDetection:0})}return s})(),ce=I(u({},xt),{toastComponent:$t});var fe=(()=>{let n=class n{constructor(t,i){this.http=t,this.toastr=i}get(t,i){let o=this.generateQueryParams(i);return this.http.get(t,{params:o}).pipe(ht(r=>ut))}generateQueryParams(t=[]){let i=new Ct;return t.forEach(o=>{i=i.append(o.key,o.value)}),i}post(t,i,o={},r=1e5){return this.http.post(t,i,o).pipe(Z(r))}postFile(t,i,o=1e5){return new ct(r=>{let p=localStorage.getItem("Token"),T=new _t({"Content-Type":"application/json","Cache-Control":"no-cache"});p&&(T=T.append("Authorization","Bearer "+p)),this.http.post(t,i,{headers:T,observe:"response",responseType:"blob"}).pipe(Z(o)).subscribe({next:h=>{r.next({title:h.headers.get("Content-Disposition"),file:h.body}),r.complete()},error:h=>{if(h.headers.get("Content-Type")==="application/json; charset=utf-8"){let _=new FileReader;_.addEventListener("loadend",O=>{let k=JSON.parse(O.srcElement.result)?.Message;if(!this.unauthorizedErrorHandling(h)){let V=this.errorMessageHandling(h);this.toastr.error(k??"An unknown error has occured!",V.header,{enableHtml:!0})}}),_.readAsText(h.error)}r.error(h)}})})}unauthorizedErrorHandling(t){let i=!1;return(t.status==401||t.status==403)&&(localStorage.getItem("Token")?this.toastr.error("Your session has expired. Please login again.","Unauthorized",{enableHtml:!0}):window.location.href="/",i=!0),i}errorMessageHandling(t){let i="API Error",o="Exception Message";return t.error?(i="API Error - "+t.status,t.status==451&&(i="Error"),t.error&&(o=t.error.Message)):t.Message&&(i="API Error - "+t.name,o=t.Message),{header:i,Message:o}}};n.\u0275fac=function(i){return new(i||n)(m(bt),m(P))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"});let s=n;return s})();export{D as a,P as b,Zt as c,le as d,fe as e};
|
|
1
|
+
import{$ as w,$a as l,E as ht,Fa as vt,Ga as Q,Ia as a,Ib as g,Ic as _t,Ja as b,Jc as Ct,Kb as y,Kc as bt,Ma as gt,Pa as U,Qb as K,Sc as yt,Ua as A,Za as H,_a as E,aa as dt,ab as M,ad as It,b as ct,ba as pt,bd as tt,c as C,ca as m,da as x,db as f,ed as B,fd as F,ga as L,gc as S,ha as mt,hd as et,j as ut,ka as ft,lb as d,mb as v,nb as R,oa as G,ob as Y,p as Z,pa as $,pb as q,rb as J,rc as W,tb as Tt,ua as N,ub as j,wb as c,wc as X}from"./chunk-HSFUKC7R.js";import{a as u,b as I}from"./chunk-GNOSNGXM.js";var wt=["toast-component",""];function At(s,n){if(s&1){let e=J();d(0,"button",5),j("click",function(){G(e);let i=c();return $(i.remove())}),d(1,"span",6),g(2,"\xD7"),v()()}}function Ht(s,n){if(s&1&&(Y(0),g(1),q()),s&2){let e=c(2);a(),y("[",e.duplicatesCount+1,"]")}}function Et(s,n){if(s&1&&(d(0,"div"),g(1),H(2,Ht,2,1,"ng-container",4),v()),s&2){let e=c();f(e.options.titleClass),E("aria-label",e.title),a(),y(" ",e.title," "),a(),l("ngIf",e.duplicatesCount)}}function Mt(s,n){if(s&1&&R(0,"div",7),s&2){let e=c();f(e.options.messageClass),l("innerHTML",e.message,Q)}}function Rt(s,n){if(s&1&&(d(0,"div",8),g(1),v()),s&2){let e=c();f(e.options.messageClass),E("aria-label",e.message),a(),y(" ",e.message," ")}}function jt(s,n){if(s&1&&(d(0,"div"),R(1,"div",9),v()),s&2){let e=c();a(),M("width",e.width()+"%")}}function Nt(s,n){if(s&1){let e=J();d(0,"button",5),j("click",function(){G(e);let i=c();return $(i.remove())}),d(1,"span",6),g(2,"\xD7"),v()()}}function St(s,n){if(s&1&&(Y(0),g(1),q()),s&2){let e=c(2);a(),y("[",e.duplicatesCount+1,"]")}}function Bt(s,n){if(s&1&&(d(0,"div"),g(1),H(2,St,2,1,"ng-container",4),v()),s&2){let e=c();f(e.options.titleClass),E("aria-label",e.title),a(),y(" ",e.title," "),a(),l("ngIf",e.duplicatesCount)}}function Ft(s,n){if(s&1&&R(0,"div",7),s&2){let e=c();f(e.options.messageClass),l("innerHTML",e.message,Q)}}function Pt(s,n){if(s&1&&(d(0,"div",8),g(1),v()),s&2){let e=c();f(e.options.messageClass),E("aria-label",e.message),a(),y(" ",e.message," ")}}function kt(s,n){if(s&1&&(d(0,"div"),R(1,"div",9),v()),s&2){let e=c();a(),M("width",e.width()+"%")}}var it=class{_attachedHost;component;viewContainerRef;injector;constructor(n,e){this.component=n,this.injector=e}attach(n,e){return this._attachedHost=n,n.attach(this,e)}detach(){let n=this._attachedHost;if(n)return this._attachedHost=void 0,n.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(n){this._attachedHost=n}},st=class{_attachedPortal;_disposeFn;attach(n,e){return this._attachedPortal=n,this.attachComponentPortal(n,e)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(n){this._disposeFn=n}},nt=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new C;_activate=new C;_manualClose=new C;_resetTimeout=new C;_countDuplicate=new C;constructor(n){this._overlayRef=n}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(n,e){n&&this._resetTimeout.next(),e&&this._countDuplicate.next(++this.duplicatesCount)}},D=class{toastId;config;message;title;toastType;toastRef;_onTap=new C;_onAction=new C;constructor(n,e,t,i,o,r){this.toastId=n,this.config=e,this.message=t,this.title=i,this.toastType=o,this.toastRef=r,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(n){this._onAction.next(n)}onAction(){return this._onAction.asObservable()}},xt={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},Dt=new pt("ToastConfig"),ot=class extends st{_hostDomElement;_componentFactoryResolver;_appRef;constructor(n,e,t){super(),this._hostDomElement=n,this._componentFactoryResolver=e,this._appRef=t}attachComponentPortal(n,e){let t=this._componentFactoryResolver.resolveComponentFactory(n.component),i;return i=t.create(n.injector),this._appRef.attachView(i.hostView),this.setDisposeFn(()=>{this._appRef.detachView(i.hostView),i.destroy()}),e?this._hostDomElement.insertBefore(this._getComponentRootNode(i),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(i)),i}_getComponentRootNode(n){return n.hostView.rootNodes[0]}},Vt=(()=>{class s{_document=x(W);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e=this._document.createElement("div");e.classList.add("overlay-container"),e.setAttribute("aria-live","polite"),this._document.body.appendChild(e),this._containerElement=e}static \u0275fac=function(t){return new(t||s)};static \u0275prov=w({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),at=class{_portalHost;constructor(n){this._portalHost=n}attach(n,e=!0){return this._portalHost.attach(n,e)}detach(){return this._portalHost.detach()}},zt=(()=>{class s{_overlayContainer=x(Vt);_componentFactoryResolver=x(gt);_appRef=x(S);_document=x(W);_paneElements=new Map;create(e,t){return this._createOverlayRef(this.getPaneElement(e,t))}getPaneElement(e="",t){return this._paneElements.get(t)||this._paneElements.set(t,{}),this._paneElements.get(t)[e]||(this._paneElements.get(t)[e]=this._createPaneElement(e,t)),this._paneElements.get(t)[e]}_createPaneElement(e,t){let i=this._document.createElement("div");return i.id="toast-container",i.classList.add(e),i.classList.add("toast-container"),t?t.getContainerElement().appendChild(i):this._overlayContainer.getContainerElement().appendChild(i),i}_createPortalHost(e){return new ot(e,this._componentFactoryResolver,this._appRef)}_createOverlayRef(e){return new at(this._createPortalHost(e))}static \u0275fac=function(t){return new(t||s)};static \u0275prov=w({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),P=(()=>{class s{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(e,t,i,o,r){this.overlay=t,this._injector=i,this.sanitizer=o,this.ngZone=r,this.toastrConfig=u(u({},e.default),e.config),e.config.iconClasses&&(this.toastrConfig.iconClasses=u(u({},e.default.iconClasses),e.config.iconClasses))}show(e,t,i={},o=""){return this._preBuildNotification(o,e,t,this.applyConfig(i))}success(e,t,i={}){let o=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}error(e,t,i={}){let o=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}info(e,t,i={}){let o=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}warning(e,t,i={}){let o=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}clear(e){for(let t of this.toasts)if(e!==void 0){if(t.toastId===e){t.toastRef.manualClose();return}}else t.toastRef.manualClose()}remove(e){let t=this._findToast(e);if(!t||(t.activeToast.toastRef.close(),this.toasts.splice(t.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let i=this.toasts[this.currentlyActive].toastRef;i.isInactive()||(this.currentlyActive=this.currentlyActive+1,i.activate())}return!0}findDuplicate(e="",t="",i,o){let{includeTitleDuplicates:r}=this.toastrConfig;for(let p of this.toasts){let T=r&&p.title===e;if((!r||T)&&p.message===t)return p.toastRef.onDuplicate(i,o),p}return null}applyConfig(e={}){return u(u({},this.toastrConfig),e)}_findToast(e){for(let t=0;t<this.toasts.length;t++)if(this.toasts[t].toastId===e)return{index:t,activeToast:this.toasts[t]};return null}_preBuildNotification(e,t,i,o){return o.onActivateTick?this.ngZone.run(()=>this._buildNotification(e,t,i,o)):this._buildNotification(e,t,i,o)}_buildNotification(e,t,i,o){if(!o.toastComponent)throw new Error("toastComponent required");let r=this.findDuplicate(i,t,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&i||t)&&this.toastrConfig.preventDuplicates&&r!==null)return r;this.previousToastMessage=t;let p=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(p=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let T=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let h=t;t&&o.enableHtml&&(h=this.sanitizer.sanitize(vt.HTML,t));let _=new nt(T),O=new D(this.index,o,h,i,e,_),k=[{provide:D,useValue:O}],rt=N.create({providers:k,parent:this._injector}),V=new it(o.toastComponent,rt),lt=T.attach(V,o.newestOnTop);_.componentInstance=lt.instance;let z={toastId:this.index,title:i||"",message:t||"",toastRef:_,onShown:_.afterActivate(),onHidden:_.afterClosed(),onTap:O.onTap(),onAction:O.onAction(),portal:lt};return p||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{z.toastRef.activate()})),this.toasts.push(z),z}static \u0275fac=function(t){return new(t||s)(m(Dt),m(zt),m(N),m(yt),m(U))};static \u0275prov=w({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),Zt=(()=>{class s{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=A(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if(this.state().value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(e,t,i){this.toastrService=e,this.toastPackage=t,this.ngZone=i,this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state=A({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(e=>I(u({},e),{value:"active"})),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let e=new Date().getTime(),t=this.hideTime-e;this.width.set(t/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(i=>100-i),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(e=>I(u({},e),{value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state().value!=="removed"&&(clearTimeout(this.timeout),this.state.update(e=>I(u({},e),{value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state().value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state().value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state().value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(e),t)):this.timeout=setTimeout(()=>e(),t)}outsideInterval(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(e),t)):this.intervalId=setInterval(()=>e(),t)}runInsideAngular(e){this.ngZone?this.ngZone.run(()=>e()):e()}static \u0275fac=function(t){return new(t||s)(b(P),b(D),b(U))};static \u0275cmp=L({type:s,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(t,i){t&1&&j("click",function(){return i.tapToast()})("mouseenter",function(){return i.stickAround()})("mouseleave",function(){return i.delayedHideToast()}),t&2&&(Tt("@flyInOut",i._state),f(i.toastClasses),M("display",i.displayStyle))},standalone:!0,features:[K],attrs:wt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,i){t&1&&H(0,At,3,0,"button",0)(1,Et,3,5,"div",1)(2,Mt,1,3,"div",2)(3,Rt,2,4,"div",3)(4,jt,2,2,"div",4),t&2&&(l("ngIf",i.options.closeButton),a(),l("ngIf",i.title),a(),l("ngIf",i.message&&i.options.enableHtml),a(),l("ngIf",i.message&&!i.options.enableHtml),a(),l("ngIf",i.options.progressBar))},dependencies:[X],encapsulation:2,data:{animation:[It("flyInOut",[F("inactive",B({opacity:0})),F("active",B({opacity:1})),F("removed",B({opacity:0})),et("inactive => active",tt("{{ easeTime }}ms {{ easing }}")),et("active => removed",tt("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return s})(),Lt=I(u({},xt),{toastComponent:Zt}),Gt=(s={})=>ft([{provide:Dt,useValue:{default:Lt,config:s}}]),le=(()=>{class s{static forRoot(e={}){return{ngModule:s,providers:[Gt(e)]}}static \u0275fac=function(t){return new(t||s)};static \u0275mod=mt({type:s});static \u0275inj=dt({})}return s})();var $t=(()=>{class s{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=A(-1);toastClasses="";get displayStyle(){return this.state()==="inactive"?"none":null}state=A("inactive");timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(e,t,i){this.toastrService=e,this.toastPackage=t,this.appRef=i,this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.set("active"),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let e=new Date().getTime(),t=this.hideTime-e;this.width.set(t/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(i=>100-i),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.set("active"),this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.state.set("removed"),this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state()!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state()==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(t){return new(t||s)(b(P),b(D),b(S))};static \u0275cmp=L({type:s,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(t,i){t&1&&j("click",function(){return i.tapToast()})("mouseenter",function(){return i.stickAround()})("mouseleave",function(){return i.delayedHideToast()}),t&2&&(f(i.toastClasses),M("display",i.displayStyle))},standalone:!0,features:[K],attrs:wt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,i){t&1&&H(0,Nt,3,0,"button",0)(1,Bt,3,5,"div",1)(2,Ft,1,3,"div",2)(3,Pt,2,4,"div",3)(4,kt,2,2,"div",4),t&2&&(l("ngIf",i.options.closeButton),a(),l("ngIf",i.title),a(),l("ngIf",i.message&&i.options.enableHtml),a(),l("ngIf",i.message&&!i.options.enableHtml),a(),l("ngIf",i.options.progressBar))},dependencies:[X],encapsulation:2,changeDetection:0})}return s})(),ce=I(u({},xt),{toastComponent:$t});var fe=(()=>{let n=class n{constructor(t,i){this.http=t,this.toastr=i}get(t,i){let o=this.generateQueryParams(i);return this.http.get(t,{params:o}).pipe(ht(r=>ut))}generateQueryParams(t=[]){let i=new Ct;return t.forEach(o=>{i=i.append(o.key,o.value)}),i}post(t,i,o={},r=1e5){return this.http.post(t,i,o).pipe(Z(r))}postFile(t,i,o=1e5){return new ct(r=>{let p=localStorage.getItem("Token"),T=new _t({"Content-Type":"application/json","Cache-Control":"no-cache"});p&&(T=T.append("Authorization","Bearer "+p)),this.http.post(t,i,{headers:T,observe:"response",responseType:"blob"}).pipe(Z(o)).subscribe({next:h=>{r.next({title:h.headers.get("Content-Disposition"),file:h.body}),r.complete()},error:h=>{if(h.headers.get("Content-Type")==="application/json; charset=utf-8"){let _=new FileReader;_.addEventListener("loadend",O=>{let k=JSON.parse(O.srcElement.result)?.Message;if(!this.unauthorizedErrorHandling(h)){let V=this.errorMessageHandling(h);this.toastr.error(k??"An unknown error has occured!",V.header,{enableHtml:!0})}}),_.readAsText(h.error)}r.error(h)}})})}unauthorizedErrorHandling(t){let i=!1;return(t.status==401||t.status==403)&&(localStorage.getItem("Token")?this.toastr.error("Your session has expired. Please login again.","Unauthorized",{enableHtml:!0}):window.location.href="/",i=!0),i}errorMessageHandling(t){let i="API Error",o="Exception Message";return t.error?(i="API Error - "+t.status,t.status==451&&(i="Error"),t.error&&(o=t.error.Message)):t.Message&&(i="API Error - "+t.name,o=t.Message),{header:i,Message:o}}delete(t,i){return this.http.delete(t,i)}};n.\u0275fac=function(i){return new(i||n)(m(bt),m(P))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"});let s=n;return s})();export{D as a,P as b,Zt as c,le as d,fe as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as re}from"./chunk-4URWFKAM.js";import{b as le}from"./chunk-
|
|
1
|
+
import{a as re}from"./chunk-4URWFKAM.js";import{b as le}from"./chunk-KRKQFGMS.js";import{a as pe,b as me}from"./chunk-VZHIFACR.js";import{a as ee,b as te,d as ne,e as ie}from"./chunk-ACYUSHMS.js";import{g as Z}from"./chunk-DS2GU2CN.js";import{e as Y}from"./chunk-NVF24LK5.js";import{m as ae,n as oe}from"./chunk-3XWOT6GZ.js";import{h as G,m as K,y as Q}from"./chunk-O5MOPAT5.js";import{c as X}from"./chunk-X4WLRMDP.js";import{$ as E,$a as h,$b as d,Ac as k,Bc as H,Dc as U,Ha as v,Ia as p,Ib as s,Jb as C,Kb as b,Mb as O,Nb as q,Ob as z,Pb as A,Q as D,Qb as V,T as w,Za as u,_b as c,ac as J,d as I,da as g,ga as N,gb as B,hb as T,jb as $,kb as F,lb as a,mb as o,nb as f,oa as P,pa as R,q as M,rb as j,ub as x,wb as y,zc as W}from"./chunk-HSFUKC7R.js";import{a as S}from"./chunk-GNOSNGXM.js";var L=(()=>{let t=class t{constructor(){this.httpService=g(Y),this._pageination=new I({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(w(n=>this.getLogs$(n).pipe()))}getLogs$(n){return this.httpService.post("/api/Channel/GetChannelLogPaged",n)}onPaginationChange(n){let e=this._pageination.value;e.PageNumber=n.pageIndex+1,this._pageination.next(e)}onFilter(n){let e=this._pageination.value;e.PageNumber=1,e=S(S({},e),n),this._pageination.next(e)}};t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=E({token:t,factory:t.\u0275fac});let i=t;return i})();function ce(i,t){if(i&1&&(a(0,"span",10),f(1,"img",11),o(),s(2)),i&2){let l=t.item;p(),h("src",l.Img,v)("alt",l.Name),p(),b(" ",l.Name," ")}}function de(i,t){if(i&1&&(a(0,"tr")(1,"td"),f(2,"img",17),a(3,"span"),s(4),o()(),a(5,"td"),s(6),c(7,"json"),o(),a(8,"td"),s(9),c(10,"json"),o(),a(11,"td"),s(12),c(13,"date"),o()()),i&2){let l=t.$implicit;p(2),h("src",l.Img,v),p(2),b(" ",l.ChannelName," "),p(2),C(d(7,5,l.Request)),p(3),C(d(10,7,l.Response)),p(3),C(J(13,9,l.Created,"dd-MM-yyyy hh:mm:ss"))}}function he(i,t){if(i&1){let l=j();a(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),s(5,"Channel"),o(),a(6,"th"),s(7,"Request"),o(),a(8,"th"),s(9,"Response"),o(),a(10,"th",15),s(11,"Created"),o()()(),a(12,"tbody"),$(13,de,14,12,"tr",null,T),c(15,"async"),o()(),a(16,"mat-paginator",16),c(17,"async"),c(18,"async"),c(19,"async"),c(20,"async"),x("page",function(e){P(l);let r=y();return R(r.channelLogService.onPaginationChange(e))}),o()()}if(i&2){let l,n,e,r,m=y();p(13),F((l=d(15,3,m.channelLogs$))==null?null:l.Data),p(3),h("length",(n=d(17,5,m.channelLogs$))==null?null:n.Count)("pageSize",(e=d(18,7,m.filter$))==null?null:e.RowCount)("pageIndex",(r=d(19,9,m.filter$))!=null&&r.PageNumber?0:((r=d(20,11,m.filter$))==null?null:r.PageNumber)-1)}}function ge(i,t){i&1&&(a(0,"div",9),f(1,"app-empty-state"),o())}var ze=(()=>{let t=class t{constructor(){this.channelLogService=g(L),this.authService=g(Z),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(M(n=>(n.Data?n.Data=n.Data.map(e=>(e.Response=e.Response?JSON.parse(e.Response):"",e.Request=e.Request?JSON.parse(e.Request):"",e.Img=X.getChannelLogoByTypeId(e.TypeID),e)):n.Data=[],n)),D(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=N({type:t,selectors:[["app-channel-log"]],standalone:!0,features:[A([L]),V],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","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,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"]],template:function(e,r){if(e&1&&(a(0,"mainpanel",0),x("onSubmit",function(){return r.onSubmitFilter()}),a(1,"filters")(2,"div",1)(3,"div")(4,"label",2),s(5,"Channel"),o(),a(6,"ng-select",3),z("ngModelChange",function(_){return q(r.channelID,_)||(r.channelID=_),_}),u(7,ce,3,3,"ng-template",4),o()()()(),a(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,he,21,13,"div",8),c(13,"async"),u(14,ge,2,0,"div",9),o()()()()()),e&2){let m;h("hideSearchBox",!0),p(6),h("clearable",!0)("items",r.channelOptions),O("ngModel",r.channelID),p(6),B(((m=d(13,5,r.channelLogs$))==null||m.Data==null?null:m.Data.length)>0?12:14)}},dependencies:[U,W,H,k,oe,ae,re,me,pe,le,ie,ne,ee,te,Q,G,K]});let i=t;return i})();export{ze as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as K,b as Q}from"./chunk-6UK5EDKC.js";import{g as $}from"./chunk-NEQN5BMS.js";import{e as q}from"./chunk-NVF24LK5.js";import{t as H,u as J}from"./chunk-CTKEWRX4.js";import{a as B,h as V,m as R,y as U}from"./chunk-O5MOPAT5.js";import{b as g,c as s}from"./chunk-X4WLRMDP.js";import{$ as T,$a as b,$b as W,Dc as j,Ia as y,Ib as L,Kb as A,Mb as E,Nb as O,Ob as D,Pb as x,Q as u,Qb as P,T as c,Ua as f,X as l,Za as S,_ as w,_b as z,d,da as h,ga as k,gb as F,lb as C,mb as m,n as p,na as _,ub as N,wb as M,za as I,zc as G}from"./chunk-HSFUKC7R.js";var X=(()=>{let a=class a{constructor(){this.httpService=h(q),this.shopeeCategories=new d({data:[],isFirstLoad:!1}),this.tiktokCategories=new d({data:[],isFirstLoad:!1}),this.lazadaCategories=new d({data:[],isFirstLoad:!1}),this.tokopediaCategories=new d({data:[],isFirstLoad:!1}),this.wooCommerceCategories=new d({data:[],isFirstLoad:!1})}getCategories(t,o){switch(t){case g.Shopee:return this.shopeeCategories.asObservable().pipe(c(e=>e.isFirstLoad?p(e.data):this.getShopeeCategories(o)));case g.Tiktok:return this.tiktokCategories.asObservable().pipe(c(e=>e.isFirstLoad?p(e.data):this.getTiktokCategories(o)));case g.Lazada:return this.lazadaCategories.asObservable().pipe(c(e=>e.isFirstLoad?p(e.data):this.getLazadaCategories(o)));case g.Tokopedia:return this.tokopediaCategories.asObservable().pipe(c(e=>e.isFirstLoad?p(e.data):this.getTokopediaCategories(o)));case g.WooCommerce:return this.wooCommerceCategories.asObservable().pipe(c(e=>e.isFirstLoad?p(e.data):this.getWooCommerceCategories(o)));default:return p([])}}getShopeeCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}]).pipe(l(e=>{let i={data:e,isFirstLoad:!0};this.shopeeCategories.next(i)}))}getTiktokCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}]).pipe(l(e=>{let i={data:e,isFirstLoad:!0};this.tiktokCategories.next(i)}))}getLazadaCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}]).pipe(l(e=>{let i={data:e,isFirstLoad:!0};this.lazadaCategories.next(i)}))}getTokopediaCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}]).pipe(l(e=>{let i={data:e,isFirstLoad:!0};this.tokopediaCategories.next(i)}))}getWooCommerceCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}]).pipe(l(e=>{let i={data:e,isFirstLoad:!0};this.wooCommerceCategories.next(i)}))}searchByIdWithParentDFS(t,o){let e=[...t];for(;e.length>0;){let i=e.pop();if(i.id===JSON.stringify(o))return i;if(i.children&&i.children.length>0)for(let n of i.children)n.parent=i,e.push(n)}return null}generateCategoryLabel(t){let o="";return t?o=s.getLabelPathTree(t):o="Select a Category",o}};a.\u0275fac=function(o){return new(o||a)},a.\u0275prov=T({token:a,factory:a.\u0275fac,providedIn:"root"});let r=a;return r})();function Z(r,a){if(r&1&&(C(0,"div",3),L(1),m()),r&2){let v=M();b("matTooltip",v.selectedCategoryLabel()),y(),A(" ",v.selectedCategoryLabel()," ")}}function ee(r,a){r&1&&(C(0,"label",2),L(1,"Category"),m())}var Te=(()=>{let a=class a{constructor(){this.categoryService=h(X),this.showClear=!1,this.showLabel=!1,this.disabled=!1,this.selectedCategory=new I,this.selectedCategoryLabel=f("Select a Category"),this.selectedNode=f(null),this.onChange=t=>{},this.onTouched=()=>{}}ngOnChanges(t){let o=t?.categoryId?.previousValue,e=t?.categoryId?.currentValue;s.IsEmpty(o)&&s.IsNotEmpty(e)&&this.initCategories(),s.IsEmpty(e)&&s.IsNotEmpty(o)&&this.generateCategoryLabel(null)}initCategories(){this.categories$=this.categoryService.getCategories(this.channelType,this.channelId).pipe(l(t=>this.setDefaultCategory(t)),u(1))}setDefaultCategory(t){try{let o=this.categoryService.searchByIdWithParentDFS(t,this.categoryId);o&&(this.generateCategoryLabel(o),this.selectedNode.set(o))}catch(o){console.error(o)}}onClickSelect(){this.disabled==!1&&(this.categories$=this.categoryService.getCategories(this.channelType,this.channelId).pipe(u(1)))}onNodeSelect(t){let o=t.node;this.selectedCategoryLabel.set(s.getLabelPathTree(o));let e=parseInt(o.id);this.onChange(e),this.selectedCategory.emit(e)}onNodeUnselect(){this.selectedCategoryLabel.set("Select a Category"),this.selectedCategory.emit(null)}generateCategoryLabel(t){t?this.selectedCategoryLabel.set(s.getLabelPathTree(t)):this.selectedCategoryLabel.set("Select a Category")}writeValue(t){s.IsNotEmpty(t)&&(this.categoryId=t,this.initCategories())}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}};a.\u0275fac=function(o){return new(o||a)},a.\u0275cmp=k({type:a,selectors:[["app-channel-category-select"]],inputs:{channelId:"channelId",channelType:"channelType",categoryId:"categoryId",showClear:"showClear",showLabel:"showLabel",disabled:"disabled"},outputs:{selectedCategory:"selectedCategory"},standalone:!0,features:[x([{provide:B,useExisting:w(()=>a),multi:!0}]),_,P],decls:4,vars:8,consts:[["appendTo","body","containerStyleClass","w-100","placeholder","Select a Category","id","selectCategory",3,"ngModelChange","click","onNodeSelect","onClear","ngModel","filter","options","showClear","disabled"],["pTemplate","value"],["for","selectCategory"],["matTooltipPosition","above",3,"matTooltip"]],template:function(o,e){o&1&&(C(0,"p-treeSelect",0),z(1,"async"),D("ngModelChange",function(n){return O(e.selectedNode,n)||(e.selectedNode=n),n}),N("click",function(){return e.onClickSelect()})("onNodeSelect",function(n){return e.onNodeSelect(n)})("onClear",function(){return e.onNodeUnselect()}),S(2,Z,2,2,"ng-template",1),m(),S(3,ee,2,0,"label",2)),o&2&&(E("ngModel",e.selectedNode),b("filter",!0)("options",W(1,6,e.categories$))("showClear",e.showClear)("disabled",e.disabled),y(3),F(e.showLabel?3:-1))},dependencies:[j,G,Q,K,$,J,H,U,V,R],styles:["[_nghost-%COMP%] .p-treeselect{width:100%;display:inline-flex;border:1px solid #ced4da;font-size:.875rem!important} .p-treeselect-panel{z-index:10002!important} .p-element .p-icon-wrapper{width:14px}"]});let r=a;return r})();export{X as a,Te as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Q,b as X}from"./chunk-6UK5EDKC.js";import{g as K}from"./chunk-NEQN5BMS.js";import{e as V}from"./chunk-NVF24LK5.js";import{k as J}from"./chunk-3XWOT6GZ.js";import{t as G,u as H}from"./chunk-CTKEWRX4.js";import{a as U,h as W,m as A,y as q}from"./chunk-O5MOPAT5.js";import{b as r,c as s}from"./chunk-X4WLRMDP.js";import{$ as N,$a as u,$b as z,Dc as R,F as w,Ia as d,Ib as y,Kb as P,Mb as E,Nb as F,Ob as I,Pb as O,Qb as j,Ua as m,X as _,Za as f,_ as k,_b as $,d as b,da as c,ga as M,gb as B,lb as h,mb as p,n as S,q as T,ub as C,wa as v,wb as x,xa as g,za as L,zc as D}from"./chunk-HSFUKC7R.js";var Y=(()=>{let i=class i{constructor(){this.httpService=c(V),this._channelTree=new b({isFirstLoad:!1,data:[]}),this.channelTree$=this._channelTree.asObservable()}getChannelTree$(){return this.channelTree$.pipe(w(e=>e.isFirstLoad?S(e.data):this.getChannelTree()))}getChannelTree(){return this.httpService.get("/api/InventoryLoader/Channel").pipe(_(t=>{this._channelTree.next({isFirstLoad:!0,data:t})}))}generateCategoryLabel(e,t){}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"});let l=i;return l})();function oe(l,i){if(l&1&&(h(0,"div",4),y(1),p()),l&2){let Z=x();d(),P(" ",Z.selectedCategoryLabel()," ")}}function ie(l,i){l&1&&(h(0,"label",3),y(1,"Channel"),p())}var Me=(()=>{let i=class i{constructor(){this.multiwarehousTreeService=c(Y),this.destroyRef=c(v),this.selectedCategoryLabel=m("Select a Channel"),this.disabled=m(!1),this.selectedNode=m(null),this.multiple=g(!1),this.floatingLabel=g(!1),this.onChannelChange=new L,this.channels$=this.multiwarehousTreeService.getChannelTree$().pipe(T(e=>e.map(t=>{t.children=t.children.map(n=>(n.icon="fa-solid fa-warehouse",n));let o=this.getChannelType(t.typeid);return t.icon=`custom-icon-${o}`,t.expandedIcon=null,t.collapsedIcon=null,t.styleClass=`custom-icon-${o}`,t.logo=s.getChannelLogoByTypeId(t.typeId),t}))),this.htmlBody=document.querySelector("body"),this.onChange=e=>{},this.onTouched=()=>{}}getChannelType(e){switch(e){case r.Tokopedia:return"tokopedia";case r.Shopee:return"shopee";case r.Lazada:return"lazada";case r.Shopify:return"shopify";case r.WooCommerce:return"woocommerce";case r.Tiktok:return"tiktok"}}initSelectedNode(e){this.channels$.pipe(J(this.destroyRef)).subscribe(t=>{if(this.multiple()){let o=[];for(let n of e){let a=s.searchByIdWithParentDFS(t,n),ee=Object.assign({},a);o.push(ee)}this.selectedNode.set(o),this.emitMultipleNodes()}else{let o=s.searchByIdWithParentDFS(t,e),n=Object.assign({},o);this.selectedNode.set(n),this.emitSingleNode(n)}})}onNodeSelect(e){let t=Object.assign({},e.node);this.multiple()?this.emitMultipleNodes():this.emitSingleNode(t)}emitMultipleNodes(){let e=Object.assign([],this.selectedNode()),t=e.map(o=>o.id);this.onChange(t),this.onChannelChange.emit(e),this.generateLabel()}emitSingleNode(e){this.onChange(e.id),this.onChannelChange.emit(e),this.generateLabel()}onNodeUnSelect(e){if(this.multiple()){let t=e.node;this.selectedNode.update(o=>o.filter(n=>n.id!==t.id)),this.emitMultipleNodes(),this.generateLabel()}}generateLabel(){let e="Select a Channel";if(this.multiple()){e="";for(let t of this.selectedNode())e+=s.getLabelPathTree(t)+", ";this.selectedCategoryLabel.set(e)}else{let t=this.selectedNode();t?(e=s.getLabelPathTree(t),this.selectedCategoryLabel.set(e)):this.selectedCategoryLabel.set(e)}}onClear(){this.onChange(null)}onClick(){let e=this.getBodyTop(),t=document.querySelector(".p-overlay.p-component"),o=e+t.getBoundingClientRect().top,n=t.getAttribute("style")||"";t.setAttribute("style",`${n} top: ${o+e}px;`)}getBodyTop(){return this.htmlBody.getBoundingClientRect().top*-1}writeValue(e){s.IsNotEmpty(e)&&this.initSelectedNode(e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled.set(e)}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=M({type:i,selectors:[["multiwarehouse-tree-select"]],inputs:{multiple:[1,"multiple"],floatingLabel:[1,"floatingLabel"]},outputs:{onChannelChange:"onChannelChange"},standalone:!0,features:[O([{provide:U,useExisting:k(()=>i),multi:!0}]),j],decls:5,vars:8,consts:[["matTooltipPosition","above",1,"p-float-label",3,"matTooltip"],["appendTo","body","containerStyleClass","w-100","id","selectChannel",1,"multiwarehouse-select",3,"click","ngModelChange","onNodeSelect","onClear","onNodeUnselect","filter","options","ngModel","selectionMode"],["pTemplate","value","type","default"],["for","selectChannel"],["matTooltipPosition","above"]],template:function(t,o){t&1&&(h(0,"span",0)(1,"p-treeSelect",1),$(2,"async"),C("click",function(){return o.onClick()}),I("ngModelChange",function(a){return F(o.selectedNode,a)||(o.selectedNode=a),a}),C("onNodeSelect",function(a){return o.onNodeSelect(a)})("onClear",function(){return o.onClear()})("onNodeUnselect",function(a){return o.onNodeUnSelect(a)}),f(3,oe,2,1,"ng-template",2),p(),f(4,ie,2,0,"label",3),p()),t&2&&(u("matTooltip",o.selectedCategoryLabel()),d(),u("filter",!0)("options",z(2,6,o.channels$)),E("ngModel",o.selectedNode),u("selectionMode",o.multiple()?"multiple":"single"),d(3),B(o.floatingLabel()?4:-1))},dependencies:[R,D,X,Q,K,q,W,A,H,G],styles:["[_nghost-%COMP%] .p-treeselect{width:100%;display:inline-flex;border:1px solid #ced4da;font-size:.875rem!important} .p-element .p-icon-wrapper{width:14px} .p-float-label .multiwarehouse-select .p-treeselect{padding:7px!important;min-height:.6rem!important} .custom-icon-tokopedia .p-treenode-icon, .custom-icon-shopee .p-treenode-icon, .custom-icon-woocommerce .p-treenode-icon, .custom-icon-lazada .p-treenode-icon, .custom-icon-tiktok .p-treenode-icon, .custom-icon-shopify .p-treenode-icon{background-size:contain;background-repeat:no-repeat;width:20px;height:20px;display:inline-block} .custom-icon-tokopedia .p-treenode-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png)} .custom-icon-woocommerce .p-treenode-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp)} .custom-icon-shopee .p-treenode-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png)} .custom-icon-tiktok .p-treenode-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png)} .custom-icon-lazada .p-treenode-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1680681836/icons/marketplace_icons/Lazadanew.png)} .custom-icon-shopify .p-treenode-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1707987435/icons/marketplace_icons/shopify.png)} .custom-icon-shopee .fa-warehouse.p-treenode-icon, .custom-icon-tiktok .fa-warehouse.p-treenode-icon, .custom-icon-tokopedia .fa-warehouse.p-treenode-icon, .custom-icon-lazada .fa-warehouse.p-treenode-icon, .custom-icon-shopify .fa-warehouse.p-treenode-icon, .custom-icon-woocommerce .fa-warehouse.p-treenode-icon{background-image:none!important;display:inline-block!important}"]});let l=i;return l})();export{Me as a};
|