marketplacepos 5.46.1 → 5.46.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-ZVKOEYH7.js → chunk-25N6ECN7.js} +1 -1
- package/Marketplace/chunk-2REDCSBO.js +1 -0
- package/Marketplace/{chunk-BAXQ2L7B.js → chunk-2WHJU6CS.js} +1 -1
- package/Marketplace/chunk-3NCIMELL.js +5 -0
- package/Marketplace/{chunk-FB2AEPXA.js → chunk-4PL4XC3C.js} +1 -1
- package/Marketplace/{chunk-L7TKCTLD.js → chunk-53AH4SKO.js} +1 -1
- package/Marketplace/{chunk-FGFIV3VO.js → chunk-57MSCWQ4.js} +1 -1
- package/Marketplace/chunk-6EMUVAZD.js +1 -0
- package/Marketplace/{chunk-CRKCNTXF.js → chunk-6GQN3CZ7.js} +1 -1
- package/Marketplace/{chunk-LOU3DIPY.js → chunk-6L24E3SM.js} +1 -1
- package/Marketplace/{chunk-2SGPD432.js → chunk-764WEWDX.js} +1 -1
- package/Marketplace/{chunk-T43QRQH5.js → chunk-7NGIEICQ.js} +1 -1
- package/Marketplace/{chunk-GPGD3XQH.js → chunk-ACNBNSCK.js} +1 -1
- package/Marketplace/{chunk-3BALA33G.js → chunk-B3HL4DNT.js} +1 -1
- package/Marketplace/chunk-B3RO2S3D.js +1 -0
- package/Marketplace/{chunk-CGEIIRYF.js → chunk-BPAZ4TES.js} +1 -1
- package/Marketplace/{chunk-GKRWJPI3.js → chunk-BXXJEM76.js} +1 -1
- package/Marketplace/{chunk-3YP6ORBR.js → chunk-C7YK5TDP.js} +1 -1
- package/Marketplace/{chunk-ZUYGRGXM.js → chunk-CTDSVBZQ.js} +1 -1
- package/Marketplace/{chunk-WAZXTB4X.js → chunk-DGIH7HSJ.js} +1 -1
- package/Marketplace/{chunk-V6UNCLNJ.js → chunk-DSAVJZIH.js} +2 -2
- package/Marketplace/{chunk-YB4KXB2C.js → chunk-E42O4ZCH.js} +1 -1
- package/Marketplace/chunk-EOYO5KJW.js +1 -0
- package/Marketplace/{chunk-NLPXBGIX.js → chunk-EPCXMVX3.js} +1 -1
- package/Marketplace/chunk-ER3SGZ7B.js +1 -0
- package/Marketplace/{chunk-6CIQBRO4.js → chunk-ESDWGP24.js} +1 -1
- package/Marketplace/chunk-GHFADTRR.js +1 -0
- package/Marketplace/{chunk-6VYFG4AQ.js → chunk-HAJDTNAW.js} +1 -1
- package/Marketplace/chunk-IJVKHW3C.js +1 -0
- package/Marketplace/chunk-JGKNYWZY.js +1 -0
- package/Marketplace/chunk-JOZJZEGN.js +1 -0
- package/Marketplace/chunk-JUHGMPX2.js +1 -0
- package/Marketplace/{chunk-6U4YIJLC.js → chunk-K5YVT6CU.js} +2 -2
- package/Marketplace/{chunk-ORLTYLPA.js → chunk-LSSYGFVV.js} +1 -1
- package/Marketplace/{chunk-KRQHTRFM.js → chunk-M7DDFDPD.js} +1 -1
- package/Marketplace/chunk-MP3G42LL.js +1 -0
- package/Marketplace/chunk-O73TXSTZ.js +1 -0
- package/Marketplace/{chunk-DB7C3AL2.js → chunk-OCJXLFB4.js} +2 -2
- package/Marketplace/chunk-PBHJGJHF.js +1 -0
- package/Marketplace/{chunk-HITTNWB6.js → chunk-PHLSX23M.js} +1 -1
- package/Marketplace/chunk-QOG52KD3.js +1 -0
- package/Marketplace/chunk-QPC5ZTYC.js +1 -0
- package/Marketplace/chunk-QSERFP5U.js +1 -0
- package/Marketplace/chunk-QTTNQJAK.js +1 -0
- package/Marketplace/chunk-RTF4FRXW.js +3 -0
- package/Marketplace/{chunk-UHJEXTOG.js → chunk-RU43F4UK.js} +1 -1
- package/Marketplace/chunk-RXQX7567.js +1 -0
- package/Marketplace/{chunk-LFGPYQCI.js → chunk-SBLG2UP7.js} +1 -1
- package/Marketplace/{chunk-DSYYZDXI.js → chunk-TG5SFCNG.js} +1 -1
- package/Marketplace/{chunk-HHO2NGCF.js → chunk-THMNZQLX.js} +1 -1
- package/Marketplace/{chunk-NWWYOZ4V.js → chunk-TKV7XWBT.js} +1 -1
- package/Marketplace/{chunk-SZGOLKC6.js → chunk-TYSVSEYQ.js} +1 -1
- package/Marketplace/{chunk-TGQ5CJ3A.js → chunk-UDXV6RW2.js} +1 -1
- package/Marketplace/{chunk-IWKRZSYG.js → chunk-V33UHV5X.js} +1 -1
- package/Marketplace/{chunk-TE5EYKIN.js → chunk-V54LZUEC.js} +1 -1
- package/Marketplace/chunk-VHOREEP5.js +1 -0
- package/Marketplace/chunk-VODHIYRA.js +1 -0
- package/Marketplace/{chunk-OE7TF7SI.js → chunk-W4MTON2T.js} +1 -1
- package/Marketplace/{chunk-DZEO4HK4.js → chunk-WBKGEDL6.js} +1 -1
- package/Marketplace/{chunk-2XWZQCUR.js → chunk-WHBI5II7.js} +1 -1
- package/Marketplace/{chunk-OVPVQS4J.js → chunk-WIMLQM6B.js} +1 -1
- package/Marketplace/{chunk-RJ5D24ZW.js → chunk-WY37QAZ4.js} +1 -1
- package/Marketplace/{chunk-4TDVVQ64.js → chunk-XMZNTZ72.js} +1 -1
- package/Marketplace/{chunk-4LZODV4E.js → chunk-XSCE2K6J.js} +1 -1
- package/Marketplace/{chunk-77MWKV5I.js → chunk-XSJBP4EN.js} +2 -2
- package/Marketplace/chunk-YIKOIRZU.js +1 -0
- package/Marketplace/{chunk-UGG2CIUU.js → chunk-ZC7VX6UG.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/main-CVD4P432.js +1 -0
- package/package.json +1 -1
- package/Marketplace/chunk-26ZM2UD3.js +0 -1
- package/Marketplace/chunk-2Z7CPNRS.js +0 -1
- package/Marketplace/chunk-3VUO4APC.js +0 -1
- package/Marketplace/chunk-7DJXZQ7M.js +0 -1
- package/Marketplace/chunk-EFI2CLNP.js +0 -1
- package/Marketplace/chunk-EI65NYTN.js +0 -1
- package/Marketplace/chunk-F2533PAC.js +0 -1
- package/Marketplace/chunk-FHWKSD5A.js +0 -3
- package/Marketplace/chunk-FIAI5SPR.js +0 -1
- package/Marketplace/chunk-FTWATKXK.js +0 -1
- package/Marketplace/chunk-ISUN5G42.js +0 -5
- package/Marketplace/chunk-JYCBJ7CC.js +0 -1
- package/Marketplace/chunk-KCFCXS2F.js +0 -1
- package/Marketplace/chunk-KFOHH7PE.js +0 -1
- package/Marketplace/chunk-M7LXGXUM.js +0 -1
- package/Marketplace/chunk-MJNFY4NT.js +0 -1
- package/Marketplace/chunk-OAG6OVUY.js +0 -1
- package/Marketplace/chunk-OHVOVAKD.js +0 -1
- package/Marketplace/chunk-OJZ7NGRW.js +0 -1
- package/Marketplace/chunk-PW42BQIY.js +0 -1
- package/Marketplace/chunk-RM2OSYMV.js +0 -1
- package/Marketplace/chunk-VIDSOLHF.js +0 -1
- package/Marketplace/chunk-ZXTHWBJ4.js +0 -1
- package/Marketplace/main-RRL4BIVO.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Y}from"./chunk-THMNZQLX.js";import"./chunk-RTF4FRXW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import{a as H}from"./chunk-CGOB6Y3X.js";import{e as F}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PYXL7UF7.js";import"./chunk-RXQX7567.js";import{m as J,n as G}from"./chunk-HJXYT6MI.js";import{A as j,c as K,h as R,m as N,p as O}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as T,j as W,l as D,n as U}from"./chunk-FXQKRJWU.js";import{$c as P,Gb as I,Gc as a,Hc as E,Kc as h,Lc as g,Mb as w,Mc as f,Nc as V,Oc as L,Pc as x,Ra as C,Yb as m,Z as b,ad as v,dc as k,ic as n,jc as i,kc as A,oc as _,pa as B,rb as d,tc as M,uc as u,ya as p,za as s}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function q(o,S){if(o&1){let t=_();n(0,"input",30),f("ngModelChange",function(e){p(t);let r=u();return g(r.sku,e)||(r.sku=e),s(e)}),i()}if(o&2){let t=u();h("ngModel",t.sku)}}function z(o,S){if(o&1){let t=_();n(0,"input",31),f("ngModelChange",function(e){p(t);let r=u();return g(r.itemId,e)||(r.itemId=e),s(e)}),i()}if(o&2){let t=u();h("ngModel",t.itemId)}}function Q(o,S){if(o&1&&(n(0,"pre",28),a(1),P(2,"json"),i()),o&2){u();let t=x(35);d(),E(v(2,1,t))}}function X(o,S){o&1&&(n(0,"p",29),a(1," Your data will be shown here once it's available "),i())}var me=(()=>{class o{constructor(){this.httpService=B(F),this.selectedChannel=C(null),this.sku=C(null),this.itemId=C(null),this.searchBy="sku"}initProductLog(){let t={ChannelID:this.selectedChannel()};this.searchBy==="sku"?t.SKU=this.sku():t.ItemID=this.itemId(),this.productLog$=this.httpService.post(H.GetProductApiLog,t).pipe(b(1))}copyToClipboard(t){if(!t)return;let c=typeof t=="string"?t:JSON.stringify(t,null,2);navigator.clipboard.writeText(c),alert("Copied to clipboard!")}static{this.\u0275fac=function(c){return new(c||o)}}static{this.\u0275cmp=I({type:o,selectors:[["app-product-api"]],decls:50,vars:14,consts:[["headerTitle","Origin Product Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],[1,"mb-2"],[1,"form-check","form-check-inline"],["type","radio","name","searchBy","id","searchBySku",1,"form-check-input",3,"ngModelChange","ngModel","value"],["for","searchBySku",1,"form-check-label"],["type","radio","name","searchBy","id","searchByItemId",1,"form-check-input",3,"ngModelChange","ngModel","value"],["for","searchByItemId",1,"form-check-label"],["type","text","class","form-control","placeholder","Product Code / SKU",3,"ngModel","ngModelChange",4,"ngIf"],["type","text","class","form-control","placeholder","ItemID is Product id from seller center",3,"ngModel","ngModelChange",4,"ngIf"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","productLogText"],[1,"text-center","my-12","text-muted"],["type","text","placeholder","Product Code / SKU",1,"form-control",3,"ngModelChange","ngModel"],["type","text","placeholder","ItemID is Product id from seller center",1,"form-control",3,"ngModelChange","ngModel"]],template:function(c,e){if(c&1){let r=_();n(0,"mainpanel",0)(1,"actions")(2,"button",1),M("click",function(){return p(r),s(e.initProductLog())}),A(3,"i",2),a(4," Search "),i()(),n(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),a(12,"Channel"),i(),n(13,"p",8),a(14," View logs related to Product API Detail "),i()(),n(15,"div",9)(16,"channel-select-options",10),f("ngModelChange",function(l){return p(r),g(e.selectedChannel,l)||(e.selectedChannel=l),s(l)}),i()()(),n(17,"div",11)(18,"div",7)(19,"h6"),a(20,"Product Code / SKU"),i(),n(21,"p",8),a(22," Product SKU or Code from Channel Product "),i()(),n(23,"div",9)(24,"div",12)(25,"div",13)(26,"input",14),f("ngModelChange",function(l){return p(r),g(e.searchBy,l)||(e.searchBy=l),s(l)}),i(),n(27,"label",15),a(28,"Search by SKU"),i()(),n(29,"div",13)(30,"input",16),f("ngModelChange",function(l){return p(r),g(e.searchBy,l)||(e.searchBy=l),s(l)}),i(),n(31,"label",17),a(32,"Search by ItemID"),i()()(),w(33,q,1,1,"input",18)(34,z,1,1,"input",19),i()()()(),V(35),P(36,"async"),n(37,"div",20)(38,"div",21)(39,"div",22)(40,"div",23)(41,"h5"),a(42,"Response"),i(),n(43,"button",24),M("click",function(){p(r);let l=x(35);return s(e.copyToClipboard(l))}),a(44," Copy "),i()(),n(45,"div",25)(46,"div",26)(47,"div",27),w(48,Q,3,3,"pre",28)(49,X,2,0,"p",29),i()()()()()()()()()}if(c&2){m("hideSearchBox",!0)("hideSearchDropdown",!0),d(16),h("ngModel",e.selectedChannel),d(10),h("ngModel",e.searchBy),m("value","sku"),d(4),h("ngModel",e.searchBy),m("value","itemid"),d(3),m("ngIf",e.searchBy==="sku"),d(),m("ngIf",e.searchBy==="itemid"),d();let r=L(v(36,11,e.productLog$));d(8),m("disabled",!r),d(5),k(r?48:49)}},dependencies:[U,T,W,D,j,K,O,R,N,G,J,Y],encapsulation:2})}}return o})();export{me as ProductApiComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-LSSYGFVV.js";import{a as h,b as C}from"./chunk-WRJFUNM3.js";import"./chunk-RTF4FRXW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-RXQX7567.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as f,J as n,n as o}from"./chunk-FXQKRJWU.js";import{Gb as l,Hb as c,Yb as s,ic as u,jc as d,ka as p,kc as i,rb as m}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var v=(()=>{class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"}]}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,g){t&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),d()()(),i(4,"router-outlet")),t&2&&(m(3),s("Tabs",g.priceTabs))},dependencies:[o,C,h,n,f],encapsulation:2})}}return e})();var b=[{path:"",component:v,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-VODHIYRA.js").then(e=>e.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-ACNBNSCK.js").then(e=>e.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{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(b)]})}}return e})();export{D as PriceRoutingModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as l}from"./chunk-LSSYGFVV.js";import{b as u}from"./chunk-WRJFUNM3.js";import"./chunk-RTF4FRXW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-RXQX7567.js";import{n as c}from"./chunk-HJXYT6MI.js";import{A as s}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as a,J as n,n as i}from"./chunk-FXQKRJWU.js";import{Gb as p,Hb as r,ka as e,kc as d}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var M=(()=>{class t{constructor(){}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=p({type:t,selectors:[["app-report"]],standalone:!1,decls:1,vars:0,template:function(o,C){o&1&&d(0,"router-outlet")},dependencies:[a],styles:["ul[_ngcontent-%COMP%] > li.dropdown-item[_ngcontent-%COMP%]{font-size:.6875rem!important}"]})}}return t})();var R=[{path:"",component:M,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",loadChildren:()=>import("./chunk-TG5SFCNG.js").then(t=>t.OrderModule),canActivate:[l]}]}],h=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=r({type:t})}static{this.\u0275inj=e({imports:[i,n.forChild(R)]})}}return t})();var S=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=r({type:t})}static{this.\u0275inj=e({imports:[i,u,h,s,c,n]})}}return t})();export{S as ReportModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as q}from"./chunk-IITU3NV6.js";import{a as j,b as V}from"./chunk-2O4IEGGR.js";import{na as $}from"./chunk-RC5PUUVM.js";import{b as s,c as a}from"./chunk-RXQX7567.js";import{A as F,a as R,h as A,m as D}from"./chunk-5PS6ZS3N.js";import{a as I}from"./chunk-V3USB3ZU.js";import{r as U,s as W}from"./chunk-MFQQEEHJ.js";import{j as O,n as z}from"./chunk-FXQKRJWU.js";import{$c as E,Ga as _,Gb as w,Gc as y,Ic as M,Ka as T,Kc as v,Lc as L,Mb as g,Mc as P,Oa as h,Qc as B,Ra as c,Yb as d,Z as S,ad as x,dc as k,ia as b,ic as u,jc as r,pa as m,rb as p,tc as f,uc as N,v as C}from"./chunk-OJMQBH6T.js";function J(n,G){if(n&1&&(u(0,"div",4),y(1),r()),n&2){let e=N();p(),M(" ",e.selectedCategoryLabel()," ")}}function K(n,G){n&1&&(u(0,"label",3),y(1,"Channel"),r())}var he=(()=>{class n{constructor(){this.multiwarehousTreeService=m(q),this.destroyRef=m(_),this.selectedCategoryLabel=c("Select a Channel"),this.disabled=c(!1),this.selectedNode=c(null),this.multiple=h(!1),this.floatingLabel=h(!1),this.onChannelChange=new T,this.channels$=this.multiwarehousTreeService.getChannelTree$().pipe(C(e=>e.map(t=>{t.children=t.children.map(i=>(i.icon="fa-solid fa-warehouse",i));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=a.getChannelLogoByTypeId(t.typeid),t})),S(1)),this.htmlBody=document.querySelector("body"),this.onChange=e=>{},this.onTouched=()=>{}}getChannelType(e){switch(e){case s.Tokopedia:return"tokopedia";case s.Shopee:return"shopee";case s.Lazada:return"lazada";case s.Shopify:return"shopify";case s.WooCommerce:return"woocommerce";case s.Tiktok:return"tiktok";case s.Plugo:return"plugo";case s.ShopifyV2:return"shopify"}}initSelectedNode(e){this.channels$.pipe(I(this.destroyRef)).subscribe(t=>{if(this.multiple()){let o=[];for(let i of e){let l=a.searchByIdWithParentDFS(t,i),H=Object.assign({},l);o.push(H)}this.selectedNode.set(o),this.emitMultipleNodes()}else{let o=a.searchByIdWithParentDFS(t,e),i=Object.assign({},o);this.selectedNode.set(i),this.emitSingleNode(i)}})}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(i=>i.id!==t.id)),this.emitMultipleNodes(),this.generateLabel()}}generateLabel(){let e="Select a Channel";if(this.multiple()){e="";for(let t of this.selectedNode())e+=a.getLabelPathTree(t)+", ";this.selectedCategoryLabel.set(e)}else{let t=this.selectedNode();t?(e=a.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,i=t.getAttribute("style")||"";t.setAttribute("style",`${i} top: ${o+e}px;`)}getBodyTop(){return this.htmlBody.getBoundingClientRect().top*-1}writeValue(e){a.IsNotEmpty(e)&&this.initSelectedNode(e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled.set(e)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=w({type:n,selectors:[["multiwarehouse-tree-select"]],inputs:{multiple:[1,"multiple"],floatingLabel:[1,"floatingLabel"]},outputs:{onChannelChange:"onChannelChange"},features:[B([{provide:R,useExisting:b(()=>n),multi:!0}])],decls:5,vars:9,consts:[["matTooltipPosition","above",1,"p-float-label",3,"matTooltip"],["appendTo","body","containerStyleClass","w-100","id","selectChannel",1,"multiwarehouse-select",3,"click","onNodeSelect","ngModelChange","onClear","onNodeUnselect","filter","filterInputAutoFocus","options","ngModel","selectionMode"],["pTemplate","value","type","default"],["for","selectChannel"],["matTooltipPosition","above"]],template:function(t,o){t&1&&(u(0,"span",0)(1,"p-treeSelect",1),E(2,"async"),f("click",function(){return o.onClick()})("onNodeSelect",function(l){return o.onNodeSelect(l)}),P("ngModelChange",function(l){return L(o.selectedNode,l)||(o.selectedNode=l),l}),f("onClear",function(){return o.onClear()})("onNodeUnselect",function(l){return o.onNodeUnSelect(l)}),g(3,J,2,1,"ng-template",2),r(),g(4,K,2,0,"label",3),r()),t&2&&(d("matTooltip",o.selectedCategoryLabel()),p(),d("filter",!0)("filterInputAutoFocus",!0)("options",x(2,7,o.channels$)),v("ngModel",o.selectedNode),d("selectionMode",o.multiple()?"multiple":"single"),p(3),k(o.floatingLabel()?4:-1))},dependencies:[z,O,V,j,$,F,A,D,W,U],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-tree-node-icon, .custom-icon-shopee.p-tree-node-icon, .custom-icon-woocommerce.p-tree-node-icon, .custom-icon-lazada.p-tree-node-icon, .custom-icon-tiktok.p-tree-node-icon, .custom-icon-shopify.p-tree-node-icon, .custom-icon-plugo.p-tree-node-icon{background-size:contain;background-repeat:no-repeat;width:20px;height:20px;display:inline-block} .custom-icon-tokopedia.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png)} .custom-icon-woocommerce.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp)} .custom-icon-shopee.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png)} .custom-icon-tiktok.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png)} .custom-icon-lazada.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1680681836/icons/marketplace_icons/Lazadanew.png)} .custom-icon-shopify.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1707987435/icons/marketplace_icons/shopify.png)} .custom-icon-plugo.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1739236419/icons/marketplace_icons/plugo.ico)} .custom-icon-shopee .fa-warehouse.p-tree-node-icon, .custom-icon-tiktok .fa-warehouse.p-tree-node-icon, .custom-icon-tokopedia .fa-warehouse.p-tree-node-icon, .custom-icon-lazada .fa-warehouse.p-tree-node-icon, .custom-icon-shopify .fa-warehouse.p-tree-node-icon, .custom-icon-woocommerce .fa-warehouse.p-tree-node-icon, .custom-icon-plugo .fa-warehouse.p-tree-node-icon{background-image:none!important;display:inline-block!important}"]})}}return n})();export{he as a};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as T}from"./chunk-Z3ITXK3D.js";import{a as Ke,b as me,c as ze,d as Ve,e as Se,f as qe,g as ve,h as Ge,i as J,j as we,k as y}from"./chunk-TGMCGROM.js";import{a as Xe}from"./chunk-CGOB6Y3X.js";import{e as re}from"./chunk-WN5DZGA4.js";import{b as ge,c as j}from"./chunk-RXQX7567.js";import{b as Je}from"./chunk-V3USB3ZU.js";import{a as Ze}from"./chunk-ERXVXBTU.js";import{G as We,n as Ue,o as $e,p as He}from"./chunk-FXQKRJWU.js";import{F as Oe,G as Ne,Hb as H,La as U,O as de,Ra as te,T as Me,Wa as $,Z as he,aa as x,ba as pe,c as g,dd as Le,ea as q,ed as Fe,f as Q,id as G,j as xe,ja as A,k as Re,ka as L,ma as E,n as z,o as ee,oa as h,p as R,pa as F,q as V,qa as Be,ua as fe,v as D,w as je}from"./chunk-OJMQBH6T.js";import{a as ue,i as b}from"./chunk-66YHNWRR.js";var Ye={production:!0,version:"5.46.3",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var wt="firebase",kt="11.10.0";J(wt,kt,"app");var W=new Le("ANGULARFIRE2_VERSION");var Qe=(r,s)=>{let e=s?[s]:Ge(),t=[];return e.forEach(n=>{n.container.getProvider(r).instances.forEach(i=>{t.includes(i)||t.push(i)})}),t},ke=function(r){return r[r.SILENT=0]="SILENT",r[r.WARN=1]="WARN",r[r.VERBOSE=2]="VERBOSE",r}(ke||{}),Pr=G()&&typeof Zone<"u"?ke.WARN:ke.SILENT;var ne=class{zone;delegate;constructor(s,e=Re){this.zone=s,this.delegate=e}now(){return this.delegate.now()}schedule(s,e,t){let n=this.zone,o=function(i){n?n.runGuarded(()=>{s.apply(this,[i])}):s.apply(this,[i])};return this.delegate.schedule(o,e,t)}},Ae=(()=>{class r{outsideAngular;insideAngular;constructor(){let e=F(U);this.outsideAngular=e.runOutsideAngular(()=>new ne(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new ne(typeof Zone>"u"?void 0:Zone.current,xe))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var It=new Map,bt={activated:!1,tokenObservers:[]},Et={initialized:!1,enabled:!1};function C(r){return It.get(r)||Object.assign({},bt)}function nt(){return Et}var Tt="https://content-firebaseappcheck.googleapis.com/v1";var yt="exchangeDebugToken",et={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Fr=24*60*60*1e3;var Ee=class{constructor(s,e,t,n,o){if(this.operation=s,this.retryPolicy=e,this.getWaitDuration=t,this.lowerBound=n,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=n,n>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(s){return b(this,null,function*(){this.stop();try{this.pending=new me,this.pending.promise.catch(e=>{}),yield Ct(this.getNextRun(s)),this.pending.resolve(),yield this.pending.promise,this.pending=new me,this.pending.promise.catch(e=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(s){if(s)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}};function Ct(r){return new Promise(s=>{setTimeout(s,r)})}var Pt={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},N=new Ve("appCheck","AppCheck",Pt);function ot(r){if(!C(r).activated)throw N.create("use-before-activation",{appName:r.name})}function it(t,n){return b(this,arguments,function*({url:r,body:s},e){let o={"Content-Type":"application/json"},i=e.getImmediate({optional:!0});if(i){let f=yield i.getHeartbeatsHeader();f&&(o["X-Firebase-Client"]=f)}let a={method:"POST",body:JSON.stringify(s),headers:o},l;try{l=yield fetch(r,a)}catch(f){throw N.create("fetch-network-error",{originalErrorMessage:f?.message})}if(l.status!==200)throw N.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(f){throw N.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=c.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw N.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:c.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function st(r,s){let{projectId:e,appId:t,apiKey:n}=r.options;return{url:`${Tt}/projects/${e}/apps/${t}:${yt}?key=${n}`,body:{debug_token:s}}}var Dt="firebase-app-check-database",_t=1,Te="firebase-app-check-store";var oe=null;function xt(){return oe||(oe=new Promise((r,s)=>{try{let e=indexedDB.open(Dt,_t);e.onsuccess=t=>{r(t.target.result)},e.onerror=t=>{var n;s(N.create("storage-open",{originalErrorMessage:(n=t.target.error)===null||n===void 0?void 0:n.message}))},e.onupgradeneeded=t=>{let n=t.target.result;switch(t.oldVersion){case 0:n.createObjectStore(Te,{keyPath:"compositeKey"})}}}catch(e){s(N.create("storage-open",{originalErrorMessage:e?.message}))}}),oe)}function Rt(r,s){return jt(Ot(r),s)}function jt(r,s){return b(this,null,function*(){let t=(yield xt()).transaction(Te,"readwrite"),o=t.objectStore(Te).put({compositeKey:r,value:s});return new Promise((i,a)=>{o.onsuccess=l=>{i()},t.onerror=l=>{var c;a(N.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function Ot(r){return`${r.options.appId}-${r.name}`}var Z=new qe("@firebase/app-check");function Ie(r,s){return ze()?Rt(r,s).catch(e=>{Z.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function at(){return nt().enabled}function ct(){return b(this,null,function*(){let r=nt();if(r.enabled&&r.token)return r.token.promise;throw Error(`
|
|
2
|
+
Can't get debug token in production mode.
|
|
3
|
+
`)})}var Nt={error:"UNKNOWN_ERROR"};function Mt(r){return Ke.encodeString(JSON.stringify(r),!1)}function ye(r,s=!1,e=!1){return b(this,null,function*(){let t=r.app;ot(t);let n=C(t),o=n.token,i;if(o&&!X(o)&&(n.token=void 0,o=void 0),!o){let c=yield n.cachedTokenPromise;c&&(X(c)?o=c:yield Ie(t,void 0))}if(!s&&o&&X(o))return{token:o.token};let a=!1;if(at())try{n.exchangeTokenPromise||(n.exchangeTokenPromise=it(st(t,yield ct()),r.heartbeatServiceProvider).finally(()=>{n.exchangeTokenPromise=void 0}),a=!0);let c=yield n.exchangeTokenPromise;return yield Ie(t,c),n.token=c,{token:c.token}}catch(c){return c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?Z.warn(c.message):e&&Z.error(c),be(c)}try{n.exchangeTokenPromise||(n.exchangeTokenPromise=n.provider.getToken().finally(()=>{n.exchangeTokenPromise=void 0}),a=!0),o=yield C(t).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?Z.warn(c.message):e&&Z.error(c),i=c}let l;return o?i?X(o)?l={token:o.token,internalError:i}:l=be(i):(l={token:o.token},n.token=o,yield Ie(t,o)):l=be(i),a&&Ut(t,l),l})}function Bt(r){return b(this,null,function*(){let s=r.app;ot(s);let{provider:e}=C(s);if(at()){let t=yield ct(),{token:n}=yield it(st(s,t),r.heartbeatServiceProvider);return{token:n}}else{let{token:t}=yield e.getToken();return{token:t}}})}function Lt(r,s,e,t){let{app:n}=r,o=C(n),i={next:e,error:t,type:s};if(o.tokenObservers=[...o.tokenObservers,i],o.token&&X(o.token)){let a=o.token;Promise.resolve().then(()=>{e({token:a.token}),tt(r)}).catch(()=>{})}o.cachedTokenPromise.then(()=>tt(r))}function lt(r,s){let e=C(r),t=e.tokenObservers.filter(n=>n.next!==s);t.length===0&&e.tokenRefresher&&e.tokenRefresher.isRunning()&&e.tokenRefresher.stop(),e.tokenObservers=t}function tt(r){let{app:s}=r,e=C(s),t=e.tokenRefresher;t||(t=Ft(r),e.tokenRefresher=t),!t.isRunning()&&e.isTokenAutoRefreshEnabled&&t.start()}function Ft(r){let{app:s}=r;return new Ee(()=>b(null,null,function*(){let e=C(s),t;if(e.token?t=yield ye(r,!0):t=yield ye(r),t.error)throw t.error;if(t.internalError)throw t.internalError}),()=>!0,()=>{let e=C(s);if(e.token){let t=e.token.issuedAtTimeMillis+(e.token.expireTimeMillis-e.token.issuedAtTimeMillis)*.5+3e5,n=e.token.expireTimeMillis-5*60*1e3;return t=Math.min(t,n),Math.max(0,t-Date.now())}else return 0},et.RETRIAL_MIN_WAIT,et.RETRIAL_MAX_WAIT)}function Ut(r,s){let e=C(r).tokenObservers;for(let t of e)try{t.type==="EXTERNAL"&&s.error!=null?t.error(s.error):t.next(s)}catch{}}function X(r){return r.expireTimeMillis-Date.now()>0}function be(r){return{token:Mt(Nt),error:r}}var Ce=class{constructor(s,e){this.app=s,this.heartbeatServiceProvider=e}_delete(){let{tokenObservers:s}=C(this.app);for(let e of s)lt(this.app,e.next);return Promise.resolve()}};function $t(r,s){return new Ce(r,s)}function Ht(r){return{getToken:s=>ye(r,s),getLimitedUseToken:()=>Bt(r),addTokenListener:s=>Lt(r,"INTERNAL",s),removeTokenListener:s=>lt(r.app,s)}}var Wt="@firebase/app-check",Kt="0.10.1";var zt="app-check",rt="app-check-internal";function Vt(){ve(new Se(zt,r=>{let s=r.getProvider("app").getImmediate(),e=r.getProvider("heartbeat");return $t(s,e)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((r,s,e)=>{r.getProvider(rt).initialize()})),ve(new Se(rt,r=>{let s=r.getProvider("app-check").getImmediate();return Ht(s)},"PUBLIC").setInstantiationMode("EXPLICIT")),J(Wt,Kt)}Vt();var qt="app-check";var ie=class{constructor(){return Qe(qt)}};var Gt=["localhost","0.0.0.0","127.0.0.1"],en=typeof window<"u"&&Gt.includes(window.location.hostname);var ut=(()=>{class r{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let t=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return typeof t=="string"&&(t=[t]),t||[]}ParseToken(e){try{let n=e.split(".")[0].replace("-","+").replace("_","/"),o=JSON.parse(window.atob(n)),a=e.split(".")[1].replace("-","+").replace("_","/"),l=JSON.parse(window.atob(a));return l.header=o,l}catch{return!1}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Xt="firebase",Yt="11.10.0";y.registerVersion(Xt,Yt,"app-compat");var Qt=["ngOnDestroy"],ht=(r,s,e,t={})=>new Proxy(r,{get:(n,o)=>e.runOutsideAngular(()=>{if(r[o])return t?.spy?.get&&t.spy.get(o,r[o]),r[o];if(Qt.indexOf(o)>-1)return()=>{};let i=s.toPromise().then(a=>{let l=a?.[o];return typeof l=="function"?l.bind(a):l?.then?l.then(c=>e.run(()=>c)):e.run(()=>l)});return new Proxy(()=>{},{get:(a,l)=>i[l],apply:(a,l,c)=>i.then(d=>{let u=d?.(...c);return t?.spy?.apply&&t.spy.apply(o,c,u),u})})})});var se=class{constructor(s){return s}},ae=new E("angularfire2.app.options"),ce=new E("angularfire2.app.name");function Pe(r,s,e){let t=typeof e=="string"&&e||"[DEFAULT]",n=typeof e=="object"&&e||{};n.name=n.name||t;let i=y.apps.filter(a=>a&&a.name===n.name)[0]||s.runOutsideAngular(()=>y.initializeApp(r,n));try{if(JSON.stringify(r)!==JSON.stringify(i.options)){let a=!!module.hot;er("error",`${i.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new se(i)}var er=(r,...s)=>{G()&&typeof console<"u"&&console[r](...s)},tr={provide:se,useFactory:Pe,deps:[ae,U,[new Be,ce]]},Go=(()=>{class r{static initializeApp(e,t){return{ngModule:r,providers:[{provide:ae,useValue:e},{provide:ce,useValue:t}]}}constructor(e){y.registerVersion("angularfire",W.full,"core"),y.registerVersion("angularfire",W.full,"app-compat"),y.registerVersion("angular",Fe.full,e.toString())}static \u0275fac=function(t){return new(t||r)(h($))};static \u0275mod=H({type:r});static \u0275inj=L({providers:[tr]})}return r})();function pt(r,s,e,t,n){let[,o,i]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===r)||[];if(o)return rr(n,i)||(dt("error",`${s} was already initialized on the ${e} Firebase App with different settings.${nr?" You may need to reload as Firebase is not HMR aware.":""}`),dt("warn",{is:n,was:i})),o;{let a=t();return globalThis.\u0275AngularfireInstanceCache.push([r,a,n]),a}}function rr(r,s){try{return r.toString()===s.toString()}catch{return r===s}}var nr=typeof module<"u"&&!!module.hot,dt=(r,...s)=>{G()&&typeof console<"u"&&console[r](...s)};globalThis.\u0275AngularfireInstanceCache||=[];var or=new E("angularfire2.auth.use-emulator"),ir=new E("angularfire2.auth.settings"),sr=new E("angularfire2.auth.tenant-id"),ar=new E("angularfire2.auth.langugage-code"),cr=new E("angularfire2.auth.use-device-language"),lr=new E("angularfire.auth.persistence"),ur=(r,s,e,t,n,o,i,a)=>pt(`${r.name}.auth`,"AngularFireAuth",r.name,()=>{let l=s.runOutsideAngular(()=>r.auth());if(e&&l.useEmulator(...e),t&&(l.tenantId=t),l.languageCode=n,o&&l.useDeviceLanguage(),i)for(let[c,d]of Object.entries(i))l.settings[c]=d;return a&&l.setPersistence(a),l},[e,t,n,o,i,a]),De=(()=>{class r{injector=F(fe);authState;idToken;user;idTokenResult;credential;constructor(e,t,n,o,i,a,l,c,d,u,p,f){let K=new Q,M=V(void 0).pipe(z(i.outsideAngular),x(()=>o.runOutsideAngular(()=>import("./chunk-GCECFUOP.js"))),D(()=>Pe(e,o,t)),D(P=>ur(P,o,a,c,d,u,l,p)),he({bufferSize:1,refCount:!1}));if(He(n))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=V(null);else{M.pipe(Me()).subscribe();let P=M.pipe(x(S=>S.getRedirectResult().then(_=>_,()=>null)),Je(this.injector),he({bufferSize:1,refCount:!1})),Y=M.pipe(x(S=>new g(_=>({unsubscribe:o.runOutsideAngular(()=>S.onAuthStateChanged(B=>_.next(B),B=>_.error(B),()=>_.complete()))})))),le=M.pipe(x(S=>new g(_=>({unsubscribe:o.runOutsideAngular(()=>S.onIdTokenChanged(B=>_.next(B),B=>_.error(B),()=>_.complete()))}))));this.authState=P.pipe(pe(Y),ee(i.outsideAngular),z(i.insideAngular)),this.user=P.pipe(pe(le),ee(i.outsideAngular),z(i.insideAngular)),this.idToken=this.user.pipe(x(S=>S?R(S.getIdToken()):V(null))),this.idTokenResult=this.user.pipe(x(S=>S?R(S.getIdTokenResult()):V(null))),this.credential=Oe(P,K,this.authState.pipe(Ne(S=>!S))).pipe(D(S=>S?.user?S:null),ee(i.outsideAngular),z(i.insideAngular))}return ht(this,M,o,{spy:{apply:(P,Y,le)=>{(P.startsWith("signIn")||P.startsWith("createUser"))&&le.then(S=>K.next(S))}}})}static \u0275fac=function(t){return new(t||r)(h(ae),h(ce,8),h($),h(U),h(Ae),h(or,8),h(ir,8),h(sr,8),h(ar,8),h(cr,8),h(lr,8),h(ie,8))};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"any"})}return r})(),ui=(()=>{class r{constructor(){y.registerVersion("angularfire",W.full,"auth-compat")}static \u0275fac=function(t){return new(t||r)};static \u0275mod=H({type:r});static \u0275inj=L({providers:[De]})}return r})();function m(r,s,e,t){return new Promise((n,o)=>{r||o("IndexedDB not available");let i=r.open(s,e),a;i.onsuccess=l=>{a=i.result,n(a)},i.onerror=l=>{o(`IndexedDB error: ${i.error}`)},typeof t=="function"&&(i.onupgradeneeded=l=>{t(l,a)})})}function ft(r,s,e,t,n){if(!r)return;let o=r.open(s,e);o.onupgradeneeded=i=>{let a=i.target.result;t.forEach(c=>{if(!a.objectStoreNames.contains(c.store)){let d=a.createObjectStore(c.store,c.storeConfig);c.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let l=n&&n();l&&Object.keys(l).map(c=>parseInt(c,10)).filter(c=>c>i.oldVersion).sort((c,d)=>c-d).forEach(c=>{l[c](a,o.transaction)}),a.close()},o.onsuccess=i=>{i.target.result.close()}}function hr(r,s,e){if(!r||!s||!e)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(t=>{try{let n=s+1,o=indexedDB.open(r,n);o.onupgradeneeded=i=>{let a=i.target.result;a.deleteObjectStore(e),a.close(),console.log("onupgradeneeded"),t.next(!0),t.complete()},o.onerror=i=>t.error(i)}catch(n){t.error(n)}})}function pr(r,s){return r.objectStoreNames.contains(s)}function I(r,s,e){r||e("You need to use the openDatabase function to create a database before you query it!"),pr(r,s)||e(`objectStore does not exists: ${s}`)}function w(r,s){let e=r.transaction(s.storeName,s.dbMode);return e.onerror=s.error,e.onabort=s.abort,e}function k(r,s,e,t){return{storeName:s,dbMode:r,error:n=>{e(n)},abort:n=>{e(n)}}}var v=function(r){return r.readonly="readonly",r.readwrite="readwrite",r}(v||{}),gt=new E(null),_e=(()=>{class r{constructor(e,t){if(this.dbConfig=e,this.platformId=t,!e.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!e.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=$e(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,ft(this.indexedDB,e.name,e.version,e.objectStoresMeta,e.migrationFactory),m(this.indexedDB,e.name).then(n=>{n.version!==e.version&&(this.dbConfig.version=n.version)}))}createObjectStore(e,t){let n=[e];ft(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,n,t)}add(e,t,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{let l=w(i,k(v.readwrite,e,d=>o.error(d))).objectStore(e),c=n?l.add(t,n):l.add(t);c.onsuccess=d=>b(this,null,function*(){let u=d.target.result,p=l.get(u);p.onsuccess=f=>{o.next(f.target.result),o.complete()}})}).catch(i=>o.error(i))})}bulkAdd(e,t){let n=new Promise((o,i)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{let c=w(a,k(v.readwrite,e,o,i)).objectStore(e),d=t.map(u=>new Promise((p,f)=>{let K=u.key;delete u.key;let M=K?c.add(u,K):c.add(u);M.onsuccess=P=>{let Y=P.target.result;p(Y)}}));o(Promise.all(d))}).catch(a=>i(a))});return R(n)}bulkDelete(e,t){let n=t.map(o=>new Promise((i,a)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(l=>{let c=w(l,k(v.readwrite,e,a,i));c.objectStore(e).delete(o),c.oncomplete=()=>{this.getAll(e).pipe(de(1)).subscribe(u=>{i(u)})}}).catch(l=>a(l))}));return R(Promise.all(n))}getByKey(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{let l=w(o,k(v.readonly,e,n.error)).objectStore(e).get(t);l.onsuccess=c=>{n.next(c.target.result),n.complete()},l.onerror=c=>{n.error(c)}}).catch(o=>n.error(o))})}bulkGet(e,t){let n=t.map(o=>this.getByKey(e,o));return new g(o=>{je(n).subscribe(i=>{o.next(i),o.complete()})})}getByID(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,c=>n.error(c));let l=w(o,k(v.readonly,e,n.error,n.next)).objectStore(e).get(t);l.onsuccess=c=>{n.next(c.target.result)}}).catch(o=>n.error(o))})}getByIndex(e,t,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{I(i,e,u=>o.error(u));let d=w(i,k(v.readonly,e,o.error)).objectStore(e).index(t).get(n);d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(i=>o.error(i))})}getAll(e){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{I(n,e,l=>t.error(l));let a=w(n,k(v.readonly,e,t.error,t.next)).objectStore(e).getAll();a.onerror=l=>{t.error(l)},a.onsuccess=({target:{result:l}})=>{t.next(l),t.complete()}}).catch(n=>t.error(n))})}update(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,c=>n.error(c));let a=w(o,k(v.readwrite,e,c=>n.error(c))).objectStore(e),l=a.put(t);l.onsuccess=c=>b(this,null,function*(){let d=c.target.result,u=a.get(d);u.onsuccess=p=>{n.next(p.target.result),n.complete()}})}).catch(o=>n.error(o))})}delete(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,l=>n.error(l));let i=w(o,k(v.readwrite,e,l=>n.error(l)));i.objectStore(e).delete(t),i.oncomplete=()=>{this.getAll(e).pipe(de(1)).subscribe(l=>{n.next(l),n.complete()})}}).catch(o=>n.error(o))})}deleteByKey(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,l=>n.error(l));let i=w(o,k(v.readwrite,e,l=>n.error(l))),a=i.objectStore(e);i.oncomplete=()=>{n.next(!0),n.complete()},a.delete(t)}).catch(o=>n.error(o))})}clear(e){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{I(n,e,a=>t.error(a));let o=w(n,k(v.readwrite,e,a=>t.error(a)));o.objectStore(e).clear(),o.oncomplete=()=>{t.next(!0),t.complete()}}).catch(n=>t.error(n))})}deleteDatabase(){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(t=>b(this,null,function*(){yield t.close();let n=this.indexedDB.deleteDatabase(this.dbConfig.name);n.onsuccess=()=>{e.next(!0),e.complete()},n.onerror=o=>e.error(o),n.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(t=>e.error(t))})}openCursor(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,c=>n.error(c));let a=w(o,k(v.readonly,e,n.error)).objectStore(e),l=t===void 0?a.openCursor():a.openCursor(t);l.onsuccess=c=>{n.next(c),n.complete()}}).catch(o=>n.error(o))})}openCursorByIndex(e,t,n,o=v.readonly){let i=new Q;return m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{I(a,e,p=>{i.error(p)});let u=w(a,k(o,e,p=>{i.error(p)},()=>{i.next()})).objectStore(e).index(t).openCursor(n);u.onsuccess=p=>{i.next(p)}}).catch(a=>i.error(a)),i}getAllByIndex(e,t,n){let o=[];return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{I(a,e,p=>i.error(p));let u=w(a,k(v.readonly,e,i.error)).objectStore(e).index(t).openCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(o.push(f.value),f.continue()):(i.next(o),i.complete())}}).catch(a=>i.error(a))})}getAllKeysByIndex(e,t,n){let o=[];return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{I(a,e,p=>i.error(p));let u=w(a,k(v.readonly,e,i.error)).objectStore(e).index(t).openKeyCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(o.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(i.next(o),i.complete())}}).catch(a=>i.error(a))})}count(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,c=>n.error(c));let l=w(o,k(v.readonly,e,n.error)).objectStore(e).count(t);l.onerror=c=>n.error(c),l.onsuccess=c=>{n.next(c.target.result),n.complete()}}).catch(o=>n.error(o))})}countByIndex(e,t,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{I(i,e,u=>o.error(u));let d=w(i,k(v.readonly,e,o.error)).objectStore(e).index(t).count(n);d.onerror=u=>o.error(u),d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(i=>o.error(i))})}deleteObjectStore(e){return hr(this.dbConfig.name,++this.dbConfig.version,e)}}return r.\u0275fac=function(e){return new(e||r)(h(gt),h($))},r.\u0275prov=A({token:r,factory:r.\u0275fac}),r})(),vi=(()=>{class r{static forRoot(e){return{ngModule:r,providers:[_e,{provide:gt,useValue:e}]}}}return r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=H({type:r}),r.\u0275inj=L({imports:[[Ue]]}),r})();var mt=(()=>{class r{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,t){let n=this.getKey(t);return this.db.add(this.DATABASE,e,n).pipe(D(o=>e))}getCategoriesByChannelType(e){let t=this.getKey(e);return this.db.getByKey(this.DATABASE,t)}getKey(e){let t="";switch(e){case ge.Lazada:t="Lazada";break;case ge.Tokopedia:t="Tokopedia";break}return t}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let e=localStorage.getItem("Authorization");return this.hostName=JSON.parse(e)?.Host,this.hostName}static{this.\u0275fac=function(t){return new(t||r)(h(_e))}}static{this.\u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var St=(()=>{class r{inititalizeIntercom(){let e=this.getFromLocalStorage();e?.Enabled&&window.Intercom("boot",{app_id:"xv1oomgl",name:e.Name,email:e.Email,created_at:e.Created,user_hash:e.Hash})}shutdown(){this.getFromLocalStorage()?.Enabled&&(window.Intercom("shutdown"),this.clearStorage())}clearStorage(){localStorage.removeItem("Intercom")}updateLocalStorage(e){let t={Enabled:!0};e&&(t=ue(ue({},t),e)),localStorage.setItem("Intercom",JSON.stringify(t))}getFromLocalStorage(){let e=localStorage.getItem("Intercom");return JSON.parse(e)}hideLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!0}),e.hide_default_launcher=!0,this.updateLocalStorage(e))}showLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!1}),e.hide_default_launcher=!1,this.updateLocalStorage(e))}isHideLauncher(){let e=this.getFromLocalStorage();return j.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var vt=(()=>{class r{constructor(){this.httpService=F(re),this.currentUser=te(null),this.tokenValue=te(null),this.channels=te([])}refreshToken(){return this.httpService.get(Xe.RefreshToken).pipe(q(e=>{this.updateTokenInLocalStorage(e)}))}updateTokenInLocalStorage(e){this.saveUserToLocalStorage(e),this.saveChannelsToLocalStorage(e.Channels)}saveUserToLocalStorage(e){let t=JSON.stringify(e);localStorage.setItem(T.USER,t)}getUser(){if(this.currentUser())return this.currentUser();{let e=localStorage.getItem(T.USER);return this.currentUser.set(e?JSON.parse(e):null),this.currentUser()}}getTokenValue(){let e=this.getUser();if(!this.tokenValue()){let t=j.parseJwt(e?.Token.access_token);this.tokenValue.set(t)}return this.tokenValue()}saveChannelsToLocalStorage(e){let t=JSON.stringify(e);localStorage.setItem(T.CHANNELS,t)}getChannels(){if(this.channels().length==0){let e=localStorage.getItem(T.CHANNELS),t=e?JSON.parse(e):[];t=this.assignChannelsLogo(t),this.channels.set(t)}return this.channels()}assignChannelsLogo(e){return e.map(t=>(t.logo=j.getChannelLogoByTypeId(t.TypeID),t.Img=j.getChannelLogoByTypeId(t.TypeID),t))}clearStorage(){localStorage.removeItem(T.USER),localStorage.removeItem(T.CHANNELS),this.currentUser.set(null),this.tokenValue.set(null),this.channels.set([])}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Fi=(()=>{class r{constructor(e,t,n,o,i,a,l,c){this.httpService=e,this.tokenDecodeService=t,this.afAuth=n,this.ngxPermission=o,this.localDataService=i,this.router=a,this.intercomService=l,this.tokenService=c}login(e){return this.httpService.post("/api/token/Login",e).pipe(q(t=>{this.setLocalStorage(t,e.Host,e.Username),this.loadPermissions()}))}getNews(){return this.httpService.get(Ye.news).pipe(D(e=>e?.items?.map(t=>t?.properties)))}loginWithGoogle(e,t){e.preventDefault();let n=new we;return n.setCustomParameters({prompt:"select_account"}),R(this.afAuth.signInWithPopup(n)).pipe(D(o=>o.credential),D(o=>o.idToken),x(o=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:o,Host:t}))),q(o=>{this.setLocalStorage(o,t,null),this.loadPermissions()}))}setLocalStorage(e,t,n){this.tokenService.updateTokenInLocalStorage(e),localStorage.setItem(T.AUTHORIZATION,JSON.stringify({Host:t,username:n})),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem(T.USER);if(j.IsNotEmpty(e)){let t=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(t)}}getChannels(){return this.tokenService.getChannels()}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=this.tokenService.getUser(),t=new Date;if(e!=null){let n=new Date(e.Token.expiredAt);return t<n?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem(T.AUTHORIZATION);this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,this.tokenService.clearStorage(),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}static{this.\u0275fac=function(t){return new(t||r)(h(re),h(ut),h(De),h(Ze),h(mt),h(We),h(St),h(vt))}}static{this.\u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{Ye as a,ut as b,Go as c,ui as d,vi as e,mt as f,St as g,vt as h,Fi as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-C7YK5TDP.js";import{c as q}from"./chunk-RXQX7567.js";import{n as w}from"./chunk-FXQKRJWU.js";import{$b as U,Gb as h,Gc as p,Hc as S,Ic as d,Jb as F,Mb as b,Oa as f,Sc as k,Yb as g,dc as x,ec as I,gc as T,hc as P,ic as r,jc as i,kc as _,oc as j,pa as v,pb as u,rb as o,tc as C,uc as s,ya as E,za as M}from"./chunk-OJMQBH6T.js";var A=(()=>{class t{transform(e){return q.getChannelLogoByTypeId(e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275pipe=F({name:"channelImage",type:t,pure:!0})}}return t})();function R(t,m){if(t&1&&_(0,"img",8),t&2){let e=s().$implicit;g("src",e==null?null:e.ThumbnailURL,u)}}function z(t,m){t&1&&_(0,"img",9)}function B(t,m){if(t&1&&b(0,R,1,1,"img",8)(1,z,1,0,"img",9),t&2){let e=m.$implicit;x(e!=null&&e.ThumbnailURL?0:1)}}function O(t,m){if(t&1){let e=j();r(0,"img",17),C("click",function(a){E(e);let l=s().$implicit;return s().onZoomImage(a,l==null?null:l.ImageURL),M(a.stopPropagation())}),i()}if(t&2){let e=s().$implicit;g("src",e==null?null:e.ThumbnailURL,u)}}function $(t,m){t&1&&_(0,"img",13)}function Z(t,m){if(t&1&&(r(0,"div",15),p(1),i()),t&2){let e=s().$implicit;o(),d("x",e.Quantity,"")}}function W(t,m){if(t&1&&(r(0,"li")(1,"div",10)(2,"div",11),b(3,O,1,1,"img",12)(4,$,1,0,"img",13),r(5,"div",14)(6,"div",15),p(7),i(),r(8,"div",16),p(9),i()()(),b(10,Z,2,1,"div",15),i()()),t&2){let e=m.$implicit;o(3),x(e!=null&&e.ThumbnailURL?3:4),o(4),S(e.Name),o(2),S(e.Code),o(),x(e.Quantity>1?10:-1)}}var Y=(()=>{class t{constructor(){this.variants=f(),this.biggerPictureService=v(y)}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=h({type:t,selectors:[["variants-dropdown"]],inputs:{variants:[1,"variants"]},decls:15,vars:2,consts:[[1,"dropdown","pe-6"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","dropdown-toggle","border-0","d-flex","align-items-center","justify-content-between","gap-4","w-100",2,"padding","0px"],[1,"text-start"],[1,"fs-6"],[1,"d-flex","align-items-center","gap-2"],[1,"fa-regular","fa-angle-down"],[1,"dropdown-menu","p-3"],[1,"ms-6","mt-3","text-black"],[1,"thumb-square","border","border-opacity-10",3,"src"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","border-opacity-10","thumb-square"],[1,"dropdown-item","d-flex","align-items-center","gap-5","justify-content-between",2,"padding-left","8px","padding-right","8px"],[1,"d-flex","align-items-center","justify-content-start","gap-5"],[1,"thumb-square-lg","border","border-opacity-10",2,"cursor","zoom-in",3,"src"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"thumb-square-lg","border","border-opacity-10"],[1,"lh-base"],[1,"text-black"],[1,"text-muted"],[1,"thumb-square-lg","border","border-opacity-10",2,"cursor","zoom-in",3,"click","src"]],template:function(n,a){if(n&1&&(r(0,"div",0)(1,"button",1)(2,"div",2)(3,"div",3),p(4),i(),r(5,"div",4),T(6,B,2,1,null,null,I),i()(),r(8,"div"),_(9,"i",5),i()(),r(10,"ul",6)(11,"h5",7),p(12),i(),T(13,W,11,4,"li",null,I),i()()),n&2){let l,c;o(4),d("",(l=a.variants())==null?null:l.length," items"),o(2),P(a.variants()),o(6),d("",(c=a.variants())==null?null:c.length," Items"),o(),P(a.variants())}},dependencies:[w],styles:[".dropdown-toggle[_ngcontent-%COMP%]:after{display:none!important}.dropdown[_ngcontent-%COMP%] .dropdown-menu.show[_ngcontent-%COMP%]{top:unset!important}.thumb-square[_ngcontent-%COMP%]{width:26px;height:26px;object-fit:contain;object-position:center}.thumb-square-lg[_ngcontent-%COMP%]{width:50px;height:50px;object-fit:contain;object-position:center}"]})}}return t})();var N=t=>({cursor:t}),rt=(()=>{class t{constructor(){this.variant=f(),this.biggerPictureService=v(y)}onZoomImage(e){let n=this.variant()?.ImageURL;n&&this.biggerPictureService.openBiggerPicture(e,n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=h({type:t,selectors:[["variant-with-image"]],inputs:{variant:[1,"variant"]},decls:8,vars:7,consts:[[1,"d-flex","align-items-center","gap-5"],[1,"thumb-square-lg","border","border-opacity-10",2,"cursor","zoom-in",3,"click","src"],[1,"lh-base"],[1,"text-black"],[1,"text-muted"]],template:function(n,a){if(n&1&&(r(0,"div",0)(1,"div")(2,"img",1),C("click",function(c){return a.onZoomImage(c)}),i()(),r(3,"div",2)(4,"div",3),p(5),i(),r(6,"div",4),p(7),i()()()),n&2){let l,c,V,D;o(2),U(k(5,N,(l=a.variant())!=null&&l.ImageURL?"zoom-in":"")),g("src",((c=a.variant())==null?null:c.ThumbnailURL)||"https://cdn.dealpos.app/template/products_thumb.png",u),o(3),d(" ",(V=a.variant())==null?null:V.Name," "),o(2),d(" ",(D=a.variant())==null?null:D.Code," ")}},dependencies:[w],styles:[".thumb-square-lg[_ngcontent-%COMP%]{width:50px;height:50px;object-fit:contain;object-position:center}"]})}}return t})();export{A as a,Y as b,rt as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=function(o){return o[o.Tokopedia=1]="Tokopedia",o[o.WooCommerce=2]="WooCommerce",o[o.None=3]="None",o[o.KalCare=4]="KalCare",o[o.Shopee=5]="Shopee",o[o.Tiktok=6]="Tiktok",o[o.Lazada=7]="Lazada",o[o.Shopify=8]="Shopify",o[o.Plugo=9]="Plugo",o[o.ShopifyV2=10]="ShopifyV2",o}(s||{});var i=function(o){return o.SHOOPE="https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",o.WOOCOMMERCE="https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",o.TOKOPEDIA="https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",o.TIKTOK="https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",o.LAZADA="https://res.cloudinary.com/pos/image/upload/v1680681836/icons/marketplace_icons/Lazadanew.png",o.KALCARE="https://res.cloudinary.com/pos/image/upload/v1654230268/icons/marketplace_icons/kalcare.png",o.SHOPIFY="https://res.cloudinary.com/pos/image/upload/v1707987435/icons/marketplace_icons/shopify.png",o.PLUGO="https://res.cloudinary.com/pos/image/upload/v1739236419/icons/marketplace_icons/plugo.ico",o.PLUGONEW="https://res.cloudinary.com/pos/image/upload/v1739263497/icons/marketplace_icons/plugonew.ico",o}(i||{});var D=(()=>{class o{static{this.GuidEMpty="00000000-0000-0000-0000-000000000000"}static{this.MinDate="0001-01-01T00:00:00"}static IsNotEmpty(t){return t!=""&&t!=o.GuidEMpty&&t!=null&&t!=null}static IsEmpty(t){return t==""||t==null||t==null||t==o.GuidEMpty}static getChannelLogoByTypeId(t){let e;switch(t){case s.Tokopedia:e=i.TOKOPEDIA;break;case s.Shopee:e=i.SHOOPE;break;case s.WooCommerce:e=i.WOOCOMMERCE;break;case s.Lazada:e=i.LAZADA;break;case s.Tiktok:e=i.TIKTOK;break;case s.KalCare:e=i.KALCARE;break;case s.Shopify:e=i.SHOPIFY;break;case s.Plugo:e=i.PLUGO;break;case s.ShopifyV2:e=i.SHOPIFY;break}return e}static getChannelLogoByName(t=""){t=t.toLowerCase();let e;switch(t){case"tokopedia":e=i.TOKOPEDIA;break;case"shoppe":e=i.SHOOPE;break;case"woocommerce":e=i.WOOCOMMERCE;break;case"tiktok":e=i.TIKTOK;break;case"lazada":e=i.LAZADA;break;case"kalCare":e=i.KALCARE;break;case"plugo":e=i.PLUGO;break;case"shopifyv2":e=i.SHOPIFY;break}return e}static getChannelName(t){let e;switch(t){case s.Shopee:e="Shopee";break;case s.Tokopedia:e="Tokopedia";break;case s.Lazada:e="Lazada";break;case s.Tiktok:e="Tiktok";break;case s.WooCommerce:e="WooCommerce";break;case s.KalCare:e="KalCare";break;case s.Plugo:e="Plugo";break;case s.ShopifyV2:e="Shopify";break}return e}static assignChannelLogo(t){return t=t.map(e=>(e.logo=this.getChannelLogoByTypeId(e.TypeID),e)),t}static getCssChannelColor(t){let e;switch(t){case s.Shopee:e="#ee4d2d";break;case s.Tokopedia:e="var(--G500,#03AC0E)";break;case s.Lazada:e="#FF00B2";break;case s.Tiktok:e="black";break;case s.WooCommerce:e="#674399";break;case s.KalCare:e="rgb(128, 188, 0)";break;case s.Plugo:e="#F2A954";break}return e}static getDaysDiff(t,e){var a=e.getTime()-t.getTime(),r=a/(1e3*60*60*24);return r}static addDays(t,e){let a=new Date(Number(t));return a.setDate(t.getDate()-e),a}static isValidDate(t){return t instanceof Date&&!isNaN(t)}static getImageInfo(t){return new Promise((e,a)=>{let r=new Image;r.src=t,r.decode().then(()=>{e({img:t,height:r.height,width:r.width})}).catch(()=>{a(new Error(`Image load error for ${t}`))})})}static formatTitleFromDate(t,e){let a=null,r=new Date(t),c=new Date(e);return r.getDate()!=c.getDate()&&(a="dd"),r.getMonth()!=c.getMonth()&&(a="dd MMM"),r.getFullYear()!=c.getFullYear()&&(a="dd MMM yyyy"),a}static openDownloadFile(t,e){var a=window.URL.createObjectURL(t),r=document.createElement("a");r.href=a,r.download=e,r.click()}static compare(t,e,a){return(t<e?-1:1)*(a?1:-1)}static isDateExpired(t){let e=new Date,a=!1;return t.getTime()<e.getTime()&&(a=!0),a}static getLabelPathTree(t){let e=[],a=t;for(;a;)e.unshift(a.label),a=a.parent;return e.join(" / ")}static searchByIdWithParentDFS(t,e){let a=[...t],r;for(typeof e=="number"?r=JSON.stringify(e):r=e;a.length>0;){let c=a.pop();if(c.id===r)return c;if(c.children&&c.children.length>0)for(let n of c.children)n.parent=c,a.push(n)}return null}static getTimeDifference(t){let e=new Date(t),a=new Date,r=Math.abs(e.getTime()-a.getTime()),c=1e3,n=6e4,d=60*n,l=24*d,m=Math.floor(r/l),p=Math.floor(r%l/d),u=Math.floor(r%d/n),g=Math.floor(r%n/c);return{days:m,hours:p,minutes:u,seconds:g}}static convertToReadableDate(t){let{days:e,hours:a,minutes:r,seconds:c}=o.getTimeDifference(t),n="";return e>0&&a>0&&r>0&&(n=`${e} days, ${a} hours and ${r} minutes ago`),e>0&&a>0&&r==0&&(n=`${e} days and ${a} hours ago`),e>0&&a==0&&(n=`${e} days ago`),e==0&&a>0&&r>0&&(n=`${a} hours and ${r} minutes ago`),e==0&&a>0&&r==0&&(n=`${a} hours ago`),e==0&&a==0&&r>0&&(n=`${r} minutes ago`),e==0&&a==0&&r==0&&c>0&&(n=`${c} seconds ago`),n}static isValidGUID(t){return/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(t)}static convertTimestampToDate(t){if(!Number.isFinite(t))return new Date(t);let e=t<1e12?t*1e3:t;return new Date(e)}static parseJwt(t){var e=t.split(".")[1],a=e.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(atob(a).split("").map(function(c){return"%"+("00"+c.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(r)}}return o})();export{i as a,s as b,D as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-PIBVGTHJ.js";import{a as fe}from"./chunk-EPBVNII2.js";import"./chunk-4YRBARG2.js";import"./chunk-7G6GQTSH.js";import{a as U}from"./chunk-UMP6ZMEJ.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as
|
|
1
|
+
import{a as D}from"./chunk-PIBVGTHJ.js";import{a as fe}from"./chunk-EPBVNII2.js";import"./chunk-4YRBARG2.js";import"./chunk-7G6GQTSH.js";import{a as U}from"./chunk-UMP6ZMEJ.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as pe}from"./chunk-ACIMXBIC.js";import{a as re}from"./chunk-Z3ITXK3D.js";import"./chunk-CGOB6Y3X.js";import{b as ae}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as oe}from"./chunk-RXQX7567.js";import{m as me,n as ue}from"./chunk-HJXYT6MI.js";import{A as ie}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{b as le,c as se}from"./chunk-ERXVXBTU.js";import{r as de,s as ce}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{E as Y,G as ee,H as te,J as ne,d as K,g as Q,j as W,m as X,n as P}from"./chunk-FXQKRJWU.js";import{$c as _,Gb as x,Gc as s,Hc as h,Ic as z,Jb as L,Mb as m,Nc as q,Oc as $,Pc as C,Qc as j,Sc as I,Tc as J,Yb as p,Z as V,aa as w,ac as S,ad as y,dc as T,ec as k,gc as A,hc as H,ic as a,jc as l,kc as u,lc as g,mc as v,ob as F,oc as B,pa as b,rb as r,rd as Z,tc as G,uc as c,v as M,ya as N,za as R}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as E,b as O}from"./chunk-66YHNWRR.js";var ge=(()=>{class t{transform(e){return typeof e=="number"&&(e=e.toString()),e!=null?e.replace(/\n/g,"<br />"):e}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275pipe=L({name:"newlines",type:t,pure:!0})}}return t})();var Ce=t=>({disabled:t}),_e=(t,d)=>({labelFilledInput:t,labelEmptyInput:d});function ye(t,d){if(t&1&&(a(0,"p"),s(1),_(2,"number"),l()),t&2){let e=c();r(),h(e.inputValueType()==="number"?y(2,1,e.inputValue):e.inputValue)}}function xe(t,d){if(t&1&&(u(0,"p",3),_(1,"newlines")),t&2){let e=c();p("innerHTML",y(1,1,e.inputValue),F)}}function Ie(t,d){if(t&1&&(g(0),s(1),v()),t&2){let e=c();r(),z(" ",e.labelValue," ")}}var ve=(()=>{class t{constructor(){this.inputValue="",this.labelValue="",this.inputType="input",this.labelVisible=!0,this.disabled=!1,this.class="mb-6",this.tooltip="",this.isInputFilled=!1,this.isNotEmpty=pe.IsNotEmpty}inputValueType(){return typeof this.inputValue}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["lib-info-page-input"]],inputs:{inputValue:"inputValue",labelValue:"labelValue",inputType:"inputType",labelVisible:"labelVisible",disabled:"disabled",class:"class",tooltip:"tooltip"},decls:5,vars:14,consts:[["matTooltipPosition","above",3,"ngClass","matTooltip"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"innerHTML"]],template:function(o,n){o&1&&(a(0,"div",0),m(1,ye,3,3,"p",1)(2,xe,2,3,"p",2),a(3,"label"),m(4,Ie,2,1,"ng-container",1),l()()),o&2&&(S(n.class),p("ngClass",I(9,Ce,n.disabled))("matTooltip",n.tooltip),r(),p("ngIf",n.isNotEmpty(n.inputValue)&&n.inputType=="input"),r(),p("ngIf",n.isNotEmpty(n.inputValue)&&n.inputType=="textarea"),r(),S(J(11,_e,n.isNotEmpty(n.inputValue),!n.isNotEmpty(n.inputValue))),r(),p("ngIf",n.labelVisible))},dependencies:[P,K,Q,X,ge,ce,de],styles:["div[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;margin-bottom:1rem;border-radius:.25rem!important}p[_ngcontent-%COMP%]{margin-top:18px;margin-bottom:18px;padding-left:.75rem!important;font-size:.875rem}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}.labelEmptyInput[_ngcontent-%COMP%]{margin-top:18px;margin-bottom:18px;padding-left:.75rem!important;font-size:.875rem;color:#ccc}.disabled[_ngcontent-%COMP%]{background-color:#e9ecef;opacity:1}"]})}}return t})();var Pe=t=>({ID:t});function Me(t,d){if(t&1){let e=B();a(0,"button",24),G("click",function(){N(e);let n=c(2),i=C(0);return R(n.onDeleteUser(i==null||i.selectedUser==null?null:i.selectedUser.ID))}),u(1,"i",25),s(2," Delete "),l()}}function Se(t,d){if(t&1&&(g(0),m(1,Me,3,0,"button",23),v()),t&2){let e,o=c(),n=C(0);r(),T((n==null||n.selectedUser==null?null:n.selectedUser.Name)!==((e=o.currentLoginUser())==null?null:e.username)?1:-1)}}function Te(t,d){if(t&1&&(g(0),a(1,"a",26),u(2,"i",27),s(3," Edit "),l(),v()),t&2){c();let e=C(0);r(),p("queryParams",I(1,Pe,e==null||e.selectedUser==null?null:e.selectedUser.ID))}}function Ue(t,d){t&1&&(a(0,"div",20),s(1," All channels assigned to this user "),l())}function De(t,d){if(t&1&&u(0,"p-chip",28),t&2){let e=d.$implicit;p("label",e.Name)("image",e.logo)("alt",e.Name)}}function Ee(t,d){if(t&1&&A(0,De,1,3,"p-chip",28,k),t&2){c();let e=C(0);H(e==null?null:e.selectedChannels)}}var ot=(()=>{class t{constructor(){this.userService=b(D),this.activatedRoute=b(Y),this.toastService=b(ae),this.router=b(ee),this.userLoader$=this.activatedRoute.queryParams.pipe(w(e=>{let o=e.ID||null;return this.userService.getUserFormLoader(o).pipe(V(1),M(n=>(n.Options.Channels=oe.assignChannelLogo(n.Options.Channels),n)))}),M(e=>{let o=e.Options.Users.find(f=>f.ID===e.Form?.ID),n=e.Options.Groups.find(f=>f.ID===e.Form?.GroupID),i=e.Options.Channels.filter(f=>e.UserChannels?.includes(f.ID));return O(E({},e),{selectedUser:o||null,selectedGroup:n||null,selectedChannels:i||[],DownloadOrderDaysRange:e.Form?.DownloadOrderDaysRange||"0"})})),this.userEditRole=U.UserEdit,this.userDeleteRole=U.UserDelete,this.currentLoginUser=Z(()=>{let e=localStorage.getItem(re.AUTHORIZATION);return e?JSON.parse(e):null})}onDeleteUser(e){confirm("Are you sure you want to delete this user?")&&this.userService.deleteUsers([e]).subscribe({next:()=>{this.router.navigate(["/menu/users/users"]),this.toastService.success("User deleted successfully","Success")}})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-user-info"]],features:[j([D])],decls:50,vars:12,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","group","aria-label","User Actions",1,"btn-group"],[4,"ngxPermissionsOnly"],[1,"container-fluid","py-5","bg-light-gray"],[1,"row","mt-8"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body","mt-8","pb-4"],[1,"row"],[1,"col-6"],[1,"info-label-group"],["id","myTab","role","tablist",1,"nav","nav-tabs"],["role","presentation",1,"nav-item"],["id","channel-tab","data-bs-toggle","tab","data-bs-target","#channel-tab-pane","type","button","role","tab","aria-controls","channel-tab-pane","aria-selected","true",1,"nav-link","active"],["id","restriction-tab","data-bs-toggle","tab","data-bs-target","#restriction-tab-pane","type","button","role","tab","aria-controls","restriction-tab-pane","aria-selected","false",1,"nav-link"],[1,"card","rounded-0","border-top-0"],[1,"card-body","pb-4"],["id","myTabContent",1,"tab-content"],["id","channel-tab-pane","role","tabpanel","aria-labelledby","channel-tab","tabindex","0",1,"tab-pane","fade","show","active"],[1,"text-center","fs-5","opacity-50"],["id","restriction-tab-pane","role","tabpanel","aria-labelledby","restriction-tab-pane","tabindex","1",1,"tab-pane","fade"],["tooltip","How many days of past orders this user can download.","labelValue","Download Order Days Range","inputType","input",3,"inputValue"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash","me-1"],["role","button","routerLink","/menu/users/users/form",1,"btn","btn-outline-secondary",3,"queryParams"],[1,"fa","fa-edit","me-1"],[1,"me-3","mb-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"label","image","alt"]],template:function(o,n){if(o&1&&(q(0),_(1,"async"),a(2,"mainpanel",0)(3,"actions")(4,"div",1),m(5,Se,2,1,"ng-container",2)(6,Te,4,3,"ng-container",2),l()(),a(7,"content")(8,"div",3)(9,"div",4)(10,"div",5)(11,"div",6)(12,"div",7)(13,"h3"),s(14,"User Information"),l()(),a(15,"div",8)(16,"div",9)(17,"div",10)(18,"div",11)(19,"label"),s(20,"Selected User"),l(),a(21,"div")(22,"span"),s(23),l()()()(),a(24,"div",10)(25,"div",11)(26,"label"),s(27,"Selected Group"),l(),a(28,"div")(29,"span"),s(30),l()()()()()()()()(),a(31,"div",9)(32,"div",5)(33,"ul",12)(34,"li",13)(35,"button",14),s(36," Channels Filter "),l()(),a(37,"li",13)(38,"button",15),s(39," Restriction "),l()()(),a(40,"div",16)(41,"div",17)(42,"div",18)(43,"div",19),m(44,Ue,2,0,"div",20)(45,Ee,2,0),l(),a(46,"div",21)(47,"div",9)(48,"div",10),u(49,"lib-info-page-input",22),l()()()()()()()()()()()),o&2){let i=$(y(1,9,n.userLoader$));r(2),p("headerTitle",(i==null||i.selectedUser==null?null:i.selectedUser.Name)+" Info")("hideSearchBox",!0)("hideSearchDropdown",!0),r(3),p("ngxPermissionsOnly",n.userDeleteRole),r(),p("ngxPermissionsOnly",n.userEditRole),r(17),h(i==null||i.selectedUser==null?null:i.selectedUser.Name),r(7),h(i==null||i.selectedGroup==null?null:i.selectedGroup.Name),r(14),T((i==null||i.selectedChannels==null?null:i.selectedChannels.length)===0?44:45),r(5),p("inputValue",i==null?null:i.DownloadOrderDaysRange)}},dependencies:[P,W,ue,me,ie,ne,te,fe,se,le,ve],styles:[".nav-tabs[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%]:hover, .nav-tabs[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%]:focus, .nav-tabs[_ngcontent-%COMP%] .nav-item.show[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:hover, .nav-tabs[_ngcontent-%COMP%] .nav-item.show[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:focus{background-color:#fff!important;border-color:#dee2e6 #dee2e6 #fff}"]})}}return t})();export{ot as UserInfoComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _}from"./chunk-67HPC5Y3.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.js";import{a as R}from"./chunk-ORLTYLPA.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import{a as ue,b as ye}from"./chunk-WRJFUNM3.js";import"./chunk-JVNHFIYT.js";import"./chunk-FHWKSD5A.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as he}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as d}from"./chunk-PW42BQIY.js";import{m as w,n as ge}from"./chunk-HJXYT6MI.js";import{A as fe}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.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-FXQKRJWU.js";import{$c as k,Gb as T,Gc as p,Hb as Z,Hc as j,Ic as J,Kc as y,Lc as g,Mb as h,Mc as C,Oa as V,Rc as re,Wc as oe,Yb as m,Z as Q,ac as $,ad as B,dc as H,ea as z,ec as ee,gc as te,hc as ie,ic as r,ja as q,jc as a,ka as X,kc as v,nc as ne,oa as Y,pb as G,rb as l,rd as U,tc as b,uc as u,xb as f,xc as K}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.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:[ue,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,ye,fe,ge,_,ce.forChild(Ke)]})}}return n})();export{Gt as OrderModule};
|
|
1
|
+
import{a as _}from"./chunk-67HPC5Y3.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.js";import{a as R}from"./chunk-LSSYGFVV.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import{a as ue,b as ye}from"./chunk-WRJFUNM3.js";import"./chunk-JVNHFIYT.js";import"./chunk-ACIMXBIC.js";import"./chunk-RTF4FRXW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as he}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as d}from"./chunk-RXQX7567.js";import{m as w,n as ge}from"./chunk-HJXYT6MI.js";import{A as fe}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.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-FXQKRJWU.js";import{$c as k,Gb as T,Gc as p,Hb as Z,Hc as j,Ic as J,Kc as y,Lc as g,Mb as h,Mc as C,Oa as V,Rc as re,Wc as oe,Yb as m,Z as Q,ac as $,ad as B,dc as H,ea as z,ec as ee,gc as te,hc as ie,ic as r,ja as q,jc as a,ka as X,kc as v,nc as ne,oa as Y,pb as G,rb as l,rd as U,tc as b,uc as u,xb as f,xc as K}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.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:[ue,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,ye,fe,ge,_,ce.forChild(Ke)]})}}return n})();export{Gt as OrderModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as k}from"./chunk-
|
|
1
|
+
import{i as k}from"./chunk-RTF4FRXW.js";import{a as A,b as F,d as U,e as W}from"./chunk-PYXL7UF7.js";import{A as L,a as D,h as V,m as I}from"./chunk-5PS6ZS3N.js";import{n as E}from"./chunk-FXQKRJWU.js";import{Gb as M,Gc as p,Ic as f,Kc as O,Lc as T,Mb as u,Mc as N,Oa as d,Qc as w,Yb as s,dc as y,ic as a,jc as o,kc as h,oc as x,pa as S,pb as g,rb as r,tc as C,uc as _,ya as v,za as b}from"./chunk-OJMQBH6T.js";function z(t,m){if(t&1&&(a(0,"span",3),h(1,"img",4),o(),a(2,"span"),p(3),o()),t&2){let e=m.item;r(),s("src",e==null?null:e.Img,g),r(2),f(" ",e.Name," ")}}function P(t,m){if(t&1){let e=x();a(0,"span",6),C("click",function(){v(e);let n=_(),c=n.item,l=n.clear;return b(l(c))}),p(1,"x"),o()}}function j(t,m){if(t&1&&(a(0,"span",3),h(1,"img",4),o(),a(2,"span"),p(3),o(),u(4,P,2,0,"span",5)),t&2){let e=m.item,i=_();r(),s("src",e==null?null:e.Img,g),r(2),f(" ",e.Name," "),r(),y(i.clearable()?4:-1)}}var Y=(()=>{class t{constructor(){this.authService=S(k),this.multiple=d(!1),this.clearable=d(!0),this.options=this.authService.getChannels(),this.onChange=e=>{}}onChannelChange(e){this.onChange(e)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},features:[w([{provide:D,multi:!0,useExisting:t}])],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(i,n){i&1&&(a(0,"ng-select",0),N("ngModelChange",function(l){return T(n.selectedChannels,l)||(n.selectedChannels=l),l}),C("ngModelChange",function(l){return n.onChannelChange(l)}),u(1,z,4,2,"ng-template",1)(2,j,5,3,"ng-template",2),o()),i&2&&(s("clearable",n.clearable())("items",n.options),O("ngModel",n.selectedChannels),s("multiple",n.multiple()))},dependencies:[E,W,U,A,F,L,V,I],encapsulation:2})}}return t})();export{Y as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as wt}from"./chunk-RHHHL4OR.js";import{b as vt}from"./chunk-IHSGQFDX.js";import{a as Tt}from"./chunk-HIC5QC3Y.js";import{a as mt}from"./chunk-UMP6ZMEJ.js";import{b as pt,e as dt}from"./chunk-WN5DZGA4.js";import{b as ct}from"./chunk-
|
|
1
|
+
import{a as wt}from"./chunk-RHHHL4OR.js";import{b as vt}from"./chunk-IHSGQFDX.js";import{a as Tt}from"./chunk-HIC5QC3Y.js";import{a as mt}from"./chunk-UMP6ZMEJ.js";import{b as pt,e as dt}from"./chunk-WN5DZGA4.js";import{b as ct}from"./chunk-RXQX7567.js";import{b as _t,c as Ct,h as bt,j as xt,k as Pt}from"./chunk-HJXYT6MI.js";import{A as lt,c as at,h as rt,m as st}from"./chunk-5PS6ZS3N.js";import{a as gt,c as ut}from"./chunk-ERXVXBTU.js";import{r as ht,s as ft}from"./chunk-MFQQEEHJ.js";import{g as L,i as ot,m as $,n as R}from"./chunk-FXQKRJWU.js";import{$c as I,Fc as V,G as W,Gb as S,Gc as m,Hc as w,Ic as A,Jb as Z,K as z,Ka as D,Kc as et,Lc as it,Mb as u,Mc as nt,Oa as f,Ra as C,X as J,Yb as h,Z as Y,ad as y,ca as q,cd as U,dc as P,ea as F,f as H,fa as K,g as G,ic as r,ja as M,jc as s,kc as j,lc as T,mc as v,nc as tt,oa as Q,oc as _,pa as X,rb as a,rd as N,tc as b,uc as l,v as x,xb as E,ya as d,za as g}from"./chunk-OJMQBH6T.js";function Mt(i,p){i&1&&tt(0)}function Dt(i,p){if(i&1&&(T(0),u(1,Mt,1,0,"ng-container",5),v()),i&2){l(2);let t=V(4);a(),h("ngTemplateOutlet",t)}}function Et(i,p){if(i&1&&(r(0,"div",6)(1,"label"),m(2,"Editing Data"),s(),r(3,"div")(4,"span"),m(5),I(6,"number"),s()()()),i&2){let t=l(2);a(5),w(y(6,1,t.value))}}function St(i,p){if(i&1&&(T(0),u(1,Dt,2,1,"ng-container",4)(2,Et,7,3,"ng-template",null,1,U),v()),i&2){let t=V(3),e=l();a(),h("ngIf",e.hasPriceEdit)("ngIfElse",t)}}function Vt(i,p){if(i&1){let t=_();r(0,"div",7)(1,"input",8),nt("ngModelChange",function(n){d(t);let o=l();return it(o.value,n)||(o.value=n),g(n)}),s(),r(2,"label",9),m(3),s()()}if(i&2){let t=l();a(),et("ngModel",t.value),h("max",t.maxEditInventory),a(2),w(t.item.Table)}}var te=(()=>{class i{constructor(t,e,n){this.dialogRef=t,this.item=e,this.permissionService=n,this.maxEditInventory=1e5,this.permissionService.hasPermission(mt.PriceUpdate).then(o=>this.hasPriceEdit=o)}ngOnInit(){this.selectedChannel=this.item.Variant.Channel.find(t=>t.ChannelID==this.item.ChannelID),this.selectedChannel.ID=this.item.Variant.ID,this.selectedChannel.Sku=this.item.Variant.Code,this.item.Table=="inventory"?(this.value=this.selectedChannel.Inventory,this.maxEditInventory=this.selectedChannel?.TypeID==ct.Tokopedia?1e5:null):this.item.Table=="price"&&(this.value=this.selectedChannel.Price,this.maxEditInventory=null),this.selectedChannel.ItemName=this.item.Name,this.selectedChannel.VarName=this.item.Variant.Model,this.initModalConfig()}initModalConfig(){let t=this.item.Table=="inventory"?"Update Inventory":"Update Price";this.modalConfig=new xt,this.modalConfig.title=`${t} ${this.item?.Name} in ${this.selectedChannel?.Title}`}onSubmit(){this.item.Table=="inventory"?this.selectedChannel.Inventory=this.value:this.item.Table=="price"&&(this.selectedChannel.Price=this.value),this.dialogRef.close(this.selectedChannel)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(e){return new(e||i)(E(_t),E(Ct),E(gt))}}static{this.\u0275cmp=S({type:i,selectors:[["app-table-dialog"]],decls:5,vars:4,consts:[["INVENTORY",""],["DISABLED",""],[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["matTooltipPosition","above","matTooltip","Cannot edit Unit Price because you dont have access ProductEditor role",1,"info-label-group","mt-3",2,"background","#e9ecef","opacity","1"],[1,"form-label-group","mt-3"],["type","text","name","edit","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"],["for","edit",1,"text-capitalize"]],template:function(e,n){if(e&1){let o=_();r(0,"modal-material",2),b("onClose",function(){return d(o),g(n.onClose())})("onCancel",function(){return d(o),g(n.onClose())})("onOk",function(){return d(o),g(n.onSubmit())}),r(1,"div",3),u(2,St,4,2,"ng-container",4)(3,Vt,4,3,"ng-template",null,0,U),s()()}if(e&2){let o=V(4);h("dynamicValidated",n.value)("config",n.modalConfig),a(2),h("ngIf",n.item.Table=="price")("ngIfElse",o)}},dependencies:[R,L,ot,$,bt,Tt,vt,wt,Pt,lt,at,rt,st,ut,ft,ht],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-left:1rem;margin-right:1rem}.mat-dialog-content[_ngcontent-%COMP%]{padding-left:.5rem;padding-right:.5rem;margin-left:.5rem;margin-right:.5rem}.font-lg[_ngcontent-%COMP%]{font-size:large}.font-lgr[_ngcontent-%COMP%]{font-size:larger}"]})}}return i})();var ie=(()=>{class i{transform(t,e,n=0){if(!t)return t;let o=e?parseInt(e,10):10;return t.length>o?t.substring(n,o)+"...":t}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275pipe=Z({name:"stringLimit",type:i,pure:!0})}}return i})();function Lt(i,p){if(i&1){let t=_();r(0,"span",6),b("click",function(){d(t);let n=l();return g(n.onGetRowCount())}),r(1,"i",7),m(2,"?"),s()()}}function $t(i,p){if(i&1&&(T(0),r(1,"span"),m(2),I(3,"number"),s(),v()),i&2){let t=l();a(2),w(y(3,1,t.rowCount()))}}function Rt(i,p){if(i&1){let t=_();r(0,"a",10),b("click",function(){d(t);let n=l(2);return g(n.onNextPage())}),j(1,"i",11),m(2," Next"),s()}}function Ot(i,p){if(i&1){let t=_();r(0,"a",12),b("click",function(){d(t);let n=l(2);return g(n.onLastPage())}),j(1,"i",13),m(2," Last"),s()}}function kt(i,p){if(i&1&&(r(0,"div",5),u(1,Rt,3,0,"a",8)(2,Ot,3,0,"a",9),s()),i&2){let t=l();a(),P(t.disableNextButton()&&!t.goToLastPage()?1:-1),a(),P(t.disableNextButton()&&!t.goToLastPage()?2:-1)}}var le=(()=>{class i{constructor(){this.totalData=f(0),this.rowCount=f(),this.pageNumber=f(),this.disableNextButton=f(),this.goToLastPage=f(),this.hideCount=f(),this.nextPage=new D,this.lastPage=new D,this.getRowCount=new D}onNextPage(){this.nextPage.emit()}onLastPage(){this.lastPage.emit()}onGetRowCount(){this.getRowCount.emit()}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=S({type:i,selectors:[["infinite-paginator"]],inputs:{totalData:[1,"totalData"],rowCount:[1,"rowCount"],pageNumber:[1,"pageNumber"],disableNextButton:[1,"disableNextButton"],goToLastPage:[1,"goToLastPage"],hideCount:[1,"hideCount"]},outputs:{nextPage:"onNextPage",lastPage:"onLastPage",getRowCount:"onGetRowCount"},decls:9,vars:7,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],[2,"cursor","pointer"],[4,"ngIf"],[1,"btn-group"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"div",1)(2,"div",2),m(3),I(4,"number"),u(5,Lt,3,0,"span",3)(6,$t,4,3,"ng-container",4),m(7),s()(),u(8,kt,3,2,"div",5),s()),e&2&&(a(3),A(" Showing 1 - ",y(4,5,n.totalData())," of "),a(2),P(n.hideCount()?5:-1),a(),h("ngIf",!n.hideCount()&&n.rowCount()),a(),A(" records ~ ",n.pageNumber()," Page "),a(),P(n.totalData()>0?8:-1))},dependencies:[R,L,$],encapsulation:2})}}return i})();var ue=(()=>{class i{constructor(t){this.http=t,this.pagination$=new G(null),this._pageNumber=C(1),this.pageNumber=N(()=>this._pageNumber()),this._hideCount=C(!0),this.hideCount=N(()=>this._hideCount()),this._disableNextButton=C(!0),this.disableNextButton=N(()=>this._disableNextButton()),this._goToLastPage=C(!1),this.isLastPage=N(()=>this._goToLastPage()),this.totalData=C(0),this.destroy$=new H,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this._pageNumber.set(t.PageNumber)}setPaginationButtonState(t,e){e==0?this._disableNextButton.set(!0):this._disableNextButton.set(!(e<t.RowCount*t.PageNumber))}reloadPagination(t){t.PageNumber=1,this.pagination$.next(t),this._hideCount.set(!0),this._goToLastPage.set(!1)}onLastPage(t={}){let e=JSON.parse(JSON.stringify(t));this.totalRowCount$=this.http.post(`/api/${this.fethRowCountEndpoint}`,e).pipe(x(n=>n.Total),F(n=>{this._hideCount.set(!1),e.RowCount=n,e.PageNumber=1,this.pagination$.next(e),this._goToLastPage.set(!0)}))}paginationFunction(){return this.pagination$.pipe(q(this.destroy$),W(t=>t!=null),z(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(x(e=>e.Data?e.Data:[]))),K(this.pagination$),J((t,e)=>{let[n,o]=t,[c]=e;return o.PageNumber==1?[c,o]:[n.concat(c),o]}),F(([t,e])=>{this.setPageNumberFooter(e);let n=this.calculateProductLength(t);this.totalData.set(n),this.setPaginationButtonState(e,n)}),x(([t])=>t),Y())}getRowCount(t){this._hideCount.set(!1),this.totalRowCount$=this.http.post(`/API/${this.fethRowCountEndpoint}`,t).pipe(x(e=>e.Total))}calculateProductLength(t=[]){return t.reduce((n,o)=>n+(o.Variants?.length?o.Variants?.length:0),0)}static{this.\u0275fac=function(e){return new(e||i)(Q(dt))}}static{this.\u0275prov=M({token:i,factory:i.\u0275fac})}}return i})();var be=(()=>{class i{constructor(){this.toastr=X(pt)}responseHandling(t=[],e=[],n,o=[]){let c=t.length>0,k=e.length>0;if(!k&&c&&this.toastr.success(`${this.generateSuccessMessage(t.length,o)}`,"Success",{enableHtml:!0}),k&&c){let B=`<li>${this.generateSuccessMessage(t.length)}</li>`,It=this.generateErrorMessage(n,e),yt=`<ol>${B} ${It}</ol>`;this.toastr.warning(yt,"Warning",{enableHtml:!0})}if(k&&!c){let B=`<ol>${this.generateErrorMessage(n,e)}</ol>`;this.toastr.error(B,"Error",{enableHtml:!0})}}generateSuccessMessage(t,e=[]){let n=e.length>1?e.length:1;return`
|
|
2
2
|
<div>
|
|
3
3
|
<span class="fw-bold">Successfully</span> updated ${t} variants in ${n} channels
|
|
4
4
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k}from"./chunk-PIBVGTHJ.js";import{a as be}from"./chunk-A44LN77B.js";import{a as Me}from"./chunk-PQQSREEC.js";import{a as Ve}from"./chunk-GH5FTODR.js";import{a as Te,b as De}from"./chunk-EPBVNII2.js";import{b as ke,c as Ee}from"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as Y}from"./chunk-UMP6ZMEJ.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as ue}from"./chunk-Z3ITXK3D.js";import"./chunk-CGOB6Y3X.js";import{b as Z}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{d as Ce,e as fe}from"./chunk-PYXL7UF7.js";import{c as de}from"./chunk-PW42BQIY.js";import{b as xe,c as te,d as ye,j as Se,k as ve,m as Ue,n as we}from"./chunk-HJXYT6MI.js";import{A as H,b as me,h as q,m as j}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as _e,b as ge,c as he}from"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as ce,J as pe,j as $,n as z}from"./chunk-FXQKRJWU.js";import{$b as K,$c as F,G as se,Gb as B,Gc as g,Hc as Q,Ic as D,Kb as le,Kc as U,Lc as w,Mb as f,Mc as M,Nc as O,Oc as N,Pc as h,Qc as W,Ra as S,Rc as X,Sc as ee,Yb as _,Z as E,ad as A,dc as v,ea as J,ec as V,gc as P,hc as I,ic as o,jc as s,kc as L,lc as b,mc as T,oc as y,pa as x,pb as ae,q as oe,rb as a,rd as R,tc as C,uc as l,v as G,ya as c,za as p}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as ne,b as re}from"./chunk-66YHNWRR.js";var ie=function(i){return i.ERROR="https://res.cloudinary.com/pos/image/upload/v1705387550/POS/Images/Cashier/globalerror.svg",i.UNAUTHORIZED="https://res.cloudinary.com/pos/image/upload/v1702547639/POS/Images/Dashboard/locked.svg",i.EMPTY_LIST="https://res.cloudinary.com/pos/image/upload/v1705388070/POS/Images/Cashier/globalnodata.svg",i.REMOVE="https://res.cloudinary.com/pos/image/upload/v1706156973/icons/globalerrorclear.svg",i}(ie||{});var Pe=()=>({display:"d-flex"});function Ae(i,m){if(i&1&&(o(0,"div",6),L(1,"img",9),o(2,"p",10),g(3," All users already migrated. "),s()()),i&2){let e=l();a(),_("src",e.emptyStateIcon,ae)}}function Re(i,m){if(i&1){let e=y();o(0,"div",14)(1,"p-checkBox",15),M("ngModelChange",function(t){let n=c(e).$implicit;return w(n.selected,t)||(n.selected=t),p(t)}),C("ngModelChange",function(){c(e);let t=l(2),n=h(0);return p(t.onUserCheckChange(n))}),s(),o(2,"label",16),g(3),s()()}if(i&2){let e=m.$implicit;a(),K(X(7,Pe)),_("binary",!0)("id",e.ID),U("ngModel",e.selected),a(),_("for",e.ID),a(),D(" ",e.Name," ")}}function Ge(i,m){if(i&1){let e=y();o(0,"div",11)(1,"p-checkBox",12),M("ngModelChange",function(t){c(e);let n=l();return w(n.isCheckAll,t)||(n.isCheckAll=t),p(t)}),C("ngModelChange",function(t){c(e);let n=l(),d=h(0);return p(n.onCheckAllChange(t,d))}),s(),o(2,"label",13),g(3," Check All "),s()(),P(4,Re,4,8,"div",14,V)}if(i&2){let e=l(),r=h(0);a(),K(X(4,Pe)),_("binary",!0),U("ngModel",e.isCheckAll),a(3),I(r)}}var Ie=(()=>{class i extends be{constructor(){super(),this.dialogRef=x(xe),this.data=x(te),this.userService=x(k),this.dialogData=x(te),this.toastr=x(Z),this.userGroups=R(()=>this.dialogData.userGroups||[]),this.availableUsers=R(()=>{let e=new Map;return this.dialogData.availableUsers.forEach(r=>e.set(r.ID,r)),e}),this.migrateLoader$=this.userService.getUserMigrateLoader().pipe(G(e=>e.Data),G(e=>e.filter(t=>this.availableUsers().has(t.ID)===!1)),G(e=>e.map(t=>(t.selected=!0,t))),E(1)),this.isCheckAll=S(!0),this.selectedGroup=S(null),this.emptyStateIcon=ie.EMPTY_LIST,this.config=new Se,this.config.title="Migrate Users",this.config.customWidth="600px"}ngAfterViewInit(){this.initTopPosition()}ngOnDestroy(){this.stopOverlayObserver()}onUserCheckChange(e){let r=e.every(t=>t.selected);this.isCheckAll.set(r)}onCheckAllChange(e,r){this.isCheckAll.set(e),r.forEach(t=>t.selected=e)}onClose(){this.dialogRef.close(!1)}onSubmit(e){let r=e.filter(n=>n.selected);if(r.length===0){this.toastr.error("Please select at least one user","Error");return}if(de.IsEmpty(this.selectedGroup())){this.toastr.error("Please select a user group","Error");return}let t={userIds:r.map(n=>n.ID),groupId:this.selectedGroup()};this.userService.migrateUser(t).subscribe(()=>{this.dialogRef.close(!0),this.toastr.success("Users migrated successfully","Success")})}onClickSelect(){setTimeout(()=>{this.adjustOverlayPosition()},0)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-migrate-dialog"]],features:[W([k]),le],decls:15,vars:8,consts:[[3,"onClose","onCancel","onOk","config"],["content",""],[1,"row"],[1,"col","border-end"],[1,"modal-title","mb-8"],[1,"user-list-scroll","mt-5",2,"max-height","300x","overflow-y","auto","overflow-x","hidden","box-sizing","border-box"],[1,"d-flex","flex-column","align-items-center","mt-5"],[1,"col"],["optionLabel","Name","optionValue","ID","placeholder","Select a group","filterBy","Name","appendTo","body",1,"w-100",3,"click","ngModelChange","options","filter","ngModel"],["alt","No users found",2,"width","100px","height","100px",3,"src"],[1,"text-muted","mt-4","opacity-50",2,"margin-bottom","0px"],[1,"d-flex","w-100","align-items-center","mb-4"],["id","checkBoxAll",3,"ngModelChange","binary","ngModel"],["for","checkBoxAll",1,"ms-2"],[1,"d-flex","w-100","align-items-center","mb-3","ms-10"],[3,"ngModelChange","binary","id","ngModel"],[1,"ms-2",3,"for"]],template:function(r,t){if(r&1){let n=y();O(0),F(1,"async"),o(2,"modal-material",0),C("onClose",function(){return c(n),p(t.onClose())})("onCancel",function(){return c(n),p(t.onClose())})("onOk",function(){c(n);let u=h(0);return p(t.onSubmit(u))}),o(3,"div",1)(4,"div",2)(5,"div",3)(6,"h5",4),g(7,"Users from POS"),s(),o(8,"div",5),f(9,Ae,4,1,"div",6)(10,Ge,6,5),s()(),o(11,"div",7)(12,"h5",4),g(13,"Assign Group"),s(),o(14,"p-select",8),C("click",function(){return c(n),p(t.onClickSelect())}),M("ngModelChange",function(u){return c(n),w(t.selectedGroup,u)||(t.selectedGroup=u),p(u)}),s()()()()()}if(r&2){let n=N(A(1,5,t.migrateLoader$));a(2),_("config",t.config),a(7),v((n==null?null:n.length)===0?9:10),a(5),_("options",t.userGroups())("filter",!0),U("ngModel",t.selectedGroup)}},dependencies:[z,$,ve,H,q,j,ke,Me],styles:[".user-list-scroll[_ngcontent-%COMP%]{max-height:160px;overflow-y:auto;overflow-x:hidden;box-sizing:border-box}"]})}}return i})();var Le=i=>({ID:i});function Be(i,m){if(i&1){let e=y();o(0,"button",13),C("click",function(){c(e);let t=l(2),n=h(0);return p(t.onDeleteUser(n==null?null:n.Filter))}),L(1,"i",14),g(2),s()}if(i&2){let e,r=l(2);a(2),D(" Delete (",(e=r.selectedUsers())==null?null:e.length,") ")}}function We(i,m){if(i&1&&(b(0),f(1,Be,3,1,"button",12),T()),i&2){let e,r=l();a(),v(((e=r.selectedUsers())==null?null:e.length)>0?1:-1)}}function $e(i,m){if(i&1){let e=y();b(0),o(1,"button",15),C("click",function(){c(e);let t=l(),n=h(0),d=h(2);return p(t.onMigrateUser(n==null||n.Options==null?null:n.Options.Groups,d==null?null:d.Data))}),g(2," Migrate "),s(),T()}}function ze(i,m){i&1&&(b(0),o(1,"a",16),g(2," Invite "),s(),T())}function qe(i,m){if(i&1){let e=y();b(0),o(1,"th",17)(2,"div",18)(3,"input",19),C("change",function(t){c(e);let n=l(),d=h(2);return p(n.onCheckAllUser(t.target.checked,d==null?null:d.Data))}),s()()(),T()}}function je(i,m){if(i&1){let e=y();o(0,"div",18)(1,"input",23),M("ngModelChange",function(t){c(e);let n=l(2).$implicit;return w(n.checked,t)||(n.checked=t),p(t)}),C("ngModelChange",function(){c(e);let t=l(3),n=h(2);return p(t.onSelectUser(n==null?null:n.Data))}),s()()}if(i&2){let e=l(2).$implicit;a(),U("ngModel",e.checked)}}function He(i,m){if(i&1&&(b(0),o(1,"td"),f(2,je,2,1,"div",18),s(),T()),i&2){let e,r=l().$implicit,t=l();a(2),v(r.Name!==((e=t.currentLoginUser())==null?null:e.username)?2:-1)}}function Ye(i,m){if(i&1&&(o(0,"a",20),g(1),s()),i&2){let e=l().$implicit;_("queryParams",ee(2,Le,e.UserID)),a(),D(" ",e.Name," ")}}function Ze(i,m){if(i&1&&(o(0,"span"),g(1),s()),i&2){let e=l().$implicit;a(),Q(e.Name)}}function Je(i,m){if(i&1&&(o(0,"a",21),g(1),s()),i&2){let e=l().$implicit;_("queryParams",ee(2,Le,e.GroupID)),a(),D(" ",e.GroupName," ")}}function Ke(i,m){if(i&1&&(o(0,"span"),g(1),s()),i&2){let e=l().$implicit;a(),Q(e.GroupName)}}function Qe(i,m){if(i&1&&L(0,"p-chip",24),i&2){let e=m.$implicit;_("label",e.Name)("image",e.Logo)("alt",e.Name)}}function Xe(i,m){if(i&1&&P(0,Qe,1,3,"p-chip",24,V),i&2){let e=l().$implicit;I(e.Channels)}}function et(i,m){i&1&&(o(0,"span"),g(1,"All Channels"),s())}function tt(i,m){if(i&1&&(o(0,"tr"),f(1,He,3,1,"ng-container",3),o(2,"td"),f(3,Ye,2,4,"a",20)(4,Ze,2,1,"span"),s(),o(5,"td"),f(6,Je,2,4,"a",21)(7,Ke,2,1,"span"),s(),o(8,"td")(9,"div",22),f(10,Xe,2,0)(11,et,2,0,"span"),s()()()),i&2){let e=m.$implicit,r=l();a(),_("ngxPermissionsOnly",r.userDeleteRole),a(2),v(r.hasUserEditRole()?3:4),a(3),v(r.hasUserEditRole()?6:7),a(4),v((e.Channels==null?null:e.Channels.length)>0?10:11)}}function it(i,m){if(i&1){let e=y();o(0,"app-mat-paginator-no-count",25),C("next",function(){c(e);let t=l(),n=h(0);return p(t.onNextPage(n==null?null:n.Filter))})("previous",function(){c(e);let t=l(),n=h(0);return p(t.onPrevPage(n==null?null:n.Filter))}),s()}if(i&2){l();let e=h(0),r=h(2);_("filter",e==null?null:e.Filter)("totaldata",r==null||r.Data==null?null:r.Data.length)("paginationTotal",r==null?null:r.Count)("hasClicked",!0)("alwaysShowNextButton",!0)}}var zt=(()=>{class i{constructor(){this.usersService=x(k),this.permissionService=x(_e),this.toastService=x(Z),this.dialog=x(ye),this.userInviteOptions=S([]),this.searchText=S(null),this.selectedGroup=S(null),this.userLoader$=this.usersService.getLoader().pipe(J(e=>{this.userInviteOptions.set(e.Options.Users),this.initUsers(e.Filter)}),E(1)),this.users$=oe({Count:0,Data:[]}),this.userAddRole=Y.UserInvite,this.userDeleteRole=Y.UserDelete,this.hasUserEditRole=S(!1),this.selectedUsers=S([]),this.currentLoginUser=R(()=>{let e=localStorage.getItem(ue.AUTHORIZATION);return e?JSON.parse(e):null}),this.permissionService.hasPermission(Y.UserEdit).then(e=>{this.hasUserEditRole.set(e)})}initUsers(e){let r=re(ne({},e),{Name:this.searchText(),GroupID:this.selectedGroup()});this.users$=this.usersService.getUsers(r).pipe(J(t=>this.filterUserInvtiteOptions(t.Data)),E(1))}filterUserInvtiteOptions(e){this.userInviteOptions.update(r=>r.filter(t=>e.findIndex(n=>n.UserID===t.ID)===-1))}onCheckAllUser(e,r){r.forEach(n=>{n.Name!==this.currentLoginUser()?.username&&(n.checked=e)});let t=r.filter(n=>n.checked);this.selectedUsers.set(t)}onSelectUser(e){let r=e.filter(t=>t.checked);this.selectedUsers.set(r)}onDeleteUser(e={PageNumber:1,PageSize:10}){let r=this.selectedUsers().map(n=>n.UserID);confirm("Are you sure you want to delete selected users?")&&this.usersService.deleteUsers(r).subscribe(()=>{this.selectedUsers.set([]),this.toastService.success("User deleted successfully","Success"),this.initUsers(e)})}onMigrateUser(e,r){this.dialog.open(Ie,{data:{userGroups:e,availableUsers:r}}).afterClosed().pipe(se(t=>t===!0)).subscribe(()=>{this.initUsers({PageNumber:1,PageSize:10})})}onNextPage(e){e.PageNumber+=1,this.initUsers(e)}onPrevPage(e){e.PageNumber-=1,this.initUsers(e)}onSuccessUpdateUser(e){e.PageNumber=1,this.initUsers(e)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-users"]],features:[W([k])],decls:33,vars:17,consts:[["headerTitle","Users","description","Manage your users and their permissions",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","ID","placeholder","Select Group",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[4,"ngxPermissionsOnly"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","15%"],[3,"filter","totaldata","paginationTotal","hasClicked","alwaysShowNextButton"],[3,"onSuccessUpdateUser","groups","users"],[1,"btn","btn-danger","me-3"],[1,"btn","btn-danger","me-3",3,"click"],[1,"fa","fa-trash","me-1"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["role","button","routerLink","/menu/users/users/form",1,"btn","btn-success"],[2,"width","5px"],[1,"d-flex"],["name","selectAll","type","checkbox",3,"change"],["routerLink","/menu/users/users/info",3,"queryParams"],["routerLink","/menu/users/groups/info",3,"queryParams"],[1,"lh-base"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"me-3","mb-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"label","image","alt"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","alwaysShowNextButton"]],template:function(r,t){if(r&1){let n=y();O(0),F(1,"async"),O(2),F(3,"async"),o(4,"mainpanel",0),M("textChange",function(u){return c(n),w(t.searchText,u)||(t.searchText=u),p(u)}),C("onSubmit",function(){c(n);let u=h(0);return p(t.initUsers(u==null?null:u.Filter))}),o(5,"filters")(6,"div")(7,"label",1),g(8,"Group"),s(),o(9,"ng-select",2),M("ngModelChange",function(u){return c(n),w(t.selectedGroup,u)||(t.selectedGroup=u),p(u)}),s()()(),o(10,"actions"),f(11,We,2,1,"ng-container",3)(12,$e,3,0,"ng-container",3)(13,ze,3,0,"ng-container",3),s(),o(14,"content")(15,"div",4)(16,"div",5)(17,"div",6)(18,"table",7)(19,"thead",8)(20,"tr"),f(21,qe,4,0,"ng-container",3),o(22,"th",9),g(23,"Login ID"),s(),o(24,"th",9),g(25,"Group"),s(),o(26,"th"),g(27,"Channel"),s()()(),o(28,"tbody"),P(29,tt,12,4,"tr",null,V),s()(),f(31,it,1,5,"app-mat-paginator-no-count",10),s()()()()(),o(32,"invite-group",11),C("onSuccessUpdateUser",function(){c(n);let u=h(0);return p(t.onSuccessUpdateUser(u==null?null:u.Filter))}),s()}if(r&2){let n=N(A(1,11,t.userLoader$));a(2);let d=N(A(3,14,t.users$));a(2),U("text",t.searchText),a(5),_("clearable",!0)("items",n==null||n.Options==null?null:n.Options.Groups),U("ngModel",t.selectedGroup),a(2),_("ngxPermissionsOnly",t.userDeleteRole),a(),_("ngxPermissionsOnly",t.userAddRole),a(),_("ngxPermissionsOnly",t.userAddRole),a(8),_("ngxPermissionsOnly",t.userDeleteRole),a(8),I(d==null?null:d.Data),a(2),v(n?31:-1),a(),_("groups",n==null||n.Options==null?null:n.Options.Groups)("users",t.userInviteOptions())}},dependencies:[z,$,we,Ue,pe,ce,Ve,he,ge,fe,Ce,H,me,q,j,Ee,De,Te],encapsulation:2})}}return i})();export{zt as UsersComponent};
|
|
1
|
+
import{a as k}from"./chunk-PIBVGTHJ.js";import{a as be}from"./chunk-A44LN77B.js";import{a as Me}from"./chunk-PQQSREEC.js";import{a as Ve}from"./chunk-GH5FTODR.js";import{a as Te,b as De}from"./chunk-EPBVNII2.js";import{b as ke,c as Ee}from"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as Y}from"./chunk-UMP6ZMEJ.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as ue}from"./chunk-Z3ITXK3D.js";import"./chunk-CGOB6Y3X.js";import{b as Z}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{d as Ce,e as fe}from"./chunk-PYXL7UF7.js";import{c as de}from"./chunk-RXQX7567.js";import{b as xe,c as te,d as ye,j as Se,k as ve,m as Ue,n as we}from"./chunk-HJXYT6MI.js";import{A as H,b as me,h as q,m as j}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as _e,b as ge,c as he}from"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as ce,J as pe,j as $,n as z}from"./chunk-FXQKRJWU.js";import{$b as K,$c as F,G as se,Gb as B,Gc as g,Hc as Q,Ic as D,Kb as le,Kc as U,Lc as w,Mb as f,Mc as M,Nc as O,Oc as N,Pc as h,Qc as W,Ra as S,Rc as X,Sc as ee,Yb as _,Z as E,ad as A,dc as v,ea as J,ec as V,gc as P,hc as I,ic as o,jc as s,kc as L,lc as b,mc as T,oc as y,pa as x,pb as ae,q as oe,rb as a,rd as R,tc as C,uc as l,v as G,ya as c,za as p}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as ne,b as re}from"./chunk-66YHNWRR.js";var ie=function(i){return i.ERROR="https://res.cloudinary.com/pos/image/upload/v1705387550/POS/Images/Cashier/globalerror.svg",i.UNAUTHORIZED="https://res.cloudinary.com/pos/image/upload/v1702547639/POS/Images/Dashboard/locked.svg",i.EMPTY_LIST="https://res.cloudinary.com/pos/image/upload/v1705388070/POS/Images/Cashier/globalnodata.svg",i.REMOVE="https://res.cloudinary.com/pos/image/upload/v1706156973/icons/globalerrorclear.svg",i}(ie||{});var Pe=()=>({display:"d-flex"});function Ae(i,m){if(i&1&&(o(0,"div",6),L(1,"img",9),o(2,"p",10),g(3," All users already migrated. "),s()()),i&2){let e=l();a(),_("src",e.emptyStateIcon,ae)}}function Re(i,m){if(i&1){let e=y();o(0,"div",14)(1,"p-checkBox",15),M("ngModelChange",function(t){let n=c(e).$implicit;return w(n.selected,t)||(n.selected=t),p(t)}),C("ngModelChange",function(){c(e);let t=l(2),n=h(0);return p(t.onUserCheckChange(n))}),s(),o(2,"label",16),g(3),s()()}if(i&2){let e=m.$implicit;a(),K(X(7,Pe)),_("binary",!0)("id",e.ID),U("ngModel",e.selected),a(),_("for",e.ID),a(),D(" ",e.Name," ")}}function Ge(i,m){if(i&1){let e=y();o(0,"div",11)(1,"p-checkBox",12),M("ngModelChange",function(t){c(e);let n=l();return w(n.isCheckAll,t)||(n.isCheckAll=t),p(t)}),C("ngModelChange",function(t){c(e);let n=l(),d=h(0);return p(n.onCheckAllChange(t,d))}),s(),o(2,"label",13),g(3," Check All "),s()(),P(4,Re,4,8,"div",14,V)}if(i&2){let e=l(),r=h(0);a(),K(X(4,Pe)),_("binary",!0),U("ngModel",e.isCheckAll),a(3),I(r)}}var Ie=(()=>{class i extends be{constructor(){super(),this.dialogRef=x(xe),this.data=x(te),this.userService=x(k),this.dialogData=x(te),this.toastr=x(Z),this.userGroups=R(()=>this.dialogData.userGroups||[]),this.availableUsers=R(()=>{let e=new Map;return this.dialogData.availableUsers.forEach(r=>e.set(r.ID,r)),e}),this.migrateLoader$=this.userService.getUserMigrateLoader().pipe(G(e=>e.Data),G(e=>e.filter(t=>this.availableUsers().has(t.ID)===!1)),G(e=>e.map(t=>(t.selected=!0,t))),E(1)),this.isCheckAll=S(!0),this.selectedGroup=S(null),this.emptyStateIcon=ie.EMPTY_LIST,this.config=new Se,this.config.title="Migrate Users",this.config.customWidth="600px"}ngAfterViewInit(){this.initTopPosition()}ngOnDestroy(){this.stopOverlayObserver()}onUserCheckChange(e){let r=e.every(t=>t.selected);this.isCheckAll.set(r)}onCheckAllChange(e,r){this.isCheckAll.set(e),r.forEach(t=>t.selected=e)}onClose(){this.dialogRef.close(!1)}onSubmit(e){let r=e.filter(n=>n.selected);if(r.length===0){this.toastr.error("Please select at least one user","Error");return}if(de.IsEmpty(this.selectedGroup())){this.toastr.error("Please select a user group","Error");return}let t={userIds:r.map(n=>n.ID),groupId:this.selectedGroup()};this.userService.migrateUser(t).subscribe(()=>{this.dialogRef.close(!0),this.toastr.success("Users migrated successfully","Success")})}onClickSelect(){setTimeout(()=>{this.adjustOverlayPosition()},0)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-migrate-dialog"]],features:[W([k]),le],decls:15,vars:8,consts:[[3,"onClose","onCancel","onOk","config"],["content",""],[1,"row"],[1,"col","border-end"],[1,"modal-title","mb-8"],[1,"user-list-scroll","mt-5",2,"max-height","300x","overflow-y","auto","overflow-x","hidden","box-sizing","border-box"],[1,"d-flex","flex-column","align-items-center","mt-5"],[1,"col"],["optionLabel","Name","optionValue","ID","placeholder","Select a group","filterBy","Name","appendTo","body",1,"w-100",3,"click","ngModelChange","options","filter","ngModel"],["alt","No users found",2,"width","100px","height","100px",3,"src"],[1,"text-muted","mt-4","opacity-50",2,"margin-bottom","0px"],[1,"d-flex","w-100","align-items-center","mb-4"],["id","checkBoxAll",3,"ngModelChange","binary","ngModel"],["for","checkBoxAll",1,"ms-2"],[1,"d-flex","w-100","align-items-center","mb-3","ms-10"],[3,"ngModelChange","binary","id","ngModel"],[1,"ms-2",3,"for"]],template:function(r,t){if(r&1){let n=y();O(0),F(1,"async"),o(2,"modal-material",0),C("onClose",function(){return c(n),p(t.onClose())})("onCancel",function(){return c(n),p(t.onClose())})("onOk",function(){c(n);let u=h(0);return p(t.onSubmit(u))}),o(3,"div",1)(4,"div",2)(5,"div",3)(6,"h5",4),g(7,"Users from POS"),s(),o(8,"div",5),f(9,Ae,4,1,"div",6)(10,Ge,6,5),s()(),o(11,"div",7)(12,"h5",4),g(13,"Assign Group"),s(),o(14,"p-select",8),C("click",function(){return c(n),p(t.onClickSelect())}),M("ngModelChange",function(u){return c(n),w(t.selectedGroup,u)||(t.selectedGroup=u),p(u)}),s()()()()()}if(r&2){let n=N(A(1,5,t.migrateLoader$));a(2),_("config",t.config),a(7),v((n==null?null:n.length)===0?9:10),a(5),_("options",t.userGroups())("filter",!0),U("ngModel",t.selectedGroup)}},dependencies:[z,$,ve,H,q,j,ke,Me],styles:[".user-list-scroll[_ngcontent-%COMP%]{max-height:160px;overflow-y:auto;overflow-x:hidden;box-sizing:border-box}"]})}}return i})();var Le=i=>({ID:i});function Be(i,m){if(i&1){let e=y();o(0,"button",13),C("click",function(){c(e);let t=l(2),n=h(0);return p(t.onDeleteUser(n==null?null:n.Filter))}),L(1,"i",14),g(2),s()}if(i&2){let e,r=l(2);a(2),D(" Delete (",(e=r.selectedUsers())==null?null:e.length,") ")}}function We(i,m){if(i&1&&(b(0),f(1,Be,3,1,"button",12),T()),i&2){let e,r=l();a(),v(((e=r.selectedUsers())==null?null:e.length)>0?1:-1)}}function $e(i,m){if(i&1){let e=y();b(0),o(1,"button",15),C("click",function(){c(e);let t=l(),n=h(0),d=h(2);return p(t.onMigrateUser(n==null||n.Options==null?null:n.Options.Groups,d==null?null:d.Data))}),g(2," Migrate "),s(),T()}}function ze(i,m){i&1&&(b(0),o(1,"a",16),g(2," Invite "),s(),T())}function qe(i,m){if(i&1){let e=y();b(0),o(1,"th",17)(2,"div",18)(3,"input",19),C("change",function(t){c(e);let n=l(),d=h(2);return p(n.onCheckAllUser(t.target.checked,d==null?null:d.Data))}),s()()(),T()}}function je(i,m){if(i&1){let e=y();o(0,"div",18)(1,"input",23),M("ngModelChange",function(t){c(e);let n=l(2).$implicit;return w(n.checked,t)||(n.checked=t),p(t)}),C("ngModelChange",function(){c(e);let t=l(3),n=h(2);return p(t.onSelectUser(n==null?null:n.Data))}),s()()}if(i&2){let e=l(2).$implicit;a(),U("ngModel",e.checked)}}function He(i,m){if(i&1&&(b(0),o(1,"td"),f(2,je,2,1,"div",18),s(),T()),i&2){let e,r=l().$implicit,t=l();a(2),v(r.Name!==((e=t.currentLoginUser())==null?null:e.username)?2:-1)}}function Ye(i,m){if(i&1&&(o(0,"a",20),g(1),s()),i&2){let e=l().$implicit;_("queryParams",ee(2,Le,e.UserID)),a(),D(" ",e.Name," ")}}function Ze(i,m){if(i&1&&(o(0,"span"),g(1),s()),i&2){let e=l().$implicit;a(),Q(e.Name)}}function Je(i,m){if(i&1&&(o(0,"a",21),g(1),s()),i&2){let e=l().$implicit;_("queryParams",ee(2,Le,e.GroupID)),a(),D(" ",e.GroupName," ")}}function Ke(i,m){if(i&1&&(o(0,"span"),g(1),s()),i&2){let e=l().$implicit;a(),Q(e.GroupName)}}function Qe(i,m){if(i&1&&L(0,"p-chip",24),i&2){let e=m.$implicit;_("label",e.Name)("image",e.Logo)("alt",e.Name)}}function Xe(i,m){if(i&1&&P(0,Qe,1,3,"p-chip",24,V),i&2){let e=l().$implicit;I(e.Channels)}}function et(i,m){i&1&&(o(0,"span"),g(1,"All Channels"),s())}function tt(i,m){if(i&1&&(o(0,"tr"),f(1,He,3,1,"ng-container",3),o(2,"td"),f(3,Ye,2,4,"a",20)(4,Ze,2,1,"span"),s(),o(5,"td"),f(6,Je,2,4,"a",21)(7,Ke,2,1,"span"),s(),o(8,"td")(9,"div",22),f(10,Xe,2,0)(11,et,2,0,"span"),s()()()),i&2){let e=m.$implicit,r=l();a(),_("ngxPermissionsOnly",r.userDeleteRole),a(2),v(r.hasUserEditRole()?3:4),a(3),v(r.hasUserEditRole()?6:7),a(4),v((e.Channels==null?null:e.Channels.length)>0?10:11)}}function it(i,m){if(i&1){let e=y();o(0,"app-mat-paginator-no-count",25),C("next",function(){c(e);let t=l(),n=h(0);return p(t.onNextPage(n==null?null:n.Filter))})("previous",function(){c(e);let t=l(),n=h(0);return p(t.onPrevPage(n==null?null:n.Filter))}),s()}if(i&2){l();let e=h(0),r=h(2);_("filter",e==null?null:e.Filter)("totaldata",r==null||r.Data==null?null:r.Data.length)("paginationTotal",r==null?null:r.Count)("hasClicked",!0)("alwaysShowNextButton",!0)}}var zt=(()=>{class i{constructor(){this.usersService=x(k),this.permissionService=x(_e),this.toastService=x(Z),this.dialog=x(ye),this.userInviteOptions=S([]),this.searchText=S(null),this.selectedGroup=S(null),this.userLoader$=this.usersService.getLoader().pipe(J(e=>{this.userInviteOptions.set(e.Options.Users),this.initUsers(e.Filter)}),E(1)),this.users$=oe({Count:0,Data:[]}),this.userAddRole=Y.UserInvite,this.userDeleteRole=Y.UserDelete,this.hasUserEditRole=S(!1),this.selectedUsers=S([]),this.currentLoginUser=R(()=>{let e=localStorage.getItem(ue.AUTHORIZATION);return e?JSON.parse(e):null}),this.permissionService.hasPermission(Y.UserEdit).then(e=>{this.hasUserEditRole.set(e)})}initUsers(e){let r=re(ne({},e),{Name:this.searchText(),GroupID:this.selectedGroup()});this.users$=this.usersService.getUsers(r).pipe(J(t=>this.filterUserInvtiteOptions(t.Data)),E(1))}filterUserInvtiteOptions(e){this.userInviteOptions.update(r=>r.filter(t=>e.findIndex(n=>n.UserID===t.ID)===-1))}onCheckAllUser(e,r){r.forEach(n=>{n.Name!==this.currentLoginUser()?.username&&(n.checked=e)});let t=r.filter(n=>n.checked);this.selectedUsers.set(t)}onSelectUser(e){let r=e.filter(t=>t.checked);this.selectedUsers.set(r)}onDeleteUser(e={PageNumber:1,PageSize:10}){let r=this.selectedUsers().map(n=>n.UserID);confirm("Are you sure you want to delete selected users?")&&this.usersService.deleteUsers(r).subscribe(()=>{this.selectedUsers.set([]),this.toastService.success("User deleted successfully","Success"),this.initUsers(e)})}onMigrateUser(e,r){this.dialog.open(Ie,{data:{userGroups:e,availableUsers:r}}).afterClosed().pipe(se(t=>t===!0)).subscribe(()=>{this.initUsers({PageNumber:1,PageSize:10})})}onNextPage(e){e.PageNumber+=1,this.initUsers(e)}onPrevPage(e){e.PageNumber-=1,this.initUsers(e)}onSuccessUpdateUser(e){e.PageNumber=1,this.initUsers(e)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-users"]],features:[W([k])],decls:33,vars:17,consts:[["headerTitle","Users","description","Manage your users and their permissions",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","ID","placeholder","Select Group",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[4,"ngxPermissionsOnly"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","15%"],[3,"filter","totaldata","paginationTotal","hasClicked","alwaysShowNextButton"],[3,"onSuccessUpdateUser","groups","users"],[1,"btn","btn-danger","me-3"],[1,"btn","btn-danger","me-3",3,"click"],[1,"fa","fa-trash","me-1"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["role","button","routerLink","/menu/users/users/form",1,"btn","btn-success"],[2,"width","5px"],[1,"d-flex"],["name","selectAll","type","checkbox",3,"change"],["routerLink","/menu/users/users/info",3,"queryParams"],["routerLink","/menu/users/groups/info",3,"queryParams"],[1,"lh-base"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"me-3","mb-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"label","image","alt"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","alwaysShowNextButton"]],template:function(r,t){if(r&1){let n=y();O(0),F(1,"async"),O(2),F(3,"async"),o(4,"mainpanel",0),M("textChange",function(u){return c(n),w(t.searchText,u)||(t.searchText=u),p(u)}),C("onSubmit",function(){c(n);let u=h(0);return p(t.initUsers(u==null?null:u.Filter))}),o(5,"filters")(6,"div")(7,"label",1),g(8,"Group"),s(),o(9,"ng-select",2),M("ngModelChange",function(u){return c(n),w(t.selectedGroup,u)||(t.selectedGroup=u),p(u)}),s()()(),o(10,"actions"),f(11,We,2,1,"ng-container",3)(12,$e,3,0,"ng-container",3)(13,ze,3,0,"ng-container",3),s(),o(14,"content")(15,"div",4)(16,"div",5)(17,"div",6)(18,"table",7)(19,"thead",8)(20,"tr"),f(21,qe,4,0,"ng-container",3),o(22,"th",9),g(23,"Login ID"),s(),o(24,"th",9),g(25,"Group"),s(),o(26,"th"),g(27,"Channel"),s()()(),o(28,"tbody"),P(29,tt,12,4,"tr",null,V),s()(),f(31,it,1,5,"app-mat-paginator-no-count",10),s()()()()(),o(32,"invite-group",11),C("onSuccessUpdateUser",function(){c(n);let u=h(0);return p(t.onSuccessUpdateUser(u==null?null:u.Filter))}),s()}if(r&2){let n=N(A(1,11,t.userLoader$));a(2);let d=N(A(3,14,t.users$));a(2),U("text",t.searchText),a(5),_("clearable",!0)("items",n==null||n.Options==null?null:n.Options.Groups),U("ngModel",t.selectedGroup),a(2),_("ngxPermissionsOnly",t.userDeleteRole),a(),_("ngxPermissionsOnly",t.userAddRole),a(),_("ngxPermissionsOnly",t.userAddRole),a(8),_("ngxPermissionsOnly",t.userDeleteRole),a(8),I(d==null?null:d.Data),a(2),v(n?31:-1),a(),_("groups",n==null||n.Options==null?null:n.Options.Groups)("users",t.userInviteOptions())}},dependencies:[z,$,we,Ue,pe,ce,Ve,he,ge,fe,Ce,H,me,q,j,Ee,De,Te],encapsulation:2})}}return i})();export{zt as UsersComponent};
|