(window.webpackJsonp=window.webpackJsonp||[]).push([[128],{1165:function(e,t,n){"use strict";n.r(t);var r=n(1),o=(n(46),n(71),n(12),n(28),n(40),n(4),n(31),n(51),n(35),n(26),n(10),n(52),n(54),n(39),n(272)),l=n(21),c=n(49),v=n.n(c),m=n(784),d=n.n(m),f=n(810),y=n.n(f),h=n(141);function k(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){c=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var x=Object(r.h)({props:{value:Object,rules:Object,permissionItems:Array,groupItems:Array},setup:function(e,t){var menu=Object(r.J)(!1),n=Object(r.J)(y()(e.value)),c=Object(r.J)(!0),form=Object(r.J)(null),m=Object(r.J)(!1);var f=function t(){c.value=!0,form.value?(form.value.resetValidation(),n.value=y()(e.value),n.value.id&&setTimeout((function(){n.value.command=n.value.command+" ",Object(o.nextTick)((function(){n.value.command=n.value.command.trim()}))}),200)):setTimeout((function(){t()}),100)};Object(r.Y)(menu,(function(e){e&&f()}));return{menu:menu,item:n,save:function(){if(form.value.validate()){for(var r=0,o=Object.keys(e.rules);r<o.length;r++){var c,v=o[r],d=k(e.rules[v]);try{for(d.s();!(c=d.n()).done;){var f=(0,c.value)(n.value[v]);if(!0!==f)return void h.a.$emit("snack","red","[".concat(v,"] - ").concat(f))}}catch(e){d.e(e)}finally{d.f()}}var data=n.value;console.log("Updating",{data:data}),m.value=!0,Object(l.getSocket)("/core/general").emit("generic::setCoreCommand",n.value,(function(){h.a.$emit("snack","success","Data updated."),menu.value=!1,t.emit("save"),m.value=!1}))}},translate:v.a,capitalize:d.a,valid:c,saving:m,form:form}}}),_=n(45),O=n(44),V=n.n(O),w=n(48),S=n(43),C=n(269),A=n(378),I=n(32),J=n(263),$=n(25),T=n(140),component=Object(_.a)(x,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("v-dialog",{attrs:{persistent:"","max-width":"800",scrollable:"",fullscreen:e.$vuetify.breakpoint.mobile},scopedSlots:e._u([{key:"activator",fn:function(t){var r=t.on,o=t.attrs;return[n("v-btn",e._g(e._b({staticClass:"primary-hover",attrs:{icon:""}},"v-btn",o,!1),r),[n("v-icon",[e._v("\n          mdi-pencil\n        ")])],1)]}}]),model:{value:e.menu,callback:function(t){e.menu=t},expression:"menu"}},[e._v(" "),n("v-card",{staticClass:"pt-3",attrs:{outlined:""}},[n("v-card-text",[n("v-form",{ref:"form",attrs:{"lazy-validation":""},model:{value:e.valid,callback:function(t){e.valid=t},expression:"valid"}},[n("v-text-field",{attrs:{label:e.translate("command"),rules:e.rules.command,"hide-details":"auto",required:""},scopedSlots:e._u([{key:"append",fn:function(){return[e.item.command!==e.item.defaultValue?n("v-btn",{attrs:{small:"",text:""},on:{click:function(t){e.item.command=e.item.defaultValue}}},[e._v("\n                set to default\n              ")]):e._e()]},proxy:!0}]),model:{value:e.item.command,callback:function(t){e.$set(e.item,"command",t)},expression:"item.command"}}),e._v(" "),n("v-select",{attrs:{label:e.translate("permissions"),clearable:"",items:e.permissionItems,"hide-details":"auto"},model:{value:e.item.permission,callback:function(t){e.$set(e.item,"permission",t)},expression:"item.permission"}})],1)],1),e._v(" "),n("v-card-actions",[n("v-spacer"),e._v(" "),n("v-btn",{attrs:{text:""},on:{click:function(t){e.menu=!1}}},[e._v("\n          Cancel\n        ")]),e._v(" "),n("v-btn",{attrs:{color:"primary",loading:e.saving,text:"",disabled:!e.valid},on:{click:function(t){return e.save()}}},[e._v("\n          Save & Close\n        ")])],1)],1)],1)],1)}),[],!1,null,null,null);t.default=component.exports;V()(component,{VBtn:w.a,VCard:S.a,VCardActions:S.b,VCardText:S.d,VDialog:C.a,VForm:A.a,VIcon:I.a,VSelect:J.a,VSpacer:$.e,VTextField:T.a})}}]);