text: /* automatically generated by JSCoverage - do not edit */
  if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
  if (! _$jscoverage['knockout.vm.js']) {
    _$jscoverage['knockout.vm.js'] = [];
    _$jscoverage['knockout.vm.js'][17] = 0;
    _$jscoverage['knockout.vm.js'][19] = 0;
    _$jscoverage['knockout.vm.js'][20] = 0;
    _$jscoverage['knockout.vm.js'][21] = 0;
    _$jscoverage['knockout.vm.js'][25] = 0;
    _$jscoverage['knockout.vm.js'][26] = 0;
    _$jscoverage['knockout.vm.js'][29] = 0;
    _$jscoverage['knockout.vm.js'][50] = 0;
    _$jscoverage['knockout.vm.js'][51] = 0;
    _$jscoverage['knockout.vm.js'][52] = 0;
    _$jscoverage['knockout.vm.js'][53] = 0;
    _$jscoverage['knockout.vm.js'][54] = 0;
    _$jscoverage['knockout.vm.js'][57] = 0;
    _$jscoverage['knockout.vm.js'][58] = 0;
    _$jscoverage['knockout.vm.js'][59] = 0;
    _$jscoverage['knockout.vm.js'][60] = 0;
    _$jscoverage['knockout.vm.js'][61] = 0;
    _$jscoverage['knockout.vm.js'][62] = 0;
    _$jscoverage['knockout.vm.js'][67] = 0;
    _$jscoverage['knockout.vm.js'][68] = 0;
    _$jscoverage['knockout.vm.js'][69] = 0;
    _$jscoverage['knockout.vm.js'][71] = 0;
    _$jscoverage['knockout.vm.js'][72] = 0;
    _$jscoverage['knockout.vm.js'][78] = 0;
    _$jscoverage['knockout.vm.js'][80] = 0;
    _$jscoverage['knockout.vm.js'][81] = 0;
    _$jscoverage['knockout.vm.js'][85] = 0;
    _$jscoverage['knockout.vm.js'][86] = 0;
    _$jscoverage['knockout.vm.js'][92] = 0;
    _$jscoverage['knockout.vm.js'][93] = 0;
    _$jscoverage['knockout.vm.js'][95] = 0;
    _$jscoverage['knockout.vm.js'][97] = 0;
    _$jscoverage['knockout.vm.js'][99] = 0;
    _$jscoverage['knockout.vm.js'][100] = 0;
    _$jscoverage['knockout.vm.js'][103] = 0;
    _$jscoverage['knockout.vm.js'][105] = 0;
    _$jscoverage['knockout.vm.js'][107] = 0;
    _$jscoverage['knockout.vm.js'][108] = 0;
    _$jscoverage['knockout.vm.js'][111] = 0;
    _$jscoverage['knockout.vm.js'][112] = 0;
    _$jscoverage['knockout.vm.js'][116] = 0;
    _$jscoverage['knockout.vm.js'][118] = 0;
    _$jscoverage['knockout.vm.js'][130] = 0;
    _$jscoverage['knockout.vm.js'][132] = 0;
    _$jscoverage['knockout.vm.js'][135] = 0;
    _$jscoverage['knockout.vm.js'][138] = 0;
    _$jscoverage['knockout.vm.js'][141] = 0;
    _$jscoverage['knockout.vm.js'][144] = 0;
    _$jscoverage['knockout.vm.js'][147] = 0;
    _$jscoverage['knockout.vm.js'][150] = 0;
    _$jscoverage['knockout.vm.js'][153] = 0;
    _$jscoverage['knockout.vm.js'][156] = 0;
    _$jscoverage['knockout.vm.js'][159] = 0;
    _$jscoverage['knockout.vm.js'][184] = 0;
    _$jscoverage['knockout.vm.js'][185] = 0;
    _$jscoverage['knockout.vm.js'][186] = 0;
    _$jscoverage['knockout.vm.js'][187] = 0;
    _$jscoverage['knockout.vm.js'][188] = 0;
    _$jscoverage['knockout.vm.js'][190] = 0;
    _$jscoverage['knockout.vm.js'][205] = 0;
    _$jscoverage['knockout.vm.js'][206] = 0;
    _$jscoverage['knockout.vm.js'][208] = 0;
    _$jscoverage['knockout.vm.js'][209] = 0;
    _$jscoverage['knockout.vm.js'][211] = 0;
    _$jscoverage['knockout.vm.js'][221] = 0;
    _$jscoverage['knockout.vm.js'][223] = 0;
    _$jscoverage['knockout.vm.js'][232] = 0;
    _$jscoverage['knockout.vm.js'][233] = 0;
    _$jscoverage['knockout.vm.js'][235] = 0;
    _$jscoverage['knockout.vm.js'][237] = 0;
    _$jscoverage['knockout.vm.js'][239] = 0;
    _$jscoverage['knockout.vm.js'][243] = 0;
    _$jscoverage['knockout.vm.js'][244] = 0;
    _$jscoverage['knockout.vm.js'][247] = 0;
    _$jscoverage['knockout.vm.js'][248] = 0;
    _$jscoverage['knockout.vm.js'][249] = 0;
    _$jscoverage['knockout.vm.js'][250] = 0;
    _$jscoverage['knockout.vm.js'][251] = 0;
    _$jscoverage['knockout.vm.js'][252] = 0;
    _$jscoverage['knockout.vm.js'][253] = 0;
    _$jscoverage['knockout.vm.js'][262] = 0;
    _$jscoverage['knockout.vm.js'][263] = 0;
    _$jscoverage['knockout.vm.js'][264] = 0;
    _$jscoverage['knockout.vm.js'][265] = 0;
    _$jscoverage['knockout.vm.js'][266] = 0;
    _$jscoverage['knockout.vm.js'][270] = 0;
    _$jscoverage['knockout.vm.js'][282] = 0;
    _$jscoverage['knockout.vm.js'][285] = 0;
    _$jscoverage['knockout.vm.js'][287] = 0;
    _$jscoverage['knockout.vm.js'][290] = 0;
    _$jscoverage['knockout.vm.js'][292] = 0;
    _$jscoverage['knockout.vm.js'][295] = 0;
    _$jscoverage['knockout.vm.js'][297] = 0;
    _$jscoverage['knockout.vm.js'][300] = 0;
    _$jscoverage['knockout.vm.js'][302] = 0;
    _$jscoverage['knockout.vm.js'][305] = 0;
    _$jscoverage['knockout.vm.js'][306] = 0;
    _$jscoverage['knockout.vm.js'][310] = 0;
    _$jscoverage['knockout.vm.js'][313] = 0;
    _$jscoverage['knockout.vm.js'][315] = 0;
    _$jscoverage['knockout.vm.js'][317] = 0;
    _$jscoverage['knockout.vm.js'][319] = 0;
    _$jscoverage['knockout.vm.js'][322] = 0;
    _$jscoverage['knockout.vm.js'][327] = 0;
    _$jscoverage['knockout.vm.js'][329] = 0;
    _$jscoverage['knockout.vm.js'][333] = 0;
    _$jscoverage['knockout.vm.js'][349] = 0;
    _$jscoverage['knockout.vm.js'][352] = 0;
    _$jscoverage['knockout.vm.js'][353] = 0;
    _$jscoverage['knockout.vm.js'][355] = 0;
    _$jscoverage['knockout.vm.js'][356] = 0;
    _$jscoverage['knockout.vm.js'][358] = 0;
    _$jscoverage['knockout.vm.js'][360] = 0;
    _$jscoverage['knockout.vm.js'][365] = 0;
    _$jscoverage['knockout.vm.js'][367] = 0;
    _$jscoverage['knockout.vm.js'][368] = 0;
    _$jscoverage['knockout.vm.js'][370] = 0;
    _$jscoverage['knockout.vm.js'][373] = 0;
    _$jscoverage['knockout.vm.js'][378] = 0;
    _$jscoverage['knockout.vm.js'][380] = 0;
    _$jscoverage['knockout.vm.js'][381] = 0;
    _$jscoverage['knockout.vm.js'][383] = 0;
    _$jscoverage['knockout.vm.js'][384] = 0;
    _$jscoverage['knockout.vm.js'][386] = 0;
    _$jscoverage['knockout.vm.js'][388] = 0;
    _$jscoverage['knockout.vm.js'][392] = 0;
    _$jscoverage['knockout.vm.js'][398] = 0;
    _$jscoverage['knockout.vm.js'][418] = 0;
    _$jscoverage['knockout.vm.js'][419] = 0;
    _$jscoverage['knockout.vm.js'][428] = 0;
    _$jscoverage['knockout.vm.js'][429] = 0;
    _$jscoverage['knockout.vm.js'][430] = 0;
    _$jscoverage['knockout.vm.js'][431] = 0;
    _$jscoverage['knockout.vm.js'][433] = 0;
    _$jscoverage['knockout.vm.js'][434] = 0;
    _$jscoverage['knockout.vm.js'][437] = 0;
    _$jscoverage['knockout.vm.js'][438] = 0;
    _$jscoverage['knockout.vm.js'][442] = 0;
    _$jscoverage['knockout.vm.js'][443] = 0;
    _$jscoverage['knockout.vm.js'][446] = 0;
    _$jscoverage['knockout.vm.js'][447] = 0;
    _$jscoverage['knockout.vm.js'][450] = 0;
    _$jscoverage['knockout.vm.js'][458] = 0;
    _$jscoverage['knockout.vm.js'][459] = 0;
    _$jscoverage['knockout.vm.js'][464] = 0;
    _$jscoverage['knockout.vm.js'][465] = 0;
    _$jscoverage['knockout.vm.js'][467] = 0;
    _$jscoverage['knockout.vm.js'][470] = 0;
    _$jscoverage['knockout.vm.js'][474] = 0;
    _$jscoverage['knockout.vm.js'][478] = 0;
    _$jscoverage['knockout.vm.js'][481] = 0;
    _$jscoverage['knockout.vm.js'][487] = 0;
    _$jscoverage['knockout.vm.js'][488] = 0;
    _$jscoverage['knockout.vm.js'][491] = 0;
    _$jscoverage['knockout.vm.js'][500] = 0;
    _$jscoverage['knockout.vm.js'][501] = 0;
    _$jscoverage['knockout.vm.js'][504] = 0;
    _$jscoverage['knockout.vm.js'][505] = 0;
    _$jscoverage['knockout.vm.js'][506] = 0;
    _$jscoverage['knockout.vm.js'][507] = 0;
    _$jscoverage['knockout.vm.js'][508] = 0;
    _$jscoverage['knockout.vm.js'][509] = 0;
    _$jscoverage['knockout.vm.js'][510] = 0;
    _$jscoverage['knockout.vm.js'][511] = 0;
    _$jscoverage['knockout.vm.js'][512] = 0;
    _$jscoverage['knockout.vm.js'][513] = 0;
    _$jscoverage['knockout.vm.js'][514] = 0;
    _$jscoverage['knockout.vm.js'][517] = 0;
    _$jscoverage['knockout.vm.js'][518] = 0;
    _$jscoverage['knockout.vm.js'][520] = 0;
    _$jscoverage['knockout.vm.js'][521] = 0;
    _$jscoverage['knockout.vm.js'][522] = 0;
    _$jscoverage['knockout.vm.js'][528] = 0;
    _$jscoverage['knockout.vm.js'][529] = 0;
    _$jscoverage['knockout.vm.js'][535] = 0;
    _$jscoverage['knockout.vm.js'][536] = 0;
    _$jscoverage['knockout.vm.js'][538] = 0;
    _$jscoverage['knockout.vm.js'][542] = 0;
    _$jscoverage['knockout.vm.js'][545] = 0;
    _$jscoverage['knockout.vm.js'][548] = 0;
    _$jscoverage['knockout.vm.js'][554] = 0;
    _$jscoverage['knockout.vm.js'][555] = 0;
    _$jscoverage['knockout.vm.js'][556] = 0;
    _$jscoverage['knockout.vm.js'][557] = 0;
    _$jscoverage['knockout.vm.js'][558] = 0;
    _$jscoverage['knockout.vm.js'][575] = 0;
    _$jscoverage['knockout.vm.js'][576] = 0;
    _$jscoverage['knockout.vm.js'][582] = 0;
    _$jscoverage['knockout.vm.js'][584] = 0;
    _$jscoverage['knockout.vm.js'][589] = 0;
    _$jscoverage['knockout.vm.js'][591] = 0;
    _$jscoverage['knockout.vm.js'][593] = 0;
    _$jscoverage['knockout.vm.js'][598] = 0;
    _$jscoverage['knockout.vm.js'][599] = 0;
    _$jscoverage['knockout.vm.js'][600] = 0;
    _$jscoverage['knockout.vm.js'][601] = 0;
    _$jscoverage['knockout.vm.js'][605] = 0;
    _$jscoverage['knockout.vm.js'][611] = 0;
    _$jscoverage['knockout.vm.js'][614] = 0;
    _$jscoverage['knockout.vm.js'][622] = 0;
    _$jscoverage['knockout.vm.js'][625] = 0;
    _$jscoverage['knockout.vm.js'][628] = 0;
    _$jscoverage['knockout.vm.js'][629] = 0;
    _$jscoverage['knockout.vm.js'][630] = 0;
    _$jscoverage['knockout.vm.js'][631] = 0;
    _$jscoverage['knockout.vm.js'][635] = 0;
    _$jscoverage['knockout.vm.js'][636] = 0;
    _$jscoverage['knockout.vm.js'][640] = 0;
    _$jscoverage['knockout.vm.js'][643] = 0;
    _$jscoverage['knockout.vm.js'][646] = 0;
    _$jscoverage['knockout.vm.js'][648] = 0;
    _$jscoverage['knockout.vm.js'][652] = 0;
    _$jscoverage['knockout.vm.js'][655] = 0;
    _$jscoverage['knockout.vm.js'][658] = 0;
    _$jscoverage['knockout.vm.js'][669] = 0;
    _$jscoverage['knockout.vm.js'][673] = 0;
    _$jscoverage['knockout.vm.js'][674] = 0;
    _$jscoverage['knockout.vm.js'][675] = 0;
    _$jscoverage['knockout.vm.js'][676] = 0;
    _$jscoverage['knockout.vm.js'][677] = 0;
    _$jscoverage['knockout.vm.js'][678] = 0;
    _$jscoverage['knockout.vm.js'][680] = 0;
    _$jscoverage['knockout.vm.js'][681] = 0;
    _$jscoverage['knockout.vm.js'][682] = 0;
    _$jscoverage['knockout.vm.js'][688] = 0;
    _$jscoverage['knockout.vm.js'][689] = 0;
    _$jscoverage['knockout.vm.js'][691] = 0;
    _$jscoverage['knockout.vm.js'][692] = 0;
    _$jscoverage['knockout.vm.js'][694] = 0;
    _$jscoverage['knockout.vm.js'][695] = 0;
    _$jscoverage['knockout.vm.js'][697] = 0;
    _$jscoverage['knockout.vm.js'][698] = 0;
    _$jscoverage['knockout.vm.js'][703] = 0;
    _$jscoverage['knockout.vm.js'][705] = 0;
    _$jscoverage['knockout.vm.js'][707] = 0;
    _$jscoverage['knockout.vm.js'][711] = 0;
    _$jscoverage['knockout.vm.js'][712] = 0;
    _$jscoverage['knockout.vm.js'][719] = 0;
    _$jscoverage['knockout.vm.js'][723] = 0;
    _$jscoverage['knockout.vm.js'][724] = 0;
    _$jscoverage['knockout.vm.js'][725] = 0;
    _$jscoverage['knockout.vm.js'][729] = 0;
    _$jscoverage['knockout.vm.js'][730] = 0;
    _$jscoverage['knockout.vm.js'][731] = 0;
    _$jscoverage['knockout.vm.js'][732] = 0;
    _$jscoverage['knockout.vm.js'][736] = 0;
    _$jscoverage['knockout.vm.js'][750] = 0;
    _$jscoverage['knockout.vm.js'][767] = 0;
    _$jscoverage['knockout.vm.js'][770] = 0;
    _$jscoverage['knockout.vm.js'][773] = 0;
    _$jscoverage['knockout.vm.js'][775] = 0;
    _$jscoverage['knockout.vm.js'][776] = 0;
    _$jscoverage['knockout.vm.js'][780] = 0;
    _$jscoverage['knockout.vm.js'][781] = 0;
    _$jscoverage['knockout.vm.js'][783] = 0;
    _$jscoverage['knockout.vm.js'][785] = 0;
    _$jscoverage['knockout.vm.js'][787] = 0;
    _$jscoverage['knockout.vm.js'][788] = 0;
    _$jscoverage['knockout.vm.js'][791] = 0;
    _$jscoverage['knockout.vm.js'][792] = 0;
    _$jscoverage['knockout.vm.js'][793] = 0;
    _$jscoverage['knockout.vm.js'][797] = 0;
    _$jscoverage['knockout.vm.js'][798] = 0;
    _$jscoverage['knockout.vm.js'][799] = 0;
    _$jscoverage['knockout.vm.js'][802] = 0;
    _$jscoverage['knockout.vm.js'][808] = 0;
    _$jscoverage['knockout.vm.js'][813] = 0;
    _$jscoverage['knockout.vm.js'][818] = 0;
    _$jscoverage['knockout.vm.js'][819] = 0;
    _$jscoverage['knockout.vm.js'][827] = 0;
    _$jscoverage['knockout.vm.js'][829] = 0;
    _$jscoverage['knockout.vm.js'][831] = 0;
    _$jscoverage['knockout.vm.js'][835] = 0;
  }
  _$jscoverage['knockout.vm.js'][17]++;
  if (typeof ko !== "undefined") {
    _$jscoverage['knockout.vm.js'][19]++;
    ko = jQuery.extend(true, {"log": (typeof wpp !== "undefined" && wpp.log === "function")? wpp.log: (function () {
    _$jscoverage['knockout.vm.js'][20]++;
    return false;
  }), "ajaxurl": (function (action) {
    _$jscoverage['knockout.vm.js'][21]++;
    return typeof ajaxurl !== "undefined"? ajaxurl + "?action=wpp_" + action: false;
  }), "strings": (typeof wpp !== "undefined" && wpp.strings !== "undefined")? wpp.strings: {}}, ko);
    _$jscoverage['knockout.vm.js'][25]++;
    ko.view_model = (function (args) {
    _$jscoverage['knockout.vm.js'][26]++;
    "use strict";
    _$jscoverage['knockout.vm.js'][26]++;
    ko.log("ko.view_model()", arguments);
    _$jscoverage['knockout.vm.js'][29]++;
    args = jQuery.extend(true, {"model": {}, "args": {}, "instance": {}, "bind": true, "timeout": 3000, "container": false, "saas": {"scope": jQuery.extend((typeof wpp.saas === "object"? wpp.saas: {}), {scope: "wpp.saas"}), "model": false, "screen": false, "show_updates": false, "debug_mode": false, "force_new_connection": false, "secure": true, "path": "_saas", "instance": typeof wpp._instance === "object"? wpp._instance: {}}, "actions": {"pre_apply": (function () {
    _$jscoverage['knockout.vm.js'][50]++;
    return;
  }), "init": (function () {
    _$jscoverage['knockout.vm.js'][51]++;
    return;
  }), "add_data": (function () {
    _$jscoverage['knockout.vm.js'][52]++;
    return;
  }), "remove_data": (function () {
    _$jscoverage['knockout.vm.js'][53]++;
    return;
  }), "get_model": (function () {
    _$jscoverage['knockout.vm.js'][54]++;
    return;
  }), "timeout": false, "callback": false, "saas_connect": (function () {
    _$jscoverage['knockout.vm.js'][57]++;
    return;
  }), "saas_disconnect": (function () {
    _$jscoverage['knockout.vm.js'][58]++;
    return;
  }), "saas_set_screen": (function () {
    _$jscoverage['knockout.vm.js'][59]++;
    return;
  }), "saas_update_on": (function () {
    _$jscoverage['knockout.vm.js'][60]++;
    return;
  }), "saas_update_emit": (function () {
    _$jscoverage['knockout.vm.js'][61]++;
    return;
  }), "saas_ignored": (function () {
    _$jscoverage['knockout.vm.js'][62]++;
    return;
  })}, "callback": (function (error, data) {
    _$jscoverage['knockout.vm.js'][67]++;
    var self = this;
    _$jscoverage['knockout.vm.js'][68]++;
    if (typeof self.actions === "object" && typeof self.actions.callback === "function") {
      _$jscoverage['knockout.vm.js'][69]++;
      return self.actions.callback(error, data);
    }
    else {
      _$jscoverage['knockout.vm.js'][71]++;
      if (error instanceof Error) {
        _$jscoverage['knockout.vm.js'][71]++;
        ko.log(error, data);
      }
      _$jscoverage['knockout.vm.js'][72]++;
      return data;
    }
  })}, typeof args === "object"? args: (typeof args === "string"? {"model": args}: {}));
    _$jscoverage['knockout.vm.js'][78]++;
    var container = (args.container && typeof args.container !== "object")? jQuery(args.container): args.container;
    _$jscoverage['knockout.vm.js'][80]++;
    if (! container || typeof container.length === "undefined" || ! container.length > 0) {
      _$jscoverage['knockout.vm.js'][81]++;
      return args.callback(new Error("ko.view_model. Container is missing, or incorrect."), false);
    }
    _$jscoverage['knockout.vm.js'][85]++;
    if (! args.actions.timeout || typeof args.actions.timeout !== "function") {
      _$jscoverage['knockout.vm.js'][86]++;
      args.actions.timeout = (function (self) {
    _$jscoverage['knockout.vm.js'][92]++;
    if (typeof self.saas.model == "string" && self.saas.connected == false && self.saas.ignore == false) {
      _$jscoverage['knockout.vm.js'][93]++;
      try {
        _$jscoverage['knockout.vm.js'][93]++;
        if (typeof self.saas.scope == "object") {
          _$jscoverage['knockout.vm.js'][93]++;
          self.saas.scope.disconnect();
        }
      }
      catch (e) {
        _$jscoverage['knockout.vm.js'][93]++;
        console.log(e);
      }
      _$jscoverage['knockout.vm.js'][93]++;
      ;
      _$jscoverage['knockout.vm.js'][95]++;
      self._bind = self._args.bind;
      _$jscoverage['knockout.vm.js'][97]++;
      self.saas.ignore = true;
      _$jscoverage['knockout.vm.js'][99]++;
      if (typeof self[self.saas.path] === "object") {
        _$jscoverage['knockout.vm.js'][100]++;
        self[self.saas.path] = ko.mapping.fromJS(self[self.saas.path]);
      }
      _$jscoverage['knockout.vm.js'][103]++;
      self.apply();
      _$jscoverage['knockout.vm.js'][105]++;
      if (self.saas.show_updates) {
        _$jscoverage['knockout.vm.js'][105]++;
        self.navbar_notice("SaaS offline");
      }
      _$jscoverage['knockout.vm.js'][107]++;
      try {
        _$jscoverage['knockout.vm.js'][107]++;
        self._args.actions.saas_ignored(self);
      }
      catch (e) {
        _$jscoverage['knockout.vm.js'][107]++;
        self._args.callback(e, self);
      }
      _$jscoverage['knockout.vm.js'][108]++;
      return;
    }
    _$jscoverage['knockout.vm.js'][111]++;
    self._is_timeout = true;
    _$jscoverage['knockout.vm.js'][112]++;
    return args.callback(new Error("Timeout. View Model load error."));
  });
    }
    _$jscoverage['knockout.vm.js'][116]++;
    var html = container.html();
    _$jscoverage['knockout.vm.js'][118]++;
    container.html("").addClass("ud_view_model ud_ui_loading").append("<div class=\"ud_ui_spinner\"></div>").append("<div class=\"ud_ui_prepared_interface\"></div>").find(".ud_ui_prepared_interface").html(html);
    _$jscoverage['knockout.vm.js'][130]++;
    var vm = (function (args, container) {
    _$jscoverage['knockout.vm.js'][132]++;
    var self = this;
    _$jscoverage['knockout.vm.js'][135]++;
    self._applied = false;
    _$jscoverage['knockout.vm.js'][138]++;
    self._loaded = false;
    _$jscoverage['knockout.vm.js'][141]++;
    self.saas = args.saas;
    _$jscoverage['knockout.vm.js'][144]++;
    self._args = args;
    _$jscoverage['knockout.vm.js'][147]++;
    self.container = container;
    _$jscoverage['knockout.vm.js'][150]++;
    self._actions = {};
    _$jscoverage['knockout.vm.js'][153]++;
    self._bind = args.bind;
    _$jscoverage['knockout.vm.js'][156]++;
    self._is_timeout = false;
    _$jscoverage['knockout.vm.js'][159]++;
    self.timers = {"load_timeout": false, "socket_status": false};
    _$jscoverage['knockout.vm.js'][184]++;
    self.add_data = (function (item, vhanlder, view_model, event) {
    _$jscoverage['knockout.vm.js'][185]++;
    if (typeof vhanlder == "function") {
      _$jscoverage['knockout.vm.js'][186]++;
      item.push(new vhanlder());
    }
    else {
      _$jscoverage['knockout.vm.js'][187]++;
      if (typeof view_model[vhanlder] === "function") {
        _$jscoverage['knockout.vm.js'][188]++;
        item.push(new view_model[vhanlder]());
      }
    }
    _$jscoverage['knockout.vm.js'][190]++;
    try {
      _$jscoverage['knockout.vm.js'][190]++;
      self._args.actions.add_data(self, event, item, vhanlder);
    }
    catch (e) {
      _$jscoverage['knockout.vm.js'][190]++;
      self._args.callback(e, view_model);
    }
  });
    _$jscoverage['knockout.vm.js'][205]++;
    self.remove_data = (function (item, data, event) {
    _$jscoverage['knockout.vm.js'][206]++;
    var c = typeof ko.strings !== "undefined" && typeof ko.strings.remove_confirmation !== "undefined"? ko.strings.remove_confirmation: "Are you sure you want to remove it?";
    _$jscoverage['knockout.vm.js'][208]++;
    if (confirm(c)) {
      _$jscoverage['knockout.vm.js'][209]++;
      item.remove(data);
    }
    _$jscoverage['knockout.vm.js'][211]++;
    try {
      _$jscoverage['knockout.vm.js'][211]++;
      self._args.actions.remove_data(self, event, item, data);
    }
    catch (e) {
      _$jscoverage['knockout.vm.js'][211]++;
      self._args.callback(e, self);
    }
  });
    _$jscoverage['knockout.vm.js'][221]++;
    self.in_array = (function (item, data) {
    _$jscoverage['knockout.vm.js'][223]++;
    return (data instanceof Array && data.indexOf(item) != -1);
  });
    _$jscoverage['knockout.vm.js'][232]++;
    self.navbar_notice = (function (data) {
    _$jscoverage['knockout.vm.js'][233]++;
    var self = this;
    _$jscoverage['knockout.vm.js'][235]++;
    data = (typeof data === "string"? {message: data}: (typeof data === "object"? data: {}));
    _$jscoverage['knockout.vm.js'][237]++;
    if (typeof data.message === "undefined") {
      _$jscoverage['knockout.vm.js'][237]++;
      return;
    }
    _$jscoverage['knockout.vm.js'][239]++;
    var socket_status = jQuery("li#ud_saas_message"), socket_object = jQuery("li#ud_saas_object");
    _$jscoverage['knockout.vm.js'][243]++;
    if (! socket_status.length > 0) {
      _$jscoverage['knockout.vm.js'][244]++;
      jQuery("ul#wp-admin-bar-root-default.ab-top-menu").append(socket_status = jQuery("<li id=\"ud_saas_message\" class=\"ud_saas_message\"></li>"));
    }
    _$jscoverage['knockout.vm.js'][247]++;
    if (data.object) {
      _$jscoverage['knockout.vm.js'][248]++;
      if (! socket_object.length > 0) {
        _$jscoverage['knockout.vm.js'][249]++;
        jQuery("ul#wp-admin-bar-root-default.ab-top-menu").append(socket_object = jQuery("<li id=\"ud_saas_object\" class=\"ud_saas_object\">[object]</li>"));
      }
      _$jscoverage['knockout.vm.js'][250]++;
      ;
      _$jscoverage['knockout.vm.js'][251]++;
      jQuery(socket_object).unbind("click");
      _$jscoverage['knockout.vm.js'][252]++;
      jQuery(socket_object).bind("click", (function () {
    _$jscoverage['knockout.vm.js'][253]++;
    ud.admin.pointer(socket_object, {"pointerClass": "wp-pointer ud-pointer ud-saas-debug", "title": data.message, "pointerWidth": 600, "content": "<pre>" + JSON.stringify(data.object, undefined, 2) + "</pre>"});
  }));
    }
    _$jscoverage['knockout.vm.js'][262]++;
    socket_status.fadeTo(500, 1, (function () {
    _$jscoverage['knockout.vm.js'][263]++;
    window.clearTimeout(self.timers.socket_status);
    _$jscoverage['knockout.vm.js'][264]++;
    socket_status.html(data.message? data.message: "");
    _$jscoverage['knockout.vm.js'][265]++;
    self.timers.socket_status = window.setTimeout((function () {
    _$jscoverage['knockout.vm.js'][265]++;
    socket_status.fadeTo(3000, 0.5, (function () {
    _$jscoverage['knockout.vm.js'][266]++;
    window.setTimeout((function () {
    _$jscoverage['knockout.vm.js'][266]++;
    socket_status.fadeTo(3000, 0.1);
  }), 5000);
  }));
  }), data.fade_out? data.fade_out: 10000);
  }));
    _$jscoverage['knockout.vm.js'][270]++;
    return data.message;
  });
    _$jscoverage['knockout.vm.js'][282]++;
    self.apply = (function () {
    _$jscoverage['knockout.vm.js'][285]++;
    var self = this;
    _$jscoverage['knockout.vm.js'][287]++;
    if (self._is_timeout) {
      _$jscoverage['knockout.vm.js'][290]++;
      return false;
    }
    else {
      _$jscoverage['knockout.vm.js'][292]++;
      if (! self._bind) {
        _$jscoverage['knockout.vm.js'][295]++;
        return self._args.callback(null, self);
      }
      else {
        _$jscoverage['knockout.vm.js'][297]++;
        if (this._applied) {
          _$jscoverage['knockout.vm.js'][300]++;
          return self._args.callback(null, self);
        }
        else {
          _$jscoverage['knockout.vm.js'][302]++;
          if (! self._loaded) {
            _$jscoverage['knockout.vm.js'][305]++;
            var error = typeof ko.strings.ko_model_failed? ko.strings.ko_model_failed: "Knockout Model was not loaded.";
            _$jscoverage['knockout.vm.js'][306]++;
            return self._args.callback(new Error(error), self);
          }
          else {
            _$jscoverage['knockout.vm.js'][310]++;
            try {
              _$jscoverage['knockout.vm.js'][313]++;
              try {
                _$jscoverage['knockout.vm.js'][313]++;
                self._args.actions.pre_apply(self);
              }
              catch (e) {
                _$jscoverage['knockout.vm.js'][313]++;
                self._args.callback(e, self);
              }
              _$jscoverage['knockout.vm.js'][315]++;
              ko.applyBindings(self, self.container.get(0));
              _$jscoverage['knockout.vm.js'][317]++;
              self._applied = true;
              _$jscoverage['knockout.vm.js'][319]++;
              self.container.removeClass("ud_ui_loading").addClass("ud_ui_applied");
              _$jscoverage['knockout.vm.js'][322]++;
              clearTimeout(self.timers.load_timeout);
              _$jscoverage['knockout.vm.js'][327]++;
              try {
                _$jscoverage['knockout.vm.js'][327]++;
                self._args.actions.init(self);
              }
              catch (e) {
                _$jscoverage['knockout.vm.js'][327]++;
                console.log(e);
                _$jscoverage['knockout.vm.js'][327]++;
                self._args.callback(e, self);
              }
              _$jscoverage['knockout.vm.js'][329]++;
              return self._args.callback(null, self);
            }
            catch (error) {
              _$jscoverage['knockout.vm.js'][333]++;
              return self._args.callback(error, self);
            }
          }
        }
      }
    }
  });
    _$jscoverage['knockout.vm.js'][349]++;
    self._prepare_model_data = (function (r, d) {
    _$jscoverage['knockout.vm.js'][352]++;
    var self = this;
    _$jscoverage['knockout.vm.js'][353]++;
    var data = {};
    _$jscoverage['knockout.vm.js'][355]++;
    r = typeof r !== "object"? {}: r;
    _$jscoverage['knockout.vm.js'][356]++;
    d = typeof d !== "object"? self: d;
    _$jscoverage['knockout.vm.js'][358]++;
    for (var i in r) {
      _$jscoverage['knockout.vm.js'][360]++;
      switch (i) {
      case "_static":
        _$jscoverage['knockout.vm.js'][365]++;
        for (var e in r[i]) {
          _$jscoverage['knockout.vm.js'][367]++;
          if (d && typeof d[e] === "function") {
            _$jscoverage['knockout.vm.js'][368]++;
            data[e] = d[e](r[i][e]);
          }
          else {
            _$jscoverage['knockout.vm.js'][370]++;
            data[e] = r[i][e];
          }
  }
        _$jscoverage['knockout.vm.js'][373]++;
        break;
      case "_observable":
        _$jscoverage['knockout.vm.js'][378]++;
        for (var e in r[i]) {
          _$jscoverage['knockout.vm.js'][380]++;
          if (d && typeof d[e] === "function") {
            _$jscoverage['knockout.vm.js'][381]++;
            data[e] = d[e](r[i][e]);
          }
          else {
            _$jscoverage['knockout.vm.js'][383]++;
            if (! r[i][e] || typeof r[i][e].length === "undefined") {
              _$jscoverage['knockout.vm.js'][384]++;
              data[e] = ko.observable(r[i][e]);
            }
            else {
              _$jscoverage['knockout.vm.js'][386]++;
              if (typeof r[i][e] === "object") {
                _$jscoverage['knockout.vm.js'][388]++;
                data[e] = ko.observableArray(r[i][e]);
              }
              else {
                _$jscoverage['knockout.vm.js'][392]++;
                data[e] = ko.observable(r[i][e]);
              }
            }
          }
  }
        _$jscoverage['knockout.vm.js'][398]++;
        break;
      case "_action":
        _$jscoverage['knockout.vm.js'][418]++;
        self._actions = jQuery.extend(true, self._actions, r[i]);
        _$jscoverage['knockout.vm.js'][419]++;
        break;
      case "_saas":
        _$jscoverage['knockout.vm.js'][428]++;
        if (typeof self.saas.path == "string") {
          _$jscoverage['knockout.vm.js'][429]++;
          data[self.saas.path] = {};
          _$jscoverage['knockout.vm.js'][430]++;
          for (var e in r[i]) {
            _$jscoverage['knockout.vm.js'][431]++;
            switch (e) {
            case "conditionals":
              _$jscoverage['knockout.vm.js'][433]++;
              data[self.saas.path] = jQuery.extend(true, {}, data[self.saas.path], r[i][e]);
              _$jscoverage['knockout.vm.js'][434]++;
              break;
            case "interface":
            default:
              _$jscoverage['knockout.vm.js'][437]++;
              data[self.saas.path] = jQuery.extend(true, {}, r[i][e], data[self.saas.path]);
              _$jscoverage['knockout.vm.js'][438]++;
              break;
            }
  }
          _$jscoverage['knockout.vm.js'][442]++;
          if (typeof ud.utils === "object" && typeof ud.utils.type_fix === "function") {
            _$jscoverage['knockout.vm.js'][443]++;
            data[self.saas.path] = ud.utils.type_fix(data[self.saas.path], {"nullify": true});
          }
          _$jscoverage['knockout.vm.js'][446]++;
          if (d && typeof d[self.saas.path] === "function") {
            _$jscoverage['knockout.vm.js'][447]++;
            data[self.saas.path] = d[self.saas.path](data[self.saas.path]);
          }
        }
        _$jscoverage['knockout.vm.js'][450]++;
        break;
      default:
        _$jscoverage['knockout.vm.js'][458]++;
        if (d && typeof d[i] === "function") {
          _$jscoverage['knockout.vm.js'][459]++;
          data[i] = d[i](r[i]);
        }
        else {
          _$jscoverage['knockout.vm.js'][464]++;
          if (typeof r[i] === "object" && typeof r[i].length === "undefined") {
            _$jscoverage['knockout.vm.js'][465]++;
            data[i] = self._prepare_model_data(r[i], (typeof d[i] === "object"? d[i]: false));
          }
          else {
            _$jscoverage['knockout.vm.js'][467]++;
            data[i] = r[i];
          }
        }
        _$jscoverage['knockout.vm.js'][470]++;
        break;
      }
  }
    _$jscoverage['knockout.vm.js'][474]++;
    return data;
  });
    _$jscoverage['knockout.vm.js'][478]++;
    self.timers.load_timeout = setTimeout((function () {
    _$jscoverage['knockout.vm.js'][478]++;
    args.actions.timeout(self);
  }), args.timeout);
    _$jscoverage['knockout.vm.js'][481]++;
    self = jQuery.extend(true, self, (typeof self._args.instance === "object"? self._args.instance: {}));
    _$jscoverage['knockout.vm.js'][487]++;
    if (typeof self._args.model === "string") {
      _$jscoverage['knockout.vm.js'][488]++;
      self._args.model_name = self._args.model;
      _$jscoverage['knockout.vm.js'][491]++;
      jQuery.ajax({url: ko.ajaxurl("get_model"), data: {"args": jQuery.extend(true, {}, {"model": self._args.model_name}, self._args.args)}, dataType: "json", type: "POST", async: false, beforeSend: (function (xhr) {
    _$jscoverage['knockout.vm.js'][500]++;
    try {
      _$jscoverage['knockout.vm.js'][500]++;
      self._args.actions.get_model(self);
    }
    catch (e) {
      _$jscoverage['knockout.vm.js'][500]++;
      self._args.callback(e, self);
    }
    _$jscoverage['knockout.vm.js'][501]++;
    xhr.overrideMimeType("application/json; charset=utf-8");
  }), complete: (function (jqXHR) {
    _$jscoverage['knockout.vm.js'][504]++;
    var r = {};
    _$jscoverage['knockout.vm.js'][505]++;
    try {
      _$jscoverage['knockout.vm.js'][506]++;
      r = jQuery.parseJSON(jqXHR.responseText);
      _$jscoverage['knockout.vm.js'][507]++;
      if (typeof r !== "object" || jqXHR.responseText === "") {
        _$jscoverage['knockout.vm.js'][508]++;
        throw new Error("Ajax response is empty");
      }
      else {
        _$jscoverage['knockout.vm.js'][509]++;
        if (jqXHR.status === 500) {
          _$jscoverage['knockout.vm.js'][510]++;
          throw new Error("Internal Server Error");
        }
        else {
          _$jscoverage['knockout.vm.js'][511]++;
          if (jqXHR.statusText === "timeout") {
            _$jscoverage['knockout.vm.js'][512]++;
            throw new Error("Server Timeout");
          }
          else {
            _$jscoverage['knockout.vm.js'][513]++;
            if (typeof r.success == true) {
              _$jscoverage['knockout.vm.js'][514]++;
              throw new Error("Could not get '" + self._args.model + "' model");
            }
          }
        }
      }
    }
    catch (error) {
      _$jscoverage['knockout.vm.js'][517]++;
      ko.log("AJAX Error: " + (error.message? error.message: "Unknown."));
      _$jscoverage['knockout.vm.js'][518]++;
      self._args.model = r = false;
    }
    _$jscoverage['knockout.vm.js'][520]++;
    if (r) {
      _$jscoverage['knockout.vm.js'][521]++;
      self._args.model = r.model;
      _$jscoverage['knockout.vm.js'][522]++;
      self._args.model._name = self._args.model_name;
    }
  }), error: (function (jqXHR, textStatus, errorThrown) {
  })});
    }
    else {
      _$jscoverage['knockout.vm.js'][528]++;
      if (typeof self._args.model._name === "undefined") {
        _$jscoverage['knockout.vm.js'][529]++;
        self._args.model._name = "";
      }
    }
    _$jscoverage['knockout.vm.js'][535]++;
    if (! self._args.model) {
      _$jscoverage['knockout.vm.js'][536]++;
      return;
    }
    else {
      _$jscoverage['knockout.vm.js'][538]++;
      self._loaded = true;
    }
    _$jscoverage['knockout.vm.js'][542]++;
    var prepared_data = self._prepare_model_data(self._args.model);
    _$jscoverage['knockout.vm.js'][545]++;
    prepared_data.strings = jQuery.extend(true, ko.strings, (typeof prepared_data.strings != "undefined")? prepared_data.strings: {});
    _$jscoverage['knockout.vm.js'][548]++;
    self = jQuery.extend(true, self, prepared_data);
    _$jscoverage['knockout.vm.js'][554]++;
    for (var i in self._actions) {
      _$jscoverage['knockout.vm.js'][555]++;
      if (jQuery("[data-action_hook=\"" + i + "\"]", container).length > 0) {
        _$jscoverage['knockout.vm.js'][556]++;
        for (var a in self._actions[i]) {
          _$jscoverage['knockout.vm.js'][557]++;
          if (typeof self._actions[i][a] === "string") {
            _$jscoverage['knockout.vm.js'][558]++;
            jQuery("[data-action_hook=\"" + i + "\"]", container).append(self._actions[i][a]);
          }
          else {
          }
  }
      }
  }
    _$jscoverage['knockout.vm.js'][575]++;
    self.saas._set_screen = (function (e, args) {
    _$jscoverage['knockout.vm.js'][576]++;
    ko.log("ko.view_model.vm()._saas_screen_set()", arguments);
    _$jscoverage['knockout.vm.js'][582]++;
    if (self.saas.ignore) {
      _$jscoverage['knockout.vm.js'][582]++;
      return;
    }
    _$jscoverage['knockout.vm.js'][584]++;
    self.saas.connected = true;
    _$jscoverage['knockout.vm.js'][589]++;
    if (typeof self[self.saas.path] === "object") {
      _$jscoverage['knockout.vm.js'][591]++;
      self.saas._active(true);
      _$jscoverage['knockout.vm.js'][593]++;
      self.saas.update_trigger = self.saas.id + "::update::" + self.saas.screen;
      _$jscoverage['knockout.vm.js'][598]++;
      self.saas.scope.on(self.saas.id + "::request::_interface", (function () {
    _$jscoverage['knockout.vm.js'][599]++;
    ko.log("ko.view_model.vm()._saas_screen_set(); Interface request received, responding.");
    _$jscoverage['knockout.vm.js'][600]++;
    self.saas._merging(true);
    _$jscoverage['knockout.vm.js'][601]++;
    self.saas.scope.emit(self.saas.id + "::update::" + self.saas.screen, {"key": self.saas.path, "value": ko.toJS(self[self.saas.path])});
    _$jscoverage['knockout.vm.js'][605]++;
    self.saas._merging(false);
  }));
      _$jscoverage['knockout.vm.js'][611]++;
      self.saas.scope.on(self.saas.update_trigger, (function (data) {
    _$jscoverage['knockout.vm.js'][614]++;
    var data = jQuery.extend({"path": false, "key": false, "value": false, "update": true, "message": false}, data);
    _$jscoverage['knockout.vm.js'][622]++;
    var full_path = (data.path && data.key? (data.path + "." + data.key): false);
    _$jscoverage['knockout.vm.js'][625]++;
    self.saas._merging(true);
    _$jscoverage['knockout.vm.js'][628]++;
    if (data.update && full_path !== false) {
      _$jscoverage['knockout.vm.js'][629]++;
      try {
        _$jscoverage['knockout.vm.js'][630]++;
        self.saas._observable_caller[full_path].value(data.value);
      }
      catch (e) {
        _$jscoverage['knockout.vm.js'][631]++;
        self._args.callback(new Error("Interface Path Not Found"), self);
      }
    }
    _$jscoverage['knockout.vm.js'][635]++;
    if (typeof data.message === "string" && data.message.length > 0 && self.saas.show_updates) {
      _$jscoverage['knockout.vm.js'][636]++;
      self.navbar_notice(data.message);
    }
    _$jscoverage['knockout.vm.js'][640]++;
    try {
      _$jscoverage['knockout.vm.js'][640]++;
      self._args.actions.saas_update_on(self, data);
    }
    catch (e) {
      _$jscoverage['knockout.vm.js'][640]++;
      self._args.callback(e, self);
    }
    _$jscoverage['knockout.vm.js'][643]++;
    self.saas._merging(false);
  }));
      _$jscoverage['knockout.vm.js'][646]++;
      jQuery(document).bind(self.saas.id + "::disconnected", (function (event, data) {
    _$jscoverage['knockout.vm.js'][646]++;
    self.saas._active(false);
  }));
      _$jscoverage['knockout.vm.js'][648]++;
      self[self.saas.path] = self.saas._set_emit(self[self.saas.path]);
    }
    _$jscoverage['knockout.vm.js'][652]++;
    try {
      _$jscoverage['knockout.vm.js'][652]++;
      self._args.actions.saas_set_screen(self);
    }
    catch (e) {
      _$jscoverage['knockout.vm.js'][652]++;
      self._args.callback(e, self);
    }
    _$jscoverage['knockout.vm.js'][655]++;
    self._bind = self._args.bind;
    _$jscoverage['knockout.vm.js'][658]++;
    self.apply();
  });
    _$jscoverage['knockout.vm.js'][669]++;
    self.saas._set_emit = (function (data, path) {
    _$jscoverage['knockout.vm.js'][673]++;
    var subscribe = (function (object, key, path) {
    _$jscoverage['knockout.vm.js'][674]++;
    self.saas._observable_caller[path + "." + key] = {"path": path, "key": key, "value": object};
    _$jscoverage['knockout.vm.js'][675]++;
    object.subscribe((function (value) {
    _$jscoverage['knockout.vm.js'][676]++;
    if (! self.saas._merging()) {
      _$jscoverage['knockout.vm.js'][677]++;
      try {
        _$jscoverage['knockout.vm.js'][678]++;
        var data = {"key": key, "value": value, "path": path};
        _$jscoverage['knockout.vm.js'][680]++;
        self._args.actions.saas_update_emit(self, data);
        _$jscoverage['knockout.vm.js'][681]++;
        self.saas.scope.emit(self.saas.update_trigger, data);
      }
      catch (e) {
        _$jscoverage['knockout.vm.js'][682]++;
        self._args.callback(e, self);
      }
    }
  }), self);
  });
    _$jscoverage['knockout.vm.js'][688]++;
    var subscribe_deep = (function (object, path) {
    _$jscoverage['knockout.vm.js'][689]++;
    for (var key in object) {
      _$jscoverage['knockout.vm.js'][691]++;
      if (key === "__ko_mapping__") {
        _$jscoverage['knockout.vm.js'][692]++;
        continue;
      }
      else {
        _$jscoverage['knockout.vm.js'][694]++;
        if (ko.isObservable(object[key])) {
          _$jscoverage['knockout.vm.js'][695]++;
          subscribe(object[key], key, path);
        }
        else {
          _$jscoverage['knockout.vm.js'][697]++;
          if (typeof object[key] === "object") {
            _$jscoverage['knockout.vm.js'][698]++;
            subscribe_deep(object[key], path + "." + key);
          }
        }
      }
  }
  });
    _$jscoverage['knockout.vm.js'][703]++;
    data = ko.mapping.fromJS(data);
    _$jscoverage['knockout.vm.js'][705]++;
    subscribe_deep(data, typeof path === "string"? path: self.saas.path);
    _$jscoverage['knockout.vm.js'][707]++;
    return data;
  });
    _$jscoverage['knockout.vm.js'][711]++;
    if (typeof self[self.saas.path] === "function") {
      _$jscoverage['knockout.vm.js'][712]++;
      self[self.saas.path] = self[self.saas.path]({});
    }
    _$jscoverage['knockout.vm.js'][719]++;
    if (typeof self.saas.model === "string") {
      _$jscoverage['knockout.vm.js'][723]++;
      if (typeof self.saas.scope.connect !== "function") {
        _$jscoverage['knockout.vm.js'][724]++;
        self._bind = false;
        _$jscoverage['knockout.vm.js'][725]++;
        return self._args.callback(new Error(typeof ko.strings.saas_connection_fail !== "undefined"? ko.strings.saas_connection_fail: "Application could not connect to SaaS."), self);
      }
      _$jscoverage['knockout.vm.js'][729]++;
      self.saas.scope.show_updates = self.saas.show_updates;
      _$jscoverage['knockout.vm.js'][730]++;
      if (typeof self.saas.scope.settings.log !== "undefined") {
        _$jscoverage['knockout.vm.js'][731]++;
        if (self.saas.debug_mode) {
          _$jscoverage['knockout.vm.js'][731]++;
          jQuery.extend(self.saas.scope.settings.log, {"events": true, "all_data": true});
        }
        else {
          _$jscoverage['knockout.vm.js'][732]++;
          jQuery.extend(self.saas.scope.settings.log, {"events": false, "all_data": false});
        }
      }
      _$jscoverage['knockout.vm.js'][736]++;
      self.saas.scope.instance = jQuery.extend({"api_key": false, "site_uid": false, "customer_key": false, "customer_name": false, "site_url": false, "home": false, "ajax": false, "ip": false, "site": false, "screen": false}, self.saas.scope.instance, typeof self.saas.instance === "object"? self.saas.instance: {});
      _$jscoverage['knockout.vm.js'][750]++;
      jQuery.extend(self.saas, {"id": false, "update_trigger": false, "_merging": ko.observable(false), "_active": ko.observable(null), "_observable_caller": {}, "connected": false, "ignore": false});
      _$jscoverage['knockout.vm.js'][767]++;
      if (typeof self.saas.screen === "string") {
        _$jscoverage['knockout.vm.js'][770]++;
        self._bind = false;
        _$jscoverage['knockout.vm.js'][773]++;
        if (self.saas.scope.id && ! self.saas.force_new_connection) {
          _$jscoverage['knockout.vm.js'][775]++;
          self.saas.id = self.saas.scope.id;
          _$jscoverage['knockout.vm.js'][776]++;
          jQuery(document).one(self.saas.scope.id + "::update::screen_set::" + self.saas.screen, self.saas._set_screen);
        }
        else {
          _$jscoverage['knockout.vm.js'][780]++;
          jQuery(document).one("ud::saas::connect", (function (event, socket) {
    _$jscoverage['knockout.vm.js'][781]++;
    self.saas.id = socket.id;
    _$jscoverage['knockout.vm.js'][783]++;
    jQuery(document).one(socket.id + "::update::screen_set::" + self.saas.screen, self.saas._set_screen);
    _$jscoverage['knockout.vm.js'][785]++;
    try {
      _$jscoverage['knockout.vm.js'][785]++;
      self._args.actions.saas_connect(self);
    }
    catch (e) {
      _$jscoverage['knockout.vm.js'][785]++;
      self._args.callback(e, self);
    }
    _$jscoverage['knockout.vm.js'][787]++;
    jQuery(document).bind(socket.id + "::update", (function (event, data) {
    _$jscoverage['knockout.vm.js'][788]++;
    if (self.saas.show_updates) {
      _$jscoverage['knockout.vm.js'][788]++;
      self.navbar_notice(data);
    }
  }));
    _$jscoverage['knockout.vm.js'][791]++;
    jQuery(document).one(socket.id + "::init", (function (event, socket) {
    _$jscoverage['knockout.vm.js'][792]++;
    if (self.saas.show_updates) {
      _$jscoverage['knockout.vm.js'][793]++;
      self.navbar_notice({"message": ko.strings.connection_established? ko.strings.connection_established: "SaaS Online."});
    }
  }));
    _$jscoverage['knockout.vm.js'][797]++;
    jQuery(document).one(socket.id + "::disconnected", (function (event, socket) {
    _$jscoverage['knockout.vm.js'][798]++;
    if (self.saas.show_updates) {
      _$jscoverage['knockout.vm.js'][799]++;
      self.navbar_notice({"message": ko.strings.connection_lost? ko.strings.connection_lost: "SaaS Offline."});
    }
    _$jscoverage['knockout.vm.js'][802]++;
    try {
      _$jscoverage['knockout.vm.js'][802]++;
      self._args.actions.saas_disconnect(self);
    }
    catch (e) {
      _$jscoverage['knockout.vm.js'][802]++;
      self._args.callback(e, self);
    }
  }));
  }));
        }
        _$jscoverage['knockout.vm.js'][808]++;
        self.saas.scope.instance.screen = self.saas.screen;
      }
      _$jscoverage['knockout.vm.js'][813]++;
      self.saas.scope.connect(self.saas.model, {"force new connection": self.saas.force_new_connection, "secure": self.saas.secure});
    }
    else {
      _$jscoverage['knockout.vm.js'][818]++;
      if (typeof self[self.saas.path] === "object") {
        _$jscoverage['knockout.vm.js'][819]++;
        self[self.saas.path] = ko.mapping.fromJS(self[self.saas.path]);
      }
    }
  });
    _$jscoverage['knockout.vm.js'][827]++;
    vm = new vm(args, container);
    _$jscoverage['knockout.vm.js'][829]++;
    ko.log(vm);
    _$jscoverage['knockout.vm.js'][831]++;
    return vm.apply();
  });
  }
  else {
    _$jscoverage['knockout.vm.js'][835]++;
    ko = {view_model: (function () {
    _$jscoverage['knockout.vm.js'][835]++;
    return false;
  })};
  }
  _$jscoverage['knockout.vm.js'].source = ["/**"," * Knockout View Model"," *"," * Flexible View Model generator for interfaces:"," * creates View Model object and initializes (apply bindings) knockout functionality."," * Contains basic view_model functionality such as add_data, remove_data ( the same as depriciated add and remove row functionality ), etc."," * Also, it's used as Gateway to SaaS: initializes socket connection."," *"," * @version 1.0"," * @description ViewModel class for all knockout/saas instances ( view models )"," * @package Knockout"," * @subpackage UD"," * @dependencies jquery, knockout, knockout-mapping, ud.socket, ud.saas"," * @author team@UD"," * @param args. mixed. Settings."," */","if( typeof ko !== 'undefined' ) {","","  ko = jQuery.extend( true, {","    'log': ( typeof wpp !== 'undefined' &amp;&amp; wpp.log === 'function' ) ? wpp.log : function() { return false; },","    'ajaxurl': function( action ) { return typeof ajaxurl !== 'undefined' ? ajaxurl + '?action=wpp_' + action : false; },","    'strings': ( typeof wpp !== 'undefined' &amp;&amp; wpp.strings !== 'undefined' ) ? wpp.strings : {}","  }, ko );","","  ko.view_model = function( args ) {","    'use strict'; ko.log( 'ko.view_model()', arguments );","","    /* Try to determine if model's name is set or model's object already exists */","    args = jQuery.extend( true, {","      'model': {}, // model can be string.","      'args': {}, // specific arguments for model getting. i.e. unique ID.","      'instance': {}, // Object which extends the current model. All additional object's data can be set here","      'bind': true, // If true, it allows do ko.applyBindings()","      'timeout': 3000, //15000, // Interface load timeout.","      'container': false, // Required!","      // All SaaS settings stored here","      'saas': {","        'scope': jQuery.extend( ( typeof wpp.saas === 'object' ? wpp.saas : {} ), { scope: 'wpp.saas' } ), // SaaS object scope ( ud.saas )","        'model': false,","        'screen': false,","        'show_updates': false, // Shows messages in navbar","        'debug_mode': false, // Prints logs to console","        'force_new_connection': false, // If true, we set new socket connection in any case.","        'secure' : true, // SSL or not","        'path' : '_saas', // Link to object which should be emited on subscribe,","        'instance': typeof wpp._instance === 'object' ? wpp._instance : {} // Contains client's neccessary data such as site_url, api_key, etc","      },","      // Set of actions listeners which are fired on view model 'triggers'","      'actions': {","        'pre_apply': function() { return; }, // Called before ko.applyBindings() function","        'init': function() { return; }, // Called after ko.applyBindings() function","        'add_data': function() { return; }, // Called after data adding","        'remove_data': function() { return; }, // Called after data removing","        'get_model': function() { return; }, // Called before we do ajax request for get model","        'timeout': false, // Called on timeout","        'callback': false, // Additional","        'saas_connect': function() { return; }, // Called on ud::saas::connect event","        'saas_disconnect': function() { return; }, // Called on ud::saas::disconnect event","        'saas_set_screen': function() { return; }, // Called on self.saas._set_screen","        'saas_update_on': function() { return; }, // Called on saas data updating by SaaS","        'saas_update_emit': function() { return; }, // Called on data emit to SaaS","        'saas_ignored' : function() { return; } // Called if Saas connection is not established and we ignore it.","      },","      // Return / Callback handling. Outputs Error objects to console, returns second argument","      // Should not be overwritten! If you want to add your callback use actions.callback","      'callback': function( error, data ) {","        var self = this;","        if( typeof self.actions === 'object' &amp;&amp; typeof self.actions.callback === 'function' ) {","          return self.actions.callback( error, data );","        } else {","          if( error instanceof Error ) { ko.log( error, data ); }","          return data;","        }","      }","    }, typeof args === 'object' ? args : ( typeof args === 'string' ? { 'model' : args } : {} ) );","","    /* Check container argument */","    var container = ( args.container &amp;&amp; typeof args.container !== 'object' ) ? jQuery( args.container ) : args.container;","","    if( !container || typeof container.length === 'undefined' || !container.length &gt; 0 ) {","      return args.callback( new Error( 'ko.view_model. Container is missing, or incorrect.' ), false );","    }","","    /* Set Timeout Event */","    if ( !args.actions.timeout || typeof args.actions.timeout !== 'function' ) {","      args.actions.timeout = function( self ) {","        /**","         * Determine if Saas connection is not established.","         * If yes, - so it can be the reason of timeout.","         * Try to ignore Saas connection in this case and apply bindings without Saas. peshkov@UD","         */","        if ( typeof self.saas.model == 'string' &amp;&amp; self.saas.connected == false &amp;&amp; self.saas.ignore == false ) {","          try{ if( typeof self.saas.scope == 'object' ) self.saas.scope.disconnect(); } catch(e) { console.log( e ); };","          /* Set bind val passed to view_model */","          self._bind = self._args.bind;","          /* Saas initialization is ignored now. */","          self.saas.ignore = true;","          /* We should set saas variable to observable in any case. */","          if( typeof self[ self.saas.path ] === 'object' ) {","            self[ self.saas.path ] = ko.mapping.fromJS( self[ self.saas.path ] );","          }","          /* Now, we try to call apply. */","          self.apply();","          /* Updates navbar notice */","          if( self.saas.show_updates ) { self.navbar_notice( 'SaaS offline' ); }","          /* Special Handlers can be added here */","          try{ self._args.actions.saas_ignored( self ); } catch(e) { self._args.callback( e, self ); }","          return;","        }","","        self._is_timeout = true;","        return args.callback( new Error( 'Timeout. View Model load error.' ) );","      };","    }","","    var html = container.html();","","    container.html( '' )","      .addClass( 'ud_view_model ud_ui_loading' )","      .append( '&lt;div class=\"ud_ui_spinner\"&gt;&lt;/div&gt;' )","      .append( '&lt;div class=\"ud_ui_prepared_interface\"&gt;&lt;/div&gt;' )","      .find( '.ud_ui_prepared_interface' )","      .html( html );","","    /**","     * Creates View_Model","     *","     * Any view_model methods or static variables shoud be added inside of this function.","     */","    var vm = function( args, container ) {","","      var self = this;","","      /* Determines if view_model already applied Bindings ( ko.applyBinding )  */","      self._applied = false;","","      /* Determines if model's data is successfully loaded */","      self._loaded = false;","","      /* SaaS connection */","      self.saas = args.saas;","","      /* Arguments */","      self._args = args;","","      /* DOM */","      self.container = container;","","      /* Action Hooks */","      self._actions = {};","","      /* Bind. boolean */","      self._bind = args.bind;","","      /* Is timeout? */","      self._is_timeout = false;","","      /* setTimeout instances */","      self.timers = {","        'load_timeout': false,","        'socket_status': false","      };","","      /**","       * Pushes new element to array.","       *","       * Example of usage:","       * data-bind=\"click: $root.add_data.bind( $data, $root.some_array, $root.vhandler )\"","       * where $root.vhandler is a function, which creates data.","       *","       * $root.vhandler example:","       * self.handler = function() {","       *   var self = this;","       *   self.arg1 = ko.observable( 'value1' );","       *   self.arg2 = 'value2';","       * }","       *","       * @param observableArray item. Where we want to add new data","       * @param mixed vhandler. Name of function or function which inits new data","       * @param object view_model. The current view_model object","       * @param object event.","       * @author peshkov@UD","       */","      self.add_data = function( item, vhanlder, view_model, event ) {","        if( typeof vhanlder == 'function' ) {","          item.push( new vhanlder );","        } else if ( typeof view_model[ vhanlder ] === 'function' ) {","          item.push( new view_model[ vhanlder ]() );","        }","        try{ self._args.actions.add_data( self, event, item, vhanlder ) } catch(e) { self._args.callback( e, view_model ); }","      };","","","      /**","       * Removes data from array.","       *","       * Example of usage:","       * data-bind=\"click: $root.remove_data.bind( $data, $root.some_array )\"","       *","       * @param observableArray item. Where we want to remove data","       * @param mixed data. Data which should be removed from array.","       * @param object event.","       * @author peshkov@UD","       */","      self.remove_data = function( item, data, event ) {","        var c = typeof ko.strings !== 'undefined' &amp;&amp; typeof ko.strings.remove_confirmation !== 'undefined' ?","          ko.strings.remove_confirmation : 'Are you sure you want to remove it?';","        if ( confirm( c ) ) {","          item.remove( data );","        }","        try{ self._args.actions.remove_data( self, event, item, data ) } catch(e) { self._args.callback( e, self ); }","      };","","","      /**","       * Checks item in array","       * Template Helper Function","       *","       * @author potanin@UD","       */","      self.in_array = function( item, data ) {","        // console.info( 'ko.view_model._show()', arguments );","        return ( data instanceof Array &amp;&amp; data.indexOf( item ) != -1 );","      };","","","      /**","       * Renders Message in Navbar sent by SaaS.","       *","       * @author potanin@UD","       */","      self.navbar_notice = function( data ) {","        var self = this;","        /* */","        data = ( typeof data === 'string' ? { message: data } : ( typeof data === 'object' ? data : {} ) );","        /* If message property is not defined at all, we do not proceed */","        if( typeof data.message === 'undefined' ) return;","","        var socket_status = jQuery( 'li#ud_saas_message' ),","            socket_object = jQuery( 'li#ud_saas_object' );","","        /* Add Navbar Status Container */","        if( !socket_status.length &gt; 0 ) {","          jQuery( 'ul#wp-admin-bar-root-default.ab-top-menu' ).append( socket_status = jQuery( '&lt;li id=\"ud_saas_message\" class=\"ud_saas_message\"&gt;&lt;/li&gt;' ) );","        }","","        if( data.object ) {","          if( !socket_object.length &gt; 0 ) {","            jQuery( 'ul#wp-admin-bar-root-default.ab-top-menu' ).append( socket_object = jQuery( '&lt;li id=\"ud_saas_object\" class=\"ud_saas_object\"&gt;[object]&lt;/li&gt;' ) );","          };","          jQuery( socket_object ).unbind( 'click' );","          jQuery( socket_object ).bind( 'click', function() {","            ud.admin.pointer( socket_object, {","              'pointerClass': 'wp-pointer ud-pointer ud-saas-debug',","              'title': data.message,","              'pointerWidth': 600,","              'content': '&lt;pre&gt;' + JSON.stringify( data.object, undefined, 2 ) + '&lt;/pre&gt;'","            });","          });","        }","","        socket_status.fadeTo( 500, 1, function() {","          window.clearTimeout( self.timers.socket_status );","          socket_status.html( data.message ? data.message : '' );","          self.timers.socket_status = window.setTimeout( function() { socket_status.fadeTo( 3000, 0.5, function() {","            window.setTimeout( function() { socket_status.fadeTo( 3000, 0.1 ); }, 5000 );","          }); }, data.fade_out ? data.fade_out : 10000 );","        });","","        return data.message;","      };","","","      /**","       * Wrapper for ko.applyBindings()","       *","       * Calls before ko.applyBindings() - self.pre_apply()","       * Calls after ko.applyBindings()  - init()","       *","       * @author peshkov@UD","       */","      self.apply = function() {","        // console.info( 'ko.view_model.vm().apply()' );","","        var self = this;","","        if ( self._is_timeout ) {","","          // console.info( 'ko.view_model.vm().apply() - Timeout.' );","          return false;","","        } else if( !self._bind ) {","","          // console.info( 'ko.view_model.vm().apply() - Halted.' );","          return self._args.callback( null, self );","","        } else if ( this._applied ) {","","          // console.info( 'ko.view_model.vm().apply() - Already applied.' );","          return self._args.callback( null, self );","","        } else if ( !self._loaded ) {","","          // console.info( 'ko.view_model.vm().apply() - Model was not loaded' );","          var error = typeof ko.strings.ko_model_failed ? ko.strings.ko_model_failed : 'Knockout Model was not loaded.';","          return self._args.callback( new Error ( error ), self );","","        } else {","","          try {","","            /* Special Handlers can be added here */","            try{ self._args.actions.pre_apply( self ) } catch(e) { self._args.callback( e, self ); }","","            ko.applyBindings( self, self.container.get(0) );","","            self._applied = true;","","            self.container.removeClass( 'ud_ui_loading' ).addClass( 'ud_ui_applied' );","","            /** Prevent Load Timeout Event */","            clearTimeout( self.timers.load_timeout );","","            // console.info( 'ko.view_model.vm().apply() - Applied.' );","","            /* Special Handlers can be added here */","            try{ self._args.actions.init( self ); } catch(e) { console.log( e ); self._args.callback( e, self ); }","","            return self._args.callback( null, self );","","          } catch( error ) {","","            return self._args.callback( error, self );","","          }","","        }","","      }","","","      /**","       * Recursively parses model data and prepares it for MVVM view_model.","       * Internal function which called automatically on view_model initialization.","       * Should not be used manually!","       *","       * @author peshkov@UD","       */","      self._prepare_model_data = function( r, d ) {","        // console.info( '_prepare_model_data', arguments );","","        var self = this;","        var data = {};","","        r = typeof r !== 'object' ? {} : r;","        d = typeof d !== 'object' ? self : d;","","        for( var i in r ) {","","          switch ( i ) {","","            case '_static':","              // console.info( '_static', r[i] );","","              for( var e in r[i] ) {","                /* Handler for incoming data. You need to add handler to 'model' argument */","                if( d &amp;&amp; typeof d[e] === 'function' ) {","                  data[e] = d[e]( r[i][e] );","                } else {","                  data[e] = r[i][e];","                }","              }","            break;","","            case '_observable':","              // console.info( '_observable', r[i] );","","              for( var e in r[i] ) {","                /* Handler for incoming data. You need to add handler to 'model' argument */","                if( d &amp;&amp; typeof d[e] === 'function' ) {","                  data[e] = d[e]( r[i][e] );","                } else {","                  if( !r[i][e] || typeof r[i][e].length === 'undefined' ) {","                    data[e] = ko.observable( r[i][e] );","                  } else {","                    if( typeof r[i][e] === 'object' ) {","","                      data[e] = ko.observableArray( r[i][e] );","","                    } else {","","                      data[e] = ko.observable( r[i][e] );","","                    }","                  }","                }","              }","            break;","","            /**","             * Contains additional interfaces added by hooks","             *","             * It's used instead of do_action.","             * You should add all additional data to the current interface by apply_filter,","             * which has to be called in model.","             *","             * To add 'some_action' hook to interface you should do the following steps:","             * View:","             * &lt;div data-action_hook=\"some_action\"&gt;&lt;/div&gt;","             * Model:","             * r._action = { some_hook: [ '&lt;div&gt;HEllo&lt;/div&gt;', '&lt;span&gt;WoRlD!&lt;/span&gt;' ], some_other_hook: [ '' ], ... }","             * Result:","             * &lt;div data-action_hook=\"some_action\"&gt;&lt;div&gt;HEllo&lt;/div&gt;&lt;span&gt;WoRlD!&lt;/span&gt;&lt;/div&gt;","             *","             * @author peshkov@UD","             */","            case '_action':","              self._actions = jQuery.extend( true, self._actions, r[i] );","              break;","","            /**","             * SAAS interface","             * Used by SaaS. All data for SaaS emit should be added here.","             *","             * @author peshkov@UD","             */","            case '_saas':","              if ( typeof self.saas.path == 'string' ) {","                data[ self.saas.path ] = {};","                for( var e in r[i] ) {","                  switch( e ) {","                    case 'conditionals':","                      data[ self.saas.path ] = jQuery.extend( true, {}, data[ self.saas.path ], r[i][e] );","                      break;","                    case 'interface':","                    default:","                      data[ self.saas.path ] = jQuery.extend( true, {}, r[i][e], data[ self.saas.path ] );","                      break;","                  }","                }","                /* Convert values screwed up by PHP/MySQL/whatever */","                if( typeof ud.utils === 'object' &amp;&amp; typeof ud.utils.type_fix === 'function' ) {","                  data[ self.saas.path ] = ud.utils.type_fix( data[ self.saas.path ], { 'nullify': true } );","                }","                /* Interface Handler. */","                if( d &amp;&amp; typeof d[ self.saas.path ] === 'function' ) {","                  data[ self.saas.path ] = d[ self.saas.path ]( data[ self.saas.path ] );","                }","              }","              break;","","            /**","             * Any other data.","             * Check it recursively.","             */","            default:","              /* Handler for incoming data. You need to add handler to 'model' argument */","              if( d &amp;&amp; typeof d[i] === 'function' ) {","                data[i] = d[i]( r[i] );","              } else {","                /**","                 * Determine if we need to check data recursively or just set value.","                 */","                if( typeof r[i] === 'object' &amp;&amp; typeof r[i].length === 'undefined' ) {","                  data[i] = self._prepare_model_data( r[i], ( typeof d[i] === 'object' ? d[i] : false ) );","                } else {","                  data[i] = r[i];","                }","              }","              break;","          }","        }","","        return data;","      }","","      /* Init callback on timeout */","      self.timers.load_timeout = setTimeout( function() { args.actions.timeout( self ) }, args.timeout );","","      /* All additional methods and elements for the current model can be added here */","      self = jQuery.extend( true, self, ( typeof self._args.instance === 'object' ? self._args.instance : {} ) );","","","      /**","       * Determine if we already have model or we need to get it from server.","       */","      if( typeof self._args.model === 'string' ) {","        self._args.model_name = self._args.model;","","        /** Get model data from server */","        jQuery.ajax( {","          url: ko.ajaxurl( 'get_model' ),","          data: {","            'args': jQuery.extend( true, {}, { 'model': self._args.model_name }, self._args.args )","          },","          dataType: 'json',","          type: 'POST',","          async: false,","          beforeSend: function ( xhr ) {","            try{ self._args.actions.get_model( self ) } catch(e) { self._args.callback( e, self ); }","            xhr.overrideMimeType( 'application/json; charset=utf-8' );","          },","          complete: function( jqXHR ) {","            var r = {};","            try {","              r = jQuery.parseJSON( jqXHR.responseText );","              if( typeof r !== 'object' || jqXHR.responseText === '' ) {","                throw new Error( 'Ajax response is empty' );","              } else if( jqXHR.status === 500 ) {","                throw new Error( 'Internal Server Error' );","              } else if ( jqXHR.statusText === 'timeout' ) {","                throw new Error( 'Server Timeout' );","              } else if ( typeof r.success == true ) {","                throw new Error( 'Could not get \\'' + self._args.model + '\\' model' );","              }","            } catch( error ) {","              ko.log( 'AJAX Error: ' + ( error.message ? error.message : 'Unknown.' ) );","              self._args.model = r = false;","            }","            if( r ) {","              self._args.model = r.model;","              self._args.model._name = self._args.model_name;","            }","          },","          error: function( jqXHR, textStatus, errorThrown ) {}","        } );","      } else {","        if( typeof self._args.model._name === 'undefined' ) {","          self._args.model._name = '';","        }","      }","","","      /** Determine if global model is _loaded. If not, we stop process. */","      if( !self._args.model ) {","        return;","      } else {","        self._loaded = true;","      }","","      /* Prepare data for MVVM view_model by parsing model's object */","      var prepared_data = self._prepare_model_data( self._args.model );","","      /* Merge model Localization data with global Localization strings */","      prepared_data.strings = jQuery.extend( true, ko.strings, ( typeof prepared_data.strings != 'undefined' ) ? prepared_data.strings : {} );","","      /* Merge default and prepared data */","      self = jQuery.extend( true, self, prepared_data );","","      /**","       * Go through all hooks and add interfaces if exist.","       * See: case _action in self._prepare_model_data()","       */","      for( var i in self._actions ) {","        if( jQuery( '[data-action_hook=\"'+i+'\"]', container ).length &gt; 0 ) {","          for ( var a in self._actions[i] ) {","            if( typeof self._actions[i][a] === 'string' ) {","              jQuery( '[data-action_hook=\"'+i+'\"]', container ).append( self._actions[i][a] );","            } else {","              // Ignore it for now.","            }","          }","        }","      }","","","      /** SAAS LOGIC STARTS HERE NOW */","","","      /**","       * Ran after SaaS has trigger Screen Set Event, meaning it is ready","       *","       * @author potanin@UD","       */","      self.saas._set_screen = function( e, args ) {","        ko.log( 'ko.view_model.vm()._saas_screen_set()', arguments );","","        /**","         * If ignore is true we stop SaaS initialization.","         * It happens, if timeout is called and Saas is still not established.","         */","        if( self.saas.ignore ) { return; }","","        self.saas.connected = true;","","        /**","         * Determine if view_model has saas data before add listeners","         */","        if( typeof self[ self.saas.path ] === 'object' ) {","          /* Set _active flag to true. So it says that saas is ready */","          self.saas._active( true );","          /* Set update trigger as we already know session ID */","          self.saas.update_trigger = self.saas.id + '::update::' + self.saas.screen;","","          /**","           * Wait for Interface Request","           */","          self.saas.scope.on( self.saas.id + '::request::_interface', function() {","            ko.log( 'ko.view_model.vm()._saas_screen_set(); Interface request received, responding.' );","            self.saas._merging( true );","            self.saas.scope.emit( self.saas.id + '::update::' + self.saas.screen, {","              'key': self.saas.path,","              'value': ko.toJS( self[ self.saas.path ] )","            } );","            self.saas._merging( false );","          });","","          /**","           * Monitor Update Triggers, and set values","           */","          self.saas.scope.on( self.saas.update_trigger, function( data ) {","            // console.info( '_prepare_interface() -&gt; ' + self.saas.update_trigger + ' (' + update.path + '.' + update.key + ')', arguments );","","            var data = jQuery.extend( {","              'path': false,","              'key': false,","              'value': false,","              'update': true,","              'message': false","            }, data );","","            var full_path = ( data.path &amp;&amp; data.key ? ( data.path + '.' + data.key ) : false );","","            /* Disable subscribe event */","            self.saas._merging( true );","","            /* Update value */","            if( data.update &amp;&amp; full_path !== false ) {","              try {","                self.saas._observable_caller[ full_path ][ 'value' ]( data.value );","              } catch (e) { self._args.callback( new Error( 'Interface Path Not Found' ), self ); }","            }","","            /* Updates navbar notice if message exists */","            if( typeof data.message === 'string' &amp;&amp; data.message.length &gt; 0 &amp;&amp; self.saas.show_updates ) {","              self.navbar_notice( data.message );","            }","","            /* Special Handlers can be added here */","            try{ self._args.actions.saas_update_on( self, data ) } catch(e) { self._args.callback( e, self ); }","","            /* Enable subscribe event */","            self.saas._merging( false );","          });","","          jQuery( document ).bind( self.saas.id + '::disconnected', function( event, data ) { self.saas._active( false ); });","","          self[ self.saas.path ] = self.saas._set_emit( self[ self.saas.path ] );","        }","","        /** Call SaaS callback if needed when data is set and prepared */","        try{ self._args.actions.saas_set_screen( self ) } catch(e) { self._args.callback( e, self ); }","","        /* Set bind val passed to view_model */","        self._bind = self._args.bind;","","        /* Now, when SaaS is ready we try to call apply again */","        self.apply();","      };","","","      /**","       * Observable data, pares and add Subscribers to all observable items that emit updates","       *","       * @param data","       * @param path","       * @author potanin@UD","       */","      self.saas._set_emit = function( data, path ) {","        // console.info( '_prepare_interface()', arguments );","","        /* Add emit on subscribe event */","        var subscribe = function( object, key, path ) {","          self.saas._observable_caller[ path + '.' + key ] = { 'path': path, 'key': key, 'value' : object };","          object.subscribe( function( value ) {","            if( !self.saas._merging() ) {","              try{","                var data = { 'key': key, 'value': value, 'path': path };","                /* Special Handlers can be added here */","                self._args.actions.saas_update_emit( self, data );","                self.saas.scope.emit( self.saas.update_trigger, data );","              } catch(e) { self._args.callback( e, self ); }","            }","          }, self );","        };","","        /* Recursively check data and set subscribe events */","        var subscribe_deep = function( object, path ) {","          for( var key in object ) {","            /* Ignore extra data */","            if ( key === '__ko_mapping__' ) {","              continue;","            /* Determine if element is observable */","            } else if ( ko.isObservable( object[key] ) ) {","              subscribe( object[key], key, path );","            /* Recursively check and subscribe object's data */","            } else if ( typeof object[key] === 'object' ) {","              subscribe_deep( object[key], path + '.' + key );","            }","          }","        }","","        data = ko.mapping.fromJS( data );","","        subscribe_deep( data, typeof path === 'string' ? path : self.saas.path );","","        return data;","      };","","      /* Determine if still have saas data as function and fix it */","      if( typeof self[ self.saas.path ] === 'function' ) {","        self[ self.saas.path ] = self[ self.saas.path ]( {} );","      }","","      /**","       * Now we try to connect to SaaS ( if saas.model is set )","       * If SaaS Screen is specified, we wait for screen to be ready, and then load Interface, if needed","       */","      if( typeof self.saas.model === 'string' ) {","        // console.info( 'ko.view_model() - Binding SaaS MVVM Handlers' );","","        /** Return Error if SaaS scope object is incorrect some reason */","        if ( typeof self.saas.scope.connect !== 'function' ) {","          self._bind = false;","          return self._args.callback( new Error( typeof ko.strings.saas_connection_fail !== 'undefined' ? ko.strings.saas_connection_fail :  'Application could not connect to SaaS.' ), self );","        }","","        /* Enable/Disable Navbar SaaS Status and console Updates */","        self.saas.scope.show_updates = self.saas.show_updates;","        if( typeof self.saas.scope.settings.log !== 'undefined' ) {","          if( self.saas.debug_mode ) jQuery.extend( self.saas.scope.settings.log, { 'events': true, 'all_data': true } );","          else jQuery.extend( self.saas.scope.settings.log, { 'events': false, 'all_data': false } );","        }","","        /* Update|Fix SaaS instance */","        self.saas.scope.instance = jQuery.extend( {","          'api_key' : false,","          'site_uid' : false,","          'customer_key' : false,","          'customer_name' : false,","          'site_url' : false,","          'home' : false,","          'ajax' : false,","          'ip' : false,","          'site' : false,","          'screen' : false","        }, self.saas.scope.instance, typeof self.saas.instance === 'object' ? self.saas.instance : {} );","","        /* Set additional specific SaaS data */","        jQuery.extend( self.saas, {","          // Socket Session ID","          'id' : false,","          // Name of event which called on self[ self.saas.path ] element subscribe","          'update_trigger': false,","          // Used as a flag to disable subscribe while updating","          '_merging' : ko.observable( false ),","          // Screen not set until SaaS says it is set","          '_active' : ko.observable( null ),","          // The list of interface elements which should do saas.emit on subscribe","          '_observable_caller' : {},","          // Check if we connected to SaaS","          'connected' : false,","          //","          'ignore' : false","        } );","","        if( typeof self.saas.screen === 'string' ) {","","          /* We should do SaaS connection before bindings will be applied. */","          self._bind = false;","","          /* Call self._saas_screen_set when socket is connected. */","          if( self.saas.scope.id &amp;&amp; !self.saas.force_new_connection ) {","            /* Looks like connection is already established, so just add bind */","            self.saas.id = self.saas.scope.id;","            jQuery( document ).one( self.saas.scope.id + '::update::screen_set::' + self.saas.screen, self.saas._set_screen );","          } else {","            /* Connection is not established yet ( or we force new connection ),","             * so we add event to ud::saas::connect, because we need to know connection ID. */","            jQuery( document ).one( 'ud::saas::connect', function( event, socket ) {","              self.saas.id = socket.id;","              /* */","              jQuery( document ).one( socket.id + '::update::screen_set::' + self.saas.screen, self.saas._set_screen );","              /* */","              try{ self._args.actions.saas_connect( self ) } catch(e) { self._args.callback( e, self ); }","              /* Prints all updates in navbar */","              jQuery( document ).bind( socket.id + '::update', function( event, data ) {","                if( self.saas.show_updates ) { self.navbar_notice( data ); }","              });","              /* Prints 'SaaS Online' on SaaS ready */","              jQuery( document ).one( socket.id + '::init', function( event, socket ) {","                if( self.saas.show_updates ) {","                  self.navbar_notice({ 'message': ko.strings.connection_established ? ko.strings.connection_established : 'SaaS Online.' });","                }","              });","              /* Call saas_disconnect action and print 'SaaS Offline' on connection lost */","              jQuery( document ).one( socket.id + '::disconnected', function( event, socket ) {","                if( self.saas.show_updates ) {","                  self.navbar_notice({ 'message': ko.strings.connection_lost ? ko.strings.connection_lost : 'SaaS Offline.' });","                }","                /* Do additional actions ( callback ) on disconnect */","                try{ self._args.actions.saas_disconnect( self ) } catch(e) { self._args.callback( e, self ); }","              });","            });","          }","","          /* Switch active screen ( SaaS instance screen ) */","          self.saas.scope.instance.screen = self.saas.screen;","","        }","","        /* Do connection to socket */","        self.saas.scope.connect( self.saas.model, { 'force new connection': self.saas.force_new_connection, 'secure': self.saas.secure } );","","      } else {","","        /* We should set saas variable to observable in any case. */","        if( typeof self[ self.saas.path ] === 'object' ) {","          self[ self.saas.path ] = ko.mapping.fromJS( self[ self.saas.path ] );","        }","","      }","","    }","","    /* Bind Knockout */","    vm = new vm( args, container );","","    ko.log( vm );","","    return vm.apply();","","  }","","} else {  ko = { view_model: function() { return false; } } }"];
  