import{n as i,_ as n}from"./index-009d300e.js";const s={components:{ValueID:()=>n(()=>import("./ValueId-b5742f28.js"),["./ValueId-b5742f28.js","./index-009d300e.js","./index-fe507b7b.css","./ValueId-5906c47c.css"],import.meta.url)},props:{value:Boolean,title:String,editedValue:Object,nodes:Array},watch:{value(a){this.$refs.form&&this.$refs.form.resetValidation()}},data(){return{valid:!0,required:a=>!!a||"This field is required",positive:a=>a>=0||"Value must be positive",validValue:[a=>!!a||"This field is required",a=>a&&a.writeable||"This value is Read Only"]}}};var o=function(){var e=this,l=e._self._c;return l("v-dialog",{attrs:{"max-width":"500px",persistent:""},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[l("v-card",[l("v-card-title",[l("span",{staticClass:"headline"},[e._v("Add association")])]),l("v-card-text",[l("v-container",{attrs:{"grid-list-md":""}},[l("v-form",{ref:"form",attrs:{"lazy-validation":""},model:{value:e.valid,callback:function(t){e.valid=t},expression:"valid"}},[l("v-row",[l("v-col",{attrs:{cols:"12"}},[l("v-select",{attrs:{label:"Node",required:"","return-object":"","item-text":"_name",rules:[e.required],"item-value":"id",items:e.nodes},model:{value:e.editedValue.node,callback:function(t){e.$set(e.editedValue,"node",t)},expression:"editedValue.node"}})],1),e.editedValue.node?l("v-col",{attrs:{cols:"12"}},[l("v-select",{attrs:{label:"Value",required:"","return-object":"","item-text":"label",rules:e.validValue,"item-value":"id",items:e.editedValue.node.values},scopedSlots:e._u([{key:"selection",fn:function({item:t}){return[e._v(" "+e._s((t.label||t.id)+(t.endpoint>1?" - Endpoint "+t.endpoint:""))+" ")]}},{key:"item",fn:function({item:t}){return[l("v-list-item-content",[l("v-list-item-title",[e._v(e._s((t.label||t.id)+(t.endpoint>0?" - Endpoint "+t.endpoint:"")))]),l("v-list-item-subtitle",{staticClass:"text-truncate text-no-wrap",staticStyle:{"max-width":"500px"}},[e._v(e._s(t.description))])],1)]}}],null,!1,2612602261),model:{value:e.editedValue.value,callback:function(t){e.$set(e.editedValue,"value",t)},expression:"editedValue.value"}})],1):e._e(),e.editedValue.value?l("v-col",{attrs:{cols:"12"}},[l("ValueID",{attrs:{disable_send:""},model:{value:e.editedValue.value,callback:function(t){e.$set(e.editedValue,"value",t)},expression:"editedValue.value"}})],1):e._e(),l("v-col",{attrs:{cols:"12"}},[l("v-text-field",{attrs:{label:"Timeout",hint:"Seconds to wait before send this value. Set to 0 to send immediately",suffix:"s",rules:[e.positive],required:"",type:"number"},model:{value:e.editedValue.timeout,callback:function(t){e.$set(e.editedValue,"timeout",e._n(t))},expression:"editedValue.timeout"}})],1)],1)],1)],1)],1),l("v-card-actions",[l("v-spacer"),l("v-btn",{attrs:{color:"blue darken-1",text:""},on:{click:function(t){return e.$emit("close")}}},[e._v("Cancel")]),l("v-btn",{attrs:{color:"blue darken-1",text:""},on:{click:function(t){e.$refs.form.validate()&&e.$emit("save")}}},[e._v("Save")])],1)],1)],1)},d=[],r=i(s,o,d,!1,null,null,null,null);const c=r.exports;export{c as default};
