// # Generated by tools/generate_components.R. Do not edit by hand.

const binding = new Shiny.InputBinding();

$.extend(binding, {
  find(scope) {
    return $(scope).find('wa-drawer[id]');
  },

  getId(el) {
    return el.id;
  },

  getValue(el) {
    return el.open;
  },


  subscribe(el, callback) {
    el.__shinyWebawesomeCallback = () => callback();
    el.__shinyWebawesomeEvents = ["wa-show", "wa-after-hide"];
    el.__shinyWebawesomeEvents.forEach((eventName) => {
      el.addEventListener(eventName, el.__shinyWebawesomeCallback);
    });
  },

  unsubscribe(el, callback) {
    if (el.__shinyWebawesomeCallback) {
      (el.__shinyWebawesomeEvents || []).forEach((eventName) => {
        el.removeEventListener(eventName, el.__shinyWebawesomeCallback);
      });
      delete el.__shinyWebawesomeEvents;
      delete el.__shinyWebawesomeCallback;
    }
  },

  receiveMessage(el, data) {
    return;
  }
});

Shiny.inputBindings.register(binding, 'shiny.webawesome.wa_drawer');
