import{n as y}from"./chunk-6WU6YPK5.js";import{b as f}from"./chunk-LBB5SFMN.js";import{o as g}from"./chunk-3WWEFG5Z.js";import{f as z}from"./chunk-ZQPWXQD7.js";import{a as c}from"./chunk-HEWBVLHR.js";import{c as d}from"./chunk-WXQVX7WD.js";import{m as S}from"./chunk-OWZ5YAMH.js";import{a as b}from"./chunk-KXX3UDJ3.js";import{j as u}from"./chunk-GQAU5ACB.js";import{S as s,k as o,la as l,pa as n}from"./chunk-ISMRT7VU.js";import{a as r,b as h}from"./chunk-M5TX2NVG.js";var p=class e{constructor(t){this._http=t,this._defaultFilter={criteria:null,take:100,skip:0,orderBy:"id",isAscending:!0}}bind(t,i){return this._http.post(`/api/fiscalization-settings/${t}/bind`,r({},i))}unbind(t){return this._http.post(`/api/fiscalization-settings/${t}/unbind`,{})}use(t,i){return this._http.post(`/api/fiscalization-settings/${t}/use`,r({},i))}updateToken(t,i){return this._http.post(`/api/fiscalization-settings/${t}/update-token`,{token:i})}getToken(t){return this._http.get(`/api/fiscalization-settings/${t}/get-token`)}getAll(t=this._defaultFilter){let i=h(r({},t),{criteria:{search:null,filter:{storeId:this._retailStoreId}}});return this._http.post("/api/fiscalization-settings/all",r({},i),{headers:b})}static{this.\u0275fac=function(i){return new(i||e)(n(u))}}static{this.\u0275prov=l({token:e,factory:e.\u0275fac})}};o([c(d.selectedStoreId)],p.prototype,"_retailStoreId",void 0);var m=class e{constructor(t,i,a){this._fiscalizationSettingsServiceApi=t,this._trinityServiceApi=i,this._store=a}bind(t,i){return this._fiscalizationSettingsServiceApi.bind(t,i).pipe(s(1))}unbind(t){return this._fiscalizationSettingsServiceApi.unbind(t).pipe(s(1))}use(t,i){return this._fiscalizationSettingsServiceApi.use(i,{useFiscalizationSettings:t}).pipe(s(1))}getAll(t){return this._fiscalizationSettingsServiceApi.getAll(t).pipe(s(1))}updateToken(t,i){return this._fiscalizationSettingsServiceApi.updateToken(t,i).pipe(s(1))}getToken(t){return this._fiscalizationSettingsServiceApi.getToken(t).pipe(s(1))}canCashboxWKFiscalize(t){let i=this.cashboxes.find(a=>a.id===t);return i?i.isFiscalized&&i.fiscalizationSettings!=null&&i.fiscalizationSettings.integrationSystem===f.Webkassa&&this.companySettings.simplifiedTaxRegime===!1:!1}canCashboxTrinityFiscalize(t){let i=this.cashboxes.find(a=>a.id===t);return i?i.isFiscalized&&i.fiscalizationSettings!=null&&i.fiscalizationSettings.integrationSystem===f.Trinity&&this.companySettings.simplifiedTaxRegime===!0:!1}hasWebkassaIntegration(){return this.cashboxes.some(t=>t.isFiscalized&&t.fiscalizationSettings!=null&&t.fiscalizationSettings?.integrationSystem===f.Webkassa)}static{this.\u0275fac=function(i){return new(i||e)(n(p),n(y),n(S))}}static{this.\u0275prov=l({token:e,factory:e.\u0275fac})}};o([c(z.cashboxes)],m.prototype,"cashboxes",void 0);o([c(g.companySettings)],m.prototype,"companySettings",void 0);export{p as a,m as b};
//# sourceMappingURL=chunk-SV5V42S3.js.map
