"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[703],{70703:function(a,e,l){l.r(e),l.d(e,{default:function(){return L}});var i=l(20641),s=l(53751);const t={class:"variable-modal-container"},n={class:"row"},o={class:"col-s-12 col-m-8 value"},r=["disabled"],d={class:"row"},u={class:"col-s-12 col-m-8 value"},c=["disabled"],v={class:"row button-container"},b=["disabled"];function m(a,e,l,m,h,p){const f=(0,i.g2)("Modal");return(0,i.uX)(),(0,i.Wv)(f,{visible:l.visible,title:"Set Variable",ref:"modal",onOpen:p.onOpen,onClose:e[3]||(e[3]=e=>a.$emit("close",e))},{default:(0,i.k6)(()=>[(0,i.Lk)("div",t,[(0,i.Lk)("form",{onSubmit:e[2]||(e[2]=(0,s.D$)((...a)=>p.setValue&&p.setValue(...a),["prevent"]))},[(0,i.Lk)("div",n,[e[4]||(e[4]=(0,i.Lk)("div",{class:"col-s-12 col-m-4 label"},[(0,i.Lk)("label",{for:"name"},"Variable Name")],-1)),(0,i.Lk)("div",o,[(0,i.bo)((0,i.Lk)("input",{type:"text",id:"variable-name","onUpdate:modelValue":e[0]||(e[0]=a=>h.varName=a),placeholder:"Variable Name",disabled:h.loading,ref:"varName"},null,8,r),[[s.Jo,h.varName]])])]),(0,i.Lk)("div",d,[e[5]||(e[5]=(0,i.Lk)("div",{class:"col-s-12 col-m-4 label"},[(0,i.Lk)("label",{for:"name"},"Variable Value")],-1)),(0,i.Lk)("div",u,[(0,i.bo)((0,i.Lk)("input",{type:"text",id:"variable-value","onUpdate:modelValue":e[1]||(e[1]=a=>h.varValue=a),ref:"varValue",placeholder:"Variable Value",disabled:h.loading},null,8,c),[[s.Jo,h.varValue]])])]),(0,i.Lk)("div",v,[(0,i.Lk)("button",{type:"submit",title:"Set",disabled:h.loading},[...e[6]||(e[6]=[(0,i.Lk)("i",{class:"fas fa-check"},null,-1)])],8,b)])],32)])]),_:1},8,["visible","onOpen"])}var h=l(354),p=l(91387),f={name:"VariableModal",components:{Modal:h.A},mixins:[p.A],emits:["close"],props:{visible:{type:Boolean,default:!1}},data(){return{loading:!1,varName:null,varValue:null}},methods:{async clearValue(){this.loading=!0;try{await this.request("variable.unset",{name:this.varName.trim()})}finally{this.loading=!1}},async setValue(){const a=this.varName.trim();a?.length||this.notifyWarning("No variable name has been specified");const e=this.varValue;if(e?.length){this.loading=!0;try{const l={};l[a]=e,await this.request("variable.set",l)}finally{this.loading=!1}}else await this.clearValue();this.$refs.varName.value="",this.$refs.varValue.value="",this.$refs.modal.close()},onOpen(){this.$nextTick(()=>{this.$refs.varName.focus()})}}},k=l(66262);const V=(0,k.A)(f,[["render",m],["__scopeId","data-v-4e3d4a40"]]);var L=V}}]);
//# sourceMappingURL=703.2d73916a.js.map