! function(t) { function e(r) { if (i[r]) return i[r].exports; var s = i[r] = { exports: {}, id: r, loaded: !1 }; return t[r].call(s.exports, s, s.exports, e), s.loaded = !0, s.exports } var i = {}; return e.m = t, e.c = i, e.p = "", e(0) }([function(t, e, i) { "use strict"; function r(t) { return t && t.__esModule ? t : { "default": t } } var s = i(1), n = r(s); gapi.analytics.ready(function() { function t(t, e, i) { t.innerHTML = e.map(function(t) { var e = t.id == i ? "selected " : " "; return "" }).join("") } function e(t) { return t.ids || t.viewId ? { prop: "viewId", value: t.viewId || t.ids && t.ids.replace(/^ga:/, "") } : t.propertyId ? { prop: "propertyId", value: t.propertyId } : t.accountId ? { prop: "accountId", value: t.accountId } : void 0 } gapi.analytics.createComponent("ViewSelector2", { execute: function() { return this.setup_(function() { this.updateAccounts_(), this.changed_ && (this.render_(), this.onChange_()) }.bind(this)), this }, set: function(t) { if (!!t.ids + !!t.viewId + !!t.propertyId + !!t.accountId > 1) throw new Error('You cannot specify more than one of the following options: "ids", "viewId", "accountId", "propertyId"'); if (t.container && this.container) throw new Error("You cannot change containers once a view selector has been rendered on the page."); var e = this.get(); return (e.ids != t.ids || e.viewId != t.viewId || e.propertyId != t.propertyId || e.accountId != t.accountId) && (e.ids = null, e.viewId = null, e.propertyId = null, e.accountId = null), gapi.analytics.Component.prototype.set.call(this, t) }, setup_: function(t) { function e() { n["default"].get().then(function(e) { i.summaries = e, i.accounts = i.summaries.all(), t() }, function(t) { i.emit("error", t) }) } var i = this; gapi.analytics.auth.isAuthorized() ? e() : gapi.analytics.auth.on("success", e) }, updateAccounts_: function() { var t, i, r, s = this.get(), n = e(s); if (n) switch (n.prop) { case "viewId": t = this.summaries.getProfile(n.value), i = this.summaries.getAccountByProfileId(n.value), r = this.summaries.getWebPropertyByProfileId(n.value); break; case "propertyId": r = this.summaries.getWebProperty(n.value), i = this.summaries.getAccountByWebPropertyId(n.value), t = r && r.views && r.views[0]; break; case "accountId": i = this.summaries.getAccount(n.value), r = i && i.properties && i.properties[0], t = r && r.views && r.views[0] } else i = this.accounts[0], r = i && i.properties && i.properties[0], t = r && r.views && r.views[0]; i || r || t ? (i != this.account || r != this.property || t != this.view) && (this.changed_ = { account: i && i != this.account, property: r && r != this.property, view: t && t != this.view }, this.account = i, this.properties = i.properties, this.property = r, this.views = r && r.views, this.view = t, this.ids = t && "ga:" + t.id) : this.emit("error", new Error("You do not have access to " + n.prop.slice(0, -2) + " : " + n.value)) }, render_: function() { var e = this.get(); this.container = "string" == typeof e.container ? document.getElementById(e.container) : e.container, this.container.innerHTML = e.template || this.template; var i = this.container.querySelectorAll("select"), r = this.accounts, s = this.properties || [{ name: "(Empty)", id: "" }], n = this.views || [{ name: "(Empty)", id: "" }]; t(i[0], r, this.account.id), t(i[1], s, this.property && this.property.id), t(i[2], n, this.view && this.view.id), i[0].onchange = this.onUserSelect_.bind(this, i[0], "accountId"), i[1].onchange = this.onUserSelect_.bind(this, i[1], "propertyId"), i[2].onchange = this.onUserSelect_.bind(this, i[2], "viewId") }, onChange_: function() { var t = { account: this.account, property: this.property, view: this.view, ids: this.view && "ga:" + this.view.id }; this.changed_ && (this.changed_.account && this.emit("accountChange", t), this.changed_.property && this.emit("propertyChange", t), this.changed_.view && (this.emit("viewChange", t), this.emit("idsChange", t), this.emit("change", t.ids))), this.changed_ = null }, onUserSelect_: function(t, e) { var i = {}; i[e] = t.value, this.set(i), this.execute() }, template: '