YUI.add("moodle-message_airnotifier-toolboxes",function(c,e){var t,i='div[data-processor-name="airnotifier"]',o="a.hidedevice",r="li.airnotifierdevice",u="dimmed_text",s="deviceid-",n=function(){n.superclass.constructor.apply(this,arguments)};c.extend(n,c.Base,{replace_button:function(e,t,i,o){o=o||"pointer";var s=c.one(e).all(t).setStyle("cursor",o);return s.on("click",i,this),s},toggle_hide_device_ui:function(e){var t,i=e.ancestor(r),o=e.one("img"),s=u,n="";n=i.hasClass(s)?"hide":"show",i.toggleClass(s),t=M.util.get_string(n,"moodle"),o.setAttrs({alt:t,title:t,src:M.util.image_url("t/"+n)}),e.set("title",t),e.set("className","editing_"+n)},send_request:function(e,o,s){var t,i,n,a,r;for(i in e=e||{},t=this.get("config").pageparams)e[i]=t[i];return o&&o.show(),e.sesskey=M.cfg.sesskey,n=M.cfg.wwwroot+this.get("ajaxurl"),r={method:"POST",data:e,on:{success:function(e,t){try{(a=c.JSON.parse(t.responseText)).error?c.use("moodle-core-notification-ajaxexception",function(){return new M.core.ajaxException(a).show()}):a.success&&s()}catch(i){}o&&o.hide()},failure:function(e,t){o&&o.hide(),c.use("moodle-core-notification-ajaxexception",function(){return new M.core.ajaxException(t).show()})}},context:this,sync:!(a=[])},c.io(n,r),a},get_element_id:function(e){return e.get("id").replace(s,"")}},{NAME:"device-toolbox",ATTRS:{ajaxurl:{value:0},config:{value:0}}}),t=function(){t.superclass.constructor.apply(this,arguments)},c.extend(t,n,{initializer:function(){this.setup_for_device()},setup_for_device:function(e){e=e||i,c.all(e).each(this._setup_for_device,this)},_setup_for_device:function(e){this.replace_button(e,o,this.toggle_hide_device)},toggle_hide_device:function(e){var t,i,o,s,n,a;e.preventDefault(),t=e.target.ancestor(r),i=e.target.ancestor("a",!0),o={field:"enable",enable:t.hasClass(u)?1:0,id:this.get_element_id(t)},s=M.util.add_spinner(c,t),a=function(){n.toggle_hide_device_ui(i)},(n=this).send_request(o,s,a)}},{NAME:"message-device-toolbox",ATTRS:{}}),M.message=M.message||{},M.message.init_device_toolbox=function(e){return new t(e)}},"@VERSION@",{requires:["base","node","io"]});