/* perhaps later...
var Chime = function (platform, deviceId, service) {
if (!(this instanceof Chime)) return new Chime(platform, deviceId, service)

PushSensor.call(this, platform, deviceId, service)
}
util.inherits(Chime, PushSensor)
974037
function (platform, deviceId, service) {
  var self = this

  if (!(this instanceof Camera)) return new Camera(platform, deviceId, service)

  var floodlight

  PushSensor.call(this, platform, deviceId, service)
  
  if (underscore.keys(service.capabilities).indexOf('floodlight') === -1) return

  floodlight = self.getAccessoryService(Service.Lightbulb)
  if (!floodlight) return self.log.warn('Camera', { err: 'could not find Service.Lightbulb' })

  debug('setting callback for on/off')
  floodlight.getCharacteristic(Characteristic.On).on('set', function (value, callback) {
    if (self.readings.floodlight === value) return callback()

    if (!self.platform.doorbot) {
      var err = new Error('not connected for updating floodlight')

      self.log.error('setValue', { deviceId: deviceId, diagnostic: err.toString() })
      return callback(err)
    }

    debug ('set value to ' + JSON.stringify(value) + ', currently ' + JSON.stringify(self.readings.floodlight))
    self.readings.floodlight = value
    self.platform.doorbot[value ? 'lightOn' : 'lightOff']({ id: deviceId },
                                                 function (err, response, result) {/* jshint unused: false */
      debug('result from doorbot ' + (value ? 'lightOn' : 'lightOff') + ': errP=' + (!!err))
      if (err) {
        self.log.error('setValue', { deviceId: deviceId, diagnostic: err.toString() })
      } else {
        self._update.bind(self)({ floodlight: value })
      }
       
      callback()
    })
    debug('setting value to ' + JSON.stringify(value))
  })
  debug ('callback for on/off is now set')
}
178944
function ZeroPush(keys){
  if (!keys) return
  this.name = "zeropush"
  this.keys = keys

  this.initialize = function() {
    this.client = new zeroPush(this.keys.server_token);
  }

  this.send = function(data, callback) {
    var context = this;
    var zeropushStat;
	var deviceType = getZeroPushDeviceType(data.deviceType);
	var notification = getNotificationObject(deviceType, data.message);

	context.client.register([data.deviceToken], function(err, response) {

		if (err) {
			zeropushStat = new ZeroPushErrorStatus(err);
			debug("-_-_ FAILED with zeropush _-_-");
            debug(zeropushStat);
            return callback(zeropushStat);
		}

		context.client.notify(deviceType, [data.deviceToken], notification, function (err, result) {

	        if (err) {
	          zeropushStat = new ZeroPushErrorStatus(err);
	          debug("-_-_ FAILED with zeropush _-_-");
	          debug(zeropushStat);
	          return callback(zeropushStat);
	        }
	        else {
	          zeropushStat = new ZeroPushSuccessStatus(result);
	          debug("-_-_ sent with zeropush _-_-");
	          result.service = context;
	          result.status = zeropushStat;
	          debug(result);
	          return callback(null, result);
	        }
		});
    });
  }

  debug("zeropush initing")
  this.initialize()
}
467456
function inherit (Const, Super) {
    function F () {}
    F.prototype = Super.prototype;
    Const.prototype = new F();
    Const.prototype.constructor = Const;
  }
1286725
function add(f)  {
    if (handlers.every(isnt(f)))  handlers.push(f)
    return notify }
1156059
function (base, name, fn) {
		return function () {
			var hasExistingValue = false;
			var existingValue;
			var prototype = getPrototypeOf(this);
			var existingPrototypeValue = prototype._super;

			/* We must delete the instance's _super so the lookup
					will reach the prototype. */
			if (hasOwnProperty.call(this, '_super')) {
				hasExistingValue = true;
				existingValue = this._super;
				/* NOTE: if the object is sealed this will not work.
						The '_super' key cannot be used on the instance
						in that rare case. */
				delete this._super;
			}

			/* Add a new ._super() method that is the same method
					but on the super-class. It must be set on the prototype
					because the instance may be sealed. */
			prototype._super = base[name];

			// The method only need to be bound temporarily, so we
			// remove it when we're done executing
			var ret = fn.apply(this, arguments);
			prototype._super = existingPrototypeValue;
			if (hasExistingValue) {
				this._super = existingValue;
			}
			return ret;
		};
	}
583563
function() {

        /* Prepare our message */
        var message = { proxy: { proxy: clone, arguments: arguments }};

        /* Is this "new F()" or a normal call? */
        if (this instanceof Invocable) {
          message.newInstance = true;
          ProxyPromise.call(this, message, send);
          this.asProxy(true);
        } else {
          return new ProxyPromise(message, send);
        }
      }
318853
function addHookFn (proto, name) {
  proto[name] = function () {
    var args = [].splice.call(arguments, 0);

    var fn = args.splice(args.length - 1)[0];
    fn = _.isFunction(fn) ? fn : undefined;

    var options = {};
    if (_.isPlainObject(args[args.length - 1])) {
      options = args.splice(args.length - 1)[0];
    }

    var self = this;
    _.each(args, function(arg) {
      var event = util.format('%s.%s.%s.%s', name, self.name, self.version, arg);
      // remove old listeners if redefine is true
      if (options.redefine) {
        debug('Redefine hook', event);
        self.removeAllListeners(event);
      }
      self.on(event, fn);
    });
  };
}
771886
function copyOwn(source, target, inherits, publicStatic, allowInit, isNOTExtendingNative) {
    for (var
      key,
      noFunctionCheck = typeof source !== 'function',
      names = oK(source),
      i = 0; i < names.length; i++
    ) {
      key = names[i];
      if (
        (noFunctionCheck || indexOf.call(nativeFunctionOPN, key) < 0) &&
        isNotASpecialKey(key, allowInit)
      ) {
        if (hOP.call(target, key)) {
          warn('duplicated: ' + key.toString());
        }
        setProperty(inherits, target, key, gOPD(source, key), publicStatic, isNOTExtendingNative);
      }
    }
  }
815152
function (name) { var self = this

        //console.log ('callChainMethod', this.constructor.$meta.name, name)

        const methods = _.filter2 (this.constructor.$traits || [], function (Trait) {

                                                                        var method = Trait.prototype[name]

                                                                        // if (method) {
                                                                        //     return (...args) => {
                                                                        //         console.log ('Calling', Trait.$meta.name, name)
                                                                        //         return method.call (self, ...args)
                                                                        //     }
                                                                        // }

                                                                        return (method && method.bind (self)) || false })

        return __.seq (methods) }
59184
function(proto) {
        function F() {}
        this.merge(F.prototype, proto || {}, (function() {
            var Events = function() {};
            Events.prototype = EventEmitter.prototype;
            return new Events();
        })());
        return new F();
    }
585628
function callNew(T, args)
{
  return new (Function.prototype.bind.apply(T, [null].concat(args)));
}
11596
public Device registerDeviceForPush(UUID deviceId,
                                        String notifier,
                                        String token,
                                        Map<String, Object> properties) {
      if (properties == null) {
          properties = new HashMap<String, Object>();
      }
      String notifierKey = notifier + ".notifier.id";
      properties.put(notifierKey, token);
      return registerDevice(deviceId, properties);
    }
844296
function inherits (ctorA, ctorB) {
      function f() {}
      f.prototype = ctorB.prototype;
      ctorA.prototype = new f();
    }
544344
function PushApp(options) {
    ActionFactoryAbstract.call(this, options);
    this.device = new PushAppDevice(options);
    this.channel = new PushAppChannel(options);
    this.analytics = new PushAppAnalytics(options);
}
1349144
function createServer() {
  function app(req, res, next) {
    app.handle(req, res, next);
  }
  app.method = '*';
  merge(app, proto);
  merge(app, EventEmitter.prototype);
  app.stack = [];
  app.params = [];
  app._cachedEvents = [] ;
  app.routedMethods = {} ;
  app.locals = Object.create(null);
  for (var i = 0; i < arguments.length; ++i) {
    app.use(arguments[i]);
  }

  //create methods app.invite, app.register, etc..
  methods.forEach((method) => {
    app[method.toLowerCase()] = app.use.bind(app, method.toLowerCase()) ;
  }) ;

  //special handling for cdr events
  app.on = function(event, listener) {
    if (0 === event.indexOf('cdr:')) {
      if (app.client) {
        app.client.on(event, function() {
          var args = Array.prototype.slice.call(arguments) ;
          EventEmitter.prototype.emit.apply(app, [event].concat(args)) ;
        }) ;
      }
      else {
        this._cachedEvents.push(event) ;
      }
    }
    //delegate all others to standard EventEmitter prototype
    return EventEmitter.prototype.addListener.call(app, event, listener) ;
  } ;

  return app;
}
459843
function extender (d, b) {
  _.each(b, (p) => {
    /* istanbul ignore if */
    if (Object.prototype.hasOwnProperty.call(b, p)) {
      d[p] = b[p];
    }
  });

  function Factory () {
    this.constructor = d;
  }

  /* istanbul ignore next */
  d.prototype = b === null ? Object.create(b) : (Factory.prototype = b.prototype, new Factory());
}
1154229
function Mutant(obj) {
    var triggered,
        i = 0;
        mutations = {};

    if (!obj.addEventListener) {
        obj = EventTarget(obj);
    }
    
    function trigger() {
        i++;
        
        if (triggered) return;
        
        triggered = setTimeout(function() {
            var evt = new MutationEvent(mutations, i);

            triggered = null;
            mutations = {};
            i = 0;

            obj.dispatchEvent(evt);
        }, 0);
    }
    
    return new Proxy(obj, {
        deleteProperty: function(target, property) {
            if (property in target) {
                if (!(property in mutations)) {
                    mutations[property] = target[property];
                }
                
                delete target[property];
                trigger();
            }
            
            return true;
        },
        defineProperty: function(target, property, descriptor) {
            var value = target[property];
            
            Object.defineProperty(target, property, descriptor);

            if (!(property in mutations)) {
                if (target[property] !== value) {
                    mutations[property] = value;
                    trigger();
                }
            }
        },
        set: function(target, property, value, receiver) {
            if (value !== target[property]) {
                if (!(property in mutations)) {
                    mutations[property] = target[property];
                }
                
                target[property] = value;
                trigger();
            }
        }
    });
}