import{n as _}from"./chunk-OWR3JC2T.js";import{b as m}from"./chunk-LBB5SFMN.js";import{m as b}from"./chunk-Y47MVODT.js";import{c as y}from"./chunk-J7KKTDSX.js";import{c as z}from"./chunk-7R42RYQZ.js";import{a as k}from"./chunk-PLVHWZTL.js";import{a as c}from"./chunk-LJUR6GAC.js";import{p as S}from"./chunk-7WGMNLRJ.js";import{i as g}from"./chunk-YMOV4UGM.js";import{K as e,ga as f,la as r}from"./chunk-I3FGJX2C.js";import{d as p,n as d}from"./chunk-INB5GR2I.js";import{a as o,b as u}from"./chunk-B7YGBANW.js";d();d();var s=class s{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`,o({},i))}unbind(t){return this._http.post(`/api/fiscalization-settings/${t}/unbind`,{})}use(t,i){return this._http.post(`/api/fiscalization-settings/${t}/use`,o({},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=u(o({},t),{criteria:{search:null,filter:{storeId:this._retailStoreId}}});return this._http.post("/api/fiscalization-settings/all",o({},i),{headers:k})}};s.\u0275fac=function(i){return new(i||s)(r(g))},s.\u0275prov=f({token:s,factory:s.\u0275fac});var l=s;p([c(z.selectedStoreId)],l.prototype,"_retailStoreId",void 0);var n=class n{constructor(t,i,a){this._fiscalizationSettingsServiceApi=t,this._trinityServiceApi=i,this._store=a}bind(t,i){return this._fiscalizationSettingsServiceApi.bind(t,i).pipe(e(1))}unbind(t){return this._fiscalizationSettingsServiceApi.unbind(t).pipe(e(1))}use(t,i){return this._fiscalizationSettingsServiceApi.use(i,{useFiscalizationSettings:t}).pipe(e(1))}getAll(t){return this._fiscalizationSettingsServiceApi.getAll(t).pipe(e(1))}updateToken(t,i){return this._fiscalizationSettingsServiceApi.updateToken(t,i).pipe(e(1))}getToken(t){return this._fiscalizationSettingsServiceApi.getToken(t).pipe(e(1))}canCashboxWKFiscalize(t){let i=this.cashboxes.find(a=>a.id===t);return i?i.isFiscalized&&i.fiscalizationSettings!=null&&i.fiscalizationSettings.integrationSystem===m.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===m.Trinity&&this.companySettings.simplifiedTaxRegime===!0:!1}hasWebkassaIntegration(){return this.cashboxes.some(t=>t.isFiscalized&&t.fiscalizationSettings!=null&&t.fiscalizationSettings?.integrationSystem===m.Webkassa)}};n.\u0275fac=function(i){return new(i||n)(r(l),r(_),r(S))},n.\u0275prov=f({token:n,factory:n.\u0275fac});var h=n;p([c(y.cashboxes)],h.prototype,"cashboxes",void 0);p([c(b.companySettings)],h.prototype,"companySettings",void 0);export{l as a,h as b};
//# sourceMappingURL=chunk-6QLLPMKJ.js.map
