"use strict";(self.webpackChunknexopos_4x=self.webpackChunknexopos_4x||[]).push([[800],{800:(s,e,t)=>{t.r(e),t.d(e,{default:()=>a});var i=t(7389),r=t(9671),o=t(7266);const n={name:"ns-reset",props:["url"],methods:{__:i.__,submit:function(){if(0===this.fields.length)return r.kX.error((0,i.__)("This form is not completely loaded.")).susbcribe();if(!this.validation.validateFields(this.fields))return this.$forceUpdate(),r.kX.error(this.$slots["error-form-invalid"]?this.$slots["error-form-invalid"][0].text:"Invalid Form").subscribe();var s=this.validation.getValue(this.fields);confirm(this.$slots["confirm-message"]?this.$slots["confirm-message"][0].text:(0,i.__)("Would you like to proceed ?"))&&r.ih.post("/api/nexopos/v4/reset",s).subscribe({next:function(s){r.kX.success(s.message).subscribe()},error:function(s){r.kX.error(s.message).subscribe()}})},loadFields:function(){var s=this;r.ih.get("/api/nexopos/v4/fields/ns.reset").subscribe({next:function(e){s.fields=s.validation.createFields(e)},error:function(s){r.kX.error(s.message).subscribe()}})}},mounted:function(){this.loadFields()},data:function(){return{validation:new o.Z,fields:[]}}};const a=(0,t(1900).Z)(n,(function(){var s=this,e=s.$createElement,t=s._self._c||e;return t("div",{staticClass:"ns-tab",attrs:{id:"reset-app"}},[t("div",{staticClass:"flex flex-wrap",attrs:{id:"card-header"}},[t("div",{staticClass:"tab active cursor-pointer px-4 py-2 rounded-tl-lg rounded-tr-lg"},[s._v("\n            "+s._s(s.__("Reset"))+"\n        ")])]),s._v(" "),t("div",{staticClass:"card-body ns-box ns-tab-item rounded-br-lg rounded-bl-lg shadow"},[t("div",{staticClass:"-mx-4 flex flex-wrap p-2"},s._l(s.fields,(function(s,e){return t("div",{key:e,staticClass:"px-4"},[t("ns-field",{attrs:{field:s}})],1)})),0),s._v(" "),t("div",{staticClass:"card-body ns-box-footer border-t p-2 flex"},[t("div",[t("ns-button",{attrs:{type:"info"},on:{click:function(e){return s.submit()}}},[s._v(s._s(s.__("Proceed")))])],1)])])])}),[],!1,null,null,null).exports}}]);