import{a as x}from"./chunk-WM2SNXCB.js";import"./chunk-N6RJE5TE.js";import{a as P,b as V}from"./chunk-OB36AN2P.js";import{a as p}from"./chunk-GPXQ2AOL.js";import{fa as g}from"./chunk-27KSTDMK.js";import"./chunk-PSDBNMO6.js";import"./chunk-PDYJ5OYY.js";import{s as w}from"./chunk-GQAU5ACB.js";import{Bb as a,Ib as l,S as n,ac as m,cc as h,hc as o,ic as f,jc as C,kc as u,sb as d,vc as v}from"./chunk-ISMRT7VU.js";import{a as s}from"./chunk-M5TX2NVG.js";function S(e,_){if(e&1&&(f(0,"div",0)(1,"div",2),u(2,"tis-print-view-content",3),C()()),e&2){let t=v();d(2),o("data",t.dataWithClassName)}}function R(e,_){e&1&&u(0,"wk-message-bar",1),e&2&&o("fullSize",!0)}var c=(()=>{class e{constructor(t,i,r){this._printViewServiceApi=t,this._activatedRoute=i,this._printViewService=r,this.fullUrl="",this.returnMode=!1,this.notFound=!1,this.dataWithClassName=[],this.data={cmp:"",stmp:0,dc:"",fd:!1}}ngOnInit(){this.fullUrl=location.href,this.returnMode=this.fullUrl.toLowerCase().indexOf("return")>-1,this._activatedRoute.queryParams.pipe(n(1)).subscribe(t=>{this.data.cmp=t.cmp,this.data.stmp=t.stmp,this.data.dc=t.dc,this.data.fd=t.fd==="true",!(!this.data.cmp||!this.data.stmp||!this.data.dc)&&(this.returnMode?this.getReturnPrint(this.data):this.getSellPrint(this.data))})}getSellPrint(t){this._printViewServiceApi.getSellPrintView(s({},t),p.KazRus).pipe(n(1)).subscribe({next:i=>{this.notFound=!1,this.dataWithClassName=i,this.dataWithClassName.length&&this._printViewService.addedClasses(this.dataWithClassName)},error:()=>{this.notFound=!0}})}getReturnPrint(t){this._printViewServiceApi.getReturnSellPrintView(s({},t),p.KazRus).pipe(n(1)).subscribe({next:i=>{this.notFound=!1,this.dataWithClassName=i,this.dataWithClassName.length&&this._printViewService.addedClasses(this.dataWithClassName)},error:()=>{this.notFound=!0}})}static{this.\u0275fac=function(i){return new(i||e)(a(P),a(w),a(V))}}static{this.\u0275cmp=l({type:e,selectors:[["tis-product-receipt-view"]],decls:2,vars:1,consts:[[1,"receipt"],["type","info","title","\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D","secondaryText","\u0412\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0447\u0435\u043A \u0435\u0449\u0435 \u043D\u0435 \u0441\u0438\u043D\u0445\u0440\u043E\u043D\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u043D.",3,"fullSize"],[1,"print-view"],[3,"data"]],template:function(i,r){i&1&&m(0,S,3,1,"div",0)(1,R,1,1,"wk-message-bar",1),i&2&&h(r.dataWithClassName.length?0:1)},dependencies:[x,g],styles:[`.receipt[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.print-view[_ngcontent-%COMP%]{width:max-content;overflow:auto;display:flex;flex-direction:column;gap:10px;font-size:14px;margin:10px 0;padding:15px;border-radius:4px;box-shadow:1px 0 12px 0 var(--color-brand-90)}
/*# sourceMappingURL=product-receipt-view.component-KCU57BFN.css.map */`]})}}return e})();var j=[{path:"sell",component:c,pathMatch:"full"},{path:"return",component:c,pathMatch:"full"}];export{j as routes};
//# sourceMappingURL=product-receipt-view.routes-WABDJKO3.js.map
