import{n as _}from"./chunk-5PAFX6IW.js";import{b as m}from"./chunk-LBB5SFMN.js";import{o as b}from"./chunk-O5FUBBHI.js";import{f as y}from"./chunk-ZNYLCQSJ.js";import{c as z}from"./chunk-UU4K5RCK.js";import{a as c}from"./chunk-F24KRXZV.js";import{p as S}from"./chunk-JBWPPKX4.js";import{a as k}from"./chunk-7N232KV6.js";import{i as g}from"./chunk-NDLDFKR2.js";import{K as e,fa as f,ka as r}from"./chunk-PVUKHE45.js";import{d as p,n as d}from"./chunk-VD6R3735.js";import{a as o,b as u}from"./chunk-MZPAXKJS.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-OQXNGODS.js.map
