marketplacepos 3.10.0 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/Marketplace/{chunk-P3IVG6BD.js → chunk-23SBJKPP.js} +1 -1
  2. package/Marketplace/{chunk-WCQU2HIE.js → chunk-2RIYYO3I.js} +2 -2
  3. package/Marketplace/{chunk-SQR4ZRTF.js → chunk-36GAH775.js} +1 -1
  4. package/Marketplace/{chunk-3KM6M3SV.js → chunk-3CF7HOB3.js} +1 -1
  5. package/Marketplace/{chunk-TBOHCD6E.js → chunk-52UFYFEM.js} +1 -1
  6. package/Marketplace/{chunk-RUB4SQ54.js → chunk-5PIRWI5F.js} +1 -1
  7. package/Marketplace/{chunk-ECAAF5I6.js → chunk-6GF6XSWZ.js} +1 -1
  8. package/Marketplace/{chunk-4HJGWXQ3.js → chunk-7NZIFRTH.js} +1 -1
  9. package/Marketplace/{chunk-I5POPG3M.js → chunk-A2WAKRJC.js} +1 -1
  10. package/Marketplace/{chunk-YILL4GKX.js → chunk-BFNB4J5W.js} +1 -1
  11. package/Marketplace/{chunk-UW4B35JC.js → chunk-BJBDPG47.js} +1 -1
  12. package/Marketplace/{chunk-NN3SPEH5.js → chunk-C3TFPYXX.js} +1 -1
  13. package/Marketplace/{chunk-XDU5GZAR.js → chunk-C7TRF3SY.js} +2 -2
  14. package/Marketplace/{chunk-6NPWPFG3.js → chunk-CNCAKULD.js} +1 -1
  15. package/Marketplace/{chunk-4PF4YRRT.js → chunk-CNKB33H4.js} +1 -1
  16. package/Marketplace/{chunk-FBXFQ4G2.js → chunk-DHJDNOMM.js} +9 -9
  17. package/Marketplace/{chunk-ORA63EP5.js → chunk-F2X2FB6J.js} +1 -1
  18. package/Marketplace/{chunk-OV2NRCQ5.js → chunk-F5ZJBCUU.js} +1 -1
  19. package/Marketplace/{chunk-POSHHHMT.js → chunk-F7TBBOWO.js} +1 -1
  20. package/Marketplace/{chunk-SHX3JAGT.js → chunk-FTHNPPXM.js} +1 -1
  21. package/Marketplace/{chunk-KB7PR6DP.js → chunk-GR67GFTL.js} +1 -1
  22. package/Marketplace/{chunk-6D7NMKRE.js → chunk-GTSE6GZT.js} +1 -1
  23. package/Marketplace/{chunk-WOHUGR5B.js → chunk-H57B7P7N.js} +1 -1
  24. package/Marketplace/{chunk-7MM3ONJ5.js → chunk-IWREFJGX.js} +1 -1
  25. package/Marketplace/{chunk-ZMC2DAP2.js → chunk-JJLMXJYI.js} +1 -1
  26. package/Marketplace/{chunk-O3IHPLVP.js → chunk-JJPZKFSE.js} +1 -1
  27. package/Marketplace/{chunk-L7Q6GF26.js → chunk-JUI6EOAN.js} +1 -1
  28. package/Marketplace/{chunk-XLZ3ZJTK.js → chunk-L35RXBHK.js} +1 -1
  29. package/Marketplace/{chunk-ULR2QT4D.js → chunk-LDGVYQDZ.js} +1 -1
  30. package/Marketplace/{chunk-32LBRSCJ.js → chunk-LDMABSVE.js} +1 -1
  31. package/Marketplace/chunk-LKQ6EHTZ.js +1 -0
  32. package/Marketplace/{chunk-VCLTTDX7.js → chunk-MWO3MHRT.js} +1 -1
  33. package/Marketplace/{chunk-HT7RDS3I.js → chunk-NIH5QHYK.js} +1 -1
  34. package/Marketplace/{chunk-LAEELPPC.js → chunk-ODAO6UI4.js} +1 -1
  35. package/Marketplace/{chunk-BLMEJMMZ.js → chunk-ODJ4UZGV.js} +1 -1
  36. package/Marketplace/{chunk-2WK2VI24.js → chunk-OIUZMXWP.js} +1 -1
  37. package/Marketplace/{chunk-JYZZ37SG.js → chunk-OIV2KTCZ.js} +1 -1
  38. package/Marketplace/{chunk-3SVOLAII.js → chunk-OM4EEQPS.js} +1 -1
  39. package/Marketplace/{chunk-FA44W5LU.js → chunk-P24WVMWI.js} +1 -1
  40. package/Marketplace/{chunk-PZX3AESM.js → chunk-PLNXC7LP.js} +1 -1
  41. package/Marketplace/{chunk-SOPDRQWM.js → chunk-QOGXVEGW.js} +1 -1
  42. package/Marketplace/{chunk-WKDJS327.js → chunk-QUSBGNEW.js} +1 -1
  43. package/Marketplace/{chunk-NJM2XHQY.js → chunk-QZFQKQ7J.js} +1 -1
  44. package/Marketplace/{chunk-GR5OKYJS.js → chunk-RONMO7FE.js} +1 -1
  45. package/Marketplace/{chunk-YGL3QYTJ.js → chunk-U53TPHQS.js} +1 -1
  46. package/Marketplace/{chunk-PNLW4YVH.js → chunk-UCVQS5HR.js} +1 -1
  47. package/Marketplace/chunk-UWJWLXE2.js +1 -0
  48. package/Marketplace/{chunk-L6CJT6UC.js → chunk-V3UGRPNZ.js} +1 -1
  49. package/Marketplace/{chunk-7RTQ2IDL.js → chunk-VXL3UMDN.js} +1 -1
  50. package/Marketplace/{chunk-35L7AOGR.js → chunk-WIQODYPX.js} +1 -1
  51. package/Marketplace/{chunk-SQGOM2WU.js → chunk-WZCMEPBS.js} +1 -1
  52. package/Marketplace/{chunk-OZKNF6S2.js → chunk-XB2UHCVJ.js} +1 -1
  53. package/Marketplace/{chunk-FDI2UIO2.js → chunk-XDLTNTVT.js} +1 -1
  54. package/Marketplace/{chunk-ZRFFM47Q.js → chunk-Z3NC34XH.js} +1 -1
  55. package/Marketplace/{chunk-7KXQRJHI.js → chunk-Z5U5IBQC.js} +1 -1
  56. package/Marketplace/chunk-ZDNNLDAI.js +5 -0
  57. package/Marketplace/{chunk-KPPQNI2R.js → chunk-ZQYW374F.js} +1 -1
  58. package/Marketplace/index.html +2 -2
  59. package/Marketplace/{main-525IC5TZ.js → main-B2USSC5L.js} +1 -1
  60. package/Marketplace/{styles-SUQABHBL.css → styles-UF4D57IG.css} +1 -1
  61. package/package.json +1 -1
  62. package/Marketplace/chunk-LBQ2LOYA.js +0 -1
  63. package/Marketplace/chunk-QTQ6GNKJ.js +0 -5
  64. package/Marketplace/chunk-SUMLYFC7.js +0 -1
  65. /package/Marketplace/{chunk-4RJDBICZ.js → chunk-KG5K5AND.js} +0 -0
  66. /package/Marketplace/{chunk-ZKZWHDGN.js → chunk-PUBPICPK.js} +0 -0
  67. /package/Marketplace/{chunk-OOD7TLAL.js → chunk-UWYERBYV.js} +0 -0
  68. /package/Marketplace/{polyfills-ZMM4NOHE.js → polyfills-UZ2JZAXP.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{a as St}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-L6CJT6UC.js";import{a as Dt,b as We,c as xt,d as Pt,e as Ue,f as Rt,g as Ve,h as Ot,i as de,j as Ke,k as R}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-SHX3JAGT.js";import{b as Le,c as ue,d as jt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-7RTQ2IDL.js";import{$ as b,$a as P,A as ht,B as pt,Ba as Tt,Cc as Et,Dc as $e,Ga as g,Gc as Te,Ha as J,Hc as be,I as Se,Jc as ze,Ma as F,N as ft,Pa as re,Pb as wt,Q as ke,Qa as I,Qb as yt,Ra as se,Sb as ve,T as B,Ta as H,U as Ee,Ub as Be,Wa as ae,X as oe,Yb as Fe,aa as W,ab as L,b as m,ba as S,bb as ce,bc as He,c as x,ca as h,cb as Oe,da as ee,db as je,ea as De,fa as U,fb as Me,g as lt,h as ut,hb as bt,ic as _t,ja as xe,jb as le,jc as Ct,k as Z,ka as Pe,kc as It,l as Q,lb as k,m as z,n as ie,pa as mt,q as M,r as dt,ra as gt,rb as $,ta as ge,tb as X,tc as At,va as te,wb as Ne,xc as kt,ya as vt,za as Re}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-FA44W5LU.js";import{a as C,b as Y,h as D}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-ZKZWHDGN.js";var Mt={production:!0,version:"3.10.0",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/v1/content?fetch=children:omni&sort=sortOrder:asc"};var Nt=(()=>{let o=class o{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let n=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return n||[]}ParseToken(e){try{let r=e.split(".")[0].replace("-","+").replace("_","/"),s=JSON.parse(window.atob(r)),c=e.split(".")[1].replace("-","+").replace("_","/"),l=JSON.parse(window.atob(c));return l.header=s,l}catch{return!1}}};o.\u0275fac=function(n){return new(n||o)},o.\u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var Bt=["toast-component",""];function ln(i,o){if(i&1){let t=Me();P(0,"button",5),le("click",function(){xe(t);let n=k();return Pe(n.remove())}),P(1,"span",6),$(2,"\xD7"),L()()}}function un(i,o){if(i&1&&(Oe(0),$(1),je()),i&2){let t=k(2);g(1),X("[",t.duplicatesCount+1,"]")}}function dn(i,o){if(i&1&&(P(0,"div"),$(1),ae(2,un,2,1,"ng-container",4),L()),i&2){let t=k();H(t.options.titleClass),re("aria-label",t.title),g(1),X(" ",t.title," "),g(1),I("ngIf",t.duplicatesCount)}}function hn(i,o){if(i&1&&ce(0,"div",7),i&2){let t=k();H(t.options.messageClass),I("innerHTML",t.message,Re)}}function pn(i,o){if(i&1&&(P(0,"div",8),$(1),L()),i&2){let t=k();H(t.options.messageClass),re("aria-label",t.message),g(1),X(" ",t.message," ")}}function fn(i,o){if(i&1&&(P(0,"div"),ce(1,"div",9),L()),i&2){let t=k();g(1),se("width",t.width+"%")}}function mn(i,o){if(i&1){let t=Me();P(0,"button",5),le("click",function(){xe(t);let n=k();return Pe(n.remove())}),P(1,"span",6),$(2,"\xD7"),L()()}}function gn(i,o){if(i&1&&(Oe(0),$(1),je()),i&2){let t=k(2);g(1),X("[",t.duplicatesCount+1,"]")}}function vn(i,o){if(i&1&&(P(0,"div"),$(1),ae(2,gn,2,1,"ng-container",4),L()),i&2){let t=k();H(t.options.titleClass),re("aria-label",t.title),g(1),X(" ",t.title," "),g(1),I("ngIf",t.duplicatesCount)}}function Tn(i,o){if(i&1&&ce(0,"div",7),i&2){let t=k();H(t.options.messageClass),I("innerHTML",t.message,Re)}}function bn(i,o){if(i&1&&(P(0,"div",8),$(1),L()),i&2){let t=k();H(t.options.messageClass),re("aria-label",t.message),g(1),X(" ",t.message," ")}}function wn(i,o){if(i&1&&(P(0,"div"),ce(1,"div",9),L()),i&2){let t=k();g(1),se("width",t.width+"%")}}var qe=class{_attachedHost;component;viewContainerRef;injector;constructor(o,t){this.component=o,this.injector=t}attach(o,t){return this._attachedHost=o,o.attach(this,t)}detach(){let o=this._attachedHost;if(o)return this._attachedHost=void 0,o.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(o){this._attachedHost=o}},Ge=class{_attachedPortal;_disposeFn;attach(o,t){return this._attachedPortal=o,this.attachComponentPortal(o,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(o){this._disposeFn=o}},Ze=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new x;_activate=new x;_manualClose=new x;_resetTimeout=new x;_countDuplicate=new x;constructor(o){this._overlayRef=o}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(o,t){o&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}},ne=class{toastId;config;message;title;toastType;toastRef;_onTap=new x;_onAction=new x;constructor(o,t,e,n,r,s){this.toastId=o,this.config=t,this.message=e,this.title=n,this.toastType=r,this.toastRef=s,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(o){this._onAction.next(o)}onAction(){return this._onAction.asObservable()}},Ft={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},Ht=new S("ToastConfig"),Je=class extends Ge{_hostDomElement;_componentFactoryResolver;_appRef;constructor(o,t,e){super(),this._hostDomElement=o,this._componentFactoryResolver=t,this._appRef=e}attachComponentPortal(o,t){let e=this._componentFactoryResolver.resolveComponentFactory(o.component),n;return n=e.create(o.injector),this._appRef.attachView(n.hostView),this.setDisposeFn(()=>{this._appRef.detachView(n.hostView),n.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(n),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(n)),n}_getComponentRootNode(o){return o.hostView.rootNodes[0]}},yn=(()=>{class i{_document=ee(Fe);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t=this._document.createElement("div");t.classList.add("overlay-container"),t.setAttribute("aria-live","polite"),this._document.body.appendChild(t),this._containerElement=t}static \u0275fac=function(e){return new(e||i)};static \u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Xe=class{_portalHost;constructor(o){this._portalHost=o}attach(o,t=!0){return this._portalHost.attach(o,t)}detach(){return this._portalHost.detach()}},_n=(()=>{class i{_overlayContainer=ee(yn);_componentFactoryResolver=ee(Tt);_appRef=ee(ve);_document=ee(Fe);_paneElements=new Map;create(t,e){return this._createOverlayRef(this.getPaneElement(t,e))}getPaneElement(t="",e){return this._paneElements.get(e)||this._paneElements.set(e,{}),this._paneElements.get(e)[t]||(this._paneElements.get(e)[t]=this._createPaneElement(t,e)),this._paneElements.get(e)[t]}_createPaneElement(t,e){let n=this._document.createElement("div");return n.id="toast-container",n.classList.add(t),n.classList.add("toast-container"),e?e.getContainerElement().appendChild(n):this._overlayContainer.getContainerElement().appendChild(n),n}_createPortalHost(t){return new Je(t,this._componentFactoryResolver,this._appRef)}_createOverlayRef(t){return new Xe(this._createPortalHost(t))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Lt=(()=>{class i{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(t,e,n,r,s){this.overlay=e,this._injector=n,this.sanitizer=r,this.ngZone=s,this.toastrConfig=C(C({},t.default),t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=C(C({},t.default.iconClasses),t.config.iconClasses))}show(t,e,n={},r=""){return this._preBuildNotification(r,t,e,this.applyConfig(n))}success(t,e,n={}){let r=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(r,t,e,this.applyConfig(n))}error(t,e,n={}){let r=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(r,t,e,this.applyConfig(n))}info(t,e,n={}){let r=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(r,t,e,this.applyConfig(n))}warning(t,e,n={}){let r=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(r,t,e,this.applyConfig(n))}clear(t){for(let e of this.toasts)if(t!==void 0){if(e.toastId===t){e.toastRef.manualClose();return}}else e.toastRef.manualClose()}remove(t){let e=this._findToast(t);if(!e||(e.activeToast.toastRef.close(),this.toasts.splice(e.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let n=this.toasts[this.currentlyActive].toastRef;n.isInactive()||(this.currentlyActive=this.currentlyActive+1,n.activate())}return!0}findDuplicate(t="",e="",n,r){let{includeTitleDuplicates:s}=this.toastrConfig;for(let a of this.toasts){let c=s&&a.title===t;if((!s||c)&&a.message===e)return a.toastRef.onDuplicate(n,r),a}return null}applyConfig(t={}){return C(C({},this.toastrConfig),t)}_findToast(t){for(let e=0;e<this.toasts.length;e++)if(this.toasts[e].toastId===t)return{index:e,activeToast:this.toasts[e]};return null}_preBuildNotification(t,e,n,r){return r.onActivateTick?this.ngZone.run(()=>this._buildNotification(t,e,n,r)):this._buildNotification(t,e,n,r)}_buildNotification(t,e,n,r){if(!r.toastComponent)throw new Error("toastComponent required");let s=this.findDuplicate(n,e,this.toastrConfig.resetTimeoutOnDuplicate&&r.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&n||e)&&this.toastrConfig.preventDuplicates&&s!==null)return s;this.previousToastMessage=e;let a=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(a=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let c=this.overlay.create(r.positionClass,this.overlayContainer);this.index=this.index+1;let l=e;e&&r.enableHtml&&(l=this.sanitizer.sanitize(vt.HTML,e));let d=new Ze(c),u=new ne(this.index,r,l,n,t,d),p=[{provide:ne,useValue:u}],f=ge.create({providers:p,parent:this._injector}),q=new qe(r.toastComponent,f),j=c.attach(q,r.newestOnTop);d.componentInstance=j.instance;let A={toastId:this.index,title:n||"",message:e||"",toastRef:d,onShown:d.afterActivate(),onHidden:d.afterClosed(),onTap:u.onTap(),onAction:u.onAction(),portal:j};return a||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{A.toastRef.activate()})),this.toasts.push(A),A}static \u0275fac=function(e){return new(e||i)(h(Ht),h(_n),h(ge),h(At),h(F))};static \u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Cn=(()=>{class i{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=-1;toastClasses="";state;get displayStyle(){if(this.state.value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,e,n){this.toastrService=t,this.toastPackage=e,this.ngZone=n,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(r=>{this.duplicatesCount=r}),this.state={value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}}}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state=Y(C({},this.state),{value:"active"}),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width===0||this.width===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width=e/this.options.timeOut*100,this.options.progressAnimation==="increasing"&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state=Y(C({},this.state),{value:"active"}),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state.value!=="removed"&&(clearTimeout(this.timeout),this.state=Y(C({},this.state),{value:"removed"}),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state.value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state.value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state.value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(t),e)):this.timeout=setTimeout(()=>t(),e)}outsideInterval(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(t),e)):this.intervalId=setInterval(()=>t(),e)}runInsideAngular(t){this.ngZone?this.ngZone.run(()=>t()):t()}static \u0275fac=function(e){return new(e||i)(J(Lt),J(ne),J(F))};static \u0275cmp=De({type:i,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(e,n){e&1&&le("click",function(){return n.tapToast()})("mouseenter",function(){return n.stickAround()})("mouseleave",function(){return n.delayedHideToast()}),e&2&&(bt("@flyInOut",n.state),H(n.toastClasses),se("display",n.displayStyle))},standalone:!0,features:[Ne],attrs:Bt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,n){e&1&&ae(0,ln,3,0,"button",0)(1,dn,3,5,"div",1)(2,hn,1,3,"div",2)(3,pn,2,4,"div",3)(4,fn,2,2,"div",4),e&2&&(I("ngIf",n.options.closeButton),g(1),I("ngIf",n.title),g(1),I("ngIf",n.message&&n.options.enableHtml),g(1),I("ngIf",n.message&&!n.options.enableHtml),g(1),I("ngIf",n.options.progressBar))},dependencies:[He],encapsulation:2,data:{animation:[Et("flyInOut",[be("inactive",Te({opacity:0})),be("active",Te({opacity:1})),be("removed",Te({opacity:0})),ze("inactive => active",$e("{{ easeTime }}ms {{ easing }}")),ze("active => removed",$e("{{ easeTime }}ms {{ easing }}"))])]}})}return i})(),In=Y(C({},Ft),{toastComponent:Cn}),An=(i={})=>gt([{provide:Ht,useValue:{default:In,config:i}}]),zi=(()=>{class i{static forRoot(t={}){return{ngModule:i,providers:[An(t)]}}static \u0275fac=function(e){return new(e||i)};static \u0275mod=U({type:i});static \u0275inj=W({})}return i})();var Sn=(()=>{class i{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=-1;toastClasses="";get displayStyle(){return this.state==="inactive"?"none":null}state="inactive";timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,e,n){this.toastrService=t,this.toastPackage=e,this.appRef=n,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(r=>{this.duplicatesCount=r})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state="active",!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width===0||this.width===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width=e/this.options.timeOut*100,this.options.progressAnimation==="increasing"&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state="active",this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state!=="removed"&&(clearTimeout(this.timeout),this.state="removed",this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(e){return new(e||i)(J(Lt),J(ne),J(ve))};static \u0275cmp=De({type:i,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(e,n){e&1&&le("click",function(){return n.tapToast()})("mouseenter",function(){return n.stickAround()})("mouseleave",function(){return n.delayedHideToast()}),e&2&&(H(n.toastClasses),se("display",n.displayStyle))},standalone:!0,features:[Ne],attrs:Bt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,n){e&1&&ae(0,mn,3,0,"button",0)(1,vn,3,5,"div",1)(2,Tn,1,3,"div",2)(3,bn,2,4,"div",3)(4,wn,2,2,"div",4),e&2&&(I("ngIf",n.options.closeButton),g(1),I("ngIf",n.title),g(1),I("ngIf",n.message&&n.options.enableHtml),g(1),I("ngIf",n.message&&!n.options.enableHtml),g(1),I("ngIf",n.options.progressBar))},dependencies:[He],encapsulation:2})}return i})(),Wi=Y(C({},Ft),{toastComponent:Sn});var kn="firebase",En="10.7.1";de(kn,En,"app");var pe=new wt("ANGULARFIRE2_VERSION");var Dn=(i,o)=>{let t=o?[o]:Ot(),e=[];return t.forEach(n=>{n.container.getProvider(i).instances.forEach(s=>{e.includes(s)||e.push(s)})}),e},he=class{constructor(){return Dn(xn)}},xn="app-check";function Ye(){}var we=class{zone;delegate;constructor(o,t=ut){this.zone=o,this.delegate=t}now(){return this.delegate.now()}schedule(o,t,e){let n=this.zone,r=function(s){n.runGuarded(()=>{o.apply(this,[s])})};return this.delegate.schedule(r,t,e)}},Qe=class{zone;task=null;constructor(o){this.zone=o}call(o,t){let e=this.unscheduleTask.bind(this);return this.task=this.zone.run(()=>Zone.current.scheduleMacroTask("firebaseZoneBlock",Ye,{},Ye,Ye)),t.pipe(oe({next:e,complete:e,error:e})).subscribe(o).add(e)}unscheduleTask(){setTimeout(()=>{this.task!=null&&this.task.state==="scheduled"&&(this.task.invoke(),this.task=null)},10)}},$t=(()=>{class i{ngZone;outsideAngular;insideAngular;constructor(t){this.ngZone=t,this.outsideAngular=t.runOutsideAngular(()=>new we(Zone.current)),this.insideAngular=t.run(()=>new we(Zone.current,lt)),globalThis.\u0275AngularFireScheduler||=this}static \u0275fac=function(e){return new(e||i)(h(F))};static \u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function Pn(){let i=globalThis.\u0275AngularFireScheduler;if(!i)throw new Error(`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
1
+ import{a as St}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-V3UGRPNZ.js";import{a as Dt,b as We,c as xt,d as Pt,e as Ue,f as Rt,g as Ve,h as Ot,i as de,j as Ke,k as R}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-FTHNPPXM.js";import{b as Le,c as ue,d as jt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-VXL3UMDN.js";import{$ as b,$a as P,A as ht,B as pt,Ba as Tt,Cc as Et,Dc as $e,Ga as g,Gc as Te,Ha as J,Hc as be,I as Se,Jc as ze,Ma as F,N as ft,Pa as re,Pb as wt,Q as ke,Qa as I,Qb as yt,Ra as se,Sb as ve,T as B,Ta as H,U as Ee,Ub as Be,Wa as ae,X as oe,Yb as Fe,aa as W,ab as L,b as m,ba as S,bb as ce,bc as He,c as x,ca as h,cb as Oe,da as ee,db as je,ea as De,fa as U,fb as Me,g as lt,h as ut,hb as bt,ic as _t,ja as xe,jb as le,jc as Ct,k as Z,ka as Pe,kc as It,l as Q,lb as k,m as z,n as ie,pa as mt,q as M,r as dt,ra as gt,rb as $,ta as ge,tb as X,tc as At,va as te,wb as Ne,xc as kt,ya as vt,za as Re}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-P24WVMWI.js";import{a as C,b as Y,h as D}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-PUBPICPK.js";var Mt={production:!0,version:"3.10.1",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/v1/content?fetch=children:omni&sort=sortOrder:asc"};var Nt=(()=>{let o=class o{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let n=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return n||[]}ParseToken(e){try{let r=e.split(".")[0].replace("-","+").replace("_","/"),s=JSON.parse(window.atob(r)),c=e.split(".")[1].replace("-","+").replace("_","/"),l=JSON.parse(window.atob(c));return l.header=s,l}catch{return!1}}};o.\u0275fac=function(n){return new(n||o)},o.\u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var Bt=["toast-component",""];function ln(i,o){if(i&1){let t=Me();P(0,"button",5),le("click",function(){xe(t);let n=k();return Pe(n.remove())}),P(1,"span",6),$(2,"\xD7"),L()()}}function un(i,o){if(i&1&&(Oe(0),$(1),je()),i&2){let t=k(2);g(1),X("[",t.duplicatesCount+1,"]")}}function dn(i,o){if(i&1&&(P(0,"div"),$(1),ae(2,un,2,1,"ng-container",4),L()),i&2){let t=k();H(t.options.titleClass),re("aria-label",t.title),g(1),X(" ",t.title," "),g(1),I("ngIf",t.duplicatesCount)}}function hn(i,o){if(i&1&&ce(0,"div",7),i&2){let t=k();H(t.options.messageClass),I("innerHTML",t.message,Re)}}function pn(i,o){if(i&1&&(P(0,"div",8),$(1),L()),i&2){let t=k();H(t.options.messageClass),re("aria-label",t.message),g(1),X(" ",t.message," ")}}function fn(i,o){if(i&1&&(P(0,"div"),ce(1,"div",9),L()),i&2){let t=k();g(1),se("width",t.width+"%")}}function mn(i,o){if(i&1){let t=Me();P(0,"button",5),le("click",function(){xe(t);let n=k();return Pe(n.remove())}),P(1,"span",6),$(2,"\xD7"),L()()}}function gn(i,o){if(i&1&&(Oe(0),$(1),je()),i&2){let t=k(2);g(1),X("[",t.duplicatesCount+1,"]")}}function vn(i,o){if(i&1&&(P(0,"div"),$(1),ae(2,gn,2,1,"ng-container",4),L()),i&2){let t=k();H(t.options.titleClass),re("aria-label",t.title),g(1),X(" ",t.title," "),g(1),I("ngIf",t.duplicatesCount)}}function Tn(i,o){if(i&1&&ce(0,"div",7),i&2){let t=k();H(t.options.messageClass),I("innerHTML",t.message,Re)}}function bn(i,o){if(i&1&&(P(0,"div",8),$(1),L()),i&2){let t=k();H(t.options.messageClass),re("aria-label",t.message),g(1),X(" ",t.message," ")}}function wn(i,o){if(i&1&&(P(0,"div"),ce(1,"div",9),L()),i&2){let t=k();g(1),se("width",t.width+"%")}}var qe=class{_attachedHost;component;viewContainerRef;injector;constructor(o,t){this.component=o,this.injector=t}attach(o,t){return this._attachedHost=o,o.attach(this,t)}detach(){let o=this._attachedHost;if(o)return this._attachedHost=void 0,o.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(o){this._attachedHost=o}},Ge=class{_attachedPortal;_disposeFn;attach(o,t){return this._attachedPortal=o,this.attachComponentPortal(o,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(o){this._disposeFn=o}},Ze=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new x;_activate=new x;_manualClose=new x;_resetTimeout=new x;_countDuplicate=new x;constructor(o){this._overlayRef=o}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(o,t){o&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}},ne=class{toastId;config;message;title;toastType;toastRef;_onTap=new x;_onAction=new x;constructor(o,t,e,n,r,s){this.toastId=o,this.config=t,this.message=e,this.title=n,this.toastType=r,this.toastRef=s,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(o){this._onAction.next(o)}onAction(){return this._onAction.asObservable()}},Ft={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},Ht=new S("ToastConfig"),Je=class extends Ge{_hostDomElement;_componentFactoryResolver;_appRef;constructor(o,t,e){super(),this._hostDomElement=o,this._componentFactoryResolver=t,this._appRef=e}attachComponentPortal(o,t){let e=this._componentFactoryResolver.resolveComponentFactory(o.component),n;return n=e.create(o.injector),this._appRef.attachView(n.hostView),this.setDisposeFn(()=>{this._appRef.detachView(n.hostView),n.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(n),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(n)),n}_getComponentRootNode(o){return o.hostView.rootNodes[0]}},yn=(()=>{class i{_document=ee(Fe);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t=this._document.createElement("div");t.classList.add("overlay-container"),t.setAttribute("aria-live","polite"),this._document.body.appendChild(t),this._containerElement=t}static \u0275fac=function(e){return new(e||i)};static \u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Xe=class{_portalHost;constructor(o){this._portalHost=o}attach(o,t=!0){return this._portalHost.attach(o,t)}detach(){return this._portalHost.detach()}},_n=(()=>{class i{_overlayContainer=ee(yn);_componentFactoryResolver=ee(Tt);_appRef=ee(ve);_document=ee(Fe);_paneElements=new Map;create(t,e){return this._createOverlayRef(this.getPaneElement(t,e))}getPaneElement(t="",e){return this._paneElements.get(e)||this._paneElements.set(e,{}),this._paneElements.get(e)[t]||(this._paneElements.get(e)[t]=this._createPaneElement(t,e)),this._paneElements.get(e)[t]}_createPaneElement(t,e){let n=this._document.createElement("div");return n.id="toast-container",n.classList.add(t),n.classList.add("toast-container"),e?e.getContainerElement().appendChild(n):this._overlayContainer.getContainerElement().appendChild(n),n}_createPortalHost(t){return new Je(t,this._componentFactoryResolver,this._appRef)}_createOverlayRef(t){return new Xe(this._createPortalHost(t))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Lt=(()=>{class i{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(t,e,n,r,s){this.overlay=e,this._injector=n,this.sanitizer=r,this.ngZone=s,this.toastrConfig=C(C({},t.default),t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=C(C({},t.default.iconClasses),t.config.iconClasses))}show(t,e,n={},r=""){return this._preBuildNotification(r,t,e,this.applyConfig(n))}success(t,e,n={}){let r=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(r,t,e,this.applyConfig(n))}error(t,e,n={}){let r=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(r,t,e,this.applyConfig(n))}info(t,e,n={}){let r=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(r,t,e,this.applyConfig(n))}warning(t,e,n={}){let r=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(r,t,e,this.applyConfig(n))}clear(t){for(let e of this.toasts)if(t!==void 0){if(e.toastId===t){e.toastRef.manualClose();return}}else e.toastRef.manualClose()}remove(t){let e=this._findToast(t);if(!e||(e.activeToast.toastRef.close(),this.toasts.splice(e.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let n=this.toasts[this.currentlyActive].toastRef;n.isInactive()||(this.currentlyActive=this.currentlyActive+1,n.activate())}return!0}findDuplicate(t="",e="",n,r){let{includeTitleDuplicates:s}=this.toastrConfig;for(let a of this.toasts){let c=s&&a.title===t;if((!s||c)&&a.message===e)return a.toastRef.onDuplicate(n,r),a}return null}applyConfig(t={}){return C(C({},this.toastrConfig),t)}_findToast(t){for(let e=0;e<this.toasts.length;e++)if(this.toasts[e].toastId===t)return{index:e,activeToast:this.toasts[e]};return null}_preBuildNotification(t,e,n,r){return r.onActivateTick?this.ngZone.run(()=>this._buildNotification(t,e,n,r)):this._buildNotification(t,e,n,r)}_buildNotification(t,e,n,r){if(!r.toastComponent)throw new Error("toastComponent required");let s=this.findDuplicate(n,e,this.toastrConfig.resetTimeoutOnDuplicate&&r.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&n||e)&&this.toastrConfig.preventDuplicates&&s!==null)return s;this.previousToastMessage=e;let a=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(a=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let c=this.overlay.create(r.positionClass,this.overlayContainer);this.index=this.index+1;let l=e;e&&r.enableHtml&&(l=this.sanitizer.sanitize(vt.HTML,e));let d=new Ze(c),u=new ne(this.index,r,l,n,t,d),p=[{provide:ne,useValue:u}],f=ge.create({providers:p,parent:this._injector}),q=new qe(r.toastComponent,f),j=c.attach(q,r.newestOnTop);d.componentInstance=j.instance;let A={toastId:this.index,title:n||"",message:e||"",toastRef:d,onShown:d.afterActivate(),onHidden:d.afterClosed(),onTap:u.onTap(),onAction:u.onAction(),portal:j};return a||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{A.toastRef.activate()})),this.toasts.push(A),A}static \u0275fac=function(e){return new(e||i)(h(Ht),h(_n),h(ge),h(At),h(F))};static \u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Cn=(()=>{class i{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=-1;toastClasses="";state;get displayStyle(){if(this.state.value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,e,n){this.toastrService=t,this.toastPackage=e,this.ngZone=n,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(r=>{this.duplicatesCount=r}),this.state={value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}}}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state=Y(C({},this.state),{value:"active"}),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width===0||this.width===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width=e/this.options.timeOut*100,this.options.progressAnimation==="increasing"&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state=Y(C({},this.state),{value:"active"}),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state.value!=="removed"&&(clearTimeout(this.timeout),this.state=Y(C({},this.state),{value:"removed"}),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state.value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state.value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state.value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(t),e)):this.timeout=setTimeout(()=>t(),e)}outsideInterval(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(t),e)):this.intervalId=setInterval(()=>t(),e)}runInsideAngular(t){this.ngZone?this.ngZone.run(()=>t()):t()}static \u0275fac=function(e){return new(e||i)(J(Lt),J(ne),J(F))};static \u0275cmp=De({type:i,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(e,n){e&1&&le("click",function(){return n.tapToast()})("mouseenter",function(){return n.stickAround()})("mouseleave",function(){return n.delayedHideToast()}),e&2&&(bt("@flyInOut",n.state),H(n.toastClasses),se("display",n.displayStyle))},standalone:!0,features:[Ne],attrs:Bt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,n){e&1&&ae(0,ln,3,0,"button",0)(1,dn,3,5,"div",1)(2,hn,1,3,"div",2)(3,pn,2,4,"div",3)(4,fn,2,2,"div",4),e&2&&(I("ngIf",n.options.closeButton),g(1),I("ngIf",n.title),g(1),I("ngIf",n.message&&n.options.enableHtml),g(1),I("ngIf",n.message&&!n.options.enableHtml),g(1),I("ngIf",n.options.progressBar))},dependencies:[He],encapsulation:2,data:{animation:[Et("flyInOut",[be("inactive",Te({opacity:0})),be("active",Te({opacity:1})),be("removed",Te({opacity:0})),ze("inactive => active",$e("{{ easeTime }}ms {{ easing }}")),ze("active => removed",$e("{{ easeTime }}ms {{ easing }}"))])]}})}return i})(),In=Y(C({},Ft),{toastComponent:Cn}),An=(i={})=>gt([{provide:Ht,useValue:{default:In,config:i}}]),zi=(()=>{class i{static forRoot(t={}){return{ngModule:i,providers:[An(t)]}}static \u0275fac=function(e){return new(e||i)};static \u0275mod=U({type:i});static \u0275inj=W({})}return i})();var Sn=(()=>{class i{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=-1;toastClasses="";get displayStyle(){return this.state==="inactive"?"none":null}state="inactive";timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,e,n){this.toastrService=t,this.toastPackage=e,this.appRef=n,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(r=>{this.duplicatesCount=r})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state="active",!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width===0||this.width===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width=e/this.options.timeOut*100,this.options.progressAnimation==="increasing"&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state="active",this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state!=="removed"&&(clearTimeout(this.timeout),this.state="removed",this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(e){return new(e||i)(J(Lt),J(ne),J(ve))};static \u0275cmp=De({type:i,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(e,n){e&1&&le("click",function(){return n.tapToast()})("mouseenter",function(){return n.stickAround()})("mouseleave",function(){return n.delayedHideToast()}),e&2&&(H(n.toastClasses),se("display",n.displayStyle))},standalone:!0,features:[Ne],attrs:Bt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,n){e&1&&ae(0,mn,3,0,"button",0)(1,vn,3,5,"div",1)(2,Tn,1,3,"div",2)(3,bn,2,4,"div",3)(4,wn,2,2,"div",4),e&2&&(I("ngIf",n.options.closeButton),g(1),I("ngIf",n.title),g(1),I("ngIf",n.message&&n.options.enableHtml),g(1),I("ngIf",n.message&&!n.options.enableHtml),g(1),I("ngIf",n.options.progressBar))},dependencies:[He],encapsulation:2})}return i})(),Wi=Y(C({},Ft),{toastComponent:Sn});var kn="firebase",En="10.7.1";de(kn,En,"app");var pe=new wt("ANGULARFIRE2_VERSION");var Dn=(i,o)=>{let t=o?[o]:Ot(),e=[];return t.forEach(n=>{n.container.getProvider(i).instances.forEach(s=>{e.includes(s)||e.push(s)})}),e},he=class{constructor(){return Dn(xn)}},xn="app-check";function Ye(){}var we=class{zone;delegate;constructor(o,t=ut){this.zone=o,this.delegate=t}now(){return this.delegate.now()}schedule(o,t,e){let n=this.zone,r=function(s){n.runGuarded(()=>{o.apply(this,[s])})};return this.delegate.schedule(r,t,e)}},Qe=class{zone;task=null;constructor(o){this.zone=o}call(o,t){let e=this.unscheduleTask.bind(this);return this.task=this.zone.run(()=>Zone.current.scheduleMacroTask("firebaseZoneBlock",Ye,{},Ye,Ye)),t.pipe(oe({next:e,complete:e,error:e})).subscribe(o).add(e)}unscheduleTask(){setTimeout(()=>{this.task!=null&&this.task.state==="scheduled"&&(this.task.invoke(),this.task=null)},10)}},$t=(()=>{class i{ngZone;outsideAngular;insideAngular;constructor(t){this.ngZone=t,this.outsideAngular=t.runOutsideAngular(()=>new we(Zone.current)),this.insideAngular=t.run(()=>new we(Zone.current,lt)),globalThis.\u0275AngularFireScheduler||=this}static \u0275fac=function(e){return new(e||i)(h(F))};static \u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function Pn(){let i=globalThis.\u0275AngularFireScheduler;if(!i)throw new Error(`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
2
2
  provideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).`);return i}function zt(i){return Rn(Pn())(i)}function Rn(i){return function(t){return t=t.lift(new Qe(i.ngZone)),t.pipe(Q(i.outsideAngular),Z(i.insideAngular))}}var jn="firebase",Mn="10.7.1";R.registerVersion(jn,Mn,"app-compat");var Nn=["ngOnDestroy"],Ut=(i,o,t,e={})=>new Proxy(i,{get:(n,r)=>t.runOutsideAngular(()=>{if(i[r])return e?.spy?.get&&e.spy.get(r,i[r]),i[r];if(Nn.indexOf(r)>-1)return()=>{};let s=o.toPromise().then(a=>{let c=a?.[r];return typeof c=="function"?c.bind(a):c?.then?c.then(l=>t.run(()=>l)):t.run(()=>c)});return new Proxy(()=>{},{get:(a,c)=>s[c],apply:(a,c,l)=>s.then(d=>{let u=d?.(...l);return e?.spy?.apply&&e.spy.apply(r,l,u),u})})})});var ye=class{constructor(o){return o}},_e=new S("angularfire2.app.options"),Ce=new S("angularfire2.app.name");function et(i,o,t){let e=typeof t=="string"&&t||"[DEFAULT]",n=typeof t=="object"&&t||{};n.name=n.name||e;let s=R.apps.filter(a=>a&&a.name===n.name)[0]||o.runOutsideAngular(()=>R.initializeApp(i,n));try{if(JSON.stringify(i)!==JSON.stringify(s.options)){let a=!!module.hot;Bn("error",`${s.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new ye(s)}var Bn=(i,...o)=>{Be()&&typeof console<"u"&&console[i](...o)},Fn={provide:ye,useFactory:et,deps:[_e,F,[new mt,Ce]]},co=(()=>{class i{static initializeApp(t,e){return{ngModule:i,providers:[{provide:_e,useValue:t},{provide:Ce,useValue:e}]}}constructor(t){R.registerVersion("angularfire",pe.full,"core"),R.registerVersion("angularfire",pe.full,"app-compat"),R.registerVersion("angular",yt.full,t.toString())}static \u0275fac=function(e){return new(e||i)(h(te))};static \u0275mod=U({type:i});static \u0275inj=W({providers:[Fn]})}return i})();function Vt(i,o,t,e,n){let[,r,s]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===i)||[];if(r)return Hn(n,s)||(Wt("error",`${o} was already initialized on the ${t} Firebase App with different settings.${Ln?" You may need to reload as Firebase is not HMR aware.":""}`),Wt("warn",{is:n,was:s})),r;{let a=e();return globalThis.\u0275AngularfireInstanceCache.push([i,a,n]),a}}function Hn(i,o){try{return i.toString()===o.toString()}catch{return i===o}}var Ln=typeof module<"u"&&!!module.hot,Wt=(i,...o)=>{Be()&&typeof console<"u"&&console[i](...o)};globalThis.\u0275AngularfireInstanceCache||=[];var $n=new Map,zn={activated:!1,tokenObservers:[]},Wn={initialized:!1,enabled:!1};function O(i){return $n.get(i)||Object.assign({},zn)}function Jt(){return Wn}var Un="https://content-firebaseappcheck.googleapis.com/v1";var Vn="exchangeDebugToken",Kt={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},_o=24*60*60*1e3;var nt=class{constructor(o,t,e,n,r){if(this.operation=o,this.retryPolicy=t,this.getWaitDuration=e,this.lowerBound=n,this.upperBound=r,this.pending=null,this.nextErrorWaitInterval=n,n>r)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(o){return D(this,null,function*(){this.stop();try{this.pending=new We,this.pending.promise.catch(t=>{}),yield Kn(this.getNextRun(o)),this.pending.resolve(),yield this.pending.promise,this.pending=new We,this.pending.promise.catch(t=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(t){this.retryPolicy(t)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(o){if(o)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let t=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),t}}};function Kn(i){return new Promise(o=>{setTimeout(o,i)})}var qn={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"},K=new Pt("appCheck","AppCheck",qn);function Xt(i){if(!O(i).activated)throw K.create("use-before-activation",{appName:i.name})}function Yt(e,n){return D(this,arguments,function*({url:i,body:o},t){let r={"Content-Type":"application/json"},s=t.getImmediate({optional:!0});if(s){let f=yield s.getHeartbeatsHeader();f&&(r["X-Firebase-Client"]=f)}let a={method:"POST",body:JSON.stringify(o),headers:r},c;try{c=yield fetch(i,a)}catch(f){throw K.create("fetch-network-error",{originalErrorMessage:f?.message})}if(c.status!==200)throw K.create("fetch-status-error",{httpStatus:c.status});let l;try{l=yield c.json()}catch(f){throw K.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=l.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw K.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${l.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:l.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function Qt(i,o){let{projectId:t,appId:e,apiKey:n}=i.options;return{url:`${Un}/projects/${t}/apps/${e}:${Vn}?key=${n}`,body:{debug_token:o}}}var Gn="firebase-app-check-database",Zn=1,it="firebase-app-check-store";var Ie=null;function Jn(){return Ie||(Ie=new Promise((i,o)=>{try{let t=indexedDB.open(Gn,Zn);t.onsuccess=e=>{i(e.target.result)},t.onerror=e=>{var n;o(K.create("storage-open",{originalErrorMessage:(n=e.target.error)===null||n===void 0?void 0:n.message}))},t.onupgradeneeded=e=>{let n=e.target.result;switch(e.oldVersion){case 0:n.createObjectStore(it,{keyPath:"compositeKey"})}}}catch(t){o(K.create("storage-open",{originalErrorMessage:t?.message}))}}),Ie)}function Xn(i,o){return Yn(Qn(i),o)}function Yn(i,o){return D(this,null,function*(){let e=(yield Jn()).transaction(it,"readwrite"),r=e.objectStore(it).put({compositeKey:i,value:o});return new Promise((s,a)=>{r.onsuccess=c=>{s()},e.onerror=c=>{var l;a(K.create("storage-set",{originalErrorMessage:(l=c.target.error)===null||l===void 0?void 0:l.message}))}})})}function Qn(i){return`${i.options.appId}-${i.name}`}var ot=new Rt("@firebase/app-check");function tt(i,o){return xt()?Xn(i,o).catch(t=>{ot.warn(`Failed to write token to IndexedDB. Error: ${t}`)}):Promise.resolve()}function en(){return Jt().enabled}function tn(){return D(this,null,function*(){let i=Jt();if(i.enabled&&i.token)return i.token.promise;throw Error(`
3
3
  Can't get debug token in production mode.
4
- `)})}var ei={error:"UNKNOWN_ERROR"};function ti(i){return Dt.encodeString(JSON.stringify(i),!1)}function rt(i,o=!1){return D(this,null,function*(){let t=i.app;Xt(t);let e=O(t),n=e.token,r;if(n&&!fe(n)&&(e.token=void 0,n=void 0),!n){let c=yield e.cachedTokenPromise;c&&(fe(c)?n=c:yield tt(t,void 0))}if(!o&&n&&fe(n))return{token:n.token};let s=!1;if(en()){e.exchangeTokenPromise||(e.exchangeTokenPromise=Yt(Qt(t,yield tn()),i.heartbeatServiceProvider).finally(()=>{e.exchangeTokenPromise=void 0}),s=!0);let c=yield e.exchangeTokenPromise;return yield tt(t,c),e.token=c,{token:c.token}}try{e.exchangeTokenPromise||(e.exchangeTokenPromise=e.provider.getToken().finally(()=>{e.exchangeTokenPromise=void 0}),s=!0),n=yield O(t).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"?ot.warn(c.message):ot.error(c),r=c}let a;return n?r?fe(n)?a={token:n.token,internalError:r}:a=Gt(r):(a={token:n.token},e.token=n,yield tt(t,n)):a=Gt(r),s&&ri(t,a),a})}function ni(i){return D(this,null,function*(){let o=i.app;Xt(o);let{provider:t}=O(o);if(en()){let e=yield tn(),{token:n}=yield Yt(Qt(o,e),i.heartbeatServiceProvider);return{token:n}}else{let{token:e}=yield t.getToken();return{token:e}}})}function ii(i,o,t,e){let{app:n}=i,r=O(n),s={next:t,error:e,type:o};if(r.tokenObservers=[...r.tokenObservers,s],r.token&&fe(r.token)){let a=r.token;Promise.resolve().then(()=>{t({token:a.token}),qt(i)}).catch(()=>{})}r.cachedTokenPromise.then(()=>qt(i))}function nn(i,o){let t=O(i),e=t.tokenObservers.filter(n=>n.next!==o);e.length===0&&t.tokenRefresher&&t.tokenRefresher.isRunning()&&t.tokenRefresher.stop(),t.tokenObservers=e}function qt(i){let{app:o}=i,t=O(o),e=t.tokenRefresher;e||(e=oi(i),t.tokenRefresher=e),!e.isRunning()&&t.isTokenAutoRefreshEnabled&&e.start()}function oi(i){let{app:o}=i;return new nt(()=>D(this,null,function*(){let t=O(o),e;if(t.token?e=yield rt(i,!0):e=yield rt(i),e.error)throw e.error;if(e.internalError)throw e.internalError}),()=>!0,()=>{let t=O(o);if(t.token){let e=t.token.issuedAtTimeMillis+(t.token.expireTimeMillis-t.token.issuedAtTimeMillis)*.5+3e5,n=t.token.expireTimeMillis-5*60*1e3;return e=Math.min(e,n),Math.max(0,e-Date.now())}else return 0},Kt.RETRIAL_MIN_WAIT,Kt.RETRIAL_MAX_WAIT)}function ri(i,o){let t=O(i).tokenObservers;for(let e of t)try{e.type==="EXTERNAL"&&o.error!=null?e.error(o.error):e.next(o)}catch{}}function fe(i){return i.expireTimeMillis-Date.now()>0}function Gt(i){return{token:ti(ei),error:i}}var st=class{constructor(o,t){this.app=o,this.heartbeatServiceProvider=t}_delete(){let{tokenObservers:o}=O(this.app);for(let t of o)nn(this.app,t.next);return Promise.resolve()}};function si(i,o){return new st(i,o)}function ai(i){return{getToken:o=>rt(i,o),getLimitedUseToken:()=>ni(i),addTokenListener:o=>ii(i,"INTERNAL",o),removeTokenListener:o=>nn(i.app,o)}}var ci="@firebase/app-check",li="0.8.1";var ui="app-check",Zt="app-check-internal";function di(){Ve(new Ue(ui,i=>{let o=i.getProvider("app").getImmediate(),t=i.getProvider("heartbeat");return si(o,t)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((i,o,t)=>{i.getProvider(Zt).initialize()})),Ve(new Ue(Zt,i=>{let o=i.getProvider("app-check").getImmediate();return ai(o)},"PUBLIC").setInstantiationMode("EXPLICIT")),de(ci,li)}di();var hi=["localhost","0.0.0.0","127.0.0.1"],jo=typeof window<"u"&&hi.includes(window.location.hostname);var fi=new S("angularfire2.auth.use-emulator"),mi=new S("angularfire2.auth.settings"),gi=new S("angularfire2.auth.tenant-id"),vi=new S("angularfire2.auth.langugage-code"),Ti=new S("angularfire2.auth.use-device-language"),bi=new S("angularfire.auth.persistence"),wi=(i,o,t,e,n,r,s,a)=>Vt(`${i.name}.auth`,"AngularFireAuth",i.name,()=>{let c=o.runOutsideAngular(()=>i.auth());if(t&&c.useEmulator(...t),e&&(c.tenantId=e),c.languageCode=n,r&&c.useDeviceLanguage(),s)for(let[l,d]of Object.entries(s))c.settings[l]=d;return a&&c.setPersistence(a),c},[t,e,n,r,s,a]),at=(()=>{class i{authState;idToken;user;idTokenResult;credential;constructor(t,e,n,r,s,a,c,l,d,u,p,f){let q=new x,j=ie(void 0).pipe(Z(s.outsideAngular),B(()=>r.runOutsideAngular(()=>import("https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-LBQ2LOYA.js"))),M(()=>et(t,r,e)),M(A=>wi(A,r,a,l,d,u,c,p)),ke({bufferSize:1,refCount:!1}));if(It(n))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=ie(null);else{j.pipe(ft()).subscribe();let A=j.pipe(B(T=>T.getRedirectResult().then(N=>N,()=>null)),zt,ke({bufferSize:1,refCount:!1})),me=j.pipe(B(T=>new m(N=>({unsubscribe:r.runOutsideAngular(()=>T.onAuthStateChanged(G=>N.next(G),G=>N.error(G),()=>N.complete()))})))),Ae=j.pipe(B(T=>new m(N=>({unsubscribe:r.runOutsideAngular(()=>T.onIdTokenChanged(G=>N.next(G),G=>N.error(G),()=>N.complete()))}))));this.authState=A.pipe(Ee(me),Q(s.outsideAngular),Z(s.insideAngular)),this.user=A.pipe(Ee(Ae),Q(s.outsideAngular),Z(s.insideAngular)),this.idToken=this.user.pipe(B(T=>T?z(T.getIdToken()):ie(null))),this.idTokenResult=this.user.pipe(B(T=>T?z(T.getIdTokenResult()):ie(null))),this.credential=ht(A,q,this.authState.pipe(pt(T=>!T))).pipe(M(T=>T?.user?T:null),Q(s.outsideAngular),Z(s.insideAngular))}return Ut(this,j,r,{spy:{apply:(A,me,Ae)=>{(A.startsWith("signIn")||A.startsWith("createUser"))&&Ae.then(T=>q.next(T))}}})}static \u0275fac=function(e){return new(e||i)(h(_e),h(Ce,8),h(te),h(F),h($t),h(fi,8),h(mi,8),h(gi,8),h(vi,8),h(Ti,8),h(bi,8),h(he,8))};static \u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"any"})}return i})(),Jo=(()=>{class i{constructor(){R.registerVersion("angularfire",pe.full,"auth-compat")}static \u0275fac=function(e){return new(e||i)};static \u0275mod=U({type:i});static \u0275inj=W({providers:[at]})}return i})();function v(i,o,t,e){return new Promise((n,r)=>{i||r("IndexedDB not available");let s=i.open(o,t),a;s.onsuccess=c=>{a=s.result,n(a)},s.onerror=c=>{r(`IndexedDB error: ${s.error}`)},typeof e=="function"&&(s.onupgradeneeded=c=>{e(c,a)})})}function on(i,o,t,e,n){if(!i)return;let r=i.open(o,t);r.onupgradeneeded=s=>{let a=s.target.result;e.forEach(l=>{if(!a.objectStoreNames.contains(l.store)){let d=a.createObjectStore(l.store,l.storeConfig);l.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let c=n&&n();c&&Object.keys(c).map(l=>parseInt(l,10)).filter(l=>l>s.oldVersion).sort((l,d)=>l-d).forEach(l=>{c[l](a,r.transaction)}),a.close()},r.onsuccess=s=>{s.target.result.close()}}function _i(i,o,t){if(!i||!o||!t)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new m(e=>{try{let n=o+1,r=indexedDB.open(i,n);r.onupgradeneeded=s=>{let a=s.target.result;a.deleteObjectStore(t),a.close(),console.log("onupgradeneeded"),e.next(!0),e.complete()},r.onerror=s=>e.error(s)}catch(n){e.error(n)}})}function Ci(i,o){return i.objectStoreNames.contains(o)}function E(i,o,t){i||t("You need to use the openDatabase function to create a database before you query it!"),Ci(i,o)||t(`objectStore does not exists: ${o}`)}function y(i,o){let t=i.transaction(o.storeName,o.dbMode);return t.onerror=o.error,t.onabort=o.abort,t}function _(i,o,t,e){return{storeName:o,dbMode:i,error:n=>{t(n)},abort:n=>{t(n)}}}var w=function(i){return i.readonly="readonly",i.readwrite="readwrite",i}(w||{}),rn=new S(null),ct=(()=>{class i{constructor(t,e){if(this.dbConfig=t,this.platformId=e,!t.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!t.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=Ct(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,on(this.indexedDB,t.name,t.version,t.objectStoresMeta,t.migrationFactory),v(this.indexedDB,t.name).then(n=>{n.version!==t.version&&(this.dbConfig.version=n.version)}))}createObjectStore(t,e){let n=[t];on(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,n,e)}add(t,e,n){return new m(r=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{let c=y(s,_(w.readwrite,t,d=>r.error(d))).objectStore(t),l=n?c.add(e,n):c.add(e);l.onsuccess=d=>D(this,null,function*(){let u=d.target.result,p=c.get(u);p.onsuccess=f=>{r.next(f.target.result),r.complete()}})}).catch(s=>r.error(s))})}bulkAdd(t,e){let n=new Promise((r,s)=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{let l=y(a,_(w.readwrite,t,r,s)).objectStore(t),d=e.map(u=>new Promise((p,f)=>{let q=u.key;delete u.key;let j=q?l.add(u,q):l.add(u);j.onsuccess=A=>{let me=A.target.result;p(me)}}));r(Promise.all(d))}).catch(a=>s(a))});return z(n)}bulkDelete(t,e){let n=e.map(r=>new Promise((s,a)=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(c=>{let l=y(c,_(w.readwrite,t,a,s));l.objectStore(t).delete(r),l.oncomplete=()=>{this.getAll(t).pipe(Se(1)).subscribe(u=>{s(u)})}}).catch(c=>a(c))}));return z(Promise.all(n))}getByKey(t,e){return new m(n=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{let c=y(r,_(w.readonly,t,n.error)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result),n.complete()},c.onerror=l=>{n.error(l)}}).catch(r=>n.error(r))})}bulkGet(t,e){let n=e.map(r=>this.getByKey(t,r));return new m(r=>{dt(n).subscribe(s=>{r.next(s),r.complete()})})}getByID(t,e){return new m(n=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{E(r,t,l=>n.error(l));let c=y(r,_(w.readonly,t,n.error,n.next)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result)}}).catch(r=>n.error(r))})}getByIndex(t,e,n){return new m(r=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{E(s,t,u=>r.error(u));let d=y(s,_(w.readonly,t,r.error)).objectStore(t).index(e).get(n);d.onsuccess=u=>{r.next(u.target.result),r.complete()}}).catch(s=>r.error(s))})}getAll(t){return new m(e=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{E(n,t,c=>e.error(c));let a=y(n,_(w.readonly,t,e.error,e.next)).objectStore(t).getAll();a.onerror=c=>{e.error(c)},a.onsuccess=({target:{result:c}})=>{e.next(c),e.complete()}}).catch(n=>e.error(n))})}update(t,e){return new m(n=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{E(r,t,l=>n.error(l));let a=y(r,_(w.readwrite,t,l=>n.error(l))).objectStore(t),c=a.put(e);c.onsuccess=l=>D(this,null,function*(){let d=l.target.result,u=a.get(d);u.onsuccess=p=>{n.next(p.target.result),n.complete()}})}).catch(r=>n.error(r))})}delete(t,e){return new m(n=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{E(r,t,c=>n.error(c));let s=y(r,_(w.readwrite,t,c=>n.error(c)));s.objectStore(t).delete(e),s.oncomplete=()=>{this.getAll(t).pipe(Se(1)).subscribe(c=>{n.next(c),n.complete()})}}).catch(r=>n.error(r))})}deleteByKey(t,e){return new m(n=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{E(r,t,c=>n.error(c));let s=y(r,_(w.readwrite,t,c=>n.error(c))),a=s.objectStore(t);s.oncomplete=()=>{n.next(!0),n.complete()},a.delete(e)}).catch(r=>n.error(r))})}clear(t){return new m(e=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{E(n,t,a=>e.error(a));let r=y(n,_(w.readwrite,t,a=>e.error(a)));r.objectStore(t).clear(),r.oncomplete=()=>{e.next(!0),e.complete()}}).catch(n=>e.error(n))})}deleteDatabase(){return new m(t=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(e=>D(this,null,function*(){yield e.close();let n=this.indexedDB.deleteDatabase(this.dbConfig.name);n.onsuccess=()=>{t.next(!0),t.complete()},n.onerror=r=>t.error(r),n.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(e=>t.error(e))})}openCursor(t,e){return new m(n=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{E(r,t,l=>n.error(l));let a=y(r,_(w.readonly,t,n.error)).objectStore(t),c=e===void 0?a.openCursor():a.openCursor(e);c.onsuccess=l=>{n.next(l),n.complete()}}).catch(r=>n.error(r))})}openCursorByIndex(t,e,n,r=w.readonly){let s=new x;return v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{E(a,t,p=>{s.error(p)});let u=y(a,_(r,t,p=>{s.error(p)},()=>{s.next()})).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{s.next(p)}}).catch(a=>s.error(a)),s}getAllByIndex(t,e,n){let r=[];return new m(s=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{E(a,t,p=>s.error(p));let u=y(a,_(w.readonly,t,s.error)).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(r.push(f.value),f.continue()):(s.next(r),s.complete())}}).catch(a=>s.error(a))})}getAllKeysByIndex(t,e,n){let r=[];return new m(s=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{E(a,t,p=>s.error(p));let u=y(a,_(w.readonly,t,s.error)).objectStore(t).index(e).openKeyCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(r.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(s.next(r),s.complete())}}).catch(a=>s.error(a))})}count(t,e){return new m(n=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{E(r,t,l=>n.error(l));let c=y(r,_(w.readonly,t,n.error)).objectStore(t).count(e);c.onerror=l=>n.error(l),c.onsuccess=l=>{n.next(l.target.result),n.complete()}}).catch(r=>n.error(r))})}countByIndex(t,e,n){return new m(r=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{E(s,t,u=>r.error(u));let d=y(s,_(w.readonly,t,r.error)).objectStore(t).index(e).count(n);d.onerror=u=>r.error(u),d.onsuccess=u=>{r.next(u.target.result),r.complete()}}).catch(s=>r.error(s))})}deleteObjectStore(t){return _i(this.dbConfig.name,++this.dbConfig.version,t)}}return i.\u0275fac=function(t){return new(t||i)(h(rn),h(te))},i.\u0275prov=b({token:i,factory:i.\u0275fac}),i})(),or=(()=>{class i{static forRoot(t){return{ngModule:i,providers:[ct,{provide:rn,useValue:t}]}}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=U({type:i}),i.\u0275inj=W({imports:[[_t]]}),i})();var sn=(()=>{let o=class o{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,n){let r=this.getKey(n);return this.db.add(this.DATABASE,e,r).pipe(M(s=>e))}getCategoriesByChannelType(e){let n=this.getKey(e);return this.db.getByKey(this.DATABASE,n)}getKey(e){let n="";switch(e){case Le.Lazada:n="Lazada";break;case Le.Tokopedia:n="Tokopedia";break}return n}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let e=localStorage.getItem("Authorization");return this.hostName=JSON.parse(e)?.Host,this.hostName}};o.\u0275fac=function(n){return new(n||o)(h(ct))},o.\u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var an=(()=>{let o=class o{constructor(){}inititalizeIntercom(){let e=this.getFromLocalStorage();e?.Enabled&&window.Intercom("boot",{app_id:"xv1oomgl",name:e.Name,email:e.Email,created_at:e.Created,user_hash:e.Hash})}shutdown(){this.getFromLocalStorage()?.Enabled&&(window.Intercom("shutdown"),this.clearStorage())}clearStorage(){localStorage.removeItem("Intercom")}updateLocalStorage(e){let n={Enabled:!0};e&&(n=C(C({},n),e)),localStorage.setItem("Intercom",JSON.stringify(n))}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 ue.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}};o.\u0275fac=function(n){return new(n||o)},o.\u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var Ys=(()=>{let o=class o{constructor(e,n,r,s,a,c,l){this.httpService=e,this.tokenDecodeService=n,this.afAuth=r,this.ngxPermission=s,this.localDataService=a,this.router=c,this.intercomService=l,this.channels=[]}login(e){return this.httpService.post("/api/token/Login",e).pipe(oe(n=>{this.setLocalStorage(n,e.Host,e.Username),this.loadPermissions()}))}getNews(){return this.httpService.get(Mt.news).pipe(M(e=>e?.items?.map(n=>n?.properties)))}loginWithGoogle(e,n){e.preventDefault();let r=new Ke;return r.setCustomParameters({prompt:"select_account"}),z(this.afAuth.signInWithPopup(r)).pipe(M(s=>s.credential),M(s=>s.idToken),B(s=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:s,Host:n}))),oe(s=>{this.setLocalStorage(s,n,null),this.loadPermissions()}))}setLocalStorage(e,n,r){localStorage.setItem("user",JSON.stringify(e)),localStorage.setItem("Authorization",JSON.stringify({Host:n,username:r})),localStorage.setItem("channels",JSON.stringify(e.Channels)),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem("user");if(ue.IsNotEmpty(e)){let n=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(n)}}getChannels(){let e=JSON.parse(JSON.stringify(this.channels));if(this.channels.length===0){let n=localStorage.getItem("channels");n?(this.channels=JSON.parse(n),e=JSON.parse(JSON.stringify(this.channels))):(this.channels=[],e=[])}return e=this.setChannelLogo(e),e}setChannelLogo(e){return e=e.map(n=>(n.Img=ue.getChannelLogoByTypeId(n.TypeID),n)),e}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=JSON.parse(window.localStorage.getItem("user")),n=new Date;if(e!=null){let r=new Date(e.Token.expiredAt);return n<r?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem("Authorization");this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,this.channels=[],localStorage.removeItem("channels"),localStorage.removeItem("user"),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}};o.\u0275fac=function(n){return new(n||o)(h(St),h(Nt),h(at),h(jt),h(sn),h(kt),h(an))},o.\u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();export{Nt as a,Mt as b,ne as c,Lt as d,Cn as e,zi as f,co as g,Jo as h,or as i,sn as j,Ys as k};
4
+ `)})}var ei={error:"UNKNOWN_ERROR"};function ti(i){return Dt.encodeString(JSON.stringify(i),!1)}function rt(i,o=!1){return D(this,null,function*(){let t=i.app;Xt(t);let e=O(t),n=e.token,r;if(n&&!fe(n)&&(e.token=void 0,n=void 0),!n){let c=yield e.cachedTokenPromise;c&&(fe(c)?n=c:yield tt(t,void 0))}if(!o&&n&&fe(n))return{token:n.token};let s=!1;if(en()){e.exchangeTokenPromise||(e.exchangeTokenPromise=Yt(Qt(t,yield tn()),i.heartbeatServiceProvider).finally(()=>{e.exchangeTokenPromise=void 0}),s=!0);let c=yield e.exchangeTokenPromise;return yield tt(t,c),e.token=c,{token:c.token}}try{e.exchangeTokenPromise||(e.exchangeTokenPromise=e.provider.getToken().finally(()=>{e.exchangeTokenPromise=void 0}),s=!0),n=yield O(t).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"?ot.warn(c.message):ot.error(c),r=c}let a;return n?r?fe(n)?a={token:n.token,internalError:r}:a=Gt(r):(a={token:n.token},e.token=n,yield tt(t,n)):a=Gt(r),s&&ri(t,a),a})}function ni(i){return D(this,null,function*(){let o=i.app;Xt(o);let{provider:t}=O(o);if(en()){let e=yield tn(),{token:n}=yield Yt(Qt(o,e),i.heartbeatServiceProvider);return{token:n}}else{let{token:e}=yield t.getToken();return{token:e}}})}function ii(i,o,t,e){let{app:n}=i,r=O(n),s={next:t,error:e,type:o};if(r.tokenObservers=[...r.tokenObservers,s],r.token&&fe(r.token)){let a=r.token;Promise.resolve().then(()=>{t({token:a.token}),qt(i)}).catch(()=>{})}r.cachedTokenPromise.then(()=>qt(i))}function nn(i,o){let t=O(i),e=t.tokenObservers.filter(n=>n.next!==o);e.length===0&&t.tokenRefresher&&t.tokenRefresher.isRunning()&&t.tokenRefresher.stop(),t.tokenObservers=e}function qt(i){let{app:o}=i,t=O(o),e=t.tokenRefresher;e||(e=oi(i),t.tokenRefresher=e),!e.isRunning()&&t.isTokenAutoRefreshEnabled&&e.start()}function oi(i){let{app:o}=i;return new nt(()=>D(this,null,function*(){let t=O(o),e;if(t.token?e=yield rt(i,!0):e=yield rt(i),e.error)throw e.error;if(e.internalError)throw e.internalError}),()=>!0,()=>{let t=O(o);if(t.token){let e=t.token.issuedAtTimeMillis+(t.token.expireTimeMillis-t.token.issuedAtTimeMillis)*.5+3e5,n=t.token.expireTimeMillis-5*60*1e3;return e=Math.min(e,n),Math.max(0,e-Date.now())}else return 0},Kt.RETRIAL_MIN_WAIT,Kt.RETRIAL_MAX_WAIT)}function ri(i,o){let t=O(i).tokenObservers;for(let e of t)try{e.type==="EXTERNAL"&&o.error!=null?e.error(o.error):e.next(o)}catch{}}function fe(i){return i.expireTimeMillis-Date.now()>0}function Gt(i){return{token:ti(ei),error:i}}var st=class{constructor(o,t){this.app=o,this.heartbeatServiceProvider=t}_delete(){let{tokenObservers:o}=O(this.app);for(let t of o)nn(this.app,t.next);return Promise.resolve()}};function si(i,o){return new st(i,o)}function ai(i){return{getToken:o=>rt(i,o),getLimitedUseToken:()=>ni(i),addTokenListener:o=>ii(i,"INTERNAL",o),removeTokenListener:o=>nn(i.app,o)}}var ci="@firebase/app-check",li="0.8.1";var ui="app-check",Zt="app-check-internal";function di(){Ve(new Ue(ui,i=>{let o=i.getProvider("app").getImmediate(),t=i.getProvider("heartbeat");return si(o,t)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((i,o,t)=>{i.getProvider(Zt).initialize()})),Ve(new Ue(Zt,i=>{let o=i.getProvider("app-check").getImmediate();return ai(o)},"PUBLIC").setInstantiationMode("EXPLICIT")),de(ci,li)}di();var hi=["localhost","0.0.0.0","127.0.0.1"],jo=typeof window<"u"&&hi.includes(window.location.hostname);var fi=new S("angularfire2.auth.use-emulator"),mi=new S("angularfire2.auth.settings"),gi=new S("angularfire2.auth.tenant-id"),vi=new S("angularfire2.auth.langugage-code"),Ti=new S("angularfire2.auth.use-device-language"),bi=new S("angularfire.auth.persistence"),wi=(i,o,t,e,n,r,s,a)=>Vt(`${i.name}.auth`,"AngularFireAuth",i.name,()=>{let c=o.runOutsideAngular(()=>i.auth());if(t&&c.useEmulator(...t),e&&(c.tenantId=e),c.languageCode=n,r&&c.useDeviceLanguage(),s)for(let[l,d]of Object.entries(s))c.settings[l]=d;return a&&c.setPersistence(a),c},[t,e,n,r,s,a]),at=(()=>{class i{authState;idToken;user;idTokenResult;credential;constructor(t,e,n,r,s,a,c,l,d,u,p,f){let q=new x,j=ie(void 0).pipe(Z(s.outsideAngular),B(()=>r.runOutsideAngular(()=>import("https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-LKQ6EHTZ.js"))),M(()=>et(t,r,e)),M(A=>wi(A,r,a,l,d,u,c,p)),ke({bufferSize:1,refCount:!1}));if(It(n))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=ie(null);else{j.pipe(ft()).subscribe();let A=j.pipe(B(T=>T.getRedirectResult().then(N=>N,()=>null)),zt,ke({bufferSize:1,refCount:!1})),me=j.pipe(B(T=>new m(N=>({unsubscribe:r.runOutsideAngular(()=>T.onAuthStateChanged(G=>N.next(G),G=>N.error(G),()=>N.complete()))})))),Ae=j.pipe(B(T=>new m(N=>({unsubscribe:r.runOutsideAngular(()=>T.onIdTokenChanged(G=>N.next(G),G=>N.error(G),()=>N.complete()))}))));this.authState=A.pipe(Ee(me),Q(s.outsideAngular),Z(s.insideAngular)),this.user=A.pipe(Ee(Ae),Q(s.outsideAngular),Z(s.insideAngular)),this.idToken=this.user.pipe(B(T=>T?z(T.getIdToken()):ie(null))),this.idTokenResult=this.user.pipe(B(T=>T?z(T.getIdTokenResult()):ie(null))),this.credential=ht(A,q,this.authState.pipe(pt(T=>!T))).pipe(M(T=>T?.user?T:null),Q(s.outsideAngular),Z(s.insideAngular))}return Ut(this,j,r,{spy:{apply:(A,me,Ae)=>{(A.startsWith("signIn")||A.startsWith("createUser"))&&Ae.then(T=>q.next(T))}}})}static \u0275fac=function(e){return new(e||i)(h(_e),h(Ce,8),h(te),h(F),h($t),h(fi,8),h(mi,8),h(gi,8),h(vi,8),h(Ti,8),h(bi,8),h(he,8))};static \u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"any"})}return i})(),Jo=(()=>{class i{constructor(){R.registerVersion("angularfire",pe.full,"auth-compat")}static \u0275fac=function(e){return new(e||i)};static \u0275mod=U({type:i});static \u0275inj=W({providers:[at]})}return i})();function v(i,o,t,e){return new Promise((n,r)=>{i||r("IndexedDB not available");let s=i.open(o,t),a;s.onsuccess=c=>{a=s.result,n(a)},s.onerror=c=>{r(`IndexedDB error: ${s.error}`)},typeof e=="function"&&(s.onupgradeneeded=c=>{e(c,a)})})}function on(i,o,t,e,n){if(!i)return;let r=i.open(o,t);r.onupgradeneeded=s=>{let a=s.target.result;e.forEach(l=>{if(!a.objectStoreNames.contains(l.store)){let d=a.createObjectStore(l.store,l.storeConfig);l.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let c=n&&n();c&&Object.keys(c).map(l=>parseInt(l,10)).filter(l=>l>s.oldVersion).sort((l,d)=>l-d).forEach(l=>{c[l](a,r.transaction)}),a.close()},r.onsuccess=s=>{s.target.result.close()}}function _i(i,o,t){if(!i||!o||!t)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new m(e=>{try{let n=o+1,r=indexedDB.open(i,n);r.onupgradeneeded=s=>{let a=s.target.result;a.deleteObjectStore(t),a.close(),console.log("onupgradeneeded"),e.next(!0),e.complete()},r.onerror=s=>e.error(s)}catch(n){e.error(n)}})}function Ci(i,o){return i.objectStoreNames.contains(o)}function E(i,o,t){i||t("You need to use the openDatabase function to create a database before you query it!"),Ci(i,o)||t(`objectStore does not exists: ${o}`)}function y(i,o){let t=i.transaction(o.storeName,o.dbMode);return t.onerror=o.error,t.onabort=o.abort,t}function _(i,o,t,e){return{storeName:o,dbMode:i,error:n=>{t(n)},abort:n=>{t(n)}}}var w=function(i){return i.readonly="readonly",i.readwrite="readwrite",i}(w||{}),rn=new S(null),ct=(()=>{class i{constructor(t,e){if(this.dbConfig=t,this.platformId=e,!t.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!t.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=Ct(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,on(this.indexedDB,t.name,t.version,t.objectStoresMeta,t.migrationFactory),v(this.indexedDB,t.name).then(n=>{n.version!==t.version&&(this.dbConfig.version=n.version)}))}createObjectStore(t,e){let n=[t];on(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,n,e)}add(t,e,n){return new m(r=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{let c=y(s,_(w.readwrite,t,d=>r.error(d))).objectStore(t),l=n?c.add(e,n):c.add(e);l.onsuccess=d=>D(this,null,function*(){let u=d.target.result,p=c.get(u);p.onsuccess=f=>{r.next(f.target.result),r.complete()}})}).catch(s=>r.error(s))})}bulkAdd(t,e){let n=new Promise((r,s)=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{let l=y(a,_(w.readwrite,t,r,s)).objectStore(t),d=e.map(u=>new Promise((p,f)=>{let q=u.key;delete u.key;let j=q?l.add(u,q):l.add(u);j.onsuccess=A=>{let me=A.target.result;p(me)}}));r(Promise.all(d))}).catch(a=>s(a))});return z(n)}bulkDelete(t,e){let n=e.map(r=>new Promise((s,a)=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(c=>{let l=y(c,_(w.readwrite,t,a,s));l.objectStore(t).delete(r),l.oncomplete=()=>{this.getAll(t).pipe(Se(1)).subscribe(u=>{s(u)})}}).catch(c=>a(c))}));return z(Promise.all(n))}getByKey(t,e){return new m(n=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{let c=y(r,_(w.readonly,t,n.error)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result),n.complete()},c.onerror=l=>{n.error(l)}}).catch(r=>n.error(r))})}bulkGet(t,e){let n=e.map(r=>this.getByKey(t,r));return new m(r=>{dt(n).subscribe(s=>{r.next(s),r.complete()})})}getByID(t,e){return new m(n=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{E(r,t,l=>n.error(l));let c=y(r,_(w.readonly,t,n.error,n.next)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result)}}).catch(r=>n.error(r))})}getByIndex(t,e,n){return new m(r=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{E(s,t,u=>r.error(u));let d=y(s,_(w.readonly,t,r.error)).objectStore(t).index(e).get(n);d.onsuccess=u=>{r.next(u.target.result),r.complete()}}).catch(s=>r.error(s))})}getAll(t){return new m(e=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{E(n,t,c=>e.error(c));let a=y(n,_(w.readonly,t,e.error,e.next)).objectStore(t).getAll();a.onerror=c=>{e.error(c)},a.onsuccess=({target:{result:c}})=>{e.next(c),e.complete()}}).catch(n=>e.error(n))})}update(t,e){return new m(n=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{E(r,t,l=>n.error(l));let a=y(r,_(w.readwrite,t,l=>n.error(l))).objectStore(t),c=a.put(e);c.onsuccess=l=>D(this,null,function*(){let d=l.target.result,u=a.get(d);u.onsuccess=p=>{n.next(p.target.result),n.complete()}})}).catch(r=>n.error(r))})}delete(t,e){return new m(n=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{E(r,t,c=>n.error(c));let s=y(r,_(w.readwrite,t,c=>n.error(c)));s.objectStore(t).delete(e),s.oncomplete=()=>{this.getAll(t).pipe(Se(1)).subscribe(c=>{n.next(c),n.complete()})}}).catch(r=>n.error(r))})}deleteByKey(t,e){return new m(n=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{E(r,t,c=>n.error(c));let s=y(r,_(w.readwrite,t,c=>n.error(c))),a=s.objectStore(t);s.oncomplete=()=>{n.next(!0),n.complete()},a.delete(e)}).catch(r=>n.error(r))})}clear(t){return new m(e=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{E(n,t,a=>e.error(a));let r=y(n,_(w.readwrite,t,a=>e.error(a)));r.objectStore(t).clear(),r.oncomplete=()=>{e.next(!0),e.complete()}}).catch(n=>e.error(n))})}deleteDatabase(){return new m(t=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(e=>D(this,null,function*(){yield e.close();let n=this.indexedDB.deleteDatabase(this.dbConfig.name);n.onsuccess=()=>{t.next(!0),t.complete()},n.onerror=r=>t.error(r),n.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(e=>t.error(e))})}openCursor(t,e){return new m(n=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{E(r,t,l=>n.error(l));let a=y(r,_(w.readonly,t,n.error)).objectStore(t),c=e===void 0?a.openCursor():a.openCursor(e);c.onsuccess=l=>{n.next(l),n.complete()}}).catch(r=>n.error(r))})}openCursorByIndex(t,e,n,r=w.readonly){let s=new x;return v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{E(a,t,p=>{s.error(p)});let u=y(a,_(r,t,p=>{s.error(p)},()=>{s.next()})).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{s.next(p)}}).catch(a=>s.error(a)),s}getAllByIndex(t,e,n){let r=[];return new m(s=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{E(a,t,p=>s.error(p));let u=y(a,_(w.readonly,t,s.error)).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(r.push(f.value),f.continue()):(s.next(r),s.complete())}}).catch(a=>s.error(a))})}getAllKeysByIndex(t,e,n){let r=[];return new m(s=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{E(a,t,p=>s.error(p));let u=y(a,_(w.readonly,t,s.error)).objectStore(t).index(e).openKeyCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(r.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(s.next(r),s.complete())}}).catch(a=>s.error(a))})}count(t,e){return new m(n=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{E(r,t,l=>n.error(l));let c=y(r,_(w.readonly,t,n.error)).objectStore(t).count(e);c.onerror=l=>n.error(l),c.onsuccess=l=>{n.next(l.target.result),n.complete()}}).catch(r=>n.error(r))})}countByIndex(t,e,n){return new m(r=>{v(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{E(s,t,u=>r.error(u));let d=y(s,_(w.readonly,t,r.error)).objectStore(t).index(e).count(n);d.onerror=u=>r.error(u),d.onsuccess=u=>{r.next(u.target.result),r.complete()}}).catch(s=>r.error(s))})}deleteObjectStore(t){return _i(this.dbConfig.name,++this.dbConfig.version,t)}}return i.\u0275fac=function(t){return new(t||i)(h(rn),h(te))},i.\u0275prov=b({token:i,factory:i.\u0275fac}),i})(),or=(()=>{class i{static forRoot(t){return{ngModule:i,providers:[ct,{provide:rn,useValue:t}]}}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=U({type:i}),i.\u0275inj=W({imports:[[_t]]}),i})();var sn=(()=>{let o=class o{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,n){let r=this.getKey(n);return this.db.add(this.DATABASE,e,r).pipe(M(s=>e))}getCategoriesByChannelType(e){let n=this.getKey(e);return this.db.getByKey(this.DATABASE,n)}getKey(e){let n="";switch(e){case Le.Lazada:n="Lazada";break;case Le.Tokopedia:n="Tokopedia";break}return n}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let e=localStorage.getItem("Authorization");return this.hostName=JSON.parse(e)?.Host,this.hostName}};o.\u0275fac=function(n){return new(n||o)(h(ct))},o.\u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var an=(()=>{let o=class o{constructor(){}inititalizeIntercom(){let e=this.getFromLocalStorage();e?.Enabled&&window.Intercom("boot",{app_id:"xv1oomgl",name:e.Name,email:e.Email,created_at:e.Created,user_hash:e.Hash})}shutdown(){this.getFromLocalStorage()?.Enabled&&(window.Intercom("shutdown"),this.clearStorage())}clearStorage(){localStorage.removeItem("Intercom")}updateLocalStorage(e){let n={Enabled:!0};e&&(n=C(C({},n),e)),localStorage.setItem("Intercom",JSON.stringify(n))}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 ue.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}};o.\u0275fac=function(n){return new(n||o)},o.\u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var Ys=(()=>{let o=class o{constructor(e,n,r,s,a,c,l){this.httpService=e,this.tokenDecodeService=n,this.afAuth=r,this.ngxPermission=s,this.localDataService=a,this.router=c,this.intercomService=l,this.channels=[]}login(e){return this.httpService.post("/api/token/Login",e).pipe(oe(n=>{this.setLocalStorage(n,e.Host,e.Username),this.loadPermissions()}))}getNews(){return this.httpService.get(Mt.news).pipe(M(e=>e?.items?.map(n=>n?.properties)))}loginWithGoogle(e,n){e.preventDefault();let r=new Ke;return r.setCustomParameters({prompt:"select_account"}),z(this.afAuth.signInWithPopup(r)).pipe(M(s=>s.credential),M(s=>s.idToken),B(s=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:s,Host:n}))),oe(s=>{this.setLocalStorage(s,n,null),this.loadPermissions()}))}setLocalStorage(e,n,r){localStorage.setItem("user",JSON.stringify(e)),localStorage.setItem("Authorization",JSON.stringify({Host:n,username:r})),localStorage.setItem("channels",JSON.stringify(e.Channels)),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem("user");if(ue.IsNotEmpty(e)){let n=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(n)}}getChannels(){let e=JSON.parse(JSON.stringify(this.channels));if(this.channels.length===0){let n=localStorage.getItem("channels");n?(this.channels=JSON.parse(n),e=JSON.parse(JSON.stringify(this.channels))):(this.channels=[],e=[])}return e=this.setChannelLogo(e),e}setChannelLogo(e){return e=e.map(n=>(n.Img=ue.getChannelLogoByTypeId(n.TypeID),n)),e}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=JSON.parse(window.localStorage.getItem("user")),n=new Date;if(e!=null){let r=new Date(e.Token.expiredAt);return n<r?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem("Authorization");this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,this.channels=[],localStorage.removeItem("channels"),localStorage.removeItem("user"),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}};o.\u0275fac=function(n){return new(n||o)(h(St),h(Nt),h(at),h(jt),h(sn),h(kt),h(an))},o.\u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();export{Nt as a,Mt as b,ne as c,Lt as d,Cn as e,zi as f,co as g,Jo as h,or as i,sn as j,Ys as k};
@@ -1,2 +1,2 @@
1
- import{a as D,b as Ee,c as Pe,d as ae,e as oe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-32LBRSCJ.js";import{a as Me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-BLMEJMMZ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-PNLW4YVH.js";import{a as Ve,b as De}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-WOHUGR5B.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-OOD7TLAL.js";import{a as ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-ZRFFM47Q.js";import{a as ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-YILL4GKX.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-OV2NRCQ5.js";import{a as Ie,b as we}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-3KM6M3SV.js";import{a as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-TBOHCD6E.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-KPPQNI2R.js";import{a as Ce,b as fe,d as xe,e as ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-SOPDRQWM.js";import{a as re}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-NJM2XHQY.js";import{d as q,k as W}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-XDU5GZAR.js";import{a as H}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-L6CJT6UC.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-SHX3JAGT.js";import{B as ye,C as te,D as be,q as X,r as Se,u as ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-SQR4ZRTF.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-NN3SPEH5.js";import{b as ge,c as K,h as Y,k as J,m as Z,u as he}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-FDI2UIO2.js";import{c as V}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-7RTQ2IDL.js";import{$a as l,Aa as N,Ac as G,B,Fb as f,Ga as r,Gb as x,Ha as y,Hb as O,Ob as R,Qa as p,Wa as u,X as k,_b as me,aa as $,ab as s,ac as de,bb as v,bc as U,cb as b,db as I,ea as P,ec as j,fa as A,fb as S,fc as _e,hc as z,ic as Q,ja as d,jb as g,ka as _,lb as c,ob as pe,q as se,qb as F,rb as m,sb as E,tb as w,ub as ce,wc as ue,yb as L}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-FA44W5LU.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-ZKZWHDGN.js";var Ne=(()=>{let o=class o{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=P({type:o,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,a){n&1&&(l(0,"nav",0)(1,"div",1)(2,"div"),v(3,"nav-tab",2),s()()(),v(4,"router-outlet")),n&2&&(r(3),p("Tabs",a.inventoryTabs))},dependencies:[ue,Ie]});let i=o;return i})();function Ye(i,o){if(i&1){let e=S();l(0,"button",21),g("click",function(){d(e);let n=c().ngIf,a=c(2);return _(a.onUpdateItems(n))}),v(1,"i",22),m(2," Update "),s()}}function Je(i,o){if(i&1&&(l(0,"actions")(1,"div",19),u(2,Ye,3,0,"button",20),s()()),i&2){let e=o.ngIf,t=c(2);r(2),p("ngIf",t.productService.hasSelectionVariant(e))}}function Ze(i,o){if(i&1){let e=S();l(0,"app-table",23),g("onToggle",function(n){d(e);let a=c(2);return _(a.onShowDifferenceStock(n))})("onSubmit",function(n){let h=d(e).ngIf,C=c(2);return _(C.updateStockByVariant(n,h))}),s()}if(i&2){let e=o.ngIf,t=c(2);p("data",e)("channel",t.channelOptions)("showProductToggle",!0)("filter",t.searchFilter)}}function qe(i,o){if(i&1){let e=S();l(0,"span",24),g("click",function(){d(e);let n=c(2);return _(n.getRowCount())}),l(1,"i",25),m(2,"?"),s()()}}function We(i,o){if(i&1&&(l(0,"span"),m(1),f(2,"number"),s()),i&2){let e=o.ngIf;r(1),E(x(2,1,e))}}function Xe(i,o){if(i&1){let e=S();l(0,"a",26),g("click",function(){d(e);let n=c(2);return _(n.nextPage())}),v(1,"i",27),m(2," Next"),s()}}function et(i,o){if(i&1){let e=S();l(0,"a",28),g("click",function(){d(e);let n=c(2);return _(n.getAllData())}),v(1,"i",29),m(2," Last"),s()}}function tt(i,o){if(i&1){let e=S();l(0,"mainpanel",1),g("onSubmit",function(n){d(e);let a=c();return _(a.onSearch(n))}),u(1,Je,3,1,"actions",2),f(2,"async"),l(3,"filters")(4,"div")(5,"label",3),m(6,"PageNumber"),s(),l(7,"input",4),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.PageNumber=n)}),s()(),l(8,"div",5)(9,"label",6),m(10,"Page Size"),s(),l(11,"input",7),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.RowCount=n)}),s()()(),l(12,"content")(13,"div",8)(14,"div",9)(15,"div",10),u(16,Ze,1,4,"app-table",11),f(17,"async"),b(18),l(19,"div",12)(20,"div",13)(21,"div",14),m(22),f(23,"number"),f(24,"async"),u(25,qe,3,0,"span",15)(26,We,3,3,"span",2),f(27,"async"),m(28),s()(),l(29,"div",16),u(30,Xe,3,0,"a",17)(31,et,3,0,"a",18),s()(),I(),s()()()()()}if(i&2){let e=c(),t;p("pageData",e.pageData)("hideSearchBox",!1)("textButton","Search"),r(1),p("ngIf",x(2,13,e.paginationService.data$)),r(6),p("ngModel",e.searchFilter.PageNumber),r(4),p("ngModel",e.searchFilter.RowCount),r(5),p("ngIf",x(17,15,e.paginationService.data$)),r(6),w(" Showing 1 - ",x(23,17,(t=x(24,19,e.paginationService.data$))==null?null:t.length)," of "),r(3),p("ngIf",e.paginationService.hideCount),r(1),p("ngIf",x(27,21,!e.paginationService.hideCount&&e.allDataCount$)),r(2),w(" records ~ ",e.paginationService.footerPageNumber," Page "),r(2),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),r(1),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}var ke=(()=>{let o=class o{constructor(t,n,a,h,C,T){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=h,this.productService=C,this.authService=T,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:D.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,n){let a=this.productService.selectedVariantProduct(t);if(a.length>0){let C=a.map(M=>({ID:M.ID,Code:M.Code,Inventory:M.Inventory}));var h=n.filter(M=>M.selected).map(M=>M.ID);let T={ListChannelID:h,List:C};this.http.post("/api/Inventory/UpdateChannel",T).subscribe(M=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+T.List.length+" variants in "+T.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(h=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+C.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=D.DIFFERENCE:this.searchFilter.filterModel=D.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let n=this.productService.selectedVariantProduct(t);this.dialog.open(Me,{data:{selectedItems:n,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe(B(a=>V.IsNotEmpty(a))).subscribe(a=>{this.updateStock(t,a)})}getRowCount(){this.paginationService.hideCount=!1;let t={text:this.searchFilter.text};this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,t)}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(H),y(q),y(ee),y(ie),y(ne),y(W))},o.\u0275cmp=P({type:o,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit"],[4,"ngIf"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[1,"mt-5"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[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"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary border-start-0","title","Load all products",3,"click",4,"ngIf"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[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",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(n,a){n&1&&(u(0,tt,32,23,"mainpanel",0),f(1,"async")),n&2&&p("ngIf",x(1,1,a.loader$))},dependencies:[U,K,Z,Y,J,te,ae,X,j,z],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();function nt(i,o){if(i&1){let e=S();l(0,"button",39),g("click",function(){d(e);let n=c().ngIf,a=c(2);return _(a.updateStock(n))}),v(1,"i",40),m(2," Update"),s()}}function it(i,o){if(i&1&&(l(0,"div"),u(1,nt,3,0,"button",38),s()),i&2){let e=o.ngIf,t=c(2);r(1),p("ngIf",t.productService.hasSelectionVariant(e))}}function at(i,o){if(i&1&&(l(0,"span",41),v(1,"img",42),s(),m(2)),i&2){let e=o.item;r(1),p("src",e==null?null:e.Img,N),r(1),w(" ",e.Name," ")}}function ot(i,o){i&1&&(l(0,"div",43)(1,"span"),m(2," showing only different stock, please press next to populate more data "),s()())}function lt(i,o){if(i&1){let e=S();l(0,"th")(1,"input",44),g("ngModelChange",function(n){d(e);let a=c(2);return _(a.checkboxState=n)})("ngModelChange",function(){let a=d(e).ngIf,h=c(2);return _(h.onCheckboxStateChange(a))}),s()()}if(i&2){let e=c(2);r(1),p("ngModel",e.checkboxState)}}function rt(i,o){i&1&&(b(0),l(1,"th",45),m(2," Reserved "),s(),I())}function st(i,o){if(i&1){let e=S();b(0),l(1,"input",61),g("ngModelChange",function(n){d(e);let a=c(3).$implicit;return _(a.selected=n)})("ngModelChange",function(){d(e);let n=c(3).$implicit,a=c(2);return _(a.onCheckboxStateProduct(n))}),s(),I()}if(i&2){let e=c(3).$implicit;r(1),p("ngModel",e.selected)}}function pt(i,o){if(i&1){let e=S();b(0),l(1,"img",62),g("click",function(n){d(e);let a=c(3).$implicit,h=c(2);return _(h.onZoomImage(n,a==null?null:a.ImageUrl))}),s(),I()}if(i&2){let e=c(3).$implicit;r(1),pe("src",e==null?null:e.ThumbnailUrl,N)}}function ct(i,o){i&1&&v(0,"img",63)}function mt(i,o){if(i&1&&(b(0),v(1,"br"),l(2,"div",64),v(3,"i",65),l(4,"small"),m(5),s()(),I()),i&2){let e=c(3).$implicit;r(5),w("(",e==null?null:e.Category,")")}}var dt=i=>({"ms-10":i});function _t(i,o){if(i&1&&(b(0),l(1,"td",57)(2,"div",13),u(3,st,2,1,"ng-container",3),l(4,"div",49),u(5,pt,2,1,"ng-container",51)(6,ct,1,0,"ng-template",null,58,R),s()()(),l(8,"td",59)(9,"span",60),m(10),s(),u(11,mt,6,1,"ng-container",3),s(),I()),i&2){let e=F(7),t=c(2).$implicit,n=c(2);r(1),p("rowSpan",t==null?null:t.Variants.length),r(2),p("ngIf",t.Variants.length>1),r(1),p("ngClass",L(8,dt,t.Variants.length<=1)),r(1),p("ngIf",t==null?null:t.ThumbnailUrl)("ngIfElse",e),r(3),p("rowSpan",t==null?null:t.Variants.length),r(2),E(t==null?null:t.Name),r(1),p("ngIf",t.CategoryID!==null&&t.CategoryID!=n.guidEmpty)}}function ut(i,o){if(i&1){let e=S();b(0),l(1,"input",44),g("ngModelChange",function(n){d(e);let a=c(2).$implicit;return _(a.selected=n)}),s(),I()}if(i&2){let e=c(2).$implicit;r(1),p("ngModel",e.selected)}}function gt(i,o){if(i&1&&(b(0),u(1,ut,2,1,"ng-container",3),I()),i&2){let e=c().$implicit;r(1),p("ngIf",(e==null?null:e.Inventory)<=1e5)}}function ht(i,o){if(i&1){let e=S();l(0,"input",44),g("ngModelChange",function(n){d(e);let a=c(2).$implicit;return _(a.selected=n)}),s()}if(i&2){let e=c(2).$implicit;p("ngModel",e.selected)}}function Ct(i,o){if(i&1&&u(0,ht,1,1,"input",66),i&2){let e=c().$implicit;p("ngIf",(e==null?null:e.Inventory)>=0)}}function ft(i,o){i&1&&(l(0,"div",67),m(1,"Not Found"),s())}function xt(i,o){if(i&1&&(l(0,"div")(1,"span",68),m(2),f(3,"number"),s(),m(4," => "),l(5,"span",69),m(6),f(7,"number"),s()()),i&2){let e=c().$implicit;r(2),w(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),r(4),E(x(7,4,e==null?null:e.Inventory))}}function vt(i,o){if(i&1&&(l(0,"div"),m(1),f(2,"number"),s()),i&2){let e=c().$implicit;r(1),w(" ",x(2,1,e==null?null:e.Inventory)," ")}}function St(i,o){if(i&1&&(b(0),l(1,"div",70)(2,"a",71),v(3,"i",72),s()(),I()),i&2){let e=c().$implicit,t=c(3);r(2),p("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),N)}}var yt=i=>({"bg-gradient-warning":i});function bt(i,o){if(i&1){let e=S();l(0,"td",73)(1,"div",48)(2,"div")(3,"span",74),g("click",function(){d(e);let n=c().$implicit,a=c(),h=a.$implicit,C=a.ngForOf,T=c(2);return _(T.openTableDialog(h,n,C))}),m(4),f(5,"number"),s()(),l(6,"div",70)(7,"a",71),v(8,"i",72),s()(),l(9,"div",70)(10,"span",75),g("click",function(){d(e);let n=c().$implicit,a=c(3);return _(a.refreshInventory(n==null||n.Channel[0]==null?null:n.Channel[0].ChannelItemID,n==null||n.Channel[0]==null?null:n.Channel[0].ChannelVariationID,n==null||n.Channel[0]==null?null:n.Channel[0].ChannelID,n==null?null:n.ID))}),v(11,"i",76),s()()()()}if(i&2){let e=c().$implicit;p("ngClass",L(5,yt,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),r(4),w(" ",x(5,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," "),r(3),p("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,N)}}function It(i,o){if(i&1&&(b(0),l(1,"span",79),m(2),f(3,"number"),s(),I()),i&2){let e=c(2).$implicit;r(2),w(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function wt(i,o){i&1&&m(0," - ")}function Tt(i,o){if(i&1&&(b(0),l(1,"td",77),u(2,It,4,3,"ng-container",51)(3,wt,1,0,"ng-template",null,78,R),s(),I()),i&2){let e=F(4),t=c().$implicit;r(2),p("ngIf",t==null||t.Channel[0]==null?null:t.Channel[0].InventoryReserved)("ngIfElse",e)}}function Mt(i,o){i&1&&(b(0),m(1," - "),I())}function Et(i,o){if(i&1&&(l(0,"span",80),f(1,"date"),m(2),f(3,"date"),s()),i&2){let e=c().$implicit;p("matTooltip",O(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),r(2),w(" ",O(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}var Vt=i=>({"text-decoration-line-through":i});function Dt(i,o){if(i&1&&(l(0,"tr"),u(1,_t,12,10,"ng-container",3),l(2,"td",46),m(3),s(),l(4,"td",47)(5,"div",48)(6,"span",49),m(7),s()()(),l(8,"td",50),u(9,gt,2,1,"ng-container",51)(10,Ct,1,1,"ng-template",null,52,R),s(),l(12,"td")(13,"div",48),u(14,ft,2,0,"div",53)(15,xt,8,6,"div",3)(16,vt,3,3,"div",3)(17,St,4,1,"ng-container",3),s()(),u(18,bt,12,7,"td",54)(19,Tt,5,2,"ng-container",3),l(20,"td",55),u(21,Mt,2,0,"ng-container",51)(22,Et,4,8,"ng-template",null,56,R),s()()),i&2){let e=o.$implicit,t=o.index,n=F(11),a=F(23),h=c(3);r(1),p("ngIf",t==0),r(2),E(e==null?null:e.Model),r(1),p("matTooltip",e.isDiscontinued?h.discontinuedVariantMsg:""),r(2),p("ngClass",L(15,Vt,e.isDiscontinued)),r(1),E(e==null?null:e.Code),r(2),p("ngIf",(e==null?null:e.Channel[0].TypeID)==1)("ngIfElse",n),r(5),p("ngIf",(e==null?null:e.I)==null),r(1),p("ngIf",(e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)),r(1),p("ngIf",(e==null?null:e.I)!=null&&(e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)),r(1),p("ngIf",(e==null?null:e.I)!=null),r(1),p("ngIf",e==null?null:e.Channel),r(1),p("ngIf",h.isShowReservedColumn),r(2),p("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==h.minDate)("ngIfElse",a)}}function Pt(i,o){if(i&1&&(l(0,"tbody"),u(1,Dt,24,17,"tr",32),s()),i&2){let e=o.$implicit;r(1),p("ngForOf",e.Variants)}}function Nt(i,o){if(i&1){let e=S();l(0,"span",81),g("click",function(){d(e);let n=c(2);return _(n.getRowCount())}),l(1,"i",82),m(2,"?"),s()()}}function kt(i,o){if(i&1&&(l(0,"span"),m(1),f(2,"number"),s()),i&2){let e=o.ngIf;r(1),E(x(2,1,e==null?null:e.Total))}}function Ft(i,o){if(i&1){let e=S();l(0,"a",86),g("click",function(){d(e);let n=c(3);return _(n.onNextPage())}),v(1,"i",87),m(2," Next"),s()}}function Rt(i,o){if(i&1){let e=S();l(0,"a",88),g("click",function(){d(e);let n=c(3);return _(n.onLastPage())}),v(1,"i",89),m(2," Last"),s()}}function Bt(i,o){if(i&1&&(l(0,"div",83),u(1,Ft,3,0,"a",84)(2,Rt,3,0,"a",85),s()),i&2){let e=c(2);r(1),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),r(1),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}function $t(i,o){if(i&1){let e=S();l(0,"mainpanel",1),g("onSubmit",function(n){d(e);let a=c();return _(a.onSearch(n))}),l(1,"actions")(2,"div",2),u(3,it,2,1,"div",3),f(4,"async"),s()(),l(5,"filters")(6,"div")(7,"label",4),m(8,"Channel"),s(),l(9,"ng-select",5),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.ChannelID=n)}),u(10,at,3,2,"ng-template",6),s()(),l(11,"div",7)(12,"label",8),m(13,"PageNumber"),s(),l(14,"input",9),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.PageNumber=n)}),s()(),l(15,"div",7)(16,"label",10),m(17,"Page Size"),s(),l(18,"input",11),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.RowCount=n)}),s()(),l(19,"div",7)(20,"label",12),m(21,"Quantity From - To"),s(),l(22,"div",13)(23,"input",14),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.QuantityFrom=n)}),s(),m(24," - "),l(25,"input",15),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.QuantityTo=n)}),s()()()(),l(26,"content")(27,"div",16)(28,"div",17)(29,"div",18),u(30,ot,3,0,"div",19),l(31,"table",20)(32,"thead",21)(33,"tr")(34,"th",22),m(35,"Product "),v(36,"br"),l(37,"mat-slide-toggle",23),g("toggleChange",function(){d(e);let n=c();return n.showDifferenceStock=!n.showDifferenceStock,_(n.onShowDifferenceStock())}),l(38,"small",12),m(39,"FILTER DIFFERENT INVENTORY"),s()()(),l(40,"th",24),m(41,"Variant"),s(),l(42,"th",25),m(43,"SKU"),s(),u(44,lt,2,1,"th",3),f(45,"async"),l(46,"th",26),m(47,"POS"),s(),l(48,"th",27)(49,"div",28),g("click",function(){d(e);let n=c();return _(n.openModalFilter())}),v(50,"img",29),l(51,"span",30),m(52),f(53,"stringLimit"),s()()(),u(54,rt,3,0,"ng-container",3),l(55,"th",31),m(56,"Last Sync"),s()()(),u(57,Pt,2,1,"tbody",32),f(58,"async"),s(),l(59,"div",33)(60,"div",34)(61,"div",35),m(62),f(63,"number"),f(64,"async"),u(65,Nt,3,0,"span",36)(66,kt,3,3,"span",3),f(67,"async"),m(68),s()(),u(69,Bt,3,2,"div",37),f(70,"async"),s()()()()()()}if(i&2){let e=c(),t,n;p("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),r(3),p("ngIf",x(4,24,e.paginationService.data$)),r(6),p("clearable",!1)("items",e.channelOptions)("ngModel",e.searchFilter.ChannelID),r(5),p("ngModel",e.searchFilter.PageNumber),r(4),p("ngModel",e.searchFilter.RowCount),r(5),p("ngModel",e.searchFilter.QuantityFrom),r(2),p("ngModel",e.searchFilter.QuantityTo),r(5),p("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),r(14),p("ngIf",x(45,26,e.paginationService.data$)),r(5),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?e.selectedChannel==null?null:e.selectedChannel.Name:""),r(1),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,N),r(2),ce(" ",O(53,28,e.selectedChannel==null?null:e.selectedChannel.Name,13),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?"...":""," "),r(2),p("ngIf",e.isShowReservedColumn),r(3),p("ngForOf",x(58,31,e.products$)),r(5),w(" Showing 1 - ",x(63,33,(t=x(64,35,e.paginationService.data$))==null?null:t.length)," of "),r(3),p("ngIf",e.paginationService.hideCount),r(1),p("ngIf",x(67,37,!e.paginationService.hideCount&&e.rowCount$)),r(2),w(" records ~ ",e.paginationService.footerPageNumber," Page "),r(1),p("ngIf",((n=x(70,39,e.paginationService.data$))==null?null:n.length)>0)}}var Fe=(()=>{let o=class o{constructor(t,n,a,h,C,T,M,Be,$e){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=h,this.productService=C,this.authService=T,this.biggerPictureService=M,this.inventoryService=Be,this.mainPanelService=$e,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=V.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=V.GuidEMpty,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.paginationService.data$.pipe(se(t=>(t=t.map(n=>(n.Variants&&(n.Variants=n.Variants.map(a=>(a.isDiscontinued=n.Discontinued=="Yes",a))),n)),t)),k(t=>{this.checkShowReservedColumn(t)}))}checkShowReservedColumn(t){let n=0,a;t.forEach(h=>{a=h.Variants.find(C=>V.IsNotEmpty(C?.Channel[0]?.InventoryReserved)),a&&(n+=1)}),this.isShowReservedColumn=n>0}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe(k(t=>{if(this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.initSelectedChannel(),this.paginationService.reloadPagination(this.searchFilter),!t.Filter.IsMarketplaceAppActive){let n=`Automatic inventory sync disabled.
1
+ import{a as D,b as Ee,c as Pe,d as ae,e as oe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-LDMABSVE.js";import{a as Me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-ODJ4UZGV.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-UCVQS5HR.js";import{a as Ve,b as De}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-H57B7P7N.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-UWYERBYV.js";import{a as ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-Z3NC34XH.js";import{a as ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-BFNB4J5W.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-F5ZJBCUU.js";import{a as Ie,b as we}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-3CF7HOB3.js";import{a as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-52UFYFEM.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-ZQYW374F.js";import{a as Ce,b as fe,d as xe,e as ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-QOGXVEGW.js";import{a as re}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-QZFQKQ7J.js";import{d as q,k as W}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-C7TRF3SY.js";import{a as H}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-V3UGRPNZ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-FTHNPPXM.js";import{B as ye,C as te,D as be,q as X,r as Se,u as ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-36GAH775.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-C3TFPYXX.js";import{b as ge,c as K,h as Y,k as J,m as Z,u as he}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-XDLTNTVT.js";import{c as V}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-VXL3UMDN.js";import{$a as l,Aa as N,Ac as G,B,Fb as f,Ga as r,Gb as x,Ha as y,Hb as O,Ob as R,Qa as p,Wa as u,X as k,_b as me,aa as $,ab as s,ac as de,bb as v,bc as U,cb as b,db as I,ea as P,ec as j,fa as A,fb as S,fc as _e,hc as z,ic as Q,ja as d,jb as g,ka as _,lb as c,ob as pe,q as se,qb as F,rb as m,sb as E,tb as w,ub as ce,wc as ue,yb as L}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-P24WVMWI.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-PUBPICPK.js";var Ne=(()=>{let o=class o{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=P({type:o,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,a){n&1&&(l(0,"nav",0)(1,"div",1)(2,"div"),v(3,"nav-tab",2),s()()(),v(4,"router-outlet")),n&2&&(r(3),p("Tabs",a.inventoryTabs))},dependencies:[ue,Ie]});let i=o;return i})();function Ye(i,o){if(i&1){let e=S();l(0,"button",21),g("click",function(){d(e);let n=c().ngIf,a=c(2);return _(a.onUpdateItems(n))}),v(1,"i",22),m(2," Update "),s()}}function Je(i,o){if(i&1&&(l(0,"actions")(1,"div",19),u(2,Ye,3,0,"button",20),s()()),i&2){let e=o.ngIf,t=c(2);r(2),p("ngIf",t.productService.hasSelectionVariant(e))}}function Ze(i,o){if(i&1){let e=S();l(0,"app-table",23),g("onToggle",function(n){d(e);let a=c(2);return _(a.onShowDifferenceStock(n))})("onSubmit",function(n){let h=d(e).ngIf,C=c(2);return _(C.updateStockByVariant(n,h))}),s()}if(i&2){let e=o.ngIf,t=c(2);p("data",e)("channel",t.channelOptions)("showProductToggle",!0)("filter",t.searchFilter)}}function qe(i,o){if(i&1){let e=S();l(0,"span",24),g("click",function(){d(e);let n=c(2);return _(n.getRowCount())}),l(1,"i",25),m(2,"?"),s()()}}function We(i,o){if(i&1&&(l(0,"span"),m(1),f(2,"number"),s()),i&2){let e=o.ngIf;r(1),E(x(2,1,e))}}function Xe(i,o){if(i&1){let e=S();l(0,"a",26),g("click",function(){d(e);let n=c(2);return _(n.nextPage())}),v(1,"i",27),m(2," Next"),s()}}function et(i,o){if(i&1){let e=S();l(0,"a",28),g("click",function(){d(e);let n=c(2);return _(n.getAllData())}),v(1,"i",29),m(2," Last"),s()}}function tt(i,o){if(i&1){let e=S();l(0,"mainpanel",1),g("onSubmit",function(n){d(e);let a=c();return _(a.onSearch(n))}),u(1,Je,3,1,"actions",2),f(2,"async"),l(3,"filters")(4,"div")(5,"label",3),m(6,"PageNumber"),s(),l(7,"input",4),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.PageNumber=n)}),s()(),l(8,"div",5)(9,"label",6),m(10,"Page Size"),s(),l(11,"input",7),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.RowCount=n)}),s()()(),l(12,"content")(13,"div",8)(14,"div",9)(15,"div",10),u(16,Ze,1,4,"app-table",11),f(17,"async"),b(18),l(19,"div",12)(20,"div",13)(21,"div",14),m(22),f(23,"number"),f(24,"async"),u(25,qe,3,0,"span",15)(26,We,3,3,"span",2),f(27,"async"),m(28),s()(),l(29,"div",16),u(30,Xe,3,0,"a",17)(31,et,3,0,"a",18),s()(),I(),s()()()()()}if(i&2){let e=c(),t;p("pageData",e.pageData)("hideSearchBox",!1)("textButton","Search"),r(1),p("ngIf",x(2,13,e.paginationService.data$)),r(6),p("ngModel",e.searchFilter.PageNumber),r(4),p("ngModel",e.searchFilter.RowCount),r(5),p("ngIf",x(17,15,e.paginationService.data$)),r(6),w(" Showing 1 - ",x(23,17,(t=x(24,19,e.paginationService.data$))==null?null:t.length)," of "),r(3),p("ngIf",e.paginationService.hideCount),r(1),p("ngIf",x(27,21,!e.paginationService.hideCount&&e.allDataCount$)),r(2),w(" records ~ ",e.paginationService.footerPageNumber," Page "),r(2),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),r(1),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}var ke=(()=>{let o=class o{constructor(t,n,a,h,C,T){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=h,this.productService=C,this.authService=T,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:D.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,n){let a=this.productService.selectedVariantProduct(t);if(a.length>0){let C=a.map(M=>({ID:M.ID,Code:M.Code,Inventory:M.Inventory}));var h=n.filter(M=>M.selected).map(M=>M.ID);let T={ListChannelID:h,List:C};this.http.post("/api/Inventory/UpdateChannel",T).subscribe(M=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+T.List.length+" variants in "+T.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(h=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+C.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=D.DIFFERENCE:this.searchFilter.filterModel=D.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let n=this.productService.selectedVariantProduct(t);this.dialog.open(Me,{data:{selectedItems:n,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe(B(a=>V.IsNotEmpty(a))).subscribe(a=>{this.updateStock(t,a)})}getRowCount(){this.paginationService.hideCount=!1;let t={text:this.searchFilter.text};this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,t)}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(H),y(q),y(ee),y(ie),y(ne),y(W))},o.\u0275cmp=P({type:o,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit"],[4,"ngIf"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[1,"mt-5"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[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"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary border-start-0","title","Load all products",3,"click",4,"ngIf"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[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",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(n,a){n&1&&(u(0,tt,32,23,"mainpanel",0),f(1,"async")),n&2&&p("ngIf",x(1,1,a.loader$))},dependencies:[U,K,Z,Y,J,te,ae,X,j,z],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();function nt(i,o){if(i&1){let e=S();l(0,"button",39),g("click",function(){d(e);let n=c().ngIf,a=c(2);return _(a.updateStock(n))}),v(1,"i",40),m(2," Update"),s()}}function it(i,o){if(i&1&&(l(0,"div"),u(1,nt,3,0,"button",38),s()),i&2){let e=o.ngIf,t=c(2);r(1),p("ngIf",t.productService.hasSelectionVariant(e))}}function at(i,o){if(i&1&&(l(0,"span",41),v(1,"img",42),s(),m(2)),i&2){let e=o.item;r(1),p("src",e==null?null:e.Img,N),r(1),w(" ",e.Name," ")}}function ot(i,o){i&1&&(l(0,"div",43)(1,"span"),m(2," showing only different stock, please press next to populate more data "),s()())}function lt(i,o){if(i&1){let e=S();l(0,"th")(1,"input",44),g("ngModelChange",function(n){d(e);let a=c(2);return _(a.checkboxState=n)})("ngModelChange",function(){let a=d(e).ngIf,h=c(2);return _(h.onCheckboxStateChange(a))}),s()()}if(i&2){let e=c(2);r(1),p("ngModel",e.checkboxState)}}function rt(i,o){i&1&&(b(0),l(1,"th",45),m(2," Reserved "),s(),I())}function st(i,o){if(i&1){let e=S();b(0),l(1,"input",61),g("ngModelChange",function(n){d(e);let a=c(3).$implicit;return _(a.selected=n)})("ngModelChange",function(){d(e);let n=c(3).$implicit,a=c(2);return _(a.onCheckboxStateProduct(n))}),s(),I()}if(i&2){let e=c(3).$implicit;r(1),p("ngModel",e.selected)}}function pt(i,o){if(i&1){let e=S();b(0),l(1,"img",62),g("click",function(n){d(e);let a=c(3).$implicit,h=c(2);return _(h.onZoomImage(n,a==null?null:a.ImageUrl))}),s(),I()}if(i&2){let e=c(3).$implicit;r(1),pe("src",e==null?null:e.ThumbnailUrl,N)}}function ct(i,o){i&1&&v(0,"img",63)}function mt(i,o){if(i&1&&(b(0),v(1,"br"),l(2,"div",64),v(3,"i",65),l(4,"small"),m(5),s()(),I()),i&2){let e=c(3).$implicit;r(5),w("(",e==null?null:e.Category,")")}}var dt=i=>({"ms-10":i});function _t(i,o){if(i&1&&(b(0),l(1,"td",57)(2,"div",13),u(3,st,2,1,"ng-container",3),l(4,"div",49),u(5,pt,2,1,"ng-container",51)(6,ct,1,0,"ng-template",null,58,R),s()()(),l(8,"td",59)(9,"span",60),m(10),s(),u(11,mt,6,1,"ng-container",3),s(),I()),i&2){let e=F(7),t=c(2).$implicit,n=c(2);r(1),p("rowSpan",t==null?null:t.Variants.length),r(2),p("ngIf",t.Variants.length>1),r(1),p("ngClass",L(8,dt,t.Variants.length<=1)),r(1),p("ngIf",t==null?null:t.ThumbnailUrl)("ngIfElse",e),r(3),p("rowSpan",t==null?null:t.Variants.length),r(2),E(t==null?null:t.Name),r(1),p("ngIf",t.CategoryID!==null&&t.CategoryID!=n.guidEmpty)}}function ut(i,o){if(i&1){let e=S();b(0),l(1,"input",44),g("ngModelChange",function(n){d(e);let a=c(2).$implicit;return _(a.selected=n)}),s(),I()}if(i&2){let e=c(2).$implicit;r(1),p("ngModel",e.selected)}}function gt(i,o){if(i&1&&(b(0),u(1,ut,2,1,"ng-container",3),I()),i&2){let e=c().$implicit;r(1),p("ngIf",(e==null?null:e.Inventory)<=1e5)}}function ht(i,o){if(i&1){let e=S();l(0,"input",44),g("ngModelChange",function(n){d(e);let a=c(2).$implicit;return _(a.selected=n)}),s()}if(i&2){let e=c(2).$implicit;p("ngModel",e.selected)}}function Ct(i,o){if(i&1&&u(0,ht,1,1,"input",66),i&2){let e=c().$implicit;p("ngIf",(e==null?null:e.Inventory)>=0)}}function ft(i,o){i&1&&(l(0,"div",67),m(1,"Not Found"),s())}function xt(i,o){if(i&1&&(l(0,"div")(1,"span",68),m(2),f(3,"number"),s(),m(4," => "),l(5,"span",69),m(6),f(7,"number"),s()()),i&2){let e=c().$implicit;r(2),w(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),r(4),E(x(7,4,e==null?null:e.Inventory))}}function vt(i,o){if(i&1&&(l(0,"div"),m(1),f(2,"number"),s()),i&2){let e=c().$implicit;r(1),w(" ",x(2,1,e==null?null:e.Inventory)," ")}}function St(i,o){if(i&1&&(b(0),l(1,"div",70)(2,"a",71),v(3,"i",72),s()(),I()),i&2){let e=c().$implicit,t=c(3);r(2),p("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),N)}}var yt=i=>({"bg-gradient-warning":i});function bt(i,o){if(i&1){let e=S();l(0,"td",73)(1,"div",48)(2,"div")(3,"span",74),g("click",function(){d(e);let n=c().$implicit,a=c(),h=a.$implicit,C=a.ngForOf,T=c(2);return _(T.openTableDialog(h,n,C))}),m(4),f(5,"number"),s()(),l(6,"div",70)(7,"a",71),v(8,"i",72),s()(),l(9,"div",70)(10,"span",75),g("click",function(){d(e);let n=c().$implicit,a=c(3);return _(a.refreshInventory(n==null||n.Channel[0]==null?null:n.Channel[0].ChannelItemID,n==null||n.Channel[0]==null?null:n.Channel[0].ChannelVariationID,n==null||n.Channel[0]==null?null:n.Channel[0].ChannelID,n==null?null:n.ID))}),v(11,"i",76),s()()()()}if(i&2){let e=c().$implicit;p("ngClass",L(5,yt,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),r(4),w(" ",x(5,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," "),r(3),p("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,N)}}function It(i,o){if(i&1&&(b(0),l(1,"span",79),m(2),f(3,"number"),s(),I()),i&2){let e=c(2).$implicit;r(2),w(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function wt(i,o){i&1&&m(0," - ")}function Tt(i,o){if(i&1&&(b(0),l(1,"td",77),u(2,It,4,3,"ng-container",51)(3,wt,1,0,"ng-template",null,78,R),s(),I()),i&2){let e=F(4),t=c().$implicit;r(2),p("ngIf",t==null||t.Channel[0]==null?null:t.Channel[0].InventoryReserved)("ngIfElse",e)}}function Mt(i,o){i&1&&(b(0),m(1," - "),I())}function Et(i,o){if(i&1&&(l(0,"span",80),f(1,"date"),m(2),f(3,"date"),s()),i&2){let e=c().$implicit;p("matTooltip",O(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),r(2),w(" ",O(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}var Vt=i=>({"text-decoration-line-through":i});function Dt(i,o){if(i&1&&(l(0,"tr"),u(1,_t,12,10,"ng-container",3),l(2,"td",46),m(3),s(),l(4,"td",47)(5,"div",48)(6,"span",49),m(7),s()()(),l(8,"td",50),u(9,gt,2,1,"ng-container",51)(10,Ct,1,1,"ng-template",null,52,R),s(),l(12,"td")(13,"div",48),u(14,ft,2,0,"div",53)(15,xt,8,6,"div",3)(16,vt,3,3,"div",3)(17,St,4,1,"ng-container",3),s()(),u(18,bt,12,7,"td",54)(19,Tt,5,2,"ng-container",3),l(20,"td",55),u(21,Mt,2,0,"ng-container",51)(22,Et,4,8,"ng-template",null,56,R),s()()),i&2){let e=o.$implicit,t=o.index,n=F(11),a=F(23),h=c(3);r(1),p("ngIf",t==0),r(2),E(e==null?null:e.Model),r(1),p("matTooltip",e.isDiscontinued?h.discontinuedVariantMsg:""),r(2),p("ngClass",L(15,Vt,e.isDiscontinued)),r(1),E(e==null?null:e.Code),r(2),p("ngIf",(e==null?null:e.Channel[0].TypeID)==1)("ngIfElse",n),r(5),p("ngIf",(e==null?null:e.I)==null),r(1),p("ngIf",(e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)),r(1),p("ngIf",(e==null?null:e.I)!=null&&(e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)),r(1),p("ngIf",(e==null?null:e.I)!=null),r(1),p("ngIf",e==null?null:e.Channel),r(1),p("ngIf",h.isShowReservedColumn),r(2),p("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==h.minDate)("ngIfElse",a)}}function Pt(i,o){if(i&1&&(l(0,"tbody"),u(1,Dt,24,17,"tr",32),s()),i&2){let e=o.$implicit;r(1),p("ngForOf",e.Variants)}}function Nt(i,o){if(i&1){let e=S();l(0,"span",81),g("click",function(){d(e);let n=c(2);return _(n.getRowCount())}),l(1,"i",82),m(2,"?"),s()()}}function kt(i,o){if(i&1&&(l(0,"span"),m(1),f(2,"number"),s()),i&2){let e=o.ngIf;r(1),E(x(2,1,e==null?null:e.Total))}}function Ft(i,o){if(i&1){let e=S();l(0,"a",86),g("click",function(){d(e);let n=c(3);return _(n.onNextPage())}),v(1,"i",87),m(2," Next"),s()}}function Rt(i,o){if(i&1){let e=S();l(0,"a",88),g("click",function(){d(e);let n=c(3);return _(n.onLastPage())}),v(1,"i",89),m(2," Last"),s()}}function Bt(i,o){if(i&1&&(l(0,"div",83),u(1,Ft,3,0,"a",84)(2,Rt,3,0,"a",85),s()),i&2){let e=c(2);r(1),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),r(1),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}function $t(i,o){if(i&1){let e=S();l(0,"mainpanel",1),g("onSubmit",function(n){d(e);let a=c();return _(a.onSearch(n))}),l(1,"actions")(2,"div",2),u(3,it,2,1,"div",3),f(4,"async"),s()(),l(5,"filters")(6,"div")(7,"label",4),m(8,"Channel"),s(),l(9,"ng-select",5),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.ChannelID=n)}),u(10,at,3,2,"ng-template",6),s()(),l(11,"div",7)(12,"label",8),m(13,"PageNumber"),s(),l(14,"input",9),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.PageNumber=n)}),s()(),l(15,"div",7)(16,"label",10),m(17,"Page Size"),s(),l(18,"input",11),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.RowCount=n)}),s()(),l(19,"div",7)(20,"label",12),m(21,"Quantity From - To"),s(),l(22,"div",13)(23,"input",14),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.QuantityFrom=n)}),s(),m(24," - "),l(25,"input",15),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.QuantityTo=n)}),s()()()(),l(26,"content")(27,"div",16)(28,"div",17)(29,"div",18),u(30,ot,3,0,"div",19),l(31,"table",20)(32,"thead",21)(33,"tr")(34,"th",22),m(35,"Product "),v(36,"br"),l(37,"mat-slide-toggle",23),g("toggleChange",function(){d(e);let n=c();return n.showDifferenceStock=!n.showDifferenceStock,_(n.onShowDifferenceStock())}),l(38,"small",12),m(39,"FILTER DIFFERENT INVENTORY"),s()()(),l(40,"th",24),m(41,"Variant"),s(),l(42,"th",25),m(43,"SKU"),s(),u(44,lt,2,1,"th",3),f(45,"async"),l(46,"th",26),m(47,"POS"),s(),l(48,"th",27)(49,"div",28),g("click",function(){d(e);let n=c();return _(n.openModalFilter())}),v(50,"img",29),l(51,"span",30),m(52),f(53,"stringLimit"),s()()(),u(54,rt,3,0,"ng-container",3),l(55,"th",31),m(56,"Last Sync"),s()()(),u(57,Pt,2,1,"tbody",32),f(58,"async"),s(),l(59,"div",33)(60,"div",34)(61,"div",35),m(62),f(63,"number"),f(64,"async"),u(65,Nt,3,0,"span",36)(66,kt,3,3,"span",3),f(67,"async"),m(68),s()(),u(69,Bt,3,2,"div",37),f(70,"async"),s()()()()()()}if(i&2){let e=c(),t,n;p("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),r(3),p("ngIf",x(4,24,e.paginationService.data$)),r(6),p("clearable",!1)("items",e.channelOptions)("ngModel",e.searchFilter.ChannelID),r(5),p("ngModel",e.searchFilter.PageNumber),r(4),p("ngModel",e.searchFilter.RowCount),r(5),p("ngModel",e.searchFilter.QuantityFrom),r(2),p("ngModel",e.searchFilter.QuantityTo),r(5),p("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),r(14),p("ngIf",x(45,26,e.paginationService.data$)),r(5),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?e.selectedChannel==null?null:e.selectedChannel.Name:""),r(1),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,N),r(2),ce(" ",O(53,28,e.selectedChannel==null?null:e.selectedChannel.Name,13),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?"...":""," "),r(2),p("ngIf",e.isShowReservedColumn),r(3),p("ngForOf",x(58,31,e.products$)),r(5),w(" Showing 1 - ",x(63,33,(t=x(64,35,e.paginationService.data$))==null?null:t.length)," of "),r(3),p("ngIf",e.paginationService.hideCount),r(1),p("ngIf",x(67,37,!e.paginationService.hideCount&&e.rowCount$)),r(2),w(" records ~ ",e.paginationService.footerPageNumber," Page "),r(1),p("ngIf",((n=x(70,39,e.paginationService.data$))==null?null:n.length)>0)}}var Fe=(()=>{let o=class o{constructor(t,n,a,h,C,T,M,Be,$e){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=h,this.productService=C,this.authService=T,this.biggerPictureService=M,this.inventoryService=Be,this.mainPanelService=$e,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=V.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=V.GuidEMpty,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.paginationService.data$.pipe(se(t=>(t=t.map(n=>(n.Variants&&(n.Variants=n.Variants.map(a=>(a.isDiscontinued=n.Discontinued=="Yes",a))),n)),t)),k(t=>{this.checkShowReservedColumn(t)}))}checkShowReservedColumn(t){let n=0,a;t.forEach(h=>{a=h.Variants.find(C=>V.IsNotEmpty(C?.Channel[0]?.InventoryReserved)),a&&(n+=1)}),this.isShowReservedColumn=n>0}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe(k(t=>{if(this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.initSelectedChannel(),this.paginationService.reloadPagination(this.searchFilter),!t.Filter.IsMarketplaceAppActive){let n=`Automatic inventory sync disabled.
2
2
  Please enable Dealpos X Marketplace Apps integration in POS Configuration`;this.toastr.warning(n,"Warning")}}))}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(t=>t.ID==this.searchFilter.ChannelID)}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter),this.initSelectedChannel()}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(t){let n=this.productService.selectedVariantProduct(t);if(n.length>0){let a=n.map(C=>({ID:C.ID,Code:C.Code,Inventory:C.Inventory})),h={ListChannelID:[this.searchFilter.ChannelID],List:a};this.http.post("/api/Inventory/UpdateChannel",h).subscribe(C=>{this.searchFilter.PageNumber=1,this.paginationService.reloadPagination(this.searchFilter),this.checkboxState=!1,this.handlingUpdateStock(C)})}}handlingUpdateStock(t){if(t[0]?.StatusProduct){let n=t[0].StatusProduct.Fail_list,a=t[0].StatusProduct.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",a,n)}else this.toastr.error(t[0]?.Exception,"Error")}refreshInventory(t,n,a,h){let C={ChannelItemID:t,ChannelVariationID:n,ChannelID:a,VariantID:h};this.http.post("/api/Inventory/RefreshInventoryChannel",C).subscribe(T=>{this.toastr.success("Successfully updated","Success"),this.paginationService.reloadPagination(this.searchFilter)})}onCheckboxStateProduct(t){t.Variants=t.Variants.map(n=>(n.Inventory>=0&&(n.selected=t.selected),n))}onCheckboxStateChange(t){t=t.map(n=>(n.Variants=n.Variants.map(a=>(a.selected=this.checkboxState,a)),n))}openTableDialog(t,n,a){this.dialog.open(Ee,{data:{Name:t.Name,Variant:n,ChannelID:n?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:t.ChannelItemID}}).afterClosed().pipe(B(C=>V.IsNotEmpty(C))).subscribe(C=>{this.updateItemAfterDialog(C,a)})}updateItemAfterDialog(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku},h=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(C=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+h?.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=D.DIFFERENCE:this.searchFilter.filterModel=D.ALL,this.paginationService.reloadPagination(this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,PageNumber:1,text:this.searchFilter.text};this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`${this.rowCountApi}`,t)}onLastPage(){let t={ChannelID:this.searchFilter.ChannelID,PageNumber:1};this.http.post(`${this.rowCountApi}`,t).subscribe({next:n=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,n.Total)}})}onZoomImage(t,n){this.biggerPictureService.openBiggerPicture(t,n)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(H),y(q),y(ee),y(ie),y(ne),y(W),y(Te),y(oe),y(ye))},o.\u0275cmp=P({type:o,selectors:[["app-single-channel-comparison"]],decls:2,vars:3,consts:[["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit"],[1,"d-flex"],[4,"ngIf"],["for","ng-select",1,"fw-bold"],["id","ng-select","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text","mt-3",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModel","ngModelChange"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModel","ngModelChange"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModel","ngModelChange"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"matTooltip","click"],[2,"width","16px",3,"src"],[1,"ms-1"],[1,"text-center",2,"width","145px"],[4,"ngFor","ngForOf"],[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"],["style","cursor: pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"me-2"],[2,"width","18px",3,"src"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModel","ngModelChange"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-start"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["OTHER_CHANNEL",""],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],["SYNCDATE",""],[1,"text-start",2,"width","0%",3,"rowSpan"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-end",3,"ngClass"],[1,"cursor",3,"click"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom"],[1,"text-end"],["EMPTY_RESERVED",""],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary border-start-0","title","Load all products",3,"click",4,"ngIf"],["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(n,a){n&1&&(u(0,$t,71,41,"mainpanel",0),f(1,"async")),n&2&&p("ngIf",x(1,1,a.loader$))},dependencies:[me,de,U,K,Z,ge,Y,J,xe,Ce,fe,Ve,te,X,j,z,_e,Pe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});let i=o;return i})();var At=[{path:"",component:Ne,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:ke,canActivate:[re],data:{title:"Inventory Comparison"}},{path:"bychannel",component:Fe,canActivate:[re],data:{title:"Inventory Comparison"}}]}],Re=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=A({type:o}),o.\u0275inj=$({imports:[Q,G.forChild(At)]});let i=o;return i})();var Nn=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=A({type:o}),o.\u0275inj=$({providers:[oe],imports:[Q,Re,G,we,he,ve,De,be,ae,Se]});let i=o;return i})();export{Nn as InventoryModule};