(window.webpackJsonp=window.webpackJsonp||[]).push([[208],{1385:function(e,t,l){"use strict";l.r(t);var n=l(2),r=l(36),o=(l(22),l(56)),c={};c.props={value:{key:"value",required:!0,type:null},editation:{key:"editation",required:!0,type:Boolean}},c.setup=function(e,t){var l=t.emit,c=e,d=Object(n.b)({get:function(){return c.value},set:function(e){return l("update:value",e)}});return Object(n.Y)((function(){return d.value.type}),(function(e){console.log({val:e}),"boolean"===e&&(d.value.currentValue=Boolean(d.value.currentValue),d.value.defaultValue=Boolean(d.value.defaultValue)),"number"===e&&(d.value.currentValue=isNaN(Number(d.value.currentValue))?0:Number(d.value.currentValue),d.value.defaultValue=isNaN(Number(d.value.defaultValue))?0:Number(d.value.defaultValue)),"string"===e&&(d.value.currentValue=String(d.value.currentValue),d.value.defaultValue=String(d.value.defaultValue)),"array"===e&&((!Array.isArray(d.value.currentValue)||Object(o.isNumber)(d.value.currentValue)||Object(r.a)(d.value.currentValue).length>0)&&(d.value.currentValue=[]),(!Array.isArray(d.value.defaultValue)||Object(o.isNumber)(d.value.defaultValue)||Object(r.a)(d.value.defaultValue).length>0)&&(d.value.defaultValue=[]))})),{emit:l,item:d,closeDialog:function(){l("close")}}};var d=c,m=l(46),v=l(44),f=l.n(v),V=l(1160),y=l(52),_=l(45),x=l(37),k=l(263),h=l(767),w=l(139),N=l(773),component=Object(m.a)(d,(function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("v-card",[l("v-card-text",[l("v-text-field",{attrs:{filled:"","hide-details":"auto",small:"",label:"Variable Name"},model:{value:e.item.name,callback:function(t){e.$set(e.item,"name",t)},expression:"item.name"}}),e._v(" "),l("v-select",{attrs:{filled:"","hide-details":"auto",small:"",label:"Variable Type",items:["string","number","array","boolean"]},model:{value:e.item.type,callback:function(t){e.$set(e.item,"type",t)},expression:"item.type"}}),e._v(" "),l("v-textarea",{attrs:{"auto-grow":"",filled:"",rows:"1","row-height":"15","hide-details":"auto",small:"",label:"Variable Description"},model:{value:e.item.description,callback:function(t){e.$set(e.item,"description",t)},expression:"item.description"}}),e._v(" "),"boolean"===e.item.type?l("v-switch",{attrs:{label:"Default Value"},on:{change:function(){return e.item.currentValue=e.item.defaultValue}},model:{value:e.item.defaultValue,callback:function(t){e.$set(e.item,"defaultValue",t)},expression:"item.defaultValue"}}):e._e(),e._v(" "),"string"===e.item.type?l("v-text-field",{attrs:{filled:"","hide-details":"auto",small:"",label:"Default Value"},on:{input:function(t){return e.item.currentValue=t}},model:{value:e.item.defaultValue,callback:function(t){e.$set(e.item,"defaultValue",t)},expression:"item.defaultValue"}}):e._e(),e._v(" "),"number"===e.item.type?l("v-text-field",{attrs:{type:"number",filled:"","hide-details":"auto",small:"",label:"Default Value"},on:{input:function(t){return e.item.currentValue=Number(t)}},model:{value:e.item.defaultValue,callback:function(t){e.$set(e.item,"defaultValue",e._n(t))},expression:"item.defaultValue"}}):e._e(),e._v(" "),"array"===e.item.type?[l("v-banner",{attrs:{"single-line":""},scopedSlots:e._u([{key:"actions",fn:function(){return[l("v-btn",{attrs:{icon:""},on:{click:function(t){e.item.defaultValue=e.item.defaultValue.concat([""])}}},[l("v-icon",[e._v("mdi-plus")])],1)]},proxy:!0}],null,!1,2365635359)},[e._v("\n        Default values\n        ")]),e._v(" "),e._l(e.item.defaultValue,(function(t,n){return l("v-text-field",{key:n,attrs:{filled:"","hide-details":"auto",small:""},on:{input:function(){return e.item.currentValue=e.item.defaultValue}},scopedSlots:e._u([{key:"append",fn:function(){return[l("v-btn",{attrs:{icon:""},on:{click:function(t){e.item.defaultValue=[].concat(e.item.defaultValue).filter((function(e,t){return t!==n}))}}},[l("v-icon",[e._v("mdi-minus")])],1)]},proxy:!0}],null,!0),model:{value:e.item.defaultValue[n],callback:function(t){e.$set(e.item.defaultValue,n,t)},expression:"item.defaultValue[index]"}})}))]:e._e(),e._v(" "),e.editation?l("v-text-field",{attrs:{readonly:"",label:"Variable in messages",value:"{settings."+e.item.name+"}","hide-details":""}}):e._e(),e._v(" "),e.editation?l("v-text-field",{attrs:{readonly:"",label:"Variable in scripts",value:"settings."+e.item.name,"hide-details":""}}):e._e(),e._v(" "),l("v-btn",{staticClass:"my-2",attrs:{color:e.editation?"error":"dark",block:""},on:{click:function(){return e.emit("click")}}},[e._v("\n      "+e._s(e.editation?"Remove variable":"Add new variable")+"\n    ")])],2),e._v(" "),l("v-card-actions",{staticClass:"justify-end"},[l("v-btn",{attrs:{text:""},on:{click:e.closeDialog}},[e._v("Close")])],1)],1)}),[],!1,null,null,null);t.default=component.exports;f()(component,{VBanner:V.a,VBtn:y.a,VCard:_.a,VCardActions:_.b,VCardText:_.d,VIcon:x.a,VSelect:k.a,VSwitch:h.a,VTextField:w.a,VTextarea:N.a})}}]);