Skip to content

Instantly share code, notes, and snippets.

@JBou
Created January 20, 2017 09:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JBou/9ed3ee830e04387811bc48fbcadc04fd to your computer and use it in GitHub Desktop.
Save JBou/9ed3ee830e04387811bc48fbcadc04fd to your computer and use it in GitHub Desktop.
Soundcloud app
This file has been truncated, but you can view the full file.
webpackJsonp([2], {
0: function(e, t, n) {
n(1220), e.exports = n(1187)
},
6: function(e, t) {
e.exports = function() {
var e = [];
return e.toString = function() {
for (var e = [], t = 0; t < this.length; t++) {
var n = this[t];
n[2] ? e.push("@media " + n[2] + "{" + n[1] + "}") : e.push(n[1])
}
return e.join("")
}, e
}
},
7: function(e, t, n) {
function i(e, t) {
for (var n = 0; n < e.length; n++) {
var i = e[n],
r = c[i.id];
if (r) {
r.refs++;
for (var o = 0; o < r.parts.length; o++) r.parts[o](i.parts[o]);
for (; o < i.parts.length; o++) r.parts.push(s(i.parts[o], t))
} else {
for (var a = [], o = 0; o < i.parts.length; o++) a.push(s(i.parts[o], t));
c[i.id] = {
id: i.id,
refs: 1,
parts: a
}
}
}
}
function r(e) {
for (var t = [], n = {}, i = 0; i < e.length; i++) {
var r = e[i],
o = r[0],
s = r[1],
a = r[2],
l = r[3],
u = {
css: s,
media: a,
sourceMap: l
};
n[o] ? n[o].parts.push(u) : t.push(n[o] = {
id: o,
parts: [u]
})
}
return t
}
function o() {
var e = document.createElement("style"),
t = p();
return e.type = "text/css", t.appendChild(e), e
}
function s(e, t) {
var n, i, r;
if (t.singleton) {
var s = g++;
n = f || (f = o()), i = l.bind(null, n, s, !1), r = l.bind(null, n, s, !0)
} else n = o(), i = u.bind(null, n), r = function() {
n.parentNode.removeChild(n)
};
return i(e),
function(t) {
if (t) {
if (t.css === e.css && t.media === e.media && t.sourceMap === e.sourceMap) return;
i(e = t)
} else r()
}
}
function a(e, t, n) {
var i = ["/** >>" + t + " **/", "/** " + t + "<< **/"],
r = e.lastIndexOf(i[0]),
o = n ? i[0] + n + i[1] : "";
if (e.lastIndexOf(i[0]) >= 0) {
var s = e.lastIndexOf(i[1]) + i[1].length;
return e.slice(0, r) + o + e.slice(s)
}
return e + o
}
function l(e, t, n, i) {
var r = n ? "" : i.css;
if (e.styleSheet) e.styleSheet.cssText = a(e.styleSheet.cssText, t, r);
else {
var o = document.createTextNode(r),
s = e.childNodes;
s[t] && e.removeChild(s[t]), s.length ? e.insertBefore(o, s[t]) : e.appendChild(o)
}
}
function u(e, t) {
var n = t.css,
i = t.media,
r = t.sourceMap;
if (r && "function" == typeof btoa) try {
n += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(JSON.stringify(r)) + " */", n = '@import url("data:stylesheet/css;base64,' + btoa(n) + '")'
} catch (o) {}
if (i && e.setAttribute("media", i), e.styleSheet) e.styleSheet.cssText = n;
else {
for (; e.firstChild;) e.removeChild(e.firstChild);
e.appendChild(document.createTextNode(n))
}
}
var c = {},
d = function(e) {
var t;
return function() {
return "undefined" == typeof t && (t = e.apply(this, arguments)), t
}
},
h = d(function() {
return /msie 9\b/.test(window.navigator.userAgent.toLowerCase())
}),
p = d(function() {
return document.head || document.getElementsByTagName("head")[0]
}),
f = null,
g = 0;
e.exports = function(e, t) {
t = t || {}, "undefined" == typeof t.singleton && (t.singleton = h());
var n = r(e);
return i(n, t),
function(e) {
for (var o = [], s = 0; s < n.length; s++) {
var a = n[s],
l = c[a.id];
l.refs--, o.push(l)
}
if (e) {
var u = r(e);
i(u, t)
}
for (var s = 0; s < o.length; s++) {
var l = o[s];
if (0 === l.refs) {
for (var d = 0; d < l.parts.length; d++) l.parts[d]();
delete c[l.id]
}
}
}
}
},
45: function(e, t, n) {
e.exports = n.p + "assets/images/statistics/jumpmonth-a98e52.png"
},
48: function(e, t, n) {
"use strict";
function i(e) {
return e && e.__esModule ? e : {
"default": e
}
}
function r(e) {
s["default"](e)
}
t.__esModule = !0, t.registerDefaultDecorators = r;
var o = n(2782),
s = i(o)
},
49: function(e, t, n) {
"use strict";
function i(e) {
return e && e.__esModule ? e : {
"default": e
}
}
function r(e) {
s["default"](e), l["default"](e), c["default"](e), h["default"](e), f["default"](e), m["default"](e), _["default"](e)
}
t.__esModule = !0, t.registerDefaultHelpers = r;
var o = n(2783),
s = i(o),
a = n(2784),
l = i(a),
u = n(2785),
c = i(u),
d = n(2786),
h = i(d),
p = n(2787),
f = i(p),
g = n(2788),
m = i(g),
v = n(2789),
_ = i(v)
},
50: function(e, t, n) {
"use strict";
t.__esModule = !0;
var i = n(4),
r = {
methodMap: ["debug", "info", "warn", "error"],
level: "info",
lookupLevel: function(e) {
if ("string" == typeof e) {
var t = i.indexOf(r.methodMap, e.toLowerCase());
e = t >= 0 ? t : parseInt(e, 10)
}
return e
},
log: function(e) {
if (e = r.lookupLevel(e), "undefined" != typeof console && r.lookupLevel(r.level) <= e) {
var t = r.methodMap[e];
console[t] || (t = "log");
for (var n = arguments.length, i = Array(n > 1 ? n - 1 : 0), o = 1; n > o; o++) i[o - 1] = arguments[o];
console[t].apply(console, i)
}
}
};
t["default"] = r, e.exports = t["default"]
},
51: function(e, t, n) {
function i(e, t) {
return o.t(e, t.hash, {
comment: t.hash._comment,
context: t.hash._context
})
}
function r(e) {
return o.t(s.cleanBlockText(e.fn()), e.hash, {
comment: e.hash._comment,
context: e.hash._context
})
}
var o = n(52),
s = n(933);
e.exports = function() {
var e = arguments.length;
if (2 === e) return i.apply(this, arguments);
if (1 === e) return r.apply(this, arguments);
throw new Error("Invalid signature to t helper, expected 1 or 2 arguments, got " + e)
}
},
53: function(e, t, n) {
var i = n(20),
r = n(539);
e.exports = function() {
return new i.SafeString(r.handlebarHelper.apply(this, arguments))
}
},
55: function(e, t, n) {
"use strict";
var i = e.exports = new(n(259));
n(958).applyTo(i), n(3).each({
app_id: 1e3 * String(Date.now()).substr(-8) + Math.floor(1e3 * Math.random()),
app_version: null,
public_api_host: "https://api.soundcloud.com/",
api_v2_host: "https://api-v2.soundcloud.com/",
client_application_id: 46941,
client_id: "fDoItMDbsbZz8dY16ZzARCZmzgHBPotA",
eventlogger_tracking_url: "https://l9bjkkhaycw6f8f4.soundcloud.com",
experiments: null,
geoip: null,
fb_app_id: "19507961798",
google_client_id: "984739005367.apps.googleusercontent.com",
recaptcha_public_key: "6LeABsUSAAAAABLOEF92U0unfhlGLynYlhvJRFue",
adyen_url: "https://test.adyen.com/hpp/cse/js/7814235253800464.shtml",
playHistoryLength: 50,
maxComments: 200,
me: null,
mixi_api_key: "1403ed11563185e9cff6cfeedf4f2ecf77fa459e",
notifications: null,
notificationsUri: "wss://pushers.soundcloud.com/",
oauth_token: null,
preferFlashAudio: !0,
promotedContentServer: "https://promoted.soundcloud.com/promo",
promotedContentAccessToken: "web",
restoreToSound: null,
rollouts: null,
router: null,
songkick_api_key: "ZWsLr2h7FF5sHG54",
facebook_api_key: "a7309b9a9a85963579f7e8bcffd36d2a",
versionUpdateInterval: 36e5,
visualsQueueHost: "https://visuals-queue.soundcloud.com/visuals",
wisHost: "https://wis.sndcdn.com",
systemUserId: 193
}, function(e, t) {
i.set(t, e, {
silent: !0
})
}), i.finalize()
},
57: function(e, t, n) {
"use strict";
var i, r, o = new(n(104))("broadcast"),
s = n(55).get("app_id");
o.on("broadcast", function(e) {
var t = e.current;
t && t.appId !== s && r.call(a, t)
});
var a = e.exports = n(3).assign({}, n(22).Events, {
broadcast: function(e, t) {
var n, s;
return "string" == typeof e ? (n = [].slice.call(arguments, 1), t = e, e = {}) : n = [].slice.call(arguments, 2), s = i(t, n), o.set("broadcast", s), e.excludeThis || r.call(this, s), this
}
});
i = function(e, t) {
return {
type: e,
timestamp: Date.now(),
appId: s,
args: t
}
}, r = function(e) {
this.trigger.apply(this, ["broadcast:" + e.type].concat(e.args || []))
}
},
58: function(e, t, n) {
var i = n(62);
e.exports = function() {
var e = Array.prototype.slice.call(arguments, 0, -1);
return i.getRoute.apply(i, e)
}
},
61: function(e, t, n) {
(function(t) {
"use strict";
function i(e, t) {
return e.get ? e.get(t) : e[t]
}
function r(e, t) {
this.has(e) && this.set(e, Math.max(0, this.get(e) + (t ? 1 : -1)))
}
function o(e, t) {
r.call(this, e.isPrivate() ? "private_tracks_count" : "track_count", t)
}
function s(e) {
n(3).each({
follow: e.onFollow,
like: e.onLikesChanged,
repost: e.onReposted,
comment: e.onComment,
destroy: e.onDeleteResource,
createPlaylist: e.onPlaylistCreate
}, function(t, i) {
e.listenTo(n(74), i + ":origin:user:" + e.id, t)
})
}
function a(e) {
r.call(this, "followers_count", e.state)
}
function l() {
return {
product: {
id: p,
name: ""
},
recurring: !1
}
}
function u() {
return {
product: {
id: g,
name: "Free"
},
recurring: !1
}
}
function c() {
var e = this.isCPPEnabled() && this.get("cpp").rightsholder_links;
if (!e || !e.length) return !0;
var t = e[0].rightsholder_urn;
return n(3).every(e, {
rightsholder_urn: t
})
}
function d() {
for (var e = arguments.length, t = Array(e), n = 0; e > n; n++) t[n] = arguments[n];
return function() {
return t.some(this.get, this)
}
}
var h = n(73).productIds,
p = h.CONSUMER_SUBSCRIPTION_FREE,
f = h.CONSUMER_SUBSCRIPTION_HIGH_TIER,
g = h.CREATOR_SUBSCRIPTION_FREE,
m = [{
emitter: n(74),
event: "follow",
getInstance: function(e, t) {
var n = t.target;
return e.id === n
},
handler: a
}];
e.exports = n(66).extend(n(954), n(955), n(956).withOptions({
types: n(1784).user
}), n(254).withOptions({
attr: "username"
}), n(253).withOptions({
read: "avatar_url",
write: "avatar_data"
}), n(522), n(199).withOptions({
events: m
}), {
resource_type: "user",
urnPrefix: "soundcloud:users",
saveFormat: "json",
saveWithWrapper: !1,
_connections: null,
setup: function() {
var e = this;
this.has("subscriptions") && !this.has("creator_subscriptions") && this.set("creator_subscriptions", this.get("subscriptions")), this.options.isMe && (this.id ? s(this) : this.once("change:id", function() {
s(e)
}))
},
baseUrl: function() {
var e = this.id;
return e ? this.getEndpointUrl("user", {
id: e
}) : "you" === this.get("permalink") ? this.getEndpointUrl("me") : void 0
},
ownerUrl: function() {
return this.getEndpointUrl("userAsOwner", {
urn: this.getUrn()
})
},
getImageSaveUrl: function() {
return this.getEndpointUrl("userImageUpdate", {
id: this.id
})
},
ownerAttributes: ["default_tracks_feedable", "cpp", "downloads_disabled", "hidden_tracks_count", "blocked_tracks_count", "default_license", "primary_email", "primary_email_confirmed", "date_of_birth", "gender"],
parse: function(e) {
var t = n(3).clone(e);
return t.primary_email_confirmed = t.primary_email_confirmed !== !1, t.subscriptions && !t.creator_subscriptions && (t.creator_subscriptions = t.subscriptions), "undefined" == typeof t.country_code && "undefined" != typeof t.country && (t.country_code = n(85).countryToCode(t.country)), t
},
onLikesChanged: function(e) {
r.call(this, "likes_count", e.state)
},
onFollow: function(e) {
r.call(this, "followings_count", e.state)
},
onReposted: function(e) {
r.call(this, "reposts_count", e.state)
},
onComment: function(e) {
e.state && r.call(this, "comments_count", !0)
},
onDeleteResource: function(e) {
var t = e.targetModel;
switch (t.resource_type) {
case "sound":
this.adjustUploadSeconds(t), this.owns("sound", t) && o.call(this, t, !1);
break;
case "comment":
this.owns("comment", t) && r.call(this, "comments_count", !1)
}
},
onPlaylistCreate: function(e) {
var t = "private" === e.object.get("sharing") ? "private_playlists_count" : "playlist_count";
this.set(t, (this.get(t) || 0) + 1)
},
owns: function(e, t) {
void 0 === t && (t = e, e = t.resource_type);
var n = this.id;
if (!n) return !1;
switch (e) {
case "comment":
case "playlist":
case "sound":
return n === i(t, "user_id");
case "user":
return n === i(t, "id");
case "sound-upload-edit":
case "playlist-upload":
case "playlist-edit":
case "profile-settings":
return !0
}
return !1
},
canDownload: function(e) {
return "sound" === e.resource_type && e.get("downloadable") && e.get("has_downloads_left") !== !1
},
getCountry: function() {
var e = this.get("country_code");
return e ? n(85).codeToCountry(e) : this.get("country")
},
getCountryCode: function() {
var e = this.get("country");
return e ? n(85).countryToCode(e) : this.get("country_code")
},
getPlan: function() {
return this.getCreatorSubscription().product.id
},
getConsumerPlan: function() {
return this.getConsumerSubscription().product.id
},
getPlanName: function() {
return this.getCreatorSubscription().product.name
},
isCPPEnabled: function() {
return !!this.get("cpp")
},
canRequestISRCGeneration: function() {
return this.getCPPOption("indie", !1) === !0 && this.hasMonetization() === !0
},
canBulkUploadAsPlaylist: function() {
return !this.isCPPEnabled() || c.call(this)
},
hasOnlyOneRightsholderLink: function() {
return c.call(this)
},
getCPPOption: function(e, t) {
var n = this.get("cpp");
return null != (n && n.config && n.config[e]) ? n.config[e] : t
},
canEditMonetization: function() {
return this.getCPPOption("can_edit_monetization", !0)
},
canEditDownloadable: function() {
return this.getCPPOption("can_edit_downloadable", !0)
},
canEditRssEnabled: function() {
return this.getCPPOption("can_edit_rss_enabled", !0)
},
hasGeoblocking: function() {
return this.isCPPEnabled() || n(55).get("rollouts").get("geo_blocking_settings")
},
hasMonetization: function() {
return this.getCPPOption("has_monetization_form")
},
hasFullScheduling: function() {
return this.isCPPEnabled() || n(55).get("rollouts").get("scheduled_publishings")
},
hasToPublicScheduling: function() {
return this.isCPPEnabled() || n(55).get("rollouts").get("scheduled_publishings_only_sunrise_to_public")
},
hasAnyScheduling: function() {
return this.hasFullScheduling() || this.hasToPublicScheduling()
},
hasMonthlyPlan: function() {
return this.getCreatorSubscription().recurring
},
hasCreatorSubHug: function() {
var e = this.get("creator_subscription");
return !(!e || !e.hug)
},
isPremium: function() {
var e = this.getPlan();
return e && e !== g
},
hasHighTier: function() {
return this.getConsumerPlan() === f
},
hasProPlanLevel: function() {
return 1 === this.getPerk("planLevel")
},
getConsumerSubscription: function() {
return this.get("consumer_subscription") || l()
},
getCreatorSubscription: function() {
var e = this.get("creator_subscription"),
t = this.get("creator_subscriptions");
return e ? e : t && t[0] ? t[0] : u()
},
getPerk: function(e) {
return n(1762).get(this.getPlan(), this.getConsumerPlan(), e)
},
getPermalink: function() {
return this.get("permalink_url").replace(/^https?:.+?\w\//, "/")
},
isMe: function() {
return this === n(55).get("me") && !!this.id
},
isSystemUser: function() {
return this.id === n(55).get("systemUserId")
},
hasConnection: function(e) {
var i = this,
r = n(56).defer(),
o = this.isMe();
return this._connections || !o ? r.resolve(o && this._connections.indexOf(e) > -1) : t.ajax({
url: this.getEndpointUrl("meConnections"),
dataType: "json"
}).done(function(t) {
i._connections = t.map(function(e) {
return e.type
}), r.resolve(i._connections.indexOf(e) > -1)
}).fail(r.resolve.bind(r, !1)), r
},
getNumTracks: function(e) {
var t = this.get("track_count") || 0,
n = this.get("private_tracks_count") || 0,
i = this.get("blocked_tracks_count") || 0,
r = this.get("hidden_tracks_count") || 0;
switch (e) {
case "public":
return t;
case "private":
return n;
case "hidden":
return r;
case "blocked":
return i;
default:
return t + n + r + i
}
},
getNumPlaylists: function(e) {
var t = this.get("playlist_count") || 0,
n = this.get("private_playlists_count") || 0;
switch (e) {
case "public":
return t;
case "private":
return n;
default:
return t + n
}
},
hasPlaylists: d("playlist_count", "private_playlists_count"),
hasLikes: d("likes_count", "public_favorites_count"),
hasFollowings: d("followings_count"),
hasPublicSounds: d("track_count", "playlist_count", "reposts_count"),
hasTracks: d("track_count", "private_tracks_count"),
hasOwnSounds: d("track_count", "private_tracks_count", "playlist_count", "private_playlists_count"),
hasSounds: d("track_count", "private_tracks_count", "playlist_count", "private_playlists_count", "reposts_count"),
adjustUploadSeconds: function(e, t) {
var n, i, r, o = e.get("duration");
o && (n = Math.round(o / 1e3) * (t ? -1 : 1), i = this.getUploadSecondsLeft() + n, r = this.getUploadSecondsUsed() - n, this.setUploadSeconds(i, r))
},
setUploadSeconds: function(e, t) {
var i = n(3).clone(this.get("quota"));
i && (i.upload_seconds_used = t, i.unlimited_upload_quota || (i.upload_seconds_left = e), this.set("quota", i))
},
getUploadSecondsLeft: function() {
var e = this.get("quota");
return e ? e.unlimited_upload_quota ? 1 / 0 : e.upload_seconds_left : void 0
},
getUploadSecondsUsed: function() {
var e = this.get("quota");
return e ? e.upload_seconds_used : 0
},
getUploadSeconds: function() {
var e = this.getUploadSecondsLeft();
return e === 1 / 0 ? e : e + this.getUploadSecondsUsed()
},
hasUnlimitedUpload: function() {
return this.getUploadSecondsLeft() === 1 / 0
},
getUploadMinutesLeft: function() {
var e = this.getUploadSecondsLeft();
return (0 > e ? Math.floor : Math.ceil)(e / 60)
},
getUploadMinutesUsed: function() {
return Math.round(this.getUploadSecondsUsed() / 60)
},
isOverQuota: function() {
return this.getUploadSecondsLeft() < 0
},
getRSSFeedUrl: function() {
return "http://feeds.soundcloud.com/users/" + this.getUrn() + "/sounds.rss"
}
}, {
normalize: function(e) {
return e.avatar_url && (e.avatar_url = e.avatar_url.replace("http:", "https:").replace(/\?.*/, "")), e
},
resolve: function(e) {
return "you" === e ? n(56).resolve(n(55).get("me")) : n(66)._resolve(this, e, function(t) {
return t.hasPermalink(e)
})
}
})
}).call(t, n(1))
},
62: function(e, t, n) {
(function(t) {
"use strict";
function i(e, i) {
var r, o;
this.currentLayout && (e !== this.currentLayout && this.currentLayout.dispose(), n(57).trigger("layout:beforeChange", this._currentLayoutInfo)), this.currentLayout = e, o = this._currentLayoutInfo = e.getChangeEventData(i), r = t("#content"), e.render(), r.children()[0] !== e.el && r.empty()[0].appendChild(e.el), n(57).trigger("layout:change", o)
}
function r(e) {
return e._navigationBlocks.filter(o).map(function(e) {
return e.callback
}).filter(n(3).identity).reduce(function(e, t) {
return t(e) !== !1 && e
}, !0)
}
function o(e) {
return !e.condition || e.condition()
}
function s() {
return n(98).pushState ? window.location.href : "https://" + window.location.hostname + "/" + window.location.hash.replace(/^[#\/]/, "")
}
function a(e, t) {
("popstate" !== t.type || r(e)) && n(22).History.prototype.checkUrl.call(this, t)
}
var l, u, c, d = 300,
h = e.exports = n(22).Router.extend({
currentLayout: null,
_currentLayoutInfo: null,
_navigationBlocks: null,
_navCount: 0,
initialize: function() {
this._navigationBlocks = [], n(3).bindAll(this, "onBeforeUnload", "detachCurrentLayout"), n(22).history.checkUrl = a.bind(n(22).history, this)
},
setRoutes: function(e, t) {
var n = this;
l = e, u = t, c = l.slice(0).reverse(), e.forEach(function(e) {
var t = e.route,
i = e.name,
r = e.handler;
n.route(t, i, r)
})
},
setLoader: function(e) {
this.loader = e
},
reload: function() {
this.match(window.location.href.replace(/^https?:\/\/[^\/]+\//, ""))
},
addNavigationBlock: function(e, i, r) {
var o, s = n(3).uniqueId();
return o = this._navigationBlocks.unshift({
id: s,
exitSiteMessage: e,
callback: i,
condition: r
}), 1 === o && t(window).on("beforeunload", this.onBeforeUnload), s
},
removeNavigationBlock: function(e) {
var n, i = this._navigationBlocks;
for (n = i.length; n--;)
if (i[n].id === e) {
i.splice(n, 1);
break
}
i.length || t(window).off("beforeunload", this.onBeforeUnload)
},
isNavigationBlocked: function() {
return this._navigationBlocks.some(o)
},
onBeforeUnload: function() {
var e = n(3).find(this._navigationBlocks, o);
return e && e.exitSiteMessage
},
navigateToRoute: function(e, t, n) {
var i, r = [e];
t && t.length && (r = r.concat(t)), i = h.getRoute.apply(h, r), this.navigate(i, n)
},
navigate: function(e, t) {
r(this) && (t && t.hard ? window.location.href = e : n(22).Router.prototype.navigate.call(this, e, t))
},
match: function(e) {
return n(22).history.loadUrl(e)
},
getUrlInfo: function(e) {
var t, i, r, o = n(63).parse(e);
return o.path ? (t = o.path.substring(1), r = n(3).find(c, function(e) {
return e.route.test(t)
}), r && (i = {
name: r.name,
params: this._extractParameters(r.route, t)
}), i) : void 0
},
getLocation: function() {
return s()
},
apply: function(e, t) {
var r, o, s = this,
a = "layouts/" + e;
t = t || {}, ++this._navCount, this.setupDeferred && this.setupDeferred.reject(), this.setupDeferred = o = n(56).defer(), r = window.setTimeout(this.detachCurrentLayout, d), this.loader.loadLayout(a).always(window.clearTimeout.bind(window, r)).done(function(n) {
if ("rejected" !== o.state()) {
var r = s.currentLayout instanceof n ? s.currentLayout : new n;
r.setArgs(t), s.setupDeferred = r.setup(t).done(i.bind(s, r, e, t))
}
})
},
notImplemented: function(e) {
var t = s();
e && (t = e(t)), window.open(t), window.history.go(-1)
},
isLoggedIn: function() {
return n(64).isLoggedIn()
},
getRolloutValue: function(e) {
return n(55).get("rollouts").get(e)
},
getExperimentValue: function(e, t) {
return n(55).get("experiments").get(e, t)
},
getCurrentUserPermalink: function() {
return n(55).get("me").get("permalink")
},
getQueryParams: function(e) {
return n(63).getQueryParams(e)
},
getQueryString: function(e) {
return n(63).getQueryString(e)
},
getLayoutInfo: function() {
return this._currentLayoutInfo
},
getRouteInfo: function(e) {
return n(3).find(l, function(t) {
return t.name === e
})
},
getNavCount: function() {
return this._navCount
},
unauthenticated: function() {
n(59).trackAuthEvent(n(105).initiate, {
target: "implicit:navigate"
});
var e = n(63).parse(window.location.href).relative;
this.navigateToRoute("signin", e, {
replace: !0,
trigger: !0
})
},
detachCurrentLayout: function() {
this.currentLayout && this.currentLayout.$el.detach()
}
}, {
getRoute: function(e) {
var t = u[e];
if (t) {
for (var n = arguments.length, i = Array(n > 1 ? n - 1 : 0), r = 1; n > r; r++) i[r - 1] = arguments[r];
return t.apply(this, i)
}
},
includeSecretTokenForSound: function(e) {
var t = n(55).get("me");
return !(!e.secret_token || t.owns("sound", e))
},
includeSecretTokenForPlaylist: function(e) {
var t = n(55).get("me");
return !(!e.secret_token || t.owns("playlist", e))
},
removeFragmentParams: function() {
if (n(98).pushState) {
for (var e = window.location.href, t = e, i = arguments.length, r = Array(i), o = 0; i > o; o++) r[o] = arguments[o];
t = r.length ? r.reduce(function(e, t) {
return n(63).removeFragmentParam(t, e)
}, e) : n(63).modify(e, {
fragment: null
}), t !== e && window.history.replaceState(null, null, t)
}
}
})
}).call(t, n(1))
},
65: function(e, t, n) {
"use strict";
function i() {
this._visuals || (this._visuals = new(n(897))(null, {
resource_id: this.id
})), this._visuals.reset(this.get("visuals"), {
parse: !0
}), this._visuals.lastFetchTime = Date.now()
}
function r() {
var e = !this.isBlocked() && this._streamsExist;
e !== this._playable && (this._playable = e, this.trigger("change:playable", e))
}
function o(e) {
return e && (e.currentMetadata = n(68).getCurrentMetadata()), e
}
var s = n(3).constant(1),
a = function() {
return this
},
l = n(3).constant(void 0),
u = .25,
c = "BLOCK",
d = "SNIP",
h = "MONETIZE",
p = "ALLOW",
f = function(e, t) {
var n = t.target,
i = t.targetType;
return e.id === n && "sound" === i
},
g = [{
emitter: n(74),
event: "like",
getInstance: f,
handler: function(e) {
this.onLike(e)
}
}, {
emitter: n(74),
event: "repost",
getInstance: f,
handler: function(e) {
this.onRepost(e)
}
}, {
emitter: n(74),
event: "comment",
getInstance: f,
handler: function(e) {
this.onComment(e)
}
}],
m = n(953).withOptions({
batchEndpoint: "trackBatch",
getBatchParams: function(e) {
var t = e.playlist;
return t && "public" !== t.get("sharing") && !n(55).get("me").owns(t) ? {
playlistId: t.id,
playlistSecretToken: t.get("secret_token")
} : null
}
}),
v = (e.exports = n(66).extend(m, n(952), n(954), n(955), n(1304), n(254).withOptions({
attr: "title"
}), n(253).withOptions({
read: "artwork_url",
write: "artwork_data"
}), n(522), n(957), n(199).withOptions({
events: g
}), {
resource_type: "sound",
urnPrefix: "soundcloud:tracks",
getEndpointForMethod: function(e) {
return "read" === e ? "track" : null
},
audio: null,
_visuals: null,
submodelMap: {
user: n(61),
created_with: n(977)
},
timeOffset: 0,
playlist: null,
originalSound: null,
ownerAttributes: ["scheduled_public_date", "scheduled_private_date", "scheduled_timezone", "geo_blockings", "managed_by_feeds", "reveal_comments", "reveal_stats"],
_streamsExist: !0,
_playable: !0,
_preloadingCounter: 0,
setup: function(e, t) {
var o = !(!t || !t.suppressGlobalEvents);
this.on("play", v("play", o), this).on("pause", v("pause", o), this).on("seeked", v("seeked", o), this).on("finish", v("finish", o), this).on("playStart", v("playStart", !0), this), this.getSounds = n(3).memoize(this.getSounds), this.listenTo(this, "change:visuals", i).listenTo(this, "change:policy", r), this.attrExists("visuals") && i.call(this), r.call(this)
},
getSubmodelOptions: function(e) {
return "user" === e ? {
parse: !0
} : null
},
ownerUrl: function() {
return this.getEndpointUrl("trackAsOwner", {
urn: this.getUrn()
})
},
parse: function(e) {
var t = e.schedule;
return e.scheduled_timezone = t && t.timezone, e.scheduled_public_date = t && Date.parse(t.sunrise), e.scheduled_private_date = t && Date.parse(t.sunset), e
},
baseUrl: function() {
return this.getEndpointUrl("track", {
urn: this.getUrn()
})
},
destroyUrl: function() {
return this.getEndpointUrl("trackDelete", {
id: this.id
})
},
streamsUrl: function() {
return this.getEndpointUrl("trackStreams", {
id: this.id
})
},
getImageSaveUrl: function() {
return this.getEndpointUrl("trackPatchUpdate", {
id: this.id
})
},
extractSecretToken: function(e) {
return n(63).parse(e.uri).query.secret_token
},
play: function(e) {
this.playlist ? (this.playlist.setCurrentSound(this), this.playlist.play(e)) : this.createAudio().play(e)
},
pause: function(e) {
this.playlist ? this.playlist.pause(e) : this.audio && this.audio.pause(e)
},
seek: function(e) {
this.createAudio().seek(e)
},
seekRelative: function(e) {
this.createAudio().seekRelative(e)
},
getSounds: function() {
return [this]
},
getCurrentSound: a,
getFirstSound: a,
getLastSound: a,
getNumSounds: s,
getPrevSound: l,
getNextSound: l,
getSoundIndex: function(e) {
return e === this ? 0 : -1
},
containsSound: function(e) {
return e === this
},
isBuffering: function() {
return !!this.audio && this.audio.isBuffering()
},
isPlaying: function() {
return !!this.audio && this.audio.isPlaying()
},
loadProgress: function() {
return this.audio ? this.audio.loadProgress() : 0
},
currentTime: function() {
return this.audio ? this.audio.currentTime() : 0
},
getListenTime: function() {
return this.audio ? this.audio.getListenTime() : 0
},
isNowPlaying: function() {
return n(68).getCurrentSound() === this
},
progress: function() {
return this.currentTime() / this.duration()
},
duration: function() {
return this.get("full_duration") || this.get("duration")
},
getMediaDuration: function() {
return this.get("duration")
},
isPlayable: function() {
return this._playable
},
setHasStreamInfo: function(e) {
this._streamsExist !== e && (this._streamsExist = e, r.call(this))
},
isProcessing: function() {
var e = this.get("state");
return "finished" !== e && null != e
},
isEditing: function() {
return !1
},
isCommentable: function() {
return this.get("commentable") !== !1
},
isManagedByFeeds: function() {
return !!this.get("managed_by_feeds")
},
isMonetizable: function() {
return !!this.get("monetization_enabled")
},
isMonetizablePending: function() {
var e = this.get("monetization");
return !this.isMonetizable() && !!(e && e.territories && e.territories.length > 0)
},
hasScheduledPrivacy: function() {
return !(!this.get("scheduled_public_date") && !this.get("scheduled_private_date"))
},
isGeoblocked: function() {
var e = this.get("geo_blockings");
return !(!e || !e.length)
},
isBlocked: function() {
return this.get("policy") === c
},
isSnippetized: function() {
return this.get("policy") === d
},
isMonetized: function() {
return this.get("policy") === h
},
isAllowed: function() {
return this.get("policy") === p
},
isAd: function() {
return !!this.get("ad_type")
},
isExternal: function() {
return "external" === this.get("ad_type")
},
getOriginalSound: function() {
return this.originalSound || this
},
hasMinPlayTime: function() {
return this.getListenTime() >= u * this.getMediaDuration()
},
createAudio: function() {
return this.audio || (this.audio = n(503).createAudioFromSound(this)), this.audio
},
initAudio: function() {
this.createAudio().initAudio()
},
requestPreloading: function() {
this._preloadingCounter++ || (this.initAudio(), this.audio.enablePreloading())
},
unrequestPreloading: function() {
--this._preloadingCounter || this.createAudio().disablePreloading()
},
disposeAudio: function() {
this.audio && (this.audio.dispose(), this.audio = null)
},
toJSON: function() {
var e = n(66).prototype.toJSON.apply(this, arguments);
return e._playlist = {}, this.playlist && n(3).each(["id", "permalink", "permalink_url", "secret_token", "user_id"], function(t) {
e._playlist[t] = this.playlist.get(t)
}, this), e
},
saveUrl: function(e) {
return e ? this.getEndpointUrl("trackPatchUpdate", {
id: this.id
}) : this.isNew() ? this.getEndpointUrl("trackCreate") : this.getEndpointUrl("trackUpdate", {
urn: this.getUrn()
})
},
saveFormat: "json",
getAttributesToBeSaved: function() {
var e = ["api_streamable", "commentable", "description", "downloadable", "embeddable", "feedable", "genre", "isrc", "isrc_generate", "label_name", "license", "monetization", "original_filename", "permalink", "purchase_title", "purchase_url", "release_date", "replacing_uid", "replacing_original_filename", "reveal_comments", "reveal_stats", "sharing", "shared_to", "tag_list", "title", "uid", "geo_blockings", "publisher_metadata", "restrictions", "rightsholders"].reduce(function(e, t) {
return null != this[t] && (e[t] = this[t]), e
}.bind(this.attributes), {});
return n(3).assign(e, n(3).pick(this.attributes, ["scheduled_private_date", "scheduled_public_date", "scheduled_timezone", "scheduled_public_timezone"])), e
},
setMonetizableTrack: function(e) {
e.hold(), this.addSubmodel(e), this._monetizableTrack = e
},
getMonetizableTrack: function() {
return this._monetizableTrack
}
}, {
states: {
READY: "ready",
PROCESSING: "processing",
FAILED: "failed",
FINISHED: "finished"
},
hashFn: function(e) {
var t = e.resource_id;
if (t) {
if ("object" == typeof t) {
if ("playlist_id" in t) return [t.playlist_id, t.sound_id].join("_");
if ("ad_target_id" in t) return ["ad", t.ad_target_id, t.sound_id].join("_")
}
return t
}
return e.id || null
},
resolve: function(e, t, i) {
return n(66)._resolve(this, [e, t, i], function(n) {
var i = n.get("user");
return i && n.get("permalink") === t && i.permalink === e
})
},
normalize: function(e) {
var t = e.waveform_url;
return t && t.indexOf("/w1.") > -1 && (e.waveform_url = t.replace(/\/w1\./, "/wis.")), e
},
onCleanup: function(e) {
return e._visuals && (e._visuals.release(), e._visuals = null), e.disposeAudio(), n(66).onCleanup.apply(this, arguments)
}
}), n(3).memoize(function(e, t) {
return function(i) {
var r = n(3).toArray(arguments);
switch (i && i.sound === n(92).getCurrentSound() && (i.ad = n(92).getCurrentAd()), t || n(57).trigger.apply(n(57), ["audio:" + e].concat(r)), e) {
case "playStart":
n(59).trackPlayStart(o(i));
break;
case "pause":
n(59).trackPause(o(i))
}
}
}, function(e, t) {
return e + (t ? "" : "-global")
}))
},
75: function(e, t, n) {
"use strict";
var i = e.exports = function(e, t) {
var r = i.getClass(e);
return e = n(3).omit(e, "resource_type"), new r(e, t)
};
i.getClass = function(e) {
var t = e.resource_type || e.kind;
return n("playlist" === t ? 84 : "sound" === t || "track" === t ? 65 : 65)
}
},
82: function(e, t, n) {
"use strict";
function i(e) {
switch (e) {
case u:
return "consumer-subscription";
case p:
case f:
case g:
return "creator-gift";
case c:
case d:
case h:
return "creator-subscription"
}
}
function r(e) {
switch (e) {
case u:
return "consumer-high-tier";
case p:
case c:
return "free";
case f:
case d:
return "pro";
case g:
case h:
return "pro-unlimited"
}
}
function o() {
n(57).off("connect:hasUserData", s), a = n(3).once(function() {
n(64).isLoggedIn() || n(57).once("connect:hasUserData", s)
})
}
function s() {
m.clearRequestCache(), m.instances.invoke("fetch")
}
var a = void 0,
l = n(73).productIds,
u = l.CONSUMER_SUBSCRIPTION_HIGH_TIER,
c = l.CREATOR_SUBSCRIPTION_FREE,
d = l.CREATOR_SUBSCRIPTION_PRO,
h = l.CREATOR_SUBSCRIPTION_PRO_UNLIMITED,
p = l.CREATOR_GIFT_FREE,
f = l.CREATOR_GIFT_PRO,
g = l.CREATOR_GIFT_PRO_UNLIMITED;
o();
var m = e.exports = n(66).extend({
resource_type: "product",
setup: function() {
a()
},
fetch: function(e) {
var t = this;
return v(i(this.id), this.options.ref).then(function(n) {
var i = n.body.plans;
t.lastFetchTime = Date.now(), t.populateFromPlans(i, e)
})
},
populateFromPlans: function(e, t) {
var i = n(3).findWhere(e, {
id: r(this.id)
});
i ? this.set(this.parse(i, t), t) : this.set("active", !1)
},
parse: function(e) {
return n(3).extend({
active: !0
}, n(3).omit(e, "id"))
},
isActive: function() {
return !!this.get("active")
},
isPromoAvailable: function() {
var e = "soundcloud:payments:promotions:consumer-subscription",
t = this.getPromotion();
return t.urn && 0 === t.urn.indexOf(e) || !1
},
isAvailable: function() {
return this.isFree() || !!this.get("preselected_term")
},
isGift: function() {
return this.id.indexOf("gift") > -1
},
isPro: function() {
return -1 === this.id.indexOf("unlimited") && !this.isFree()
},
isProUnlimited: function() {
return this.id.indexOf("unlimited") > -1
},
isRenewal: function() {
return "renewal" === this.get("use_case")
},
isFree: function() {
return this.id.indexOf("free") > -1
},
isCurrency: function(e) {
return this.getCurrency() === e
},
isTrial: function() {
return !!this.get("trial")
},
getPromotion: function() {
return this.get("promotion") || {}
},
getPromotionDurationInMonths: function() {
var e = this.get("promotion");
return e ? e.duration_in_days / 30 : 0
},
getTrialDuration: function() {
var e = this.get("trial");
return e ? e.duration_in_days : 0
},
getTrackingUseCase: function() {
var e = this.get("use_case");
return (e === m.useCases.REGULAR || e === m.useCases.MONEY_BACK) && (e = "new"), e
},
getCurrency: function() {
return this.getPrice().currency
},
getTitle: function() {
return this.isPro() ? n(52).t("Pro") : this.isProUnlimited() ? n(52).t("Pro Unlimited") : n(52).t("Free")
},
getPrice: function(e) {
return this.getTermData(e).price || {
currency: "EUR"
}
},
getDisplayPrice: function() {
var e = this.getPrice(),
t = e.display,
i = e.currency,
r = n(52).numberHelper.format(t, {
precision: 2
});
return t ? n(93).format(r, i) : ""
},
getPackagePrice: function(e) {
var t = this.getTermData(e)["package"];
return t && (t.price || {
currency: "EUR"
})
},
getPromoPrice: function() {
var e = arguments.length <= 0 || void 0 === arguments[0] ? 2 : arguments[0],
t = this.getPromotion().price || {
currency: "EUR"
},
i = t.display,
r = t.currency,
o = n(52).numberHelper.format(i, {
precision: e
});
return i ? n(93).format(o, r) : ""
},
getPromoCode: function() {
var e = this.getPromotion(),
t = e.urn;
return t && t.split(":").pop()
},
getDiscount: function(e) {
var t = this.getTermData(e).discount;
return t && t.price
},
getTermData: function(e) {
return e = e || this.getPreselectedTerm(), this.get(e) || {}
},
getPreselectedTerm: function() {
return this.get("preselected_term")
},
getUrn: function() {
return this.getTermData()["package"].urn
}
}, {
useCases: {
DISABLED: "disabled",
REGULAR: "regular",
MONEY_BACK: "money_back",
RENEWAL: "renewal",
DOWNGRADE: "downgrade",
UPGRADE: "upgrade"
},
resetLoginListener: o,
clearRequestCache: function() {
v.cache = {}
}
}),
v = n(3).memoize(function(e, t) {
return n(23).callEndpoint("paymentQuotations", {
category: e
}, {
ref: t
}).fail(function() {
delete v.cache[e]
})
}, function(e, t) {
return e
})
},
84: function(e, t, n) {
"use strict";
function i(e, t) {
e.originalSound.set(e.attributes, t)
}
function r(e, t) {
this.set(e.attributes, t)
}
function o() {
s.call(this)
}
function s(e) {
var t = this.soundsCollection.pluck("duration").reduce(function(e, t) {
return e + (t || 0)
}, 0);
this.set("duration", t, e)
}
function a(e) {
var t = this,
i = e.filter(function(e) {
return !t.findSoundById(e)
}),
r = this.soundsCollection.filter(function(t) {
var n = t.id;
return -1 === e.indexOf(n)
});
r.forEach(function(e) {
return t.removeSound(e)
}), i.forEach(function(e) {
var i = new(n(65))({
id: e
});
t.addSound(i), i.release()
}), this.reorder(e)
}
var l, u = n(3).constant(!1),
c = "tracklistChange",
d = 500;
l = n(22).Collection.extend({
model: n(65),
fetch: function() {
return this.playlist.fetch.apply(this.playlist, arguments)
},
initialize: function(e, t) {
this.playlist = t.playlist
},
hasDataForView: function() {
return !!this.playlist.attributes.tracks
},
isFullyPopulated: n(3).constant(!0),
_usageCount: n(3).constant(1),
hold: n(3).noop,
release: n(3).noop
});
var h = function(e, t) {
var n = t.target,
i = t.targetType;
return e.id === n && "playlist" === i
},
p = [{
emitter: n(57),
event: "broadcast:" + c,
getInstance: function(e, t) {
var n = e.id,
i = t.id;
return n === i
},
handler: function(e) {
var t = e.trackIds;
a.call(this, t)
}
}, {
emitter: n(74),
event: "like",
getInstance: h,
handler: function(e) {
this.onLike(e)
}
}, {
emitter: n(74),
event: "repost",
getInstance: h,
handler: function(e) {
this.onRepost(e)
}
}],
f = (e.exports = n(66).extend(n(442), n(952), n(444), n(335), n(254).withOptions({
attr: "title"
}), n(253).withOptions({
read: "artwork_url",
write: "artwork_data"
}), n(522), n(957), n(199).withOptions({
events: p
}), {
resource_type: "playlist",
urnPrefix: "soundcloud:playlists",
saveFormat: "json",
submodelMap: {
tracks: n(65),
user: n(61)
},
states: {
shuffling: function(e) {
var t = this.getSoundIndex(this.getCurrentSound()),
n = e && this.isPlaying() ? t : null,
i = e ? 0 : t;
this.currentSoundCursor = i, this.setPlayOrder(n), this.toggleState("repeating", e)
},
repeating: {
initial: !1
}
},
soundsCollection: null,
currentSoundCursor: 0,
_isPlayActionQueued: !1,
_playOrder: null,
_internalNavigation: !1,
getSubmodelOptions: function(e) {
return "user" === e ? {
parse: !0
} : null
},
setup: function() {
this.soundsCollection = new l(null, {
playlist: this
}), this.listenTo(this.soundsCollection, "error", function(e, t, i) {
t instanceof n(511) && this.removeSound(e)
}), this._playOrder || (this._playOrder = [])
},
baseUrl: function() {
return this.getEndpointUrl("playlist", {
id: this.id
}, {
representation: "full"
})
},
destroyUrl: function() {
return this.getEndpointUrl("playlistDelete", {
id: this.id
})
},
saveUrl: function() {
return this.isNew() ? this.getEndpointUrl("playlistCreate") : this.getEndpointUrl("playlistUpdate", {
id: this.id
})
},
getImageSaveUrl: function() {
return this.getEndpointUrl("playlistArtworkUpdate", {
id: this.id
})
},
createSubmodel: function(e, t) {
"tracks" === t ? this.prepareSounds() : n(66).prototype.createSubmodel.apply(this, arguments)
},
prepareSounds: function() {
var e = this,
t = [];
this.get("tracks").forEach(function(i) {
if (!e.containsSoundId(i.id)) {
var r = new(n(65))(i);
e.addSubmodel(r);
var o = n(3).defaults({
resource_id: {
playlist_id: e.id,
sound_id: i.id
}
}, i),
s = new(n(65))(o, {
suppressGlobalEvents: !0
});
s.playlist = e, s.originalSound = r, t.push(s), e.toggleListeners(s, !0)
}
}), 0 === this.soundsCollection.length ? this.soundsCollection.reset(t) : this.soundsCollection.add(t, {
silent: !0
}), t.length && this.setPlayOrder()
},
getSoundsCollection: function() {
return this.soundsCollection
},
getSoundsCollectionClone: function() {
return new l(this.soundsCollection.models.slice(), {
playlist: this
})
},
toggleListeners: function(e, t) {
var n = t ? "on" : "off",
s = t ? "listenTo" : "stopListening";
e[n]("play", this.onSoundPlay, this)[n]("pause", this.onSoundPause, this)[n]("buffering:start buffering:end", this.onSoundBuffering, this)[n]("finish", this.onSoundFinish, this)[n]("time", this.onSoundTime, this)[n]("seeked", this.onSoundSeeked, this)[n]("change:duration", o, this), e[n]("change", i)[s](e.originalSound, "change", r)
},
onSoundBuffering: function(e) {
this.trigger(e.type, e)
},
onSoundPlay: function(e) {
e.playlist = this, this.trigger("internal:play", e), this._internalNavigation || (this.trigger("play", e), n(57).trigger("audio:play", e), this._internalNavigation = !0)
},
onSoundPause: function(e) {
this._internalNavigation || (e.playlist = this, this.trigger("pause", e), n(57).trigger("audio:pause", e), this._internalNavigation = !0)
},
onSoundFinish: function(e) {
e.sound === this.getLastSound() && (e.playlist = this, this.trigger("pause finish", e), n(57).trigger("audio:pause audio:finish", e))
},
onSoundTime: function(e) {
e.playlist = this, this.trigger("time", e)
},
onSoundSeeked: function(e) {
e.playlist = this, this.trigger("seeked", e)
},
getPrevSound: function() {
return this.soundsCollection.at(this._playOrder[this.currentSoundCursor - 1])
},
getCurrentSound: function() {
return this.soundsCollection.at(this._playOrder[this.currentSoundCursor])
},
getNextSound: function() {
return this.soundsCollection.at(this._playOrder[this.currentSoundCursor + 1])
},
getFirstSound: function() {
return this.soundsCollection.at(this._playOrder[0])
},
getLastSound: function() {
return this.soundsCollection.at(this._playOrder[this.soundsCollection.length - 1])
},
findSound: function(e) {
return this.findSoundById(e.id)
},
findSoundById: function(e) {
return this.soundsCollection.get(e)
},
getSounds: function() {
return this.soundsCollection.models
},
getSoundIndex: function(e) {
return this.soundsCollection.indexOf(e)
},
containsSound: function(e) {
return this.getSoundIndex(e) > -1
},
containsSoundId: function(e) {
return !!this.findSoundById(e)
},
isManagedByFeeds: function() {
return !!this.get("managed_by_feeds")
},
getNumSounds: function() {
return this.soundsCollection.length || this.get("track_count") || 0
},
isGeoblocked: u,
isMonetizable: u,
isMonetizablePending: u,
hasScheduledPrivacy: u,
play: function(e) {
var t = this;
e = e || {}, e.audible && e.audible.playlist && e.userInitiated && (this.setPlayOrder(this.getSoundIndex(e.audible)), this.getState("shuffling") ? this.currentSoundCursor = 0 : this.setCurrentSound(e.audible)), this.soundsCollection.length ? (this._internalNavigation = !1, this.getCurrentSound().createAudio().play(e)) : this.lastFetchTime || (this._isPlayActionQueued = !0, this.fetch().done(function() {
t._isPlayActionQueued && (t._isPlayActionQueued = !1, t.play(e))
}))
},
pause: function(e) {
if (this._isPlayActionQueued = !1, this.soundsCollection && this.soundsCollection.length) {
this._internalNavigation = !1;
var t = this.getCurrentSound().audio;
t && t.pause(e)
}
},
rewind: function() {
this.currentSoundCursor = 0
},
setCurrentSound: function(e) {
e && (this.currentSoundCursor = this._playOrder.indexOf(this.getSoundIndex(e)))
},
hasDataForPlay: function() {
return this.attributes.hasOwnProperty("tracks")
},
isNowPlaying: function() {
return this.getSoundIndex(n(68).getCurrentSound()) > -1
},
isBuffering: function() {
return this.soundsCollection.some(f("isBuffering"))
},
isPlaying: function() {
return this.soundsCollection.some(f("isPlaying"))
},
isProcessing: function() {
return this.soundsCollection.some(f("isProcessing"))
},
isPlayable: function() {
return !this.get("tracks") || this.soundsCollection.some(f("isPlayable"))
},
isAlbum: function() {
return !!this.get("is_album")
},
setPlayOrder: function(e) {
var t = n(3).range(this.soundsCollection.length);
this.getState("shuffling") && (t = n(3).shuffle(t), "number" == typeof e && (t.splice(t.indexOf(e), 1), t.unshift(e))), this._playOrder = t
},
parse: function(e, t) {
return e = n(66).prototype.parse.apply(this, arguments), t = t || {}, t.isSavingOrder && (e.tracks || e.track_count) && (delete e.tracks, delete e.track_count), e.secret_token && e.tracks && e.tracks.forEach(function(t) {
"public" === t.sharing || t.secret_token || (t.secret_token = e.secret_token)
}), e
},
extractSecretToken: function(e) {
return n(63).parse(e.uri).query.secret_token
},
duration: function() {
return this.get("duration")
},
removeSound: function(e) {
if (e = this.findSound(e)) {
var t = this.getSoundIndex(e),
n = this.get("tracks").slice();
return this.currentSoundCursor > t && --this.currentSoundCursor, e.isPlaying() && e.pause(), this.toggleListeners(e, !1), n.splice(t, 1), this.soundsCollection.remove(e), s.call(this), this.set("tracks", n), e.playlist = null, e.release(), !0
}
return !1
},
addSound: function(e) {
var t, i, r;
return this.findSound(e) ? !1 : (t = n(3).defaults({
resource_id: {
playlist_id: this.id,
sound_id: e.id
}
}, e.attributes), i = new(n(65))(t, {
suppressGlobalEvents: !0
}), i.playlist = this, i.originalSound = e, this.addSubmodel(e), this.toggleListeners(i, !0), r = this.get("tracks"), r || (this.set("tracks", [], {
silent: !0
}), r = this.get("tracks")), this._playOrder.push(this.soundsCollection.length), r.push(i.attributes), this.soundsCollection.add(i), s.call(this, {
silent: !0
}), this.forceChange("tracks"), !0)
},
getCurrentOrder: function() {
return this.soundsCollection.pluck("id")
},
reorder: function(e) {
var t = this.soundsCollection,
n = this.getCurrentSound(),
i = n && n.id;
t.sort({
silent: !0,
comparator: function(t) {
return e.indexOf(t.id)
}
}), this.currentSoundCursor = Math.max(0, e.indexOf(i)), this.set({
tracks: this.soundsCollection.toJSON(),
track_count: this.soundsCollection.length
})
},
hasCapacity: function(e) {
return n(3).union(this.soundsCollection.pluck("id"), e).length <= d
},
saveOrder: function(e) {
var t = this,
i = this.soundsCollection.pluck("id"),
r = {
playlist: {
tracks: i
}
};
return n(22).Model.prototype.save.call(this, {}, n(3).assign({
url: this.saveUrl(),
data: JSON.stringify(r),
contentType: "application/json",
isSavingOrder: !0
}, e)).done(function() {
n(57).broadcast({
excludeThis: !0
}, c, {
id: t.id,
trackIds: i
})
})
},
getAttributesToBeSaved: function() {
var e = n(66).prototype.getAttributesToBeSaved.call(this);
return e.tracks && (e.tracks = n(3).pluck(e.tracks, "id")), e
},
resetOrder: function() {
var e = this;
return this.fetch().done(function() {
e.soundsCollection.each(function(e) {
e.playlist = null, e.release()
}), e.soundsCollection.reset([], {
silent: !0
}), e.prepareSounds()
})
},
hasDifferentCreators: function() {
var e, t = this.get("user_id"),
n = !1;
return e = !this.soundsCollection.every(function(e) {
var i = e.get("user_id");
return null == i ? (n = !0, !0) : i === t
}), e || (n ? null : e)
},
hasVisuals: function() {
return !1
}
}, {
onCleanup: function(e) {
e.soundsCollection.each(function(e) {
e.playlist = null, e.release()
}), e.soundsCollection.off(), delete e.soundsCollection, n(66).onCleanup(e)
},
resolve: function(e, t, i) {
return n(66)._resolve(this, [e, "sets", t, i], function(n) {
var i = n.get("user");
return i && n.get("permalink") === t && i.permalink === e
})
}
}), n(3).memoize(function(e) {
return function(t) {
return t[e]()
}
}))
},
96: function(e, t, n) {
var i = n(513),
r = n(20);
e.exports = function(e) {
return new r.SafeString(i.getAccessibleMarkup(e.hash))
}
},
107: function(e, t, n) {
(function(t) {
"use strict";
var i = 1 / 0;
e.exports = n(66).extend(n(442), {
resource_type: "comment",
urnPrefix: "soundcloud:comments",
parse: function(e) {
return null === e.timestamp && (e.timestamp = i), e
},
submodelMap: {
track: n(65),
user: n(61)
},
baseUrl: function() {
return this.getEndpointUrl("comment", {
id: this.id
})
},
saveUrl: function() {
var e = this.getSound(),
t = ["tracks", e.id, "comments"].join("/"),
i = e.get("secret_token");
return i && e.isPrivate() ? n(63).modify(t, {
query: {
secret_token: i
}
}) : t
},
destroyUrl: function() {
return ["tracks", this.getSoundId(), "comments", this.id].join("/")
},
getAttributesToBeSaved: function() {
return this.pick("body", "timestamp")
},
setReplyTo: function(e) {
this.set("replyTo", e.id), this.trigger("change:recipient", e.get("user").permalink)
},
hasDataForView: function(e) {
return n(66).prototype.hasDataForView.call(this, n(3).without(e, "id"))
},
getSound: function() {
var e = this.getSoundId(),
t = n(65).hashFn({
id: e,
resource_type: "sound"
}),
i = n(65).instances.get(t);
return !i && e && (i = new(n(65))(this.get("track") || {
id: e
}), this.addSubmodel(i)), i
},
destroy: function(e) {
return this.isNew() || n(74).notify("comment", {
object: this,
target: this.getSoundId(),
targetType: "sound",
state: !1
}), n(66).prototype.destroy.call(this, e)
},
getSoundId: function() {
return this.get("track_id") || (this.get("track") || {}).id
},
reportAsSpam: function() {
var e = this;
t.post("i1/comments/" + this.id + "/spam", function() {
e.trigger("destroy", e, e.collection)
})
}
}, {
EMPTY_TIMESTAMP: i
})
}).call(t, n(1))
},
116: function(e, t, n) {
"use strict";
var i = "track",
r = "artist",
o = {
ARTIST: r,
TRACK: i
},
s = n(953).withOptions({
batchEndpoint: "stationBatch",
paramName: "urns"
});
e.exports = n(66).extend(s, n(253).withOptions({
read: "artwork_url"
}), n(254).withOptions({
attr: "title"
}), {
resource_type: "station",
baseUrl: function() {
return this.getEndpointUrl("station", {
urn: this.id
})
},
getUrn: function() {
return this.id
},
getImageResourceInfo: function() {
var e = n(100).getAsAttributes(this.id),
t = e.id;
switch (this.get("type")) {
case i:
return {
Model: n(65),
args: {
id: t
}
};
case r:
return {
Model: n(61),
args: {
id: t
}
};
default:
return null
}
}
}, {
types: o,
resolve: function(e, t) {
var i = e + "/" + t;
return n(66)._resolve(this, ["stations", e, t], function(e) {
return e.get("permalink") === i
})
},
getStationPageUrl: function(e) {
var t = "user" === e.resource_type ? "artist" : "track";
return "/stations/" + t + e.getPermalink()
}
})
},
120: function(e, t, n) {
"use strict";
var i = n(22).Model;
e.exports = {
activities: new i({
channel: "/me/activities/all/own",
itemName: "activity",
itemNamePlural: "activities",
minPollInterval: 12e4,
maxPollInterval: 192e4,
baseUrl: function() {
return n(55).get("api_v2_host") + "activities"
}
}),
unreadConversations: new(i.extend({
defaults: {
baseUrl: function() {
return n(294).baseUrl("unread") + "?force=1"
},
itemName: "conversation",
itemNamePlural: "conversations",
minPollInterval: 0,
maxPollInterval: 0
},
initialize: function() {
this.setDefaultPolling()
},
enableRealTimePolling: function() {
this.set("minPollInterval", 4e4), this.set("maxPollInterval", 18e4), this.trigger("pollIntervalChange")
},
setDefaultPolling: function() {
this.set("minPollInterval", 3e5), this.set("maxPollInterval", 192e4), this.trigger("pollIntervalChange")
}
})),
conversations: new i({
baseUrl: n(294).baseUrl,
itemName: "conversation",
itemNamePlural: "conversations",
minPollInterval: 1e3,
maxPollInterval: 3e4
})
}
},
122: function(e, t, n) {
"use strict";
var i = e.exports = n(66).extend({
url: null,
lastFetchTime: 1,
initialize: function(e) {
e = e || {}, this.id || (e.id = this.id = this.cid, i.instances.set(this.id, this)), this.fatal = !!e.fatal, n(66).prototype.initialize.apply(this, arguments)
}
}, {
fromSpamWarning: function(e) {
try {
var t = function() {
var t = JSON.parse(e.responseText).errors[0];
if (!["reason_phrase", "warning_level"].every(function(e) {
return t[e]
})) return {
v: null
};
var n = t.reason_phrase;
return {
v: new i({
xhr: e,
error: t,
message: n
})
}
}();
if ("object" == typeof t) return t.v
} catch (n) {
return null
}
},
raise: function(e, t) {
var r = new i(e);
if (r.release(), t = t || {}, t.hard) throw r;
n(57).trigger("exception", r)
},
ajaxFatal: function(e) {
return function(t, r) {
"abort" !== r && i.raise(n(3).assign(e, {
xhr: t,
fatal: !0
}))
}
},
ajaxNonFatal: function(e) {
return function(t, n) {
"abort" !== n && i.raise({
message: e,
xhr: t,
fatal: !1
})
}
}
})
},
134: function(e, t) {
e.exports = function(e, t, n) {
return ("function" == typeof e ? e() : e) ? t : n
}
},
141: function(e, t, n) {
"use strict";
var i = {
buttonText: n(52).t("I need help"),
buttonLink: "http://help.soundcloud.com"
},
r = {
buttonText: n(52).t("Get latest status"),
buttonLink: "http://status.soundcloud.com"
};
e.exports = {
UNKNOWN: n(3).assign({
title: n(52).t("Something doesn’t sound right."),
message: n(52).t("A report has been sent to our tech team,<br> and they’re looking into the problem.<br>Please check back in a bit.")
}, r),
PAGE_NOT_FOUND: n(3).assign({
title: n(52).t("We can’t find that page.")
}, i),
SOUND_NOT_FOUND: n(3).assign({
title: n(52).t("We can’t find that track."),
message: n(52).t("Did you try to access a private track while not being signed in?<br>Maybe the track has been removed.")
}, i),
PLAYLIST_NOT_FOUND: n(3).assign({
title: n(52).t("We can’t find that playlist."),
message: n(52).t("Did you try to access a private playlist while not being signed in?<br>Maybe the playlist has been removed.")
}, i),
STATION_NOT_FOUND: n(3).assign({
title: n(52).t("We can’t find that station.")
}, i),
USER_NOT_FOUND: n(3).assign({
title: n(52).t("We can’t find that user.")
}, i),
USER_INFO_NOT_LOADED: n(3).assign({
title: n(52).t("We’re unable to load your profile information at the moment.")
}, i)
}
},
150: function(e, t, n) {
"use strict";
e.exports = n(72).extend(n(121), {
defaults: {
type: null,
userId: null
},
setup: function(e) {
e.resource_id && !e.userId && (e.userId = e.resource_id)
},
getSourceInfo: function() {
return {
type: "user-" + this.options.type,
resourceId: this.options.userId,
resourceType: "user"
}
}
}, {
hashFn: function(e, t) {
return t && (t.userId || t.resource_id) || null
}
})
},
159: function(e, t, n) {
(function(t) {
"use strict";
function i(e, t) {
t && t.sent_at && (this._lastMessageSentAt = new Date(t.sent_at), this.set("has_attachment", r.call(this)))
}
function r() {
var e = this.get("last_message");
return e ? !!e.content.match(n(179).scLinksRegexGlobal) : !1
}
var o = n(55).get("systemUserId");
e.exports = n(66).extend({
resource_type: "conversation",
saveWithWrapper: !1,
_lastMessageSentAt: null,
submodelMap: {
users: n(61)
},
baseUrl: function() {
return n(294).baseUrlWithId(this.id)
},
setup: function() {
this.listenTo(this, "change:last_message", i)
},
parse: function(e) {
var t = n(3).find(e.users, function(e) {
return "system" === e.id
});
return t && (t.id = o), n(66).prototype.parse.apply(this, arguments)
},
getRecipient: function() {
var e, t = n(55).get("me").id;
return e = n(3).find(this.get("users"), function(e) {
return t !== e.id
}), e || this.get("users")[0]
},
fetch: function() {
var e = this;
return n(66).prototype.fetch.apply(this, arguments).fail(function() {
e.trigger("error")
})
},
isFromSoundCloud: function() {
return this.getRecipient().id === o
},
isFromMissingUser: function() {
return "missing_user" === this.getRecipient().kind
},
setRead: function(e) {
this.set("read", e)
},
markAsRead: function() {
var e = this.toggleReadState(!0);
return n(57).trigger("conversation:read", this.id), e
},
markAsUnread: function() {
var e = this.toggleReadState(!1);
return n(57).trigger("conversation:unread", this.id), e
},
toggleReadState: function(e) {
var t, i = this,
r = null != e ? e : !this.get("read");
return this.set("read", r), this._saveDeferred || (this._saveDeferred = t = n(56).defer().always(function() {
i._saveDeferred = null
}).done(function() {
i.get("read") !== r && i.toggleReadState(i.get("read"))
}), this.save({
read: r
}, {
dataType: "text"
}).done(function() {
window.setTimeout(t.resolve, 1e3)
}).fail(function() {
window.setTimeout(t.reject, 1e3)
})), this._saveDeferred
},
getUuid: function() {
var e = this.get("last_message");
return n(558).hashFn(e)
},
infoForBadge: function() {
var e = this.get("last_message");
return {
from: this.getRecipient(),
isFromSoundCloud: this.isFromSoundCloud(),
content: e.content,
sentAt: e.sent_at,
id: this.id
}
},
lastMessageSentAt: function() {
return this._lastMessageSentAt || i.call(this, null, this.get("last_message")), this._lastMessageSentAt
},
destroyAndReport: function(e) {
var i = this;
e ? t.ajax({
url: this.baseUrl() + "/spam",
type: "PUT",
success: function() {
i.trigger("destroy", i)
}
}) : n(74).destroy(this)
}
})
}).call(t, n(1))
},
168: function(e, t, n) {
var i = n(20),
r = n(934);
e.exports = function(e) {
return new i.SafeString(r.render(e.hash))
}
},
169: function(e, t) {
! function() {
function t() {
clearTimeout(L), T = A = E = C = D = P = M = I = O = L = void 0, F = [], R = function() {
throw new Error("EventGateway must be initialized")
}
}
function n() {
return Math.floor(1e6 * Math.random())
}
function i(e) {
var t, n = {};
for (t in e) e.hasOwnProperty(t) && (n[t] = e[t]);
return n
}
function r(e, t) {
var n, r = i(e);
for (n in t) t.hasOwnProperty(n) && (r[n] = t[n]);
return r
}
function o(e) {
return e = "object" == typeof e ? e : {}, e.context = e.context || {}, e.context.scope = e.context.scope || [], e
}
function s(e) {
return e.replace(j, "v$&")
}
function a(e, t, n) {
var i = e[n];
return "object" == typeof i ? t[n] = Object.keys(x(i)).reduce(a.bind(null, i), {}) : t[n] = "" + i, t
}
function l(e, t) {
var n = x(t);
return "0.0.0" === e ? Object.keys(n).reduce(a.bind(null, n), {}) : n
}
function u(e, t, n, i) {
var r = M + (t ? "/v1/events" : "/v1/event"),
o = JSON.stringify(e);
if (i && W) window.navigator.sendBeacon(r, o);
else {
var s = new window.XMLHttpRequest;
s.onload = f.bind(null, s), s.onerror = g.bind(null, s, n && u.bind(null, e, t, !1, !1)), s.open("post", r, !0), s.send(JSON.stringify(e))
}
}
function c(e) {
O ? (F.push(e), L || (L = setTimeout(d, O))) : u(e, !1, !0, !1)
}
function d(e) {
clearTimeout(L), L = null, F.length && (u(F.slice(), !0, !0, !!e), F.length = 0)
}
function h(e, t, n) {
var i = Date.now(),
r = window.location.href;
k(n).then(function(n) {
var o, a;
n = n || {}, n.anonymous_id = T, n.client_id = D, n.ts = i, n.url = n.url || r, P && (n.app_version = P);
var u = [];
if (C)
for (o in C) u.push(C[o]);
u.length && (n.part_of_variants = u.join(",")), E && (n.origin = E), I && !n.user && (n.user = I), (a = document.referrer).length > 0 && (n.referrer = a), c({
event: e,
version: s(t),
payload: l(t, n)
})
})
}
function p(e) {
e.onload = e.onerror = null
}
function f(e) {
p(e)
}
function g(e, t) {
p(e), t && !/^4/.test(e.status) && setTimeout(t, z)
}
function m(e, t) {
for (var n = 0, i = t.length; i > n; n++)
if (void 0 === e[t[n]]) return !0;
return !1
}
function v(e) {
return e ? _("users", e) : T
}
function _(e, t) {
return ["soundcloud", e, t].join(":")
}
function y(e, t) {
t && (e.query_urn = t.queryUrn, e.query_position = t.position)
}
function b() {}
function w(e) {
var t, n, i = {};
if (e)
for (t = 1; t < arguments.length; ++t) n = arguments[t], n in e && (i[n] = e[n]);
return i
}
function x(e) {
var t, n = {};
for (t in e) e.hasOwnProperty(t) && null != e[t] && (n[t] = e[t]);
return n
}
function k(e) {
return e && "function" == typeof e.then ? e : {
then: function(t) {
return k(t(e))
}
}
}
var S, T, A, E, C, D, P, M, I, R, L, O, F, N, B = "sc_anonymous_id",
$ = 3e4,
U = 1e3,
z = 3e4,
H = "https://telemetry.soundcloud.com",
j = /^[^v]/,
W = !!window.navigator.sendBeacon;
t(), S = {
_anonymousId: null,
initialize: function(e) {
if (!A) {
if (!e.id) throw new Error("EventGateway: You need to pass an id");
E = e.origin, e.user && (I = _("users", e.user)), N = e.eventVersions || {}, T = this._anonymousId = S.getAnonymousId(), this.checkpointIntervals = {}, D = e.id, P = e.appVersion || null, M = e.trackingUrl || H, O = e.batchTimeout || !1, A = !0, R = b
}
},
deinitialize: function() {
t()
},
setUser: function(e) {
I = _("users", e)
},
setExperiments: function(e) {
C = e
},
getAnonymousId: function() {
var e = S.anonymousIdStore.get();
return e && "undefined" !== e || (e = [n(), n(), n(), n()].join("-"), S.anonymousIdStore.set(e)), e
},
logEvent: h,
pageview: function(e, t, n, i) {
R(), h("pageview", N.pageview || "0.0.0", k(i).then(function(i) {
i = o(i);
var s = v(e),
a = {
user: s,
level: t,
chapter: n.join("::"),
page_name: i.page_name,
page_urn: i.page_urn,
query_urn: i.query_urn,
locale: i.locale
};
return r(a, i.params)
}))
},
impression: function(e, t) {
R(), h("impression", N.impression || "1.16.0", k(t).then(function(e) {
e = o(e);
var t = w(e, "impression_name", "impression_category", "impression_object", "page_name", "page_urn", "ad_urn", "monetized_object", "monetization_type", "promoted_by", "external_media");
return t.page_context = e.context.scope.join(":"), t
}))
},
click: function(e, t, n, i) {
R(), h("click", N.click || "0.0.0", k(i).then(function(i) {
i = o(i);
var s = {
ad_urn: i.ad_urn,
campaign: i.context.campaign,
chapter: n.join("::"),
context: i.context.scope.join(":"),
external_media: i.external_media,
level: t,
monetization_type: i.monetization_type,
monetized_object: i.monetized_object,
promoted_by: i.promoted_by,
urn: i.urn,
user: v(e),
click_name: i.click_name,
click_object: i.click_object,
click_target: i.click_target,
page_name: i.page_name,
page_urn: i.page_urn
};
return y(s, i.context.attribution), r(s, i.params)
}))
},
audio: function(e) {
R(), h("audio", N.audio || "1.16.0", k(e).then(function(e) {
var t, n = e.id,
r = "soundcloud:tracks:" + n,
o = this.checkpointIntervals,
s = "number" == typeof e.checkpointInterval && e.checkpointInterval >= U ? e.checkpointInterval : null,
a = w(e, "page_name", "page_urn", "source", "in_playlist", "playlist_position", "reposted_by", "track_length", "protocol", "action", "trigger", "pause_reason", "ad_urn", "monetization_type", "promoted_by", "policy", "monetization_model");
if (y(a, e.attribution), a.track = r, a.track_owner = _("users", e.trackOwnerId), a.playhead_position = e.playheadPosition, a.monetized_object = e.monetized_urn, clearInterval(o[n]), "play" === e.action) {
var l = Date.now() + e.track_length;
t = i(a), t.action = "checkpoint", o[n] = setInterval(function() {
Date.now() < l ? h("audio", N.audio || "1.16.0", t) : clearInterval(o[n])
}, s || $)
} else delete o[n];
return a
}.bind(this)))
},
audioPerformance: function(e) {
R(), h("audio_performance", N.audioPerformance || "0.0.0", k(e).then(function(e) {
if (m(e, ["type", "latency", "protocol", "playertype", "host"])) throw new Error("EventGateway — AudioPerformance : One or multiple mandatory arguments are missing");
return {
type: e.type,
latency: e.latency,
protocol: e.protocol,
player_type: e.playertype,
host: e.host
}
}))
},
audioError: function(e) {
R(), h("audio_error", N.audioError || "0.0.0", k(e).then(function(e) {
if (m(e, ["error_code", "protocol", "player_type", "host", "url"])) throw new Error("EventGateway — AudioError : One or multiple mandatory arguments are missing");
return {
error_code: e.error_code,
protocol: e.protocol,
player_type: e.player_type,
host: e.host,
url: e.url
}
}))
},
appLoad: function(e, t) {
R(), h("appload", N.appLoad || "0.0.0", k(t).then(function(t) {
return {
latency: t.latency,
user: v(e),
level: t.level
}
}))
},
statsView: function(e, t) {
h("stats_view", N.statsView || "0.0.0", k(t).then(function(t) {
var n = v(e);
return r({
user: n
}, t)
}))
},
anonymousIdStore: {
get: function() {
var e = document.cookie.split(B + "=");
return e.length > 1 && e[1].split(";")[0]
},
set: function(e) {
var t, n = "." + window.location.hostname.replace(/.*\.(.+\..+)/, "$1"),
i = new Date;
i.setTime(i.getTime() + 31536e7), t = "; expires=" + i.toGMTString(), document.cookie = B + "=" + e + t + "; path=/; domain=" + n
}
},
flush: d
}, "undefined" != typeof e && e.exports ? e.exports = S : (window.SC = window.SC || {}, window.SC.EventGateway = S)
}()
},
176: function(e, t, n) {
function i(e, t, n, i) {
return o.tp(t, n, e, i.hash, {
comment: i.hash._comment,
context: i.hash._context
})
}
function r(e, t) {
return o.tp(s.cleanBlockText(t.fn()), s.cleanBlockText(t.inverse()), e, t.hash, {
comment: t.hash._comment,
context: t.hash._context
})
}
var o = n(52),
s = n(933);
e.exports = function() {
var e = arguments.length;
if (4 === e) return i.apply(null, arguments);
if (2 === e) return r.apply(null, arguments);
throw new Error("Invalid signature to tp helper, expected 4 or 2 arguments, got: " + e)
}
},
177: function(e, t, n) {
"use strict";
function i(e, t) {
var n = e.previousAttributes().username,
i = /^user\d+$/;
i.test(n) && this.set("permalink", o(t))
}
function r() {
var e = this.getAttributesFromModel();
this.set(e), this.unsetImageFile({
force: !0
}), this.markFieldsClean()
}
function o(e) {
return e.replace(/^[_-]/, "").replace(/[_-]$/, "").replace(/([_-]){2,}/g, "$1").replace(/[^a-z0-9_-]/g, "")
}
e.exports = n(80).extend(n(253).withOptions({
read: "avatar_url"
}), n(254).withOptions({
attr: "username"
}), n(198), {
resource_type: "profile-settings",
_user: null,
_webProfileForms: null,
fields: {
username: {
defaultValue: ""
},
permalink: {
defaultValue: ""
},
description: {
defaultValue: ""
},
avatar_url: {
defaultValue: null
},
first_name: {
defaultValue: ""
},
last_name: {
defaultValue: ""
},
city: {
defaultValue: ""
},
country_code: {
defaultValue: ""
}
},
constraints: {
username: [
[n(69), {
message: n(52).t("Enter your display name. You can change it later.")
}],
[n(109), {
maxLength: 50,
message: n(52).t("Enter a display name that is up to [[maxLength]] characters.")
}]
],
permalink: [
[n(69), {
message: n(52).t("Enter a profile URL.")
}],
[n(1278), {
getResource: function() {
return n(55).get("me")
}
}]
],
description: [
[n(109), {
maxLength: 4e3,
message: n(52).t("Enter a description that is up to [[maxLength]] characters.")
}]
]
},
actions: {
"default": "save",
save: function() {
var e = this,
t = n(56).defer();
return this.validate().done(function(i) {
i ? e.saveEdits().done(function() {
e.trigger("saved"), n(57).trigger("profile:saved"), t.resolve(), e.markFieldsClean()
}).fail(t.reject) : t.reject()
}), t
},
cancel: function() {
this.cancelEdits()
}
},
buttons: {
save: {
label: n(52).t("Save changes"),
pendingLabel: n(52).t("Saving"),
action: "save"
},
cancel: {
label: n(52).t("Cancel"),
action: "cancel"
}
},
setup: function() {
this._user = n(55).get("me"), this._webProfileForms = new(n(905))(null, {
userId: this._user.id
}), this.listenTo(this._webProfileForms, "form:dirty", this.enableAction).listenTo(this._webProfileForms, "form:clean", this.disableAction).listenTo(this, "imageDataChanged", this.markFieldsDirty.bind(this, "avatar_url")), r.call(this), this.listenTo(this, "change:username", i)
},
getUser: function() {
return this._user
},
getWebProfileForms: function() {
return this._webProfileForms
},
cancelEdits: function() {
this.unsetImageFile(), r.call(this), this.trigger("canceled"), this.getWebProfileForms().fetch()
},
isDirty: function() {
var e = n(80).prototype.isDirty.apply(this, arguments);
return e || this.getWebProfileForms().some(function(e) {
return e.isDirty()
}, this)
},
markFieldsClean: function() {
n(80).prototype.markFieldsClean.apply(this, arguments), this.getWebProfileForms().invoke("markFieldsClean")
},
saveEdits: function() {
var e = this,
t = this.getUser(),
i = this.getWebProfileForms(),
r = this.getAttributesToBeSaved(),
o = [];
t.set(r), o.push(i.saveEdits()), o.push(t.save(r));
var s = this.getImageFileInfo();
return s.file && (t.setImageFile(s.file, s.source), t.once("imageTranscodingDone", function(t) {
e.unsetImageFile({
silent: !0
}), e.set("avatar_url", t.avatar_url)
}), o.push(t.uploadImage())), n(56).all(o).done(i.fetch.bind(i))
},
getAttributesToBeSaved: function() {
return n(3).pick(this.attributes, "city", "country_code", "first_name", "last_name", "description", "permalink", "username")
},
getAttributesFromModel: function() {
var e = this.getUser(),
t = n(3).pick(e.attributes, "avatar_url", "city", "first_name", "last_name", "description", "permalink", "username");
return t.country_code = e.getCountryCode(), t
}
}, {
hashFn: function() {
return 1
},
onCleanup: function(e) {
e._webProfileForms.release()
}
})
},
184: function(e, t, n) {
var i = n(20),
r = n(86);
e.exports = function(e, t) {
return new i.SafeString(r.markup(e, t.hash))
}
},
185: function(e, t, n) {
var i = n(20),
r = n(473),
o = n(423).withDefaults(r["default"]);
e.exports = function(e, t) {
return (void 0 === t.hash.escapeExpression || t.hash.escapeExpression) && (e = i.Utils.escapeExpression(e)), new i.SafeString(o(e, t.hash))
}
},
192: function(e, t) {
"use strict";
e.exports = {
defaultKind: "top",
defaultGenre: "all-music",
kinds: [{
id: "top",
urlPart: "top"
}, {
id: "trending",
urlPart: "new"
}],
genres: [{
id: "all-music",
category: "all",
content: "music"
}, {
id: "all-audio",
category: "all",
content: "audio"
}, {
id: "alternativerock",
category: "music",
content: "music"
}, {
id: "ambient",
category: "music",
content: "music"
}, {
id: "classical",
category: "music",
content: "music"
}, {
id: "country",
category: "music",
content: "music"
}, {
id: "danceedm",
category: "music",
content: "music"
}, {
id: "dancehall",
category: "music",
content: "music"
}, {
id: "deephouse",
category: "music",
content: "music"
}, {
id: "disco",
category: "music",
content: "music"
}, {
id: "drumbass",
category: "music",
content: "music"
}, {
id: "dubstep",
category: "music",
content: "music"
}, {
id: "electronic",
category: "music",
content: "music"
}, {
id: "folksingersongwriter",
category: "music",
content: "music"
}, {
id: "hiphoprap",
category: "music",
content: "music"
}, {
id: "house",
category: "music",
content: "music"
}, {
id: "indie",
category: "music",
content: "music"
}, {
id: "jazzblues",
category: "music",
content: "music"
}, {
id: "latin",
category: "music",
content: "music"
}, {
id: "metal",
category: "music",
content: "music"
}, {
id: "piano",
category: "music",
content: "music"
}, {
id: "pop",
category: "music",
content: "music"
}, {
id: "rbsoul",
category: "music",
content: "music"
}, {
id: "reggae",
category: "music",
content: "music"
}, {
id: "reggaeton",
category: "music",
content: "music"
}, {
id: "rock",
category: "music",
content: "music"
}, {
id: "soundtrack",
category: "music",
content: "music"
}, {
id: "techno",
category: "music",
content: "music"
}, {
id: "trance",
category: "music",
content: "music"
}, {
id: "trap",
category: "music",
content: "music"
}, {
id: "triphop",
category: "music",
content: "music"
}, {
id: "world",
category: "music",
content: "music"
}, {
id: "audiobooks",
category: "audio",
content: "audio"
}, {
id: "business",
category: "audio",
content: "audio"
}, {
id: "comedy",
category: "audio",
content: "audio"
}, {
id: "entertainment",
category: "audio",
content: "audio"
}, {
id: "learning",
category: "audio",
content: "audio"
}, {
id: "newspolitics",
category: "audio",
content: "audio"
}, {
id: "religionspirituality",
category: "audio",
content: "audio"
}, {
id: "science",
category: "audio",
content: "audio"
}, {
id: "sports",
category: "audio",
content: "audio"
}, {
id: "storytelling",
category: "audio",
content: "audio"
}, {
id: "technology",
category: "audio",
content: "audio"
}]
}
},
193: function(e, t, n) {
var i = n(149);
e.exports = function(e) {
return i.render(e, {
useSIUnits: !0
})
}
},
194: function(e, t, n) {
"use strict";
function i() {
var e = this.getAudible();
n(57).trigger("playlist:saved", e), this.trigger("saved")
}
function r(e) {
this.set({
errorMessage: this.getErrorMessageTemplate("save", "playlist", this.extractErrorMessage(e))
})
}
function o(e, t) {
return e.attrExists(t) ? n(56).resolve(e) : e.fetch({
attrs: t
}).then(n(3).constant(e))
}
function s() {
this.setToModelAttributes(), this.get("trackList").reset(this._playlist.getSounds())
}
function a() {
var e = this.requiredModelAttributes.map(function(e) {
return "change:" + e
}).join();
this.listenTo(this._playlist, e, function() {
this.isDirty() || s.call(this)
})
}
function l(e) {
var t = e.getSoundsCollectionClone(),
i = e.getSounds();
return n(3).assign(t, {
getCurrentOrder: function() {
return this.pluck("id")
},
reorder: function(e) {
this.sort({
silent: !0,
comparator: function(t) {
return e.indexOf(t.id)
}
})
},
resetOrder: function() {
return this.reset(i.slice()), n(56).resolve()
},
saveOrder: n(3).noop
}), n(442).applyTo(t), n(444).applyTo(t), t
}
e.exports = n(80).extend(n(198), n(943), n(948), n(254).withOptions({
attr: "title"
}), n(945), n(520), {
_playlist: null,
resource_type: "playlist-edit",
requiredModelAttributes: [],
actions: {
"default": "save",
save: function() {
var e = this;
return this.validate().then(function(t) {
return t ? (e.set("editing", !1), e.saveEdits()) : n(56).reject()
})
},
cancel: function() {
this.cancel()
}
},
fields: {
buyLink: {
defaultValue: ""
},
buyTitle: {
defaultValue: "Buy"
},
labelName: {
defaultValue: null
},
trackList: {
defaultValue: null
}
},
buttons: {
save: {
label: n(52).t("Save changes"),
pendingLabel: n(52).t("Saving"),
action: "save"
},
cancel: {
label: n(52).t("Cancel"),
action: "cancel"
}
},
constraints: {
title: [
[n(69), {
message: n(52).t("Enter a title.")
}],
[n(109), {
maxLength: 100,
message: n(52).t("Enter a title that is up to [[maxLength]] characters.")
}]
],
description: [
[n(109), {
maxLength: 4e3,
message: n(52).t("Enter a playlist description that is up to [[maxLength]] characters.")
}]
],
tags: [
[n(509)]
],
permalink: [
[n(435), {
type: "playlist",
getResource: function() {
return this.getAudible()
}
}],
[n(69), {
message: n(52).t("Enter a permalink.")
}]
],
buyLink: [
[n(292), {
strict: !1
}]
],
buyTitle: [
[n(504)]
],
customGenre: [
[n(109), {
maxLength: 100,
message: n(52).t("Enter a custom genre that is up to [[maxLength]] characters.")
}]
]
},
constraintConditions: {
buyTitle: {
fields: [],
check: function() {
return n(55).get("me").getPerk("customBuyTitle")
}
}
},
setup: function(e, t) {
var i = this;
this.on("imageDataChanged", this.markFieldsDirty.bind(this, "artwork_url")), this._playlist = new(n(84))({
id: t.resource_id
}), this.set("trackList", l(this._playlist)), o(this._playlist, this.requiredModelAttributes).then(function() {
s.call(i), a.call(i)
}), this.addSubmodel(this._playlist)
},
saveEdits: function() {
var e = this.getAudible();
if (e.set(this.getAttributesToBeSaved()), this.isDirty("trackList")) {
var t = e.getSounds(),
o = this.get("trackList");
t.length > o.length && n(3).difference(t, o.models).forEach(e.removeSound, e), e.reorder(o.pluck("id"))
}
return e.save().then(this.saveAudibleImage.bind(this, e)).then(i.bind(this), r.bind(this)).done(this.trigger.bind(this, "saved"))
},
getAudible: function() {
return this._playlist
},
getAttributesFromModel: function() {
var e = this.getAudible();
return {
buyLink: e.get("purchase_url"),
buyTitle: e.get("purchase_title"),
labelName: e.get("label_name")
}
},
getAttributesToBeSaved: function() {
var e = this.get("buyLink"),
t = this.get("buyTitle");
return {
purchase_url: e ? n(63).normalize(e) : null,
purchase_title: t === this.getFieldMetadata("buyTitle").defaultValue ? null : t,
label_name: this.get("labelName")
}
},
cancel: function() {
s.call(this), this.trigger("canceled")
},
saveCleanup: function(e) {
this.markFieldsClean()
}
}, {
hashFn: function(e, t) {
return e.resource_id || t && t.resource_id || e.id || null
}
})
},
209: function(e, t, n) {
"use strict";
e.exports = n(72).extend(n(121).withOptions({
loop: !0
}), {
model: n(65),
baseUrl: function() {
return this.getEndpointUrl("stationTracks", {
urn: this.options.resource_id
})
},
getSourceInfo: function() {
return {
type: "stations",
resourceId: this.options.resource_id,
resourceType: "station",
queryUrn: this.queryUrn
}
},
parse: function(e) {
var t = e.collection,
n = e.query_urn;
return this.queryUrn = n, t
}
}, {
hashFn: function(e, t) {
var n = t.resource_id;
return n
}
})
},
210: function(e, t, n) {
"use strict";
var i = e.exports = n(290).extend({
defaults: {
type: "track_likes"
},
baseUrl: function() {
return this.getEndpointUrl("userTrackLikes", {
id: this.options.userId
})
},
acceptsType: function(e) {
return "sound" === e
}
});
n(333).applyTo(i, {
fields: ["track.title", "track.genre", "track.tag_list", "user.username", "user.full_name", "user.permalink"],
mixins: [n(121)],
protoProps: {
defaults: {
type: "track_likes"
}
}
})
},
211: function(e, t, n) {
"use strict";
e.exports = n(150).extend({
model: n(65),
defaults: {
limit: 20,
type: "tracks",
keepBlocked: !0
},
baseUrl: function() {
return this.getEndpointUrl("userTracks", {
id: this.options.userId
}, {
representation: this.options.keepBlocked ? "owner" : ""
})
}
}, {
hashFn: function(e) {
var t = arguments.length <= 1 || void 0 === arguments[1] ? {} : arguments[1],
n = t.userId,
i = t.resource_id,
r = t.keepBlocked,
o = n || i;
return [o || null, r === !1 ? "_b" : null].join("") || null
}
})
},
225: function(e, t, n) {
var i = n(52);
e.exports = function(e, t) {
return i.dateTimeHelper.format(new Date(e), t.hash.format)
}
},
227: function(e, t, n) {
e.exports = n(51)
},
228: function(e, t, n) {
var i = n(20),
r = n(423),
o = n(473),
s = r.withDefaults(o.oneline);
e.exports = function(e, t) {
return (void 0 === t.hash.escapeExpression || t.hash.escapeExpression) && (e = i.Utils.escapeExpression(e)), new i.SafeString(s(e, t.hash))
}
},
230: function(e, t, n) {
"use strict";
function i(e) {
var t = n(55).get("me");
return n(3).all(e, function(e) {
return t.owns(e)
})
}
function r(e) {
a.call(this, e, !0), s.call(this)
}
function o(e) {
a.call(this, e, !1), s.call(this)
}
function s() {
this.setActionState("save", this.get("sounds").length ? "enabled" : "disabled"), this.forceChange("sounds")
}
function a(e, t) {
var n = this.getFieldMetadata("sounds").datasource,
i = "excludeSeed_" + e.id,
r = t ? function(t) {
return t !== e
} : null;
n.setFilter(i, r)
}
var l = n(59).trackV0Click;
e.exports = n(80).extend({
fields: {
title: {
defaultValue: ""
},
sounds: {
defaultValue: function() {
return new(n(490))
}
},
playlist: {
defaultValue: null
},
sharing: {
defaultValue: "public",
datasource: [{
label: n(52).t("private"),
value: "private"
}, {
label: n(52).t("public"),
value: "public"
}]
}
},
buttons: {
save: {
label: n(52).t("Save"),
action: "save"
}
},
actions: {
save: function() {
var e = this,
t = new(n(84))({
title: this.get("title"),
sharing: this.get("sharing")
});
return this.get("sounds").forEach(function(e) {
t.addSound(e)
}), this.validate().always(function() {
t.release()
}).then(function(i) {
return i ? t.save().then(function() {
var i = new(n(84))(t.attributes);
return n(74).notify("createPlaylist", {
object: i
}), e.get("sounds").each(function(e) {
n(74).notify("addToPlaylist", {
object: e,
target: i.id,
targetType: i.get("kind"),
state: !0
})
}), e.set("playlist", i), e.markFieldsClean(), i
}) : void l(["add_to_set", "validation"])
})
},
"default": "save"
},
constraints: {
title: [
[n(69), {
message: n(52).t("Enter a title.")
}],
[n(109), {
maxLength: 255,
message: n(52).t("Enter a title that is up to [[maxLength]] characters.")
}]
],
sounds: [
[n(69), {
message: n(52).t("Playlists must contain at least one track.")
}]
]
},
setup: function(e, t) {
var s, a = this.get("sounds");
this.startingSounds = this.options.startingSounds || [], s = n(3).any(n(3).invoke(this.startingSounds, "isPrivate")), this.set("sharing", s ? "private" : "public"), this.getFieldMetadata("sounds").datasource = new(n(1197))(null, {
sourceType: i(this.startingSounds) ? "mySounds" : "likes"
}), this.listenTo(a, "add", r).listenTo(a, "remove", o), n(3).each(this.startingSounds, this.addSound, this)
},
addSound: function(e) {
this.get("sounds").add(e)
},
areAllSoundsMine: function() {
return i(this.get("sounds").models)
}
}, {
onCleanup: function(e) {
e.get("sounds").release()
}
})
},
245: function(e, t, n) {
e.exports = n.p + "assets/images/loader-db80c5.gif"
},
249: function(e, t, n) {
"use strict";
function i(e) {
e && -1 === this.getRecipientIds().indexOf(e.id) && this.set("recipients", this.get("recipients").concat(e))
}
function r(e) {
return e instanceof n(61) ? a(e) : e instanceof n(267) ? n(56).resolve(o(e)) : f(e) ? n(56).reject() : n(61).resolve(e).then(a)
}
function o(e) {
return {
id: e.resource.resource_id,
username: e.get("output"),
avatar_url: e.get("artwork_url")
}
}
function s(e) {
return e.hasDataForView(["username", "avatar_url"]) ? n(56).resolve(e) : e.fetch()
}
function a(e) {
return s(e).then(function() {
return {
id: e.id,
username: e.get("username"),
avatar_url: e.get("avatar_url")
}
})
}
function l(e, t) {
var i, r = this;
t !== this._lastBodyValue && (this._lastBodyValue = t, n(179).getAudibleModels(t.match(n(179).scLinksRegexGlobal) || []).done(function(e) {
i = n(3).reduce(e, function(e, t) {
return t && t.audible && e.push(t.audible), e
}, []), r.set("attachments", i)
}))
}
function u(e, t) {
t && !t.isValid && m(["messages", "new-message-validation-error"])
}
function c(e) {
u.call(this, "recipients", e)
}
function d(e) {
u.call(this, "body", e)
}
function h(e) {
var t, i;
t = n(3).reject(this.get("attachments"), function(t) {
return t.resource_id === e ? (i = t, !0) : !1
}), this.set("attachments", t), p.call(this, i)
}
function p(e) {
var t = this.get("body"),
i = e.getShareURL(),
r = new RegExp("\\n{0,2}" + n(273).regexpEscape(i) + "\\S*\\n{0,2}", "igm");
t = t.replace(r, ""), this.set("body", t)
}
function f(e) {
return "string" == typeof e && "soundcloud" === e.toLowerCase()
}
function g() {
this.clearStoredValues(), this.set("body", "")
}
var m = n(59).trackV0Click;
e.exports = n(80).extend(n(1299), {
fields: {
recipients: {
defaultValue: []
},
body: {
defaultValue: ""
},
links: {
defaultValue: []
},
attachments: {
defaultValue: []
}
},
constraints: {
body: [
[n(69), {
message: n(52).t("Enter a message.")
}],
[n(109), {
maxLength: 2e4,
message: n(52).t("Enter a message that is up to [[maxLength]] characters.")
}]
],
recipients: [
[n(69), {
message: n(52).t("Enter a recipient.")
}]
]
},
buttons: {
send: {
label: n(52).t("Send"),
action: "send"
}
},
serialization: {
restoreAndStoreOnSetup: !0,
fields: ["body"]
},
actions: {
"default": "send",
send: function(e) {
var t = n(56).defer(),
i = this.get("recipients")[0],
r = this.get("body");
return this.validate().done(function(o) {
o ? n(317).send(i, r, e.showSuccessMessage).done(t.resolve).fail(t.reject) : t.reject()
}).fail(t.reject), t.done(g.bind(this)), t
}
},
setup: function(e, t) {
this.serialization.storeKey = t.conversationId && "conversation_" + t.conversationId, this.listenTo(this, "change:body", l).listenTo(this, "validation:body", d).listenTo(this, "validation:recipients", c).listenTo(this, "removeSoundFromAttached", h)
},
getRecipientIds: function() {
return n(3).pluck(this.get("recipients"), "id")
},
addRecipient: function(e) {
var t = r(e);
return t.done(i.bind(this))
},
addAttachment: function(e, t) {
this.set("body", this.get("body").replace(/\n*$/, "\n" + e.getShareURL({
type: t
}) + " "))
}
})
},
267: function(e, t, n) {
"use strict";
function i(e) {
return e ? e.replace(/^https?:.+?\w\//, "/") : null
}
function r() {
if (this.resource) {
var e = s(this.getEntityType());
this.set({
artwork_url: this.resource.get(e.artwork_url),
link: i(this.resource.get(e.link))
})
}
}
function o() {
this.listenTo(this.resource, n(3).map(s(this.getEntityType()), function(e) {
return "change:" + e
}).join(" "), r)
}
function s(e) {
switch (e) {
case "user":
return {
artwork_url: "avatar_url",
link: "permalink_url"
};
case "track":
return {
artwork_url: "artwork_url",
link: "permalink_url"
}
}
}
function a(e) {
switch (e) {
case "user":
return n(61);
case "track":
return n(65);
default:
return null
}
}
e.exports = n(66).extend({
resource_type: "shortcut",
url: null,
submodelMap: {
entity: null
},
hashCode: null,
setup: function() {
this.hashCode = this.get("output") + "%%" + this.getEntityType()
},
createSubmodel: function() {
var e = a(this.getEntityType());
null !== e && (this.resource = new e(this.get("entity")), this.addSubmodel(this.resource), o.call(this)), r.call(this)
},
fetch: function() {
return this.resource ? this.resource.fetch() : n(56).resolve({})
},
getEntityType: function() {
switch (this.get("kind")) {
case "track":
case "like":
return "track";
case "user":
case "following":
return "user";
case "query":
return "query"
}
},
isQuery: function() {
return "query" === this.get("kind")
},
equivalentTo: function(e) {
return e.hashCode === this.hashCode
}
})
},
277: function(e, t, n) {
e.exports = n.p + "assets/images/close-light-3cc615.png"
},
285: function(e, t) {
e.exports = function(e) {
function t(i) {
if (n[i]) return n[i].exports;
var r = n[i] = {
exports: {},
id: i,
loaded: !1
};
return e[i].call(r.exports, r, r.exports, t), r.loaded = !0, r.exports
}
var n = {};
return t.m = e, t.c = n, t.p = "", t(0)
}([function(e, t, n) {
function i(e) {
return this._hooksPause.every(function(t) {
return t(e)
})
}
function r(e) {
var t = e.resource_id || e.id || e.cid;
if (!t) throw new Error("Your model should have a unique `id`, `cid` or `resource_id` property");
return t
}
function o(e) {
U = e, e && ($.AudioManagerStates = e.States)
}
function s() {
var e = Y();
return f.call(this, !0).done(function(t) {
e.resolve(t.url)
}).fail(function() {
e.reject()
}), e.promise()
}
function a(e) {
var t, n = this.options;
return t = {
id: this.getId(),
src: e.url,
duration: ee.result(n.duration),
title: this.options.title,
mimeType: e.mimeType,
forceSingle: n.useSinglePlayer,
maxBufferLength: this._pausedMaxBufferLength
}, U.createAudioPlayer(t, {
streamUrlProvider: s.bind(this)
})
}
function l(e, t) {
var n = t ? "on" : "off";
e[n]("state-change", P, this)[n]("position-change", c, this)[n]("metadata", u, this)
}
function u() {
this.trigger(V.METADATA)
}
function c() {
this._prevPosition !== this.currentTime() && (this.trigger(V.TIME), this._prevPosition = this.currentTime())
}
function d() {
this._initAudioDefer && (this._initAudioDefer.reject(), this._initAudioDefer = null, this.streamInfo = null)
}
function h() {
d.call(this), this.controller && (this._storedPosition = this.currentTime(), this.controller.kill(), this.controller = null, this.trigger(V.RESET))
}
function p() {
this._registerPlays = !0, this.pause(), this.trigger(V.FINISH)
}
function f(e) {
var t = Y(),
n = this.streamInfo && !e;
return n ? t.resolve(this.streamInfo) : g.call(this).done(function(e) {
var n = Q.choosePreferredStream(e, this.options);
n ? t.resolve(n) : (this.trigger(V.NO_PROTOCOL), z.warn("(%s) Could not match a protocol of given media descriptor to one of the supported protocols (%s), aborting attempt to play.", this.getId(), this.options.protocols), t.reject())
}.bind(this)).fail(function(e) {
z.warn("(%s) Stream request failed with status: %d", this.getId(), e.status), v.call(this, e), _.call(this, e), m.call(this, e), y.call(this, e), t.reject()
}.bind(this)), t.promise()
}
function g() {
if (this.options.streamUrls && !this._usedPrefetchUrls) {
var e, t = Y();
return this._usedPrefetchUrls = !0, e = ee.result(this.options.streamUrls), t.resolve(e), t.promise()
}
return this.ajax({
type: "GET",
url: ee.result(this.options.streamUrlsEndpoint),
dataType: "json",
async: this.options.asyncFetch,
timeout: this.options.asyncFetch ? ae : se
})
}
function m(e) {
e.status >= 400 && e.status < 500 && this.trigger(V.REQUEST_FAILURE)
}
function v(e) {
var t = e.status >= 400 && e.status < 500 && -1 !== (e.responseText || "").indexOf("geo_blocked");
t && this.trigger(V.GEO_BLOCKED)
}
function _(e) {
0 === e.status && this.trigger(V.NO_CONNECTION)
}
function y(e) {
e.status >= 500 && this.trigger(V.API_FAILURE)
}
function b() {
return this.controller ? this.controller.getCapabilities().needsUrlRefresh : !0
}
function w(e) {
if (!b.call(this)) return !0;
var t = this._initAudioDefer && this._initAudioDefer.state(),
n = Q.streamValidForPlayingFrom(this.streamInfo, e);
return this.controller && this.controller.hasStreamUrlProvider && this.controller.hasStreamUrlProvider() ? !0 : t && ("pending" === t || "resolved" === t && n)
}
function x(e) {
e && !this._bufferingTimeout ? this._bufferingTimeout = window.setTimeout(function() {
this._isBuffering = !0, this.trigger(V.BUFFERRING_START)
}.bind(this), le) : e || (this._bufferingTimeout && (window.clearTimeout(this._bufferingTimeout), this._bufferingTimeout = null), this._isBuffering && (this._isBuffering = !1, this.trigger(V.BUFFERRING_END)))
}
function k() {
this.off(V.TIME, this.seekTimeEventHandler), this.trigger(V.SEEKED), this.seekTimeEventHandler = null
}
function S() {
this._errorRecoveryFlagsResetTimeout = window.setTimeout(function() {
this._errorRecoveryTime = null, this._errorRecoveryCounts = 0
}.bind(this), he)
}
function T() {
this._errorRecoveryFlagsResetTimeout && window.clearTimeout(this._errorRecoveryFlagsResetTimeout)
}
function A() {
var e = this.isPlaying(),
t = Date.now();
return T.call(this), this._errorRecoveryTime && this._errorRecoveryTime + ce > t && this._errorRecoveryCounts > de ? (this.pause(), this.trigger(V.AUDIO_ERROR, this), void h.call(this)) : (this._errorRecoveryTime = Date.now(), this._errorRecoveryCounts++, h.call(this), void(e && this.play({
seek: this.currentTime(),
userInitiated: !1
})))
}
function E(e) {
this.logAudioError({
error_code: e,
protocol: this.streamInfo ? this.streamInfo.protocol : void 0,
player_type: this.controller ? this.controller.getType() : void 0,
host: this.streamInfo ? J.getUrlHost(this.streamInfo.url) : void 0,
url: this.streamInfo ? this.streamInfo.url : void 0
})
}
function C() {
var e, t = U.Errors;
if (!this.controller) return z.error("(%s) Controller is null, aborting error handler.", this.getId(), this), E.call(this, null), void A.call(this);
switch (e = this.controller && this.controller.getErrorID(), z.error("(%s) %s", this.getId(), this.controller.getErrorMessage ? this.controller.getErrorMessage() : "Controller does not provide getErrorMessage()"), R(e, "MSE", "GENERIC", "HTML5_AUDIO_DECODE", "HTML5_AUDIO_SRC_NOT_SUPPORTED", "FLASH_PROXY", "FLASH_RTMP_CONNECT_FAILED", "FLASH_RTMP_CANNOT_PLAY_STREAM") && E.call(this, e), e) {
case t.FLASH_PROXY_CANT_LOAD_FLASH:
this.trigger(V.FLASH_NOT_LOADED);
break;
case t.FLASH_PROXY_FLASH_BLOCKED:
this.trigger(V.FLASH_BLOCK);
break;
case t.FLASH_RTMP_CONNECT_FAILED:
ee.without(this.options.protocols, X.RTMP);
case t.FLASH_RTMP_CANNOT_PLAY_STREAM:
case t.FLASH_RTMP_CONNECT_CLOSED:
case t.HTML5_AUDIO_NETWORK:
case t.HTML5_AUDIO_ABORTED:
case t.HTML5_AUDIO_DECODE:
case t.HTML5_AUDIO_SRC_NOT_SUPPORTED:
case t.GENERIC_AUDIO_ENDED_EARLY:
case t.MSE_BAD_OBJECT_STATE:
case t.MSE_HLS_NOT_VALID_PLAYLIST:
case t.MSE_HLS_PLAYLIST_NOT_FOUND:
case t.MSE_HLS_SEGMENT_NOT_FOUND:
A.call(this);
break;
case t.GENERIC_AUDIO_OVERRUN:
p.call(this);
break;
default:
z.error("(%s) Unhandled audio error code: %s", this.getId(), e, this)
}
}
function D(e, t) {
switch (this.options.debug && M.call(this, e, t), e) {
case V.PAUSE:
this._isPlaying = !1, this._isPlayActionQueued = !1, N.call(this);
break;
case V.PLAY:
var n = t;
this.toggleMute(ne.muted), this.setVolume(ne.volume), this._isPlaying = !1, this._isPlayActionQueued = !0, N.call(this), this._userInitiatedPlay = void 0 !== n.userInitiated ? !!n.userInitiated : !0, L.call(this);
break;
case V.PLAY_START:
this._isPlaying = !0, this._isPlayActionQueued = !1, N.call(this), this._registerPlays && this.registerPlay();
break;
case V.BUFFERRING_START:
case V.SEEK:
this._isPlaying && (this._isPlaying = !1, this._isPlayActionQueued = !0);
break;
case V.BUFFERRING_END:
case V.SEEKED:
this._isPlayActionQueued && (this._isPlaying = !0, this._isPlayActionQueued = !1);
break;
case V.NO_CONNECTION:
this.pause(), this._hasNoConnection = !0, this._noConnectionSince = Date.now();
break;
case V.API_FAILURE:
this.pause();
break;
case V.REQUEST_FAILURE:
this._isPlaying = !1, this._isPlayActionQueued = !1, N.call(this);
break;
case V.GEO_BLOCKED:
this._isGeoBlocked = !0;
break;
case V.NO_STREAMS:
x.call(this, !1), d.call(this), F.call(this);
break;
case V.STREAMS:
this._isGeoBlocked = !1, this._noConnectionSince = null, this._hasNoConnection = !1;
break;
case V.ONLINE:
O.call(this);
break;
case V.OFFLINE:
}
}
function P(e) {
var t = U.States,
n = U.Errors;
switch (e) {
case t.IDLE:
I.call(this), this.controller && this.controller.getErrorID() === n.FLASH_PROXY_FLASH_BLOCKED && this.trigger(V.FLASH_UNBLOCK);
break;
case t.PAUSED:
I.call(this), x.call(this, !1), this.seekTimeEventHandler && this.isPaused() && k.call(this), this.isPlaying() && this.trigger(V.PAUSE, {
position: this.currentTime()
});
break;
case t.PLAYING:
I.call(this), x.call(this, !1), S.call(this), this.trigger(V.PLAY_RESUME);
break;
case t.LOADING:
case t.SEEKING:
I.call(this), x.call(this, !0);
break;
case t.ENDED:
I.call(this), p.call(this);
break;
case t.ERROR:
x.call(this, !1), C.call(this)
}
this.trigger(V.STATE_CHANGE, e)
}
function M(e, t) {
var n = this.options.title;
n = n && n.length ? " [" + n.replace(/\s/g, "").substr(0, 6) + "]" : "", e === V.STATE_CHANGE ? z("(%s)%s Event: %s (%s)", this.getId(), n, e, t) : e !== V.TIME || this._loggedTime ? e !== V.TIME && z("(%s)%s Event: %s", this.getId(), n, e) : z("(%s)%s Event: %s %dms", this.getId(), n, e, this.currentTime()), this._loggedTime = e === V.TIME
}
function I() {
this._initAudioDefer && this._initAudioDefer.resolve()
}
function R(e) {
return void 0 === U.Errors[e] ? !1 : Array.prototype.slice.call(arguments, 1).some(function(t) {
return 0 === e.indexOf(t)
})
}
function L() {
function e() {
var e = window.navigator.onLine;
z("Navigator `onLine` status is now: " + e), window.setTimeout(function() {
window.navigator.onLine === e && this.trigger(e ? V.ONLINE : V.OFFLINE)
}.bind(this), 500)
}
this._onlineEventsRegistered || (this._onlineEventsRegistered = !0, window.addEventListener("online", e.bind(this)), window.addEventListener("offline", e.bind(this)))
}
function O() {
if (this.hasNoConnection() && this._isPlayRetryQueued) {
var e = Date.now() - this._noConnectionSince;
this._isPlayRetryQueued = !0, e < this.options.retryAfterNoConnectionEventTimeout && this.play({
userInitiated: !1
})
}
}
function F() {
this.hasNoConnection() && !this._userInitiatedPlay && (this._isPlayRetryQueued = !0)
}
function N() {
var e = this.controller;
e && e.getCapabilities().canControlBuffer && e.setMaxBufferLength(this._isPlaying || this._isPlayActionQueued ? this.options.playingMaxBufferLength : this._pausedMaxBufferLength)
}
function B(e, t, n) {
return Math.min(n, Math.max(t, e))
}
var $, U, z, H = n(1),
j = n(6),
W = n(8),
q = n(9),
Y = n(14).Deferred,
V = n(7),
G = n(18),
K = n(10),
X = n(19),
Z = n(20),
Q = n(22),
J = n(12),
ee = n(13),
te = n(23),
ne = {
muted: !1,
volume: 1
},
ie = [],
re = {},
oe = {
soundId: re,
duration: re,
title: null,
registerEndpoint: null,
streamUrlsEndpoint: re,
resourceId: !1,
debug: !1,
asyncFetch: !0,
useSinglePlayer: !0,
pausedMaxBufferLength: 2e3,
playingMaxBufferLength: 9e4,
protocols: [X.PREVIEW, X.HLS, X.HTTP, X.RTMP],
extensions: [G.MP3],
maxBitrate: 1 / 0,
mediaSourceEnabled: !0,
mseFirefox: !0,
mseSafari: !0,
eventLogger: null,
logErrors: !0,
logPerformance: !0,
ajax: null,
retryAfterNoConnectionEventTimeout: 6e4,
fadeOutDurationOnPause: 0,
fadeOutDurationOnConcurrentStreaming: 0,
fadeOutDurationOnFinish: 0,
fadeOutAlgo: te.VolumeAutomator.Algos.EaseInOut,
previewOnly: !1
},
se = 6e3,
ae = 6e3,
le = 400,
ue = 6e4,
ce = 6e3,
de = 3,
he = 3e4;
$ = e.exports = function(e, t) {
if (1 === arguments.length ? t = e : $.setAudioManager(e), !U) throw new Error("SCAudio: AudioManager instance must be set with `SCAudio.setAudioManager()` or passed via the constructor");
this.options = ee.extend({}, oe, t);
var n = Object.keys(this.options).filter(function(e) {
return this.options[e] === re
}, this);
if (n.length) throw new Error("SCAudio: pass into constructor the following options: " + n.join(", "));
Z.prioritizeAndFilter(this.options), this.controller = null, this.streamInfo = null, this._pausedMaxBufferLength = 0, this._userInitiatedPlay = this._registerPlays = !0, this._registerCounts = this._errorRecoveryCounts = 0, this._isPlayActionQueued = this._onlineEventsRegistered = this._usedPrefetchUrls = this._isPlaying = this._isBuffering = this._hasNoConnection = !1, this._initAudioDefer = this._expirationTimeout = this._bufferingTimeout = this._errorRecoveryTime = this._errorRecoveryFlagsResetTimeout = this._storedPosition = this._prevPosition = this._noConnectionSince = null, this.options.debug && (this._loggedTime = !1), this._modelListeners = {}, this._hooksPause = [], this.audioPerfMonitor = new W(this, this.logAudioPerformance.bind(this)), this.audioLogger = new j(this), this.volumeAutomator = new te.VolumeAutomator(this), z = z || q({
enabled: this.options.debug,
buffer: !0,
label: "scaudio"
})
}, ee.extend($.prototype, K, {
constructor: $,
initAudio: function() {
return this._initAudioDefer || (this._initAudioDefer = Y(), f.call(this).done(function(e) {
var t = !0;
this.streamInfo && (t = !1), this.streamInfo = e, t && this.trigger(V.STREAMS), this.controller = a.call(this, e), l.call(this, this.controller, !0), P.call(this, this.controller.getState())
}.bind(this)).fail(function() {
this.trigger(V.NO_STREAMS)
}.bind(this)), this._initAudioDefer.done(function() {
this.trigger(V.CREATED)
}.bind(this))), this._initAudioDefer.promise()
},
enablePreloading: function() {
this._pausedMaxBufferLength = this.options.pausedMaxBufferLength, N.call(this)
},
disablePreloading: function() {
this._pausedMaxBufferLength = 0, N.call(this)
},
updateOptions: function(e) {
ee.extend(this.options, e)
},
registerPlay: function() {
var e = this.options.soundId,
t = this.options.registerEndpoint;
return ie.indexOf(e) > -1 ? !1 : (ie.push(e), window.setTimeout(function() {
var t = ie.indexOf(e);
t > -1 && ie.splice(t, 1)
}, ue), this._registerCounts++, this._registerPlays = !1, this.trigger(V.REGISTERED), t && this.ajax({
type: "POST",
url: ee.result(t),
dataType: "json"
}), !0)
},
toggle: function() {
this[this.isPaused() ? "play" : "pause"]()
},
play: function(e) {
var t;
if (e && null != e.seek) t = e.seek;
else {
if (this.isPlaying()) return;
t = this.currentTime()
}
e = ee.extend({}, e, {
position: t
}), this.trigger(V.PLAY, e), w.call(this, t) || (h.call(this), this._isPlayActionQueued = !0), this.initAudio().done(function() {
this._isPlayActionQueued && (this._storedPosition = null, this.trigger(V.PLAY_START, e), this.controller && this.controller.play(t))
}.bind(this)), x.call(this, !0)
},
pause: function(e) {
x.call(this, !1), this.isPaused() || (e = ee.extend({}, e, {
position: this.currentTime()
}), i.call(this, e) && (this.trigger(V.PAUSE, e), this.callPauseOnController()))
},
callPauseOnController: function() {
this.controller && this.controller.pause()
},
registerHook: function(e, t) {
switch (e) {
case "pause":
this._hooksPause.push(t);
break;
default:
throw new Error("can`t register hook for " + e)
}
},
getListenTime: function() {
return this.audioLogger ? this.audioLogger.getListenTime() : 0
},
dispose: function() {
this.audioLogger = null, this.audioPerfMonitor = null, ee.without(ie, this.options.soundId), window.clearTimeout(this._bufferingTimeout), d.call(this), this.controller && (this.controller.kill(), this.controller = null), delete this.controller, this.trigger(V.DESTROYED), this.off()
},
seek: function(e) {
return this.controller ? e >= ee.result(this.options.duration) ? void p.call(this) : (this.seekTimeEventHandler && this.off(V.TIME, this.seekTimeEventHandler), this.seekTimeEventHandler = ee.after(2, function() {
k.call(this)
}.bind(this)), this.on(V.TIME, this.seekTimeEventHandler), this.trigger(V.SEEK, {
from: this.currentTime(),
to: e
}), this.isPlaying() && !w.call(this, e) ? (h.call(this), void this.play({
seek: e
})) : void this.controller.seek(e)) : void 0
},
seekRelative: function(e) {
if (this.controller) {
var t = B(this.currentTime() + e, 0, this.duration());
this.seek(t)
}
},
currentTime: function() {
return this._storedPosition ? this._storedPosition : this.controller ? this.controller.getCurrentPosition() : 0
},
loadProgress: function() {
var e = 0;
return this.controller && (e = this.controller.getLoadedPosition() / this.controller.getDuration(), e = e >= .99 ? 1 : e), e
},
duration: function() {
return this.controller && this.controller.getDuration() || 0
},
buffered: function() {
return this.controller && this.controller.getLoadedPosition() || 0
},
isPaused: function() {
return !this.isPlaying()
},
isBuffering: function() {
return this._isBuffering
},
isPlaying: function() {
return this._isPlayActionQueued || this._isPlaying
},
isLoading: function() {
return !(!this.controller || this.controller.getState() !== U.States.LOADING)
},
hasNoConnection: function() {
return !!this._hasNoConnection
},
hasStreamInfo: function() {
return !!this.streamInfo
},
isGeoBlocked: function() {
return !!this._isGeoBlocked
},
toggleMute: function(e) {
$.toggleMute(e)
},
isMuted: function() {
return $.isMuted()
},
setVolume: function(e) {
$.setVolume(e)
},
getVolume: function() {
return $.getVolume()
},
logAudioPerformance: function(e) {
this.getEventLogger() && this.options.logPerformance && this.getEventLogger().audioPerformance(e)
},
logAudioError: function(e) {
this.getEventLogger() && this.options.logErrors && this.getEventLogger().audioError(e)
},
getAudioManagerStates: function() {
return U.States
},
getId: function() {
return this.options.resourceId || this.options.soundId
},
getEventLogger: function() {
return this.options.eventLogger
},
registerModelEventListener: function(e, t) {
var n = r(e);
if (this._modelListeners[n]) throw new Error("Data model is already registered (forgot to unregister it or registering twice?)");
this._modelListeners[n] = t = t.bind(this, e), this.on("all", t)
},
unregisterModelEventListener: function(e) {
var t = r(e);
this._modelListeners[t] && (this.off("all", this._modelListeners[t]), delete this._modelListeners[t])
},
ajax: function(e) {
return this.options.ajax ? this.options.ajax(e) : H(e)
},
trigger: function(e, t) {
D.call(this, e, t), K.trigger.call(this, e, t)
}
}), ee.extend($, {
getSettings: function() {
return ne
},
setSettings: function(e) {
ee.extend(ne, e)
},
setAudioManager: o,
setAudioManagerOnce: ee.once(o),
toggleMute: function(e) {
ne.muted = void 0 === e ? !ne.muted : !!e, U && U.setVolume(ne.muted ? 0 : 1)
},
isMuted: function() {
return ne.muted
},
setVolume: function(e) {
ne.volume = void 0 === e ? 1 : e, U && U.setVolume(ne.volume)
},
getVolume: function() {
return ne.volume
},
Extensions: G,
Protocols: X,
Events: V,
FadeOutAlgos: te.VolumeAutomator.Algos,
BUFFER_DELAY: le,
PLAY_REGISTRATION_TIMEOUT: ue
})
}, function(e, t, n) {
var i = n(2).Deferred,
r = 4;
e.exports = function(e) {
var t, n, o, s, a, l, u, c;
e && (o = e.data || null, n = e.url || "", t = e.type || "GET", s = e.dataType || "text", a = e.async, l = e.timeout, u = e.beforeSend || null);
var d = i();
a = a !== !1;
var h = new XMLHttpRequest;
return h.open(t, n, a), a && (h.responseType = "text"), u && u(h), h.onreadystatechange = function() {
if (h.readyState === r)
if (clearTimeout(c), 0 !== h.status && h.status < 400) {
var e = h.responseText;
if ("json" === s) try {
e = JSON.parse(e)
} catch (t) {
return void d.reject(h)
}
d.resolve(e)
} else d.reject(h)
}, null != l && (c = setTimeout(function() {
h.readyState !== r && (h.abort(), d.reject(h))
}, l)), h.send(o), d.promise()
}
}, function(e, t, n) {
e.exports = n(3)
}, function(e, t, n) {
/*!
* jquery-deferred
* Copyright(c) 2011 Hidden <zzdhidden@gmail.com>
* MIT Licensed
*/
var i = e.exports = n(4),
r = Array.prototype.slice;
i.extend({
Deferred: function(e) {
var t = [
["resolve", "done", i.Callbacks("once memory"), "resolved"],
["reject", "fail", i.Callbacks("once memory"), "rejected"],
["notify", "progress", i.Callbacks("memory")]
],
n = "pending",
r = {
state: function() {
return n
},
always: function() {
return o.done(arguments).fail(arguments), this
},
then: function() {
var e = arguments;
return i.Deferred(function(n) {
i.each(t, function(t, r) {
var s = r[0],
a = e[t];
o[r[1]](i.isFunction(a) ? function() {
var e = a.apply(this, arguments);
e && i.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[s + "With"](this === o ? n : this, [e])
} : n[s])
}), e = null
}).promise()
},
promise: function(e) {
return null != e ? i.extend(e, r) : r
}
},
o = {};
return r.pipe = r.then, i.each(t, function(e, i) {
var s = i[2],
a = i[3];
r[i[1]] = s.add, a && s.add(function() {
n = a
}, t[1 ^ e][2].disable, t[2][2].lock), o[i[0]] = s.fire, o[i[0] + "With"] = s.fireWith
}), r.promise(o), e && e.call(o, o), o
},
when: function(e) {
var t, n, o, s = 0,
a = r.call(arguments),
l = a.length,
u = 1 !== l || e && i.isFunction(e.promise) ? l : 0,
c = 1 === u ? e : i.Deferred(),
d = function(e, n, i) {
return function(o) {
n[e] = this, i[e] = arguments.length > 1 ? r.call(arguments) : o, i === t ? c.notifyWith(n, i) : --u || c.resolveWith(n, i)
}
};
if (l > 1)
for (t = new Array(l), n = new Array(l), o = new Array(l); l > s; s++) a[s] && i.isFunction(a[s].promise) ? a[s].promise().done(d(s, o, a)).fail(c.reject).progress(d(s, n, t)) : --u;
return u || c.resolveWith(o, a), c.promise()
}
})
}, function(e, t, n) {
function i(e) {
var t = s[e] = {};
return r.each(e.split(o), function(e, n) {
t[n] = !0
}), t
}
var r = e.exports = n(5),
o = /\s+/,
s = {};
r.Callbacks = function(e) {
e = "string" == typeof e ? s[e] || i(e) : r.extend({}, e);
var t, n, o, a, l, u, c = [],
d = !e.once && [],
h = function(i) {
for (t = e.memory && i, n = !0, u = a || 0, a = 0, l = c.length, o = !0; c && l > u; u++)
if (c[u].apply(i[0], i[1]) === !1 && e.stopOnFalse) {
t = !1;
break
}
o = !1, c && (d ? d.length && h(d.shift()) : t ? c = [] : p.disable())
},
p = {
add: function() {
if (c) {
var n = c.length;
! function i(t) {
r.each(t, function(t, n) {
var o = r.type(n);
"function" === o ? e.unique && p.has(n) || c.push(n) : n && n.length && "string" !== o && i(n)
})
}(arguments), o ? l = c.length : t && (a = n, h(t))
}
return this
},
remove: function() {
return c && r.each(arguments, function(e, t) {
for (var n;
(n = r.inArray(t, c, n)) > -1;) c.splice(n, 1), o && (l >= n && l--, u >= n && u--)
}), this
},
has: function(e) {
return r.inArray(e, c) > -1
},
empty: function() {
return c = [], this
},
disable: function() {
return c = d = t = void 0, this
},
disabled: function() {
return !c
},
lock: function() {
return d = void 0, t || p.disable(), this
},
locked: function() {
return !d
},
fireWith: function(e, t) {
return t = t || [], t = [e, t.slice ? t.slice() : t], !c || n && !d || (o ? d.push(t) : h(t)), this
},
fire: function() {
return p.fireWith(this, arguments), this
},
fired: function() {
return !!n
}
};
return p
}
}, function(e, t) {
function n(e) {
return null == e ? String(e) : c[u.call(e)] || "object"
}
function i(e) {
return "function" === l.type(e)
}
function r(e) {
return "array" === l.type(e)
}
function o(e, t, n) {
var r, o = 0,
s = e.length,
a = void 0 === s || i(e);
if (n)
if (a) {
for (r in e)
if (t.apply(e[r], n) === !1) break
} else
for (; s > o && t.apply(e[o++], n) !== !1;);
else if (a) {
for (r in e)
if (t.call(e[r], r, e[r]) === !1) break
} else
for (; s > o && t.call(e[o], o, e[o++]) !== !1;);
return e
}
function s(e) {
return e && "object" === l.type(e) ? !0 : !1
}
function a() {
var e, t, n, i, r, o, s = arguments[0] || {},
a = 1,
u = arguments.length,
c = !1;
for ("boolean" == typeof s && (c = s, s = arguments[1] || {}, a = 2), "object" == typeof s || l.isFunction(s) || (s = {}), u === a && (s = this, --a); u > a; a++)
if (null != (e = arguments[a]))
for (t in e) n = s[t], i = e[t], s !== i && (c && i && (l.isPlainObject(i) || (r = l.isArray(i))) ? (r ? (r = !1, o = n && l.isArray(n) ? n : []) : o = n && l.isPlainObject(n) ? n : {}, s[t] = l.extend(c, o, i)) : void 0 !== i && (s[t] = i));
return s
}
var l = e.exports = {
type: n,
isArray: r,
isFunction: i,
isPlainObject: s,
each: o,
extend: a,
noop: function() {}
},
u = Object.prototype.toString,
c = {};
"Boolean Number String Function Array Date RegExp Object".split(" ").forEach(function(e) {
c["[object " + e + "]"] = e.toLowerCase()
})
}, function(e, t, n) {
function i(e) {
this.listenTime += e.from - this.currentTime, this.currentTime = e.to
}
function r(e) {
this.listenTime += e.position - this.currentTime, this.currentTime = e.position
}
function o(e) {
this.currentTime = e.position
}
var s, a = n(7);
s = e.exports = function(e) {
this.scAudio = e, this.listenTime = 0, this.currentTime = 0, this.scAudio.on(a.SEEK, i, this).on(a.PLAY_START, o, this).on(a.PAUSE, r, this)
}, s.prototype = {
constructor: s,
getListenTime: function() {
return this.listenTime + this.scAudio.currentTime() - this.currentTime
}
}
}, function(e, t) {
var n = {
CREATED: "created",
STATE_CHANGE: "state-change",
DESTROYED: "destroyed",
PLAY: "play",
PLAY_START: "play-start",
PLAY_RESUME: "play-resume",
METADATA: "metadata",
PAUSE: "pause",
FINISH: "finish",
RESET: "reset",
SEEK: "seek",
SEEKED: "seeked",
GEO_BLOCKED: "geo_blocked",
BUFFERRING_START: "buffering_start",
BUFFERRING_END: "buffering_end",
BUFFERING_START: "buffering_start",
BUFFERING_END: "buffering_end",
FLASH_NOT_LOADED: "flash_not_loaded",
FLASH_BLOCK: "flash_blocked",
FLASH_UNBLOCK: "flash_unblocked",
AUDIO_ERROR: "audio_error",
TIME: "time",
NO_STREAMS: "no_streams",
STREAMS: "streams",
NO_PROTOCOL: "no_protocol",
NO_CONNECTION: "no_connection",
API_FAILURE: "api_failure",
REQUEST_FAILURE: "request_failure",
REGISTERED: "registered",
ONLINE: "online",
OFFLINE: "offline"
};
e.exports = n
}, function(e, t, n) {
function i() {
return this.scAudio.controller ? this.controller ? void v.warn("(%s) Setup was called while it was already initialized (returned with a no-op)", this.scAudio.getId()) : (v("(%s) Initialized", this.scAudio.getId()), this.controller = this.scAudio.controller, this.protocol = this.scAudio.streamInfo.protocol, void(this.host = w.getUrlHost(this.scAudio.streamInfo.url))) : void v.warn("Can´t initialize when controller is null")
}
function r() {
this.controller && (v("(%s) Reset", this.scAudio.getId()), this.controller = this.protocol = this.host = null, this.timeToPlayMeasured = !1)
}
function o(e) {
var t = this.scAudio.getAudioManagerStates();
e === t.LOADING ? this.timeToPlayMeasured && h.call(this) : x.isNull(this.bufferingStartTime) || p.call(this)
}
function s() {
this.metadataLoadStartTime = Date.now()
}
function a() {
return x.isNull(this.metadataLoadStartTime) ? void v.warn("(%s) onMetadataEnd was called without onMetadataStart being called before.", this.scAudio.getId()) : (this.log({
type: "metadata",
latency: Date.now() - this.metadataLoadStartTime
}), void(this.metadataLoadStartTime = null))
}
function l() {
this.playClickTime = Date.now()
}
function u() {
if (!this.timeToPlayMeasured) {
if (x.isNull(this.playClickTime)) return void v.warn("(%s) onPlayResume was called without onPlayStart being called before.", this.scAudio.getId());
this.log({
type: "play",
latency: Date.now() - this.playClickTime
}), this.playClickTime = null, this.timeToPlayMeasured = !0
}
}
function c() {
this.scAudio.isPaused() || (this.seekStartTime = Date.now())
}
function d() {
if (!this.scAudio.isPaused()) {
if (x.isNull(this.seekStartTime)) return void v.warn("(%s) onSeekEnd was called without onSeekStart being called before.", this.scAudio.getId());
this.log({
type: "seek",
latency: Date.now() - this.seekStartTime
}), this.seekStartTime = null
}
}
function h() {
this.bufferingStartTime || (this.bufferingStartTime = Date.now())
}
function p() {
return x.isNull(this.bufferingStartTime) ? void v.warn("(%s) onBufferingEnd was called without onBufferingStart being called before.", this.scAudio.getId()) : (f.call(this), void(this.bufferingStartTime = null))
}
function f() {
x.isNull(this.bufferingStartTime) || (x.isNull(this.bufferingTimeAccumulated) && (this.bufferingTimeAccumulated = 0), this.bufferingTimeAccumulated += Date.now() - this.bufferingStartTime)
}
function g() {
f.call(this), x.isNull(this.bufferingTimeAccumulated) || (this.log({
type: "buffer",
latency: this.bufferingTimeAccumulated
}), this.bufferingStartTime = this.bufferingTimeAccumulated = null)
}
var m, v, _ = n(9),
y = n(7),
b = n(10),
w = n(12),
x = n(13);
m = e.exports = function(e, t) {
this.scAudio = e, this.logFn = t, this.controller = null, this.reset(), v = v || _({
enabled: e.options.debug,
buffer: !0,
label: "audioperf"
}), e.on(y.CREATED, i, this).on(y.RESET, r, this).on(y.DESTROYED, r, this).on(y.SEEK, c, this).on(y.SEEKED, d, this).on(y.PLAY, l, this).on(y.PLAY_START, s, this).on(y.PLAY_RESUME, u, this).on(y.PAUSE, g, this).on(y.FINISH, g, this).on(y.STATE_CHANGE, o, this).on(y.METADATA, a, this)
}, x.extend(m.prototype, b, {
constructor: m,
log: function(e) {
return this.controller ? (x.extend(e, {
protocol: this.protocol,
host: this.host,
playertype: this.controller.getType()
}), v("(%s) event type: %s, latency: %d, protocol: %s, host: %s playertype: %s", this.scAudio.getId(), e.type, e.latency, e.protocol, e.host, e.playertype), void this.logFn(e)) : void v.warn("(%s) Monitor log was called while controller is null (returned with a no-op)", this.scAudio.getId())
},
reset: function() {
this.bufferingStartTime = this.bufferingTimeAccumulated = this.playClickTime = this.seekStartTime = this.metadataLoadStartTime = null, this.timeToPlayMeasured = !1
}
})
}, function(e, t) {
"use strict";
function n() {
function e(e, n) {
if (p) {
for (var i = arguments.length, r = Array(i > 2 ? i - 2 : 0), o = 2; i > o; o++) r[o - 2] = arguments[o];
"string" == typeof n ? n = " " + n : (r.unshift(n), n = "");
var s = [t() + " | " + A + (k ? "%c" : "") + n].concat(E, r);
m ? T.push({
level: e,
logArgs: s
}) > x && T.shift() : h[e].apply(h, s)
}
}
function t() {
var e = new Date,
t = null === S ? 0 : e - S,
n = k ? "%c" : "";
return S = +e, n + i(e) + (n + " (" + n) + r("+" + t + "ms", " ", 8) + (n + ")")
}
function n(e) {
return e.enable = function() {
p = !0
}, e.disable = function() {
p = !1
}, e.bufferOn = function() {
m = !0
}, e.bufferOff = function() {
m = !1, T.length = 0
}, e.flush = u() ? function() {
T.forEach(function(e) {
var t = e.level,
n = e.logArgs;
h[t].apply(h, n)
}), T.length = 0
} : function() {}, e
}
var o = c.apply(void 0, arguments),
s = o.enabled,
p = void 0 === s ? !0 : s,
g = o.buffer,
m = void 0 === g ? !1 : g,
v = o.label,
_ = void 0 === v ? "" : v,
y = o.plainOutput,
b = void 0 === y ? !1 : y,
w = o.bufferSize,
x = void 0 === w ? 1e3 : w;
if (!u()) return n(d.reduce(function(e, t) {
return e[t] = e
}, function() {}));
h.CL || (h.CL = {
_cssCounter: 0
});
var k = !b && l(),
S = null,
T = [],
A = a(_, k),
E = k ? ["color: green", "color: grey", "color: blue", "color: grey", f(_), ""] : [],
C = h.CL[_] = n(d.reduce(function(t, n) {
return t[n] = e.bind(null, n), t
}, e.bind(null, "log")));
return C
}
function i(e) {
return o(e.getHours()) + ":" + o(e.getMinutes()) + ":" + o(e.getSeconds()) + "." + r(e.getMilliseconds(), "0", 3)
}
function r(e, t, n) {
return s(t, n - ("" + e).length) + e
}
function o(e) {
return r(e, "0", 2)
}
function s(e, t) {
return t > 0 ? new Array(t + 1).join(e) : ""
}
function a(e, t) {
return (t ? "%c" : "") + (e ? e : "")
}
function l() {
if ("undefined" == typeof navigator) return !1;
var e = navigator.userAgent;
return /chrome|firefox|opr/i.test(e) && !/msie|edge/i.test(e)
}
function u() {
return h && d.every(function(e) {
return "function" == typeof h[e]
})
}
function c() {
var e = arguments.length <= 0 || void 0 === arguments[0] ? !0 : arguments[0],
t = arguments.length <= 1 || void 0 === arguments[1] ? "" : arguments[1];
return "object" == typeof e && e || {
enabled: e,
label: t
}
}
e.exports = n;
var d = ["log", "info", "warn", "error"],
h = "undefined" != typeof console ? console : null,
p = ["color:#fff", "border-radius:3px", "padding:2px 4px", "font-family:sans-serif", "text-transform:uppercase", "font-size:9px"].join(";") + ";",
f = function() {
var e = ["#51613C", "#447848", "#486E5F", "#787444", "#6E664E"];
return function(t) {
return t ? "background:" + e[h.CL._cssCounter++ % e.length] + ";" + p : ""
}
}()
}, function(e, t, n) {
e.exports = n(11)
}, function(e, t, n) {
! function() {
function n() {
return {
keys: Object.keys || function(e) {
if ("object" != typeof e && "function" != typeof e || null === e) throw new TypeError("keys() called on a non-object");
var t, n = [];
for (t in e) e.hasOwnProperty(t) && (n[n.length] = t);
return n
},
uniqueId: function(e) {
var t = ++a + "";
return e ? e + t : t
},
has: function(e, t) {
return o.call(e, t)
},
each: function(e, t, n) {
if (null != e)
if (r && e.forEach === r) e.forEach(t, n);
else if (e.length === +e.length)
for (var i = 0, o = e.length; o > i; i++) t.call(n, e[i], i, e);
else
for (var s in e) this.has(e, s) && t.call(n, e[s], s, e)
},
once: function(e) {
var t, n = !1;
return function() {
return n ? t : (n = !0, t = e.apply(this, arguments), e = null, t)
}
}
}
}
var i, r = Array.prototype.forEach,
o = Object.prototype.hasOwnProperty,
s = Array.prototype.slice,
a = 0,
l = n();
i = {
on: function(e, t, n) {
if (!c(this, "on", e, [t, n]) || !t) return this;
this._events || (this._events = {});
var i = this._events[e] || (this._events[e] = []);
return i.push({
callback: t,
context: n,
ctx: n || this
}), this
},
once: function(e, t, n) {
if (!c(this, "once", e, [t, n]) || !t) return this;
var i = this,
r = l.once(function() {
i.off(e, r), t.apply(this, arguments)
});
return r._callback = t, this.on(e, r, n)
},
off: function(e, t, n) {
var i, r, o, s, a, u, d, h;
if (!this._events || !c(this, "off", e, [t, n])) return this;
if (!e && !t && !n) return this._events = {}, this;
for (s = e ? [e] : l.keys(this._events), a = 0, u = s.length; u > a; a++)
if (e = s[a], o = this._events[e]) {
if (this._events[e] = i = [], t || n)
for (d = 0, h = o.length; h > d; d++) r = o[d], (t && t !== r.callback && t !== r.callback._callback || n && n !== r.context) && i.push(r);
i.length || delete this._events[e]
}
return this
},
trigger: function(e) {
if (!this._events) return this;
var t = s.call(arguments, 1);
if (!c(this, "trigger", e, t)) return this;
var n = this._events[e],
i = this._events.all;
return n && d(n, t), i && d(i, arguments), this
},
stopListening: function(e, t, n) {
var i = this._listeners;
if (!i) return this;
var r = !t && !n;
"object" == typeof t && (n = this), e && ((i = {})[e._listenerId] = e);
for (var o in i) i[o].off(t, n, this), r && delete this._listeners[o];
return this
}
};
var u = /\s+/,
c = function(e, t, n, i) {
if (!n) return !0;
if ("object" == typeof n) {
for (var r in n) e[t].apply(e, [r, n[r]].concat(i));
return !1
}
if (u.test(n)) {
for (var o = n.split(u), s = 0, a = o.length; a > s; s++) e[t].apply(e, [o[s]].concat(i));
return !1
}
return !0
},
d = function(e, t) {
var n, i = -1,
r = e.length,
o = t[0],
s = t[1],
a = t[2];
switch (t.length) {
case 0:
for (; ++i < r;)(n = e[i]).callback.call(n.ctx);
return;
case 1:
for (; ++i < r;)(n = e[i]).callback.call(n.ctx, o);
return;
case 2:
for (; ++i < r;)(n = e[i]).callback.call(n.ctx, o, s);
return;
case 3:
for (; ++i < r;)(n = e[i]).callback.call(n.ctx, o, s, a);
return;
default:
for (; ++i < r;)(n = e[i]).callback.apply(n.ctx, t)
}
},
h = {
listenTo: "on",
listenToOnce: "once"
};
l.each(h, function(e, t) {
i[t] = function(t, n, i) {
var r = this._listeners || (this._listeners = {}),
o = t._listenerId || (t._listenerId = l.uniqueId("l"));
return r[o] = t, "object" == typeof n && (i = this), t[e](n, i, this), this
}
}), i.bind = i.on, i.unbind = i.off, i.mixin = function(e) {
var t = ["on", "once", "off", "trigger", "stopListening", "listenTo", "listenToOnce", "bind", "unbind"];
return l.each(t, function(t) {
e[t] = this[t]
}, this), e
}, "undefined" != typeof e && e.exports && (t = e.exports = i), t.BackboneEvents = i
}(this)
}, function(e, t) {
var n = {
getUrlParams: function(e) {
var t = {},
n = e.indexOf("?");
return n > -1 && e.substr(n + 1).split("&").forEach(function(e) {
var n = e.split("=");
t[n[0]] = n[1]
}), t
},
getUrlHost: function(e) {
var t, n = e.split("//");
return t = n[0] === e ? n[0].split("/")[0] : n[1] ? n[1].split("/")[0] : ""
}
};
e.exports = n
}, function(e, t) {
function n() {
function e(e) {
r.push(e), a.postMessage(o, "*")
}
function t(e) {
e.data === o && (e.stopPropagation(), r.length > 0 && r.shift()())
}
var n = window,
i = n.document;
if (!n.postMessage) return function(e) {
n.setTimeout(e, 0)
};
var r = [],
o = "zero-timeout-message-" + Math.random(),
s = i.createElement("iframe");
s.style.display = "none", s.src = "", i.documentElement.appendChild(s);
var a = s.contentWindow,
l = a.document;
return l.open(), l.write(""), l.close(), a.addEventListener("message", t, !0), e
}
var i = {
extend: function(e) {
var t = Array.prototype.slice.call(arguments, 1);
return t.forEach(function(t) {
if (t)
for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n])
}), e
},
each: function(e, t, n) {
Object.keys(e).forEach(function(i) {
t.call(n || null, e[i], i)
})
},
without: function(e, t) {
var n = e.indexOf(t);
n > -1 && e.splice(n, 1)
},
result: function(e) {
var t = e;
return i.isFunction(t) && (t = e()), t
},
isFunction: function(e) {
return "function" == typeof e
},
after: function(e, t) {
return function() {
return --e < 1 ? t.apply(this, arguments) : void 0
}
},
isNull: function(e) {
return null === e
},
once: function(e) {
var t, n = !1;
return function() {
return n ? t : (n = !0, void(t = e.apply(this, arguments)))
}
},
setImmediate: function() {
var e;
return function(t) {
e || (e = n()), e(t)
}
}()
};
e.exports = i
}, function(e, t, n) {
e.exports = n(15)
}, function(e, t, n) {
/*!
* jquery-deferred
* Copyright(c) 2011 Hidden <zzdhidden@gmail.com>
* MIT Licensed
*/
var i = e.exports = n(16),
r = Array.prototype.slice;
i.extend({
Deferred: function(e) {
var t = [
["resolve", "done", i.Callbacks("once memory"), "resolved"],
["reject", "fail", i.Callbacks("once memory"), "rejected"],
["notify", "progress", i.Callbacks("memory")]
],
n = "pending",
r = {
state: function() {
return n
},
always: function() {
return o.done(arguments).fail(arguments), this
},
then: function() {
var e = arguments;
return i.Deferred(function(n) {
i.each(t, function(t, r) {
var s = r[0],
a = e[t];
o[r[1]](i.isFunction(a) ? function() {
var e = a.apply(this, arguments);
e && i.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[s + "With"](this === o ? n : this, [e])
} : n[s])
}), e = null
}).promise()
},
promise: function(e) {
return null != e ? i.extend(e, r) : r
}
},
o = {};
return r.pipe = r.then, i.each(t, function(e, i) {
var s = i[2],
a = i[3];
r[i[1]] = s.add, a && s.add(function() {
n = a
}, t[1 ^ e][2].disable, t[2][2].lock), o[i[0]] = s.fire, o[i[0] + "With"] = s.fireWith
}), r.promise(o), e && e.call(o, o), o
},
when: function(e) {
var t, n, o, s = 0,
a = r.call(arguments),
l = a.length,
u = 1 !== l || e && i.isFunction(e.promise) ? l : 0,
c = 1 === u ? e : i.Deferred(),
d = function(e, n, i) {
return function(o) {
n[e] = this, i[e] = arguments.length > 1 ? r.call(arguments) : o, i === t ? c.notifyWith(n, i) : --u || c.resolveWith(n, i)
}
};
if (l > 1)
for (t = new Array(l), n = new Array(l), o = new Array(l); l > s; s++) a[s] && i.isFunction(a[s].promise) ? a[s].promise().done(d(s, o, a)).fail(c.reject).progress(d(s, n, t)) : --u;
return u || c.resolveWith(o, a), c.promise()
}
})
}, function(e, t, n) {
function i(e) {
var t = s[e] = {};
return r.each(e.split(o), function(e, n) {
t[n] = !0
}), t
}
var r = e.exports = n(17),
o = /\s+/,
s = {};
r.Callbacks = function(e) {
e = "string" == typeof e ? s[e] || i(e) : r.extend({}, e);
var t, n, o, a, l, u, c = [],
d = !e.once && [],
h = function(i) {
for (t = e.memory && i, n = !0, u = a || 0, a = 0, l = c.length, o = !0; c && l > u; u++)
if (c[u].apply(i[0], i[1]) === !1 && e.stopOnFalse) {
t = !1;
break
}
o = !1, c && (d ? d.length && h(d.shift()) : t ? c = [] : p.disable())
},
p = {
add: function() {
if (c) {
var n = c.length;
! function i(t) {
r.each(t, function(t, n) {
var o = r.type(n);
"function" === o ? e.unique && p.has(n) || c.push(n) : n && n.length && "string" !== o && i(n)
})
}(arguments), o ? l = c.length : t && (a = n, h(t))
}
return this
},
remove: function() {
return c && r.each(arguments, function(e, t) {
for (var n;
(n = r.inArray(t, c, n)) > -1;) c.splice(n, 1), o && (l >= n && l--, u >= n && u--)
}), this
},
has: function(e) {
return r.inArray(e, c) > -1
},
empty: function() {
return c = [], this
},
disable: function() {
return c = d = t = void 0, this
},
disabled: function() {
return !c
},
lock: function() {
return d = void 0, t || p.disable(), this
},
locked: function() {
return !d
},
fireWith: function(e, t) {
return t = t || [], t = [e, t.slice ? t.slice() : t], !c || n && !d || (o ? d.push(t) : h(t)), this
},
fire: function() {
return p.fireWith(this, arguments), this
},
fired: function() {
return !!n
}
};
return p
}
}, function(e, t) {
function n(e) {
return null == e ? String(e) : c[u.call(e)] || "object"
}
function i(e) {
return "function" === l.type(e)
}
function r(e) {
return "array" === l.type(e)
}
function o(e, t, n) {
var r, o = 0,
s = e.length,
a = void 0 === s || i(e);
if (n)
if (a) {
for (r in e)
if (t.apply(e[r], n) === !1) break
} else
for (; s > o && t.apply(e[o++], n) !== !1;);
else if (a) {
for (r in e)
if (t.call(e[r], r, e[r]) === !1) break
} else
for (; s > o && t.call(e[o], o, e[o++]) !== !1;);
return e
}
function s(e) {
return e && "object" === l.type(e) ? !0 : !1
}
function a() {
var e, t, n, i, r, o, s = arguments[0] || {},
a = 1,
u = arguments.length,
c = !1;
for ("boolean" == typeof s && (c = s, s = arguments[1] || {}, a = 2), "object" == typeof s || l.isFunction(s) || (s = {}), u === a && (s = this, --a); u > a; a++)
if (null != (e = arguments[a]))
for (t in e) n = s[t], i = e[t], s !== i && (c && i && (l.isPlainObject(i) || (r = l.isArray(i))) ? (r ? (r = !1, o = n && l.isArray(n) ? n : []) : o = n && l.isPlainObject(n) ? n : {}, s[t] = l.extend(c, o, i)) : void 0 !== i && (s[t] = i));
return s
}
var l = e.exports = {
type: n,
isArray: r,
isFunction: i,
isPlainObject: s,
each: o,
extend: a,
noop: function() {}
},
u = Object.prototype.toString,
c = {};
"Boolean Number String Function Array Date RegExp Object".split(" ").forEach(function(e) {
c["[object " + e + "]"] = e.toLowerCase()
})
}, function(e, t) {
var n = {
AAC: "aac",
MP3: "mp3",
OGG: "ogg",
OPUS: "opus",
WAV: "wav"
};
e.exports = n
}, function(e, t) {
var n = {
HTTP: "http",
RTMP: "rtmp",
HLS: "hls",
PREVIEW: "preview"
};
e.exports = n
}, function(e, t, n) {
function i(e) {
return u.supportsMediaSourceExtensions() && e.mediaSourceEnabled && (u.isChrome() && u.getChromeVersion() >= 35 || u.isFirefox() && e.mseFirefox || u.isSafari() && e.mseSafari)
}
function r(e) {
return function(t) {
var n = !1;
switch (t) {
case l.PREVIEW:
n = e.previewOnly && u.supportsHTML5Audio();
break;
case l.RTMP:
n = u.supportsFlash();
break;
case l.HTTP:
n = u.supportsHTML5Audio() || u.supportsFlash();
break;
case l.HLS:
n = i(e)
}
return n
}
}
function o(e) {
return e
}
function s(e) {
e.protocols = o(e.protocols).filter(r(e))
}
var a, l = n(19),
u = n(21);
a = {
prioritizeAndFilter: s
}, e.exports = a
}, function(e, t) {
function n(e) {
return e.test(window.navigator.userAgent.toLowerCase())
}
function i(e, t) {
try {
return window.navigator.userAgent.toLowerCase().match(e)[t]
} catch (n) {
return null
}
}
function r() {
try {
return parseInt(i(/chrom(e|ium)\/([0-9]+)\./, 2), 10)
} catch (e) {
return NaN
}
}
function o() {
return !d() && !u() && n(/safari/)
}
function s() {
return o() && n(/version\/7\.1/)
}
function a() {
return o() && n(/version\/8/) && !n(/version\/80/)
}
function l() {
return o() && n(/version\/9\./)
}
function u() {
return !d() && n(/chrom(e|ium)/)
}
function c() {
return n(/firefox/)
}
function d() {
return n(/edge/)
}
function h() {
return d() && n(/windows\snt/)
}
function p() {
return d() && n(/windows\sphone/)
}
function f() {
return !!window.MediaSource && (window.MediaSource.isTypeSupported("audio/mpeg") || window.MediaSource.isTypeSupported("audio/mp4"))
}
function g() {
try {
return window.hasOwnProperty("Audio") && !!(new window.Audio).canPlayType("audio/mpeg")
} catch (e) {
return !1
}
}
function m() {
try {
var e = o() && n(/version\/5\.0/),
t = window.hasOwnProperty("Audio") && (!!(new window.Audio).canPlayType('audio/x-mpegURL; codecs="mp3"') || !!(new window.Audio).canPlayType('vnd.apple.mpegURL; codecs="mp3"'));
return !e && t
} catch (i) {
return !1
}
}
function v() {
return y(_()) >= w
}
function _() {
var e, t, n, i;
if ("undefined" != typeof window.ActiveXObject) try {
i = new window.ActiveXObject("ShockwaveFlash.ShockwaveFlash"), i && (e = i.GetVariable("$version"))
} catch (r) {
e = null
} else window.navigator && window.navigator.plugins && window.navigator.plugins.length > 0 && (n = "application/x-shockwave-flash", t = window.navigator.mimeTypes, t && t[n] && t[n].enabledPlugin && t[n].enabledPlugin.description && (e = t[n].enabledPlugin.description));
return e
}
function y(e) {
var t;
if (!e || !(t = e.match(/\d\S+/))) return 0;
var n = t[0].replace(/,/g, ".").split(".");
return parseFloat([n[0], n[1] || "0"].join(".")) || 0
}
var b, w = 9;
b = {
flashPlugin: _,
isSafari: o,
isSafari71: s,
isSafari8: a,
isSafari9: l,
isChrome: u,
getChromeVersion: r,
isFirefox: c,
isEdge: d,
isEdgeDesktop: h,
isEdgeMobile: p,
supportsNativeHLSAudio: m,
supportsHTML5Audio: g,
supportsFlash: v,
supportsMediaSourceExtensions: f
}, e.exports = b
}, function(e, t, n) {
function i(e) {
var t = h.getUrlHost(e);
return f.every(function(e) {
return 0 !== t.indexOf(e)
})
}
function r(e, t) {
return !(e === c.HLS && !i(t))
}
function o(e, t) {
if (!e) return !1;
var n = e.issuedAt + s(e.protocol, e.duration);
return a(e.protocol) ? Date.now() + e.duration - (t || 0) < n : Date.now() < n
}
function s(e, t) {
var n = a(e);
return g + (n ? d.result(t) : 0)
}
function a(e) {
return e === c.HTTP || e === c.HLS
}
function l(e, t) {
function n(e) {
return -1 * e
}
function i(e, t) {
return Math.abs(t - v) - Math.abs(e - v)
}
var o, s, a, l, u, c, h, p, f, g, m = {},
v = t.maxBitrate,
_ = t.protocols,
y = t.extensions;
for (d.each(e, function(e, t) {
var n = t.split("_"),
i = n[0],
r = n[1],
o = n[2];
m[i] = m[i] || {}, m[i][r] = m[i][r] || {}, m[i][r][o] = e
}), u = 0, c = _.length; c > u; ++u)
for (l = _[u], p = 0, f = y.length; f > p; ++p)
if (h = y[p], m[l] && m[l][h]) {
if (o = Object.keys(m[l][h]).map(Number).sort(n), s = v === 1 / 0, a = v === -(1 / 0), v = s || a ? o[s ? "pop" : "shift"]() : o.sort(i).pop(), g = m[l][h][v], !r(l, g)) continue;
return {
url: g,
bitrate: v,
protocol: l,
extension: h,
issuedAt: Date.now(),
duration: d.result(t.duration)
}
}
return null
}
var u, c = n(19),
d = n(13),
h = n(12),
p = .9,
f = [],
g = Math.floor(12e4 * p);
u = {
choosePreferredStream: l,
streamValidForPlayingFrom: o
}, e.exports = u
}, function(e, t, n) {
var i, r, o = n(7),
s = n(13),
a = s.extend,
l = s.setImmediate,
u = {
Linear: 0,
EaseIn: 1,
EaseOut: 2,
EaseInOut: 3
};
e.exports = i = {}, i.VolumeAutomator = r = function(e) {
if (this.scAudio = e, this.fadeOutAlgo = this.options().fadeOutAlgo, this.fadeOutActive = !1, this.initialVolume = void 0, r.isSupported()) {
var t = this.options();
["fadeOutDurationOnPause", "fadeOutDurationOnFinish", "fadeOutDurationOnConcurrentStreaming"].forEach(function(e) {
"number" != typeof t[e] && (t[e] = 0)
}), this.scAudio.registerHook("pause", this.hookPause.bind(this)), this.scAudio.on(o.TIME, this.onTime, this), this.scAudio.on(o.PLAY_RESUME, this.onPlay, this)
}
}, i.VolumeAutomator.isSupported = function() {
var e = new window.Audio,
t = e.volume,
n = 0 === t ? 1 : t / 2;
return e.volume = n, e.volume === n
}, i.VolumeAutomator.Algos = u, a(r.prototype, {
options: function() {
return this.scAudio.options
},
doFadeOut: function(e, t, n, i) {
this.fadeOutActive = !0;
var r = Date.now() - (n || 0),
s = function() {
if (this.fadeOutActive) {
var n, a = (Date.now() - r) / t;
if (a >= 1) e && (this.scAudio.trigger(o.PAUSE, i), this.scAudio.callPauseOnController()), this.cancelFadeout();
else {
switch (this.fadeOutAlgo) {
case u.Linear:
n = 1 - a;
break;
case u.EaseIn:
n = 1 - a * a;
break;
case u.EaseOut:
n = 1 / (10 * (a + .1)) - .05;
break;
case u.EaseInOut:
default:
n = Math.cos(a * Math.PI) / 2 + .5
}
this.scAudio.setVolume(this.initialVolume * n), l(s)
}
}
}.bind(this);
this.initialVolume = this.scAudio.getVolume(), s()
},
cancelFadeout: function() {
this.fadeOutActive && (this.fadeOutActive = !1, this.scAudio.setVolume(this.initialVolume), this.initialVolume = void 0)
},
isFadeOutEnabled: function() {
return this.options().fadeOutDurationOnConcurrentStreaming || this.options().fadeOutDurationOnPause || this.options().fadeOutDurationOnFinish
},
hookPause: function(e) {
return this.options().fadeOutDurationOnConcurrentStreaming && "concurrent_streaming" === e.pause_reason ? (this.doFadeOut(!0, this.options().fadeOutDurationOnConcurrentStreaming, 0, e), !1) : this.options().fadeOutDurationOnPause ? (this.doFadeOut(!0, this.options().fadeOutDurationOnPause, 0, e), !1) : !0
},
onPlay: function() {
this.isFadeOutEnabled() && this.cancelFadeout()
},
onTime: function() {
if (this.options().fadeOutDurationOnFinish) {
var e = this.scAudio.currentTime(),
t = this.scAudio.duration(),
n = this.options().fadeOutDurationOnFinish;
!this.fadeOutActive && e + n >= t && this.doFadeOut(!1, n, e + n - t, {})
}
}
})
}])
},
286: function(e, t, n) {
"use strict";
function i(e) {
var t = e.state,
n = e.object;
t && !this.contains(n) && this.onCommentCreated(n)
}
var r = [{
emitter: n(74),
event: "comment",
getInstance: function(e, t) {
var n = t.target;
return e.options.sound_id === n
},
handler: i
}];
e.exports = n(72).extend(n(199).withOptions({
events: r
}), {
model: n(107),
defaults: {
sound_id: null,
secret_token: null
},
soundDuration: null,
setup: function(e) {
var t = e.sound_id,
i = new(n(65))({
id: t
});
this.options.secret_token = i.get("secret_token"), this.soundDuration = i.duration(), i.release()
},
baseUrl: function() {
return this.getEndpointUrl("trackComments", {
id: this.options.sound_id
}, {
filter_replies: 0
})
},
parse: function(e) {
var t = this,
n = /^http:/;
return e.collection.map(function(e) {
return e.timestamp = t.normalizeTimestamp(e.timestamp), n.test(e.user.avatar_url) && (e.user.avatar_url = e.user.avatar_url.replace(n, "https:")), e
})
},
normalizeTimestamp: function(e) {
return (e > this.soundDuration || 0 > e) && (e = n(107).EMPTY_TIMESTAMP), e
},
onCommentCreated: function(e) {
this.add(e, {
at: 0
})
}
}, {
hashFn: function(e, t) {
return t && t.sound_id || null
}
})
},
287: function(e, t, n) {
"use strict";
function i() {
var e = n(55).get("experiments").get("v2_listening", /^reco-ss-/);
return e || null
}
function r(e) {
return e.resource_type = "playlist" === e.kind ? "playlist" : "sound", e
}
var o = Math.floor(1e8 * Math.random());
e.exports = n(72).extend(n(121), {
model: n(75),
audioSourceVersion: null,
queryUrn: null,
defaults: {
resource_id: null,
resource_type: null
},
getSourceInfo: function() {
return {
type: "recommender",
queryUrn: this.queryUrn,
version: this.audioSourceVersion,
resourceId: this.options.resource_id,
resourceType: this.options.resource_type
}
},
parse: function(e) {
var t = e.query_urn,
n = e.collection,
i = e.variant;
return this.audioSourceVersion = i || "no_version", this.queryUrn = t, n.map(r)
},
baseUrl: function() {
var e = n(55).get("me").id || null;
return this.getEndpointUrl("relatedSounds", {
track_id: this.options.resource_id
}, {
user_id: e,
anon_user_id: e ? null : o,
variant: i()
})
}
}, {
hashFn: function(e, t) {
var n = t.resource_id;
return n
}
})
},
288: function(e, t, n) {
"use strict";
function i(e) {
var t = e.premium_content,
n = t || {
collection: [],
total_results: 0
};
return {
count: n.total_results,
records: n.collection.map(function(e) {
return {
kind: "track",
origin: e,
campaign: "high_tier"
}
})
}
}
function r(e) {
var t = e.promoted_content;
return t ? {
count: 1,
records: [s(t)]
} : {
count: 0,
records: []
}
}
function o(e) {
var t = e.collection || [],
i = e.total_results,
r = n(3).compact(t),
o = r.length < t.length ? i - (t.length - r.length) : i;
return {
count: o,
records: r.map(function(e) {
return {
kind: e.kind,
origin: e,
campaign: null
}
})
}
}
function s(e) {
var t = e.promoted,
n = u[e.type];
return n ? {
ad_urn: t.ad_urn,
campaign: "promoted",
kind: n,
origin: e[n],
tracking: t.tracking
} : (window.console.warn("Unknown promoted type:", e.type), null)
}
var a = {
sounds: "tracks",
high_tier: "tracks",
sets: "playlists",
playlists: "playlists_without_albums",
albums: "albums",
people: "users",
universal: "universal"
},
l = new(n(104))("promoted-persistent"),
u = {
"user-promoted": "user",
"track-promoted": "track"
};
e.exports = n(72).extend(n(121), {
model: n(567),
facetName: null,
facets: null,
totalResults: null,
queryUrn: null,
setup: function(e) {
var t = e.params,
n = (t && t.q || "").trim();
this.facets = [], 0 === n.length && this.setToFullyPopulated()
},
getSourceInfo: function() {
return {
type: "search",
queryUrn: this.getCurrentQueryUrn()
}
},
baseUrl: function() {
var e = this.options,
t = e.category,
i = e.params;
switch (i = n(3).assign({
q: "",
sc_a_id: l.get("sc_a_id")
}, i), t) {
case "high_tier":
i["filter.content_tier"] = "SUB_HIGH_TIER";
case "sounds":
case "sets":
case "albums":
case "playlists":
this.facetName = "genre";
break;
case "people":
this.facetName = "place";
break;
default:
this.facetName = "model"
}
return i.facet = this.facetName, i.user_id = n(169).getAnonymousId(), t ? this.getEndpointUrl("searchCategory", {
category: a[t]
}, i) : this.getEndpointUrl("search", {}, i)
},
getTotalResults: function() {
return this.totalResults || 0
},
getTotalPremiumResults: function() {
return this.premiumTotalResults || 0
},
getFacetByName: function(e) {
var t = n(3).findWhere(this.facets, {
name: e
});
return t ? t.facets : []
},
getCurrentFacet: function() {
return this.getFacetByName(this.facetName)
},
parse: function(e) {
var t = i(e),
s = r(e),
a = o(e);
return this.totalResults = a.count, this.premiumTotalResults = t.count, this.queryUrn = e.query_urn, this.facets = e.facets || [], this.trigger("change:facet_counts"), n(3).flatten([t.records, s.records, a.records])
},
audibleAt: function(e) {
var t = this.at(e);
return t && t.getAudible()
},
couldContainSounds: function() {
var e = this.options.category;
return "people" !== e
},
modelToGroupKey: function(e) {
return "high_tier" === this.options.category ? "high_tier" : "high_tier" === e.get("campaign") ? "high_tier" : "free_tier"
},
getCurrentQueryUrn: function() {
return this.queryUrn
}
}, {
hashFn: function(e, t) {
return ["search", t.category || "universal", n(63).stringify({
query: t.params
})].join("_")
}
})
},
289: function(e, t, n) {
"use strict";
function i(e) {
var t = e.state,
n = e.target,
i = void 0;
t ? this.add({
id: n
}, {
at: 0
}) : (i = this.get(n)) && this.remove(i)
}
var r = [{
emitter: n(74),
event: "follow",
getInstance: function(e, t) {
var n = t.origin;
return e.options.userId === n
},
handler: i
}],
o = e.exports = n(150).extend(n(199).withOptions({
events: r
}), {
model: n(61),
defaults: {
limit: 3,
type: "followings"
},
baseUrl: function() {
return this.getEndpointUrl("userFollowings", {
id: this.options.userId
})
}
});
n(333).applyTo(o, {
fields: ["username", "full_name"]
})
},
290: function(e, t, n) {
"use strict";
function i(e) {
var t, i = e.state,
r = e.origin,
o = e.target,
s = e.targetType;
i && this.acceptsType(s) ? this.add(n(457).getLikeModelData(r, s, o), {
at: 0
}) : (t = this.find(function(e) {
var t = "sound" === s ? e.get("track") : "playlist" === s ? e.get("playlist") : null;
return t && o === t.id
}), t && this.remove(t))
}
var r = [{
emitter: n(74),
event: "like",
getInstance: function(e, t) {
var n = t.origin;
return e.options.userId === n
},
handler: i
}];
e.exports = n(150).extend(n(1297), n(199).withOptions({
events: r
}), {
model: n(457),
defaults: {
type: "likes"
},
baseUrl: function() {
return this.getEndpointUrl("userLikes", {
id: this.options.userId
})
},
unshuffle: function(e) {
return -Date.parse(e.get("created_at"))
},
parse: function(e) {
var t = this.options.userId;
return e.collection.forEach(function(e) {
e.user_id = t
}), e.collection
},
audibleAt: function(e) {
var t = this.at(e);
return t && t.getAudible()
},
acceptsType: function(e) {
return "sound" === e || "playlist" === e
}
})
},
305: function(e, t, n) {
"use strict";
var i = e.exports = n(66).extend({
resource_type: "user_stream_item",
submodelMap: {
track: null,
playlist: null
},
baseUrl: null,
audible: null,
createSubmodel: function(e, t) {
var i, r = n("track" === t ? 65 : 84),
o = this.get(t);
o && (i = new r(o), this.addSubmodel(i), this.listenTo(i, "destroy", this.onSubmodelDestroy), this.audible = i)
},
onSubmodelDestroy: function() {
this.destroy()
},
equivalentTo: function(e) {
if (this === e) return !0;
var t = this.get("track") || this.get("playlist"),
n = e.get("track") || e.get("playlist") || e.attributes;
return t.kind === n.kind && t.id === n.id
},
getAudible: function() {
return this.audible
},
getActionType: function() {
return this.isRepost() ? "repost" : this.isLike() ? "like" : "post"
},
isSpotlight: function() {
return this.get("type").indexOf("_spotlight") > -1
},
isRepost: function() {
return /[_-]repost$/.test(this.get("type"))
},
isLike: function() {
return /[_-]like$/.test(this.get("type"))
},
isRegular: function() {
return !this.isRepost() && !this.isLike() && !this.isSpotlight()
},
toggleSpotlight: function(e) {
this.isRepost() || this.isLike() || (void 0 === e && (e = !this.isSpotlight()), this.set("type", this.get("type").replace(e ? /$/ : /_spotlight$/, e ? "_spotlight" : "")))
},
getModelData: function() {
return this.get("track") || this.get("playlist")
}
}, {
convert: function(e) {
var t = e instanceof n(65),
r = e.toJSON();
return new i({
type: r.kind,
created_at: r.created_at,
track: t ? r : null,
playlist: t ? null : r
})
}
})
},
314: function(e, t, n) {
var i = n(3),
r = n(20);
e.exports = function(e) {
var t, n;
return t = i.defaults(e.hash, {
href: null,
className: null,
label: null,
type: null
}), n = '<<%-tag%> class="<%-className%>"' + (t.href ? ' href="<%-href%>" target="blank"' : "") + "><%-label%></<%-tag%>>", new r.SafeString(i.template(n)({
tag: t.href ? "a" : "span",
className: ("sc-label sc-label-small sc-label-" + t.type + " " + t.className).trim(),
label: t.label,
href: t.href
}))
}
},
315: function(e, t, n) {
var i = n(3),
r = n(52),
o = n(314);
e.exports = function(e) {
var t = r.t("Private", null, {
comment: "This is a track label. If track is private it has small tag `Private`"
}),
n = i.defaults({
type: "private",
label: t
}, e.hash);
return o({
hash: n
})
}
},
316: function(e, t, n) {
"use strict";
e.exports = n(72).extend({
model: n(165),
lastFetchTime: Date.now(),
next_href: !1
}, {
neverRelease: !0,
hashFn: function() {
return 1
}
})
},
317: function(e, t, n) {
"use strict";
function i(e, t, i) {
var r = n(889).instances.get(i.id),
o = new a;
r && r.add(i.last_message), o.add(i, {
userAction: !0,
merge: !0
});
var l = n(159).instances.get(i.id);
l && l.markAsRead(), n(57).trigger("new-message:sent", {
recipient: e,
showSuccessMessage: t
}), s(["messages", "new-message-sent"])
}
function r(e, t) {
var i = t.responseText,
r = function(e) {
return i.indexOf(e) > -1
},
o = i ? r("confirmed their address") ? "emailnotconfirmed" : r("sender must be followed") ? "privacy" : r("receiver blocked sender") ? "youareblocked" : r("rate limit") ? "ratelimit" : r("receiver does not exist") ? "receiverdoesntexist" : "default" : "default";
n(57).trigger("new-message:failed", {
errorCode: o,
recipient: e
})
}
function o(e) {
var t = this;
e.forEach(function(e) {
t.get(e) || t.add({
id: e
}, {
at: 0
})
}), this.trigger("new-conversations-added")
}
var s = n(59).trackV0Click,
a = e.exports = n(72).extend({
model: n(159),
currentConversationId: null,
baseUrl: n(294).baseUrl,
setup: function() {
this.listenTo(n(57), "new-unread-messages", o).listenTo(this, "change:last_message", this.sort)
},
getCurrentConversationId: function() {
return this.currentConversationId
},
fetch: function(e) {
var t = this;
return n(72).prototype.fetch.apply(this, arguments).done(function() {
e && e.reset && t.trigger("new-conversations-added")
})
},
setCurrentConversationId: function(e) {
e !== this.currentConversationId && (this.currentConversationId = e, this.trigger("change:currentConversationId", {
currentConversationId: e
}))
},
comparator: function(e, t) {
return t.lastMessageSentAt() - e.lastMessageSentAt()
}
}, {
hashFn: function() {
return 1
},
neverRelease: !0,
send: function(e, t, o) {
return n(294).post(e.id, t).done(i.bind(this, e, o)).fail(r.bind(this, e))
}
})
},
318: function(e, t, n) {
"use strict";
var i = {
user: {
playlists: "userPlaylists",
playlists_without_albums: "userPlaylistsWithoutAlbums",
albums: "userAlbums"
},
sound: {
playlists: "playlistsForTrack",
playlists_without_albums: "playlistsWithoutAlbumsForTrack",
albums: "albumsForTrack"
}
},
r = (e.exports = n(132).extend({
model: n(84),
defaults: {
resource_id: null,
playlists_for: null,
exclude: null,
playlistType: "playlists"
},
setupSources: function() {
var e = this.options.exclude;
return e && (this.filters = [function(t) {
return t.id !== e
}]), [new r(null, this.options)]
}
}, {
hashFn: function(e, t) {
var n = r.hashFn.apply(this, arguments);
return t.exclude && (n += "_" + t.exclude), n
}
}), n(72).extend({
model: n(84),
parse: function(e) {
return e.collection.forEach(function(e) {
null === e.tracks && delete e.tracks
}), e.collection
},
baseUrl: function() {
var e, t = this.options,
n = t.playlists_for,
r = t.resource_id,
o = t.playlistType,
s = {
representation: "mini"
},
a = (e = {}, e["user" === n ? "id" : "trackId"] = r, e);
return this.getEndpointUrl(i[n][o], a, s)
}
}, {
hashFn: function(e, t) {
var n = t.playlists_for,
i = t.resource_id,
r = t.limit,
o = t.offset,
s = t.playlistType;
return n + "_" + i + "_" + r + "_" + o + "_" + s
}
}))
},
319: function(e, t, n) {
"use strict";
function i(e) {
var t = e.context;
if (t) {
var i = n(3).findIndex(this.models, function(e) {
return e.get("context_urn") === t.resourceUrn
});
0 !== i && (i > 0 && this.remove(this.at(i)), this.add(r(t), {
at: 0
}))
}
}
function r(e) {
var t, i = e.resourceId,
r = e.resourceType,
o = e.resourceUrn,
s = new(n(456))((t = {
context_urn: o,
kind: r,
played_at: Date.now()
}, t[r] = {
id: i
}, t));
return s.release(), s
}
function o() {
this.reset([])
}
var s = e.exports = n(72).extend({
model: n(456),
baseUrl: function() {
return this.getEndpointUrl("playHistoryContexts")
},
setup: function() {
this.listenTo(n(74), "addToPlayHistory", i), this.listenTo(n(74), "clearPlayHistory", o)
}
}, {
hashFn: function() {
return 1
}
});
n(333).applyTo(s, {
fields: ["station.title", "playlist.title", "playlist.user.username", "user.username"]
})
},
320: function(e, t, n) {
"use strict";
var i = e.exports = n(72).extend({
model: n(61),
setup: function() {
n(64).isLoggedIn() || this.setToFullyPopulated()
},
comparator: function(e) {
return e.get("username").toLowerCase()
},
baseUrl: function() {
return this.getEndpointUrl("shortcutsFollowings")
}
}, {
hashFn: function() {
return n(55).get("me").get("id")
},
prefetch: function() {
var e = new i;
e.isPopulated() || e.fetch(), e.release()
}
})
},
321: function(e, t, n) {
(function(t) {
"use strict";
var i = 5;
e.exports = n(150).extend(n(442), n(444), {
defaults: {
type: "spotlight"
},
model: n(305),
baseUrl: function() {
return this.getEndpointUrl("userSpotlight", {
id: this.options.userId
})
},
add: function() {
return n(150).prototype.add.apply(this, arguments), this.length > i && this.remove(this.models.slice(i)), this
},
parse: function(e) {
return e.collection.slice(0, i).map(function(e) {
var t = "playlist" === e.kind;
return {
type: t ? "playlist_spotlight" : "track_spotlight",
created_at: e.created_at,
track: t ? null : e,
playlist: t ? e : null
}
})
},
getMaxItemCount: function() {
return i
},
getCurrentOrder: function() {
return this.map(function(e) {
return (e.get("playlist") || e.get("track")).id
})
},
reorder: function(e) {
this.sort({
silent: !0,
comparator: function(t) {
return e.indexOf(t.audible.id)
}
})
},
resetOrder: function() {
return this.fetch({
reset: !0
})
},
saveOrder: function() {
return this.save()
},
save: function() {
var e = this.map(function(e) {
return e.audible.getUrn()
});
return t.ajax(n(3).result(this, "baseUrl"), {
type: "PUT",
data: JSON.stringify({
spotlight: e
}),
dataType: "json",
contentType: "application/json"
})
}
})
}).call(t, n(1))
},
325: function(e, t, n) {
"use strict";
function i(e, t) {
this.set("network", o(t))
}
function r(e, t) {
this._webProfile.set("network", t), this.set("icon", this._webProfile.getNetworkClassName())
}
function o(e) {
var t;
return e ? (n(3).any(a, function(n, i) {
return n.test(e) ? (t = i, !0) : void 0
}), t || "personal") : ""
}
function s() {
var e = this.getAttributesFromModel();
this.set(e), this.markFieldsClean()
}
var a = {
facebook: /\bfacebook\.com/i,
twitter: /\btwitter\.com/i,
myspace: /\bmyspace\.com/i,
lastfm: /\b(last\.fm|lastfm\.[a-z]*)/i,
youtube: /\byoutube\.com/i,
google_plus: /\bplus\.google\.com/i,
beatport: /\bbeatport\.com/i,
discogs: /\bdiscogs\.com/i,
flickr: /\bflickr\.com/i,
hypem: /\bhypem\.com/i,
ning: /\bning\.com/i,
posterous: /\bposterous\.com/i,
purevolume: /\bpurevolume\.com/i,
residentadvisor: /\bresidentadvisor\.net\/(profile|dj)/i,
residentadvisorlabel: /\bresidentadvisor\.net\/record-label/i,
reverbnation: /\breverbnation\.com/i,
soundcloud: /\bsoundcloud\.com/i,
songkick: /\bsongkick\.com/i,
tumblr: /\btumblr\.com/i,
vimeo: /\bvimeo\.com/i,
virb: /\bvirb\.com/i,
wordpress: /\bwordpress\.com/i,
ccmixter: /\bccmixter\.org/i,
itunes_podcast: /\bitunes\.apple\.com/i,
instagram: /\binstagram\.com/i,
foursquare: /\bfoursquare\.com/i,
flavors: /\bflavors.me/i,
thedjlist: /\bthedjlist.com/i,
berklee: /\bberkleemusic\.com/i,
whatpeopleplay: /\bwhatpeopleplay\.com/i,
zeroinch: /\bzero-inch\.com/i,
gigatools: /\bgigs\.gigatools\.com/i,
freesound: /\bfreesound\.org/i,
bandpage: /\bbandpage\.com/i,
bandsintown: /\bbandsintown\.com/i,
email: /.*@.*/i
};
e.exports = n(80).extend({
resource_type: "web-profile-form",
_webProfile: null,
fields: {
icon: {
defaultValue: ""
},
url: {
defaultValue: ""
},
title: {
defaultValue: ""
}
},
constraints: {
url: [
[n(69), {
message: n(52).t("Enter a web or email address.")
}],
[n(1273), {
message: n(52).t("This URL or email is invalid."),
constraints: [
[n(292), {
strict: !1
}],
[n(437)]
]
}]
]
},
setup: function(e, t) {
this._webProfile = new(n(572))(e, t), this.addSubmodel(this._webProfile), s.call(this), this.listenTo(this, "change:url", i).listenTo(this, "change:network", r)
},
removeWebProfile: function() {
this.trigger("form:dirty"), this.destroy()
},
getAttributesFromModel: function() {
var e = this._webProfile.getNetworkClassName();
return n(3).assign(this.getWebProfile().pick("id", "title", "url", "network"), {
icon: e
})
},
getWebProfile: function() {
return this._webProfile
}
})
},
356: function(e, t, n) {
"use strict";
e.exports = n(233).extend({
readEndpoint: "userBlockingsIds",
createEndpoint: "userBlockingsCreate",
deleteEndpoint: "userBlockingsDelete",
getCreateEndpointQueryParams: function(e) {
var t = arguments.length <= 1 || void 0 === arguments[1] ? {} : arguments[1],
n = t.reported,
i = t.remove_activities;
return {
user_id: e,
reported: n ? "true" : null,
remove_activities: i ? "true" : null
}
}
})
},
357: function(e, t, n) {
"use strict";
e.exports = n(66).extend({
resource_type: "liked-and-owned-playlist",
submodelMap: {
playlist: n(84)
},
setup: function(e) {},
isOwned: function() {
return "playlist" === this.get("type")
},
isLiked: function() {
return "playlist-like" === this.get("type")
},
isAlbum: function() {
return this.getAudible().isAlbum()
},
createSubmodel: function() {
var e = n(3).last(this._submodels);
n(66).prototype.createSubmodel.apply(this, arguments);
var t = n(3).last(this._submodels);
t !== e && this.listenTo(t, "destroy", this.onSubmodelDestroy)
},
onSubmodelDestroy: function() {
this.destroy()
},
getAudible: function() {
return n(84).instances.get(this.get("playlist").id)
}
}, {
hashFn: function(e) {
var t = e.type,
n = e.user,
i = e.playlist;
return [t, n.id, i.id].join("_")
},
getModelData: function(e, t, n) {
return {
type: t,
created_at: (new Date).toISOString(),
playlist: {
id: n
},
user: {
id: e
}
}
}
})
},
358: function(e, t, n) {
"use strict";
e.exports = n(66).extend({
submodelMap: {
promoted_by: n(61),
user: n(61)
},
urnPrefix: "soundcloud:users",
hasDataForView: function() {
return !0
},
getUser: function() {
return n(61).instances.get(this.get("user").id)
},
parse: function(e) {
return e.origin && (e.user = e.origin, delete e.origin), e.user && (e.id = e.user.id), e
},
isPromoted: function() {
return "promoted" === this.get("source") || "promoted" === this.get("campaign")
}
})
},
422: function(e, t) {
var n = {
"'": /[\u042C\u044C]/gi,
"": /[\u042a\u044a]/gi,
a: /[\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250\u0410\u0430]/gi,
aa: /[\uA733]/gi,
ae: /[\u00E6\u01FD\u01E3]/gi,
ao: /[\uA735]/gi,
au: /[\uA737]/gi,
av: /[\uA739\uA73B]/gi,
ay: /[\uA73D]/gi,
b: /[\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253\u0411\u0431]/gi,
c: /[\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/gi,
ch: /[\u0427\u0447]/gi,
d: /[\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A\u0414\u0434]/gi,
dz: /[\u01F3\u01C6]/gi,
e: /[\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD\u0415\u042D]/gi,
f: /[\u24D5\uFF46\u1E1F\u0192\uA77C\u0424\u0444]/gi,
g: /[\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F\u0413\u0433]/gi,
h: /[\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/gi,
hv: /[\u0195]/gi,
i: /[\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131\u0418\u0438]/gi,
j: /[\u24D9\uFF4A\u0135\u01F0\u0249]/gi,
k: /[\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3\u041A\u043A]/gi,
kh: /[\u0425\u0445]/gi,
l: /[\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u0142\u019A\u026B\u2C61\uA749\uA781\uA747\u041B\u043B]/gi,
lj: /[\u01C9]/gi,
m: /[\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F\u041C\u043C]/gi,
n: /[\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5\u041D\u043D]/gi,
nj: /[\u01CC]/gi,
o: /[\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275\u041E\u043E]/gi,
oi: /[\u01A3]/gi,
ou: /[\u0223]/gi,
oo: /[\uA74F]/gi,
p: /[\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755\u041F\u043F]/gi,
q: /[\u24E0\uFF51\u024B\uA757\uA759]/gi,
r: /[\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783\u0420\u0440]/gi,
s: /[\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B\u017F\u0421\u0441]/gi,
shch: /[\u0429\u0449]/gi,
sh: /[\u0428\u0448]/gi,
t: /[\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787\u0422\u0442]/gi,
ts: /[\u0426\u0446]/gi,
tz: /[\uA729]/gi,
u: /[\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289\u0423\u0443]/gi,
v: /[\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C\u0412\u0432]/gi,
vy: /[\uA761]/gi,
w: /[\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/gi,
x: /[\u24E7\uFF58\u1E8B\u1E8D]/gi,
y: /[\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF\u0419\u0439\u042B\u044B]/gi,
ya: /[\u042F\u044F]/gi,
yo: /[\u0401\u0451]/gi,
yu: /[\u042E\u044E]/gi,
z: /[\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763\u0417\u0437]/gi,
zh: /[\u0416\u0436]/gi
},
i = /^\[|\]$/g,
r = new RegExp("[" + Object.keys(n).reduce(function(e, t) {
return e + n[t].source.replace(i, "")
}, "") + "]", "i");
e.exports = function(e) {
if (r.test(e))
for (var t in n) n[t].lastIndex = 0, n[t].test(e) && (e = e.replace(n[t], t));
return e.toLowerCase()
}
},
423: function(e, t, n) {
"use strict";
function i(e, t) {
var n = o({}, D, t),
r = n.links,
P = n.userLinks,
M = n.internalLinks,
I = n.externalLinks,
R = n.deepLinks,
L = n.escapeExpression,
O = n.hashtagLinks,
F = n.internalLinksBaseUrl,
N = n.isOpeningNewWindow,
B = n.maxExternalLinksLength,
$ = n.maxLength,
U = n.paragraphs,
z = n.redirectorPattern,
H = n.splitWordsAtLength,
j = n.whitelist,
W = L !== !1;
if ("string" != typeof e) return "";
r ? P || M || I || (r = !1) : P = M = I = !1;
var q = r ? c() : {},
Y = q.flatten,
V = q.addPlaceholder;
return p.lastIndex = m.lastIndex = g.lastIndex = 0, e = s(e), r && (e = e.replace(C, function(e, t, n, i) {
var r = n || t;
return V(r, i !== r ? i : null)
}).replace(p, function(e, t) {
return V(t)
})), e = e.replace(x, "\n\n").replace(k, "\n").replace(A, " "), e = j && j.length ? e.replace(new RegExp("<(?!\\s*\\/?(" + j.join("|") + ")\\b)[^>]*>", "ig"), "") : e.replace(S, ""), W && (e = a(e)), r && (e = e.replace(g, '<a href="mailto:$1">$1</a>'), e = Y(e, function(e, t) {
var r = {},
s = "",
u = b.test(e) ? e : "http://" + e;
if (0 === e.indexOf("mailto:")) r.href = e, r.text = e.replace("mailto:", "");
else if (M && _.test(e)) r.href = e.replace(_, F), r.text = e.replace(b, "");
else if (I) {
var c = y.test(u);
r.href = c ? u : l(z, u, y), c || (r.title = u, r.rel = "nofollow"), r.text = h(e, B, b), r.target = "_blank"
} else r.href = e;
return t && (W ? s = i(t, o({}, n, {
paragraphs: !1,
splitWordsAtLength: 0
})).trim() + (/[!?:;.]$/.test(t) ? " " : ": ") : r.text = t), s + (r.text ? '<a href="' + a(r.href) + '"' + (r.rel ? ' rel="' + r.rel + '"' : "") + (r.target ? ' target="' + r.target + '"' : "") + (r.title ? ' title="' + a(r.title) + '"' : "") + (">" + (W ? a(r.text) : r.text) + "</a>") : a(r.href))
}), P && (e = e.replace(m, '$1@<a href="' + F + '$2"' + (N ? ' target="_blank"' : "") + ">$2</a>")), O && (e = e.replace(v, '$1<a href="/tags/$3">$2</a>')), R && (e = e.replace(f, '<a href="#t=$1">$1</a>'))), $ && (e = u(e, $)), H > 0 && (e = d(e, H)), e = U ? e.split(w).map(function(e) {
return "<p>" + e.trim().replace(T, "<br>") + "</p>"
}).join("") : e.replace(E, " ").replace(A, " ")
}
function r(e, t) {
var n = t && t.redirectorPattern;
return n ? l(n, e, y) : e
}
var o = n(1178),
s = n(1179),
a = n(1180),
l = n(1181),
u = n(1182),
c = n(1183),
d = n(1184),
h = n(1185);
e.exports = i;
var p = /\b((?:https?:\/\/|www\d{0,3}\.|(?:[a-z0-9\-]+\.)+[a-z]{2,4}\/)[^\s'’"]*[^\s`!()\[\]{};:'".,<>?«»“”‘’])/gi,
f = /(\b(?:[0-5]?[0-9])(?::[0-5][0-9]){1,2}\b)/g,
g = /([a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,24})/gi,
m = /(\s|[^\w]|^)@([\w\-]+)/g,
v = /( |^)(#([\w-]+))/gm,
_ = /^((?:https?:\/\/)?(?:www\.|m\.)?soundcloud\.(?:com|dev))\/?|^\//i,
y = /^((?:https?:\/\/)?([a-z0-9-]+\.)*soundcloud\.(?:com|dev))(?:\/|$)/i,
b = /^(?:ht|f)tps?:\/\//i,
w = /(?:[ \t]*\r?\n[ \t]*){2,}/,
x = /<\/p>/g,
k = /<br\s*\/?>/g,
S = /<\/?[a-z].*?>/gi,
T = /\r?\n/g,
A = /[ \t]{2,}/g,
E = /[\r\n]+/g,
C = /<a\s+[^>]*?href=(['"]([^'"\s]+)['"]|[^'"\s]+)[^>]*?>(.+?)<\/a>/gi,
D = {
paragraphs: !0,
links: !0,
externalLinks: !0,
internalLinks: !0,
userLinks: !0,
deepLinks: !1,
whitelist: [],
internalLinksBaseUrl: "/",
isOpeningNewWindow: !1,
maxLength: null,
truncateExternalLinks: !0,
maxExternalLinksLength: 50,
hashtagLinks: !0,
splitWordsAtLength: null,
redirectorPattern: null
};
i.redirectLink = r, i.withDefaults = function(e) {
var t = o({}, D, e),
n = function(e, n) {
var r = n ? o({}, t, n) : t;
return i(e, r)
};
return n.redirectLink = function(e, n) {
var i = n ? o({}, t, n) : t;
return r(e, i)
}, n
}
},
424: function(e, t, n) {
"use strict";
function i() {
var e = new(n(75))({
id: this.options.resource_id,
resource_type: this.options.resource_type
});
return e.release(), e.get("secret_token")
}
e.exports = n(891).extend({
defaults: {
type: null,
resource_id: null,
resource_type: null
},
actionName: function() {
return "likers" === this.options.type ? "like" : "repost"
},
setup: function() {
this.options.secret_token = i.call(this), n(891).prototype.setup.apply(this, arguments)
},
baseUrl: function() {
var e = this.options,
t = e.resource_type,
n = e.resource_id,
i = e.type,
r = {
id: n,
category: i
};
return "sound" === t && "likers" === i ? this.getEndpointUrl("trackCategory", r) : "sound" === t && "reposters" === i ? this.getEndpointUrl("soundReposters", r) : "likers" === i ? this.getEndpointUrl("playlistCategory", r) : this.getEndpointUrl("edgePlaylistCategory", r)
}
}, {
hashFn: function(e, t) {
return t ? t.resource_id + "_" + t.type + "_" + t.resource_type : null
}
})
},
425: function(e, t, n) {
"use strict";
function i(e) {
e.length > 0 && n(57).trigger("new-unread-messages", e)
}
function r(e) {
var t;
e.forEach(function(e) {
t = n(159).instances.get(e), t && t.setRead(!0)
})
}
function o() {
var e = n(120)[this.notificationType];
return {
backoffRate: 1.1,
baseDelay: e.get("minPollInterval"),
maxDelay: e.get("maxPollInterval")
}
}
function s() {
this._breaker && this.restart()
}
function a() {
this.trigger("anyUnreadMessages", this.hasAnyUnreadMessages())
}
function l(e) {
this.remove(e), a.call(this)
}
function u(e) {
var t = n(159).instances.get(e);
t && this.add(t), a.call(this)
}
e.exports = n(72).extend({
model: n(159),
notificationType: "unreadConversations",
defaults: {
limit: 20
},
setup: function() {
this.listenTo(n(120)[this.notificationType], "pollIntervalChange", s).listenTo(n(57), "conversation:read", l).listenTo(n(57), "conversation:unread", u)
},
baseUrl: function() {
return n(120)[this.notificationType].get("baseUrl")()
},
startPolling: function() {
var e = this;
this._isPolling || ! function() {
var t = e._breaker = new(n(143))(o.call(e)),
i = function() {
e._isPolling && (window.clearTimeout(e._pollingId), e.fetch({
reset: !0,
remove: !0
}).done(function() {
t.succeeded(), e._pollingId = window.setTimeout(i, t.currentDelay())
}).fail(function(e) {
e.status >= 400 && e.status < 500 ? t.disable({
autoEnable: !1
}) : t.failed()
}))
};
e._isPolling = !0, e._breaker.on("enabled", i), i()
}()
},
stopPolling: function() {
this._isPolling && (window.clearTimeout(this._pollingId), this._breaker.dispose(), this._isPolling = !1, this._pollingId = this._breaker = null)
},
restart: function() {
this.stopPolling(), this.startPolling()
},
parse: function() {
return this.next_href = null, n(72).prototype.parse.apply(this, arguments)
},
reset: function(e, t) {
var o, s, l, u;
t = t || {}, o = n(72).prototype.reset.call(this, e, t), l = n(3).pluck(o, "id"), s = n(3).difference(t.previousModels, this.models), u = n(3).pluck(s, "id"), i(l), r.call(this, u), a.call(this)
},
hasAnyUnreadMessages: function() {
return this.length > 0
}
}, {
hashFn: function() {
return 1
},
onCleanup: function(e) {
e.stopPolling()
},
neverRelease: !0
})
},
426: function(e, t, n) {
"use strict";
function i(e) {
var t = e.state,
n = e.origin,
i = void 0;
t && this.shouldAddFromActions ? this.add({
id: n
}, {
at: 0
}) : !t && (i = this.get(n)) && this.remove(i)
}
var r = [{
emitter: n(74),
event: "follow",
getInstance: function(e, t) {
var n = t.target;
return e.options.userId === n
},
handler: i
}];
e.exports = n(150).extend(n(199).withOptions({
events: r
}), {
model: n(61),
defaults: {
limit: 7,
type: "followers"
},
shouldAddFromActions: !0,
baseUrl: function() {
return this.getEndpointUrl("userFollowers", {
id: this.options.userId
})
}
})
},
427: function(e, t, n) {
"use strict";
e.exports = n(72).extend({
model: n(572),
defaults: {
type: "web-profiles"
},
url: function() {
return this.getEndpointUrl("userWebProfiles", {
urn: n(100).generate("user", this.options.userId)
})
},
parse: function(e) {
return e.forEach(function(e) {
var t = e.url,
n = e.network,
i = e.title;
e.id = t + "_" + n + "_" + i
}), e
},
getProfileByName: function(e) {
return this.find(function(t) {
return t.get("network") === e
})
}
}, {
hashFn: function(e, t) {
return t.userId
}
})
},
431: function(e, t, n) {
"use strict";
e.exports = n(80).extend(n(253).withOptions({
read: "artwork_url"
}), n(334), {
resource_type: "multi-track-artwork",
fields: {
artwork_url: {
defaultValue: ""
}
},
setup: function() {
var e = this;
this.on("imageDataChanged", function(t) {
t.file && e.markFieldsDirty("artwork_url")
}).on("canceled", this.unsetImageFile.bind(this, {
force: !0
})).on("allSaved", this.unsetImageFile.bind(this, {
force: !0
}))
},
saveSound: function(e) {
var t = this.getImageFileInfo(),
i = {
sound: e,
isSuccess: !1
};
return t.file ? (e.setImageFile(t.file, t.source), e.uploadImage().then(function() {
return {
sound: e,
isSuccess: !0
}
}, function() {
return i
})) : n(56).reject(i)
},
getAttributesFromModels: function() {
return null
},
getAttributesToBeSaved: function() {
return {}
}
})
},
432: function(e, t, n) {
"use strict";
function i() {
var e = this;
this.validate().then(function(t) {
return t ? (e.set("editing", !1), e.saveEdits()) : n(56).reject()
})
}
function r() {
this.isDirty() || this.setToModelAttributes()
}
function o(e) {
this.getAudible().set(e), this.trigger("saved")
}
function s(e) {
this.set({
errorMessage: this.getErrorMessageTemplate("save", this.getAudible().get("kind"), this.extractErrorMessage(e))
})
}
e.exports = n(80).extend(n(520), n(198), {
resource_type: "restricted-audible-edit",
requiredModelAttributes: ["description", "purchase_title", "purchase_url"],
actions: {
"default": "save",
save: function() {
return i.call(this)
},
cancel: function() {
this.cancel()
},
retry: function() {
return i.call(this)
}
},
fields: {
buyLink: {
defaultValue: ""
},
buyTitle: {
defaultValue: "Buy"
},
description: {
defaultValue: ""
}
},
buttons: {
save: {
label: n(52).t("Save changes"),
pendingLabel: n(52).t("Saving"),
action: "save"
},
cancel: {
label: n(52).t("Cancel"),
action: "cancel"
},
retry: {
label: n(52).t("Retry"),
action: "retry"
}
},
constraints: {
buyLink: [
[n(292), {
strict: !1
}]
],
buyTitle: [
[n(504)]
],
description: [
[n(109), {
maxLength: 4e3,
message: n(52).t("Playlist description must not exceed 4000 characters")
}]
]
},
constraintConditions: {
buyTitle: {
fields: [],
check: function() {
return n(55).get("me").getPerk("customBuyTitle")
}
}
},
setup: function(e, t) {
var i = t.resource_id,
o = t.resource_type;
this._audible = "restricted-playlist-edit" === o ? new(n(84))({
id: i
}) : new(n(65))({
id: i
});
var s = this.requiredModelAttributes.map(function(e) {
return "change:" + e
});
this.listenTo(this._audible, s.join(" "), r), this._audible.attrExists(this.requiredModelAttributes) ? this.setToModelAttributes() : this._audible.fetch({
attrs: this.requiredModelAttributes
}).fail(function() {
return n(122).raise({
fatal: !0
})
})
},
saveEdits: function() {
var e = this.getAudible(),
t = this.getAttributesToBeSaved(),
i = "restricted-playlist-edit" === this.options.resource_type,
r = i ? {
id: e.id
} : {
urn: e.get("urn")
},
a = i ? {
playlist: t
} : {
track: t
},
l = i ? "feedPlaylistUpdate" : "feedTrackUpdate";
return n(23).callEndpoint(l, r, null, null, a).then(o.bind(this, t), s.bind(this))
},
getAudible: function() {
return this._audible
},
getAttributesFromModel: function() {
var e = this.getAudible();
return {
buyLink: e.get("purchase_url"),
buyTitle: e.get("purchase_title") || this.getFieldMetadata("buyTitle").defaultValue,
description: e.get("description")
}
},
getAttributesToBeSaved: function() {
var e = this.get("buyLink");
return {
purchase_url: e ? n(63).normalize(e) : "",
purchase_title: this.get("buyTitle") || "",
description: this.get("description") || ""
}
},
cancel: function() {
this.set("errorMessage", ""), this.markFieldsClean(), this.trigger("canceled")
},
saveCleanup: function(e) {
this.markFieldsClean()
}
}, {
hashFn: function(e, t) {
return e.resource_id || t && t.resource_id || e.id || null
}
})
},
433: function(e, t, n) {
"use strict";
function i() {
var e = "check_identifier_recaptcha";
return this.getValidFieldValues(["identifier", e]).then(n(234).checkIdentifier).then(s(this, e))
}
function r() {
var e = "signin_with_password_recaptcha";
return this.getValidFieldValues(["identifier", "password", e]).then(n(234).signinWithPassword).then(s(this, e))
}
function o() {
var e = "signup_with_email_recaptcha";
return this.getValidFieldValues(["identifier", "password", "age", e, "accept_terms"]).then(n(234).signupWithEmail).then(s(this, e))
}
function s(e, t) {
arguments.length <= 2 || void 0 === arguments[2] ? !1 : arguments[2];
return function(i) {
return i.error === w ? (e.toggleRecaptcha(t, !0), n(56).reject()) : i
}
}
function a() {
return this.getValidFieldValues(["accept_terms"]).then(v).then(n(234).signupWithFacebook)
}
function l() {
return this.getValidFieldValues(["accept_terms"]).then(y).then(n(234).signupWithGoogle)
}
function u() {
return v().then(n(234).signinWithFacebook)
}
function c() {
return y().then(n(234).signinWithGoogle)
}
function d() {
var e = this;
return this.getValidFieldValues(["username"]).then(function(t) {
var i = e.get("gender"),
r = e.get("genderCustom"),
o = n(55).get("me"),
s = {
username: t,
gender: "custom" === i ? r : i
};
return o && o.set(s), n(56).mapEither(p, b("meUpdate", null, null, null, s))
})
}
function h() {
return this.getValidFieldValues(["identifier"]).then(function(e) {
return n(56).mapEither(p, b("resetPassword", null, {
email: e
}))
})
}
function p(e) {
return n(56).resolve(e.body || {})
}
var f = n(3).assign,
g = n(3).mapObject,
m = n(114).loadFacebookSDK,
v = n(114).getFacebookToken,
_ = n(213).loadGoogleAuthSDK,
y = n(213).getGoogleToken,
b = n(23).callEndpoint,
w = n(115).RECAPTCHA_REQUIRED,
x = ["check_identifier_recaptcha", "signup_with_email_recaptcha", "signin_with_password_recaptcha"];
e.exports = n(80).extend(n(443), n(944).withOptions({
recaptchas: x
}), {
resource_type: "signin-form",
fields: g({
identifier: "",
password: "",
age: null,
accept_terms: !1,
username: "",
reset_password_addresses: null
}, function(e) {
return {
defaultValue: e
}
}),
constraints: {
identifier: [
[n(69), {
message: n(52).t("Enter a valid email address or profile URL.")
}]
],
password: [
[n(69), {
message: n(52).t("Enter a password.")
}],
[n(924), {
minLength: 6,
message: n(52).t("Use at least [[minLength]] characters.")
}]
],
age: [
[n(69), {
message: n(52).t("Enter your age.")
}],
[n(926), {
minValue: 13,
message: n(52).t("You must be at least [[minValue]] years old.")
}]
],
accept_terms: [
[n(195), {
value: !0,
message: n(52).t("Accept the terms before continuing.")
}]
],
username: [
[n(69), {
message: n(52).t("Enter your display name. You can change it later.")
}],
[n(109), {
maxLength: 50,
message: n(52).t("Enter a display name that is up to [[maxLength]] characters.")
}]
]
},
buttons: g({
checkIdentifier: {
label: n(52).t("Continue")
},
signinWithPassword: {
label: n(52).t("Sign in")
},
signupWithEmail: {
label: n(52).t("Continue")
},
signupWithGoogle: {
label: n(52).t("Get started")
},
signupWithFacebook: {
label: n(52).t("Get started")
},
addUserInformation: {
label: n(52).t("Get started")
},
promptPasswordReset: {
label: n(52).t("Request a password reset")
}
}, function(e, t) {
return f(e, {
action: t
})
}),
actions: {
checkIdentifier: i,
signinWithGoogle: c,
signinWithFacebook: u,
signinWithPassword: r,
signupWithEmail: o,
signupWithGoogle: l,
signupWithFacebook: a,
addUserInformation: d,
promptPasswordReset: h
},
setup: function() {
m(), _()
}
})
},
453: function(e, t, n) {
"use strict";
e.exports = n(66).extend({
submodelMap: {
comment: n(107),
playlist: n(84),
promoted_by: n(61),
track: n(65),
user: n(61)
},
baseUrl: function() {
var e = {
cursor: this.get("uuid"),
limit: 1
};
return this.getEndpointUrl("myActivitiesTracks", {}, e)
},
parse: function(e) {
return e.collection ? e.collection[0] : e
},
createSubmodel: function() {
var e, t = n(3).last(this._submodels);
n(66).prototype.createSubmodel.apply(this, arguments), e = n(3).last(this._submodels), e !== t && this.listenTo(e, "destroy", this.onSubmodelDestroy)
},
onSubmodelDestroy: function() {
this.destroy()
},
getSound: function() {
var e, t;
switch (this.get("type")) {
case "track":
case "track-like":
case "track-repost":
case "track-sharing":
case "track-promoted":
e = this.get("track").id, t = n(65);
break;
case "comment":
e = this.get("comment").track.id, t = n(65);
break;
case "playlist":
case "playlist-like":
case "playlist-repost":
case "playlist-sharing":
case "playlist-promoted":
e = this.get("playlist").id, t = n(84)
}
return e ? t.instances.get(e) : null
},
equivalentTo: function(e) {
return this.get("uuid") === e.get("uuid")
},
getUuid: function() {
return this.get("uuid") || this.id
},
isPromoted: function() {
var e = this.get("type");
return "track-promoted" === e || "playlist-promoted" === e
}
}, {
convert: function(e, t) {
var i, r, o, s = {};
if (r = (e.get || function(e) {
return this[e]
}).bind(e), r("type") && r("created_at") && (r("track") || r("playlist")) && (i = {
uuid: n(3).uniqueId(),
type: r("type").replace(/_/g, "-"),
created_at: r("created_at"),
tags: "affiliated"
}, o = r("track"), o ? i.track = o : i.playlist = r("playlist"), t)) try {
s = t.toJSON()
} finally {
i.user = s
}
return i
},
hashFn: function() {
return null
}
})
},
454: function(e, t, n) {
(function(t) {
"use strict";
function i(e) {
return n(251).centered(e, 450, 500, "createNewConnection")
}
var r, o;
o = {
facebook_profile: "connection-facebook.html",
twitter: "connection-facebook.html",
facebook_page: "connection-facebook.html",
tumblr: "connection-facebook.html"
};
var s = e.exports = n(66).extend({
baseUrl: function() {
return this.getEndpointUrl("myConnection", {
id: this.id
})
}
}, {
create: function(e) {
var s, a, l = o[e];
if (r) {
if (s = r.popup, r.type === e) return s && !s.closed && s.focus && s.focus(), r.deferred;
r.deferred.reject()
}
return r || (r = {
deferred: n(56).defer().always(function() {
var e = r.popup;
e && !e.closed && e.close(), window.clearInterval(r.intervalId), r = null
}),
popup: null,
intervalId: null
}), a = r.deferred, l = window.location.protocol + "//" + window.location.host + "/" + l, n(64).login().fail(a.reject).done(function() {
t.ajax({
type: "POST",
url: "me/connections",
data: {
service: e,
redirect_uri: l
},
dataType: "json",
contentType: "application/json"
}).fail(a.reject).done(function(e) {
var t = r.popup = i(e.authorize_url);
r.intervalId = window.setInterval(function() {
(!t || t.closed) && a.reject()
}, 2e3)
})
}), a
},
callback: function(e) {
var t, i = n(63).parseQueryString(e.location.search);
"1" === i.success ? (t = new s({
id: parseInt(i.id, 10)
}), t.fetch().fail(r.deferred.reject).done(function() {
n(57).trigger("connect:newConnection", t), r.deferred.resolve(t)
})) : (n(57).trigger("connect:connectionError", i.errorMessage), r.deferred.reject())
}
})
}).call(t, n(1))
},
455: function(e, t, n) {
"use strict";
e.exports = n(233).extend({
readEndpoint: "myFollowingsIds",
createEndpoint: "myFollowingsCreate",
deleteEndpoint: "myFollowingsDelete"
})
},
456: function(e, t, n) {
"use strict";
function i(e) {
var t = e.kind,
i = e.station,
r = e.playlist,
o = e.user;
switch (t) {
case "station":
return new(n(116))(i);
case "playlist":
return new(n(84))(r);
case "user":
return new(n(61))(o);
default:
return null
}
}
e.exports = n(66).extend({
resource_type: "historicalPlayContext",
submodelMap: {
playlist: n(84),
station: n(116),
user: n(61)
},
setup: function(e) {
this.contextModel = i(e), this.contextModel && this.addSubmodel(this.contextModel)
},
getContextId: function() {
var e = this.get("context_urn"),
t = n(100).toComponents(e),
i = t.id;
switch (this.get("kind")) {
case "station":
return e;
case "user":
case "playlist":
return i
}
}
}, {
hashFn: function(e) {
var t = e.id,
n = e.resource_id,
i = e.context_urn;
return t || n || i
}
})
},
457: function(e, t, n) {
"use strict";
e.exports = n(66).extend({
resource_type: "like",
submodelMap: {
track: n(65),
playlist: n(84)
},
url: null,
setup: function(e) {},
getAudible: function() {
var e;
return (e = this.get("track")) ? n(65).instances.get(e.id) : (e = this.get("playlist")) ? n(84).instances.get(e.id) : void 0
},
isPlaylist: function() {
return !this.get("track")
},
isSound: function() {
return !!this.get("track")
}
}, {
hashFn: function(e) {
return e.id || [e.user_id, e.track ? "s" : "p", (e.track || e.playlist).id].join("_")
},
getLikeModelData: function(e, t, n) {
var i = {
user_id: e,
created_at: (new Date).toISOString(),
kind: "like"
};
return "sound" === t ? (i.track = {
id: n
}, i.playlist = null) : (i.playlist = {
id: n
}, i.track = null), i
}
})
},
473: function(e, t) {
"use strict";
var n = "https://exit.sc?url=%s";
e.exports = {
oneline: {
paragraphs: !1,
whitelist: [],
externalLinks: !1
},
"default": {
redirectorPattern: n
}
}
},
475: function(e, t, n) {
e.exports = n.p + "assets/images/close-modal-dark-6aac3b.svg"
},
476: function(e, t, n) {
var i = n(20);
e.exports = (i["default"] || i).template({
compiler: [7, ">= 4.0.0"],
main: function(e, t, n, i, r) {
return '<div class="l-fluid-fixed">\n <div class="sc-border-light-right l-main">\n <div class="l-tabs">\n\n </div>\n <div class="l-content">\n\n </div>\n </div>\n <div class="l-sidebar-right">\n\n </div>\n</div>\n'
},
useData: !0
})
},
481: function(e, t, n) {
(function(e, i) {
function r(e, t) {
this._id = e, this._clearFn = t
}
var o = n(2780).nextTick,
s = Function.prototype.apply,
a = Array.prototype.slice,
l = {},
u = 0;
t.setTimeout = function() {
return new r(s.call(setTimeout, window, arguments), clearTimeout)
}, t.setInterval = function() {
return new r(s.call(setInterval, window, arguments), clearInterval)
}, t.clearTimeout = t.clearInterval = function(e) {
e.close()
}, r.prototype.unref = r.prototype.ref = function() {}, r.prototype.close = function() {
this._clearFn.call(window, this._id)
}, t.enroll = function(e, t) {
clearTimeout(e._idleTimeoutId), e._idleTimeout = t
}, t.unenroll = function(e) {
clearTimeout(e._idleTimeoutId), e._idleTimeout = -1
}, t._unrefActive = t.active = function(e) {
clearTimeout(e._idleTimeoutId);
var t = e._idleTimeout;
t >= 0 && (e._idleTimeoutId = setTimeout(function() {
e._onTimeout && e._onTimeout()
}, t))
}, t.setImmediate = "function" == typeof e ? e : function(e) {
var n = u++,
i = arguments.length < 2 ? !1 : a.call(arguments, 1);
return l[n] = !0, o(function() {
l[n] && (i ? e.apply(null, i) : e.call(null), t.clearImmediate(n))
}), n
}, t.clearImmediate = "function" == typeof i ? i : function(e) {
delete l[e]
}
}).call(t, n(481).setImmediate, n(481).clearImmediate)
},
483: function(e, t, n) {
var i = n(149);
e.exports = function(e, t) {
return i.render(e, t && t.hash)
}
},
485: function(e, t, n) {
(function(t, n, i) {
e.exports = function(e) {
function t(i) {
if (n[i]) return n[i].exports;
var r = n[i] = {
exports: {},
id: i,
loaded: !1
};
return e[i].call(r.exports, r, r.exports, t), r.loaded = !0, r.exports
}
var n = {};
return t.m = e, t.c = n, t.p = "/build/", t(0)
}(function(e) {
for (var t in e)
if (Object.prototype.hasOwnProperty.call(e, t)) switch (typeof e[t]) {
case "function":
break;
case "object":
e[t] = function(t) {
var n = t.slice(1),
i = e[t[0]];
return function(e, t, r) {
i.apply(this, [e, t, r].concat(n))
}
}(e[t]);
break;
default:
e[t] = e[e[t]]
}
return e
}([function(e, t, n) {
function i() {
return g++
}
var r, o = n(1),
s = n(12),
a = n(14),
l = n(36),
u = n(42),
c = n(37),
d = n(46),
h = n(41),
p = n(118),
f = n(43),
g = 0;
e.exports = r = function(e) {
e = e || {}, this._players = {}, this._volume = 1, this._mute = !1, this.States = l, this.Errors = u, this._settings = s({}, e, r.defaults)
}, r.MimeTypes = f, r.Protocols = p, r.Events = c, r.States = l, r.Errors = u, r.BrowserUtils = d, r.defaults = {
flashAudioPath: "flashAudio.swf",
flashLoadTimeout: 2e3,
flashObjectID: "flashAudioObject",
audioObjectID: "html5AudioObject",
updateInterval: 50,
bufferTime: 8e3,
maxBufferLength: 9e4,
mseEnableBufferingBeforePlay: !1,
bufferingDelay: 500,
streamUrlProvider: null,
seekHackEnabled: !0,
audioGlitchSleepHackEnabled: !0,
enableWebCrypto: !0
}, r.capabilities = h.names, r.createDefaultMediaDescriptor = function(e, t, n) {
if (!e || !t || !t.length) throw new Error("invalid input to create media descriptor");
return n || (n = 0), {
id: e,
src: t,
duration: n,
forceSingle: !1,
mimeType: void 0,
maxBufferLength: void 0
}
}, r.prototype.getAudioPlayer = function(e) {
return this._players[e]
}, r.prototype.hasAudioPlayer = function(e) {
return void 0 !== this._players[e]
}, r.prototype.removeAudioPlayer = function(e) {
this.hasAudioPlayer(e) && delete this._players[e]
}, r.prototype.setVolume = function(e) {
e = Math.min(1, e), this._volume = Math.max(0, e);
for (var t in this._players) this._players.hasOwnProperty(t) && this._players[t].setVolume(this._volume)
}, r.prototype.getVolume = function() {
return this._volume
}, r.prototype.setMute = function(e) {
this._muted = e;
for (var t in this._players) this._players.hasOwnProperty(t) && this._players[t].setMute(this._muted)
}, r.prototype.getMute = function() {
return this._muted
}, r.prototype.createAudioPlayer = function(e, t) {
if (!e) throw "AudioManager: No media descriptor object passed, can't build any player";
if (e.constructor !== Array && (e = [e]), 0 === e.length) throw "AudioManager: Descriptors array was empty, can't build any player";
for (var n = o({}, this._settings, t), r = null, s = null, l = 0; !r && l < e.length; l++) {
if (s = e[l], null == s.id && (s.id = "player-" + i()), !s.src) throw new Error("AudioManager: You need to pass a valid media source URL");
r = this._players[s.id], r || (r = a.createAudioPlayer(s, n))
}
if (!r) throw new Error("AudioManager: No player could be created from the given descriptor(s)");
return this._players[s.id] = r, this._players[s.id].setVolume(this._volume), this._players[s.id].setMute(this._muted), this._players[s.id].on(c.STATE_CHANGE, this._onStateChange, this), r
}, r.prototype._onStateChange = function(e, t) {
t.getState() === l.DEAD && this.removeAudioPlayer(t.getId())
}
}, function(e, t, n) {
function i(e, t, n) {
for (var i = -1, r = s(t), o = r.length; ++i < o;) {
var a = r[i],
l = e[a],
u = n(l, t[a], a, e, t);
(u === u ? u === l : l !== l) && (void 0 !== l || a in e) || (e[a] = u)
}
return e
}
var r = n(2),
o = n(8),
s = n(4),
a = o(function(e, t, n) {
return n ? i(e, t, n) : r(e, t)
});
e.exports = a
},
[120, 3, 4],
function(e, t) {
function n(e, t, n) {
n || (n = {});
for (var i = -1, r = t.length; ++i < r;) {
var o = t[i];
n[o] = e[o]
}
return n
}
e.exports = n
},
[121, 5, 6, 7],
function(e, t) {
function n(e) {
return !!e && "object" == typeof e
}
function i(e, t) {
var n = null == e ? void 0 : e[t];
return s(n) ? n : void 0
}
function r(e) {
return o(e) && h.call(e) == a
}
function o(e) {
var t = typeof e;
return !!e && ("object" == t || "function" == t)
}
function s(e) {
return null == e ? !1 : r(e) ? p.test(c.call(e)) : n(e) && l.test(e)
}
var a = "[object Function]",
l = /^\[object .+?Constructor\]$/,
u = Object.prototype,
c = Function.prototype.toString,
d = u.hasOwnProperty,
h = u.toString,
p = RegExp("^" + c.call(d).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
e.exports = i
},
function(e, t) {
function n(e) {
return r(e) && f.call(e, "callee") && (!m.call(e, "callee") || g.call(e) == c)
}
function i(e) {
return null != e && s(e.length) && !o(e)
}
function r(e) {
return l(e) && i(e)
}
function o(e) {
var t = a(e) ? g.call(e) : "";
return t == d || t == h
}
function s(e) {
return "number" == typeof e && e > -1 && e % 1 == 0 && u >= e
}
function a(e) {
var t = typeof e;
return !!e && ("object" == t || "function" == t)
}
function l(e) {
return !!e && "object" == typeof e
}
var u = 9007199254740991,
c = "[object Arguments]",
d = "[object Function]",
h = "[object GeneratorFunction]",
p = Object.prototype,
f = p.hasOwnProperty,
g = p.toString,
m = p.propertyIsEnumerable;
e.exports = n
},
function(e, t) {
function n(e) {
return !!e && "object" == typeof e
}
function i(e, t) {
var n = null == e ? void 0 : e[t];
return a(n) ? n : void 0
}
function r(e) {
return "number" == typeof e && e > -1 && e % 1 == 0 && v >= e
}
function o(e) {
return s(e) && f.call(e) == u
}
function s(e) {
var t = typeof e;
return !!e && ("object" == t || "function" == t)
}
function a(e) {
return null == e ? !1 : o(e) ? g.test(h.call(e)) : n(e) && c.test(e)
}
var l = "[object Array]",
u = "[object Function]",
c = /^\[object .+?Constructor\]$/,
d = Object.prototype,
h = Function.prototype.toString,
p = d.hasOwnProperty,
f = d.toString,
g = RegExp("^" + h.call(p).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"),
m = i(Array, "isArray"),
v = 9007199254740991,
_ = m || function(e) {
return n(e) && r(e.length) && f.call(e) == l
};
e.exports = _
},
function(e, t, n) {
function i(e) {
return s(function(t, n) {
var i = -1,
s = null == t ? 0 : n.length,
a = s > 2 ? n[s - 2] : void 0,
l = s > 2 ? n[2] : void 0,
u = s > 1 ? n[s - 1] : void 0;
for ("function" == typeof a ? (a = r(a, u, 5), s -= 2) : (a = "function" == typeof u ? u : void 0, s -= a ? 1 : 0), l && o(n[0], n[1], l) && (a = 3 > s ? void 0 : a, s = 1); ++i < s;) {
var c = n[i];
c && e(t, c, a)
}
return t
})
}
var r = n(9),
o = n(10),
s = n(11);
e.exports = i
},
function(e, t) {
function n(e, t, n) {
if ("function" != typeof e) return i;
if (void 0 === t) return e;
switch (n) {
case 1:
return function(n) {
return e.call(t, n)
};
case 3:
return function(n, i, r) {
return e.call(t, n, i, r)
};
case 4:
return function(n, i, r, o) {
return e.call(t, n, i, r, o)
};
case 5:
return function(n, i, r, o, s) {
return e.call(t, n, i, r, o, s)
}
}
return function() {
return e.apply(t, arguments)
}
}
function i(e) {
return e
}
e.exports = n
},
function(e, t) {
function n(e) {
return function(t) {
return null == t ? void 0 : t[e]
}
}
function i(e) {
return null != e && s(c(e))
}
function r(e, t) {
return e = "number" == typeof e || l.test(e) ? +e : -1, t = null == t ? u : t, e > -1 && e % 1 == 0 && t > e
}
function o(e, t, n) {
if (!a(n)) return !1;
var o = typeof t;
if ("number" == o ? i(n) && r(t, n.length) : "string" == o && t in n) {
var s = n[t];
return e === e ? e === s : s !== s
}
return !1
}
function s(e) {
return "number" == typeof e && e > -1 && e % 1 == 0 && u >= e
}
function a(e) {
var t = typeof e;
return !!e && ("object" == t || "function" == t)
}
var l = /^\d+$/,
u = 9007199254740991,
c = n("length");
e.exports = o
},
function(e, t) {
function n(e, t) {
if ("function" != typeof e) throw new TypeError(i);
return t = r(void 0 === t ? e.length - 1 : +t || 0, 0),
function() {
for (var n = arguments, i = -1, o = r(n.length - t, 0), s = Array(o); ++i < o;) s[i] = n[t + i];
switch (t) {
case 0:
return e.call(this, s);
case 1:
return e.call(this, n[0], s);
case 2:
return e.call(this, n[0], n[1], s)
}
var a = Array(t + 1);
for (i = -1; ++i < t;) a[i] = n[i];
return a[t] = s, e.apply(this, a)
}
}
var i = "Expected a function",
r = Math.max;
e.exports = n
},
function(e, t, n) {
function i(e, t) {
return void 0 === e ? t : e
}
function r(e, t) {
return s(function(n) {
var i = n[0];
return null == i ? i : (n.push(t), e.apply(void 0, n))
})
}
var o = n(1),
s = n(13),
a = r(o, i);
e.exports = a
},
11,
function(e, t, n) {
var i = n(15),
r = n(45),
o = n(47),
s = n(49),
a = n(119),
l = n(43),
u = e.exports = {};
u.createAudioPlayer = function(e, t) {
if (!e.mimeType) {
var n = e.src.split("?", 1)[0];
n = n.substring(n.lastIndexOf(".") + 1, n.length), e.mimeType = l.getTypeByExtension(n)
}
var u = s,
c = r;
return e.forceSingle && (u = a, c = o), u && u.canPlay(e) ? new u(e, t) : c.canPlay(e) ? new c(e, t) : i && i.canPlay(e) ? new i(e, t) : null
}
},
function(e, t, n) {
function i(e, t) {
a.call(this, e, t, "FlashAudioProxy"), this.getState() !== c.ERROR && (i.players[e.id] = this, this._errorMessage = null, this._errorID = null, this._volume = 1, this._muted = !1, i.creatingFlashAudio || (i.flashAudio ? this._createFlashAudio() : i.createFlashObject(t)))
}
var r = n(1),
o = n(16),
s = n(27),
a = n(33),
l = n(37),
u = n(42),
c = n(36),
d = n(43),
h = n(44);
e.exports = i, r(i.prototype, a.prototype), i.players = {}, i.canPlay = function(e) {
var t = e.src.split(":", 1)[0];
return "rtmp" === t || "rtmpt" === t || e.mimeType === d.MP3
}, i.createFlashObject = function(e) {
i.creatingFlashAudio = !0, i.containerElement = document.createElement("div"), i.containerElement.setAttribute("id", e.flashObjectID + "-container"), i.flashElementTarget = document.createElement("div"), i.flashElementTarget.setAttribute("id", e.flashObjectID + "-target"), i.containerElement.appendChild(i.flashElementTarget), document.body.appendChild(i.containerElement);
var t = function(t) {
if (t.success) i.flashAudio = document.getElementById(e.flashObjectID), window.setTimeout(function() {
if (i.flashAudio && !("PercentLoaded" in i.flashAudio))
for (var e in i.players) i.players.hasOwnProperty(e) && (i.players[e]._errorID = u.FLASH_PROXY_FLASH_BLOCKED, i.players[e]._errorMessage = "Flash object blocked", i.players[e]._setState(c.ERROR), i.players[e]._logger.type = i.players[e].getType(), i.players[e]._logger.log(i.players[e]._errorMessage))
}, e.flashLoadTimeout), i.flashAudio.triggerEvent = function(e, t) {
i.players[e]._triggerEvent(t)
}, i.flashAudio.onPositionChange = function(e, t, n, r) {
i.players[e]._onPositionChange(t, n, r)
}, i.flashAudio.onDebug = function(e, t, n) {
i.players[e]._logger.type = t, i.players[e]._logger.log(n)
}, i.flashAudio.onStateChange = function(e, t) {
i.players[e]._setState(t), t === c.DEAD && delete i.players[e]
}, i.flashAudio.onInit = function(e) {
i.creatingFlashAudio = !1, o(s(i.players), "_createFlashAudio")
};
else
for (var n in i.players) i.players.hasOwnProperty(n) && (i.players[n]._errorID = u.FLASH_PROXY_CANT_LOAD_FLASH, i.players[n]._errorMessage = "Cannot create flash object", i.players[n]._setState(c.ERROR))
};
document.getElementById(e.flashObjectID) || h.embedSWF(e.flashAudioPath, e.flashObjectID + "-target", "1", "1", "9.0.24", "", {
json: encodeURIComponent(JSON.stringify(e))
}, {
allowscriptaccess: "always"
}, {
id: e.flashObjectID,
tabIndex: "-1"
}, t)
}, i._ready = function() {
return i.flashAudio && !i.creatingFlashAudio
}, i.prototype._createFlashAudio = function() {
i.flashAudio.createAudio(this.getDescriptor()), this._state = i.flashAudio.getState(this.getId()), this.setVolume(this._volume), this.setMute(this._muted)
}, i.prototype._triggerEvent = function(e) {
this._logger.log("Flash element triggered event: " + e), this.trigger(e, this)
}, i.prototype._setState = function(e) {
this._state !== e && (this._state = e, this.trigger(l.STATE_CHANGE, e, this))
}, i.prototype._onPositionChange = function() {
this._triggerPositionChangeEvent()
}, i.prototype.getType = function() {
return i._ready() ? i.flashAudio.getType(this.getId()) : this._type
}, i.prototype.getContainerElement = function() {
return i.containerElement
}, i.prototype.play = function(e) {
if (i._ready()) {
if (this.getState() === c.PAUSED) return void this.resume();
e = void 0 === e ? 0 : e, i.flashAudio.playAudio(this.getId(), e)
}
}, i.prototype.pause = function() {
i._ready() && i.flashAudio.pauseAudio(this.getId())
}, i.prototype.seek = function(e) {
i._ready() && i.flashAudio.seekAudio(this.getId(), e)
}, i.prototype.resume = function() {
i._ready() && i.flashAudio.resumeAudio(this.getId())
}, i.prototype.setVolume = function(e) {
this._volume = e, i._ready() && i.flashAudio.setVolume(this.getId(), e)
}, i.prototype.getVolume = function() {
return i._ready() ? i.flashAudio.getVolume(this.getId()) : this._volume
}, i.prototype.setMute = function(e) {
this._muted = e, i._ready() && i.flashAudio.setMute(this.getId(), e)
}, i.prototype.getMute = function() {
return i._ready() ? i.flashAudio.getMute(this.getId()) : this._muted
}, i.prototype.getState = function() {
return this._state
}, i.prototype.getCurrentPosition = function() {
return i._ready() ? i.flashAudio.getCurrentPosition(this.getId()) : 0
}, i.prototype.getLoadedPosition = function() {
return i._ready() ? i.flashAudio.getLoadedPosition(this.getId()) : 0
}, i.prototype.getDuration = function() {
return i._ready() ? i.flashAudio.getDuration(this.getId()) : 0
}, i.prototype.kill = function() {
return i._ready() ? void i.flashAudio.killAudio(this.getId()) : 0
}, i.prototype.getErrorMessage = function() {
return this._errorMessage ? this._errorMessage : i.flashAudio.getErrorMessage(this.getId())
}, i.prototype.getErrorID = function() {
return this._errorID ? this._errorID : i.flashAudio.getErrorID(this.getId())
}, i.prototype.getLevelNum = function() {
return i._ready() ? i.flashAudio.getLevelNum(this.getId()) : 0
}, i.prototype.getLevel = function() {
return i._ready() ? i.flashAudio.getLevel(this.getId()) : 0
}, i.prototype.setLevel = function(e) {
return i._ready() ? i.flashAudio.setLevel(this.getId(), e) : 0
}
},
function(e, t, n) {
function i(e) {
return function(t) {
return null == t ? void 0 : t[e]
}
}
function r(e) {
return null != e && s(m(e))
}
function o(e, t) {
var n = typeof e;
if ("string" == n && f.test(e) || "number" == n) return !0;
if (d(e)) return !1;
var i = !p.test(e);
return i || null != t && e in a(t)
}
function s(e) {
return "number" == typeof e && e > -1 && e % 1 == 0 && g >= e
}
function a(e) {
return l(e) ? e : Object(e)
}
function l(e) {
var t = typeof e;
return !!e && ("object" == t || "function" == t)
}
var u = n(17),
c = n(22),
d = n(21),
h = n(26),
p = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
f = /^\w*$/,
g = 9007199254740991,
m = i("length"),
v = h(function(e, t, n) {
var i = -1,
s = "function" == typeof t,
a = o(t),
l = r(e) ? Array(e.length) : [];
return u(e, function(e) {
var r = s ? t : a && null != e ? e[t] : void 0;
l[++i] = r ? r.apply(e, n) : c(e, t, n)
}), l
});
e.exports = v
},
function(e, t, n) {
function i(e, t) {
return p(e, t, c)
}
function r(e) {
return function(t) {
return null == t ? void 0 : t[e]
}
}
function o(e, t) {
return function(n, i) {
var r = n ? f(n) : 0;
if (!a(r)) return e(n, i);
for (var o = t ? r : -1, s = l(n);
(t ? o-- : ++o < r) && i(s[o], o, s) !== !1;);
return n
}
}
function s(e) {
return function(t, n, i) {
for (var r = l(t), o = i(t), s = o.length, a = e ? s : -1; e ? a-- : ++a < s;) {
var u = o[a];
if (n(r[u], u, r) === !1) break
}
return t
}
}
function a(e) {
return "number" == typeof e && e > -1 && e % 1 == 0 && d >= e
}
function l(e) {
return u(e) ? e : Object(e)
}
function u(e) {
var t = typeof e;
return !!e && ("object" == t || "function" == t)
}
var c = n(18),
d = 9007199254740991,
h = o(i),
p = s(),
f = r("length");
e.exports = h
},
[121, 19, 20, 21], 5, 6, 7,
function(e, t, n) {
function i(e, t, n) {
null == e || r(t, e) || (t = c(t), e = 1 == t.length ? e : l(e, u(t, 0, -1)), t = s(t));
var i = null == e ? e : e[t];
return null == i ? void 0 : i.apply(e, n)
}
function r(e, t) {
var n = typeof e;
if ("string" == n && p.test(e) || "number" == n) return !0;
if (d(e)) return !1;
var i = !h.test(e);
return i || null != t && e in o(t)
}
function o(e) {
return a(e) ? e : Object(e)
}
function s(e) {
var t = e ? e.length : 0;
return t ? e[t - 1] : void 0
}
function a(e) {
var t = typeof e;
return !!e && ("object" == t || "function" == t)
}
var l = n(23),
u = n(24),
c = n(25),
d = n(21),
h = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
p = /^\w*$/;
e.exports = i
},
function(e, t) {
function n(e, t, n) {
if (null != e) {
void 0 !== n && n in i(e) && (t = [n]);
for (var r = 0, o = t.length; null != e && o > r;) e = e[t[r++]];
return r && r == o ? e : void 0
}
}
function i(e) {
return r(e) ? e : Object(e)
}
function r(e) {
var t = typeof e;
return !!e && ("object" == t || "function" == t)
}
e.exports = n
},
function(e, t) {
function n(e, t, n) {
var i = -1,
r = e.length;
t = null == t ? 0 : +t || 0, 0 > t && (t = -t > r ? 0 : r + t), n = void 0 === n || n > r ? r : +n || 0, 0 > n && (n += r), r = t > n ? 0 : n - t >>> 0, t >>>= 0;
for (var o = Array(r); ++i < r;) o[i] = e[i + t];
return o
}
e.exports = n
},
function(e, t, n) {
function i(e) {
return null == e ? "" : e + ""
}
function r(e) {
if (o(e)) return e;
var t = [];
return i(e).replace(s, function(e, n, i, r) {
t.push(i ? r.replace(a, "$1") : n || e)
}), t
}
var o = n(21),
s = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,
a = /\\(\\)?/g;
e.exports = r
},
11,
function(e, t, n) {
function i(e) {
return r(e, o(e))
}
var r = n(28),
o = n(29);
e.exports = i
},
function(e, t) {
function n(e, t) {
for (var n = -1, i = t.length, r = Array(i); ++n < i;) r[n] = e[t[n]];
return r
}
e.exports = n
},
[121, 30, 31, 32], 5, 6, 7,
function(e, t, n) {
function i(e) {
return function() {
for (var t = arguments.length, n = Array(t), i = 0; t > i; i++) n[i] = arguments[i];
this._fnDepth++;
try {
switch (t) {
case 0:
return e.call(this);
case 1:
return e.call(this, n[0]);
case 2:
return e.call(this, n[0], n[1]);
case 3:
return e.call(this, n[0], n[1], n[2]);
default:
return e.apply(this, n)
}
} finally {
if (0 === --this._fnDepth) {
this._fnDepth++;
try {
this[h]()
} finally {
this._fnDepth--
}
}
}
}
}
function r(e, t, n) {
this._fnDepth = 0, this._onExitCallbacks = [];
for (var r in this) "function" == typeof this[r] && r !== h && (this[r] = i.call(this, this[r]));
c(this, ["_checkPlayheadMoving"]), this._state = null, this._type = n, this._id = e.id, this._descriptor = e, this._settings = t, this._currentPosition = this._loadedPosition = this._positionBeforeSeek = this._duration = 0, this._logger = new u(this.getType(), this.getId(), e.title), this._isWaitingForPlayheadToMove = !1, this._lastPlayheadPosition = null, this._stallDetected = !1, this._playheadMovingTimerId = window.setInterval(this._checkPlayheadMoving, this._settings.bufferingDelay), this.updateState(a.INITIALIZE)
}
var o = n(1),
s = n(34),
a = n(36),
l = n(37),
u = n(38),
c = n(40).bindAll,
d = n(41);
e.exports = r;
var h = "_onExit";
o(r.prototype, s), r._capabilities = d.createDefaults(), r.canPlay = function(e) {
return !1
}, r.prototype.play = function(e) {
throw new Error("Not implemented!")
}, r.prototype.seek = function(e) {
throw new Error("Not implemented!")
}, r.prototype.pause = function() {
throw new Error("Not implemented!")
}, r.prototype.resume = function() {
throw new Error("Not implemented!")
}, r.prototype.setVolume = function(e) {
throw new Error("Not implemented!")
}, r.prototype.getVolume = function() {
throw new Error("Not implemented!")
}, r.prototype.setMute = function(e) {
throw new Error("Not implemented!")
}, r.prototype.getMute = function() {
throw new Error("Not implemented!")
}, r.prototype.getMaxBufferLength = function() {
throw new Error("Not implemented!")
}, r.prototype.setMaxBufferLength = function(e) {
throw new Error("Not implemented!")
}, r.prototype.kill = function() {}, r.prototype.getErrorMessage = function() {
throw new Error("Not implemented!")
}, r.prototype.getErrorID = function() {
throw new Error("Not implemented!")
}, r.prototype.getCapabilities = function() {
return this.constructor._capabilities || r._capabilities
}, r.prototype.getLogger = function() {
return this._logger
}, r.prototype.getSettings = function() {
return this._settings
}, r.prototype.getDescriptor = function() {
return this._descriptor
}, r.prototype.getType = function() {
return this._type
}, r.prototype.getId = function() {
return this._id + ""
}, r.prototype.beforeStateChange = function(e, t) {
return !0
}, r.prototype.afterStateChange = function(e, t) {}, r.prototype.updateState = function(e) {
var t = this._state;
if (t !== e) {
if (t === a.DEAD) throw new Error("Can't transition out of DEAD state.");
if (t === a.ERROR && e !== a.DEAD) throw new Error("Can only transition from DEAD to ERROR state.");
this.beforeStateChange(t, e) && (this._state = e, e === a.INITIALIZE ? this._logger.log('State changed "' + e + '"') : this._logger.log('State changed "' + this.getState() + '", position: ' + this.getCurrentPosition() + ", duration: " + this.getDuration()), e === a.PLAYING ? (this._stallDetected = !1, this._lastPlayheadPosition = null) : e === a.DEAD && window.clearInterval(this._playheadMovingTimerId), this.afterStateChange(t, e), this._triggerOnExit(l.STATE_CHANGE, e, this))
}
}, r.prototype.getState = function() {
return this._state
}, r.prototype._isInOneOfStates = function() {
for (var e in arguments)
if (arguments[e] === this.getState()) return !0;
return !1
}, r.prototype.getCurrentPosition = function() {
return Math.min(this._currentPosition, this._duration)
}, r.prototype.getLoadedPosition = function() {
return Math.min(this._loadedPosition, this._duration)
}, r.prototype.getDuration = function() {
return this._duration
}, r.prototype._triggerPositionChangeEvent = function() {
this._triggerOnExit(l.POSITION_CHANGE, this.getCurrentPosition(), this.getLoadedPosition(), this.getDuration(), this)
}, r.prototype._triggerOnExit = function() {
var e = arguments;
this._onExitCallbacks.push(function() {
this.trigger.apply(this, e)
}.bind(this))
}, r.prototype._onExit = function() {
var e = this._onExitCallbacks.slice();
this._onExitCallbacks = [], e.forEach(function(e) {
e()
})
}, r.prototype._onStalled = function() {
this._logger.log("Stall detected.")
}, r.prototype._notifyStalled = function() {
this._stallDetected || (this._stallDetected = !0, this._onStalled())
}, r.prototype._checkPlayheadMoving = function() {
if (this.getState() === a.PLAYING && !this._stallDetected) {
var e = this.getCurrentPosition(),
t = this._lastPlayheadPosition;
null !== t && e - t === 0 && this._notifyStalled(), this._lastPlayheadPosition = e
}
}
},
function(e, t, n) {
e.exports = n(35)
},
function(e, t, n) {
! function() {
function n() {
return {
keys: Object.keys || function(e) {
if ("object" != typeof e && "function" != typeof e || null === e) throw new TypeError("keys() called on a non-object");
var t, n = [];
for (t in e) e.hasOwnProperty(t) && (n[n.length] = t);
return n
},
uniqueId: function(e) {
var t = ++a + "";
return e ? e + t : t
},
has: function(e, t) {
return o.call(e, t)
},
each: function(e, t, n) {
if (null != e)
if (r && e.forEach === r) e.forEach(t, n);
else if (e.length === +e.length)
for (var i = 0, o = e.length; o > i; i++) t.call(n, e[i], i, e);
else
for (var s in e) this.has(e, s) && t.call(n, e[s], s, e)
},
once: function(e) {
var t, n = !1;
return function() {
return n ? t : (n = !0, t = e.apply(this, arguments), e = null, t)
}
}
}
}
var i, r = Array.prototype.forEach,
o = Object.prototype.hasOwnProperty,
s = Array.prototype.slice,
a = 0,
l = n();
i = {
on: function(e, t, n) {
if (!c(this, "on", e, [t, n]) || !t) return this;
this._events || (this._events = {});
var i = this._events[e] || (this._events[e] = []);
return i.push({
callback: t,
context: n,
ctx: n || this
}), this
},
once: function(e, t, n) {
if (!c(this, "once", e, [t, n]) || !t) return this;
var i = this,
r = l.once(function() {
i.off(e, r), t.apply(this, arguments)
});
return r._callback = t, this.on(e, r, n)
},
off: function(e, t, n) {
var i, r, o, s, a, u, d, h;
if (!this._events || !c(this, "off", e, [t, n])) return this;
if (!e && !t && !n) return this._events = {}, this;
for (s = e ? [e] : l.keys(this._events), a = 0, u = s.length; u > a; a++)
if (e = s[a], o = this._events[e]) {
if (this._events[e] = i = [], t || n)
for (d = 0, h = o.length; h > d; d++) r = o[d], (t && t !== r.callback && t !== r.callback._callback || n && n !== r.context) && i.push(r);
i.length || delete this._events[e]
}
return this
},
trigger: function(e) {
if (!this._events) return this;
var t = s.call(arguments, 1);
if (!c(this, "trigger", e, t)) return this;
var n = this._events[e],
i = this._events.all;
return n && d(n, t), i && d(i, arguments), this
},
stopListening: function(e, t, n) {
var i = this._listeners;
if (!i) return this;
var r = !t && !n;
"object" == typeof t && (n = this), e && ((i = {})[e._listenerId] = e);
for (var o in i) i[o].off(t, n, this), r && delete this._listeners[o];
return this
}
};
var u = /\s+/,
c = function(e, t, n, i) {
if (!n) return !0;
if ("object" == typeof n) {
for (var r in n) e[t].apply(e, [r, n[r]].concat(i));
return !1
}
if (u.test(n)) {
for (var o = n.split(u), s = 0, a = o.length; a > s; s++) e[t].apply(e, [o[s]].concat(i));
return !1
}
return !0
},
d = function(e, t) {
var n, i = -1,
r = e.length,
o = t[0],
s = t[1],
a = t[2];
switch (t.length) {
case 0:
for (; ++i < r;)(n = e[i]).callback.call(n.ctx);
return;
case 1:
for (; ++i < r;)(n = e[i]).callback.call(n.ctx, o);
return;
case 2:
for (; ++i < r;)(n = e[i]).callback.call(n.ctx, o, s);
return;
case 3:
for (; ++i < r;)(n = e[i]).callback.call(n.ctx, o, s, a);
return;
default:
for (; ++i < r;)(n = e[i]).callback.apply(n.ctx, t)
}
},
h = {
listenTo: "on",
listenToOnce: "once"
};
l.each(h, function(e, t) {
i[t] = function(t, n, i) {
var r = this._listeners || (this._listeners = {}),
o = t._listenerId || (t._listenerId = l.uniqueId("l"));
return r[o] = t, "object" == typeof n && (i = this), t[e](n, i, this), this
}
}), i.bind = i.on, i.unbind = i.off, i.mixin = function(e) {
var t = ["on", "once", "off", "trigger", "stopListening", "listenTo", "listenToOnce", "bind", "unbind"];
return l.each(t, function(t) {
e[t] = this[t]
}, this), e
}, "undefined" != typeof e && e.exports && (t = e.exports = i), t.BackboneEvents = i
}(this)
},
function(e, t) {
e.exports = {
PLAYING: "playing",
LOADING: "loading",
SEEKING: "seeking",
PAUSED: "paused",
ERROR: "error",
IDLE: "idle",
INITIALIZE: "initialize",
ENDED: "ended",
DEAD: "dead"
}
},
function(e, t) {
e.exports = {
POSITION_CHANGE: "position-change",
STATE_CHANGE: "state-change",
DATA: "data",
NETWORK_TIMEOUT: "network-timeout",
METADATA: "metadata"
}
},
function(e, t, n) {
var i, r = n(39),
o = null;
e.exports = function(e, t, n) {
if (!i && (i = r({
buffer: !0,
label: "audiomanager"
}), o)) {
var s = i;
i = function() {
s(o(arguments[0] + "%s", Array.prototype.slice.call(arguments, 1)))
}
}
return n = n && n.length ? " [" + n.replace(/\s/g, "").substr(0, 6) + "]" : "", {
log: i.bind(null, "%s (%s)%s", e, t, n)
}
}
},
function(e, t) {
"use strict";
function n() {
function e(e, n) {
if (p) {
for (var i = arguments.length, r = Array(i > 2 ? i - 2 : 0), o = 2; i > o; o++) r[o - 2] = arguments[o];
"string" == typeof n ? n = " " + n : (r.unshift(n), n = "");
var s = [t() + " | " + A + (k ? "%c" : "") + n].concat(E, r);
m ? T.push({
level: e,
logArgs: s
}) > x && T.shift() : h[e].apply(h, s)
}
}
function t() {
var e = new Date,
t = null === S ? 0 : e - S,
n = k ? "%c" : "";
return S = +e, n + i(e) + (n + " (" + n) + r("+" + t + "ms", " ", 8) + (n + ")")
}
function n(e) {
return e.enable = function() {
p = !0
}, e.disable = function() {
p = !1
}, e.bufferOn = function() {
m = !0
}, e.bufferOff = function() {
m = !1, T.length = 0
}, e.flush = u() ? function() {
T.forEach(function(e) {
var t = e.level,
n = e.logArgs;
h[t].apply(h, n)
}), T.length = 0
} : function() {}, e
}
var o = c.apply(void 0, arguments),
s = o.enabled,
p = void 0 === s ? !0 : s,
g = o.buffer,
m = void 0 === g ? !1 : g,
v = o.label,
_ = void 0 === v ? "" : v,
y = o.plainOutput,
b = void 0 === y ? !1 : y,
w = o.bufferSize,
x = void 0 === w ? 1e3 : w;
if (!u()) return n(d.reduce(function(e, t) {
return e[t] = e
}, function() {}));
h.CL || (h.CL = {
_cssCounter: 0
});
var k = !b && l(),
S = null,
T = [],
A = a(_, k),
E = k ? ["color: green", "color: grey", "color: blue", "color: grey", f(_), ""] : [],
C = h.CL[_] = n(d.reduce(function(t, n) {
return t[n] = e.bind(null, n), t
}, e.bind(null, "log")));
return C
}
function i(e) {
return o(e.getHours()) + ":" + o(e.getMinutes()) + ":" + o(e.getSeconds()) + "." + r(e.getMilliseconds(), "0", 3)
}
function r(e, t, n) {
return s(t, n - ("" + e).length) + e
}
function o(e) {
return r(e, "0", 2)
}
function s(e, t) {
return t > 0 ? new Array(t + 1).join(e) : ""
}
function a(e, t) {
return (t ? "%c" : "") + (e ? e : "")
}
function l() {
if ("undefined" == typeof navigator) return !1;
var e = navigator.userAgent;
return /chrome|firefox|opr/i.test(e) && !/msie|edge/i.test(e)
}
function u() {
return h && d.every(function(e) {
return "function" == typeof h[e]
})
}
function c() {
var e = arguments.length <= 0 || void 0 === arguments[0] ? !0 : arguments[0],
t = arguments.length <= 1 || void 0 === arguments[1] ? "" : arguments[1];
return "object" == typeof e && e || {
enabled: e,
label: t
}
}
e.exports = n;
var d = ["log", "info", "warn", "error"],
h = "undefined" != typeof console ? console : null,
p = ["color:#fff", "border-radius:3px", "padding:2px 4px", "font-family:sans-serif", "text-transform:uppercase", "font-size:9px"].join(";") + ";",
f = function() {
var e = ["#51613C", "#447848", "#486E5F", "#787444", "#6E664E"];
return function(t) {
return t ? "background:" + e[h.CL._cssCounter++ % e.length] + ";" + p : ""
}
}()
},
function(e, t) {
function n(e, t) {
var n = new Uint8Array(e.byteLength + t.byteLength);
return n.set(new Uint8Array(e), 0), n.set(new Uint8Array(t), e.byteLength), n
}
function i(e) {
for (var t = [], n = 0; n < e.length; n++) t.push({
start: 1e3 * e.start(n),
end: 1e3 * e.end(n)
});
return t
}
function r(e) {
return e.slice(0).sort(function(e, t) {
return e.start - t.start
}).reduce(function(e, t, n, i) {
return n > 0 && i[n - 1].end === t.start ? i[n - 1].end = t.end : e.push(t), e
}, [])
}
function o(e, t, n) {
return r(n).some(s(e, t))
}
function s(e, t) {
return function(n) {
return e >= n.start && t <= n.end
}
}
function a(e) {
var t = e / c,
n = u * (Math.pow(Math.E, t) / Math.E);
return n = Math.min(n, d), n += Math.random() * l
}
var l = 200,
u = 500,
c = 3,
d = 45e3;
e.exports = {
bindAll: function(e, t) {
t.forEach(function(t) {
if (!e[t]) throw new Error(t + " doesn't exist.");
e[t] = e[t].bind(e)
})
},
concatBuffersToUint8Array: n,
timeRangesToFlatMap: i,
normaliseTimeRanges: r,
isRangeInTimeRanges: o,
getRetryTime: a
}
},
function(e, t) {
function n(e) {
for (var t in r)
if (r.hasOwnProperty(t) && void 0 === e[r[t]]) throw new Error("Caps lack required field: " + t);
if (!(e[r.PROTOCOLS] instanceof Array)) throw new Error("Caps protocols must be an array");
if (!(e[r.MIMETYPES] instanceof Array)) throw new Error("Caps mimetypes must be an array");
return !0
}
function i() {
var e = {};
return e[r.MIMETYPES] = [], e[r.PROTOCOLS] = [], e[r.AUDIO_ONLY] = !0, e[r.CAN_SEEK_ALWAYS] = !0, e[r.CAN_CONTROL_BUFFER] = !1, e[r.NEEDS_URL_REFRESH] = !0, e
}
var r = {
MIMETYPES: "mimetypes",
PROTOCOLS: "protocols",
AUDIO_ONLY: "audioOnly",
CAN_SEEK_ALWAYS: "canSeekAlways",
CAN_CONTROL_BUFFER: "canControlBuffer",
NEEDS_URL_REFRESH: "needsUrlRefresh"
},
o = {
createDefaults: i,
names: r,
validate: n
};
e.exports = o
},
function(e, t) {
e.exports = {
FLASH_HLS_PLAYLIST_NOT_FOUND: "HLS_PLAYLIST_NOT_FOUND",
FLASH_HLS_PLAYLIST_SECURITY_ERROR: "HLS_SECURITY_ERROR",
FLASH_HLS_NOT_VALID_PLAYLIST: "HLS_NOT_VALID_PLAYLIST",
FLASH_HLS_NO_TS_IN_PLAYLIST: "HLS_NO_TS_IN_PLAYLIST",
FLASH_HLS_NO_PLAYLIST_IN_MANIFEST: "HLS_NO_PLAYLIST_IN_MANIFEST",
FLASH_HLS_TS_IS_CORRUPT: "HLS_TS_IS_CORRUPT",
FLASH_HLS_FLV_TAG_CORRUPT: "HLS_FLV_TAG_CORRUPT",
FLASH_HTTP_FILE_NOT_FOUND: "HTTP_FILE_NOT_FOUND",
FLASH_RTMP_CONNECT_FAILED: "RTMP_CONNECT_FAILED",
FLASH_RTMP_CONNECT_CLOSED: "RTMP_CONNECT_CLOSED",
FLASH_RTMP_CANNOT_PLAY_STREAM: "RTMP_CANNOT_PLAY_STREAM",
FLASH_PROXY_CANT_LOAD_FLASH: "CANT_LOAD_FLASH",
FLASH_PROXY_FLASH_BLOCKED: "FLASH_PROXY_FLASH_BLOCKED",
GENERIC_AUDIO_ENDED_EARLY: "GENERIC_AUDIO_ENDED_EARLY",
GENERIC_AUDIO_OVERRUN: "GENERIC_AUDIO_OVERRUN",
HTML5_AUDIO_ABORTED: "HTML5_AUDIO_ABORTED",
HTML5_AUDIO_NETWORK: "HTML5_AUDIO_NETWORK",
HTML5_AUDIO_DECODE: "HTML5_AUDIO_DECODE",
HTML5_AUDIO_SRC_NOT_SUPPORTED: "HTML5_AUDIO_SRC_NOT_SUPPORTED",
MSE_BAD_OBJECT_STATE: "MSE_BAD_OBJECT_STATE",
MSE_HLS_NOT_VALID_PLAYLIST: "MSE_HLS_NOT_VALID_PLAYLIST",
MSE_HLS_PLAYLIST_NOT_FOUND: "MSE_HLS_PLAYLIST_NOT_FOUND",
MSE_HLS_SEGMENT_NOT_FOUND: "MSE_HLS_SEGMENT_NOT_FOUND",
MSE_HLS_CANNOT_RETRY: "MSE_HLS_CANNOT_RETRY"
}
},
function(e, t) {
e.exports = {
AAC: "audio/aac",
M3U8: "application/x-mpegURL",
HLS: "application/vnd.apple.mpegurl",
MP4A: "audio/mp4",
MP3: "audio/mpeg",
OGG: "audio/ogg",
WAV: "audio/wav",
WEBMA: "audio/webm",
getTypeByExtension: function(e) {
var t = {
mp3: this.MP3,
aac: this.AAC,
mp4: this.MP4A,
mp4a: this.MP4A,
ogg: this.OGG,
oga: this.OGG,
opus: this.OGG,
webm: this.WEBM,
wav: this.WAV,
m3u8: this.M3U8
};
return t[e] || null
}
}
},
function(e, t) {
function n() {
if (!G && document.getElementsByTagName("body")[0]) {
try {
var e, t = y("span");
t.style.display = "none", e = z.getElementsByTagName("body")[0].appendChild(t), e.parentNode.removeChild(e), e = null, t = null
} catch (n) {
return
}
G = !0;
for (var i = W.length, r = 0; i > r; r++) W[r]()
}
}
function i(e) {
G ? e() : W[W.length] = e
}
function r(e) {
if (typeof U.addEventListener != R) U.addEventListener("load", e, !1);
else if (typeof z.addEventListener != R) z.addEventListener("load", e, !1);
else if (typeof U.attachEvent != R) w(U, "onload", e);
else if ("function" == typeof U.onload) {
var t = U.onload;
U.onload = function() {
t(), e()
}
} else U.onload = e
}
function o() {
var e = z.getElementsByTagName("body")[0],
t = y(L);
t.setAttribute("style", "visibility: hidden;"), t.setAttribute("type", N);
var n = e.appendChild(t);
if (n) {
var i = 0;
! function r() {
if (typeof n.GetVariable != R) try {
var o = n.GetVariable("$version");
o && (o = o.split(" ")[1].split(","), Q.pv = [b(o[0]), b(o[1]), b(o[2])])
} catch (a) {
Q.pv = [8, 0, 0]
} else if (10 > i) return i++, void window.setTimeout(r, 10);
e.removeChild(t), n = null, s()
}()
} else s()
}
function s() {
var e = q.length;
if (e > 0)
for (var t = 0; e > t; t++) {
var n = q[t].id,
i = q[t].callbackFn,
r = {
success: !1,
id: n
};
if (Q.pv[0] > 0) {
var o = _(n);
if (o)
if (!x(q[t].swfVersion) || Q.wk && Q.wk < 312)
if (q[t].expressInstall && l()) {
var s = {};
s.data = q[t].expressInstall, s.width = o.getAttribute("width") || "0", s.height = o.getAttribute("height") || "0", o.getAttribute("class") && (s.styleclass = o.getAttribute("class")), o.getAttribute("align") && (s.align = o.getAttribute("align"));
for (var d = {}, h = o.getElementsByTagName("param"), p = h.length, f = 0; p > f; f++) "movie" !== h[f].getAttribute("name").toLowerCase() && (d[h[f].getAttribute("name")] = h[f].getAttribute("value"));
u(s, d, n, i)
} else c(o), i && i(r);
else S(n, !0), i && (r.success = !0, r.ref = a(n), r.id = n, i(r))
} else if (S(n, !0), i) {
var g = a(n);
g && typeof g.SetVariable != R && (r.success = !0, r.ref = g, r.id = g.id), i(r)
}
}
}
function a(e) {
var t = null,
n = _(e);
return n && "OBJECT" === n.nodeName.toUpperCase() && (t = typeof n.SetVariable !== R ? n : n.getElementsByTagName(L)[0] || n), t
}
function l() {
return !K && x("6.0.65") && (Q.win || Q.mac) && !(Q.wk && Q.wk < 312)
}
function u(e, t, n, i) {
var r = _(n);
if (n = v(n), K = !0, D = i || null, P = {
success: !1,
id: n
}, r) {
"OBJECT" === r.nodeName.toUpperCase() ? (E = d(r), C = null) : (E = r, C = n), e.id = B, (typeof e.width == R || !/%$/.test(e.width) && b(e.width) < 310) && (e.width = "310"), (typeof e.height == R || !/%$/.test(e.height) && b(e.height) < 137) && (e.height = "137");
var o = Q.ie ? "ActiveX" : "PlugIn",
s = "MMredirectURL=" + encodeURIComponent(U.location.toString().replace(/&/g, "%26")) + "&MMplayerType=" + o + "&MMdoctitle=" + encodeURIComponent(z.title.slice(0, 47) + " - Flash Player Installation");
if (typeof t.flashvars != R ? t.flashvars += "&" + s : t.flashvars = s, Q.ie && 4 !== r.readyState) {
var a = y("div");
n += "SWFObjectNew", a.setAttribute("id", n), r.parentNode.insertBefore(a, r), r.style.display = "none", g(r)
}
p(e, t, n)
}
}
function c(e) {
if (Q.ie && 4 !== e.readyState) {
e.style.display = "none";
var t = y("div");
e.parentNode.insertBefore(t, e), t.parentNode.replaceChild(d(e), t), g(e)
} else e.parentNode.replaceChild(d(e), e)
}
function d(e) {
var t = y("div");
if (Q.win && Q.ie) t.innerHTML = e.innerHTML;
else {
var n = e.getElementsByTagName(L)[0];
if (n) {
var i = n.childNodes;
if (i)
for (var r = i.length, o = 0; r > o; o++) 1 === i[o].nodeType && "PARAM" === i[o].nodeName || 8 === i[o].nodeType || t.appendChild(i[o].cloneNode(!0))
}
}
return t
}
function h(e, t) {
var n = y("div");
return n.innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'><param name='movie' value='" + e + "'>" + t + "</object>", n.firstChild
}
function p(e, t, n) {
var i, r = _(n);
if (n = v(n), Q.wk && Q.wk < 312) return i;
if (r) {
var o, s, a, l = y(Q.ie ? "div" : L);
typeof e.id == R && (e.id = n);
for (a in t) t.hasOwnProperty(a) && "movie" !== a.toLowerCase() && f(l, a, t[a]);
Q.ie && (l = h(e.data, l.innerHTML));
for (o in e) e.hasOwnProperty(o) && (s = o.toLowerCase(), "styleclass" === s ? l.setAttribute("class", e[o]) : "classid" !== s && "data" !== s && l.setAttribute(o, e[o]));
Q.ie ? Y[Y.length] = e.id : (l.setAttribute("type", N), l.setAttribute("data", e.data)), r.parentNode.replaceChild(l, r), i = l
}
return i
}
function f(e, t, n) {
var i = y("param");
i.setAttribute("name", t), i.setAttribute("value", n), e.appendChild(i)
}
function g(e) {
var t = _(e);
t && "OBJECT" === t.nodeName.toUpperCase() && (Q.ie ? (t.style.display = "none", function n() {
if (4 === t.readyState) {
for (var e in t) "function" == typeof t[e] && (t[e] = null);
t.parentNode.removeChild(t)
} else window.setTimeout(n, 10)
}()) : t.parentNode.removeChild(t))
}
function m(e) {
return e && e.nodeType && 1 === e.nodeType
}
function v(e) {
return m(e) ? e.id : e
}
function _(e) {
if (m(e)) return e;
var t = null;
try {
t = z.getElementById(e)
} catch (n) {}
return t
}
function y(e) {
return z.createElement(e)
}
function b(e) {
return parseInt(e, 10)
}
function w(e, t, n) {
e.attachEvent(t, n), V[V.length] = [e, t, n]
}
function x(e) {
e += "";
var t = Q.pv,
n = e.split(".");
return n[0] = b(n[0]), n[1] = b(n[1]) || 0, n[2] = b(n[2]) || 0, t[0] > n[0] || t[0] === n[0] && t[1] > n[1] || t[0] === n[0] && t[1] === n[1] && t[2] >= n[2] ? !0 : !1
}
function k(e, t, n, i) {
var r = z.getElementsByTagName("head")[0];
if (r) {
var o = "string" == typeof n ? n : "screen";
if (i && (M = null, I = null), !M || I !== o) {
var s = y("style");
s.setAttribute("type", "text/css"), s.setAttribute("media", o), M = r.appendChild(s), Q.ie && typeof z.styleSheets != R && z.styleSheets.length > 0 && (M = z.styleSheets[z.styleSheets.length - 1]), I = o
}
M && (typeof M.addRule != R ? M.addRule(e, t) : typeof z.createTextNode != R && M.appendChild(z.createTextNode(e + " {" + t + "}")))
}
}
function S(e, t) {
if (X) {
var n = t ? "visible" : "hidden",
i = _(e);
G && i ? i.style.visibility = n : "string" == typeof e && k("#" + e, "visibility:" + n)
}
}
function T(e) {
var t = /[\\\"<>\.;]/,
n = null != t.exec(e);
return n && typeof encodeURIComponent != R ? encodeURIComponent(e) : e
}
/*! SWFObject v2.3.20130521 <http://github.com/swfobject/swfobject>
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var A, E, C, D, P, M, I, R = "undefined",
L = "object",
O = "Shockwave Flash",
F = "ShockwaveFlash.ShockwaveFlash",
N = "application/x-shockwave-flash",
B = "SWFObjectExprInst",
$ = "onreadystatechange",
U = window,
z = document,
H = navigator,
j = !1,
W = [],
q = [],
Y = [],
V = [],
G = !1,
K = !1,
X = !0,
Z = !1,
Q = function() {
var e = typeof z.getElementById != R && typeof z.getElementsByTagName != R && typeof z.createElement != R,
t = H.userAgent.toLowerCase(),
n = H.platform.toLowerCase(),
i = n ? /win/.test(n) : /win/.test(t),
r = n ? /mac/.test(n) : /mac/.test(t),
o = /webkit/.test(t) ? parseFloat(t.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : !1,
s = "Microsoft Internet Explorer" === H.appName,
a = [0, 0, 0],
l = null;
if (typeof H.plugins != R && typeof H.plugins[O] == L) l = H.plugins[O].description, l && typeof H.mimeTypes != R && H.mimeTypes[N] && H.mimeTypes[N].enabledPlugin && (j = !0, s = !1, l = l.replace(/^.*\s+(\S+\s+\S+$)/, "$1"), a[0] = b(l.replace(/^(.*)\..*$/, "$1")), a[1] = b(l.replace(/^.*\.(.*)\s.*$/, "$1")), a[2] = /[a-zA-Z]/.test(l) ? b(l.replace(/^.*[a-zA-Z]+(.*)$/, "$1")) : 0);
else if (typeof U.ActiveXObject != R) try {
var u = new ActiveXObject(F);
u && (l = u.GetVariable("$version"), l && (s = !0, l = l.split(" ")[1].split(","), a = [b(l[0]), b(l[1]), b(l[2])]))
} catch (c) {}
return {
w3: e,
pv: a,
wk: o,
ie: s,
win: i,
mac: r
}
}();
(function() {
Q.w3 && ((typeof z.readyState != R && ("complete" === z.readyState || "interactive" === z.readyState) || typeof z.readyState == R && (z.getElementsByTagName("body")[0] || z.body)) && n(), G || (typeof z.addEventListener != R && z.addEventListener("DOMContentLoaded", n, !1), Q.ie && (z.attachEvent($, function e() {
"complete" === z.readyState && (z.detachEvent($, e), n())
}), U === top && ! function t() {
if (!G) {
try {
z.documentElement.doScroll("left")
} catch (e) {
return void window.setTimeout(t, 0)
}
n()
}
}()), Q.wk && ! function i() {
return G ? void 0 : /loaded|complete/.test(z.readyState) ? void n() : void window.setTimeout(i, 0)
}()))
})();
W[0] = function() {
j ? o() : s()
};
(function() {
Q.ie && window.attachEvent("onunload", function() {
for (var e = V.length, t = 0; e > t; t++) V[t][0].detachEvent(V[t][1], V[t][2]);
for (var n = Y.length, i = 0; n > i; i++) g(Y[i]);
for (var r in Q) Q[r] = null;
Q = null;
for (var o in A) A[o] = null;
A = null
})
})();
e.exports = A = {
registerObject: function(e, t, n, i) {
if (Q.w3 && e && t) {
var r = {};
r.id = e, r.swfVersion = t, r.expressInstall = n, r.callbackFn = i, q[q.length] = r, S(e, !1)
} else i && i({
success: !1,
id: e
})
},
getObjectById: function(e) {
return Q.w3 ? a(e) : void 0
},
embedSWF: function(e, t, n, r, o, s, a, c, d, h) {
var f = v(t),
g = {
success: !1,
id: f
};
Q.w3 && !(Q.wk && Q.wk < 312) && e && t && n && r && o ? (S(f, !1), i(function() {
n += "", r += "";
var i = {};
if (d && typeof d === L)
for (var m in d) i[m] = d[m];
i.data = e, i.width = n, i.height = r;
var v = {};
if (c && typeof c === L)
for (var _ in c) v[_] = c[_];
if (a && typeof a === L)
for (var y in a)
if (a.hasOwnProperty(y)) {
var b = Z ? encodeURIComponent(y) : y,
w = Z ? encodeURIComponent(a[y]) : a[y];
typeof v.flashvars != R ? v.flashvars += "&" + b + "=" + w : v.flashvars = b + "=" + w
}
if (x(o)) {
var k = p(i, v, t);
i.id === f && S(f, !0), g.success = !0, g.ref = k, g.id = k.id
} else {
if (s && l()) return i.data = s, void u(i, v, t, h);
S(f, !0)
}
h && h(g)
})) : h && h(g)
},
switchOffAutoHideShow: function() {
X = !1
},
enableUriEncoding: function(e) {
Z = typeof e === R ? !0 : e
},
ua: Q,
getFlashPlayerVersion: function() {
return {
major: Q.pv[0],
minor: Q.pv[1],
release: Q.pv[2]
}
},
hasFlashPlayerVersion: x,
createSWF: function(e, t, n) {
return Q.w3 ? p(e, t, n) : void 0
},
showExpressInstall: function(e, t, n, i) {
Q.w3 && l() && u(e, t, n, i)
},
removeSWF: function(e) {
Q.w3 && g(e)
},
createCSS: function(e, t, n, i) {
Q.w3 && k(e, t, n, i)
},
addDomLoadEvent: i,
addLoadEvent: r,
getQueryParamValue: function(e) {
var t = z.location.search || z.location.hash;
if (t) {
if (/\?/.test(t) && (t = t.split("?")[1]), null == e) return T(t);
for (var n = t.split("&"), i = 0; i < n.length; i++)
if (n[i].substring(0, n[i].indexOf("=")) === e) return T(n[i].substring(n[i].indexOf("=") + 1))
}
return ""
},
expressInstallCallback: function() {
if (K) {
var e = _(B);
e && E && (e.parentNode.replaceChild(E, e), C && (S(C, !0), Q.ie && (E.style.display = "block")), D && D(P)), K = !1
}
},
version: "2.3"
}
},
function(e, t, n) {
function i(e, t, n, i, r) {
u.prototype.constructor.call(this, e, t, n || "HTML5AudioPlayer"), this.getState() !== s.ERROR && (this._providedAudioElement = i, this._deferAudioTagCreation = null != r ? r : !0, this._hasLoaded = !1, this._playCalled = !1, this._playRequested = !1, this._startFromPosition = null, this._positionSeekingTo = null, this._fakeSeekCompletionTimer = null, this._positionChangeTimerId = null, this._waitingForPlayingEvent = !1, this._html5Audio = null, this._pendingVolume = 1, this._pendingMuted = !1, this._audioElementReady = !1, this._trueDuration = !1, this._descriptor.duration && (this._duration = this._descriptor.duration), this._bindHandlers(), this._deferAudioTagCreation || this._initMediaElement(!1), this.updateState(s.IDLE))
}
var r = n(1),
o = n(40).bindAll,
s = n(36),
a = n(37),
l = n(42),
u = n(33),
c = n(46),
d = n(40);
e.exports = i;
var h = /maybe|probably/i;
r(i.prototype, u.prototype), i.MediaAPIEvents = ["ended", "play", "playing", "pause", "seeking", "waiting", "seeked", "error", "loadedmetadata", "timeupdate", "loadstart", "progress", "suspend"], i.canPlay = function(e) {
if (!c.supportHTML5Audio()) return !1;
var t = window.document.createElement("audio");
return t && t.canPlayType ? h.test(t.canPlayType(e.mimeType)) : !1
}, i.prototype.getLoadedPosition = function() {
return this._html5Audio && this._updateLoadedPosition(d.timeRangesToFlatMap(this._html5Audio.buffered)), u.prototype.getLoadedPosition.call(this)
}, i.prototype.play = function(e) {
if (this._isInOneOfStates(s.ERROR, s.DEAD)) return void this._logger.log("Play called but state is ERROR or DEAD.");
if (this._playCalled) return this._logger.log("play() has already been called so calling resume() instead."), "undefined" != typeof e && (this._logger.log("A time was provided so seeking to there first."), this.seek(e)), void this.resume();
this._playCalled = !0, "undefined" != typeof e && this._setStartPosition(e);
var t = this._startFromPosition;
this._logger.log("Play"), this._playRequested = !0, this.updateState(s.LOADING), this._hasLoaded ? (null !== t && this._seek(t), this._play()) : (this._logger.log("Cannot play yet as not finished loading. Will play when loading complete (unless pause() happens before this)."), this._deferAudioTagCreation && this._initMediaElement(!0))
}, i.prototype.pause = function() {
this._isInOneOfStates(s.ERROR, s.DEAD) || (this._logger.log("pause"), this._hasLoaded ? this._html5Audio.pause() : (this._playRequested = !1, null === this._startFromPosition && this.updateState(s.PAUSED)))
}, i.prototype.seek = function(e) {
return this._isInOneOfStates(s.ERROR, s.DEAD) ? void this._logger.log("Seek called but state is ERROR or DEAD.") : (this._logger.log("Seek to " + e), this._hasLoaded ? void this._seek(e) : 0 >= e ? (this._logger.log("Not scheduling seek as playback will start at 0 anyway."), void(this._playRequested || this.updateState(s.PAUSED))) : (this.updateState(s.LOADING), this._setStartPosition(e), void this._logger.log("Postponing seek for when loaded.")))
}, i.prototype.resume = function() {
return this._isInOneOfStates(s.ERROR, s.DEAD) ? void this._logger.log("Resume called but state is ERROR or DEAD.") : (this._logger.log("Resume"), this._playCalled ? this._hasLoaded ? void this._play() : (this._playRequested = !0, void this.updateState(s.LOADING)) : (this._logger.log("Calling play() instead as play hasn't been called yet."), void this.play()))
}, i.prototype.getCurrentPosition = function() {
var e = this.getState() === s.SEEKING ? this._positionBeforeSeek : this._currentPosition;
return Math.min(e, this._duration)
}, i.prototype.setVolume = function(e) {
return this._html5Audio ? void(this._html5Audio.volume = e) : void(this._pendingVolume = e)
}, i.prototype.getVolume = function() {
return this._html5Audio ? this._html5Audio.volume : this._pendingVolume
}, i.prototype.setMute = function(e) {
return this._html5Audio ? void(this._html5Audio.muted = e) : void(this._pendingMuted = e)
}, i.prototype.getMute = function() {
return this._html5Audio ? this._html5Audio.muted : this._pendingMuted
}, i.prototype.kill = function() {
this._state !== s.DEAD && (this._state !== s.ERROR && this._kill(), this.updateState(s.DEAD), this._logger.log("Dead"))
}, i.prototype.getErrorMessage = function() {
return this._errorMessage
}, i.prototype.getErrorID = function() {
return this._errorID
}, i.prototype._bindHandlers = function() {
o(this, ["_onPositionChange", "_handleHtml5MediaEvent", "_onHtml5MediaEvent", "_onLoadedMetadata", "_onBufferUpdate"])
}, i.prototype._initMediaElement = function(e) {
if (this._html5Audio) throw new Error("Audio element already initialised.");
this._logger.log("Initialising audio element.");
var t = this._getMediaElementMimeType(),
n = this._getMediaElementSrc();
this._html5Audio = this._providedAudioElement || c.createAudioElement(), this._html5Audio.id = this._settings.audioObjectID + "_" + this.getId(), this._html5Audio.preload = "auto", this._html5Audio.type = t || "", this._html5Audio.src = n || "", this._html5Audio.muted = this._pendingMuted, this._html5Audio.volume = this._pendingVolume, this._toggleEventListeners(!0), this._html5Audio.load()
}, i.prototype._getMediaElementSrc = function() {
return this.getDescriptor().src
}, i.prototype._getMediaElementMimeType = function() {
return this.getDescriptor().mimeType
}, i.prototype._seek = function(e) {
e = this._fixPosition(e);
var t = 1e3 * this._html5Audio.currentTime === e;
return this.getState() === s.SEEKING && t ? void this._logger.log("Seek already in progress to the same position. Ignoring seek request.") : (this._cancelFakeSeekCompletionTimer(), this._logger.log("Attempting seek to " + e), this._shouldBeEnded(e) ? (this._logger.log("Position is right near the end so going to ENDED state."), this._html5Audio.pause(), this._currentPosition = e, this.updateState(s.SEEKING), this.updateState(s.ENDED), void this._onPositionChange()) : t ? (this._logger.log("Seek requested to the current position. Faking a seek."), this.updateState(s.SEEKING), void(this._fakeSeekCompletionTimer = window.setTimeout(function() {
this._fakeSeekCompletionTimer = null, this._logger.log("Faking seek completion."), this._onSeeked()
}.bind(this), 0))) : (this._html5Audio.currentTime = e / 1e3, this._positionSeekingTo = e, this._positionBeforeSeek = this._currentPosition, this._currentPosition = e, this._updateLoadedPosition(d.timeRangesToFlatMap(this._html5Audio.buffered)), void this.updateState(s.SEEKING)))
}, i.prototype._cancelFakeSeekCompletionTimer = function() {
this._fakeSeekCompletionTimer && (this._logger.log("Cancelling fake seek completion timer."), window.clearTimeout(this._fakeSeekCompletionTimer), this._fakeSeekCompletionTimer = null)
}, i.prototype._play = function() {
if (this.getState() === s.ENDED) return void this._logger.log("Not playing becase in ENDED state.");
var e = this._html5Audio.play();
e && e["catch"] && e["catch"](function(e) {
"AbortError" === e.name ? this._logger.log("Play request was aborted for some reason.") : this._logger.log("Unexpected play() error: " + e.name)
}.bind(this))
}, i.prototype._disposeMediaElement = function() {
this._html5Audio && (this._html5Audio.src = "", this._html5Audio.hasAttribute("src") && this._html5Audio.removeAttribute("src"), this._html5Audio.load(), this._logger.log("Disposed media element."))
}, i.prototype._toggleEventListeners = function(e) {
var t = e ? "addEventListener" : "removeEventListener";
if (this._html5Audio) i.MediaAPIEvents.forEach(function(e) {
this._html5Audio[t](e, this._handleHtml5MediaEvent)
}, this);
else if (e) throw new Error("Cannot add listeners, audio element doesn't exist.")
}, i.prototype._handleHtml5MediaEvent = function(e) {
return "loadstart" !== e.type || this._audioElementReady || (this._logger.log("HTML5 media element ready."), this._audioElementReady = !0), this._audioElementReady ? void this._onHtml5MediaEvent(e) : void this._logger.log("HTML5 media event " + e.type + " happened before media element was ready.")
}, i.prototype._fixPosition = function(e) {
return this._trueDuration && e > this._duration ? (this._logger.log("Position is past the duration. Capping to the duration: " + this._duration), this._duration) : 0 > e ? (this._logger.log("Position is negative. Changing to 0."), 0) : e
}, i.prototype._kill = function() {
this._logger.log("Killing"), this._cancelFakeSeekCompletionTimer(), this._toggleEventListeners(!1), this._disposeMediaElement(), this._logger.log("Dead")
}, i.prototype._onBufferUpdate = function() {
this._logger.log("Buffer updated.");
var e = d.timeRangesToFlatMap(this._html5Audio.buffered);
this._updateLoadedPosition(e), this._triggerOnExit(a.DATA, e, this)
}, i.prototype._onLoadedMetadata = function() {
this._logger.log("HTML5 loadedmetadata event."), this._onTrueDurationKnown(1e3 * this._html5Audio.duration), this._triggerOnExit(a.METADATA, this), this._onLoaded()
}, i.prototype._updateLoadedPosition = function(e) {
var t = this._hasLoaded ? this._currentPosition : this._startFromPosition || 0,
n = 0;
e.some(function(e) {
return e.end < t ? !1 : (n = e.end, !0)
}), this._loadedPosition = Math.min(n, this._duration)
}, i.prototype._onTrueDurationKnown = function(e) {
this._duration = e, this._trueDuration = !0, null !== this._startFromPosition && (this._startFromPosition = this._fixPosition(this._startFromPosition))
}, i.prototype._setStartPosition = function(e) {
this._startFromPosition = this._fixPosition(e)
}, i.prototype._onLoaded = function() {
if (this._hasLoaded) throw new Error("Already loaded.");
this._hasLoaded = !0, this._loadedPosition = this._duration, null !== this._startFromPosition && (this._logger.log("Seeking to requested start position."), this._seek(this._startFromPosition)), this._playRequested && (this._logger.log("Play requested before had finished loading. Playing now."), this._play())
}, i.prototype._onPositionChange = function() {
!this._isInOneOfStates(s.DEAD, s.ERROR) && this._hasLoaded && (this.getState() === s.ENDED ? this._currentPosition = this._duration : this._currentPosition = 1e3 * this._html5Audio.currentTime, this._triggerPositionChangeEvent())
}, i.prototype._isTimeBuffered = function(e) {
if (!this._html5Audio) return !1;
for (var t = this._html5Audio.buffered, n = e / 1e3, i = 0; i < t.length; i++)
if (n >= t.start(i) && n < t.end(i)) return !0;
return !1
}, i.prototype._onStalled = function() {
this._logger.log("Stall detected, playhead is not advancing anymore. Position: " + this._currentPosition + " Buffered regions: " + this._html5Audio.buffered.length + " Ranges: " + JSON.stringify(d.timeRangesToFlatMap(this._html5Audio.buffered))), this._shouldBeEnded(1e3 * this._html5Audio.currentTime) ? (this._logger.log("Stalled at the end so switching to the ENDED state."), this.updateState(s.ENDED), this._onPositionChange()) : this.updateState(s.LOADING)
}, i.prototype._startPositionChangeInterval = function() {
null === this._positionChangeTimerId && (this._logger.log("Starting position change updates."), this._positionChangeTimerId = window.setInterval(this._onPositionChange, this._settings.updateInterval))
}, i.prototype._stopPositionChangeInterval = function() {
null !== this._positionChangeTimerId && (this._logger.log("Stopping position change updates."), window.clearInterval(this._positionChangeTimerId), this._positionChangeTimerId = null)
}, i.prototype.afterStateChange = function(e, t) {
switch (t) {
case s.PLAYING:
this._startPositionChangeInterval();
break;
default:
this._stopPositionChangeInterval()
}
}, i.prototype._onHtml5MediaEvent = function(e) {
"timeupdate" !== e.type && this._logger.log("HTML5 media event: " + e.type);
var t = this.getState();
switch (e.type) {
case "loadedmetadata":
this._onLoadedMetadata();
break;
case "loadstart":
case "progress":
case "suspend":
this._onBufferUpdate();
break;
case "playing":
(this._waitingForPlayingEvent || t !== s.SEEKING) && (this._cancelFakeSeekCompletionTimer(), this.updateState(s.PLAYING)), this._waitingForPlayingEvent = !1, this._onPositionChange();
break;
case "pause":
this._waitingForPlayingEvent = !1, t !== s.SEEKING && this.updateState(s.PAUSED), this._onPositionChange();
break;
case "timeupdate":
t !== s.SEEKING && (this._waitingForPlayingEvent || this._html5Audio.paused || t === s.PLAYING || t === s.ENDED || (this._logger.log("Going to PLAYING from a timeupdate event."), this.updateState(s.PLAYING))), this._onPositionChange();
break;
case "ended":
t !== s.SEEKING && this.updateState(s.ENDED), this._onPositionChange();
break;
case "seeking":
if (t !== s.SEEKING) throw new Error("State should be SEEKING already from when seek requested in _seek() method. Actual state: " + t);
break;
case "seeked":
if (t !== s.SEEKING) throw new Error("State should be SEEKING. Was " + t);
if (this._cancelFakeSeekCompletionTimer(), this._settings.seekHackEnabled && c.isSafari() && Math.abs(1e3 * this._html5Audio.currentTime - this._positionSeekingTo) > 200) {
this._logger.log("Seek failed. Attempting to seek again to the correct place."), this._html5Audio.currentTime = this._positionSeekingTo / 1e3;
break
}
this._onSeeked();
break;
case "waiting":
if (t === s.SEEKING) break;
this._waitingForPlayingEvent = !0, this._shouldBeEnded(1e3 * this._html5Audio.currentTime) ? (this._logger.log("Stalled at the end so switching to the ENDED state."), this.updateState(s.PLAYING), this.updateState(s.ENDED), this._onPositionChange()) : t === s.PLAYING && this._notifyStalled();
break;
case "error":
this._error(this._html5AudioErrorCodeToErrorId(this._html5Audio.error.code))
}
}, i.prototype._onSeeked = function() {
if (this._waitingForPlayingEvent) return void this._logger.log("Staying in SEEKING as a 'waiting' event was fired meaning a 'playing' event should happen when playback resumes.");
if (this._html5Audio.seeking) return void this._logger.log("Staying in SEEKING as another seek is in progress.");
var e = this.getState();
if (e !== s.SEEKING) throw new Error("State should be SEEKING. Was " + e);
this._positionSeekingTo = null, this._html5Audio.ended || this._shouldBeEnded(1e3 * this._html5Audio.currentTime) ? this.updateState(s.ENDED) : this.updateState(this._html5Audio.paused ? s.PAUSED : s.PLAYING), this._onPositionChange()
}, i.prototype._shouldBeEnded = function(e) {
return this._duration - e <= 400
}, i.prototype._html5AudioErrorCodeToErrorId = function(e) {
return {
1: l.HTML5_AUDIO_ABORTED,
2: l.HTML5_AUDIO_NETWORK,
3: l.HTML5_AUDIO_DECODE,
4: l.HTML5_AUDIO_SRC_NOT_SUPPORTED
}[e]
}, i.prototype._error = function(e) {
var t = "Error: ";
this._errorID = e, this._errorMessage = this._getErrorMessage(this._errorID) || "Unknown error.", this._logger.log(t + this._errorID + " " + this._errorMessage), this._kill(), this.updateState(s.ERROR)
}, i.prototype._getErrorMessage = function(e) {
var t = {};
return t[l.HTML5_AUDIO_ABORTED] = "The fetching process for the media resource was aborted by the user agent at the user's request.", t[l.HTML5_AUDIO_NETWORK] = "A network error of some description caused the user agent to stop fetching the media resource, after the resource was established to be usable.", t[l.HTML5_AUDIO_DECODE] = "An error of some description occurred while decoding the media resource, after the resource was established to be usable.", t[l.HTML5_AUDIO_SRC_NOT_SUPPORTED] = "The media resource indicated by the src attribute was not suitable.", t[e]
}
},
function(e, t, n) {
var i = n(43);
e.exports = {
supportHTML5Audio: function() {
var e;
try {
if (window.HTMLAudioElement && "undefined" != typeof Audio) return e = new Audio, !0
} catch (t) {
return !1
}
},
createAudioElement: function() {
var e = document.createElement("audio");
return e.setAttribute("msAudioCategory", "BackgroundCapableMedia"), e.mozAudioChannelType = "content", e
},
isMobile: function(e) {
var t = window.navigator.userAgent,
n = ["mobile", "iPhone", "iPad", "iPod", "Android", "Skyfire"];
return n.some(function(e) {
return e = new RegExp(e, "i"), e.test(t)
})
},
isIE10Mobile: function() {
return /IEmobile\/10\.0/gi.test(navigator.userAgent)
},
isNativeHlsSupported: function() {
try {
return "" !== document.createElement("audio").canPlayType("application/vnd.apple.mpegURL")
} catch (e) {
return !1
}
},
isSafari: function() {
var e = navigator.userAgent;
return !/chrome|opera/i.test(e) && /safari/i.test(e)
},
isMSESupported: function() {
return !!window.MediaSource
},
isMSESupportMPEG: function() {
return this.isMSESupported() && window.MediaSource.isTypeSupported("audio/mpeg")
},
isMSESupportMP4: function() {
return this.isMSESupported() && window.MediaSource.isTypeSupported("audio/mp4")
},
getMSETargetMimeType: function() {
return this.isMSESupportMPEG() && !this.isSafari() ? i.MP3 : this.isMSESupportMP4() ? i.MP4A : null
},
isOnLine: function() {
return window.navigator.onLine !== !1
}
}
},
function(e, t, n) {
function i(e, t, n) {
r.prototype.constructor.call(this, e, t, n || "HTML5SingleAudioPlayer")
}
var r = n(48),
o = n(45),
s = n(1);
e.exports = i, s(i.prototype, r.prototype), i.canPlay = o.canPlay, i.prototype._buildPlayer = function() {
return new o(this._descriptor, this._settings, this._type + "*", this._html5Audio)
}
},
function(e, t, n) {
function i(e, t, n) {
o(this, ["_onStateChange", "_onPositionChange"]), l.prototype.constructor.call(this, e, t, n || "BaseSingleAudioPlayer"), this._html5Audio = d, this._player = null, this._volume = 1, this._mute = !1, this._startedPlaying = !1, this._currentPositionWhenWentInactive = 0, this._loadedPositionWhenWentInactive = 0, this._durationWhenWentInactive = this._descriptor.duration || 0, this._playerErrorMessage = null, this._playerErrorID = null, this.updateState(s.IDLE)
}
var r = n(1),
o = n(40).bindAll,
s = n(36),
a = n(37),
l = n(33),
u = n(46),
c = null,
d = u.createAudioElement();
e.exports = i, r(i.prototype, l.prototype), i._buildPlayer = function() {
throw new Error("Not implemented!")
}, i.prototype._addEventListeners = function(e) {
var t = e === !1 ? "off" : "on";
this._player[t](a.STATE_CHANGE, this._onStateChange), this._player[t](a.POSITION_CHANGE, this._onPositionChange)
}, i.prototype._makeInactive = function() {
if (!this._player) throw new Error("Already inactive.");
this._logger.log("Making inactive: " + this.getId()), this._addEventListeners(!1), this._updateCurrentPositionWhenWentInactive(this._player.getCurrentPosition()), this._loadedPositionWhenWentInactive = this._player.getLoadedPosition(), this._durationWhenWentInactive = this._player.getDuration(), this._player.kill(), this._player = null, c = null, this._startedPlaying = !1, this.getState !== s.ERROR && this.updateState(s.PAUSED)
}, i.prototype._activate = function() {
if (this._player) throw new Error("Already active.");
if (this.getState() === s.ERROR) throw new Error("Cannot reactivate a player that is in the ERROR state.");
if (this.getState() === s.DEAD) throw new Error("Cannot reactivate a player that is in the DEAD state.");
c && this._makeInactive.call(c), c = this, this._logger.log("Making active: " + this.getId()), this._player = this._buildPlayer(), this._addEventListeners(!0), this._restoreState()
}, i.prototype._restoreState = function() {
this._player.setVolume(this._volume), this._player.setMute(this._mute), this._currentPositionWhenWentInactive > 0 && this._player.seek(this._currentPositionWhenWentInactive)
}, i.prototype._onStateChange = function(e) {
e === s.PLAYING && (this._startedPlaying = !0), e === s.ERROR && (this._playerErrorID = this._player.getErrorID(), this._playerErrorMessage = this._player.getErrorMessage(), this._makeInactive()), e !== s.IDLE && this.updateState(e)
}, i.prototype._updateCurrentPositionWhenWentInactive = function(e) {
this._currentPositionWhenWentInactive = e
}, i.prototype._onPositionChange = function() {
this._triggerPositionChangeEvent()
}, i.prototype.play = function(e) {
c !== this && this._activate(), this._player.play(e)
}, i.prototype.pause = function() {
if (!this._isInOneOfStates(s.IDLE, s.PAUSED, s.DEAD)) {
if (c !== this) throw new Error("Player is inactive so should be either DEAD or PAUSED. Was " + this.getState());
this._player.pause()
}
}, i.prototype.seek = function(e) {
if (c === this) this._player.seek(e);
else {
if (this.getState() === s.DEAD) return;
if (!this._isInOneOfStates(s.IDLE, s.PAUSED)) throw new Error("Inactive player should be PAUSED or IDLE. Was " + this.getState());
this._updateCurrentPositionWhenWentInactive(e), this.updateState(s.SEEKING), this.updateState(s.PAUSED)
}
}, i.prototype.resume = function() {
c !== this && this._activate(), this._player.resume()
}, i.prototype.setVolume = function(e) {
this._volume = e, this._player && this._player.setVolume(e)
}, i.prototype.getVolume = function() {
return this._volume
}, i.prototype.setMute = function(e) {
this._mute = e, this._player && this._player.setMute(e)
}, i.prototype.getMute = function() {
return this._mute
}, i.prototype.getErrorMessage = function() {
return this._playerErrorMessage
}, i.prototype.getErrorID = function() {
return this._playerErrorID
}, i.prototype.getCurrentPosition = function() {
return this._player && this._startedPlaying ? this._player.getCurrentPosition() : this._currentPositionWhenWentInactive
}, i.prototype.getLoadedPosition = function() {
return this._player && this._startedPlaying ? this._player.getLoadedPosition() : this._loadedPositionWhenWentInactive
}, i.prototype.getDuration = function() {
return this._player && this._startedPlaying ? this._player.getDuration() : this._durationWhenWentInactive
}, i.prototype.kill = function() {
this._logger.log("kill()"), this.getState() !== s.DEAD && (c === this && (this._player.kill(), c = null), this._player = null, this.updateState(s.DEAD))
}
},
function(e, t, n) {
function i(e, t, n, i, r) {
if (l.prototype.constructor.call(this, e, t, n || "HLSMSEPlayer", i, !0), this.getState() !== d.ERROR) {
o(this, ["_onPlaylistLoaded", "_onSegmentLoaded", "_onSimpleHlsToolkitError", "_onNetworkTimeout", "_onMediaSourceReady", "_onMediaSourceError", "_runSeekHack"]), this._streamUrlProvider = this._descriptor.streamUrlProvider || this._settings.streamUrlProvider || null;
var s;
s = null != this._descriptor.maxBufferLength ? this._descriptor.maxBufferLength : null != this._settings.maxBufferLength ? this._settings.maxBufferLength : this._settings.maxBufferTime, this._maxBufferLength = s, this._enableBufferingBeforePlay = !!this._settings.mseEnableBufferingBeforePlay, this._logger.log("maxBufferLength initialised to " + s + "ms"), this._updateBufferWindowTimer = null, this._updateMSEBufferTimer = null, this._updatingMSEBuffer = !1, this._playlistLoaded = !1, this._seekHackCounter = 0, this._seekHackResetState = 0, this._audioGlitchPauseTimer = null, this._appendedInitData = !1, this._mseToolkit = null, this._mseReady = !1, this._simpleHlsToolkitProvided = !!r, this._simpleHlsToolkit = r || new u(this._logger, this._descriptor.src, w, f.MP3, this._streamUrlProvider, !0, t.enableWebCrypto), this._addSimpleHlsToolkitEventListeners(!0), this._updateBufferWindow(), this._html5Audio && this._createMSEToolkit(), this._simpleHlsToolkit.hasPlaylistLoaded() && this._onPlaylistLoaded()
}
}
var r = n(1),
o = n(40).bindAll,
s = n(37),
a = n(42),
l = n(45),
u = n(50),
c = n(117),
d = n(36),
h = n(41),
p = n(118),
f = n(43),
g = n(46),
m = n(40),
v = 1500,
_ = 10,
y = 10,
b = 500,
w = g.getMSETargetMimeType(),
x = function() {
var e = {};
return e[h.names.PROTOCOLS] = [p.HLS], e[h.names.MIMETYPES] = [f.HLS, f.M3U8, f.MP3], e[h.names.NEEDS_URL_REFRESH] = !1, e[h.names.CAN_CONTROL_BUFFER] = !0, e
};
e.exports = i, r(i.prototype, l.prototype), i._capabilities = r({}, h.createDefaults(), x()), i.prototype._updateBufferWindow = function() {
if (this._playCalled || this._enableBufferingBeforePlay) {
var e = this._maxBufferLength;
if (e > 0 && !this._simpleHlsToolkit.loadRequested()) return this._logger.log("Calling load() on SimpleHLSToolkit."), void this._simpleHlsToolkit.load();
if (this._playlistLoaded) {
this._updateBufferWindowTimer && window.clearTimeout(this._updateBufferWindowTimer);
var t = this._hasLoaded ? this._currentPosition : this._startFromPosition || 0,
n = Math.min(e, this._duration - t);
this._simpleHlsToolkit.setTimeRange(new u.TimeRange(t, n)), n !== this._duration - t && (this._updateBufferWindowTimer = window.setTimeout(function() {
this._updateBufferWindowTimer = null, this._updateBufferWindow()
}.bind(this), 500))
}
}
}, i.canPlay = function(e) {
return w && u.canTransmux(f.MP3, w) && g.supportHTML5Audio() && e.mimeType === f.M3U8 ? g.isMSESupportMPEG() || g.isMSESupportMP4() : !1
}, i.prototype._onMediaSourceReady = function() {
this._mseReady = !0, this._updateMSEDuration(), this._handleLoaded(), this._updateMSEBuffer()
}, i.prototype._updateMSEBuffer = function() {
this._mseReady && (this._updatingMSEBuffer || (this._updatingMSEBuffer = !0, this._updateMSEBufferTimer && (window.clearTimeout(this._updateMSEBufferTimer), this._updateMSEBufferTimer = null), this._mseToolkit.whenStable(function() {
for (var e = this._hasLoaded ? this._currentPosition : this._startFromPosition || 0, t = Math.max(0, e - 1e3), n = e + 5e3, i = t, r = n, o = this._mseToolkit.getBuffered(), s = this._simpleHlsToolkit.getSegments(!0), a = null, l = 0; l < s.length && !a; l++) {
var u = s[l],
c = u.getStartPosition(),
d = u.getEndPosition();
d > t && n >= c && (i > c && (i = c), d > r && (r = d), m.isRangeInTimeRanges(c + 100, Math.max(c + 100, d - 100), o) || (a = u))
}
var h = !1;
if (a) this._logger.log("Appending segment " + a.getIndex()), this._appendSegment(a), h = !0;
else if (o.length && !g.isSafari()) {
var p = o[0].start,
f = o[o.length - 1].end;
i - 100 > p ? (this._mseToolkit.remove(p, i), h = !0) : f > r + 100 && (this._mseToolkit.remove(r, f), h = !0)
}
this._updatingMSEBuffer = !1, h ? this._updateMSEBuffer() : this._updateMSEBufferTimer = window.setTimeout(function() {
this._updateMSEBufferTimer = null, this._updateMSEBuffer()
}.bind(this), 1e3)
}.bind(this))))
}, i.prototype._onMediaSourceError = function(e) {
this._logger.log("MediaSource API error: " + e.message), this._error(a.MSE_BAD_OBJECT_STATE)
}, i.prototype._onNetworkTimeout = function() {
this._triggerOnExit(s.NETWORK_TIMEOUT)
}, i.prototype._onSegmentLoaded = function(e) {
this._logger.log("Segment " + e.getIndex() + " loaded."), this._updateMSEBuffer()
}, i.prototype._onPlaylistLoaded = function() {
this._logger.log("Playlist loaded."), this._playlistLoaded = !0, this._setDuration(this._simpleHlsToolkit.getDuration()), this._logger.log("Duration set from playlist info to " + this._duration), this._updateBufferWindow(), this._handleLoaded()
}, i.prototype._onSimpleHlsToolkitError = function(e) {
this._logger.log("Error from SimpleHLSToolkit."), this._error(e)
}, i.prototype._handleLoaded = function() {
this._hasLoaded || !this._playlistLoaded || !this._html5Audio || this._html5Audio.readyState < 1 || (this._triggerOnExit(s.METADATA, this), this._settings.audioGlitchSleepHackEnabled && g.isSafari() ? (this._logger.log("Sleeping to prevent audio glitch."), this._audioGlitchPauseTimer = window.setTimeout(function() {
this._audioGlitchPauseTimer = null, this._logger.log("Continuing."), this._onLoaded()
}.bind(this), b)) : this._onLoaded())
}, i.prototype.afterStateChange = function(e, t) {
switch (l.prototype.afterStateChange.call(this, e, t), t) {
case d.SEEKING:
this._updateBufferWindow(), this._updateMSEBuffer();
break;
case d.PLAYING:
this._updateBufferWindow()
}
}, i.prototype._setStartPosition = function(e) {
l.prototype._setStartPosition.call(this, e), this._updateBufferWindow()
}, i.prototype.play = function(e) {
l.prototype.play.call(this, e), this._enableBufferingBeforePlay || this._updateBufferWindow()
}, i.prototype._onLoadedMetadata = function() {
this._logger.log("HTML5 loadedmetadata event."), this._handleLoaded()
}, i.prototype._setDuration = function(e) {
this._onTrueDurationKnown(e), this._mseReady && this._updateMSEDuration()
}, i.prototype._updateMSEDuration = function() {
this._mseToolkit.whenStable(function() {
try {
this._mseToolkit.setDuration(this._duration)
} catch (e) {
this._onMediaSourceError(e)
}
}.bind(this))
}, i.prototype._appendInitData = function(e) {
this._mseToolkit.appendInitData(e), this._logger.log("Appending init data.")
}, i.prototype._appendSegment = function(e) {
var t = this._simpleHlsToolkit.getInitData();
!this._appendedInitData && t && (this._appendInitData(t), this._appendedInitData = !0), this._mseToolkit.append(e)
}, i.prototype._onStalled = function() {
l.prototype._onStalled.call(this), this.getState() === d.LOADING && (this._updateMSEBuffer(), this._settings.seekHackEnabled && g.isSafari() && this._runSeekHack())
}, i.prototype._runSeekHack = function() {
if (this._logger.log("Attempting to fix playback stall by seeking. Attempt: " + (this._seekHackCounter + 1)), this._seekHackCounter >= y) return void this._logger.log("Aborting because already attempted to fix too many times.");
var e = 1e3 * this._html5Audio.currentTime,
t = 1e3 * this._html5Audio.duration,
n = _;
if (e !== t) {
for (var i = m.timeRangesToFlatMap(this._html5Audio.buffered), r = null, o = 0; o < i.length; o++) {
var s = i[o];
if (s.start >= e && s.start - e <= 500) {
r = s;
break
}
}
var a = null;
r ? (this._logger.log("Seeking into next buffered region to try and fix playback."), a = r.start + n) : (this._logger.log("Seeking a little bit ahead to try and fix playback."), a = e + n + n * this._seekHackCounter), a = Math.min(1e3 * this._html5Audio.duration, a), this._logger.log("Seeking to " + a + " to try and fix playback."), this._seek(a), this._seekHackCounter++, this._seekHackResetState = 0
}
}, i.prototype._onHtml5MediaEvent = function(e) {
if (l.prototype._onHtml5MediaEvent.call(this, e), this._seekHackCounter > 0)
if ("seeked" === e.type) this._seekHackResetState = 1;
else if ("timeupdate" === e.type && this._seekHackResetState >= 1) {
if (this._seekHackResetState++, this._seekHackResetState < 3) return;
this._logger.log("Playback seems to be fixed. Resetting seek hack attempts count. (Attempts: " + this._seekHackCounter + ")"), this._seekHackCounter = 0, this._seekHackResetState = 0
}
}, i.prototype._getErrorMessage = function(e) {
var t = {};
return t[a.MSE_BAD_OBJECT_STATE] = "MediaSource API has thrown an exception", t[e] || l.prototype._getErrorMessage.call(this, e)
}, i.prototype._initMediaElement = function(e) {
l.prototype._initMediaElement.call(this), e && this._createMSEToolkit()
}, i.prototype._createMSEToolkit = function() {
this._mseToolkit = new c(this._html5Audio, this._logger, w), this._toggleEventListeners(!0), this._addMseToolkitEventListeners(!0)
}, i.prototype._addMseToolkitEventListeners = function(e) {
var t = e === !1 ? "off" : "on";
if (this._mseToolkit) this._mseToolkit[t](c.Events.SOURCE_READY, this._onMediaSourceReady),
this._mseToolkit[t](c.Events.SOURCE_ERROR, this._onMediaSourceError);
else if (e) throw new Error("Cannot add listeners, MSE toolkit not instantiated yet.")
}, i.prototype._getMediaElementSrc = function() {
return null
}, i.prototype._getMediaElementMimeType = function() {
return null
}, i.prototype._addSimpleHlsToolkitEventListeners = function(e) {
if (this._simpleHlsToolkit) {
var t = e === !1 ? "off" : "on";
this._simpleHlsToolkit[t](u.Events.PLAYLIST_LOADED, this._onPlaylistLoaded), this._simpleHlsToolkit[t](u.Events.SEGMENT_LOADED, this._onSegmentLoaded), this._simpleHlsToolkit[t](u.Events.NETWORK_TIMEOUT, this._onNetworkTimeout), this._simpleHlsToolkit[t](u.Events.ERROR, this._onSimpleHlsToolkitError)
}
}, i.prototype._kill = function() {
this._logger.log("Killing"), this._addMseToolkitEventListeners(!1), this._addSimpleHlsToolkitEventListeners(!1), this._updateMSEBufferTimer && window.clearTimeout(this._updateMSEBufferTimer), this._audioGlitchPauseTimer && (this._logger.log("Clearing audio glitch sleep timer."), window.clearTimeout(this._audioGlitchPauseTimer)), this._updateBufferWindowTimer && window.clearTimeout(this._updateBufferWindowTimer), this._simpleHlsToolkitProvided || this._simpleHlsToolkit.kill(), this._simpleHlsToolkit = null, this._mseToolkit && (this._mseToolkit.kill(), this._mseToolkit = null), l.prototype._kill.call(this), this._logger.log("Dead")
}, i.prototype.seek = function(e) {
this._isInOneOfStates(d.ERROR, d.DEAD) || (!this._isTimeBuffered(e) && this._isTimeBuffered(e + v) && (e += v, this._logger.log("Detected smart seeking opportunity, adjusting target to: " + e)), l.prototype.seek.call(this, e))
}, i.prototype.hasStreamUrlProvider = function() {
return !!this._streamUrlProvider
}, i.prototype.getMaxBufferLength = function() {
return this._maxBufferLength
}, i.prototype.setMaxBufferLength = function(e) {
if (!this._isInOneOfStates(d.ERROR, d.DEAD) && this._maxBufferLength !== e) {
if (0 > e) throw new Error("maxBufferLength cannot be negative.");
this._logger.log("Changing maxBufferLength to " + e + "ms"), this._maxBufferLength = e, this._updateBufferWindow()
}
}
},
function(e, t, n) {
var i, r = n(34),
o = n(1),
s = n(51),
a = n(43),
l = n(61),
u = n(40),
c = n(42);
e.exports = i = function(e, t, n, i, r, o, a) {
u.bindAll(this, ["_update", "_onPlaylistLoaded", "_onPlaylistFailed", "_onPlaylistParseError", "_onSegmentLoaded", "_onSegmentFailed", "_onSegmentTransmuxed"]), null == a && (a = !0), this._logger = e, this._playlistRequested = !1, this._playlistLoaded = !1, this._segmentLoading = null, this._duration = null, this._targetMimeType = n, this._segmentMimeType = i, this._initData = null, this._hlsToolkit = new s(e, t, {
enableWebCrypto: a
}), this._transmuxer = null, this._transmuxerHandle = null, this._keepSegments = !!o, this._timeRanges = [], this._segments = [], this._completeSegmentIndexes = [], this._segmentErrors = 0, this._playlistRefreshRetryTimer = null, this._refreshingPlaylist = !1, this._streamUrlProvider = r, this._streamUrlProviderRetryTimer = null, this._streamUrlProviderTimesFailed = 0, this._playlistTimesFailed = 0, this._initTransmuxer(), this._addHlsToolkitEventListeners(!0), this._log("Loaded.")
}, o(i.prototype, r), i.Events = {
ERROR: "error",
PLAYLIST_LOADED: "playlist-loaded",
GOT_INIT_DATA: "got-init-data",
SEGMENT_LOADED: "segment-loaded",
SEGMENT_REMOVED: "segment-removed",
NETWORK_TIMEOUT: "network-timeout"
}, i.canTransmux = function(e, t) {
return e === a.MP3 && (t === a.MP3 || t === a.MP4A)
}, i.TimeRange = function(e, t) {
this.start = e, this.duration = t, this.end = e + t
}, i._Segment = function(e, t) {
var n = e._hasSegmentLoaded(t);
this._index = t.index, this._data = n ? t.data : null, this._startPosition = t.startPosition, this._endPosition = t.endPosition, this._duration = t.duration, this._mimeType = t.mimeType, this._hasLoaded = n
}, i._Segment.prototype.getIndex = function() {
return this._index
}, i._Segment.prototype.getData = function() {
return this._data
}, i._Segment.prototype.getMimeType = function() {
return this._mimeType
}, i._Segment.prototype.getStartPosition = function() {
return this._startPosition
}, i._Segment.prototype.getEndPosition = function() {
return this._endPosition
}, i._Segment.prototype.getDuration = function() {
return this._duration
}, i._Segment.prototype.hasLoaded = function() {
return this._hasLoaded
}, i.prototype.load = function() {
this._playlistRequested || (this._log("Requesting playlist."), this._playlistRequested = !0, this._hlsToolkit.updatePlaylist())
}, i.prototype.loadRequested = function() {
return this._playlistRequested
}, i.prototype.setTimeRange = function(e) {
e.duration > 0 && this.load();
var t = [e];
this._timeRanges = t, this._update()
}, i.prototype.hasPlaylistLoaded = function() {
return this._playlistLoaded
}, i.prototype.getTotalNumSegments = function() {
return this._hlsToolkit.getNumSegments()
}, i.prototype.getNumSegments = function() {
return this._segments.length
}, i.prototype.getDuration = function() {
return this._duration
}, i.prototype.getInitData = function() {
return this._initData
}, i.prototype.getSegments = function(e) {
return this._segments.map(function(t) {
return e && !this._hasSegmentLoaded(t) ? null : new i._Segment(this, t)
}.bind(this)).filter(function(e) {
return !!e
})
}, i.prototype.kill = function() {
this._hlsToolkit.kill(), this._addHlsToolkitEventListeners(!1), this._playlistRefreshRetryTimer && window.clearTimeout(this._playlistRefreshRetryTimer), this._streamUrlProviderRetryTimer && window.clearTimeout(this._streamUrlProviderRetryTimer), this._timeRanges = [], this._segments = [], this._completeSegmentIndexes = [], this._log("Killed.")
}, i.prototype._hasSegmentLoaded = function(e) {
return -1 !== this._completeSegmentIndexes.indexOf(e.index)
}, i.prototype._timeRangesChanged = function(e) {
var t = this._timeRanges;
return t.length !== e.length ? !0 : t.some(function(t, n) {
var i = e[n];
return t.start !== i.start || t.duration !== i.duration
})
}, i.prototype._update = function() {
var e = [];
this._segments.forEach(function(t) {
this._overlapsTimeRange(t) || (this._segmentLoading === t && (this._segmentLoading = null, t.cancel(), this._transmuxerHandle && (this._transmuxerHandle.abort(), this._transmuxerHandle = null)), !this._keepSegments && this._hasSegmentLoaded(t) && (t.cancel(), e.push(t), this._completeSegmentIndexes.splice(this._completeSegmentIndexes.indexOf(t.index), 1)))
}.bind(this));
var t = [];
this._hlsToolkit.getSegments().forEach(function(e) {
if (this._overlapsTimeRange(e)) {
if (!this._refreshingPlaylist && e.isNew()) {
var n = this._segmentLoading;
(!n || n.startPosition > e.startPosition) && (n && (this._log("Cancelling segment " + n.index + " download as there is an earlier segment is now required."), n.cancel()), this._segmentLoading = e, e.load())
}
t.push(e)
} else -1 !== this._completeSegmentIndexes.indexOf(e.index) && t.push(e)
}.bind(this)), this._segments = t, e.forEach(function(e) {
this.trigger(i.Events.SEGMENT_REMOVED, new i._Segment(this, e))
}.bind(this))
}, i.prototype._overlapsTimeRange = function(e) {
return 0 !== e.duration && this._timeRanges.some(function(t) {
return e.startPosition < t.end && e.endPosition >= t.start
})
}, i.prototype._onPlaylistLoaded = function() {
this._refreshingPlaylist = !1, this._playlistLoaded || (this._playlistLoaded = !0, this._duration = this._hlsToolkit.getDuration(), this.trigger(i.Events.PLAYLIST_LOADED)), this._update()
}, i.prototype._onPlaylistParseError = function() {
this._log("Error parsing playlist."), this._onPlaylistError()
}, i.prototype._onPlaylistFailed = function(e) {
this._log("playlist loading failed. HTTP status code is " + e), 0 === e && this._notifyNetworkTimeout(), this._onPlaylistError()
}, i.prototype._onPlaylistError = function() {
this._log("Playlist loading failed " + this._playlistTimesFailed + " times before."), this._playlistTimesFailed++;
var e = u.getRetryTime(this._playlistTimesFailed);
this._playlistRefreshRetryTimer = window.setTimeout(function() {
this._playlistRefreshRetryTimer = null, this._log("Retrying..."), this._streamUrlProvider ? this._refreshPlaylist() : this._hlsToolkit.updatePlaylist()
}.bind(this), e), this._log("Retrying in " + e + " milliseconds")
}, i.prototype._onSegmentLoaded = function(e) {
this._transmuxSegment(e)
}, i.prototype._onSegmentTransmuxed = function(e) {
this._completeSegmentIndexes.push(e.index), this._segmentLoading = null, this._transmuxerHandle = null, this._segmentErrors = 0, this._update(), this.trigger(i.Events.SEGMENT_LOADED, new i._Segment(this, e))
}, i.prototype._onSegmentFailed = function(e) {
var t = e.status;
switch (this._log("segment loading failed. Status: " + t), t) {
case s.Status.NOT_FOUND:
case s.Status.FORBIDDEN:
case s.Status.DECRYPTION_ERROR:
this._segmentErrors++;
var n = u.getRetryTime(this._segmentErrors);
this._log("Will perform playlist refresh after " + n + "ms."), this._segmentLoading.cancel(), this._segmentLoading = null, this._refreshingPlaylist = !0, this._playlistRefreshRetryTimer = window.setTimeout(function() {
this._log("Performing refresh."), this._playlistRefreshRetryTimer = null, this._refreshPlaylist()
}.bind(this), n);
break;
case s.Status.TIMEOUT:
case s.Status.SERVER_ERROR:
case s.Status.FAILED:
e.status === s.Status.FAILED && this._log("WARNING: segment loading failed for unknown reason! Will retry."), e.loadAfterDelay(u.getRetryTime(e.timesFailed)), t === s.Status.TIMEOUT && this._notifyNetworkTimeout();
break;
default:
throw new Error("Invalid status on failed segment: " + e.status)
}
}, i.prototype._notifyNetworkTimeout = function() {
this.trigger(i.Events.NETWORK_TIMEOUT)
}, i.prototype._refreshPlaylist = function() {
this._refreshingPlaylist = !0;
var e = this._streamUrlProvider;
return e ? void e().done(function(e) {
this._logger.log("Got new stream url from stream url provider."), this._streamUrlProviderTimesFailed = 0, this._hlsToolkit.setUri(e), this._hlsToolkit.invalidateIncompleteSegments(), this._hlsToolkit.updatePlaylist()
}.bind(this)).fail(function() {
this._log("Failed to retrieve stream url from stream url provider.");
var e = u.getRetryTime(++this._streamUrlProviderTimesFailed);
this._streamUrlProviderRetryTimer = window.setTimeout(function() {
this._streamUrlProviderRetryTimer = null, this._log("Retrying request to stream url provider for a new url."), this._refreshPlaylist()
}.bind(this), e), this._log("Retrying in " + e + " milliseconds.")
}.bind(this)) : (this._log("Can't update playlist, got no stream URL provider."), void this.trigger(i.Events.ERROR, c.MSE_HLS_CANNOT_RETRY))
}, i.prototype._onSegmentProgress = function(e) {
var t = Math.round(e.loaded / e.total * 100);
this._log("segment " + e.index + " loaded " + e.loaded + " of " + e.total + " bytes (" + t + "%)")
}, i.prototype._initTransmuxer = function() {
var e = this._targetMimeType,
t = this._segmentMimeType;
if (e === t) return void this._log("No transmuxing needed. " + t + " is supported.");
if (!i.canTransmux(t, e)) throw new Error('Transmuxing from "' + t + '" to "' + e + '" is not supported.');
this._log("Will transmux to fragmented MP4."), this._transmuxer = new l(l.Configs.MP3_TO_FMP4), this._transmuxer.on("initData", function(e) {
this._log("Got init data."), this._initData = e, this.trigger(i.Events.GOT_INIT_DATA, e)
}.bind(this)), this._transmuxer.on("segment", function(e) {
this._log("Transmuxed data ready, " + e.data.length + " bytes for segment " + e.index), this._onSegmentTransmuxed(e)
}.bind(this))
}, i.prototype._transmuxSegment = function(e) {
this._transmuxer ? (this._log("Transmuxing segment " + e.index), this._transmuxerHandle = this._transmuxer.process(e)) : this._onSegmentTransmuxed(e)
}, i.prototype._log = function(e) {
this._logger.log("[SimpleHLS] " + e)
}, i.prototype._addHlsToolkitEventListeners = function(e) {
var t = e === !1 ? "off" : "on";
this._hlsToolkit[t](s.Events.PLAYLIST_LOADED, this._onPlaylistLoaded), this._hlsToolkit[t](s.Events.PLAYLIST_FAILED, this._onPlaylistFailed), this._hlsToolkit[t](s.Events.PLAYLIST_PARSE_ERROR, this._onPlaylistParseError), this._hlsToolkit[t](s.Events.SEGMENT_LOADED, this._onSegmentLoaded), this._hlsToolkit[t](s.Events.SEGMENT_PROGRESS, this._onSegmentProgress), this._hlsToolkit[t](s.Events.SEGMENT_FAILED, this._onSegmentFailed)
}
},
function(e, t, n) {
function i(e) {
this.reason = e
}
var r, o = n(43),
s = n(52),
a = n(40),
l = n(1),
u = n(54).Deferred,
c = n(34),
d = {
NEW: "new",
REQUESTED: "requested",
COMPLETE: "complete",
TIMEOUT: "timeout",
FORBIDDEN: "forbidden",
NOT_FOUND: "not-found",
SERVER_ERROR: "server-error",
DECRYPTION_ERROR: "decryption-error",
FAILED: "failed",
INVALIDATED: "invalidated"
},
h = /(.+?)=(.+?)(?:,|$)/g,
p = /(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT(INF): *(\d+(?:\.\d+)?)(?:,(.*))?)|(?:(?!#)()(\S.+))|(?:#EXT-X-(BYTERANGE): *(\d+(?:@\d+(?:\.\d+)?)?)|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(PROGRAM-DATE-TIME):(.+))|(?:#EXT-X-(VERSION):(\d+))|(?:(#)(.*):(.*))|(?:(#)(.*)))(?:.*)\r?\n?/g,
f = 6e3;
e.exports = r = function(e, t, n) {
this._logger = e, this._decryptor = s.getDecryptor(e, n), this._duration = 0, this._segments = [], this._playlistXHR = null, this.setUri(t)
}, r.Events = {
PLAYLIST_LOADED: "playlist-loaded",
PLAYLIST_PARSE_ERROR: "playlist-parse-error",
PLAYLIST_FAILED: "playlist-failed",
SEGMENT_LOADED: "segment-loaded",
SEGMENT_PROGRESS: "segment-progress",
SEGMENT_FAILED: "segment-failed",
SEGMENT_CANCELED: "segment-canceled"
}, r.Status = d, r.ENCRYPTION_METHODS = {
NONE: "NONE",
"AES-128": "AES-128"
};
var g = {
method: r.ENCRYPTION_METHODS.NONE,
keyUri: null,
retrieveKey: null,
iv: null
};
l(r.prototype, c), r.Segment = function(e, t, n, i, r, s) {
l(this, {
toolkit: e,
uri: t,
startPosition: n,
endPosition: n + i,
duration: i,
index: r,
data: null,
status: d.NEW,
isLast: !1,
timesFailed: 0,
loaded: 0,
total: 0,
xhr: null,
retryTimer: null,
mimeType: o.MP3,
encryption: s || g,
_abortRequest: null
}), this._logger = e._logger
}, r.Segment.prototype.containsTime = function(e) {
return e >= this.startPosition && e <= this.endPosition
}, r.Segment.prototype.isComplete = function() {
return this.status === d.COMPLETE
}, r.Segment.prototype.hasFailed = function() {
return this.status === d.TIMEOUT || this.status === d.FORBIDDEN || this.status === d.NOT_FOUND || this.status === d.SERVER_ERROR || this.status === d.DECRYPTION_ERROR || this.status === d.FAILED
}, r.Segment.prototype.isNew = function() {
return this.status === d.NEW
}, r.Segment.prototype.loadInProgress = function() {
return this.status === d.REQUESTED
}, r.Segment.prototype.isInvalidated = function() {
return this.status === d.INVALIDATED
}, r.Segment.prototype.canBeLoaded = function() {
return this.isNew() || this.hasFailed() || this.isInvalidated()
}, r.Segment.prototype.load = function() {
this.toolkit._loadSegment(this)
}, r.Segment.prototype.loadAfterDelay = function(e) {
if (!this.canBeLoaded()) throw new Error("Segment is not in a state that is valid for loading.");
null !== this.retryTimer && window.clearTimeout(this.retryTimer), this.retryTimer = window.setTimeout(function() {
this.retryTimer = null, this.load()
}.bind(this), e)
}, r.Segment.prototype.invalidate = function() {
if (this.status !== d.INVALIDATED) {
if (this.status !== d.NEW && this.cancel(), this.status !== d.NEW) throw new Error("Something else has changed the status.");
this.status = d.INVALIDATED
}
}, r.Segment.prototype.cancel = function() {
if (this.status === d.INVALIDATED) throw new Error("Segment is invalidated.");
this.status !== d.NEW && (null !== this.retryTimer && (this.toolkit._log("Clearing retry timer."), window.clearTimeout(this.retryTimer), this.retryTimer = null), this.status === d.REQUESTED && this._abortRequest(), this.toolkit._log("Segment cancelled: " + this.index), this.status = d.NEW, this.data = null, this.timesFailed = 0, this.loaded = 0, this.total = 0, this.encryption = g, this._abortRequest = null, this.toolkit.trigger(r.Events.SEGMENT_CANCELED, this))
}, r.prototype.setUri = function(e) {
this._log("Updating uri.");
var t = this._uri = e;
t.indexOf("?") > -1 && (t = t.substr(0, t.indexOf("?"))), this._baseURI = t.substr(0, t.lastIndexOf("/") + 1)
}, r.prototype.isUpdating = function() {
return !!this._playlistXHR
}, r.prototype.updatePlaylist = function() {
if (this._playlistXHR) throw new Error("Playlist update already in progress.");
var e = !1,
t = new XMLHttpRequest;
this._playlistXHR = t, t.open("GET", this._uri, !0), t.responseType = "text", t.timeout = f, this._log("Downloading playlist.");
var n = function() {
e || (this._log("Playlist download failed."), e = !0, this._playlistXHR = null, this.trigger(r.Events.PLAYLIST_FAILED, t.status))
}.bind(this);
t.onload = function() {
if (200 !== t.status) return this._log("Expected playlist response status code to be 200. Got " + t.status), void n();
this._playlistXHR = null;
try {
this._parsePlaylist(t.responseText)
} catch (e) {
if (e instanceof i) return this._log("Error parsing playlist: " + e.reason), void this.trigger(r.Events.PLAYLIST_PARSE_ERROR, e.reason);
throw e
}
this.getLastSegment().isLast = !0, this._log("Playlist download complete."), this.trigger(r.Events.PLAYLIST_LOADED)
}.bind(this), t.onerror = t.ontimeout = n, t.send()
}, r.prototype._parsePlaylist = function(e) {
var t, n = g,
o = 0,
s = 0,
a = null,
l = null,
u = !1,
c = [];
for (p.lastIndex = 0; null !== (t = p.exec(e));) switch (t = t.filter(function(e) {
return "undefined" != typeof e
}), t[1]) {
case "PLAYLIST-TYPE":
if ("VOD" !== t[2]) throw new i("Playlist type not supported: " + t[2]);
break;
case "MEDIA-SEQUENCE":
if (1 !== parseInt(t[2], 10)) throw new i("Expecting media sequence to equal 1.");
break;
case "TARGETDURATION":
break;
case "VERSION":
if (parseInt(t[2], 10) < 3) throw new i("HLS version must be 3 or above.");
break;
case "EXTM3U":
break;
case "ENDLIST":
u = !0;
break;
case "KEY":
var d = t[2];
n = this._buildSegmentEncryptionObject(d, o);
break;
case "INF":
a = 1e3 * parseFloat(t[2]);
break;
case "":
if (u) throw new i("Already received ENDLIST tag.");
if (null === s) throw new i("Not received segment duration.");
l = this._createAbsoluteURL(t[2]);
var h = this._segments[o];
h && !h.isInvalidated() ? c.push(h) : c.push(new r.Segment(this, l, s, a, o, n)), o++, s += a, l = a = null;
break;
default:
this._logger.log("Playlist line parsed but not handled: " + t[0].trim())
}
if (!u || !c.length) throw new i("Incomplete playlist.");
this._duration = s, this._segments = c
}, r.prototype._buildSegmentEncryptionObject = function(e, t) {
function n() {
var e = this._retrieveKeyDeferred;
if (e) return e.promise();
e = this._retrieveKeyDeferred = u();
var t = this.keyUri,
n = function() {
var i = new XMLHttpRequest;
this._xhr = i, i.open("GET", t, !0), i.responseType = "arraybuffer", i.onload = function() {
return this._xhr = null, 200 !== i.status ? void r() : (s("Downloaded decryption key."), void e.resolve(new Uint8Array(i.response)))
}.bind(this);
var r = function() {
if (i.status >= 400 && i.status < 500) return void e.reject();
this._retrieveKeyNumAttempts++;
var t = a.getRetryTime(this._retrieveKeyNumAttempts);
s("Error downloading decryption key. Attempt " + this._retrieveKeyNumAttempts + ". Retrying in " + t + "ms."), this._retryTimer = window.setTimeout(function() {
this._retryTimer = null, n()
}.bind(this), t)
}.bind(this);
i.onerror = i.ontimeout = function() {
this._xhr = null, r()
}.bind(this), i.send(), s("Downloading decryption key.")
}.bind(this);
return n(), e.promise()
}
var o, s = this._log.bind(this),
l = null,
c = null,
d = null,
p = null;
for (h.lastIndex = 0; null !== (o = h.exec(e));)
if (3 === o.length) {
o.shift();
var f = o[0].trim(),
m = this._removeQuotes(o[1].trim());
switch (f) {
case "METHOD":
l = r.ENCRYPTION_METHODS[m] || null;
break;
case "URI":
c = this._createAbsoluteURL(m);
break;
case "IV":
d = m;
break;
default:
this._logger.log("Unknown EXT-X-KEY attribute: " + f)
}
}
if (l === r.ENCRYPTION_METHODS.NONE) return g;
if (!l || !c) throw new i("Failed to parse M3U8 encryption header.");
return p = d ? this._parseEncryptionIvHexString(p) : this._calculateEncryptionIvForSegment(t), {
method: l,
keyUri: c,
retrieveKey: n,
iv: p,
_retrieveKeyDeferred: null,
_xhr: null,
_retryTimer: null,
_retrieveKeyNumAttempts: 0
}
}, r.prototype._removeQuotes = function(e) {
return 0 === e.indexOf('"') && e.lastIndexOf('"') === e.length - 1 ? e.slice(1, -1) : e
}, r.prototype._parseEncryptionIvHexString = function(e) {
0 === e.indexOf("0x") && (e = e.substr(2));
var t = new Uint16Array(8);
if (e.length % 4 !== 0) throw new i("Failed to parse M3U8 encryption IV (length is not multiple of 4).");
for (var n, r = 0; r < e.length; r += 4) {
if (n = parseInt(e.substr(r, 4), 16), isNaN(n)) throw new i("Failed to parse hex number in IV string.");
t[r / 4] = n
}
return t
}, r.prototype._calculateEncryptionIvForSegment = function(e) {
var t = new DataView(new ArrayBuffer(16));
return t.setUint32(0, e.index, !0), t.buffer
}, r.prototype._createAbsoluteURL = function(e) {
return "http://" === e.substr(0, 7) || "https://" === e.substr(0, 8) || "/" === e.substr(0, 1) ? e : this._baseURI + e
}, r.prototype._handleLoadSegmentFailure = function(e) {
if (!e.hasFailed()) throw new Error("Segment should have a failure state.");
e.timesFailed++, this.trigger(r.Events.SEGMENT_FAILED, e)
}, r.prototype.getNumberOfSegmentsRequested = function() {
var e = 0;
return this._segments.forEach(function(t) {
t.status === d.REQUESTED && e++
}), e
}, r.prototype._doRequest = function(e) {
if (!e.canBeLoaded()) throw new Error("Segment is not in a valid state for loading.");
e.status = d.REQUESTED;
var t = !1,
n = new XMLHttpRequest,
i = e.uri,
o = !1,
s = function(t) {
o || (o = !0, this._log("Segment loading failure: HTTP response status: " + n.status), 0 === n.status ? e.status = d.TIMEOUT : 403 === n.status ? e.status = d.FORBIDDEN : 404 === n.status ? e.status = d.NOT_FOUND : n.status >= 500 ? e.status = d.SERVER_ERROR : e.status = d.FAILED, this._handleLoadSegmentFailure(e))
}.bind(this);
n.open("GET", i, !0), n.responseType = "arraybuffer", n.onload = function() {
if (e.xhr = null, 200 !== n.status) return this._log("Got status code " + n.status + " when downloading segment " + e.index + ". Treating as an error."), void s();
e.downloadTime = Date.now() - e.downloadStartTime, this._log("Download of segment " + e.index + " complete.");
var i = new Uint8Array(n.response),
o = e.encryption;
if (o.method !== r.ENCRYPTION_METHODS.NONE) {
if (o.method !== r.ENCRYPTION_METHODS["AES-128"]) return this._log("Cannot decrypt segment. Encryption method not supported: " + o.method), e.status = d.DECRYPTION_ERROR, void this._handleLoadSegmentFailure(e);
o.retrieveKey().then(function(n) {
this._decryptSegment(n, o.iv, i).then(function(n) {
t || this._onSegmentDecypted(e, n)
}.bind(this))
}.bind(this), function() {
t || (this._log("An error occurred when trying to decrypt segment."), e.status = d.DECRYPTION_ERROR, this._handleLoadSegmentFailure(e))
}.bind(this))
} else this._onSegmentDecypted(e, i)
}.bind(this), n.onprogress = function(t) {
t.loaded && t.total && (e.loaded = t.loaded, e.total = t.total, this.trigger(r.Events.SEGMENT_PROGRESS, e))
}.bind(this), n.onerror = n.ontimeout = function(t) {
e.xhr = null, this._log("Download of segment " + e.index + " failed."), s(t)
}.bind(this), this._log("Requesting segment " + e.index + "."), e._abortRequest = function() {
if (t) throw new Error("Already aborted.");
t = !0;
var e = this.xhr;
e && (this.toolkit._log("Aborting XHR."), e.onerror = e.ontimeout = e.onprogress = e.onload = null, e.abort(), this.xhr = null);
var n = this.encryption;
if (n !== g) {
n._retrieveKeyDeferred && n._retrieveKeyDeferred.reject();
var i = n._xhr;
i && (this.toolkit._log("Aborting encryption key XHR."), i.onerror = i.ontimeout = i.onload = null, i.abort(), n._xhr = null), null !== n._retryTimer && (this.toolkit._log("Clearing encryption key retry timer."), window.clearTimeout(n._retryTimer), n._retryTimer = null)
}
}, e.xhr = n, e.downloadStartTime = Date.now(), n.send()
}, r.prototype._decryptSegment = function(e, t, n) {
var i = u();
return this._decryptor.decrypt(e, t, n).then(function(e) {
i.resolve(e)
}, i.reject), i.promise()
}, r.prototype._onSegmentDecypted = function(e, t) {
e.status = d.COMPLETE, e.data = t, this.trigger(r.Events.SEGMENT_LOADED, e)
}, r.prototype._loadSegment = function(e) {
if (!e.canBeLoaded()) throw new Error("Segment is not in a state that is valid for loading. Index: " + e.index + " State: " + e.status);
null !== e.retryTimer && (window.clearTimeout(e.retryTimer), e.retryTimer = null), this._doRequest(e)
}, r.prototype._log = function(e) {
this._logger.log("[HLS] " + e)
}, r.prototype.getSegments = function() {
return this._segments
}, r.prototype.getSegment = function(e) {
return e >= this._segments.length ? null : this._segments[e]
}, r.prototype.getSegmentIndexForTime = function(e) {
if (e >= this._duration || 0 > e || 0 === this._segments.length) return null;
for (var t = Math.floor(this._segments.length * (e / this._duration)), n = this._segments[t]; !(n.startPosition <= e && n.startPosition + n.duration > e);) n.startPosition < e ? t++ : t--, n = this._segments[t];
return t
}, r.prototype.getSegmentForTime = function(e) {
var t = this.getSegmentIndexForTime(e);
return null !== t ? this._segments[t] : null
}, r.prototype.getDuration = function() {
return this._duration
}, r.prototype.getNumSegments = function() {
return this._segments.length
}, r.prototype.getLastSegment = function() {
return this._segments.length ? this._segments[this._segments.length - 1] : null
}, r.prototype.cancelIncompleteSegments = function() {
this._log("Cancelling incomplete segments."), this._segments.filter(function(e) {
return !e.isComplete() && !e.isInvalidated()
}).forEach(function(e) {
e.cancel()
})
}, r.prototype.invalidateIncompleteSegments = function() {
this._log("Invalidating incomplete segments."), this._segments.filter(function(e) {
return !e.isComplete()
}).forEach(function(e) {
e.invalidate()
})
}, r.prototype.kill = function() {
this._log("Killing."), this.cancelIncompleteSegments();
var e = this._playlistXHR;
e && (e.onerror = e.ontimeout = e.onload = null, e.abort(), this._playlistXHR = null), this._decryptor.kill()
}
},
function(e, t, n) {
var i = n(53),
r = n(59);
e.exports = {
getDecryptor: function(e, t) {
if (t = t || {}, t.enableWebCrypto && i.isSupported()) return new i(e);
if (r.isSupported()) return new r(e);
throw new Error("Couldn't find a supported decryptor.")
}
}
},
function(e, t, n) {
var i, r = n(54).Deferred,
o = n(1),
s = n(58),
a = window.crypto && window.crypto.subtle;
e.exports = i = function(e) {
s.prototype.constructor.call(this, e, "WebCrypto")
}, o(i.prototype, s.prototype), i.isSupported = function() {
return !!a
}, i.prototype.decrypt = function(e, t, n) {
var i = r();
return this._expandKey(e).then(function(e) {
return a.decrypt({
name: "AES-CBC",
iv: t
}, e, n)
}.bind(this)).then(function(e) {
return this._log("Succesfully decrypted with web crypto."), new Uint8Array(e)
}.bind(this)).then(i.resolve)["catch"](function() {
this._log("An error occurred when trying to decrypt with web crypto."), i.reject()
}.bind(this)), i.promise()
}, i.prototype._expandKey = function(e) {
return a.importKey("raw", e, {
name: "AES-CBC"
}, !1, ["decrypt"])
}
},
function(e, t, n) {
e.exports = n(55)
},
function(e, t, n) {
/*!
* jquery-deferred
* Copyright(c) 2011 Hidden <zzdhidden@gmail.com>
* MIT Licensed
*/
var i = e.exports = n(56),
r = Array.prototype.slice;
i.extend({
Deferred: function(e) {
var t = [
["resolve", "done", i.Callbacks("once memory"), "resolved"],
["reject", "fail", i.Callbacks("once memory"), "rejected"],
["notify", "progress", i.Callbacks("memory")]
],
n = "pending",
r = {
state: function() {
return n
},
always: function() {
return o.done(arguments).fail(arguments), this
},
then: function() {
var e = arguments;
return i.Deferred(function(n) {
i.each(t, function(t, r) {
var s = r[0],
a = e[t];
o[r[1]](i.isFunction(a) ? function() {
var e = a.apply(this, arguments);
e && i.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[s + "With"](this === o ? n : this, [e])
} : n[s])
}), e = null
}).promise()
},
promise: function(e) {
return null != e ? i.extend(e, r) : r
}
},
o = {};
return r.pipe = r.then, i.each(t, function(e, i) {
var s = i[2],
a = i[3];
r[i[1]] = s.add, a && s.add(function() {
n = a
}, t[1 ^ e][2].disable, t[2][2].lock), o[i[0]] = s.fire, o[i[0] + "With"] = s.fireWith
}), r.promise(o), e && e.call(o, o), o
},
when: function(e) {
var t, n, o, s = 0,
a = r.call(arguments),
l = a.length,
u = 1 !== l || e && i.isFunction(e.promise) ? l : 0,
c = 1 === u ? e : i.Deferred(),
d = function(e, n, i) {
return function(o) {
n[e] = this, i[e] = arguments.length > 1 ? r.call(arguments) : o, i === t ? c.notifyWith(n, i) : --u || c.resolveWith(n, i)
}
};
if (l > 1)
for (t = new Array(l), n = new Array(l), o = new Array(l); l > s; s++) a[s] && i.isFunction(a[s].promise) ? a[s].promise().done(d(s, o, a)).fail(c.reject).progress(d(s, n, t)) : --u;
return u || c.resolveWith(o, a), c.promise()
}
})
},
function(e, t, n) {
function i(e) {
var t = s[e] = {};
return r.each(e.split(o), function(e, n) {
t[n] = !0
}), t
}
var r = e.exports = n(57),
o = /\s+/,
s = {};
r.Callbacks = function(e) {
e = "string" == typeof e ? s[e] || i(e) : r.extend({}, e);
var t, n, o, a, l, u, c = [],
d = !e.once && [],
h = function(i) {
for (t = e.memory && i, n = !0, u = a || 0, a = 0, l = c.length, o = !0; c && l > u; u++)
if (c[u].apply(i[0], i[1]) === !1 && e.stopOnFalse) {
t = !1;
break
}
o = !1, c && (d ? d.length && h(d.shift()) : t ? c = [] : p.disable())
},
p = {
add: function() {
if (c) {
var n = c.length;
! function i(t) {
r.each(t, function(t, n) {
var o = r.type(n);
"function" === o ? e.unique && p.has(n) || c.push(n) : n && n.length && "string" !== o && i(n)
})
}(arguments), o ? l = c.length : t && (a = n, h(t))
}
return this
},
remove: function() {
return c && r.each(arguments, function(e, t) {
for (var n;
(n = r.inArray(t, c, n)) > -1;) c.splice(n, 1), o && (l >= n && l--, u >= n && u--)
}), this
},
has: function(e) {
return r.inArray(e, c) > -1
},
empty: function() {
return c = [], this
},
disable: function() {
return c = d = t = void 0, this
},
disabled: function() {
return !c
},
lock: function() {
return d = void 0, t || p.disable(), this
},
locked: function() {
return !d
},
fireWith: function(e, t) {
return t = t || [], t = [e, t.slice ? t.slice() : t], !c || n && !d || (o ? d.push(t) : h(t)), this
},
fire: function() {
return p.fireWith(this, arguments), this
},
fired: function() {
return !!n
}
};
return p
}
},
function(e, t) {
function n(e) {
return null == e ? String(e) : c[u.call(e)] || "object"
}
function i(e) {
return "function" === l.type(e)
}
function r(e) {
return "array" === l.type(e)
}
function o(e, t, n) {
var r, o = 0,
s = e.length,
a = void 0 === s || i(e);
if (n)
if (a) {
for (r in e)
if (t.apply(e[r], n) === !1) break
} else
for (; s > o && t.apply(e[o++], n) !== !1;);
else if (a) {
for (r in e)
if (t.call(e[r], r, e[r]) === !1) break
} else
for (; s > o && t.call(e[o], o, e[o++]) !== !1;);
return e
}
function s(e) {
return e && "object" === l.type(e) ? !0 : !1
}
function a() {
var e, t, n, i, r, o, s = arguments[0] || {},
a = 1,
u = arguments.length,
c = !1;
for ("boolean" == typeof s && (c = s, s = arguments[1] || {}, a = 2), "object" == typeof s || l.isFunction(s) || (s = {}), u === a && (s = this, --a); u > a; a++)
if (null != (e = arguments[a]))
for (t in e) n = s[t], i = e[t], s !== i && (c && i && (l.isPlainObject(i) || (r = l.isArray(i))) ? (r ? (r = !1, o = n && l.isArray(n) ? n : []) : o = n && l.isPlainObject(n) ? n : {}, s[t] = l.extend(c, o, i)) : void 0 !== i && (s[t] = i));
return s
}
var l = e.exports = {
type: n,
isArray: r,
isFunction: i,
isPlainObject: s,
each: o,
extend: a,
noop: function() {}
},
u = Object.prototype.toString,
c = {};
"Boolean Number String Function Array Date RegExp Object".split(" ").forEach(function(e) {
c["[object " + e + "]"] = e.toLowerCase()
})
},
function(e, t) {
var n = e.exports = function(e, t) {
this._logger = e, this._name = t
};
n.isSupported = function() {
return !1
}, n.prototype.decrypt = function(e, t, n) {}, n.prototype._log = function(e) {
this._logger.log("[Decryptor] [" + this._name + "] " + e)
}, n.prototype.kill = function() {}
},
function(e, t, n) {
var i, r = n(54).Deferred,
o = n(1),
s = n(58),
a = n(60);
e.exports = i = function(e) {
s.prototype.constructor.call(this, e, "JS"), this._aesDecryptor = new a
}, o(i.prototype, s.prototype), i.isSupported = function() {
return !0
}, i.prototype.decrypt = function(e, t, n) {
var i = r();
return this._aesDecryptor.expandKey(e.buffer), i.resolve(new Uint8Array(this._aesDecryptor.decrypt(n.buffer, 0, t))), this._log("Succesfully decrypted in JS."), i.promise()
}, i.prototype.kill = function() {
this._aesDecryptor.destroy()
}
},
function(e, t) {
"use strict";
function n(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var i = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i)
}
}
return function(t, n, i) {
return n && e(t.prototype, n), i && e(t, i), t
}
}(),
r = function() {
function e() {
n(this, e), this.rcon = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], this.subMix = [], this.subMix[0] = new Uint32Array(256), this.subMix[1] = new Uint32Array(256), this.subMix[2] = new Uint32Array(256), this.subMix[3] = new Uint32Array(256), this.invSubMix = [], this.invSubMix[0] = new Uint32Array(256), this.invSubMix[1] = new Uint32Array(256), this.invSubMix[2] = new Uint32Array(256), this.invSubMix[3] = new Uint32Array(256), this.sBox = new Uint32Array(256), this.invSBox = new Uint32Array(256), this.key = new Uint32Array(0), this.initTable()
}
return i(e, [{
key: "uint8ArrayToUint32Array_",
value: function(e) {
for (var t = new DataView(e), n = new Uint32Array(4), i = 0; i < n.length; i++) n[i] = t.getUint32(4 * i);
return n
}
}, {
key: "initTable",
value: function() {
var e = this.sBox,
t = this.invSBox,
n = this.subMix[0],
i = this.subMix[1],
r = this.subMix[2],
o = this.subMix[3],
s = this.invSubMix[0],
a = this.invSubMix[1],
l = this.invSubMix[2],
u = this.invSubMix[3],
c = new Uint32Array(256),
d = 0,
h = 0,
p = 0;
for (p = 0; 256 > p; p++) 128 > p ? c[p] = p << 1 : c[p] = p << 1 ^ 283;
for (p = 0; 256 > p; p++) {
var f = h ^ h << 1 ^ h << 2 ^ h << 3 ^ h << 4;
f = f >>> 8 ^ 255 & f ^ 99, e[d] = f, t[f] = d;
var g = c[d],
m = c[g],
v = c[m],
_ = 257 * c[f] ^ 16843008 * f;
n[d] = _ << 24 | _ >>> 8, i[d] = _ << 16 | _ >>> 16, r[d] = _ << 8 | _ >>> 24, o[d] = _, _ = 16843009 * v ^ 65537 * m ^ 257 * g ^ 16843008 * d, s[f] = _ << 24 | _ >>> 8, a[f] = _ << 16 | _ >>> 16, l[f] = _ << 8 | _ >>> 24, u[f] = _, d ? (d = g ^ c[c[c[v ^ g]]], h ^= c[c[h]]) : d = h = 1
}
}
}, {
key: "expandKey",
value: function(e) {
for (var t = this.uint8ArrayToUint32Array_(e), n = !0, i = 0; i < t.length && n;) n = t[i] === this.key[i], i++;
if (!n) {
this.key = t;
var r = this.keySize = t.length;
if (4 !== r && 6 !== r && 8 !== r) throw new Error("Invalid aes key size=" + r);
var o = this.ksRows = 4 * (r + 6 + 1),
s = void 0,
a = void 0,
l = this.keySchedule = new Uint32Array(this.ksRows),
u = this.invKeySchedule = new Uint32Array(this.ksRows),
c = this.sBox,
d = this.rcon,
h = this.invSubMix[0],
p = this.invSubMix[1],
f = this.invSubMix[2],
g = this.invSubMix[3],
m = void 0,
v = void 0;
for (s = 0; o > s; s++) r > s ? m = l[s] = t[s] : (v = m, s % r === 0 ? (v = v << 8 | v >>> 24, v = c[v >>> 24] << 24 | c[v >>> 16 & 255] << 16 | c[v >>> 8 & 255] << 8 | c[255 & v], v ^= d[s / r | 0] << 24) : r > 6 && s % r === 4 && (v = c[v >>> 24] << 24 | c[v >>> 16 & 255] << 16 | c[v >>> 8 & 255] << 8 | c[255 & v]), l[s] = m = (l[s - r] ^ v) >>> 0);
for (a = 0; o > a; a++) s = o - a, v = 3 & a ? l[s] : l[s - 4], 4 > a || 4 >= s ? u[a] = v : u[a] = h[c[v >>> 24]] ^ p[c[v >>> 16 & 255]] ^ f[c[v >>> 8 & 255]] ^ g[c[255 & v]], u[a] = u[a] >>> 0
}
}
}, {
key: "networkToHostOrderSwap",
value: function(e) {
return e << 24 | (65280 & e) << 8 | (16711680 & e) >> 8 | e >>> 24
}
}, {
key: "decrypt",
value: function(e, t, n) {
for (var i, r, o = this.keySize + 6, s = this.invKeySchedule, a = this.invSBox, l = this.invSubMix[0], u = this.invSubMix[1], c = this.invSubMix[2], d = this.invSubMix[3], h = this.uint8ArrayToUint32Array_(n), p = h[0], f = h[1], g = h[2], m = h[3], v = new Int32Array(e), _ = new Int32Array(v.length), y = void 0, b = void 0, w = void 0, x = void 0, k = void 0, S = void 0, T = void 0, A = void 0, E = void 0, C = void 0, D = void 0, P = void 0; t < v.length;) {
for (E = this.networkToHostOrderSwap(v[t]), C = this.networkToHostOrderSwap(v[t + 1]), D = this.networkToHostOrderSwap(v[t + 2]), P = this.networkToHostOrderSwap(v[t + 3]), k = E ^ s[0], S = P ^ s[1], T = D ^ s[2], A = C ^ s[3], i = 4, r = 1; o > r; r++) y = l[k >>> 24] ^ u[S >> 16 & 255] ^ c[T >> 8 & 255] ^ d[255 & A] ^ s[i], b = l[S >>> 24] ^ u[T >> 16 & 255] ^ c[A >> 8 & 255] ^ d[255 & k] ^ s[i + 1], w = l[T >>> 24] ^ u[A >> 16 & 255] ^ c[k >> 8 & 255] ^ d[255 & S] ^ s[i + 2], x = l[A >>> 24] ^ u[k >> 16 & 255] ^ c[S >> 8 & 255] ^ d[255 & T] ^ s[i + 3], k = y, S = b, T = w, A = x, i += 4;
y = a[k >>> 24] << 24 ^ a[S >> 16 & 255] << 16 ^ a[T >> 8 & 255] << 8 ^ a[255 & A] ^ s[i], b = a[S >>> 24] << 24 ^ a[T >> 16 & 255] << 16 ^ a[A >> 8 & 255] << 8 ^ a[255 & k] ^ s[i + 1], w = a[T >>> 24] << 24 ^ a[A >> 16 & 255] << 16 ^ a[k >> 8 & 255] << 8 ^ a[255 & S] ^ s[i + 2], x = a[A >>> 24] << 24 ^ a[k >> 16 & 255] << 16 ^ a[S >> 8 & 255] << 8 ^ a[255 & T] ^ s[i + 3], i += 3, _[t] = this.networkToHostOrderSwap(y ^ p), _[t + 1] = this.networkToHostOrderSwap(x ^ f), _[t + 2] = this.networkToHostOrderSwap(w ^ g), _[t + 3] = this.networkToHostOrderSwap(b ^ m), p = E, f = C, g = D, m = P, t += 4
}
return _.buffer
}
}, {
key: "destroy",
value: function() {
this.key = void 0, this.keySize = void 0, this.ksRows = void 0, this.sBox = void 0, this.invSBox = void 0, this.subMix = void 0, this.invSubMix = void 0, this.keySchedule = void 0, this.invKeySchedule = void 0, this.rcon = void 0
}
}]), e
}();
e.exports = r
},
function(e, t, n) {
var i, r = n(1),
o = n(34),
s = n(62);
e.exports = i = function(e) {
this.killed = !1, this.config = e, this.pushedInitData = !1
}, r(i.prototype, o), i.prototype.process = function(e) {
if (this.killed) throw new Error("The transmuxer has been killed.");
var t = !1,
n = !1,
r = {
abort: function() {
if (t) throw new Error("Transmuxer cannot be aborted as it already completed.");
n || (n = !0)
}
};
switch (this.config) {
case i.Configs.VOID:
t = !0, this.trigger("segment", e);
break;
case i.Configs.MP3_TO_FMP4:
var o = new s.Unit.BasePushSrc,
a = new s.Units.MP3Parser,
l = new s.Units.MP4Mux(s.Units.MP4Mux.Profiles.MP3_AUDIO_ONLY),
u = new s.Unit.BaseSink;
o.enqueue(new s.Unit.Transfer(e.data, "binary")), o.enqueue(s.Unit.Transfer.Flush());
var c = !1;
u._onData = function() {
if (!this.killed && !n) {
var i = u.dequeue().data;
c ? (e.mimeType = "audio/mp4", e.data = i, t = !0, this.trigger("segment", e)) : (c = !0, this.pushedInitData || (this.pushedInitData = !0, this.trigger("initData", i)))
}
}.bind(this), s.Unit.link(o, a, l, u);
break;
default:
throw new Error("Config " + this.config + " not supported")
}
return r
}, i.prototype.kill = function() {
this.segents = [], this.killed = !0
}, i.Configs = {
VOID: "VOID",
MP3_TO_FMP4: "MP3_TO_FMP4"
}
},
function(e, t, n) {
var i, r = n(63),
o = n(104),
s = n(107),
a = n(110),
l = n(113),
u = n(114);
e.exports = i = {
Unit: r,
Units: {
File: u,
MP4Mux: o,
MP3Parser: s,
MSESink: a,
XHR: l
}
}
},
function(e, t, n) {
(function(t) {
var i, r, o, s, a, l, u, c, d, h, p = n(68),
f = n(70),
g = n(1),
m = n(79),
v = n(80);
e.exports = i = function() {
m.call(this), this.inputs || (this.inputs = []), this.outputs || (this.outputs = [])
}, i.create = function(e) {
return f(i.prototype, e)
}, i.createBaseSrc = function(e) {
return f(l.prototype, e)
}, i.createBasePushSrc = function(e) {
return f(u.prototype, e)
}, i.createBaseSink = function(e) {
return f(c.prototype, e)
}, i.createBaseTransform = function(e) {
return f(a.prototype, e)
}, i.createBaseParser = function(e) {
return f(d.prototype, e)
}, i.link = function(e, t) {
if (arguments.length > 2) return i.linkArray(arguments);
for (var n = 0; n < Math.min(e.numberOfOuts(), t.numberOfIns()); n++) e.out(n).pipe(t["in"](n));
return t
}, i.linkArray = function(e) {
var t, n, r;
for (r = 0; r < e.length; r++) t = e[r], e.length > r + 1 && (n = e[r + 1], i.link(t, n));
return n
};
var _ = i.Event = {
CHAIN: "chain",
NEED_DATA: "need-data",
FINISH: "finish",
PIPE: "pipe",
UNPIPE: "unpipe",
ERROR: "error",
END: "end",
OPEN: "open",
CLOSE: "close"
};
i.prototype = f(m.prototype, {
constructor: i,
"in": function(e) {
return this.inputs[e]
},
out: function(e) {
return this.outputs[e]
},
numberOfIns: function() {
return this.inputs.length
},
numberOfOuts: function() {
return this.outputs.length
},
add: function(e) {
return e instanceof r ? this.addInput(e) : e instanceof o && this.addOutput(e), this
},
remove: function(e) {
e instanceof r ? this.removeInput(e) : e instanceof o && this.removeOutput(e)
},
addInput: function(e) {
this._installEventForwarder(e, _.FINISH), this._installEventForwarder(e, _.OPEN), this._installEventForwarder(e, _.PIPE), this._installEventForwarder(e, _.UNPIPE), this._installEventForwarder(e, _.ERROR), this._installEventForwarder(e, _.CHAIN), this.inputs.push(e)
},
addOutput: function(e) {
this._installEventForwarder(e, _.END), this._installEventForwarder(e, _.OPEN), this._installEventForwarder(e, _.CLOSE), this._installEventForwarder(e, _.ERROR), this._installEventForwarder(e, _.NEED_DATA), this.outputs.push(e)
},
removeInput: function(e) {
removePut(this.inputs, e)
},
removeOutput: function(e) {
removePut(this.outputs, e)
},
removePut: function(e, t) {
e.slice().forEach(function(n, i) {
n == t && e.splice(i, 1)
})
},
_installEventForwarder: function(e, t) {
e.on(t, function(n) {
this.emit(t, e, n)
}.bind(this))
}
}), i.Transfer = s = function(e, n, i) {
n || (n = e instanceof t ? "buffer" : e instanceof String ? "utf8" : "object"), this.resolved = !1, this.data = e, this.encoding = n, this.doneCallback = i
}, s.prototype = f(Object.prototype, {
constructor: s,
resolve: function() {
this.doneCallback && !this.resolved && (this.doneCallback(), this.resolved = !0)
},
setFlushing: function(e) {
return this.data.flush = e, this
},
setEmpty: function(e) {
return this.data.empty = e, this
}
}), s.Flush = function() {
return new s({}, "binary").setFlushing(!0).setEmpty(!0)
}, s.EOS = function() {
return new s(null, "binary")
}, i.Input = r = function(e, t) {
v.Writable.prototype.constructor.call(this, {
objectMode: !0,
decodeStrings: !1
})
}, r.prototype = f(v.Writable.prototype, {
constructor: r,
_write: function(e, t, n) {
p("_write: " + t), this.emit(i.Event.CHAIN, new s(e, t, n))
}
}), i.Output = o = function(e) {
v.Readable.prototype.constructor.call(this, {
objectMode: !0
}), this._dataRequested = 0, this._shouldPushMore = !0
}, o.eos = function(e) {
e.push(null, "null")
}, o.prototype = f(v.Readable.prototype, {
constructor: o,
_read: function(e) {
this._dataRequested++, this.emit(_.NEED_DATA, this)
},
push: function(e, t) {
return this._dataRequested--, this._shouldPushMore = v.Readable.prototype.push.call(this, e, t), this._shouldPushMore
},
isPulling: function() {
return this._dataRequested > 0
},
eos: function() {
v.Readable.prototype.push.call(this, null, "null")
}
}), i.BaseTransform = a = function() {
i.prototype.constructor.apply(this, arguments), this.add(new r).add(new o), this.on(_.CHAIN, this._onChain.bind(this)), this.on(_.FINISH, this._onFinish.bind(this))
}, a.prototype = f(i.prototype, {
constructor: a,
_onChain: function(e, t) {
this._transform(t), this.out(0).push(t.data, t.encoding), t.resolve()
},
_onFinish: function(e) {
o.eos(this.out(0))
},
_transform: function(e) {}
}), i.BaseSrc = l = function() {
i.prototype.constructor.apply(this, arguments), this.add(new o), this.on(_.NEED_DATA, this.squeeze.bind(this))
}, l.prototype = f(i.prototype, {
constructor: l,
squeeze: function() {
p("squeeze");
var e = this._source();
e && (this.out(0).push(e.data, e.encoding), e.resolve())
},
_source: function() {}
}), i.BasePushSrc = u = function() {
l.prototype.constructor.apply(this, arguments), this._bufferOut = []
}, u.prototype = f(l.prototype, {
constructor: u,
_source: function() {
return this._bufferOut.length ? this._bufferOut.shift() : null
},
enqueue: function(e) {
this._bufferOut.push(e), this.out(0).isPulling && this.out(0).isPulling() && this.squeeze()
}
}), i.BaseSink = c = function() {
i.prototype.constructor.apply(this, arguments), this.add(new r), this.on(_.CHAIN, this._onChain.bind(this)), this._bufferIn = []
}, c.prototype = f(i.prototype, {
constructor: c,
_onChain: function(e, t) {
p("BaseSink._onChain: " + t.encoding), this._bufferIn.push(t), this._onData(), t.resolve()
},
_onData: function() {},
dequeue: function() {
return this._bufferIn.length ? this._bufferIn.shift() : null
}
}), i.BaseParser = d = function() {
u.prototype.constructor.apply(this, arguments), c.prototype.constructor.apply(this, arguments), this.on("finish", this._onFinish.bind(this))
}, g(d.prototype, i.prototype, m.prototype, l.prototype, u.prototype, c.prototype, {
constructor: d,
_onData: function() {
this._parse(this.dequeue())
},
_onFinish: function() {
p("BaseParser._onFinish"), o.eos(this.out(0))
},
_parse: function(e) {}
}), i.InputSelector = h = function(e) {
for (a.prototype.constructor.apply(this, arguments), e = (e || 1) - 1; e-- > 0;) this.add(new r);
this.selectedInputIndex = 0
}, g(h.prototype, a.prototype, {
constructor: h,
_onChain: function(e, t) {
var n = this["in"](this.selectedInputIndex);
return e !== n ? void t.resolve() : (this._transform(t), this.out(0).push(t.data, t.encoding), void t.resolve())
},
_onFinish: function(e) {
var t = this["in"](this.selectedInputIndex);
e === t && o.eos(this.out(0))
}
})
}).call(t, n(64).Buffer)
},
function(e, t, n) {
(function(e) {
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
"use strict";
function i() {
try {
var e = new Uint8Array(1);
return e.__proto__ = {
__proto__: Uint8Array.prototype,
foo: function() {
return 42
}
}, 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
} catch (t) {
return !1
}
}
function r() {
return s.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
}
function o(e, t) {
if (r() < t) throw new RangeError("Invalid typed array length");
return s.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t), e.__proto__ = s.prototype) : (null === e && (e = new s(t)), e.length = t), e
}
function s(e, t, n) {
if (!(s.TYPED_ARRAY_SUPPORT || this instanceof s)) return new s(e, t, n);
if ("number" == typeof e) {
if ("string" == typeof t) throw new Error("If encoding is specified then the first argument must be a string");
return c(this, e)
}
return a(this, e, t, n)
}
function a(e, t, n, i) {
if ("number" == typeof t) throw new TypeError('"value" argument must not be a number');
return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, n, i) : "string" == typeof t ? d(e, t, n) : f(e, t)
}
function l(e) {
if ("number" != typeof e) throw new TypeError('"size" argument must be a number');
if (0 > e) throw new RangeError('"size" argument must not be negative')
}
function u(e, t, n, i) {
return l(t), 0 >= t ? o(e, t) : void 0 !== n ? "string" == typeof i ? o(e, t).fill(n, i) : o(e, t).fill(n) : o(e, t)
}
function c(e, t) {
if (l(t), e = o(e, 0 > t ? 0 : 0 | g(t)), !s.TYPED_ARRAY_SUPPORT)
for (var n = 0; t > n; ++n) e[n] = 0;
return e
}
function d(e, t, n) {
if (("string" != typeof n || "" === n) && (n = "utf8"), !s.isEncoding(n)) throw new TypeError('"encoding" must be a valid string encoding');
var i = 0 | v(t, n);
e = o(e, i);
var r = e.write(t, n);
return r !== i && (e = e.slice(0, r)), e
}
function h(e, t) {
var n = t.length < 0 ? 0 : 0 | g(t.length);
e = o(e, n);
for (var i = 0; n > i; i += 1) e[i] = 255 & t[i];
return e
}
function p(e, t, n, i) {
if (t.byteLength, 0 > n || t.byteLength < n) throw new RangeError("'offset' is out of bounds");
if (t.byteLength < n + (i || 0)) throw new RangeError("'length' is out of bounds");
return t = void 0 === n && void 0 === i ? new Uint8Array(t) : void 0 === i ? new Uint8Array(t, n) : new Uint8Array(t, n, i), s.TYPED_ARRAY_SUPPORT ? (e = t, e.__proto__ = s.prototype) : e = h(e, t), e
}
function f(e, t) {
if (s.isBuffer(t)) {
var n = 0 | g(t.length);
return e = o(e, n), 0 === e.length ? e : (t.copy(e, 0, 0, n), e)
}
if (t) {
if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length" in t) return "number" != typeof t.length || X(t.length) ? o(e, 0) : h(e, t);
if ("Buffer" === t.type && J(t.data)) return h(e, t.data)
}
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
}
function g(e) {
if (e >= r()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
return 0 | e
}
function m(e) {
return +e != e && (e = 0), s.alloc(+e)
}
function v(e, t) {
if (s.isBuffer(e)) return e.length;
if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)) return e.byteLength;
"string" != typeof e && (e = "" + e);
var n = e.length;
if (0 === n) return 0;
for (var i = !1;;) switch (t) {
case "ascii":
case "latin1":
case "binary":
return n;
case "utf8":
case "utf-8":
case void 0:
return q(e).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return 2 * n;
case "hex":
return n >>> 1;
case "base64":
return G(e).length;
default:
if (i) return q(e).length;
t = ("" + t).toLowerCase(), i = !0
}
}
function _(e, t, n) {
var i = !1;
if ((void 0 === t || 0 > t) && (t = 0), t > this.length) return "";
if ((void 0 === n || n > this.length) && (n = this.length), 0 >= n) return "";
if (n >>>= 0, t >>>= 0, t >= n) return "";
for (e || (e = "utf8");;) switch (e) {
case "hex":
return R(this, t, n);
case "utf8":
case "utf-8":
return D(this, t, n);
case "ascii":
return M(this, t, n);
case "latin1":
case "binary":
return I(this, t, n);
case "base64":
return C(this, t, n);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return L(this, t, n);
default:
if (i) throw new TypeError("Unknown encoding: " + e);
e = (e + "").toLowerCase(), i = !0
}
}
function y(e, t, n) {
var i = e[t];
e[t] = e[n], e[n] = i
}
function b(e, t, n, i, r) {
if (0 === e.length) return -1;
if ("string" == typeof n ? (i = n, n = 0) : n > 2147483647 ? n = 2147483647 : -2147483648 > n && (n = -2147483648), n = +n, isNaN(n) && (n = r ? 0 : e.length - 1), 0 > n && (n = e.length + n), n >= e.length) {
if (r) return -1;
n = e.length - 1
} else if (0 > n) {
if (!r) return -1;
n = 0
}
if ("string" == typeof t && (t = s.from(t, i)), s.isBuffer(t)) return 0 === t.length ? -1 : w(e, t, n, i, r);
if ("number" == typeof t) return t = 255 & t, s.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, n) : Uint8Array.prototype.lastIndexOf.call(e, t, n) : w(e, [t], n, i, r);
throw new TypeError("val must be string, number or Buffer")
}
function w(e, t, n, i, r) {
function o(e, t) {
return 1 === s ? e[t] : e.readUInt16BE(t * s)
}
var s = 1,
a = e.length,
l = t.length;
if (void 0 !== i && (i = String(i).toLowerCase(), "ucs2" === i || "ucs-2" === i || "utf16le" === i || "utf-16le" === i)) {
if (e.length < 2 || t.length < 2) return -1;
s = 2, a /= 2, l /= 2, n /= 2
}
var u;
if (r) {
var c = -1;
for (u = n; a > u; u++)
if (o(e, u) === o(t, -1 === c ? 0 : u - c)) {
if (-1 === c && (c = u), u - c + 1 === l) return c * s
} else -1 !== c && (u -= u - c), c = -1
} else
for (n + l > a && (n = a - l), u = n; u >= 0; u--) {
for (var d = !0, h = 0; l > h; h++)
if (o(e, u + h) !== o(t, h)) {
d = !1;
break
}
if (d) return u
}
return -1
}
function x(e, t, n, i) {
n = Number(n) || 0;
var r = e.length - n;
i ? (i = Number(i), i > r && (i = r)) : i = r;
var o = t.length;
if (o % 2 !== 0) throw new TypeError("Invalid hex string");
i > o / 2 && (i = o / 2);
for (var s = 0; i > s; ++s) {
var a = parseInt(t.substr(2 * s, 2), 16);
if (isNaN(a)) return s;
e[n + s] = a
}
return s
}
function k(e, t, n, i) {
return K(q(t, e.length - n), e, n, i)
}
function S(e, t, n, i) {
return K(Y(t), e, n, i)
}
function T(e, t, n, i) {
return S(e, t, n, i)
}
function A(e, t, n, i) {
return K(G(t), e, n, i)
}
function E(e, t, n, i) {
return K(V(t, e.length - n), e, n, i)
}
function C(e, t, n) {
return 0 === t && n === e.length ? Z.fromByteArray(e) : Z.fromByteArray(e.slice(t, n))
}
function D(e, t, n) {
n = Math.min(e.length, n);
for (var i = [], r = t; n > r;) {
var o = e[r],
s = null,
a = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
if (n >= r + a) {
var l, u, c, d;
switch (a) {
case 1:
128 > o && (s = o);
break;
case 2:
l = e[r + 1], 128 === (192 & l) && (d = (31 & o) << 6 | 63 & l, d > 127 && (s = d));
break;
case 3:
l = e[r + 1], u = e[r + 2], 128 === (192 & l) && 128 === (192 & u) && (d = (15 & o) << 12 | (63 & l) << 6 | 63 & u, d > 2047 && (55296 > d || d > 57343) && (s = d));
break;
case 4:
l = e[r + 1], u = e[r + 2], c = e[r + 3], 128 === (192 & l) && 128 === (192 & u) && 128 === (192 & c) && (d = (15 & o) << 18 | (63 & l) << 12 | (63 & u) << 6 | 63 & c, d > 65535 && 1114112 > d && (s = d))
}
}
null === s ? (s = 65533, a = 1) : s > 65535 && (s -= 65536, i.push(s >>> 10 & 1023 | 55296), s = 56320 | 1023 & s), i.push(s), r += a
}
return P(i)
}
function P(e) {
var t = e.length;
if (ee >= t) return String.fromCharCode.apply(String, e);
for (var n = "", i = 0; t > i;) n += String.fromCharCode.apply(String, e.slice(i, i += ee));
return n
}
function M(e, t, n) {
var i = "";
n = Math.min(e.length, n);
for (var r = t; n > r; ++r) i += String.fromCharCode(127 & e[r]);
return i
}
function I(e, t, n) {
var i = "";
n = Math.min(e.length, n);
for (var r = t; n > r; ++r) i += String.fromCharCode(e[r]);
return i
}
function R(e, t, n) {
var i = e.length;
(!t || 0 > t) && (t = 0), (!n || 0 > n || n > i) && (n = i);
for (var r = "", o = t; n > o; ++o) r += W(e[o]);
return r
}
function L(e, t, n) {
for (var i = e.slice(t, n), r = "", o = 0; o < i.length; o += 2) r += String.fromCharCode(i[o] + 256 * i[o + 1]);
return r
}
function O(e, t, n) {
if (e % 1 !== 0 || 0 > e) throw new RangeError("offset is not uint");
if (e + t > n) throw new RangeError("Trying to access beyond buffer length")
}
function F(e, t, n, i, r, o) {
if (!s.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance');
if (t > r || o > t) throw new RangeError('"value" argument is out of bounds');
if (n + i > e.length) throw new RangeError("Index out of range")
}
function N(e, t, n, i) {
0 > t && (t = 65535 + t + 1);
for (var r = 0, o = Math.min(e.length - n, 2); o > r; ++r) e[n + r] = (t & 255 << 8 * (i ? r : 1 - r)) >>> 8 * (i ? r : 1 - r)
}
function B(e, t, n, i) {
0 > t && (t = 4294967295 + t + 1);
for (var r = 0, o = Math.min(e.length - n, 4); o > r; ++r) e[n + r] = t >>> 8 * (i ? r : 3 - r) & 255
}
function $(e, t, n, i, r, o) {
if (n + i > e.length) throw new RangeError("Index out of range");
if (0 > n) throw new RangeError("Index out of range")
}
function U(e, t, n, i, r) {
return r || $(e, t, n, 4, 3.4028234663852886e38, -3.4028234663852886e38), Q.write(e, t, n, i, 23, 4), n + 4
}
function z(e, t, n, i, r) {
return r || $(e, t, n, 8, 1.7976931348623157e308, -1.7976931348623157e308), Q.write(e, t, n, i, 52, 8), n + 8
}
function H(e) {
if (e = j(e).replace(te, ""), e.length < 2) return "";
for (; e.length % 4 !== 0;) e += "=";
return e
}
function j(e) {
return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
}
function W(e) {
return 16 > e ? "0" + e.toString(16) : e.toString(16)
}
function q(e, t) {
t = t || 1 / 0;
for (var n, i = e.length, r = null, o = [], s = 0; i > s; ++s) {
if (n = e.charCodeAt(s), n > 55295 && 57344 > n) {
if (!r) {
if (n > 56319) {
(t -= 3) > -1 && o.push(239, 191, 189);
continue
}
if (s + 1 === i) {
(t -= 3) > -1 && o.push(239, 191, 189);
continue
}
r = n;
continue
}
if (56320 > n) {
(t -= 3) > -1 && o.push(239, 191, 189), r = n;
continue
}
n = (r - 55296 << 10 | n - 56320) + 65536
} else r && (t -= 3) > -1 && o.push(239, 191, 189);
if (r = null, 128 > n) {
if ((t -= 1) < 0) break;
o.push(n)
} else if (2048 > n) {
if ((t -= 2) < 0) break;
o.push(n >> 6 | 192, 63 & n | 128)
} else if (65536 > n) {
if ((t -= 3) < 0) break;
o.push(n >> 12 | 224, n >> 6 & 63 | 128, 63 & n | 128)
} else {
if (!(1114112 > n)) throw new Error("Invalid code point");
if ((t -= 4) < 0) break;
o.push(n >> 18 | 240, n >> 12 & 63 | 128, n >> 6 & 63 | 128, 63 & n | 128)
}
}
return o
}
function Y(e) {
for (var t = [], n = 0; n < e.length; ++n) t.push(255 & e.charCodeAt(n));
return t
}
function V(e, t) {
for (var n, i, r, o = [], s = 0; s < e.length && !((t -= 2) < 0); ++s) n = e.charCodeAt(s), i = n >> 8, r = n % 256, o.push(r), o.push(i);
return o
}
function G(e) {
return Z.toByteArray(H(e))
}
function K(e, t, n, i) {
for (var r = 0; i > r && !(r + n >= t.length || r >= e.length); ++r) t[r + n] = e[r];
return r
}
function X(e) {
return e !== e
}
var Z = n(65),
Q = n(66),
J = n(67);
t.Buffer = s, t.SlowBuffer = m, t.INSPECT_MAX_BYTES = 50, s.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : i(), t.kMaxLength = r(), s.poolSize = 8192, s._augment = function(e) {
return e.__proto__ = s.prototype, e
}, s.from = function(e, t, n) {
return a(null, e, t, n)
}, s.TYPED_ARRAY_SUPPORT && (s.prototype.__proto__ = Uint8Array.prototype, s.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && s[Symbol.species] === s && Object.defineProperty(s, Symbol.species, {
value: null,
configurable: !0
})), s.alloc = function(e, t, n) {
return u(null, e, t, n)
}, s.allocUnsafe = function(e) {
return c(null, e)
}, s.allocUnsafeSlow = function(e) {
return c(null, e)
}, s.isBuffer = function(e) {
return !(null == e || !e._isBuffer)
}, s.compare = function(e, t) {
if (!s.isBuffer(e) || !s.isBuffer(t)) throw new TypeError("Arguments must be Buffers");
if (e === t) return 0;
for (var n = e.length, i = t.length, r = 0, o = Math.min(n, i); o > r; ++r)
if (e[r] !== t[r]) {
n = e[r], i = t[r];
break
}
return i > n ? -1 : n > i ? 1 : 0
}, s.isEncoding = function(e) {
switch (String(e).toLowerCase()) {
case "hex":
case "utf8":
case "utf-8":
case "ascii":
case "latin1":
case "binary":
case "base64":
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return !0;
default:
return !1
}
}, s.concat = function(e, t) {
if (!J(e)) throw new TypeError('"list" argument must be an Array of Buffers');
if (0 === e.length) return s.alloc(0);
var n;
if (void 0 === t)
for (t = 0, n = 0; n < e.length; ++n) t += e[n].length;
var i = s.allocUnsafe(t),
r = 0;
for (n = 0; n < e.length; ++n) {
var o = e[n];
if (!s.isBuffer(o)) throw new TypeError('"list" argument must be an Array of Buffers');
o.copy(i, r), r += o.length
}
return i
}, s.byteLength = v, s.prototype._isBuffer = !0, s.prototype.swap16 = function() {
var e = this.length;
if (e % 2 !== 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
for (var t = 0; e > t; t += 2) y(this, t, t + 1);
return this
}, s.prototype.swap32 = function() {
var e = this.length;
if (e % 4 !== 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
for (var t = 0; e > t; t += 4) y(this, t, t + 3), y(this, t + 1, t + 2);
return this
}, s.prototype.swap64 = function() {
var e = this.length;
if (e % 8 !== 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
for (var t = 0; e > t; t += 8) y(this, t, t + 7), y(this, t + 1, t + 6), y(this, t + 2, t + 5), y(this, t + 3, t + 4);
return this
}, s.prototype.toString = function() {
var e = 0 | this.length;
return 0 === e ? "" : 0 === arguments.length ? D(this, 0, e) : _.apply(this, arguments)
}, s.prototype.equals = function(e) {
if (!s.isBuffer(e)) throw new TypeError("Argument must be a Buffer");
return this === e ? !0 : 0 === s.compare(this, e)
}, s.prototype.inspect = function() {
var e = "",
n = t.INSPECT_MAX_BYTES;
return this.length > 0 && (e = this.toString("hex", 0, n).match(/.{2}/g).join(" "), this.length > n && (e += " ... ")), "<Buffer " + e + ">"
}, s.prototype.compare = function(e, t, n, i, r) {
if (!s.isBuffer(e)) throw new TypeError("Argument must be a Buffer");
if (void 0 === t && (t = 0), void 0 === n && (n = e ? e.length : 0), void 0 === i && (i = 0), void 0 === r && (r = this.length), 0 > t || n > e.length || 0 > i || r > this.length) throw new RangeError("out of range index");
if (i >= r && t >= n) return 0;
if (i >= r) return -1;
if (t >= n) return 1;
if (t >>>= 0, n >>>= 0, i >>>= 0, r >>>= 0, this === e) return 0;
for (var o = r - i, a = n - t, l = Math.min(o, a), u = this.slice(i, r), c = e.slice(t, n), d = 0; l > d; ++d)
if (u[d] !== c[d]) {
o = u[d], a = c[d];
break
}
return a > o ? -1 : o > a ? 1 : 0
}, s.prototype.includes = function(e, t, n) {
return -1 !== this.indexOf(e, t, n)
}, s.prototype.indexOf = function(e, t, n) {
return b(this, e, t, n, !0)
}, s.prototype.lastIndexOf = function(e, t, n) {
return b(this, e, t, n, !1)
}, s.prototype.write = function(e, t, n, i) {
if (void 0 === t) i = "utf8", n = this.length, t = 0;
else if (void 0 === n && "string" == typeof t) i = t, n = this.length, t = 0;
else {
if (!isFinite(t)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
t = 0 | t, isFinite(n) ? (n = 0 | n, void 0 === i && (i = "utf8")) : (i = n, n = void 0)
}
var r = this.length - t;
if ((void 0 === n || n > r) && (n = r), e.length > 0 && (0 > n || 0 > t) || t > this.length) throw new RangeError("Attempt to write outside buffer bounds");
i || (i = "utf8");
for (var o = !1;;) switch (i) {
case "hex":
return x(this, e, t, n);
case "utf8":
case "utf-8":
return k(this, e, t, n);
case "ascii":
return S(this, e, t, n);
case "latin1":
case "binary":
return T(this, e, t, n);
case "base64":
return A(this, e, t, n);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return E(this, e, t, n);
default:
if (o) throw new TypeError("Unknown encoding: " + i);
i = ("" + i).toLowerCase(), o = !0
}
}, s.prototype.toJSON = function() {
return {
type: "Buffer",
data: Array.prototype.slice.call(this._arr || this, 0)
}
};
var ee = 4096;
s.prototype.slice = function(e, t) {
var n = this.length;
e = ~~e, t = void 0 === t ? n : ~~t, 0 > e ? (e += n, 0 > e && (e = 0)) : e > n && (e = n), 0 > t ? (t += n, 0 > t && (t = 0)) : t > n && (t = n), e > t && (t = e);
var i;
if (s.TYPED_ARRAY_SUPPORT) i = this.subarray(e, t), i.__proto__ = s.prototype;
else {
var r = t - e;
i = new s(r, void 0);
for (var o = 0; r > o; ++o) i[o] = this[o + e]
}
return i
}, s.prototype.readUIntLE = function(e, t, n) {
e = 0 | e, t = 0 | t, n || O(e, t, this.length);
for (var i = this[e], r = 1, o = 0; ++o < t && (r *= 256);) i += this[e + o] * r;
return i
}, s.prototype.readUIntBE = function(e, t, n) {
e = 0 | e, t = 0 | t, n || O(e, t, this.length);
for (var i = this[e + --t], r = 1; t > 0 && (r *= 256);) i += this[e + --t] * r;
return i
}, s.prototype.readUInt8 = function(e, t) {
return t || O(e, 1, this.length), this[e]
}, s.prototype.readUInt16LE = function(e, t) {
return t || O(e, 2, this.length), this[e] | this[e + 1] << 8
}, s.prototype.readUInt16BE = function(e, t) {
return t || O(e, 2, this.length), this[e] << 8 | this[e + 1]
}, s.prototype.readUInt32LE = function(e, t) {
return t || O(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
}, s.prototype.readUInt32BE = function(e, t) {
return t || O(e, 4, this.length), 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
}, s.prototype.readIntLE = function(e, t, n) {
e = 0 | e, t = 0 | t, n || O(e, t, this.length);
for (var i = this[e], r = 1, o = 0; ++o < t && (r *= 256);) i += this[e + o] * r;
return r *= 128, i >= r && (i -= Math.pow(2, 8 * t)), i
}, s.prototype.readIntBE = function(e, t, n) {
e = 0 | e, t = 0 | t, n || O(e, t, this.length);
for (var i = t, r = 1, o = this[e + --i]; i > 0 && (r *= 256);) o += this[e + --i] * r;
return r *= 128, o >= r && (o -= Math.pow(2, 8 * t)), o
}, s.prototype.readInt8 = function(e, t) {
return t || O(e, 1, this.length), 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
}, s.prototype.readInt16LE = function(e, t) {
t || O(e, 2, this.length);
var n = this[e] | this[e + 1] << 8;
return 32768 & n ? 4294901760 | n : n
}, s.prototype.readInt16BE = function(e, t) {
t || O(e, 2, this.length);
var n = this[e + 1] | this[e] << 8;
return 32768 & n ? 4294901760 | n : n
}, s.prototype.readInt32LE = function(e, t) {
return t || O(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
}, s.prototype.readInt32BE = function(e, t) {
return t || O(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
}, s.prototype.readFloatLE = function(e, t) {
return t || O(e, 4, this.length), Q.read(this, e, !0, 23, 4)
}, s.prototype.readFloatBE = function(e, t) {
return t || O(e, 4, this.length), Q.read(this, e, !1, 23, 4)
}, s.prototype.readDoubleLE = function(e, t) {
return t || O(e, 8, this.length), Q.read(this, e, !0, 52, 8)
}, s.prototype.readDoubleBE = function(e, t) {
return t || O(e, 8, this.length), Q.read(this, e, !1, 52, 8)
}, s.prototype.writeUIntLE = function(e, t, n, i) {
if (e = +e, t = 0 | t, n = 0 | n, !i) {
var r = Math.pow(2, 8 * n) - 1;
F(this, e, t, n, r, 0)
}
var o = 1,
s = 0;
for (this[t] = 255 & e; ++s < n && (o *= 256);) this[t + s] = e / o & 255;
return t + n
}, s.prototype.writeUIntBE = function(e, t, n, i) {
if (e = +e, t = 0 | t, n = 0 | n, !i) {
var r = Math.pow(2, 8 * n) - 1;
F(this, e, t, n, r, 0)
}
var o = n - 1,
s = 1;
for (this[t + o] = 255 & e; --o >= 0 && (s *= 256);) this[t + o] = e / s & 255;
return t + n
}, s.prototype.writeUInt8 = function(e, t, n) {
return e = +e, t = 0 | t, n || F(this, e, t, 1, 255, 0), s.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), this[t] = 255 & e, t + 1
}, s.prototype.writeUInt16LE = function(e, t, n) {
return e = +e, t = 0 | t, n || F(this, e, t, 2, 65535, 0), s.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, this[t + 1] = e >>> 8) : N(this, e, t, !0), t + 2
}, s.prototype.writeUInt16BE = function(e, t, n) {
return e = +e, t = 0 | t, n || F(this, e, t, 2, 65535, 0), s.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8, this[t + 1] = 255 & e) : N(this, e, t, !1), t + 2
}, s.prototype.writeUInt32LE = function(e, t, n) {
return e = +e, t = 0 | t, n || F(this, e, t, 4, 4294967295, 0), s.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = 255 & e) : B(this, e, t, !0), t + 4
}, s.prototype.writeUInt32BE = function(e, t, n) {
return e = +e, t = 0 | t, n || F(this, e, t, 4, 4294967295, 0), s.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = 255 & e) : B(this, e, t, !1), t + 4
}, s.prototype.writeIntLE = function(e, t, n, i) {
if (e = +e, t = 0 | t, !i) {
var r = Math.pow(2, 8 * n - 1);
F(this, e, t, n, r - 1, -r)
}
var o = 0,
s = 1,
a = 0;
for (this[t] = 255 & e; ++o < n && (s *= 256);) 0 > e && 0 === a && 0 !== this[t + o - 1] && (a = 1), this[t + o] = (e / s >> 0) - a & 255;
return t + n
}, s.prototype.writeIntBE = function(e, t, n, i) {
if (e = +e, t = 0 | t, !i) {
var r = Math.pow(2, 8 * n - 1);
F(this, e, t, n, r - 1, -r)
}
var o = n - 1,
s = 1,
a = 0;
for (this[t + o] = 255 & e; --o >= 0 && (s *= 256);) 0 > e && 0 === a && 0 !== this[t + o + 1] && (a = 1), this[t + o] = (e / s >> 0) - a & 255;
return t + n
}, s.prototype.writeInt8 = function(e, t, n) {
return e = +e, t = 0 | t, n || F(this, e, t, 1, 127, -128), s.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), 0 > e && (e = 255 + e + 1), this[t] = 255 & e, t + 1
}, s.prototype.writeInt16LE = function(e, t, n) {
return e = +e, t = 0 | t, n || F(this, e, t, 2, 32767, -32768), s.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, this[t + 1] = e >>> 8) : N(this, e, t, !0), t + 2
}, s.prototype.writeInt16BE = function(e, t, n) {
return e = +e, t = 0 | t, n || F(this, e, t, 2, 32767, -32768), s.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8, this[t + 1] = 255 & e) : N(this, e, t, !1), t + 2
}, s.prototype.writeInt32LE = function(e, t, n) {
return e = +e, t = 0 | t, n || F(this, e, t, 4, 2147483647, -2147483648), s.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24) : B(this, e, t, !0), t + 4
}, s.prototype.writeInt32BE = function(e, t, n) {
return e = +e, t = 0 | t, n || F(this, e, t, 4, 2147483647, -2147483648), 0 > e && (e = 4294967295 + e + 1), s.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = 255 & e) : B(this, e, t, !1), t + 4
}, s.prototype.writeFloatLE = function(e, t, n) {
return U(this, e, t, !0, n)
}, s.prototype.writeFloatBE = function(e, t, n) {
return U(this, e, t, !1, n)
}, s.prototype.writeDoubleLE = function(e, t, n) {
return z(this, e, t, !0, n)
}, s.prototype.writeDoubleBE = function(e, t, n) {
return z(this, e, t, !1, n)
}, s.prototype.copy = function(e, t, n, i) {
if (n || (n = 0), i || 0 === i || (i = this.length), t >= e.length && (t = e.length), t || (t = 0), i > 0 && n > i && (i = n), i === n) return 0;
if (0 === e.length || 0 === this.length) return 0;
if (0 > t) throw new RangeError("targetStart out of bounds");
if (0 > n || n >= this.length) throw new RangeError("sourceStart out of bounds");
if (0 > i) throw new RangeError("sourceEnd out of bounds");
i > this.length && (i = this.length), e.length - t < i - n && (i = e.length - t + n);
var r, o = i - n;
if (this === e && t > n && i > t)
for (r = o - 1; r >= 0; --r) e[r + t] = this[r + n];
else if (1e3 > o || !s.TYPED_ARRAY_SUPPORT)
for (r = 0; o > r; ++r) e[r + t] = this[r + n];
else Uint8Array.prototype.set.call(e, this.subarray(n, n + o), t);
return o
}, s.prototype.fill = function(e, t, n, i) {
if ("string" == typeof e) {
if ("string" == typeof t ? (i = t, t = 0, n = this.length) : "string" == typeof n && (i = n, n = this.length), 1 === e.length) {
var r = e.charCodeAt(0);
256 > r && (e = r)
}
if (void 0 !== i && "string" != typeof i) throw new TypeError("encoding must be a string");
if ("string" == typeof i && !s.isEncoding(i)) throw new TypeError("Unknown encoding: " + i)
} else "number" == typeof e && (e = 255 & e);
if (0 > t || this.length < t || this.length < n) throw new RangeError("Out of range index");
if (t >= n) return this;
t >>>= 0, n = void 0 === n ? this.length : n >>> 0, e || (e = 0);
var o;
if ("number" == typeof e)
for (o = t; n > o; ++o) this[o] = e;
else {
var a = s.isBuffer(e) ? e : q(new s(e, i).toString()),
l = a.length;
for (o = 0; n - t > o; ++o) this[o + t] = a[o % l]
}
return this
};
var te = /[^+\/0-9A-Za-z-_]/g
}).call(t, function() {
return this
}())
},
function(e, t) {
"use strict";
function n(e) {
var t = e.length;
if (t % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
}
function i(e) {
return 3 * e.length / 4 - n(e)
}
function r(e) {
var t, i, r, o, s, a, l = e.length;
s = n(e), a = new c(3 * l / 4 - s), r = s > 0 ? l - 4 : l;
var d = 0;
for (t = 0, i = 0; r > t; t += 4, i += 3) o = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)], a[d++] = o >> 16 & 255, a[d++] = o >> 8 & 255, a[d++] = 255 & o;
return 2 === s ? (o = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4, a[d++] = 255 & o) : 1 === s && (o = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2, a[d++] = o >> 8 & 255, a[d++] = 255 & o), a
}
function o(e) {
return l[e >> 18 & 63] + l[e >> 12 & 63] + l[e >> 6 & 63] + l[63 & e]
}
function s(e, t, n) {
for (var i, r = [], s = t; n > s; s += 3) i = (e[s] << 16) + (e[s + 1] << 8) + e[s + 2], r.push(o(i));
return r.join("")
}
function a(e) {
for (var t, n = e.length, i = n % 3, r = "", o = [], a = 16383, u = 0, c = n - i; c > u; u += a) o.push(s(e, u, u + a > c ? c : u + a));
return 1 === i ? (t = e[n - 1], r += l[t >> 2], r += l[t << 4 & 63], r += "==") : 2 === i && (t = (e[n - 2] << 8) + e[n - 1], r += l[t >> 10], r += l[t >> 4 & 63], r += l[t << 2 & 63], r += "="), o.push(r), o.join("")
}
t.byteLength = i, t.toByteArray = r, t.fromByteArray = a;
for (var l = [], u = [], c = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", h = 0, p = d.length; p > h; ++h) l[h] = d[h], u[d.charCodeAt(h)] = h;
u["-".charCodeAt(0)] = 62, u["_".charCodeAt(0)] = 63
},
function(e, t) {
t.read = function(e, t, n, i, r) {
var o, s, a = 8 * r - i - 1,
l = (1 << a) - 1,
u = l >> 1,
c = -7,
d = n ? r - 1 : 0,
h = n ? -1 : 1,
p = e[t + d];
for (d += h, o = p & (1 << -c) - 1, p >>= -c, c += a; c > 0; o = 256 * o + e[t + d], d += h, c -= 8);
for (s = o & (1 << -c) - 1, o >>= -c, c += i; c > 0; s = 256 * s + e[t + d], d += h, c -= 8);
if (0 === o) o = 1 - u;
else {
if (o === l) return s ? NaN : (p ? -1 : 1) * (1 / 0);
s += Math.pow(2, i), o -= u
}
return (p ? -1 : 1) * s * Math.pow(2, o - i)
}, t.write = function(e, t, n, i, r, o) {
var s, a, l, u = 8 * o - r - 1,
c = (1 << u) - 1,
d = c >> 1,
h = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
p = i ? 0 : o - 1,
f = i ? 1 : -1,
g = 0 > t || 0 === t && 0 > 1 / t ? 1 : 0;
for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (a = isNaN(t) ? 1 : 0, s = c) : (s = Math.floor(Math.log(t) / Math.LN2), t * (l = Math.pow(2, -s)) < 1 && (s--, l *= 2), t += s + d >= 1 ? h / l : h * Math.pow(2, 1 - d), t * l >= 2 && (s++, l /= 2), s + d >= c ? (a = 0, s = c) : s + d >= 1 ? (a = (t * l - 1) * Math.pow(2, r), s += d) : (a = t * Math.pow(2, d - 1) * Math.pow(2, r), s = 0)); r >= 8; e[n + p] = 255 & a, p += f, a /= 256, r -= 8);
for (s = s << r | a, u += r; u > 0; e[n + p] = 255 & s, p += f, s /= 256, u -= 8);
e[n + p - f] |= 128 * g
}
},
function(e, t) {
var n = {}.toString;
e.exports = Array.isArray || function(e) {
return "[object Array]" == n.call(e)
}
},
function(e, t, n) {
var i = n(69);
e.exports = function() {
i.loggingEnabled() && console.log.apply(console, arguments)
}
},
function(e, t) {
var n = !1;
e.exports = {
loggingEnabled: function(e) {
return void 0 !== e && (n = e), n
}
}
},
function(e, t, n) {
function i(e, t, n) {
var i = o(e);
return n && s(e, t, n) && (t = void 0), t ? r(i, t) : i
}
var r = n(71),
o = n(77),
s = n(78);
e.exports = i
},
[120, 72, 73], 3, [121, 74, 75, 76], 5, 6, 7,
function(e, t) {
function n(e) {
var t = typeof e;
return !!e && ("object" == t || "function" == t)
}
var i = function() {
function e() {}
return function(t) {
if (n(t)) {
e.prototype = t;
var i = new e;
e.prototype = void 0
}
return i || {}
}
}();
e.exports = i
},
10,
function(e, t) {
function n() {
this._events = this._events || {}, this._maxListeners = this._maxListeners || void 0
}
function i(e) {
return "function" == typeof e
}
function r(e) {
return "number" == typeof e
}
function o(e) {
return "object" == typeof e && null !== e
}
function s(e) {
return void 0 === e
}
e.exports = n, n.EventEmitter = n, n.prototype._events = void 0, n.prototype._maxListeners = void 0, n.defaultMaxListeners = 10, n.prototype.setMaxListeners = function(e) {
if (!r(e) || 0 > e || isNaN(e)) throw TypeError("n must be a positive number");
return this._maxListeners = e, this
}, n.prototype.emit = function(e) {
var t, n, r, a, l, u;
if (this._events || (this._events = {}), "error" === e && (!this._events.error || o(this._events.error) && !this._events.error.length)) {
if (t = arguments[1], t instanceof Error) throw t;
var c = new Error('Uncaught, unspecified "error" event. (' + t + ")");
throw c.context = t, c
}
if (n = this._events[e], s(n)) return !1;
if (i(n)) switch (arguments.length) {
case 1:
n.call(this);
break;
case 2:
n.call(this, arguments[1]);
break;
case 3:
n.call(this, arguments[1], arguments[2]);
break;
default:
a = Array.prototype.slice.call(arguments, 1), n.apply(this, a)
} else if (o(n))
for (a = Array.prototype.slice.call(arguments, 1), u = n.slice(), r = u.length, l = 0; r > l; l++) u[l].apply(this, a);
return !0
}, n.prototype.addListener = function(e, t) {
var r;
if (!i(t)) throw TypeError("listener must be a function");
return this._events || (this._events = {}), this._events.newListener && this.emit("newListener", e, i(t.listener) ? t.listener : t), this._events[e] ? o(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t, o(this._events[e]) && !this._events[e].warned && (r = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners, r && r > 0 && this._events[e].length > r && (this._events[e].warned = !0, console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length), "function" == typeof console.trace && console.trace())), this
}, n.prototype.on = n.prototype.addListener, n.prototype.once = function(e, t) {
function n() {
this.removeListener(e, n), r || (r = !0, t.apply(this, arguments))
}
if (!i(t)) throw TypeError("listener must be a function");
var r = !1;
return n.listener = t, this.on(e, n), this
}, n.prototype.removeListener = function(e, t) {
var n, r, s, a;
if (!i(t)) throw TypeError("listener must be a function");
if (!this._events || !this._events[e]) return this;
if (n = this._events[e], s = n.length, r = -1, n === t || i(n.listener) && n.listener === t) delete this._events[e], this._events.removeListener && this.emit("removeListener", e, t);
else if (o(n)) {
for (a = s; a-- > 0;)
if (n[a] === t || n[a].listener && n[a].listener === t) {
r = a;
break
}
if (0 > r) return this;
1 === n.length ? (n.length = 0, delete this._events[e]) : n.splice(r, 1), this._events.removeListener && this.emit("removeListener", e, t)
}
return this
}, n.prototype.removeAllListeners = function(e) {
var t, n;
if (!this._events) return this;
if (!this._events.removeListener) return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e], this;
if (0 === arguments.length) {
for (t in this._events) "removeListener" !== t && this.removeAllListeners(t);
return this.removeAllListeners("removeListener"), this._events = {}, this
}
if (n = this._events[e], i(n)) this.removeListener(e, n);
else if (n)
for (; n.length;) this.removeListener(e, n[n.length - 1]);
return delete this._events[e], this
}, n.prototype.listeners = function(e) {
var t;
return t = this._events && this._events[e] ? i(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
}, n.prototype.listenerCount = function(e) {
if (this._events) {
var t = this._events[e];
if (i(t)) return 1;
if (t) return t.length
}
return 0
}, n.listenerCount = function(e, t) {
return e.listenerCount(t)
}
},
function(e, t, n) {
function i() {
r.call(this)
}
e.exports = i;
var r = n(79).EventEmitter,
o = n(81);
o(i, r), i.Readable = n(82), i.Writable = n(100), i.Duplex = n(101), i.Transform = n(102), i.PassThrough = n(103), i.Stream = i, i.prototype.pipe = function(e, t) {
function n(t) {
e.writable && !1 === e.write(t) && u.pause && u.pause()
}
function i() {
u.readable && u.resume && u.resume()
}
function o() {
c || (c = !0, e.end())
}
function s() {
c || (c = !0, "function" == typeof e.destroy && e.destroy())
}
function a(e) {
if (l(), 0 === r.listenerCount(this, "error")) throw e
}
function l() {
u.removeListener("data", n), e.removeListener("drain", i), u.removeListener("end", o), u.removeListener("close", s), u.removeListener("error", a), e.removeListener("error", a), u.removeListener("end", l), u.removeListener("close", l), e.removeListener("close", l)
}
var u = this;
u.on("data", n), e.on("drain", i), e._isStdio || t && t.end === !1 || (u.on("end", o), u.on("close", s));
var c = !1;
return u.on("error", a), e.on("error", a), u.on("end", l), u.on("close", l), e.on("close", l), e.emit("pipe", u), e
}
},
function(e, t) {
"function" == typeof Object.create ? e.exports = function(e, t) {
e.super_ = t, e.prototype = Object.create(t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
})
} : e.exports = function(e, t) {
e.super_ = t;
var n = function() {};
n.prototype = t.prototype, e.prototype = new n, e.prototype.constructor = e
}
},
function(e, t, n) {
(function(i) {
var r = function() {
try {
return n(80)
} catch (e) {}
}();
t = e.exports = n(84), t.Stream = r || t, t.Readable = t, t.Writable = n(93), t.Duplex = n(92), t.Transform = n(98), t.PassThrough = n(99), !i.browser && "disable" === i.env.READABLE_STREAM && r && (e.exports = r)
}).call(t, n(83))
},
function(e, t) {
function n() {
throw new Error("setTimeout has not been defined")
}
function i() {
throw new Error("clearTimeout has not been defined")
}
function r(e) {
if (c === setTimeout) return setTimeout(e, 0);
if ((c === n || !c) && setTimeout) return c = setTimeout, setTimeout(e, 0);
try {
return c(e, 0)
} catch (t) {
try {
return c.call(null, e, 0)
} catch (t) {
return c.call(this, e, 0)
}
}
}
function o(e) {
if (d === clearTimeout) return clearTimeout(e);
if ((d === i || !d) && clearTimeout) return d = clearTimeout, clearTimeout(e);
try {
return d(e)
} catch (t) {
try {
return d.call(null, e)
} catch (t) {
return d.call(this, e)
}
}
}
function s() {
g && p && (g = !1, p.length ? f = p.concat(f) : m = -1, f.length && a())
}
function a() {
if (!g) {
var e = r(s);
g = !0;
for (var t = f.length; t;) {
for (p = f, f = []; ++m < t;) p && p[m].run();
m = -1, t = f.length
}
p = null, g = !1, o(e)
}
}
function l(e, t) {
this.fun = e, this.array = t
}
function u() {}
var c, d, h = e.exports = {};
! function() {
try {
c = "function" == typeof setTimeout ? setTimeout : n
} catch (e) {
c = n
}
try {
d = "function" == typeof clearTimeout ? clearTimeout : i
} catch (e) {
d = i
}
}();
var p, f = [],
g = !1,
m = -1;
h.nextTick = function(e) {
var t = new Array(arguments.length - 1);
if (arguments.length > 1)
for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
f.push(new l(e, t)), 1 !== f.length || g || r(a)
}, l.prototype.run = function() {
this.fun.apply(null, this.array)
}, h.title = "browser", h.browser = !0, h.env = {}, h.argv = [], h.version = "", h.versions = {}, h.on = u, h.addListener = u, h.once = u, h.off = u, h.removeListener = u, h.removeAllListeners = u, h.emit = u, h.binding = function(e) {
throw new Error("process.binding is not supported")
}, h.cwd = function() {
return "/"
}, h.chdir = function(e) {
throw new Error("process.chdir is not supported")
}, h.umask = function() {
return 0
}
},
function(e, t, n) {
(function(t) {
"use strict";
function i(e, t, n) {
return "function" == typeof e.prependListener ? e.prependListener(t, n) : void(e._events && e._events[t] ? M(e._events[t]) ? e._events[t].unshift(n) : e._events[t] = [n, e._events[t]] : e.on(t, n))
}
function r(e, t) {
D = D || n(92), e = e || {}, this.objectMode = !!e.objectMode, t instanceof D && (this.objectMode = this.objectMode || !!e.readableObjectMode);
var i = e.highWaterMark,
r = this.objectMode ? 16 : 16384;
this.highWaterMark = i || 0 === i ? i : r, this.highWaterMark = ~~this.highWaterMark, this.buffer = new U, this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.defaultEncoding = e.defaultEncoding || "utf8", this.ranOut = !1, this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, e.encoding && ($ || ($ = n(97).StringDecoder), this.decoder = new $(e.encoding), this.encoding = e.encoding)
}
function o(e) {
return D = D || n(92), this instanceof o ? (this._readableState = new r(e, this), this.readable = !0, e && "function" == typeof e.read && (this._read = e.read), void I.call(this)) : new o(e)
}
function s(e, t, n, i, r) {
var o = c(t, n);
if (o) e.emit("error", o);
else if (null === n) t.reading = !1, d(e, t);
else if (t.objectMode || n && n.length > 0)
if (t.ended && !r) {
var s = new Error("stream.push() after EOF");
e.emit("error", s)
} else if (t.endEmitted && r) {
var l = new Error("stream.unshift() after end event");
e.emit("error", l)
} else {
var u;
!t.decoder || r || i || (n = t.decoder.write(n), u = !t.objectMode && 0 === n.length), r || (t.reading = !1), u || (t.flowing && 0 === t.length && !t.sync ? (e.emit("data", n), e.read(0)) : (t.length += t.objectMode ? 1 : n.length, r ? t.buffer.unshift(n) : t.buffer.push(n), t.needReadable && h(e))), f(e, t)
} else r || (t.reading = !1);
return a(t)
}
function a(e) {
return !e.ended && (e.needReadable || e.length < e.highWaterMark || 0 === e.length)
}
function l(e) {
return e >= z ? e = z : (e--, e |= e >>> 1, e |= e >>> 2, e |= e >>> 4, e |= e >>> 8, e |= e >>> 16, e++), e
}
function u(e, t) {
return 0 >= e || 0 === t.length && t.ended ? 0 : t.objectMode ? 1 : e !== e ? t.flowing && t.length ? t.buffer.head.data.length : t.length : (e > t.highWaterMark && (t.highWaterMark = l(e)), e <= t.length ? e : t.ended ? t.length : (t.needReadable = !0, 0))
}
function c(e, t) {
var n = null;
return L.isBuffer(t) || "string" == typeof t || null === t || void 0 === t || e.objectMode || (n = new TypeError("Invalid non-string/buffer chunk")), n
}
function d(e, t) {
if (!t.ended) {
if (t.decoder) {
var n = t.decoder.end();
n && n.length && (t.buffer.push(n),
t.length += t.objectMode ? 1 : n.length)
}
t.ended = !0, h(e)
}
}
function h(e) {
var t = e._readableState;
t.needReadable = !1, t.emittedReadable || (B("emitReadable", t.flowing), t.emittedReadable = !0, t.sync ? P(p, e) : p(e))
}
function p(e) {
B("emit readable"), e.emit("readable"), b(e)
}
function f(e, t) {
t.readingMore || (t.readingMore = !0, P(g, e, t))
}
function g(e, t) {
for (var n = t.length; !t.reading && !t.flowing && !t.ended && t.length < t.highWaterMark && (B("maybeReadMore read 0"), e.read(0), n !== t.length);) n = t.length;
t.readingMore = !1
}
function m(e) {
return function() {
var t = e._readableState;
B("pipeOnDrain", t.awaitDrain), t.awaitDrain && t.awaitDrain--, 0 === t.awaitDrain && R(e, "data") && (t.flowing = !0, b(e))
}
}
function v(e) {
B("readable nexttick read 0"), e.read(0)
}
function _(e, t) {
t.resumeScheduled || (t.resumeScheduled = !0, P(y, e, t))
}
function y(e, t) {
t.reading || (B("resume read 0"), e.read(0)), t.resumeScheduled = !1, t.awaitDrain = 0, e.emit("resume"), b(e), t.flowing && !t.reading && e.read(0)
}
function b(e) {
var t = e._readableState;
for (B("flow", t.flowing); t.flowing && null !== e.read(););
}
function w(e, t) {
if (0 === t.length) return null;
var n;
return t.objectMode ? n = t.buffer.shift() : !e || e >= t.length ? (n = t.decoder ? t.buffer.join("") : 1 === t.buffer.length ? t.buffer.head.data : t.buffer.concat(t.length), t.buffer.clear()) : n = x(e, t.buffer, t.decoder), n
}
function x(e, t, n) {
var i;
return e < t.head.data.length ? (i = t.head.data.slice(0, e), t.head.data = t.head.data.slice(e)) : i = e === t.head.data.length ? t.shift() : n ? k(e, t) : S(e, t), i
}
function k(e, t) {
var n = t.head,
i = 1,
r = n.data;
for (e -= r.length; n = n.next;) {
var o = n.data,
s = e > o.length ? o.length : e;
if (r += s === o.length ? o : o.slice(0, e), e -= s, 0 === e) {
s === o.length ? (++i, n.next ? t.head = n.next : t.head = t.tail = null) : (t.head = n, n.data = o.slice(s));
break
}++i
}
return t.length -= i, r
}
function S(e, t) {
var n = O.allocUnsafe(e),
i = t.head,
r = 1;
for (i.data.copy(n), e -= i.data.length; i = i.next;) {
var o = i.data,
s = e > o.length ? o.length : e;
if (o.copy(n, n.length - e, 0, s), e -= s, 0 === e) {
s === o.length ? (++r, i.next ? t.head = i.next : t.head = t.tail = null) : (t.head = i, i.data = o.slice(s));
break
}++r
}
return t.length -= r, n
}
function T(e) {
var t = e._readableState;
if (t.length > 0) throw new Error('"endReadable()" called on non-empty stream');
t.endEmitted || (t.ended = !0, P(A, t, e))
}
function A(e, t) {
e.endEmitted || 0 !== e.length || (e.endEmitted = !0, t.readable = !1, t.emit("end"))
}
function E(e, t) {
for (var n = 0, i = e.length; i > n; n++) t(e[n], n)
}
function C(e, t) {
for (var n = 0, i = e.length; i > n; n++)
if (e[n] === t) return n;
return -1
}
e.exports = o;
var D, P = n(85),
M = n(86);
o.ReadableState = r;
var I, R = (n(79).EventEmitter, function(e, t) {
return e.listeners(t).length
});
! function() {
try {
I = n(80)
} catch (e) {} finally {
I || (I = n(79).EventEmitter)
}
}();
var L = n(64).Buffer,
O = n(87),
F = n(88);
F.inherits = n(89);
var N = n(90),
B = void 0;
B = N && N.debuglog ? N.debuglog("stream") : function() {};
var $, U = n(91);
F.inherits(o, I), o.prototype.push = function(e, t) {
var n = this._readableState;
return n.objectMode || "string" != typeof e || (t = t || n.defaultEncoding, t !== n.encoding && (e = O.from(e, t), t = "")), s(this, n, e, t, !1)
}, o.prototype.unshift = function(e) {
var t = this._readableState;
return s(this, t, e, "", !0)
}, o.prototype.isPaused = function() {
return this._readableState.flowing === !1
}, o.prototype.setEncoding = function(e) {
return $ || ($ = n(97).StringDecoder), this._readableState.decoder = new $(e), this._readableState.encoding = e, this
};
var z = 8388608;
o.prototype.read = function(e) {
B("read", e), e = parseInt(e, 10);
var t = this._readableState,
n = e;
if (0 !== e && (t.emittedReadable = !1), 0 === e && t.needReadable && (t.length >= t.highWaterMark || t.ended)) return B("read: emitReadable", t.length, t.ended), 0 === t.length && t.ended ? T(this) : h(this), null;
if (e = u(e, t), 0 === e && t.ended) return 0 === t.length && T(this), null;
var i = t.needReadable;
B("need readable", i), (0 === t.length || t.length - e < t.highWaterMark) && (i = !0, B("length less than watermark", i)), t.ended || t.reading ? (i = !1, B("reading or ended", i)) : i && (B("do read"), t.reading = !0, t.sync = !0, 0 === t.length && (t.needReadable = !0), this._read(t.highWaterMark), t.sync = !1, t.reading || (e = u(n, t)));
var r;
return r = e > 0 ? w(e, t) : null, null === r ? (t.needReadable = !0, e = 0) : t.length -= e, 0 === t.length && (t.ended || (t.needReadable = !0), n !== e && t.ended && T(this)), null !== r && this.emit("data", r), r
}, o.prototype._read = function(e) {
this.emit("error", new Error("_read() is not implemented"))
}, o.prototype.pipe = function(e, n) {
function r(e) {
B("onunpipe"), e === h && s()
}
function o() {
B("onend"), e.end()
}
function s() {
B("cleanup"), e.removeListener("close", u), e.removeListener("finish", c), e.removeListener("drain", v), e.removeListener("error", l), e.removeListener("unpipe", r), h.removeListener("end", o), h.removeListener("end", s), h.removeListener("data", a), _ = !0, !p.awaitDrain || e._writableState && !e._writableState.needDrain || v()
}
function a(t) {
B("ondata"), y = !1;
var n = e.write(t);
!1 !== n || y || ((1 === p.pipesCount && p.pipes === e || p.pipesCount > 1 && -1 !== C(p.pipes, e)) && !_ && (B("false write response, pause", h._readableState.awaitDrain), h._readableState.awaitDrain++, y = !0), h.pause())
}
function l(t) {
B("onerror", t), d(), e.removeListener("error", l), 0 === R(e, "error") && e.emit("error", t)
}
function u() {
e.removeListener("finish", c), d()
}
function c() {
B("onfinish"), e.removeListener("close", u), d()
}
function d() {
B("unpipe"), h.unpipe(e)
}
var h = this,
p = this._readableState;
switch (p.pipesCount) {
case 0:
p.pipes = e;
break;
case 1:
p.pipes = [p.pipes, e];
break;
default:
p.pipes.push(e)
}
p.pipesCount += 1, B("pipe count=%d opts=%j", p.pipesCount, n);
var f = (!n || n.end !== !1) && e !== t.stdout && e !== t.stderr,
g = f ? o : s;
p.endEmitted ? P(g) : h.once("end", g), e.on("unpipe", r);
var v = m(h);
e.on("drain", v);
var _ = !1,
y = !1;
return h.on("data", a), i(e, "error", l), e.once("close", u), e.once("finish", c), e.emit("pipe", h), p.flowing || (B("pipe resume"), h.resume()), e
}, o.prototype.unpipe = function(e) {
var t = this._readableState;
if (0 === t.pipesCount) return this;
if (1 === t.pipesCount) return e && e !== t.pipes ? this : (e || (e = t.pipes), t.pipes = null, t.pipesCount = 0, t.flowing = !1, e && e.emit("unpipe", this), this);
if (!e) {
var n = t.pipes,
i = t.pipesCount;
t.pipes = null, t.pipesCount = 0, t.flowing = !1;
for (var r = 0; i > r; r++) n[r].emit("unpipe", this);
return this
}
var o = C(t.pipes, e);
return -1 === o ? this : (t.pipes.splice(o, 1), t.pipesCount -= 1, 1 === t.pipesCount && (t.pipes = t.pipes[0]), e.emit("unpipe", this), this)
}, o.prototype.on = function(e, t) {
var n = I.prototype.on.call(this, e, t);
if ("data" === e) this._readableState.flowing !== !1 && this.resume();
else if ("readable" === e) {
var i = this._readableState;
i.endEmitted || i.readableListening || (i.readableListening = i.needReadable = !0, i.emittedReadable = !1, i.reading ? i.length && h(this, i) : P(v, this))
}
return n
}, o.prototype.addListener = o.prototype.on, o.prototype.resume = function() {
var e = this._readableState;
return e.flowing || (B("resume"), e.flowing = !0, _(this, e)), this
}, o.prototype.pause = function() {
return B("call pause flowing=%j", this._readableState.flowing), !1 !== this._readableState.flowing && (B("pause"), this._readableState.flowing = !1, this.emit("pause")), this
}, o.prototype.wrap = function(e) {
var t = this._readableState,
n = !1,
i = this;
e.on("end", function() {
if (B("wrapped end"), t.decoder && !t.ended) {
var e = t.decoder.end();
e && e.length && i.push(e)
}
i.push(null)
}), e.on("data", function(r) {
if (B("wrapped data"), t.decoder && (r = t.decoder.write(r)), (!t.objectMode || null !== r && void 0 !== r) && (t.objectMode || r && r.length)) {
var o = i.push(r);
o || (n = !0, e.pause())
}
});
for (var r in e) void 0 === this[r] && "function" == typeof e[r] && (this[r] = function(t) {
return function() {
return e[t].apply(e, arguments)
}
}(r));
var o = ["error", "close", "destroy", "pause", "resume"];
return E(o, function(t) {
e.on(t, i.emit.bind(i, t))
}), i._read = function(t) {
B("wrapped _read", t), n && (n = !1, e.resume())
}, i
}, o._fromList = w
}).call(t, n(83))
},
function(e, t, n) {
(function(t) {
"use strict";
function n(e, n, i, r) {
if ("function" != typeof e) throw new TypeError('"callback" argument must be a function');
var o, s, a = arguments.length;
switch (a) {
case 0:
case 1:
return t.nextTick(e);
case 2:
return t.nextTick(function() {
e.call(null, n)
});
case 3:
return t.nextTick(function() {
e.call(null, n, i)
});
case 4:
return t.nextTick(function() {
e.call(null, n, i, r)
});
default:
for (o = new Array(a - 1), s = 0; s < o.length;) o[s++] = arguments[s];
return t.nextTick(function() {
e.apply(null, o)
})
}
}!t.version || 0 === t.version.indexOf("v0.") || 0 === t.version.indexOf("v1.") && 0 !== t.version.indexOf("v1.8.") ? e.exports = n : e.exports = t.nextTick
}).call(t, n(83))
},
67,
function(e, t, n) {
(function(e) {
"use strict";
var i = n(64),
r = i.Buffer,
o = i.SlowBuffer,
s = i.kMaxLength || 2147483647;
t.alloc = function(e, t, n) {
if ("function" == typeof r.alloc) return r.alloc(e, t, n);
if ("number" == typeof n) throw new TypeError("encoding must not be number");
if ("number" != typeof e) throw new TypeError("size must be a number");
if (e > s) throw new RangeError("size is too large");
var i = n,
o = t;
void 0 === o && (i = void 0, o = 0);
var a = new r(e);
if ("string" == typeof o)
for (var l = new r(o, i), u = l.length, c = -1; ++c < e;) a[c] = l[c % u];
else a.fill(o);
return a
}, t.allocUnsafe = function(e) {
if ("function" == typeof r.allocUnsafe) return r.allocUnsafe(e);
if ("number" != typeof e) throw new TypeError("size must be a number");
if (e > s) throw new RangeError("size is too large");
return new r(e)
}, t.from = function(t, n, i) {
if ("function" == typeof r.from && (!e.Uint8Array || Uint8Array.from !== r.from)) return r.from(t, n, i);
if ("number" == typeof t) throw new TypeError('"value" argument must not be a number');
if ("string" == typeof t) return new r(t, n);
if ("undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer) {
var o = n;
if (1 === arguments.length) return new r(t);
"undefined" == typeof o && (o = 0);
var s = i;
if ("undefined" == typeof s && (s = t.byteLength - o), o >= t.byteLength) throw new RangeError("'offset' is out of bounds");
if (s > t.byteLength - o) throw new RangeError("'length' is out of bounds");
return new r(t.slice(o, o + s))
}
if (r.isBuffer(t)) {
var a = new r(t.length);
return t.copy(a, 0, 0, t.length), a
}
if (t) {
if (Array.isArray(t) || "undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length" in t) return new r(t);
if ("Buffer" === t.type && Array.isArray(t.data)) return new r(t.data)
}
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
}, t.allocUnsafeSlow = function(e) {
if ("function" == typeof r.allocUnsafeSlow) return r.allocUnsafeSlow(e);
if ("number" != typeof e) throw new TypeError("size must be a number");
if (e >= s) throw new RangeError("size is too large");
return new o(e)
}
}).call(t, function() {
return this
}())
},
function(e, t, n) {
(function(e) {
function n(e) {
return Array.isArray ? Array.isArray(e) : "[object Array]" === m(e)
}
function i(e) {
return "boolean" == typeof e
}
function r(e) {
return null === e
}
function o(e) {
return null == e
}
function s(e) {
return "number" == typeof e
}
function a(e) {
return "string" == typeof e
}
function l(e) {
return "symbol" == typeof e
}
function u(e) {
return void 0 === e
}
function c(e) {
return "[object RegExp]" === m(e)
}
function d(e) {
return "object" == typeof e && null !== e
}
function h(e) {
return "[object Date]" === m(e)
}
function p(e) {
return "[object Error]" === m(e) || e instanceof Error
}
function f(e) {
return "function" == typeof e
}
function g(e) {
return null === e || "boolean" == typeof e || "number" == typeof e || "string" == typeof e || "symbol" == typeof e || "undefined" == typeof e
}
function m(e) {
return Object.prototype.toString.call(e)
}
t.isArray = n, t.isBoolean = i, t.isNull = r, t.isNullOrUndefined = o, t.isNumber = s, t.isString = a, t.isSymbol = l, t.isUndefined = u, t.isRegExp = c, t.isObject = d, t.isDate = h, t.isError = p, t.isFunction = f, t.isPrimitive = g, t.isBuffer = e.isBuffer
}).call(t, n(64).Buffer)
},
81,
function(e, t) {},
function(e, t, n) {
"use strict";
function i() {
this.head = null, this.tail = null, this.length = 0
}
var r = (n(64).Buffer, n(87));
e.exports = i, i.prototype.push = function(e) {
var t = {
data: e,
next: null
};
this.length > 0 ? this.tail.next = t : this.head = t, this.tail = t, ++this.length
}, i.prototype.unshift = function(e) {
var t = {
data: e,
next: this.head
};
0 === this.length && (this.tail = t), this.head = t, ++this.length
}, i.prototype.shift = function() {
if (0 !== this.length) {
var e = this.head.data;
return 1 === this.length ? this.head = this.tail = null : this.head = this.head.next, --this.length, e
}
}, i.prototype.clear = function() {
this.head = this.tail = null, this.length = 0
}, i.prototype.join = function(e) {
if (0 === this.length) return "";
for (var t = this.head, n = "" + t.data; t = t.next;) n += e + t.data;
return n
}, i.prototype.concat = function(e) {
if (0 === this.length) return r.alloc(0);
if (1 === this.length) return this.head.data;
for (var t = r.allocUnsafe(e >>> 0), n = this.head, i = 0; n;) n.data.copy(t, i), i += n.data.length, n = n.next;
return t
}
},
function(e, t, n) {
"use strict";
function i(e) {
return this instanceof i ? (u.call(this, e), c.call(this, e), e && e.readable === !1 && (this.readable = !1), e && e.writable === !1 && (this.writable = !1), this.allowHalfOpen = !0, e && e.allowHalfOpen === !1 && (this.allowHalfOpen = !1), void this.once("end", r)) : new i(e)
}
function r() {
this.allowHalfOpen || this._writableState.ended || a(o, this)
}
function o(e) {
e.end()
}
var s = Object.keys || function(e) {
var t = [];
for (var n in e) t.push(n);
return t
};
e.exports = i;
var a = n(85),
l = n(88);
l.inherits = n(89);
var u = n(84),
c = n(93);
l.inherits(i, u);
for (var d = s(c.prototype), h = 0; h < d.length; h++) {
var p = d[h];
i.prototype[p] || (i.prototype[p] = c.prototype[p])
}
},
function(e, t, n) {
(function(t, i) {
"use strict";
function r() {}
function o(e, t, n) {
this.chunk = e, this.encoding = t, this.callback = n, this.next = null
}
function s(e, t) {
S = S || n(92), e = e || {}, this.objectMode = !!e.objectMode, t instanceof S && (this.objectMode = this.objectMode || !!e.writableObjectMode);
var i = e.highWaterMark,
r = this.objectMode ? 16 : 16384;
this.highWaterMark = i || 0 === i ? i : r, this.highWaterMark = ~~this.highWaterMark, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1;
var o = e.decodeStrings === !1;
this.decodeStrings = !o, this.defaultEncoding = e.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(e) {
g(t, e)
}, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new k(this)
}
function a(e) {
return S = S || n(92), I.call(a, this) || this instanceof S ? (this._writableState = new s(e, this), this.writable = !0, e && ("function" == typeof e.write && (this._write = e.write), "function" == typeof e.writev && (this._writev = e.writev)), void C.call(this)) : new a(e)
}
function l(e, t) {
var n = new Error("write after end");
e.emit("error", n), T(t, n)
}
function u(e, t, n, i) {
var r = !0,
o = !1;
return null === n ? o = new TypeError("May not write null values to stream") : P.isBuffer(n) || "string" == typeof n || void 0 === n || t.objectMode || (o = new TypeError("Invalid non-string/buffer chunk")), o && (e.emit("error", o), T(i, o), r = !1), r
}
function c(e, t, n) {
return e.objectMode || e.decodeStrings === !1 || "string" != typeof t || (t = M.from(t, n)), t
}
function d(e, t, n, i, r) {
n = c(t, n, i), P.isBuffer(n) && (i = "buffer");
var s = t.objectMode ? 1 : n.length;
t.length += s;
var a = t.length < t.highWaterMark;
if (a || (t.needDrain = !0), t.writing || t.corked) {
var l = t.lastBufferedRequest;
t.lastBufferedRequest = new o(n, i, r), l ? l.next = t.lastBufferedRequest : t.bufferedRequest = t.lastBufferedRequest, t.bufferedRequestCount += 1
} else h(e, t, !1, s, n, i, r);
return a
}
function h(e, t, n, i, r, o, s) {
t.writelen = i, t.writecb = s, t.writing = !0, t.sync = !0, n ? e._writev(r, t.onwrite) : e._write(r, o, t.onwrite), t.sync = !1
}
function p(e, t, n, i, r) {
--t.pendingcb, n ? T(r, i) : r(i), e._writableState.errorEmitted = !0, e.emit("error", i)
}
function f(e) {
e.writing = !1, e.writecb = null, e.length -= e.writelen, e.writelen = 0
}
function g(e, t) {
var n = e._writableState,
i = n.sync,
r = n.writecb;
if (f(n), t) p(e, n, i, t, r);
else {
var o = y(n);
o || n.corked || n.bufferProcessing || !n.bufferedRequest || _(e, n), i ? A(m, e, n, o, r) : m(e, n, o, r)
}
}
function m(e, t, n, i) {
n || v(e, t), t.pendingcb--, i(), w(e, t)
}
function v(e, t) {
0 === t.length && t.needDrain && (t.needDrain = !1, e.emit("drain"))
}
function _(e, t) {
t.bufferProcessing = !0;
var n = t.bufferedRequest;
if (e._writev && n && n.next) {
var i = t.bufferedRequestCount,
r = new Array(i),
o = t.corkedRequestsFree;
o.entry = n;
for (var s = 0; n;) r[s] = n, n = n.next, s += 1;
h(e, t, !0, t.length, r, "", o.finish), t.pendingcb++, t.lastBufferedRequest = null, o.next ? (t.corkedRequestsFree = o.next, o.next = null) : t.corkedRequestsFree = new k(t)
} else {
for (; n;) {
var a = n.chunk,
l = n.encoding,
u = n.callback,
c = t.objectMode ? 1 : a.length;
if (h(e, t, !1, c, a, l, u), n = n.next, t.writing) break
}
null === n && (t.lastBufferedRequest = null)
}
t.bufferedRequestCount = 0, t.bufferedRequest = n, t.bufferProcessing = !1
}
function y(e) {
return e.ending && 0 === e.length && null === e.bufferedRequest && !e.finished && !e.writing
}
function b(e, t) {
t.prefinished || (t.prefinished = !0, e.emit("prefinish"))
}
function w(e, t) {
var n = y(t);
return n && (0 === t.pendingcb ? (b(e, t), t.finished = !0, e.emit("finish")) : b(e, t)), n
}
function x(e, t, n) {
t.ending = !0, w(e, t), n && (t.finished ? T(n) : e.once("finish", n)), t.ended = !0, e.writable = !1
}
function k(e) {
var t = this;
this.next = null, this.entry = null, this.finish = function(n) {
var i = t.entry;
for (t.entry = null; i;) {
var r = i.callback;
e.pendingcb--, r(n), i = i.next
}
e.corkedRequestsFree ? e.corkedRequestsFree.next = t : e.corkedRequestsFree = t
}
}
e.exports = a;
var S, T = n(85),
A = !t.browser && ["v0.10", "v0.9."].indexOf(t.version.slice(0, 5)) > -1 ? i : T;
a.WritableState = s;
var E = n(88);
E.inherits = n(89);
var C, D = {
deprecate: n(96)
};
! function() {
try {
C = n(80)
} catch (e) {} finally {
C || (C = n(79).EventEmitter)
}
}();
var P = n(64).Buffer,
M = n(87);
E.inherits(a, C), s.prototype.getBuffer = function() {
for (var e = this.bufferedRequest, t = []; e;) t.push(e), e = e.next;
return t
},
function() {
try {
Object.defineProperty(s.prototype, "buffer", {
get: D.deprecate(function() {
return this.getBuffer()
}, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")
})
} catch (e) {}
}();
var I;
"function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance] ? (I = Function.prototype[Symbol.hasInstance], Object.defineProperty(a, Symbol.hasInstance, {
value: function(e) {
return I.call(this, e) ? !0 : e && e._writableState instanceof s
}
})) : I = function(e) {
return e instanceof this
}, a.prototype.pipe = function() {
this.emit("error", new Error("Cannot pipe, not readable"))
}, a.prototype.write = function(e, t, n) {
var i = this._writableState,
o = !1;
return "function" == typeof t && (n = t, t = null), P.isBuffer(e) ? t = "buffer" : t || (t = i.defaultEncoding), "function" != typeof n && (n = r), i.ended ? l(this, n) : u(this, i, e, n) && (i.pendingcb++, o = d(this, i, e, t, n)), o
}, a.prototype.cork = function() {
var e = this._writableState;
e.corked++
}, a.prototype.uncork = function() {
var e = this._writableState;
e.corked && (e.corked--, e.writing || e.corked || e.finished || e.bufferProcessing || !e.bufferedRequest || _(this, e))
}, a.prototype.setDefaultEncoding = function(e) {
if ("string" == typeof e && (e = e.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((e + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + e);
return this._writableState.defaultEncoding = e, this
}, a.prototype._write = function(e, t, n) {
n(new Error("_write() is not implemented"))
}, a.prototype._writev = null, a.prototype.end = function(e, t, n) {
var i = this._writableState;
"function" == typeof e ? (n = e, e = null, t = null) : "function" == typeof t && (n = t, t = null), null !== e && void 0 !== e && this.write(e, t), i.corked && (i.corked = 1, this.uncork()), i.ending || i.finished || x(this, i, n)
}
}).call(t, n(83), n(94).setImmediate)
},
function(e, t, r) {
function o(e, t) {
this._id = e, this._clearFn = t
}
var s = Function.prototype.apply;
t.setTimeout = function() {
return new o(s.call(setTimeout, window, arguments), clearTimeout)
}, t.setInterval = function() {
return new o(s.call(setInterval, window, arguments), clearInterval)
}, t.clearTimeout = t.clearInterval = function(e) {
e && e.close()
}, o.prototype.unref = o.prototype.ref = function() {}, o.prototype.close = function() {
this._clearFn.call(window, this._id)
}, t.enroll = function(e, t) {
clearTimeout(e._idleTimeoutId), e._idleTimeout = t
}, t.unenroll = function(e) {
clearTimeout(e._idleTimeoutId), e._idleTimeout = -1
}, t._unrefActive = t.active = function(e) {
clearTimeout(e._idleTimeoutId);
var t = e._idleTimeout;
t >= 0 && (e._idleTimeoutId = setTimeout(function() {
e._onTimeout && e._onTimeout()
}, t))
}, r(95), t.setImmediate = n, t.clearImmediate = i
},
function(e, t, n) {
(function(e, t) {
! function(e, n) {
"use strict";
function i(e) {
"function" != typeof e && (e = new Function("" + e));
for (var t = new Array(arguments.length - 1), n = 0; n < t.length; n++) t[n] = arguments[n + 1];
var i = {
callback: e,
args: t
};
return g[f] = i, p(f), f++
}
function r(e) {
delete g[e]
}
function o(e) {
var t = e.callback,
i = e.args;
switch (i.length) {
case 0:
t();
break;
case 1:
t(i[0]);
break;
case 2:
t(i[0], i[1]);
break;
case 3:
t(i[0], i[1], i[2]);
break;
default:
t.apply(n, i)
}
}
function s(e) {
if (m) setTimeout(s, 0, e);
else {
var t = g[e];
if (t) {
m = !0;
try {
o(t)
} finally {
r(e), m = !1
}
}
}
}
function a() {
p = function(e) {
t.nextTick(function() {
s(e)
})
}
}
function l() {
if (e.postMessage && !e.importScripts) {
var t = !0,
n = e.onmessage;
return e.onmessage = function() {
t = !1
}, e.postMessage("", "*"), e.onmessage = n, t
}
}
function u() {
var t = "setImmediate$" + Math.random() + "$",
n = function(n) {
n.source === e && "string" == typeof n.data && 0 === n.data.indexOf(t) && s(+n.data.slice(t.length))
};
e.addEventListener ? e.addEventListener("message", n, !1) : e.attachEvent("onmessage", n), p = function(n) {
e.postMessage(t + n, "*")
}
}
function c() {
var e = new MessageChannel;
e.port1.onmessage = function(e) {
var t = e.data;
s(t)
}, p = function(t) {
e.port2.postMessage(t)
}
}
function d() {
var e = v.documentElement;
p = function(t) {
var n = v.createElement("script");
n.onreadystatechange = function() {
s(t), n.onreadystatechange = null, e.removeChild(n), n = null
}, e.appendChild(n)
}
}
function h() {
p = function(e) {
setTimeout(s, 0, e)
}
}
if (!e.setImmediate) {
var p, f = 1,
g = {},
m = !1,
v = e.document,
_ = Object.getPrototypeOf && Object.getPrototypeOf(e);
_ = _ && _.setTimeout ? _ : e, "[object process]" === {}.toString.call(e.process) ? a() : l() ? u() : e.MessageChannel ? c() : v && "onreadystatechange" in v.createElement("script") ? d() : h(), _.setImmediate = i, _.clearImmediate = r
}
}("undefined" == typeof self ? "undefined" == typeof e ? this : e : self)
}).call(t, function() {
return this
}(), n(83))
},
function(e, t) {
(function(t) {
function n(e, t) {
function n() {
if (!r) {
if (i("throwDeprecation")) throw new Error(t);
i("traceDeprecation") ? console.trace(t) : console.warn(t), r = !0
}
return e.apply(this, arguments)
}
if (i("noDeprecation")) return e;
var r = !1;
return n
}
function i(e) {
try {
if (!t.localStorage) return !1
} catch (n) {
return !1
}
var i = t.localStorage[e];
return null == i ? !1 : "true" === String(i).toLowerCase()
}
e.exports = n
}).call(t, function() {
return this
}())
},
function(e, t, n) {
function i(e) {
if (e && !l(e)) throw new Error("Unknown encoding: " + e)
}
function r(e) {
return e.toString(this.encoding)
}
function o(e) {
this.charReceived = e.length % 2, this.charLength = this.charReceived ? 2 : 0
}
function s(e) {
this.charReceived = e.length % 3, this.charLength = this.charReceived ? 3 : 0
}
var a = n(64).Buffer,
l = a.isEncoding || function(e) {
switch (e && e.toLowerCase()) {
case "hex":
case "utf8":
case "utf-8":
case "ascii":
case "binary":
case "base64":
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
case "raw":
return !0;
default:
return !1
}
},
u = t.StringDecoder = function(e) {
switch (this.encoding = (e || "utf8").toLowerCase().replace(/[-_]/, ""), i(e), this.encoding) {
case "utf8":
this.surrogateSize = 3;
break;
case "ucs2":
case "utf16le":
this.surrogateSize = 2, this.detectIncompleteChar = o;
break;
case "base64":
this.surrogateSize = 3, this.detectIncompleteChar = s;
break;
default:
return void(this.write = r)
}
this.charBuffer = new a(6), this.charReceived = 0, this.charLength = 0
};
u.prototype.write = function(e) {
for (var t = ""; this.charLength;) {
var n = e.length >= this.charLength - this.charReceived ? this.charLength - this.charReceived : e.length;
if (e.copy(this.charBuffer, this.charReceived, 0, n), this.charReceived += n, this.charReceived < this.charLength) return "";
e = e.slice(n, e.length), t = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
var i = t.charCodeAt(t.length - 1);
if (!(i >= 55296 && 56319 >= i)) {
if (this.charReceived = this.charLength = 0, 0 === e.length) return t;
break
}
this.charLength += this.surrogateSize, t = ""
}
this.detectIncompleteChar(e);
var r = e.length;
this.charLength && (e.copy(this.charBuffer, 0, e.length - this.charReceived, r), r -= this.charReceived), t += e.toString(this.encoding, 0, r);
var r = t.length - 1,
i = t.charCodeAt(r);
if (i >= 55296 && 56319 >= i) {
var o = this.surrogateSize;
return this.charLength += o, this.charReceived += o, this.charBuffer.copy(this.charBuffer, o, 0, o), e.copy(this.charBuffer, 0, 0, o), t.substring(0, r)
}
return t
}, u.prototype.detectIncompleteChar = function(e) {
for (var t = e.length >= 3 ? 3 : e.length; t > 0; t--) {
var n = e[e.length - t];
if (1 == t && n >> 5 == 6) {
this.charLength = 2;
break
}
if (2 >= t && n >> 4 == 14) {
this.charLength = 3;
break
}
if (3 >= t && n >> 3 == 30) {
this.charLength = 4;
break
}
}
this.charReceived = t
}, u.prototype.end = function(e) {
var t = "";
if (e && e.length && (t = this.write(e)), this.charReceived) {
var n = this.charReceived,
i = this.charBuffer,
r = this.encoding;
t += i.slice(0, n).toString(r)
}
return t
}
},
function(e, t, n) {
"use strict";
function i(e) {
this.afterTransform = function(t, n) {
return r(e, t, n)
}, this.needTransform = !1, this.transforming = !1, this.writecb = null, this.writechunk = null, this.writeencoding = null
}
function r(e, t, n) {
var i = e._transformState;
i.transforming = !1;
var r = i.writecb;
if (!r) return e.emit("error", new Error("no writecb in Transform class"));
i.writechunk = null, i.writecb = null, null !== n && void 0 !== n && e.push(n), r(t);
var o = e._readableState;
o.reading = !1, (o.needReadable || o.length < o.highWaterMark) && e._read(o.highWaterMark)
}
function o(e) {
if (!(this instanceof o)) return new o(e);
a.call(this, e), this._transformState = new i(this);
var t = this;
this._readableState.needReadable = !0, this._readableState.sync = !1, e && ("function" == typeof e.transform && (this._transform = e.transform), "function" == typeof e.flush && (this._flush = e.flush)), this.once("prefinish", function() {
"function" == typeof this._flush ? this._flush(function(e, n) {
s(t, e, n)
}) : s(t)
})
}
function s(e, t, n) {
if (t) return e.emit("error", t);
null !== n && void 0 !== n && e.push(n);
var i = e._writableState,
r = e._transformState;
if (i.length) throw new Error("Calling transform done when ws.length != 0");
if (r.transforming) throw new Error("Calling transform done when still transforming");
return e.push(null)
}
e.exports = o;
var a = n(92),
l = n(88);
l.inherits = n(89), l.inherits(o, a), o.prototype.push = function(e, t) {
return this._transformState.needTransform = !1, a.prototype.push.call(this, e, t)
}, o.prototype._transform = function(e, t, n) {
throw new Error("_transform() is not implemented")
}, o.prototype._write = function(e, t, n) {
var i = this._transformState;
if (i.writecb = n, i.writechunk = e, i.writeencoding = t, !i.transforming) {
var r = this._readableState;
(i.needTransform || r.needReadable || r.length < r.highWaterMark) && this._read(r.highWaterMark)
}
}, o.prototype._read = function(e) {
var t = this._transformState;
null !== t.writechunk && t.writecb && !t.transforming ? (t.transforming = !0, this._transform(t.writechunk, t.writeencoding, t.afterTransform)) : t.needTransform = !0
}
},
function(e, t, n) {
"use strict";
function i(e) {
return this instanceof i ? void r.call(this, e) : new i(e)
}
e.exports = i;
var r = n(98),
o = n(88);
o.inherits = n(89), o.inherits(i, r), i.prototype._transform = function(e, t, n) {
n(null, e)
}
},
function(e, t, n) {
e.exports = n(93)
},
function(e, t, n) {
e.exports = n(92)
},
function(e, t, n) {
e.exports = n(98)
},
function(e, t, n) {
e.exports = n(99)
},
function(e, t, n) {
(function(t) {
var i, r = n(68),
o = n(63),
s = (o.BaseTransform, o.BaseParser),
a = n(105);
e.exports = i = function(e, t) {
o.BaseParser.prototype.constructor.apply(this, arguments), e || (e = {
audioTrackId: -1,
videoTrackId: -1,
tracks: []
}), this.muxer = new a(e), this.muxer.ondata = this._onMp4Data.bind(this), this.muxer.oncodecinfo = this._onCodecInfo.bind(this), this._codecInfo = null, this._timestamp = 0, t && (this.worker = "undefined" != typeof Worker ? new Worker("/dist/mp4-mux-worker-bundle.js") : null), this.worker && (this.worker.onmessage = function(e) {
this._onMp4Data(e.data)
}.bind(this), this.worker.postMessage({
mp4MuxProfile: e
}))
}, i.Profiles = a.Profiles, i.prototype = o.createBaseParser({
constructor: i,
_onMp4Data: function(e) {
r("_onMp4Data"), this.enqueue(new o.Transfer(new t(e), "buffer"))
},
_onCodecInfo: function(e) {
r("Codec info: " + e), this._codecInfo = e
},
_onFinish: function(e) {
r("MP4Mux._onFinish"), this.worker ? this.worker.postMessage({
eos: !0
}) : this.muxer && this.muxer.flush(), s.prototype._onFinish.call(this, e)
},
_parse: function(e) {
var t;
e.data && (t = this._timestamp = e.data.timestamp), e.data.flush && (this._needFlush = !0), r("UnitMP4Mux Timestamp: " + this._timestamp), r("UnitMP4Mux._parse: Payload type: " + typeof e.data), this.worker ? (e.data.empty || this.worker.postMessage({
data: e.data,
meta: e.data.meta,
timestamp: t,
packetType: a.TYPE_AUDIO_PACKET
}), this._needFlush && (this.worker.postMessage({
eos: !0
}), this._needFlush = !1)) : this.muxer && (e.data.empty || this.muxer.pushPacket(a.TYPE_AUDIO_PACKET, new Uint8Array(e.data), t, e.data.meta), this._needFlush && (this.muxer.flush(), this._needFlush = !1))
}
})
}).call(t, n(64).Buffer)
},
function(e, t, n) {
function i(e) {
for (var t = e.length >> 1, n = new Uint8Array(t), i = 0; t > i; i++) n[i] = parseInt(e.substr(2 * i, 2), 16);
return n
}
function r(e, t) {
var n, i = 0,
r = s.RAW;
switch (t.codecId) {
case d:
var o = e[i++];
r = o, n = 1024;
break;
case c:
var l = e[i + 1] >> 3 & 3,
h = e[i + 1] >> 1 & 3;
n = 1 === h ? 3 === l ? 1152 : 576 : 3 === h ? 384 : 1152
}
return info = {
codecDescription: u[t.codecId],
codecId: t.codecId,
data: e.subarray(i),
rate: t.sampleRate,
size: t.sampleSize,
channels: t.channels,
samples: n,
packetType: r
}, a("parsed audio packet with %d samples", n), info
}
function o(e) {
var t = 0,
n = e[t] >> 4,
i = 15 & e[t];
t++;
var r = {
frameType: n,
codecId: i,
codecDescription: p[i]
};
switch (i) {
case g:
var o = e[t++];
r.packetType = o, r.compositionTime = (e[t] << 24 | e[t + 1] << 16 | e[t + 2] << 8) >> 8, t += 3;
break;
case f:
r.packetType = m.NALU, r.horizontalOffset = e[t] >> 4 & 15, r.verticalOffset = 15 & e[t], r.compositionTime = 0, t++
}
return r.data = e.subarray(t), r
}
var s, a = n(68),
l = n(106),
u = ["PCM", "ADPCM", "MP3", "PCM le", "Nellymouser16", "Nellymouser8", "Nellymouser", "G.711 A-law", "G.711 mu-law", null, "AAC", "Speex", "MP3 8khz"],
c = 2,
d = 10;
! function(e) {
e[e.HEADER = 0] = "HEADER", e[e.RAW = 1] = "RAW"
}(s || (s = {}));
var h, p = [null, "JPEG", "Sorenson", "Screen", "VP6", "VP6 alpha", "Screen2", "AVC"],
f = 4,
g = 7;
! function(e) {
e[e.KEY = 1] = "KEY", e[e.INNER = 2] = "INNER", e[e.DISPOSABLE = 3] = "DISPOSABLE", e[e.GENERATED = 4] = "GENERATED", e[e.INFO = 5] = "INFO"
}(h || (h = {}));
var m;
! function(e) {
e[e.HEADER = 0] = "HEADER", e[e.NALU = 1] = "NALU", e[e.END = 2] = "END"
}(m || (m = {}));
var v, _ = 8,
y = 9,
b = !0;
! function(e) {
e[e.CAN_GENERATE_HEADER = 0] = "CAN_GENERATE_HEADER", e[e.NEED_HEADER_DATA = 1] = "NEED_HEADER_DATA", e[e.MAIN_PACKETS = 2] = "MAIN_PACKETS"
}(v || (v = {}));
var w = function() {
function e(e) {
var t = this;
this.oncodecinfo = function(e) {
throw new Error("MP4Mux.oncodecinfo is not set")
}, this.ondata = function(e) {
throw new Error("MP4Mux.ondata is not set")
}, this.metadata = e, this.trackStates = this.metadata.tracks.map(function(e, n) {
var i = {
trackId: n + 1,
trackInfo: e,
cachedDuration: 0,
samplesProcessed: 0,
initializationData: []
};
return t.metadata.audioTrackId === n && (t.audioTrackState = i), t.metadata.videoTrackId === n && (t.videoTrackState = i), i
}, this), this._checkIfNeedHeaderData(), this.filePos = 0, this.cachedPackets = [], this.chunkIndex = 0
}
return e.prototype.pushPacket = function(e, t, n, i) {
switch (this.state === v.CAN_GENERATE_HEADER && this._tryGenerateHeader(), e) {
case _:
var a = this.audioTrackState,
l = r(t, i);
if (!a || a.trackInfo.codecId !== l.codecId) throw new Error("Unexpected audio packet codec: " + l.codecDescription);
switch (l.codecId) {
default: throw new Error("Unsupported audio codec: " + l.codecDescription);
case c:
break;
case d:
if (l.packetType === s.HEADER) return void a.initializationData.push(l.data)
}
this.cachedPackets.push({
packet: l,
timestamp: n,
trackId: a.trackId
});
break;
case y:
var u = this.videoTrackState,
h = o(t);
if (!u || u.trackInfo.codecId !== h.codecId) throw new Error("Unexpected video packet codec: " + h.codecDescription);
switch (h.codecId) {
default: throw new Error("unsupported video codec: " + h.codecDescription);
case f:
break;
case g:
if (h.packetType === m.HEADER) return void u.initializationData.push(h.data)
}
this.cachedPackets.push({
packet: h,
timestamp: n,
trackId: u.trackId
});
break;
default:
throw new Error("unknown packet type: " + e)
}
this.state === v.NEED_HEADER_DATA && this._tryGenerateHeader()
}, e.prototype.flush = function() {
this.cachedPackets.length > 0 && this._chunk()
}, e.prototype._checkIfNeedHeaderData = function() {
this.trackStates.some(function(e) {
return e.trackInfo.codecId === d || e.trackInfo.codecId === g
}) ? this.state = v.NEED_HEADER_DATA : this.state = v.CAN_GENERATE_HEADER
}, e.prototype._tryGenerateHeader = function() {
var e = this.trackStates.every(function(e) {
switch (e.trackInfo.codecId) {
case d:
case g:
return e.initializationData.length > 0;
default:
return !0
}
});
if (e) {
for (var t = ["isom"], n = 1, r = 1, o = [], s = 0; s < this.trackStates.length; s++) {
var a, u = this.trackStates[s],
h = u.trackInfo;
switch (h.codecId) {
case d:
var p = u.initializationData[0];
a = new l.AudioSampleEntry("mp4a", n, h.channels, h.samplesize, h.samplerate);
var m = new Uint8Array(41 + p.length);
m.set(i("0000000003808080"), 0), m[8] = 32 + p.length, m.set(i("00020004808080"), 9), m[16] = 18 + p.length, m.set(i("40150000000000FA000000000005808080"), 17), m[34] = p.length, m.set(p, 35), m.set(i("068080800102"), 35 + p.length), a.otherBoxes = [new l.RawTag("esds", m)];
var _ = p[0] >> 3;
u.mimeTypeCodec = "mp4a.40." + _;
break;
case c:
a = new l.AudioSampleEntry(".mp3", n, h.channels, h.samplesize, h.samplerate),
u.mimeTypeCodec = "mp3";
break;
case g:
var y = u.initializationData[0];
a = new l.VideoSampleEntry("avc1", r, h.width, h.height), a.otherBoxes = [new l.RawTag("avcC", y)];
var b = y[1] << 16 | y[2] << 8 | y[3];
u.mimeTypeCodec = "avc1." + (16777216 | b).toString(16).substr(1), t.push("iso2", "avc1", "mp41");
break;
case f:
a = new l.VideoSampleEntry("VP6F", r, h.width, h.height), a.otherBoxes = [new l.RawTag("glbl", i("00"))], u.mimeTypeCodec = "avc1.42001E";
break;
default:
throw new Error("not supported track type")
}
var w, x = l.TrackHeaderFlags.TRACK_ENABLED | l.TrackHeaderFlags.TRACK_IN_MOVIE;
u === this.audioTrackState ? w = new l.TrackBox(new l.TrackHeaderBox(x, u.trackId, -1, 0, 0, 1, s), new l.MediaBox(new l.MediaHeaderBox(h.timescale, -1, h.language), new l.HandlerBox("soun", "SoundHandler"), new l.MediaInformationBox(new l.SoundMediaHeaderBox, new l.DataInformationBox(new l.DataReferenceBox([new l.DataEntryUrlBox(l.SELF_CONTAINED_DATA_REFERENCE_FLAG)])), new l.SampleTableBox(new l.SampleDescriptionBox([a]), new l.RawTag("stts", i("0000000000000000")), new l.RawTag("stsc", i("0000000000000000")), new l.RawTag("stsz", i("000000000000000000000000")), new l.RawTag("stco", i("0000000000000000")))))) : u === this.videoTrackState && (w = new l.TrackBox(new l.TrackHeaderBox(x, u.trackId, -1, h.width, h.height, 0, s), new l.MediaBox(new l.MediaHeaderBox(h.timescale, -1, h.language), new l.HandlerBox("vide", "VideoHandler"), new l.MediaInformationBox(new l.VideoMediaHeaderBox, new l.DataInformationBox(new l.DataReferenceBox([new l.DataEntryUrlBox(l.SELF_CONTAINED_DATA_REFERENCE_FLAG)])), new l.SampleTableBox(new l.SampleDescriptionBox([a]), new l.RawTag("stts", i("0000000000000000")), new l.RawTag("stsc", i("0000000000000000")), new l.RawTag("stsz", i("000000000000000000000000")), new l.RawTag("stco", i("0000000000000000"))))))), o.push(w)
}
var k = new l.MovieExtendsBox(null, [new l.TrackExtendsBox(1, 1, 0, 0, 0), new l.TrackExtendsBox(2, 1, 0, 0, 0)], null),
S = new l.BoxContainerBox("udat", [new l.MetaBox(new l.RawTag("hdlr", i("00000000000000006D6469726170706C000000000000000000")), [new l.RawTag("ilst", i("00000025A9746F6F0000001D6461746100000001000000004C61766635342E36332E313034"))])]),
T = new l.MovieHeaderBox(1e3, 0, this.trackStates.length + 1),
A = new l.MovieBox(T, o, k, S),
E = new l.FileTypeBox("isom", 512, t),
C = E.layout(0),
D = A.layout(C),
P = new Uint8Array(C + D);
E.write(P), A.write(P), this.oncodecinfo(this.trackStates.map(function(e) {
return e.mimeTypeCodec
})), this.ondata(P), this.filePos += P.length, this.state = v.MAIN_PACKETS
}
}, e.prototype._chunk = function() {
var e = this.cachedPackets;
if (b && this.videoTrackState) {
for (var t = e.length - 1, n = this.videoTrackState.trackId; t > 0 && (e[t].trackId !== n || e[t].packet.frameType !== h.KEY);) t--;
t > 0 && (e = e.slice(0, t))
}
if (0 !== e.length) {
for (var i = [], r = 0, o = [], s = [], a = 0; a < this.trackStates.length; a++) {
var u = this.trackStates[a],
p = u.trackInfo,
m = u.trackId,
v = e.filter(function(e) {
return e.trackId === m
});
if (0 !== v.length) {
var _, y, w, x = new l.TrackFragmentBaseMediaDecodeTimeBox(u.cachedDuration);
switch (s.push(r), p.codecId) {
case d:
case c:
w = [];
for (var t = 0; t < v.length; t++) {
var k = v[t].packet,
S = Math.round(k.samples * p.timescale / p.samplerate);
i.push(k.data), r += k.data.length, w.push({
duration: S,
size: k.data.length
}), u.samplesProcessed += k.samples
}
var T = l.TrackFragmentFlags.DEFAULT_SAMPLE_FLAGS_PRESENT;
_ = new l.TrackFragmentHeaderBox(T, m, 0, 0, 0, 0, l.SampleFlags.SAMPLE_DEPENDS_ON_NO_OTHERS);
var A = l.TrackRunFlags.DATA_OFFSET_PRESENT | l.TrackRunFlags.SAMPLE_DURATION_PRESENT | l.TrackRunFlags.SAMPLE_SIZE_PRESENT;
y = new l.TrackRunBox(A, w, 0, 0), u.cachedDuration = Math.round(u.samplesProcessed * p.timescale / p.samplerate);
break;
case g:
case f:
w = [];
for (var E = u.samplesProcessed, C = E * p.timescale / p.framerate, D = Math.round(C), t = 0; t < v.length; t++) {
var P = v[t].packet;
E++;
var M = Math.round(E * p.timescale / p.framerate),
I = M - D;
D = M;
var R = Math.round(E * p.timescale / p.framerate + P.compositionTime * p.timescale / 1e3);
i.push(P.data), r += P.data.length;
var L = P.frameType === h.KEY ? l.SampleFlags.SAMPLE_DEPENDS_ON_NO_OTHERS : l.SampleFlags.SAMPLE_DEPENDS_ON_OTHER | l.SampleFlags.SAMPLE_IS_NOT_SYNC;
w.push({
duration: I,
size: P.data.length,
flags: L,
compositionTimeOffset: R - M
})
}
var T = l.TrackFragmentFlags.DEFAULT_SAMPLE_FLAGS_PRESENT;
_ = new l.TrackFragmentHeaderBox(T, m, 0, 0, 0, 0, l.SampleFlags.SAMPLE_DEPENDS_ON_NO_OTHERS);
var A = l.TrackRunFlags.DATA_OFFSET_PRESENT | l.TrackRunFlags.SAMPLE_DURATION_PRESENT | l.TrackRunFlags.SAMPLE_SIZE_PRESENT | l.TrackRunFlags.SAMPLE_FLAGS_PRESENT | l.TrackRunFlags.SAMPLE_COMPOSITION_TIME_OFFSET;
y = new l.TrackRunBox(A, w, 0, 0), u.cachedDuration = D, u.samplesProcessed = E;
break;
default:
throw new Error("Un codec")
}
var O = new l.TrackFragmentBox(_, x, y);
o.push(O)
}
}
this.cachedPackets.splice(0, e.length);
for (var F = new l.MovieFragmentHeaderBox(++this.chunkIndex), N = new l.MovieFragmentBox(F, o), B = N.layout(0), $ = new l.MediaDataBox(i), U = $.layout(B), z = B + 8, a = 0; a < o.length; a++) o[a].run.dataOffset = z + s[a];
var H = new Uint8Array(B + U);
N.write(H), $.write(H), this.ondata(H), this.filePos += H.length
}
}, e
}();
e.exports = w, w.MP3_SOUND_CODEC_ID = c, w.AAC_SOUND_CODEC_ID = d, w.TYPE_AUDIO_PACKET = _, w.TYPE_VIDEO_PACKET = y, w.Profiles = {
MP3_AUDIO_ONLY: {
audioTrackId: 0,
videoTrackId: -1,
tracks: [{
codecId: w.MP3_SOUND_CODEC_ID,
channels: 2,
samplerate: 44100,
samplesize: 16,
timescale: 44100
}]
}
}
},
function(e, t) {
function n(e) {
for (var t = new Uint8Array(4 * e.length), n = 0, i = 0, r = e.length; r > i; i++) {
var o = e.charCodeAt(i);
if (127 >= o) t[n++] = o;
else {
if (o >= 55296 && 56319 >= o) {
var s = e.charCodeAt(i + 1);
s >= 56320 && 57343 >= s && (o = ((1023 & o) << 10) + (1023 & s) + 65536, ++i)
}
0 !== (4292870144 & o) ? (t[n++] = 248 | o >>> 24 & 3, t[n++] = 128 | o >>> 18 & 63, t[n++] = 128 | o >>> 12 & 63, t[n++] = 128 | o >>> 6 & 63, t[n++] = 128 | 63 & o) : 0 !== (4294901760 & o) ? (t[n++] = 240 | o >>> 18 & 7, t[n++] = 128 | o >>> 12 & 63, t[n++] = 128 | o >>> 6 & 63, t[n++] = 128 | 63 & o) : 0 !== (4294965248 & o) ? (t[n++] = 224 | o >>> 12 & 15, t[n++] = 128 | o >>> 6 & 63, t[n++] = 128 | 63 & o) : (t[n++] = 192 | o >>> 6 & 31, t[n++] = 128 | 63 & o)
}
}
return t.subarray(0, n)
}
function i(e) {
for (var t = [], n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
return Array.prototype.concat.apply(e, t)
}
function r(e, t, n) {
e[t] = n >> 24 & 255, e[t + 1] = n >> 16 & 255, e[t + 2] = n >> 8 & 255, e[t + 3] = 255 & n
}
function o(e) {
return e.charCodeAt(0) << 24 | e.charCodeAt(1) << 16 | e.charCodeAt(2) << 8 | e.charCodeAt(3)
}
function s(e) {
return (e - p) / 1e3 | 0
}
function a(e) {
return 65536 * e | 0
}
function l(e) {
return 1073741824 * e | 0
}
function u(e) {
return 256 * e | 0
}
function c(e) {
return (31 & e.charCodeAt(0)) << 10 | (31 & e.charCodeAt(1)) << 5 | 31 & e.charCodeAt(2)
}
var d, h = this && this.__extends || function(e, t) {
function n() {
this.constructor = e
}
for (var i in t) t.hasOwnProperty(i) && (e[i] = t[i]);
e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, new n)
};
e.exports = d = {};
var p = -20828448e5,
f = [1, 0, 0, 0, 1, 0, 0, 0, 1],
g = [0, 0, 0],
m = function() {
function e(e, t) {
this.boxtype = e, "uuid" === e && (this.userType = t)
}
return e.prototype.layout = function(e) {
this.offset = e;
var t = 8;
return this.userType && (t += 16), this.size = t, t
}, e.prototype.write = function(e) {
return r(e, this.offset, this.size), r(e, this.offset + 4, o(this.boxtype)), this.userType ? (e.set(this.userType, this.offset + 8), 24) : 8
}, e.prototype.toUint8Array = function() {
var e = this.layout(0),
t = new Uint8Array(e);
return this.write(t), t
}, e
}();
d.Box = m;
var v = function(e) {
function t(t, n, i) {
void 0 === n && (n = 0), void 0 === i && (i = 0), e.call(this, t), this.version = n, this.flags = i
}
return h(t, e), t.prototype.layout = function(t) {
return this.size = e.prototype.layout.call(this, t) + 4, this.size
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return r(t, this.offset + n, this.version << 24 | this.flags), n + 4
}, t
}(m);
d.FullBox = v;
var _ = function(e) {
function t(t, n, i) {
e.call(this, "ftype"), this.majorBrand = t, this.minorVersion = n, this.compatibleBrands = i
}
return h(t, e), t.prototype.layout = function(t) {
return this.size = e.prototype.layout.call(this, t) + 4 * (2 + this.compatibleBrands.length), this.size
}, t.prototype.write = function(t) {
var n = this,
i = e.prototype.write.call(this, t);
return r(t, this.offset + i, o(this.majorBrand)), r(t, this.offset + i + 4, this.minorVersion), i += 8, this.compatibleBrands.forEach(function(e) {
r(t, n.offset + i, o(e)), i += 4
}, this), i
}, t
}(m);
d.FileTypeBox = _;
var y = function(e) {
function t(t, n) {
e.call(this, t), this.children = n
}
return h(t, e), t.prototype.layout = function(t) {
var n = e.prototype.layout.call(this, t);
return this.children.forEach(function(e) {
e && (n += e.layout(t + n))
}), this.size = n
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return this.children.forEach(function(e) {
e && (n += e.write(t))
}), n
}, t
}(m);
d.BoxContainerBox = y;
var b = function(e) {
function t(t, n, r, o) {
e.call(this, "moov", i([t], n, [r, o])), this.header = t, this.tracks = n, this.extendsBox = r, this.userData = o
}
return h(t, e), t
}(y);
d.MovieBox = b;
var w = function(e) {
function t(t, n, i, r, o, s, a, l) {
void 0 === r && (r = 1), void 0 === o && (o = 1), void 0 === s && (s = f), void 0 === a && (a = p), void 0 === l && (l = p), e.call(this, "mvhd", 0, 0), this.timescale = t, this.duration = n, this.nextTrackId = i, this.rate = r, this.volume = o, this.matrix = s, this.creationTime = a, this.modificationTime = l
}
return h(t, e), t.prototype.layout = function(t) {
return this.size = e.prototype.layout.call(this, t) + 16 + 4 + 2 + 2 + 8 + 36 + 24 + 4, this.size
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return r(t, this.offset + n, s(this.creationTime)), r(t, this.offset + n + 4, s(this.modificationTime)), r(t, this.offset + n + 8, this.timescale), r(t, this.offset + n + 12, this.duration), n += 16, r(t, this.offset + n, a(this.rate)), r(t, this.offset + n + 4, u(this.volume) << 16), r(t, this.offset + n + 8, 0), r(t, this.offset + n + 12, 0), n += 16, r(t, this.offset + n, a(this.matrix[0])), r(t, this.offset + n + 4, a(this.matrix[1])), r(t, this.offset + n + 8, a(this.matrix[2])), r(t, this.offset + n + 12, a(this.matrix[3])), r(t, this.offset + n + 16, a(this.matrix[4])), r(t, this.offset + n + 20, a(this.matrix[5])), r(t, this.offset + n + 24, l(this.matrix[6])), r(t, this.offset + n + 28, l(this.matrix[7])), r(t, this.offset + n + 32, l(this.matrix[8])), n += 36, r(t, this.offset + n, 0), r(t, this.offset + n + 4, 0), r(t, this.offset + n + 8, 0), r(t, this.offset + n + 12, 0), r(t, this.offset + n + 16, 0), r(t, this.offset + n + 20, 0), n += 24, r(t, this.offset + n, this.nextTrackId), n += 4
}, t
}(v);
d.MovieHeaderBox = w,
function(e) {
e[e.TRACK_ENABLED = 1] = "TRACK_ENABLED", e[e.TRACK_IN_MOVIE = 2] = "TRACK_IN_MOVIE", e[e.TRACK_IN_PREVIEW = 4] = "TRACK_IN_PREVIEW"
}(d.TrackHeaderFlags || (d.TrackHeaderFlags = {}));
var x = (d.TrackHeaderFlags, function(e) {
function t(t, n, i, r, o, s, a, l, u, c, d) {
void 0 === a && (a = 0), void 0 === l && (l = 0), void 0 === u && (u = f), void 0 === c && (c = p), void 0 === d && (d = p), e.call(this, "tkhd", 0, t), this.trackId = n, this.duration = i, this.width = r, this.height = o, this.volume = s, this.alternateGroup = a, this.layer = l, this.matrix = u, this.creationTime = c, this.modificationTime = d
}
return h(t, e), t.prototype.layout = function(t) {
return this.size = e.prototype.layout.call(this, t) + 20 + 8 + 6 + 2 + 36 + 8, this.size
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return r(t, this.offset + n, s(this.creationTime)), r(t, this.offset + n + 4, s(this.modificationTime)), r(t, this.offset + n + 8, this.trackId), r(t, this.offset + n + 12, 0), r(t, this.offset + n + 16, this.duration), n += 20, r(t, this.offset + n, 0), r(t, this.offset + n + 4, 0), r(t, this.offset + n + 8, this.layer << 16 | this.alternateGroup), r(t, this.offset + n + 12, u(this.volume) << 16), n += 16, r(t, this.offset + n, a(this.matrix[0])), r(t, this.offset + n + 4, a(this.matrix[1])), r(t, this.offset + n + 8, a(this.matrix[2])), r(t, this.offset + n + 12, a(this.matrix[3])), r(t, this.offset + n + 16, a(this.matrix[4])), r(t, this.offset + n + 20, a(this.matrix[5])), r(t, this.offset + n + 24, l(this.matrix[6])), r(t, this.offset + n + 28, l(this.matrix[7])), r(t, this.offset + n + 32, l(this.matrix[8])), n += 36, r(t, this.offset + n, a(this.width)), r(t, this.offset + n + 4, a(this.height)), n += 8
}, t
}(v));
d.TrackHeaderBox = x;
var k = function(e) {
function t(t, n, i, r, o) {
void 0 === i && (i = "unk"), void 0 === r && (r = p), void 0 === o && (o = p), e.call(this, "mdhd", 0, 0), this.timescale = t, this.duration = n, this.language = i, this.creationTime = r, this.modificationTime = o
}
return h(t, e), t.prototype.layout = function(t) {
return this.size = e.prototype.layout.call(this, t) + 16 + 4, this.size
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return r(t, this.offset + n, s(this.creationTime)), r(t, this.offset + n + 4, s(this.modificationTime)), r(t, this.offset + n + 8, this.timescale), r(t, this.offset + n + 12, this.duration), r(t, this.offset + n + 16, c(this.language) << 16), n + 20
}, t
}(v);
d.MediaHeaderBox = k;
var S = function(e) {
function t(t, i) {
e.call(this, "hdlr", 0, 0), this.handlerType = t, this.name = i, this._encodedName = n(this.name)
}
return h(t, e), t.prototype.layout = function(t) {
return this.size = e.prototype.layout.call(this, t) + 8 + 12 + (this._encodedName.length + 1), this.size
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return r(t, this.offset + n, 0), r(t, this.offset + n + 4, o(this.handlerType)), r(t, this.offset + n + 8, 0), r(t, this.offset + n + 12, 0), r(t, this.offset + n + 16, 0), n += 20, t.set(this._encodedName, this.offset + n), t[this.offset + n + this._encodedName.length] = 0, n += this._encodedName.length + 1
}, t
}(v);
d.HandlerBox = S;
var T = function(e) {
function t(t) {
void 0 === t && (t = 0), e.call(this, "smhd", 0, 0), this.balance = t
}
return h(t, e), t.prototype.layout = function(t) {
return this.size = e.prototype.layout.call(this, t) + 4, this.size
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return r(t, this.offset + n, u(this.balance) << 16), n + 4
}, t
}(v);
d.SoundMediaHeaderBox = T;
var A = function(e) {
function t(t, n) {
void 0 === t && (t = 0), void 0 === n && (n = g), e.call(this, "vmhd", 0, 0), this.graphicsMode = t, this.opColor = n
}
return h(t, e), t.prototype.layout = function(t) {
return this.size = e.prototype.layout.call(this, t) + 8, this.size
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return r(t, this.offset + n, this.graphicsMode << 16 | this.opColor[0]), r(t, this.offset + n + 4, this.opColor[1] << 16 | this.opColor[2]), n + 8
}, t
}(v);
d.VideoMediaHeaderBox = A, d.SELF_CONTAINED_DATA_REFERENCE_FLAG = 1;
var E = function(e) {
function t(t, i) {
void 0 === i && (i = null), e.call(this, "url ", 0, t), this.location = i, t & d.SELF_CONTAINED_DATA_REFERENCE_FLAG || (this._encodedLocation = n(i))
}
return h(t, e), t.prototype.layout = function(t) {
var n = e.prototype.layout.call(this, t);
return this._encodedLocation && (n += this._encodedLocation.length + 1), this.size = n
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return this._encodedLocation && (t.set(this._encodedLocation, this.offset + n), t[this.offset + n + this._encodedLocation.length] = 0, n += this._encodedLocation.length), n
}, t
}(v);
d.DataEntryUrlBox = E;
var C = function(e) {
function t(t) {
e.call(this, "dref", 0, 0), this.entries = t
}
return h(t, e), t.prototype.layout = function(t) {
var n = e.prototype.layout.call(this, t) + 4;
return this.entries.forEach(function(e) {
n += e.layout(t + n)
}), this.size = n
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return r(t, this.offset + n, this.entries.length), this.entries.forEach(function(e) {
n += e.write(t)
}), n
}, t
}(v);
d.DataReferenceBox = C;
var D = function(e) {
function t(t) {
e.call(this, "dinf", [t]), this.dataReference = t
}
return h(t, e), t
}(y);
d.DataInformationBox = D;
var P = function(e) {
function t(t) {
e.call(this, "stsd", 0, 0), this.entries = t
}
return h(t, e), t.prototype.layout = function(t) {
var n = e.prototype.layout.call(this, t);
return n += 4, this.entries.forEach(function(e) {
n += e.layout(t + n)
}), this.size = n
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return r(t, this.offset + n, this.entries.length), n += 4, this.entries.forEach(function(e) {
n += e.write(t)
}), n
}, t
}(v);
d.SampleDescriptionBox = P;
var M = function(e) {
function t(t, n, i, r, o) {
e.call(this, "stbl", [t, n, i, r, o]), this.sampleDescriptions = t, this.timeToSample = n, this.sampleToChunk = i, this.sampleSizes = r, this.chunkOffset = o
}
return h(t, e), t
}(y);
d.SampleTableBox = M;
var I = function(e) {
function t(t, n, i) {
e.call(this, "minf", [t, n, i]), this.header = t, this.info = n, this.sampleTable = i
}
return h(t, e), t
}(y);
d.MediaInformationBox = I;
var R = function(e) {
function t(t, n, i) {
e.call(this, "mdia", [t, n, i]), this.header = t, this.handler = n, this.info = i
}
return h(t, e), t
}(y);
d.MediaBox = R;
var L = function(e) {
function t(t, n) {
e.call(this, "trak", [t, n]), this.header = t, this.media = n
}
return h(t, e), t
}(y);
d.TrackBox = L;
var O = function(e) {
function t(t, n, i, r, o) {
e.call(this, "trex", 0, 0), this.trackId = t, this.defaultSampleDescriptionIndex = n, this.defaultSampleDuration = i, this.defaultSampleSize = r, this.defaultSampleFlags = o
}
return h(t, e), t.prototype.layout = function(t) {
return this.size = e.prototype.layout.call(this, t) + 20, this.size
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return r(t, this.offset + n, this.trackId), r(t, this.offset + n + 4, this.defaultSampleDescriptionIndex), r(t, this.offset + n + 8, this.defaultSampleDuration), r(t, this.offset + n + 12, this.defaultSampleSize), r(t, this.offset + n + 16, this.defaultSampleFlags), n + 20
}, t
}(v);
d.TrackExtendsBox = O;
var F = function(e) {
function t(t, n, r) {
e.call(this, "mvex", i([t], n, [r])), this.header = t, this.tracDefaults = n, this.levels = r
}
return h(t, e), t
}(y);
d.MovieExtendsBox = F;
var N = function(e) {
function t(t, n) {
e.call(this, "meta", 0, 0), this.handler = t, this.otherBoxes = n
}
return h(t, e), t.prototype.layout = function(t) {
var n = e.prototype.layout.call(this, t);
return n += this.handler.layout(t + n), this.otherBoxes.forEach(function(e) {
n += e.layout(t + n)
}), this.size = n
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return n += this.handler.write(t), this.otherBoxes.forEach(function(e) {
n += e.write(t)
}), n
}, t
}(v);
d.MetaBox = N;
var B = function(e) {
function t(t) {
e.call(this, "mfhd", 0, 0), this.sequenceNumber = t
}
return h(t, e), t.prototype.layout = function(t) {
return this.size = e.prototype.layout.call(this, t) + 4, this.size
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return r(t, this.offset + n, this.sequenceNumber), n + 4
}, t
}(v);
d.MovieFragmentHeaderBox = B,
function(e) {
e[e.BASE_DATA_OFFSET_PRESENT = 1] = "BASE_DATA_OFFSET_PRESENT", e[e.SAMPLE_DESCRIPTION_INDEX_PRESENT = 2] = "SAMPLE_DESCRIPTION_INDEX_PRESENT", e[e.DEFAULT_SAMPLE_DURATION_PRESENT = 8] = "DEFAULT_SAMPLE_DURATION_PRESENT", e[e.DEFAULT_SAMPLE_SIZE_PRESENT = 16] = "DEFAULT_SAMPLE_SIZE_PRESENT", e[e.DEFAULT_SAMPLE_FLAGS_PRESENT = 32] = "DEFAULT_SAMPLE_FLAGS_PRESENT"
}(d.TrackFragmentFlags || (d.TrackFragmentFlags = {}));
var $ = d.TrackFragmentFlags,
U = function(e) {
function t(t, n, i, r, o, s, a) {
e.call(this, "tfhd", 0, t), this.trackId = n, this.baseDataOffset = i, this.sampleDescriptionIndex = r, this.defaultSampleDuration = o, this.defaultSampleSize = s, this.defaultSampleFlags = a
}
return h(t, e), t.prototype.layout = function(t) {
var n = e.prototype.layout.call(this, t) + 4,
i = this.flags;
return i & $.BASE_DATA_OFFSET_PRESENT && (n += 8), i & $.SAMPLE_DESCRIPTION_INDEX_PRESENT && (n += 4), i & $.DEFAULT_SAMPLE_DURATION_PRESENT && (n += 4), i & $.DEFAULT_SAMPLE_SIZE_PRESENT && (n += 4), i & $.DEFAULT_SAMPLE_FLAGS_PRESENT && (n += 4), this.size = n
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t),
i = this.flags;
return r(t, this.offset + n, this.trackId), n += 4, i & $.BASE_DATA_OFFSET_PRESENT && (r(t, this.offset + n, 0), r(t, this.offset + n + 4, this.baseDataOffset), n += 8), i & $.SAMPLE_DESCRIPTION_INDEX_PRESENT && (r(t, this.offset + n, this.sampleDescriptionIndex), n += 4), i & $.DEFAULT_SAMPLE_DURATION_PRESENT && (r(t, this.offset + n, this.defaultSampleDuration), n += 4), i & $.DEFAULT_SAMPLE_SIZE_PRESENT && (r(t, this.offset + n, this.defaultSampleSize), n += 4), i & $.DEFAULT_SAMPLE_FLAGS_PRESENT && (r(t, this.offset + n, this.defaultSampleFlags), n += 4), n
}, t
}(v);
d.TrackFragmentHeaderBox = U;
var z = function(e) {
function t(t) {
e.call(this, "tfdt", 0, 0), this.baseMediaDecodeTime = t
}
return h(t, e), t.prototype.layout = function(t) {
return this.size = e.prototype.layout.call(this, t) + 4, this.size
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return r(t, this.offset + n, this.baseMediaDecodeTime), n + 4
}, t
}(v);
d.TrackFragmentBaseMediaDecodeTimeBox = z;
var H = function(e) {
function t(t, n, i) {
e.call(this, "traf", [t, n, i]), this.header = t, this.decodeTime = n, this.run = i
}
return h(t, e), t
}(y);
d.TrackFragmentBox = H,
function(e) {
e[e.IS_LEADING_MASK = 201326592] = "IS_LEADING_MASK", e[e.SAMPLE_DEPENDS_ON_MASK = 50331648] = "SAMPLE_DEPENDS_ON_MASK", e[e.SAMPLE_DEPENDS_ON_OTHER = 16777216] = "SAMPLE_DEPENDS_ON_OTHER", e[e.SAMPLE_DEPENDS_ON_NO_OTHERS = 33554432] = "SAMPLE_DEPENDS_ON_NO_OTHERS", e[e.SAMPLE_IS_DEPENDED_ON_MASK = 12582912] = "SAMPLE_IS_DEPENDED_ON_MASK", e[e.SAMPLE_HAS_REDUNDANCY_MASK = 3145728] = "SAMPLE_HAS_REDUNDANCY_MASK", e[e.SAMPLE_PADDING_VALUE_MASK = 917504] = "SAMPLE_PADDING_VALUE_MASK", e[e.SAMPLE_IS_NOT_SYNC = 65536] = "SAMPLE_IS_NOT_SYNC", e[e.SAMPLE_DEGRADATION_PRIORITY_MASK = 65535] = "SAMPLE_DEGRADATION_PRIORITY_MASK"
}(d.SampleFlags || (d.SampleFlags = {}));
d.SampleFlags;
! function(e) {
e[e.DATA_OFFSET_PRESENT = 1] = "DATA_OFFSET_PRESENT", e[e.FIRST_SAMPLE_FLAGS_PRESENT = 4] = "FIRST_SAMPLE_FLAGS_PRESENT", e[e.SAMPLE_DURATION_PRESENT = 256] = "SAMPLE_DURATION_PRESENT", e[e.SAMPLE_SIZE_PRESENT = 512] = "SAMPLE_SIZE_PRESENT", e[e.SAMPLE_FLAGS_PRESENT = 1024] = "SAMPLE_FLAGS_PRESENT", e[e.SAMPLE_COMPOSITION_TIME_OFFSET = 2048] = "SAMPLE_COMPOSITION_TIME_OFFSET"
}(d.TrackRunFlags || (d.TrackRunFlags = {}));
var j = d.TrackRunFlags,
W = function(e) {
function t(t, n, i, r) {
e.call(this, "trun", 1, t), this.samples = n, this.dataOffset = i, this.firstSampleFlags = r
}
return h(t, e), t.prototype.layout = function(t) {
var n = e.prototype.layout.call(this, t) + 4,
i = this.samples.length,
r = this.flags;
return r & j.DATA_OFFSET_PRESENT && (n += 4), r & j.FIRST_SAMPLE_FLAGS_PRESENT && (n += 4), r & j.SAMPLE_DURATION_PRESENT && (n += 4 * i), r & j.SAMPLE_SIZE_PRESENT && (n += 4 * i), r & j.SAMPLE_FLAGS_PRESENT && (n += 4 * i), r & j.SAMPLE_COMPOSITION_TIME_OFFSET && (n += 4 * i), this.size = n
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t),
i = this.samples.length,
o = this.flags;
r(t, this.offset + n, i), n += 4, o & j.DATA_OFFSET_PRESENT && (r(t, this.offset + n, this.dataOffset), n += 4), o & j.FIRST_SAMPLE_FLAGS_PRESENT && (r(t, this.offset + n, this.firstSampleFlags), n += 4);
for (var s = 0; i > s; s++) {
var a = this.samples[s];
o & j.SAMPLE_DURATION_PRESENT && (r(t, this.offset + n, a.duration), n += 4), o & j.SAMPLE_SIZE_PRESENT && (r(t, this.offset + n, a.size), n += 4), o & j.SAMPLE_FLAGS_PRESENT && (r(t, this.offset + n, a.flags), n += 4), o & j.SAMPLE_COMPOSITION_TIME_OFFSET && (r(t, this.offset + n, a.compositionTimeOffset), n += 4)
}
return n
}, t
}(v);
d.TrackRunBox = W;
var q = function(e) {
function t(t, n) {
e.call(this, "moof", i([t], n)), this.header = t, this.trafs = n
}
return h(t, e), t
}(y);
d.MovieFragmentBox = q;
var Y = function(e) {
function t(t) {
e.call(this, "mdat"), this.chunks = t
}
return h(t, e), t.prototype.layout = function(t) {
var n = e.prototype.layout.call(this, t);
return this.chunks.forEach(function(e) {
n += e.length
}), this.size = n
}, t.prototype.write = function(t) {
var n = this,
i = e.prototype.write.call(this, t);
return this.chunks.forEach(function(e) {
t.set(e, n.offset + i), i += e.length
}, this), i
}, t
}(m);
d.MediaDataBox = Y;
var V = function(e) {
function t(t, n) {
e.call(this, t), this.dataReferenceIndex = n
}
return h(t, e), t.prototype.layout = function(t) {
return this.size = e.prototype.layout.call(this, t) + 8, this.size
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return r(t, this.offset + n, 0), r(t, this.offset + n + 4, this.dataReferenceIndex), n + 8
}, t
}(m);
d.SampleEntry = V;
var G = function(e) {
function t(t, n, i, r, o, s) {
void 0 === i && (i = 2), void 0 === r && (r = 16), void 0 === o && (o = 44100), void 0 === s && (s = null), e.call(this, t, n), this.channelCount = i, this.sampleSize = r, this.sampleRate = o, this.otherBoxes = s
}
return h(t, e), t.prototype.layout = function(t) {
var n = e.prototype.layout.call(this, t) + 20;
return this.otherBoxes && this.otherBoxes.forEach(function(e) {
n += e.layout(t + n)
}), this.size = n
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return r(t, this.offset + n, 0), r(t, this.offset + n + 4, 0), r(t, this.offset + n + 8, this.channelCount << 16 | this.sampleSize), r(t, this.offset + n + 12, 0), r(t, this.offset + n + 16, this.sampleRate << 16), n += 20, this.otherBoxes && this.otherBoxes.forEach(function(e) {
n += e.write(t)
}), n
}, t
}(V);
d.AudioSampleEntry = G, d.COLOR_NO_ALPHA_VIDEO_SAMPLE_DEPTH = 24;
var K = function(e) {
function t(t, n, i, r, o, s, a, l, u, c) {
if (void 0 === o && (o = ""), void 0 === s && (s = 72), void 0 === a && (a = 72), void 0 === l && (l = 1), void 0 === u && (u = d.COLOR_NO_ALPHA_VIDEO_SAMPLE_DEPTH), void 0 === c && (c = null), e.call(this, t, n), this.width = i, this.height = r, this.compressorName = o, this.horizResolution = s, this.vertResolution = a, this.frameCount = l, this.depth = u, this.otherBoxes = c, o.length > 31) throw new Error("invalid compressor name")
}
return h(t, e), t.prototype.layout = function(t) {
var n = e.prototype.layout.call(this, t) + 16 + 12 + 4 + 2 + 32 + 2 + 2;
return this.otherBoxes && this.otherBoxes.forEach(function(e) {
n += e.layout(t + n)
}), this.size = n
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
r(t, this.offset + n, 0), r(t, this.offset + n + 4, 0), r(t, this.offset + n + 8, 0), r(t, this.offset + n + 12, 0), n += 16, r(t, this.offset + n, this.width << 16 | this.height), r(t, this.offset + n + 4, a(this.horizResolution)), r(t, this.offset + n + 8, a(this.vertResolution)), n += 12, r(t, this.offset + n, 0), r(t, this.offset + n + 4, this.frameCount << 16), n += 6, t[this.offset + n] = this.compressorName.length;
for (var i = 0; 31 > i; i++) t[this.offset + n + i + 1] = i < this.compressorName.length ? 127 & this.compressorName.charCodeAt(i) : 0;
return n += 32, r(t, this.offset + n, this.depth << 16 | 65535), n += 4, this.otherBoxes && this.otherBoxes.forEach(function(e) {
n += e.write(t)
}), n
}, t
}(V);
d.VideoSampleEntry = K;
var X = function(e) {
function t(t, n) {
e.call(this, t), this.data = n
}
return h(t, e), t.prototype.layout = function(t) {
return this.size = e.prototype.layout.call(this, t) + this.data.length, this.size
}, t.prototype.write = function(t) {
var n = e.prototype.write.call(this, t);
return t.set(this.data, this.offset + n), n + this.data.length
}, t
}(m);
d.RawTag = X
},
function(e, t, n) {
(function(t) {
var i, r = n(68),
o = n(63),
s = (o.BaseTransform, n(108));
n(109);
e.exports = i = function() {
o.BaseParser.prototype.constructor.apply(this, arguments), this.parser = new s, this.parser.onFrame = this._onMp3Frame.bind(this), this.parser.onNoise = this._onNoise.bind(this), this.parser.onClose = this._onClose.bind(this), this._sampleRate = 0, this._bitRate = 0, this._timestamp = 0
}, i.prototype = o.createBaseParser({
constructor: i,
_onMp3Frame: function(e, n, i) {
r("Found frame length " + e.length + " bitRate=" + n + ", sampleRate=" + i);
var s = new t(e),
a = 1152;
s.meta = {
mimeType: "audio/mpeg",
codecId: 2,
channels: 2,
bitRate: n,
sampleRate: i,
sampleSize: 16
}, s.duration = a, s.timestamp = this._timestamp, this.enqueue(new o.Transfer(s, "buffer")), this._bitRate = n, this._timestamp += a
},
_onNoise: function() {
r("mp3 has noise")
},
_onClose: function() {
r("parser closed")
},
_parse: function(e) {
return r("parse called"), e.data.empty ? (r("empty transfer"), void this.enqueue(e)) : void this.parser.push(new Uint8Array(e.data))
}
})
}).call(t, n(64).Buffer)
},
function(e, t, n) {
var i = n(68),
r = [32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160],
o = [44100, 48e3, 32e3, 22050, 24e3, 16e3, 11025, 12e3, 8e3],
s = function() {
function e() {
this.buffer = null, this.bufferSize = 0
}
return e.prototype.push = function(e) {
var t;
if (this.bufferSize > 0) {
var n = e.length + this.bufferSize;
if (!this.buffer || this.buffer.length < n) {
var r = new Uint8Array(n);
this.bufferSize > 0 && r.set(this.buffer.subarray(0, this.bufferSize)), this.buffer = r
}
this.buffer.set(e, this.bufferSize), this.bufferSize = n, e = this.buffer, t = n
} else t = e.length;
i("push " + t);
for (var o, s = 0; t > s && (o = this._parse(e, s, t)) > 0;) s += o;
var a = t - s;
a > 0 && (!this.buffer || this.buffer.length < a ? this.buffer = new Uint8Array(e.subarray(s, t)) : this.buffer.set(e.subarray(s, t))), this.bufferSize = a
}, e.prototype._parse = function(e, t, n) {
if (i("_parse"), t + 2 > n) return -1;
if (255 === e[t] || 224 === (224 & e[t + 1])) {
if (t + 24 > n) return -1;
var s = e[t + 1] >> 3 & 3,
a = e[t + 1] >> 1 & 3,
l = e[t + 2] >> 4 & 15,
u = e[t + 2] >> 2 & 3,
c = !!(2 & e[t + 2]);
if (1 !== s && 0 !== l && 15 !== l && 3 !== u) {
var d = 3 === s ? 3 - a : 3 === a ? 3 : 4,
h = 1e3 * r[14 * d + l - 1],
p = 3 === s ? 0 : 2 === s ? 1 : 2,
f = o[3 * p + u],
g = c ? 1 : 0,
m = 3 === a ? (3 === s ? 12 : 6) * h / f + g << 2 : (3 === s ? 144 : 72) * h / f + g | 0;
return t + m > n ? -1 : (this.onFrame && (i("onFrame"), this.onFrame(e.subarray(t, t + m), h, f)), m)
}
}
for (var v = t + 2; n > v;) {
if (255 === e[v - 1] && 224 === (224 & e[v])) return this.onNoise && this.onNoise(e.subarray(t, v - 1)), v - t - 1;
v++
}
return -1
}, e.prototype.close = function() {
this.bufferSize > 0 && this.onNoise && this.onNoise(this.buffer.subarray(0, this.bufferSize)), this.buffer = null, this.bufferSize = 0, this.onClose && this.onClose()
}, e
}();
e.exports = s
},
function(e, t) {
var n = 1e9;
e.exports = {
TIMESCALE_SECONDS: n
}
},
function(e, t, n) {
var i, r = n(111),
o = n(63),
s = o.BaseSink,
a = n(112);
e.exports = i = function(e) {
if (s.prototype.constructor.call(this), !r.haveMediaSourceSupportMimeType(e)) throw new Error("Local MediaSource doesn't support provided MIME type: " + e);
var t;
t = arguments.length > 1 ? Array.prototype.slice.call(arguments) : e instanceof Array ? e : [e], this.mimeTypes = t, this.mediaSource = new MediaSource, this.mseWriter = new a(this.mediaSource), this.dataSources = [], this.selectedDataSourceIndex = 0, this.mimeTypes.forEach(function(e) {
var t = {
mimeType: e
};
this.mseWriter.listen(t), this.dataSources.push(t)
}.bind(this))
}, i.prototype = o.createBaseSink({
constructor: i,
_onData: function() {
var e = this.dataSources[this.selectedDataSourceIndex];
if (!e || !e.onData) throw new Error("DataSource is not existing or has no onData function defined");
var t = this.dequeue();
t && e.onData(t.data)
},
getMediaSourceUrl: function() {
return URL.createObjectURL(this.mediaSource)
}
})
},
function(e, t) {
var n;
e.exports = n = {
haveGlobalWindow: function() {
return "undefined" != typeof window
},
haveMediaSourceExtensions: function() {
return n.haveGlobalWindow() && window.MediaSource
},
haveMediaSourceSupportMimeType: function(e) {
return n.haveMediaSourceExtensions() && window.MediaSource.isTypeSupported(e)
}
}
},
function(e, t) {
var n = function() {
function e(e, t) {
this.mediaSource = e, this.dataSource = t, this.dataSource.onData = this.pushData.bind(this), this.updateEnabled = !1, this.buffer = [], this.sourceBuffer = null, this.sourceBufferUpdatedBound = null
}
return e.prototype.allowWriting = function() {
this.updateEnabled = !0, this.update()
}, e.prototype.pushData = function(e) {
this.buffer.push(e), this.update()
}, e.prototype.update = function() {
if (this.updateEnabled && 0 !== this.buffer.length) {
this.sourceBuffer || (this.sourceBuffer = this.mediaSource.addSourceBuffer(this.dataSource.mimeType), this.sourceBufferUpdatedBound = this._sourceBufferUpdated.bind(this), this.sourceBuffer.addEventListener("update", this.sourceBufferUpdatedBound)), this.updateEnabled = !1;
var e = this.buffer.shift();
if (null === e) return void this.sourceBuffer.removeEventListener("update", this.sourceBufferUpdatedBound);
e.timestamp && (this.sourceBuffer.timestampOffset = e.timestamp / 1e9), this.sourceBuffer.appendBuffer(e)
}
}, e.prototype._sourceBufferUpdated = function(e) {
this.updateEnabled = !0, this.update()
}, e.prototype.finish = function() {
this.buffer.push(null), this.update()
}, e
}(),
i = function() {
function e(e) {
this.bufferWriters = [], this.mediaSource = e, this.mediaSourceOpened = !1, this.mediaSource.addEventListener("sourceopen", function(e) {
this.mediaSourceOpened = !0, this.bufferWriters.forEach(function(e) {
e.allowWriting()
})
}.bind(this)), this.mediaSource.addEventListener("sourceend", function(e) {
this.mediaSourceOpened = !1
}.bind(this))
}
return e.prototype.listen = function(e) {
var t = new n(this.mediaSource, e);
this.bufferWriters.push(t), this.mediaSourceOpened && t.allowWriting()
}, e
}();
e.exports = i
},
function(e, t, n) {
var i, r, o = n(63);
r = function(e) {
o.BasePushSrc.prototype.constructor.call(this);
var t = this.req = new XMLHttpRequest;
t.open("GET", e, !0), t.responseType = "arraybuffer", t.onload = function(e) {
this.enqueue(new o.Transfer(new Uint8Array(t.response), "binary")), this.enqueue(new o.Transfer(null, "binary"))
}.bind(this), t.send()
}, r.prototype = o.createBasePushSrc({
constructor: r
}), e.exports = i = {
Src: r
}
},
function(e, t, n) {
var i, r, o, s = n(63),
a = n(115);
n(70);
r = function(e, t) {
s.prototype.constructor.call(this);
var n = a.createReadStream(e, t);
this.on("end", function() {
n.close()
}), this.addOutput(n)
}, r.prototype = s.create({
constructor: r
}), o = function(e, t) {
s.prototype.constructor.call(this);
var n = a.createWriteStream(e, t);
this.on("finish", function() {
n.close()
}), this.addInput(n)
}, o.prototype = s.create({
constructor: o
}), e.exports = i = {
Src: r,
Sink: o
}
},
function(e, t, n) {
var i = n(111);
e.exports = i.haveGlobalWindow() ? new(n(116)) : n(! function() {
var e = new Error('Cannot find module "fs"');
throw e.code = "MODULE_NOT_FOUND", e
}())
},
function(e, t, n) {
! function(t) {
e.exports = t()
}(function() {
function e() {
return !1
}
function t(e) {
return !!(e && !e.isFile && e.data instanceof Object)
}
function n(e) {
return !(!e || !e.isFile)
}
function i(e, n) {
var i, r = e.length,
o = n;
for (i = 0; r > i; ++i) {
if (!t(o)) throw new Error("ENOENT");
o = o.data[e[i]]
}
return o
}
String.prototype.trim || ! function() {
var e = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
String.prototype.trim = function() {
return this.replace(e, "")
}
}();
var r = {
utf8: "utf-8",
utf16le: "utf-16le",
utf16be: "utf-16be"
},
o = function(e) {
var t = Date.now();
this.root = {
mtime: t,
ctime: t,
atime: t,
data: {}
}, this.fnDone = function() {
var t = arguments;
"function" == typeof e && setTimeout(function() {
e.apply(null, t)
}, 0)
}
};
return o.prototype.arrayBufferToString = function(e, t) {
return "undefined" == typeof TextDecoder ? String.fromCharCode.apply(null, new Uint16Array(e)) : (t = r[t] || "utf8", new TextDecoder(t).decode(new DataView(e)));
}, o.prototype.stringToArrayBuffer = function(e, t) {
var n;
if (t = r[t] || "utf8", "undefined" == typeof TextEncoder) {
n = new ArrayBuffer(2 * e.length);
for (var i = new Uint16Array(n), o = 0, s = e.length; s > o; ++o) i[o] = e.charCodeAt(o)
} else n = new TextEncoder(t).encode(e).buffer;
return n
}, o.prototype.getNode = function(e) {
return i(this.parsePath(e), this.root)
}, o.prototype.joinPath = function() {
var e = [],
t = arguments || [];
return e = this.parsePath(Array.prototype.slice.call(t).join("/")), ("/" === t[0][0] ? "/" : "") + e.join("/")
}, o.prototype.parsePath = function(e) {
var t = [];
return e = e || "/", e.split(/\/+/).forEach(function(e) {
e = e.trim(), e.length && "." !== e && (".." === e ? t.pop() : t.push(e))
}), t
}, o.prototype.normalizePath = function(e) {
return "/" + this.parsePath(e).join("/")
}, o.prototype.dirname = function(e) {
var t = this.parsePath(e);
return t = t.slice(0, t.length - 1), "/" + t.join("/")
}, o.prototype.basename = function(e) {
var t = this.parsePath(e);
return t.length ? t.pop() : ""
}, o.prototype.fileSizeSI = function(e, t, n, i, r) {
return (t = Math, n = t.log, i = 1e3, r = n(e) / n(i) | 0, e / t.pow(i, r)).toFixed(r ? 2 : 0) + " " + (r ? "kMGTPEZY" [--r] + "B" : "Bytes")
}, o.prototype.fileSizeIEC = function(e, t, n, i, r) {
return (t = Math, n = t.log, i = 1024, r = n(e) / n(i) | 0, e / t.pow(i, r)).toFixed(r ? 2 : 0) + " " + (r ? "KMGTPEZY" [--r] + "iB" : "Bytes")
}, o.prototype.statSync = function(n) {
var r = this.parsePath(n),
o = i(r, this.root),
s = t(o);
if (!o || !o.data) throw new Error("ENOENT");
return this.fnDone("stat", n), {
size: s ? Object.keys(o.data).length : o.data.byteLength,
ctime: new Date(o.ctime),
mtime: new Date(o.mtime),
atime: new Date(o.atime),
isFile: function() {
return !s
},
isDirectory: function() {
return s
},
isBlockDevice: e,
isCharacterDevice: e,
isSymbolicLink: e,
isFIFO: e,
isSocket: e
}
}, o.prototype.existsSync = function(e) {
var n, i = this.parsePath(e),
r = i.length,
o = this.root;
for (n = 0; r > n; ++n) {
if (!t(o)) return this.fnDone("exists", e), !1;
o = o.data[i[n]]
}
return this.fnDone("exists", e), !!o
}, o.prototype.mkdirSync = function(e) {
var n, r = this.parsePath(e),
o = i(r.slice(0, r.length - 1), this.root),
s = Date.now();
if (!r.length || !t(o)) throw new Error("ENODIR");
return n = r[r.length - 1], o.data[n] || (o.data[n] = {
data: {},
ctime: s,
mtime: s,
atime: s
}, o.mtime = s), this.fnDone("mkdir", e), this
}, o.prototype.mkdirpSync = function(e) {
var r, o, s, a = this.parsePath(e),
l = a.length;
if (!a.length) throw new Error("ENODIR");
for (o = 0; l > o; ++o) {
if (r = a.slice(0, o + 1), s = i(r, this.root), n(s)) throw new Error("ENODIR");
t(s) || this.mkdirSync(r.join("/"))
}
return this.fnDone("mkdirp", e), this
}, o.prototype.readdirSync = function(e) {
var n = this.parsePath(e),
r = i(n, this.root);
if (!t(r)) throw new Error("ENODIR");
return r.atime = Date.now(), this.fnDone("readdir", e), Object.keys(r.data)
}, o.prototype.rmdirSync = function(e) {
var n = this.parsePath(e),
r = i(n, this.root),
o = n.pop(),
s = i(n, this.root);
if (!t(r)) throw new Error("ENODIR");
if (Object.keys(r.data).length) throw new Error("ENOTEMPTY");
return delete s.data[o], s.mtime = Date.now(), this.fnDone("rmdir", e), this
}, o.prototype.unlinkSync = function(e) {
var t = this.dirname(e),
n = this.basename(e),
r = i(this.parsePath(t), this.root);
return delete r.data[n], r.mtime = Date.now(), this.fnDone("unlink", e), this
}, o.prototype.rmrfSync = function(e) {
var n = this.parsePath(e),
r = n.pop(),
o = i(n, this.root);
if (!t(o)) throw new Error("ENODIR");
return r ? delete o.data[r] : o.data = {}, o.mtime = Date.now(), this.fnDone("rmrf", e), this
}, o.prototype.writeFileSync = function(e, n, r) {
var o, s, a = this.parsePath(e),
l = a.pop(),
u = this.existsSync(e),
c = i(a, this.root);
if (!t(c)) throw new Error("ENODIR");
if (!l) throw new Error("EINVALIDPATH");
return "string" == typeof r && (r = {
encoding: r
}), r = r || {
encoding: null
}, o = "string" == typeof n ? this.stringToArrayBuffer(n, r.encoding) : n, s = Date.now(), u ? (c.data[l].data = o, c.data[l].atime = s, c.data[l].mtime = s) : (c.data[l] = {
data: o,
ctime: s,
mtime: s,
atime: s,
isFile: !0
}, c.mtime = s), c.atime = s, this.fnDone("writeFile", e), this
}, o.prototype.readFileSync = function(e, t) {
var r = this.parsePath(e),
o = i(r, this.root);
if ("string" == typeof t && (t = {
encoding: t
}), t = t || {
encoding: null
}, !n(o)) throw new Error("ENOENT");
return o.atime = Date.now(), this.fnDone("readFile", e), t.encoding ? this.arrayBufferToString(o.data, t.encoding) : o.data
}, o.prototype.renameSync = function(e, n) {
var r = this.parsePath(e),
o = i(r, this.root),
s = i(r.slice(0, r.length - 1), this.root),
a = r[r.length - 1],
l = this.parsePath(n),
u = i(l, this.root),
c = i(l.slice(0, l.length - 1), this.root),
d = l[l.length - 1],
h = Date.now();
if (!r.length || !l.length) throw new Error("ENOENT");
if (!t(s || !t(c))) throw new Error("ENODIR");
if (u) throw new Error("EEXISTS");
return c.data[d] = u = o, u.ctime = h, c.mtime = h, delete s.data[a], s.mtime = h, this.fnDone("rename", {
oldPath: e,
newPath: n
}), this
}, ["exists"].forEach(function(e) {
o.prototype[e] = function(t, n) {
return n(this[e + "Sync"](t))
}
}), ["stat", "readdir", "mkdirp", "mkdir", "rmdir", "rmrf", "unlink"].forEach(function(e) {
o.prototype[e] = function(t, n) {
var i;
try {
i = this[e + "Sync"](t)
} catch (r) {
return n(r)
}
return n(null, i)
}
}), ["readFile"].forEach(function(e) {
o.prototype[e] = function(t, n, i) {
var r;
i || (i = n, n = void 0);
try {
r = this[e + "Sync"](t, n)
} catch (o) {
return i(o)
}
return i(null, r)
}
}), ["rename"].forEach(function(e) {
o.prototype[e] = function(t, n, i) {
var r;
try {
r = this[e + "Sync"](t, n)
} catch (o) {
return i(o)
}
return i(null, r)
}
}), ["writeFile"].forEach(function(e) {
o.prototype[e] = function(t, n, i, r) {
var o;
r || (r = i, i = void 0);
try {
o = this[e + "Sync"](t, n, i)
} catch (s) {
return r(s)
}
return r(null, o)
}
}), o
})
},
function(e, t, n) {
var i, r = n(34),
o = n(40),
s = n(1),
a = o.bindAll;
e.exports = i = function(e, t, n) {
a(this, ["_onMSEInit", "_onSourceBufferUpdateEnd", "_onSourceBufferError"]), this.mimeType = n, this._ready = !1, this._logger = t, this._html5Audio = e, this._objectUrl = null, this._sourceBuffer = null, this._mediaSource = null, this._canAppendInitData = !0, this._whenStableUpdateListeners = [], this._mediaSource = new window.MediaSource, this._mediaSource.addEventListener("sourceopen", this._onMSEInit, !1), this._objectUrl = URL.createObjectURL(this._mediaSource), this._html5Audio.removeAttribute("src"), this._html5Audio.src = this._objectUrl
}, i.Events = {
SOURCE_READY: "source-ready",
SOURCE_ERROR: "source-error"
}, s(i.prototype, r), s(i.prototype, {
_onMSEInit: function() {
this._log("MSE initialised."), this._mediaSource.removeEventListener("sourceopen", this._onMSEInit, !1), this._sourceBuffer = this._mediaSource.addSourceBuffer(this.mimeType), this._sourceBuffer.appendMode = "sequence", this._sourceBuffer.addEventListener("updateend", this._onSourceBufferUpdateEnd, !1), this._sourceBuffer.addEventListener("error", this._onSourceBufferError, !1), this._ready = !0, this.trigger(i.Events.SOURCE_READY)
},
_append: function(e) {
try {
this._sourceBuffer.appendBuffer(e.buffer)
} catch (t) {
this._log("Error while appending to SourceBuffer: " + t.message), this.trigger(i.Events.SOURCE_ERROR, t)
}
},
_onSourceBufferUpdateEnd: function() {
if (this._log("Update end."), 0 !== this._whenStableUpdateListeners.length && !this._sourceBuffer.updating) {
var e = this._whenStableUpdateListeners.shift();
e()
}
},
_onSourceBufferError: function() {
this._log("An error occurred when trying to update the source buffer.")
},
_log: function(e) {
this._logger.log("[MSE] " + e)
},
appendInitData: function(e) {
if (!this._ready) throw new Error("MediaSource is not ready yet");
this._log("Preparing to append init data."), this.whenStable(function() {
if (this._log("Appending init data."), !this._canAppendInitData) throw new Error("Cannot append init data at this stage.");
this._canAppendInitData = !1, this._append(e)
}.bind(this))
},
append: function(e) {
if (!this._ready) throw new Error("MediaSource is not ready yet");
var t = e.getIndex();
this._log("Preparing to append segment " + t), this.whenStable(function() {
this._log("Appending segment " + t + ". Start: " + e.getStartPosition() + " End: " + e.getEndPosition()), this._canAppendInitData = !1;
try {
this._sourceBuffer.timestampOffset = e.getStartPosition() / 1e3, this._append(e.getData())
} catch (n) {
this._log("Error while appending to SourceBuffer: " + n.message), this.trigger(i.Events.SOURCE_ERROR, n)
}
}.bind(this))
},
remove: function(e, t) {
if (!this._ready) throw new Error("MediaSource is not ready yet");
if (e > t) throw new Error("Start cannot be > end.");
this._log("Preparing to remove buffer region. Start: " + e + " End: " + t), this.whenStable(function() {
this._log("Removing buffered region. Start: " + e + " End: " + t);
try {
this._sourceBuffer.remove(e / 1e3, t / 1e3)
} catch (n) {
this._log("Error while appending to SourceBuffer: " + n.message), this.trigger(i.Events.SOURCE_ERROR, n)
}
}.bind(this))
},
endOfStream: function() {
this._log("Preparing to finalize stream."), this.whenStable(function() {
this._log("Finalizing stream");
try {
this._mediaSource.endOfStream(), this._log("Called endOfStream()")
} catch (e) {
this._log("MediaSource endOfStream() call failed. State: " + this._mediasSource.readyState + " Error: " + e.message), this.trigger(i.Events.SOURCE_ERROR, e)
}
}.bind(this))
},
setDuration: function(e) {
var t = e / 1e3;
this._mediaSource.duration = t
},
whenStable: function(e) {
if (!this._sourceBuffer) throw new Error("MSE not initialised yet.");
if ("open" !== this._mediaSource.readyState) throw new Error("Media source is not open. State: " + this._mediaSource.readyState);
this._sourceBuffer.updating ? this._whenStableUpdateListeners.push(e) : e()
},
getBuffered: function() {
return this._sourceBuffer ? o.timeRangesToFlatMap(this._sourceBuffer.buffered) : []
},
kill: function() {
if (this._ready = !1, this._mediaSource.removeEventListener("sourceopen", this._onMSEInit, !1), this._sourceBuffer) {
this._sourceBuffer.removeEventListener("updateend", this._onSourceBufferUpdateEnd, !1), this._sourceBuffer.removeEventListener("error", this._onSourceBufferError, !1);
try {
this._mediaSource.removeSourceBuffer(this._sourceBuffer)
} catch (e) {
this._log("Exception when trying to remove source buffer.")
}
}
this._whenStableUpdateListeners = [], this._html5Audio.src = "", this._html5Audio.hasAttribute("src") && this._html5Audio.removeAttribute("src"), this._objectUrl && (URL.revokeObjectURL(this._objectUrl), this._objectUrl = null), this._sourceBuffer = null, this._mediaSource = null
}
})
},
function(e, t) {
var n = {
HTTP: "http",
RTMP: "rtmp",
HLS: "hls"
};
e.exports = n
},
function(e, t, n) {
function i(e, t, n) {
r.prototype.constructor.call(this, e, t, n || "HLSMSESingleAudioPlayer"), this._playCalled = !1, this._streamUrlProvider = this._descriptor.streamUrlProvider || this._settings.streamUrlProvider || null;
var i;
i = null != this._descriptor.maxBufferLength ? this._descriptor.maxBufferLength : null != this._settings.maxBufferLength ? this._settings.maxBufferLength : this._settings.maxBufferTime, this._maxBufferLength = i, this._enableBufferingBeforePlay = !!this._settings.mseEnableBufferingBeforePlay, this._simpleHlsToolkit = new s(this._logger, this._descriptor.src, d, a.MP3, this._streamUrlProvider, !0), this._updateBufferWindow()
}
var r = n(48),
o = n(49),
s = n(50),
a = n(43),
l = n(46),
u = n(36),
c = n(1),
d = l.getMSETargetMimeType();
e.exports = i, c(i.prototype, r.prototype), i._capabilities = o._capabilities, i.canPlay = o.canPlay, i.prototype._buildPlayer = function() {
var e = c({}, this._settings, {
mseEnableBufferingBeforePlay: !0
}),
t = c({}, this._descriptor, {
maxBufferLength: this._maxBufferLength
});
return new o(t, e, this._type + "*", this._html5Audio, this._simpleHlsToolkit)
}, i.prototype.kill = function() {
this.getState() !== u.DEAD && (r.prototype.kill.call(this), this._simpleHlsToolkit.kill(), this._simpleHlsToolkit = null)
}, i.prototype.getMaxBufferLength = function() {
return this._maxBufferLength
}, i.prototype.setMaxBufferLength = function(e) {
this._maxBufferLength !== e && (this._maxBufferLength = e, this._player ? this._player.setMaxBufferLength(e) : (this._logger.log("Changing maxBufferLength to " + e + "ms"), this._updateBufferWindow()))
}, i.prototype.play = function(e) {
this._playCalled = !0, r.prototype.play.call(this, e)
}, i.prototype._updateCurrentPositionWhenWentInactive = function(e) {
r.prototype._updateCurrentPositionWhenWentInactive.call(this, e), this._player || this._updateBufferWindow()
}, i.prototype._updateBufferWindow = function() {
if (this._player) throw new Error("Player is active. SimpleHLSToolkit should be controlled there only.");
(this._playCalled || this._enableBufferingBeforePlay) && this._simpleHlsToolkit.setTimeRange(new s.TimeRange(this._currentPositionWhenWentInactive, this._maxBufferLength))
}
},
function(e, t, n, i, r) {
function o(e, t) {
return null == t ? e : s(t, a(t), e)
}
var s = n(i),
a = n(r);
e.exports = o
},
function(e, t, n, i, r, o) {
function s(e) {
return function(t) {
return null == t ? void 0 : t[e]
}
}
function a(e) {
return null != e && u(w(e))
}
function l(e, t) {
return e = "number" == typeof e || m.test(e) ? +e : -1, t = null == t ? b : t, e > -1 && e % 1 == 0 && t > e
}
function u(e) {
return "number" == typeof e && e > -1 && e % 1 == 0 && b >= e
}
function c(e) {
for (var t = h(e), n = t.length, i = n && e.length, r = !!i && u(i) && (g(e) || f(e)), o = -1, s = []; ++o < n;) {
var a = t[o];
(r && l(a, i) || _.call(e, a)) && s.push(a)
}
return s
}
function d(e) {
var t = typeof e;
return !!e && ("object" == t || "function" == t)
}
function h(e) {
if (null == e) return [];
d(e) || (e = Object(e));
var t = e.length;
t = t && u(t) && (g(e) || f(e)) && t || 0;
for (var n = e.constructor, i = -1, r = "function" == typeof n && n.prototype === e, o = Array(t), s = t > 0; ++i < t;) o[i] = i + "";
for (var a in e) s && l(a, t) || "constructor" == a && (r || !_.call(e, a)) || o.push(a);
return o
}
var p = n(i),
f = n(r),
g = n(o),
m = /^\d+$/,
v = Object.prototype,
_ = v.hasOwnProperty,
y = p(Object, "keys"),
b = 9007199254740991,
w = s("length"),
x = y ? function(e) {
var t = null == e ? void 0 : e.constructor;
return "function" == typeof t && t.prototype === e || "function" != typeof e && a(e) ? c(e) : d(e) ? y(e) : []
} : c;
e.exports = x
}
]))
}).call(t, n(1053).Buffer, n(481).setImmediate, n(481).clearImmediate)
},
486: function(e, t, n) {
function i(e, t, n) {
function i() {
be && (O() ? (me("Init in single connection mode", ge), pe && R(), re(), ie() ? (me("Attaching to already existing connection", ne()), $()) : (me("Becoming connection owner"), Q(), U())) : (me("Init in plain mode"), U()))
}
function s() {
be || (me("Reconnecting"), be = !0, i(), Z("meta", {
connected: be
}))
}
function c() {
be && (me("Disconnecting"), be = !1, D(), Z("meta", {
connected: be
}))
}
function A() {
P(), S = null
}
function C() {
D(), i()
}
function D() {
M(!1)
}
function P() {
M(!0)
}
function M(e) {
me("Disposing instance: unregistering window events & clearing timeouts"), W(), g.clearTimeout(_e), F() ? (me("Closing connection"), ve.dispose(), ve = null, O() && (me("Clearing single connection lock if it is mine"), J(), e && (me("Broadcasting dispose event"), Z(b, null)))) : re()
}
function I() {
pe && xe.on(y, function(e) {
e === f.actions.HEARTBEAT && R()
})
}
function R() {
g.clearTimeout(_e), _e = g.setTimeout(L, pe)
}
function L() {
me("Heartbeat timed out. Will cleanup lock & re-init..."), ee(), C()
}
function O() {
return !we
}
function F() {
return !!ve
}
function N() {
return F() && O()
}
function B() {
return !F() && O()
}
function $() {
h.on(_, function(e) {
xe.trigger(_, e)
}).on(y, function(e) {
xe.trigger(y, e)
}).on(b, function() {
window.setTimeout(i, 200 * Math.random())
})
}
function U() {
if (ve) throw new Error("Can't initialize client twice");
ve = new l({
eventUrl: t,
withCredentials: ae,
log: me,
json: le
}), ve.on(v, z).on(_, K).on(m, H), j(), O() && h.on(w, function(e) {
Y(e)
}).on(x, function(e) {
V(e)
})
}
function z(e) {
me("Handling SSE open (first bit of event stream received)"), X(v, ve.getEventSourceReadyState())
}
function H(e) {
me.error("Handling SSE error"), X(m, e)
}
function j() {
g.onbeforeunload && (ye = g.onbeforeunload), g.onbeforeunload = q, ce && (g.SCBananaBus = xe)
}
function W() {
g.onbeforeunload = ye, ye = null, ce && delete g.SCBananaBus
}
function q() {
ye && ye(), A()
}
function Y(t) {
if ("object" != typeof t) throw new Error("BananaBus: can only publish Object-payload");
B() ? Z(w, t) : te() ? (me("Sending payload to publish endpoint:", t), r(e, t, de)) : (me.warn("Attempting to publish when not parent. Owner is %s. Giving up SSE connection.", ne()), C())
}
function V(e) {
B() ? Z(x, e) : Y(G(e))
}
function G(e) {
return E(e) ? f.createMessage(he) : void me("Can not generate payload for unknown event type:", e)
}
function K(e) {
if (!te()) return me.warn("Received SSE event while not owner. Owner is %s. Giving up SSE connection.", ne()), void C();
var t = f.parseAction(e);
me("Handling SSE message"), X(_, e), t && X(y, t)
}
function X(e, t) {
xe.trigger(e, t), N() && Z(e, t)
}
function Z(e, t) {
me.info("broadcasting", e, t), h.broadcast(e, t)
}
function Q() {
p.set(T, ge)
}
function J() {
te() && ee()
}
function ee() {
p.remove(T)
}
function te() {
return ne() === ge
}
function ne() {
return p.get(T)
}
function ie() {
return !!ne()
}
function re() {
h.off(w + " " + x + " " + _ + " " + y + " " + b)
}
function oe() {
h.on("meta", function(e) {
e.connected === !0 ? s() : e.connected === !1 && c()
})
}
if (!e || !t) throw new Error("Need a publish & event endpoint URL");
var se = a({}, k, n),
ae = se.withCredentials,
le = se.json,
ue = se.singleConnection,
ce = se.debug,
de = se.authorization,
he = se.registrationId,
pe = se.heartbeatTimeoutMs,
fe = se.connected,
ge = Math.random().toString(16).substr(2),
me = u({
enabled: ce,
buffer: !0,
label: "trinity"
}),
ve = void 0,
_e = void 0,
ye = void 0,
be = !!fe,
we = !ue || !o(),
xe = a({}, d, {
publish: Y,
publishEvent: V,
dispose: A,
disconnect: c,
reconnect: s
});
return i(), ce && xe.on(v, me.info.bind(null, "Connection open")).on(y, me.info.bind(null, "Received action")).on(m, me.error.bind(me, "Error")), I(), oe(), xe
}
function r(e, t, n) {
return s({
url: e,
data: JSON.stringify(t),
type: "POST",
dataType: "text",
beforeSend: function(e) {
n && e.setRequestHeader("Authorization", "OAuth " + n)
}
})
}
function o() {
try {
var e = g.localStorage,
t = Date.now();
if (e.getItem) return e.setItem(t, t), e.removeItem(t), !0
} catch (n) {}
return !1
}
n(2180);
var s = n(1158),
a = n(823),
l = n(1161),
u = n(1162),
c = n(883),
d = n(25),
h = n(1159),
p = n(1129),
f = n(1160),
g = window,
m = c.ERROR,
v = c.OPEN,
_ = c.DATA,
y = c.ACTION,
b = c.DISPOSE,
w = c.PUBLISH,
x = c.PUBLISH_EVENT,
k = {
withCredentials: !1,
json: !1,
singleConnection: !0,
debug: !1,
authorization: null,
registrationId: void 0,
heartbeatTimeoutMs: null,
connected: !0
},
S = void 0,
T = "trinity-owner";
e.exports = {
SCMessages: f,
Events: c,
getInstance: function(e, t, n) {
return S || (S = i(e, t, n))
}
};
var A = function(e) {
return Object.keys(e).map(function(t) {
return e[t]
})
},
E = function(e) {
return function(t) {
return e.indexOf(t) > -1
}
}(A(f.events))
},
487: function(e, t, n) {
"use strict";
e.exports = n(339).extend(n(441), {
notificationType: "activities",
parse: function(e) {
var t = e.collection;
return t && t.forEach(function(e) {
e.comment && !e.comment.user && (e.comment.user = e.user, e.comment.user_id = e.user.user_id), e.user && (delete e.user.cpp, delete e.user.default_tracks_feedable), e.resource && (delete e.resource.cpp, delete e.resource.default_tracks_feedable)
}), t
}
}, {
hashFn: function() {
return 1
}
})
},
488: function(e, t, n) {
"use strict";
e.exports = n(72).extend(n(121), {
model: n(557),
defaults: {
genre: null,
chartKind: null
},
baseUrl: function() {
var e = this.options,
t = e.chartKind,
i = e.genre;
return this.getEndpointUrl("charts", {}, {
kind: t,
genre: n(127).genreUrn(i)
})
},
setup: function() {
this.queryUrn = null, this.lastUpdated = null
},
parse: function(e) {
var t = e.query_urn,
n = e.collection,
i = e.last_updated,
r = e.kind;
return this.queryUrn = t, this.lastUpdated = i, n.map(function(e, t) {
var n = e.track,
i = e.score;
return "top" === r ? {
weekPlays: i,
track: n
} : "trending" === r ? {
track: n
} : void 0
})
},
getSourceInfo: function() {
var e = this.queryUrn,
t = this.options,
n = t.genre,
i = t.chartKind;
return {
type: "charts",
genre: n,
chartKind: i,
queryUrn: e
}
},
audibleAt: function(e) {
var t = this.at(e);
return t && t.soundModel
}
}, {
hashFn: function(e, t) {
return t.chartKind + "_" + t.genre
}
})
},
489: function(e, t, n) {
"use strict";
e.exports = n(286).extend({
baseUrl: function() {
return n(63).stringify({
path: ["app", "v2", "tracks", this.options.sound_id, "comments"],
query: {
filter_replies: 1
}
})
},
getCommentAtTimestamp: function(e, t) {
return t = n(3).isNumber(t) ? t : 0, this.find(function(i) {
var r = i.get("timestamp"),
o = e - r;
return 0 === t ? r === e : o >= 0 && Math.abs(o) <= t && r !== n(107).EMPTY_TIMESTAMP
}) || null
},
onCommentCreated: function(e) {
e.get("replyTo") || this.add(e, {
at: 0
})
}
}, {
hashFn: function(e, t) {
return t && t.sound_id || null
}
})
},
490: function(e, t, n) {
"use strict";
e.exports = n(72).extend({
model: n(65),
next_href: !1,
lastFetchTime: Date.now()
})
},
493: function(e, t, n) {
"use strict";
function i(e) {
var t = e.target,
i = this.find(function(e) {
return e.get("track_id") === t
});
i && this.remove(i);
var r = new(n(560))({
track_id: t,
played_at: Date.now()
});
r.release(), this.add(r, {
at: 0
})
}
function r() {
this.reset([])
}
var o = e.exports = n(72).extend(n(121), {
getSourceInfo: function() {
return {
type: "history"
}
},
model: n(560),
baseUrl: function() {
return this.getEndpointUrl("playHistoryTracks")
},
setup: function() {
this.listenTo(n(74), "addToPlayHistory", i), this.listenTo(n(74), "clearPlayHistory", r)
},
audibleAt: function(e) {
var t = this.at(e);
return t && t.sound
}
}, {
hashFn: function() {
return 1
}
});
n(333).applyTo(o, {
fields: ["track.title", "track.genre", "track.user.username", "track.description"],
mixins: [n(121)]
})
},
494: function(e, t, n) {
"use strict";
var i = e.exports = n(72).extend({
model: n(65),
setup: function() {
n(64).isLoggedIn() || this.setToFullyPopulated()
},
baseUrl: function() {
return this.getEndpointUrl("shortcutsTrackLikes")
}
}, {
hashFn: function() {
return n(55).get("me").get("id")
},
prefetch: function() {
var e = new i;
e.isPopulated() || e.fetch(), e.release()
}
})
},
497: function(e, t, n) {
"use strict";
e.exports = n(132).extend(n(121), {
model: n(305),
getSourceInfo: function() {
return {
type: "user-profile",
resourceId: this.options.resource_id || this.options.userId,
resourceType: "user"
}
},
setupSources: function() {
var e = [new(n(499))(null, {
userId: this.options.resource_id || this.options.userId
})],
t = n(61).instances.get(this.options.userId),
i = t && t.getPerk("spotlight");
return (i || void 0 === i) && e.unshift(new(n(321))(null, {
userId: this.options.resource_id || this.options.userId
})), e
},
audibleAt: function(e) {
var t = this.at(e);
return t && t.getAudible()
}
}, {
hashFn: function(e, t) {
return t.resource_id || t.userId
}
})
},
498: function(e, t, n) {
"use strict";
e.exports = n(150).extend({
model: n(84),
defaults: {
type: "playlists"
},
baseUrl: function() {
return this.getEndpointUrl("userPlaylistsWithoutAlbums", {
id: this.options.userId
})
}
})
},
499: function(e, t, n) {
"use strict";
e.exports = n(150).extend(n(941), {
defaults: {
type: "sounds"
},
baseUrl: function() {
return this.getEndpointUrl("streamUserProfile", {
id: this.options.userId
})
},
setup: function(e) {
n(150).prototype.setup.call(this, e), this.isMe = n(64).currentUserId() === e.userId
},
parse: function(e) {
var t = e.collection,
i = void 0 === t ? [] : t,
r = n(64).currentUserId();
return i.length && !this.isMe && (i = i.filter(function(e) {
return e.user && (delete e.user.cpp, delete e.user.default_tracks_feedable), e.track || e.playlist && e.playlist.track_count || e.playlist && e.playlist.user_id === r
})), i
}
})
},
557: function(e, t, n) {
"use strict";
e.exports = n(66).extend({
resource_type: "chartTrack",
submodelMap: {
track: n(65)
},
createSubmodel: function(e, t) {
this.soundModel = new e(this.get(t)), this.addSubmodel(this.soundModel)
}
})
},
558: function(e, t, n) {
"use strict";
function i() {
this._messageSentAt = new Date(this.get("sent_at"))
}
function r() {
var e = this,
t = this.getPossibleAudibleLinks();
t && n(179).getAudibleModels(t).done(function(t) {
t.forEach(function(e) {
e && o.call(this, e.audible, e.link)
}, e), e.trigger("audibleFinishedResolving")
})
}
function o(e, t) {
var i = n(63).parse(e.getShareURL()).path,
r = {
link: null,
model: e
}; - 1 !== t.indexOf(i) && (r.link = t, this.addSubmodel(r.model), s.call(this, r))
}
function s(e) {
var t = this.get("audibleInformation");
t.push(e), this.set("audibleInformation", t), this.trigger("audibleInformationUpdated", {
audibleInformation: e,
timestamp: this.sentAt()
})
}
var a = n(55).get("systemUserId");
e.exports = n(66).extend({
resource_type: "conversation_message",
_messageSentAt: null,
getSenderId: function() {
var e = this.get("sender_urn");
return e ? n(100).getAsAttributes(e).id : null
},
setup: function() {
this.set("audibleInformation", []), i.call(this)
},
sentAt: function() {
return this._messageSentAt
},
fetchAudibles: function() {
r.call(this)
},
getAudible: function() {
var e = this.get("audibleInformation");
return e && e[0] && e[0].model
},
hasDataForView: function() {
return !0
},
getPossibleAudibleLinks: function() {
var e = this.get("content") ? this.get("content") : "";
return e.match(n(179).scLinksRegexGlobal)
},
isFromSoundCloud: function() {
return this.getSenderId() === a
},
isFromMissingUser: function() {
var e = this.get("sender");
return e && "missing_user" === e.kind
}
}, {
hashFn: function(e) {
return e.id || [e.conversation_id, e.sent_at].join("_")
}
})
},
560: function(e, t, n) {
"use strict";
e.exports = n(66).extend({
resource_type: "historicalPlay",
submodelMap: {
track: n(65)
},
setup: function(e) {
this.sound = new(n(65))({
id: e.track_id
}), this.addSubmodel(this.sound)
}
}, {
hashFn: function(e) {
var t = e.id,
n = e.resource_id,
i = e.track_id;
return t || n || i
}
})
},
562: function(e, t, n) {
"use strict";
e.exports = n(66).extend({
resource_type: "onboarding-recommendation",
submodelMap: {
track: n(65)
},
createSubmodel: function(e, t) {
var i, r = this.get(t);
r && (i = new(n(65))({
id: r.id
}), i.set(r), this.addSubmodel(i), this.listenTo(i, "destroy", this.destroy), this.audible = i)
},
getAudible: function() {
return this.audible
}
})
},
565: function(e, t, n) {
"use strict";
e.exports = n(233).extend({
readEndpoint: "playlistLikesIds",
createEndpoint: "playlistLikesCreate",
deleteEndpoint: "playlistLikesDelete"
})
},
566: function(e, t, n) {
"use strict";
e.exports = n(233).extend({
readEndpoint: "playlistRepostsIds",
createEndpoint: "playlistRepostsCreate",
deleteEndpoint: "playlistRepostsDelete"
})
},
567: function(e, t, n) {
"use strict";
e.exports = n(66).extend({
resource_type: "search",
baseUrl: null,
submodelMap: {
origin: null
},
createSubmodel: function() {
var e, t;
switch (this.get("kind")) {
case "user":
e = n(61);
break;
case "track":
e = n(65);
break;
case "playlist":
e = n(84)
}
t = new e(this.get("origin")), this.addSubmodel(t), this.resource = t
},
getAudible: function() {
switch (this.get("kind")) {
case "track":
case "playlist":
return this.resource;
default:
return null
}
},
isPromoted: function() {
return "promoted" === this.get("campaign")
}
}, {
hashFn: function(e) {
return e.resource_id || e.id
}
})
},
568: function(e, t, n) {
"use strict";
e.exports = n(233).extend({
readEndpoint: "soundLikesIds",
createEndpoint: "soundLikesCreate",
deleteEndpoint: "soundLikesDelete"
})
},
569: function(e, t, n) {
"use strict";
e.exports = n(233).extend({
readEndpoint: "soundRepostsIds",
createEndpoint: "soundRepostsCreate",
deleteEndpoint: "soundRepostsDelete"
})
},
570: function(e, t, n) {
"use strict";
function i(e) {
return e || ""
}
e.exports = n(66).extend({
resource_type: "stats-totals",
baseUrl: function() {
var e = this.options;
return n(63).stringify({
path: "/" + n(63).joinPath(n(3).compact([].concat("users", e.user, e.track && ["tracks", e.track], "stats", "totals", e.singleMetric)))
}, n(55).get("api_v2_host"))
},
fetch: function(e) {
var t = this.options.from,
i = this.options.to;
return t && i && (e = n(3).assign({
data: {
from: +t,
to: +i
}
}, e)), n(66).prototype.fetch.call(this, e)
},
parse: function(e) {
return e && e.period || e
}
}, {
hashFn: function(e, t) {
return t = t || {}, [t.singleMetric, +t.from, +t.to, t.track].map(i).join("_")
}
})
},
572: function(e, t, n) {
"use strict";
var i = {
facebook: "Facebook",
twitter: "Twitter",
myspace: "MySpace",
lastfm: "Last.fm",
youtube: "YouTube",
beatport: "Beatport",
discogs: "Discogs",
flickr: "Flickr",
hypem: "Hype Machine",
ning: "Ning",
posterous: "Posterous",
purevolume: "PureVolume",
residentadvisor: "Resident Advisor",
residentadvisorlabel: "Resident Advisor",
reverbnation: "ReverbNation",
soundcloud: "SoundCloud",
songkick: "Songkick",
tumblr: "Tumblr",
vimeo: "Vimeo",
virb: "Virb",
wordpress: "Wordpress",
ccmixter: "ccMixter",
itunes_podcast: "iTunes Podcast",
foursquare: "Foursquare",
flavors: "flavors.me",
thedjlist: "The DJ List",
berklee: "Berklee",
whatpeopleplay: "Whatpeopleplay",
zeroinch: "zero",
google_plus: "Google+",
bandpage: "BandPage",
bandsintown: "Bandsintown",
instagram: "Instagram"
};
e.exports = n(66).extend({
resource_type: "web-profile",
getUserId: function() {
return this.collection ? this.collection.resource_id : this.options.userId
},
getNetworkName: function() {
var e = this.get("network");
return this.get("title") ? this.get("title") : "personal" === e || "other" === e ? this.get("url").replace(/^https?:\/\//, "") : i[e] || ""
},
isEmail: function() {
return this.get("url").indexOf("@") > 0
},
getNetworkClassName: function() {
return (this.get("network") || "").replace(/[^a-z]/g, "")
}
}, {
hashFn: function(e, t) {
return e.id
}
})
},
644: function(e, t) {
function n(e) {
if (this.size = 0, this._data = [], e)
for (var t = 0; t < e.length; ++t) this.insert(t, e[t])
}
function i() {
this._data.push(0)
}
function r() {
this._data.pop()
}
function o(e) {
for (var t = 0; t < this._data.length; ++t) this._data[t] &= e._data[t]
}
function s(e) {
for (var t = 0; e; ++t) e &= e - 1;
return t
}
function a(e, t, n) {
var i = (1 << t - e + 1) - 1 << e;
return n || (i = ~i), i
}
var l = 1 << 31;
e.exports = n, n.combine = function(e) {
var t = e[0].clone();
return t.applyAnd(e.slice(1)), t
}, n.prototype = {
get: function(e) {
return 0 !== (this._data[e / 32 | 0] & 1 << e % 32)
},
set: function(e, t) {
if (!(0 > e || e >= this.size)) {
var n = e / 32 | 0,
i = e % 32;
this._data[n] ^= (!t - 1 ^ this._data[n]) & 1 << i
}
},
insert: function(e, t) {
if (!(e > this.size || 0 > e)) {
var n, r, o, s, u;
if (this.size % 32 === 0 && i.call(this), e < this.size) {
for (n = e / 32 | 0, r = e % 32, o = this._data[n], u = this._data.length - 1; u > n; --u) this._data[u] <<= 1, this._data[u - 1] & l && (this._data[u] |= 1);
s = a(0, r - 1, !1), this._data[n] = o << 1 & s | o & ~s
}++this.size, this.set(e, t)
}
},
remove: function(e) {
if (!(e >= this.size || 0 > e)) {
var t, n, i, o, s;
if (e < this.size - 1)
for (t = e / 32 | 0, n = e % 32, i = this._data[t], o = a(0, n - 1, !1), this._data[t] = i >>> 1 & o | i & ~o, s = t + 1; s < this._data.length; ++s) 1 & this._data[s] && (this._data[s - 1] |= l), this._data[s] >>>= 1;
--this.size % 32 === 0 && r.call(this)
}
},
applyAnd: function(e) {
for (var t = 0; t < e.length; ++t) o.call(this, e[t])
},
clearRange: function(e, t) {
var n, i, r, o = e / 32 | 0,
s = t / 32 | 0;
for (r = o; s >= r; ++r) n = Math.max(0, e - 32 * r), i = Math.min(31, t - 32 * r), 0 === n && 31 === i ? this._data[r] = 0 : this._data[r] &= a(n, i, 0)
},
clone: function() {
var e = new n;
return e._data = this._data.slice(), e.size = this.size, e
},
getIndexes: function(e) {
for (var t = [], n = !!e, i = 0; i < this.size; ++i) this.get(i) === n && t.push(i);
return t
},
countValuesInRange: function(e, t, n) {
t = t || 0, n = void 0 === n ? this.size - 1 : n;
var i, r, o, l, u = t / 32 | 0,
c = n / 32 | 0,
d = 0;
for (o = u; c >= o; ++o) i = Math.max(0, t - 32 * o), r = Math.min(31, n - 32 * o), l = 0 === i && 31 === r ? this._data[o] : this._data[o] & a(i, r, 1), d += s(l);
return e ? d : n - t - d + 1
}
}
},
645: function(e, t, n) {
/*!
* Bowser - a browser detector
* https://github.com/ded/bowser
* MIT License | (c) Dustin Diaz 2015
*/
! function(t, i) {
"undefined" != typeof e && e.exports ? e.exports = i() : n(3148)(t, i)
}("bowser", function() {
function e(e) {
function t(t) {
var n = e.match(t);
return n && n.length > 1 && n[1] || ""
}
function n(t) {
var n = e.match(t);
return n && n.length > 1 && n[2] || ""
}
var i, r = t(/(ipod|iphone|ipad)/i).toLowerCase(),
o = /like android/i.test(e),
a = !o && /android/i.test(e),
l = /nexus\s*[0-6]\s*/i.test(e),
u = !l && /nexus\s*[0-9]+/i.test(e),
c = /CrOS/.test(e),
d = /silk/i.test(e),
h = /sailfish/i.test(e),
p = /tizen/i.test(e),
f = /(web|hpw)os/i.test(e),
g = /windows phone/i.test(e),
m = !g && /windows/i.test(e),
v = !r && !d && /macintosh/i.test(e),
_ = !a && !h && !p && !f && /linux/i.test(e),
y = t(/edge\/(\d+(\.\d+)?)/i),
b = t(/version\/(\d+(\.\d+)?)/i),
w = /tablet/i.test(e),
x = !w && /[^-]mobi/i.test(e),
k = /xbox/i.test(e);
/opera|opr|opios/i.test(e) ? i = {
name: "Opera",
opera: s,
version: b || t(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)
} : /coast/i.test(e) ? i = {
name: "Opera Coast",
coast: s,
version: b || t(/(?:coast)[\s\/](\d+(\.\d+)?)/i)
} : /yabrowser/i.test(e) ? i = {
name: "Yandex Browser",
yandexbrowser: s,
version: b || t(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)
} : /ucbrowser/i.test(e) ? i = {
name: "UC Browser",
ucbrowser: s,
version: t(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)
} : /mxios/i.test(e) ? i = {
name: "Maxthon",
maxthon: s,
version: t(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)
} : /epiphany/i.test(e) ? i = {
name: "Epiphany",
epiphany: s,
version: t(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)
} : /puffin/i.test(e) ? i = {
name: "Puffin",
puffin: s,
version: t(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)
} : /sleipnir/i.test(e) ? i = {
name: "Sleipnir",
sleipnir: s,
version: t(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)
} : /k-meleon/i.test(e) ? i = {
name: "K-Meleon",
kMeleon: s,
version: t(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)
} : g ? (i = {
name: "Windows Phone",
windowsphone: s
}, y ? (i.msedge = s, i.version = y) : (i.msie = s, i.version = t(/iemobile\/(\d+(\.\d+)?)/i))) : /msie|trident/i.test(e) ? i = {
name: "Internet Explorer",
msie: s,
version: t(/(?:msie |rv:)(\d+(\.\d+)?)/i)
} : c ? i = {
name: "Chrome",
chromeos: s,
chromeBook: s,
chrome: s,
version: t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)
} : /chrome.+? edge/i.test(e) ? i = {
name: "Microsoft Edge",
msedge: s,
version: y
} : /vivaldi/i.test(e) ? i = {
name: "Vivaldi",
vivaldi: s,
version: t(/vivaldi\/(\d+(\.\d+)?)/i) || b
} : h ? i = {
name: "Sailfish",
sailfish: s,
version: t(/sailfish\s?browser\/(\d+(\.\d+)?)/i)
} : /seamonkey\//i.test(e) ? i = {
name: "SeaMonkey",
seamonkey: s,
version: t(/seamonkey\/(\d+(\.\d+)?)/i)
} : /firefox|iceweasel|fxios/i.test(e) ? (i = {
name: "Firefox",
firefox: s,
version: t(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)
}, /\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e) && (i.firefoxos = s)) : d ? i = {
name: "Amazon Silk",
silk: s,
version: t(/silk\/(\d+(\.\d+)?)/i)
} : /phantom/i.test(e) ? i = {
name: "PhantomJS",
phantom: s,
version: t(/phantomjs\/(\d+(\.\d+)?)/i)
} : /slimerjs/i.test(e) ? i = {
name: "SlimerJS",
slimer: s,
version: t(/slimerjs\/(\d+(\.\d+)?)/i)
} : /blackberry|\bbb\d+/i.test(e) || /rim\stablet/i.test(e) ? i = {
name: "BlackBerry",
blackberry: s,
version: b || t(/blackberry[\d]+\/(\d+(\.\d+)?)/i)
} : f ? (i = {
name: "WebOS",
webos: s,
version: b || t(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)
}, /touchpad\//i.test(e) && (i.touchpad = s)) : /bada/i.test(e) ? i = {
name: "Bada",
bada: s,
version: t(/dolfin\/(\d+(\.\d+)?)/i)
} : p ? i = {
name: "Tizen",
tizen: s,
version: t(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || b
} : /qupzilla/i.test(e) ? i = {
name: "QupZilla",
qupzilla: s,
version: t(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || b
} : /chromium/i.test(e) ? i = {
name: "Chromium",
chromium: s,
version: t(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || b
} : /chrome|crios|crmo/i.test(e) ? i = {
name: "Chrome",
chrome: s,
version: t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)
} : a ? i = {
name: "Android",
version: b
} : /safari|applewebkit/i.test(e) ? (i = {
name: "Safari",
safari: s
}, b && (i.version = b)) : r ? (i = {
name: "iphone" == r ? "iPhone" : "ipad" == r ? "iPad" : "iPod"
}, b && (i.version = b)) : i = /googlebot/i.test(e) ? {
name: "Googlebot",
googlebot: s,
version: t(/googlebot\/(\d+(\.\d+))/i) || b
} : {
name: t(/^(.*)\/(.*) /),
version: n(/^(.*)\/(.*) /)
}, !i.msedge && /(apple)?webkit/i.test(e) ? (/(apple)?webkit\/537\.36/i.test(e) ? (i.name = i.name || "Blink", i.blink = s) : (i.name = i.name || "Webkit", i.webkit = s), !i.version && b && (i.version = b)) : !i.opera && /gecko\//i.test(e) && (i.name = i.name || "Gecko", i.gecko = s, i.version = i.version || t(/gecko\/(\d+(\.\d+)?)/i)), i.msedge || !a && !i.silk ? r ? (i[r] = s, i.ios = s) : v ? i.mac = s : k ? i.xbox = s : m ? i.windows = s : _ && (i.linux = s) : i.android = s;
var S = "";
i.windowsphone ? S = t(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i) : r ? (S = t(/os (\d+([_\s]\d+)*) like mac os x/i), S = S.replace(/[_\s]/g, ".")) : a ? S = t(/android[ \/-](\d+(\.\d+)*)/i) : i.webos ? S = t(/(?:web|hpw)os\/(\d+(\.\d+)*)/i) : i.blackberry ? S = t(/rim\stablet\sos\s(\d+(\.\d+)*)/i) : i.bada ? S = t(/bada\/(\d+(\.\d+)*)/i) : i.tizen && (S = t(/tizen[\/\s](\d+(\.\d+)*)/i)), S && (i.osversion = S);
var T = S.split(".")[0];
return w || u || "ipad" == r || a && (3 == T || T >= 4 && !x) || i.silk ? i.tablet = s : (x || "iphone" == r || "ipod" == r || a || l || i.blackberry || i.webos || i.bada) && (i.mobile = s), i.msedge || i.msie && i.version >= 10 || i.yandexbrowser && i.version >= 15 || i.vivaldi && i.version >= 1 || i.chrome && i.version >= 20 || i.firefox && i.version >= 20 || i.safari && i.version >= 6 || i.opera && i.version >= 10 || i.ios && i.osversion && i.osversion.split(".")[0] >= 6 || i.blackberry && i.version >= 10.1 || i.chromium && i.version >= 20 ? i.a = s : i.msie && i.version < 10 || i.chrome && i.version < 20 || i.firefox && i.version < 20 || i.safari && i.version < 6 || i.opera && i.version < 10 || i.ios && i.osversion && i.osversion.split(".")[0] < 6 || i.chromium && i.version < 20 ? i.c = s : i.x = s, i
}
function t(e) {
return e.split(".").length
}
function n(e, t) {
var n, i = [];
if (Array.prototype.map) return Array.prototype.map.call(e, t);
for (n = 0; n < e.length; n++) i.push(t(e[n]));
return i
}
function i(e) {
for (var i = Math.max(t(e[0]), t(e[1])), r = n(e, function(e) {
var r = i - t(e);
return e += new Array(r + 1).join(".0"), n(e.split("."), function(e) {
return new Array(20 - e.length).join("0") + e
}).reverse()
}); --i >= 0;) {
if (r[0][i] > r[1][i]) return 1;
if (r[0][i] !== r[1][i]) return -1;
if (0 === i) return 0
}
}
function r(t, n, r) {
var o = a;
"string" == typeof n && (r = n, n = void 0), void 0 === n && (n = !1), r && (o = e(r));
var s = "" + o.version;
for (var l in t)
if (t.hasOwnProperty(l) && o[l]) return i([s, t[l]]) < 0;
return n
}
function o(e, t, n) {
return !r(e, t, n)
}
var s = !0,
a = e("undefined" != typeof navigator ? navigator.userAgent : "");
return a.test = function(e) {
for (var t = 0; t < e.length; ++t) {
var n = e[t];
if ("string" == typeof n && n in a) return !0
}
return !1
}, a.isUnsupportedBrowser = r, a.compareVersions = i, a.check = o, a._detect = e, a
})
},
714: function(e, t, n) {
e.exports = n.p + "assets/images/header/cloud-e365a4.png"
},
715: function(e, t, n) {
e.exports = n.p + "assets/images/header/cloud@2x-e5fba4.png"
},
716: function(e, t, n) {
e.exports = n.p + "assets/images/header/wordmark-d95b0a.png"
},
717: function(e, t, n) {
e.exports = n.p + "assets/images/header/wordmark@2x-8fdb34.png"
},
718: function(e, t, n) {
e.exports = n.p + "assets/images/list-bullet-ab4e6e.png"
},
721: function(e, t, n) {
e.exports = n.p + "assets/images/messages/deleted_user_40-8817cd.png"
},
760: function(e, t, n) {
var i = n(20);
e.exports = (i["default"] || i).template({
compiler: [7, ">= 4.0.0"],
main: function(e, t, n, i, r) {
return '<div class="l-banner l-inner-fullwidth">\n\n</div>\n<div class="l-listen-hero">\n\n</div>\n<div class="l-listen-wrapper">\n <div class="l-about-main">\n <div class="l-about-rows">\n <div class="l-about-row">\n <div class="l-about-top">\n\n </div>\n </div>\n <div class="l-about-row l-listen__mainContent">\n <div class="l-about-left">\n\n </div>\n <div class="l-about-right">\n\n </div>\n </div>\n </div>\n </div>\n <div class="l-sidebar-right">\n\n </div>\n</div>\n'
},
useData: !0
})
},
761: function(e, t, n) {
var i = n(20);
e.exports = (i["default"] || i).template({
compiler: [7, ">= 4.0.0"],
main: function(e, t, n, i, r) {
return '<div class="l-premium">\n <div class="l-premium-banner l-inner-fullwidth">\n\n </div>\n <div class="l-premium-content">\n\n </div>\n</div>\n'
},
useData: !0
})
},
823: function(e, t, n) {
function i(e, t, n) {
for (var i = -1, r = s(t), o = r.length; ++i < o;) {
var a = r[i],
l = e[a],
u = n(l, t[a], a, e, t);
(u === u ? u === l : l !== l) && (void 0 !== l || a in e) || (e[a] = u)
}
return e
}
var r = n(2771),
o = n(2774),
s = n(1130),
a = o(function(e, t, n) {
return n ? i(e, t, n) : r(e, t)
});
e.exports = a
},
824: function(e, t, n) {
var i = n(1792);
"string" == typeof i && (i = [
[e.id, i, ""]
]);
n(7)(i, {})
},
882: function(e, t, n) {
var i = n(180),
r = n(20);
e.exports = function(e) {
var t = i.usertextOneline(e, {
links: !1
});
return new r.SafeString(i.splitWords(t))
}
},
884: function(e, t) {
function n(e, t) {
return function(t) {
return e[i.pluralForm(t)].replace(/%d/i, t)
}
}
var i = e.exports = {
delimiters: {
thousands: ",",
decimal: "."
},
relativeTime: {
justNow: "Just now",
rightNow: "Right now",
future: "%s",
past: "%s",
sec: n(["1 second", "%d seconds"]),
min: n(["1 minute", "%d minutes"]),
hour: n(["1 hour", "%d hours"]),
day: n(["1 day", "%d days"]),
month: n(["1 month", "%d months"]),
year: n(["1 year", "%d years"])
},
dateFormats: {
readable: "DD MMMM YYYY",
readableTime: "DD MMMM YYYY HH:mm",
readableAbbreviated: "MMM DD, YYYY",
readableWithWeekday: "DDDD, DD MMMM YYYY",
"default": "DD/MM/YYYY"
},
dates: {
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
weekdays: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
shortWeekdays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
minWeekdays: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
},
d3: {
grouping: [3],
currency: ["$", ""],
dateTime: "%a %b %e %X %Y",
date: "%m/%d/%Y",
time: "%H:%M:%S",
periods: ["AM", "PM"]
},
datePicker: {
closeText: "Done",
prevText: "Prev",
nextText: "Next",
currentText: "Today",
weekHeader: "Wk",
dateFormat: "dd/mm/yy",
firstDay: 1,
isRTL: !1,
showMonthAfterYear: !1,
yearSuffix: ""
},
pluralForm: function(e) {
return 1 !== e ? 1 : 0
}
}
},
885: function(e, t) {
var n = {
getPurchaseTitle: function(e, t) {
var n, i = e.purchase_url,
r = this._shops;
if (t = t || "Buy", i && !e.purchase_title)
for (n in r)
if (r.hasOwnProperty(n) && r[n].test(i)) switch (n) {
case "Flattr":
return "Flattr";
case "Promohutt":
return "Subscribe on Promo Hutt";
default:
return t + " on " + n
}
return e.purchase_title || t
},
getStoreName: function(e) {
var t, n = e.purchase_url,
i = this._shops;
if (n)
for (var r in i)
if (i[r].test(n)) {
t = r;
break
}
return t
},
_shops: {
Amazon: /ama?zo?n\.(co\.(jp|uk)|com|de|to)/,
Beatport: /beatport\.(com|it)/,
iTunes: /apple\.com/,
Juno: /juno(\.co\.uk|download\.com)/,
"Digital Tunes": /digital-tunes\.net/,
'zero"': /zero-inch\.com/,
trackitdown: /trackitdown\.net/,
whatpeopleplay: /whatpeopleplay\.com/,
DJdownload: /djdownload\.com/,
Minno: /soundra\.in/,
Flattr: /flattr\.com/,
Ganxy: /ganxy\.com/,
Legitmix: /legitmix\.com|lgt\.mx/,
Promohutt: /promohutt\.com/
}
};
"undefined" != typeof e && e.exports ? e.exports = n : (window.SC = window.SC || {}, window.SC.OnlineStores = n)
},
886: function(e, t) {
"use strict";
function n(e, t, i, s) {
var a = e.firstChild,
l = void 0;
if (a)
do a.nodeType === r ? t(a) : a.nodeType === o && n(a, t, i, s), l = a; while ((a = a.nextSibling) && (!i || i(l)));
s && a && s(a)
}
var i = Node,
r = i.TEXT_NODE,
o = i.ELEMENT_NODE;
e.exports = n
},
887: function(e, t, n) {
"use strict";
var i = n(932).makeFilterGenerator(["output"]);
e.exports = n(132).extend({
model: n(267),
defaults: {
query: null,
entityKind: null
},
setupSources: function() {
var e = this.options,
t = e.query,
i = e.entityKind;
return this.remoteCollection = new(n(1199))(null, {
query: t,
limit: 10,
entityKind: i
}), [
[new(n(320)), {
maxModels: 2
}],
[new(n(494)), {
maxModels: 2
}], this.remoteCollection
]
},
updateFilter: function(e) {
var t = i(e);
this.setFilter("term", function(e) {
return "query" === e.get("kind") || t(e)
}), this.remoteCollection.updateQuery(e)
},
getQueryUrn: function() {
return this.remoteCollection.queryUrn
},
extractModel: function(e) {
switch (e.get("kind")) {
case "user":
return new(n(267))({
entity: n(3).clone(e.attributes),
output: e.get("username"),
highlights: [],
kind: "following"
});
case "track":
return new(n(267))({
entity: n(3).clone(e.attributes),
output: e.get("title"),
highlights: [],
kind: "like"
});
default:
return !1
}
}
}, {
hashFn: function() {
return 1
}
})
},
889: function(e, t, n) {
"use strict";
function i(e) {
var t = e.audibleInformation.model;
t && this.attachments.add({
urn: t.getUrn(),
timestamp: e.timestamp
})
}
function r(e) {
var t = this;
e.some(function(e) {
return e === t.options.resource_id ? (t.fetchUnread(), !0) : void 0
})
}
e.exports = n(72).extend({
model: n(558),
attachments: null,
setup: function(e) {
var t = e.resource_id;
this.attachments = new(n(1189))(null, {
conversationId: t
}), this.listenTo(this, "audibleInformationUpdated", i).listenTo(n(57), "new-unread-messages", r)
},
baseUrl: function() {
return n(294).baseUrlWithId(this.resource_id, "messages")
},
comparator: function(e, t) {
return t.sentAt() - e.sentAt()
},
fetchUnread: function() {
this.fetch({
add: !0,
remove: !1,
url: this.baseUrl() + "?limit=10&linked_partitioning=1"
})
},
getAttachments: function() {
return this.attachments
}
}, {
onCleanup: function(e) {
e.attachments.release()
}
})
},
890: function(e, t, n) {
"use strict";
e.exports = n(132).extend(n(296).withOptions({
fields: ["username"]
}), {
model: n(61),
defaults: {
limit: 2e3,
maxModels: null
},
setup: function(e) {
var t = e.query;
n(132).prototype.setup.apply(this, arguments), this.setUserInput(t)
},
setupSources: function() {
return [
[new(n(320)), {
maxModels: this.options.maxModels
}]
]
}
}, {
prefetch: function() {
n(320).prefetch()
}
})
},
891: function(e, t, n) {
"use strict";
e.exports = n(72).extend({
actionName: null,
defaults: {
resource_id: null,
resource_type: null
},
model: n(61),
setup: function(e) {
var t = e.resource_type,
i = e.resource_id,
r = n(3).result(this, "actionName"),
o = t,
s = r + ":target:" + o + ":" + i;
this.listenTo(n(74), s, this.onAction)
},
onAction: function(e) {
if (e.state) this.add({
id: e.origin
}, {
at: 0
});
else {
var t = this.get(e.origin);
t && this.remove(t)
}
}
})
},
892: function(e, t, n) {
"use strict";
function i(e) {
var t = e.state,
i = e.target,
r = this.get(i);
if (r && this.remove(r), t) {
var o = new(n(116))({
id: i
});
o.release(), this.add(o, {
at: 0
})
}
}
var r = e.exports = n(72).extend({
model: n(116),
setup: function() {
this.listenTo(n(74), "likeStation", i)
},
baseUrl: function() {
return this.getEndpointUrl("likedStations")
},
parse: function(e) {
var t = e.collection,
i = n(3).values(n(116).types);
return t.filter(function(e) {
var t = e.type;
return i.indexOf(t) > -1
})
}
}, {
hashFn: function() {
return 1
}
});
n(333).applyTo(r, {
fields: ["title"]
})
},
894: function(e, t, n) {
"use strict";
function i(e) {
return "artist_recommended"
}
function r(e) {
return e.split("").reduce(function(e, t) {
return e + t.charCodeAt(0)
}, 0) % 1e3
}
e.exports = n(72).extend({
model: n(116),
defaults: {
type: "artist"
},
baseUrl: function() {
var e = i(this.options.type);
return this.getEndpointUrl("recommendedStations", {
type: e
})
},
shuffleBy: function(e) {
var t = r(e);
this.comparator = function(i) {
return i.id === e ? 1 / 0 : n(100).toComponents(i.id).id % t
}, this.sort()
}
}, {
hashFn: function(e, t) {
return t.type || "artist"
}
})
},
895: function(e, t, n) {
"use strict";
e.exports = n(72).extend(n(121), {
model: n(562),
defaults: {
resource_ids: [],
tags: null
},
setup: function(e) {
var t = (e.tags, e.resource_ids);
this.options.resource_ids = t.slice(0, 10)
},
parse: function(e) {
return e
},
getSourceInfo: function() {
return {
type: "onboarding"
}
},
baseUrl: function() {
var e, t = this.options,
i = t.tags,
r = t.resource_ids;
return r.length ? e = {
track_urns: n(3).map(r, n(100).generate.bind(null, "sound")).join(",")
} : i && (e = {
tags: [].concat(i).join(",")
}), this.getEndpointUrl("onboardingTrackRecommendations", {}, e)
},
audibleAt: function(e) {
var t = this.at(e);
return t && t.getAudible()
}
}, {
hashFn: function(e, t) {
return t.resource_ids.join("")
}
})
},
897: function(e, t, n) {
(function(t) {
"use strict";
var i = 200,
r = 1e3,
o = 5e3;
e.exports = n(72).extend({
model: n(1359),
_isLooping: !1,
_loopInterval: null,
_approvalDeferred: null,
_isPending: !1,
setup: function() {
var e = this;
this.listenTo(this, "change:entry_time", n(3).debounce(function() {
e.sort({
silent: !0
})
}, i)).listenTo(this, "submission:success", function() {
e._isPending = !0, e.trigger("change:approval")
})
},
fetch: function(e) {
return e.timeout = o, n(72).prototype.fetch.call(this, e)
},
baseUrl: function() {
return this.getEndpointUrl("visuals", {}, {
urn: "soundcloud:sounds:" + this.resource_id
})
},
isLooping: function() {
return this._isLooping
},
getLoopInterval: function() {
return this._loopInterval
},
parse: function(e) {
var t = e && e.visuals;
return t ? (t = n(3).map(t, function(e) {
return e.id = n(100).getAsAttributes(e.urn).id, e.filename = e.visual_url.split("/").pop(), e
}), e.is_looping && e.loop_interval && (this._isLooping = !0, this._loopInterval = Math.max(r, e.loop_interval)), t) : this.toJSON()
},
isApproved: function() {
return !(!this.length || !this.at(0).get("urn"))
},
isPending: function() {
return this._isPending
},
submitForApproval: function(e) {
if (!n(98).formData) return void this.trigger("submission:error");
var i = new window.FormData,
r = {
visuals: [],
user_urn: n(55).get("me").getUrn(),
urn: e
};
return this.forEach(function(e, t) {
var o;
e && e.has("file") && (o = e.toJSON(), n(3).omit(o, "visual_url", "urn", "_resource_id", "_resource_type"), o.entry_time = Math.floor(o.entry_time), r.visuals.push(o), i.append("visuals[upload-" + t + "]", e.get("file"), e.get("filename")))
}), i.append("visuals_data", JSON.stringify(r)), t.ajax({
url: n(55).get("visualsQueueHost"),
type: "POST",
data: i,
processData: !1,
contentType: !1,
dataType: "json",
beforeSend: function(e) {
e.setRequestHeader("Authorization", "OAuth " + n(64).getAuthToken())
}
}).done(this.trigger.bind(this, "submission:success")).fail(this.trigger.bind(this, "submission:error"))
},
fetchApprovalStatus: function() {
var e = this,
i = "soundcloud:sounds:" + this.options.resource_id,
r = n(55).get("me").getUrn(),
o = this._approvalDeferred,
s = function(t) {
t && t.urn && (e._isPending = !0), o.resolve()
};
return o && "rejected" !== o.state() ? o : (o = this._approvalDeferred = n(56).defer(), t.ajax(n(55).get("visualsQueueHost") + "/" + i, {
data: {
user_urn: r
},
beforeSend: function(e) {
e.setRequestHeader("Authorization", "OAuth " + n(64).getAuthToken())
}
}).done(s).fail(o.reject), o)
},
comparator: function(e) {
return e.get("entry_time")
}
})
}).call(t, n(1))
},
898: function(e, t, n) {
"use strict";
var i = (e.exports = n(132).extend({
model: n(358),
setupSources: function() {
var e = this.options,
t = e.category,
r = [new(n(1202))(null, e)];
return t && "who_to_follow" !== t || r.unshift(new i(null, e)), r
}
}), n(72).extend(n(1296), {
model: n(358),
adZone: "suggestedUsers",
_deferred: null,
meIds: null,
setup: function() {
this.meIds = new(n(455))
},
fetch: function(e) {
var t = this;
if (this._deferred) return this._deferred;
var i = this._deferred = n(56).defer();
return this.meIds.fetch().done(function() {
n(72).prototype.fetch.call(t, e).done(i.resolve).fail(i.reject)
}).fail(i.reject), i.always(function() {
t._deferred = null
}), i
},
parse: function(e) {
var t = this.meIds;
return e.filter(function(e) {
return !t.get(e.origin.id)
})
}
}, {
onCleanup: function(e) {
e.meIds.release(), e.meIds = null
},
hashFn: function(e, t) {
return t && t.category || 1
}
}))
},
899: function(e, t, n) {
"use strict";
e.exports = n(286).extend({
defaults: {
limit: n(55).get("maxComments")
},
initialize: function() {
n(286).prototype.initialize.apply(this, arguments), this.threads = [], this.listenTo(this, "remove", this._removeComment)
},
threads: null,
_addComment: function(e) {
var t, i, r, o, s = e.get("timestamp");
r = this.getTimestampIndex(s), i = this.threads[r], e.created_timestamp = Date.parse(e.get("created_at")), i && i[0] === s ? (o = n(3).sortedIndex(i[1], e, function(e) {
return e.created_timestamp
}), i[1].splice(o, 0, e)) : (t = [s, [e]], this.threads.splice(r, 0, t))
},
_removeComment: function(e) {
var t, n = this.getThreadAtTimestamp(e.get("timestamp"));
n && (t = n[1].indexOf(e), t > -1 && n[1].splice(t, 1))
},
_prepareModel: function() {
var e = n(286).prototype._prepareModel.apply(this, arguments);
return e.created_timestamp = Date.parse(e.created_at), e.get("timestamp") > this.soundDuration && e.set({
timestamp: n(107).EMPTY_TIMESTAMP
}, {
silent: !0
}), this._addComment(e), e
},
comparator: function(e, t) {
var i = e.attributes.timestamp === n(107).EMPTY_TIMESTAMP ? 1 / 0 : e.attributes.timestamp,
r = t.attributes.timestamp === n(107).EMPTY_TIMESTAMP ? 1 / 0 : t.attributes.timestamp;
return i - r || e.created_timestamp - t.created_timestamp
},
getThreadComments: function(e) {
var t, i, r = arguments[1],
o = n(3).isNumber(r) ? r : 0,
s = n(3).isBoolean(r) ? r : !1;
return t = 0 === o ? this.getThreadAtTimestamp(e) : n(3).find(this.threads, function(t) {
return Math.abs(e - t[0]) <= o && t[0] !== n(107).EMPTY_TIMESTAMP
}), i = t ? t[1] : [], i.filter(s ? function(e) {
return e.id
} : n(3).identity)
},
getTimestamps: function() {
return n(3).pluck(this.threads, 0)
},
getTimestampIndex: function(e) {
return n(3).sortedIndex(this.threads, [e], function(e) {
return e[0] === n(107).EMPTY_TIMESTAMP ? 1 / 0 : e[0]
})
},
getThreadAtTimestamp: function(e) {
var t = this.getTimestampIndex(e),
n = this.threads[t];
return n && n[0] === e ? n : null
}
})
},
901: function(e, t, n) {
"use strict";
e.exports = n(132).extend(n(121), n(296).withOptions({
fields: ["playlist.title", "playlist.user.username"]
}), {
model: n(357),
filters: {
likedAlbumsOnly: function(e) {
return e.isAlbum() && e.isLiked()
}
},
setupSources: function() {
return [new(n(902))(null, this.options)]
},
getSourceInfo: function() {
return {
type: "user-liked-albums",
resourceId: this.options.userId,
resourceType: "user"
}
}
})
},
902: function(e, t, n) {
"use strict";
function i(e) {
var t = e.object;
this.add(n(357).getModelData(this.options.userId, "playlist", t.id), {
at: 0
})
}
function r(e) {
var t = (e.targetType, e.state),
i = e.origin,
r = e.target,
s = void 0;
t ? this.add(n(357).getModelData(i, "playlist-like", r), {
at: 0
}) : (s = o.call(this, r)) && this.remove(s)
}
function o(e) {
return this.find(function(t) {
return e === t.get("playlist").id
})
}
var s = [{
emitter: n(74),
event: "like",
getInstance: function(e, t) {
var n = t.origin,
i = t.targetType;
return e.options.userId === n && "playlist" === i
},
handler: r
}, {
emitter: n(74),
event: "createPlaylist",
getInstance: function(e, t) {
var n = t.object;
return e.options.userId === n.get("user_id")
},
handler: i
}];
e.exports = n(150).extend(n(199).withOptions({
events: s
}), {
model: n(357),
defaults: {
type: "playlists/liked_and_owned"
},
baseUrl: function() {
return this.getEndpointUrl("collectionPlaylists", {
id: this.options.userId
})
},
audibleAt: function(e) {
var t = this.at(e);
return t && t.getAudible()
}
})
},
903: function(e, t, n) {
"use strict";
function i(e) {
return e.isOwned()
}
function r(e) {
return e.isLiked()
}
e.exports = n(132).extend(n(121), n(296).withOptions({
fields: ["playlist.title", "playlist.user.username"]
}), {
model: n(357),
_filterType: "all",
filters: {
playlistsOnly: function(e) {
return !e.isAlbum()
}
},
setupSources: function() {
return [new(n(902))(null, this.options)]
},
setTypeFilter: function(e) {
if (e !== this._filterType) switch (this._filterType = e, e) {
case "all":
this.setFilter("likedOrCreated", null);
break;
case "liked":
this.setFilter("likedOrCreated", r);
break;
case "owned":
this.setFilter("likedOrCreated", i)
}
},
compareModels: function(e, t) {
return e.get("playlist").id === t.get("playlist").id
},
getSourceInfo: function() {
return {
type: "user-playlists",
resourceId: this.options.userId,
resourceType: "user"
}
}
})
},
904: function(e, t, n) {
"use strict";
e.exports = n(72).extend({
model: n(65),
defaults: {
limit: 250
},
baseUrl: function() {
return this.getEndpointUrl("userTracks", {
id: this.options.userId
})
}
})
},
905: function(e, t, n) {
"use strict";
e.exports = n(72).extend({
model: n(325),
url: null,
defaults: {
userId: null
},
setup: function(e) {
this.webProfiles = new(n(427))(null, e)
},
fetch: function() {
var e = this;
return this.webProfiles.fetch().done(function(t) {
e.lastFetchTime = Date.now(), e.reset(t)
})
},
saveEdits: function() {
var e = this,
t = this.models.map(function(e) {
return e.validate()
});
return n(56).all(t).then(function() {
for (var t = arguments.length, i = Array(t), r = 0; t > r; r++) i[r] = arguments[r];
return n(3).all(i) ? n(22).sync("create", e, {
url: e.webProfiles.url()
}) : n(56).reject()
})
}
}, {
hashFn: function(e, t) {
return t.userId
}
})
},
906: function(e, t, n) {
"use strict";
e.exports = {
onboardingLike: {
viewType: "callout",
viewOptions: {
title: n(52).t("Keep track of this track"),
body: n(52).t("Click the heart to save it to your list of likes.")
},
shouldDisplay: function() {
return n(64).isLoggedIn() && !n(55).get("me").hasLikes() && "onboarding" === n(55).get("router").getLayoutInfo().layoutName
}
},
pulseUpsell: {
viewType: "modal",
viewOptions: {
Subview: n(1519),
filter: "darken",
width: 500
},
shouldDisplay: function() {
return n(64).isLoggedIn() && n(55).get("rollouts").get("v2_pulse_upsell")
}
}
}
},
907: function(e, t, n) {
"use strict";
e.exports = [n(52).t("January"), n(52).t("February"), n(52).t("March"), n(52).t("April"), n(52).t("May"), n(52).t("June"), n(52).t("July"), n(52).t("August"), n(52).t("September"), n(52).t("October"), n(52).t("November"), n(52).t("December")]
},
909: function(e, t) {
"use strict";
function n(e, t) {
return 1 === t ? "rgb(" + e + ")" : "rgba(" + e + "," + t + ")"
}
var i = "0,0,0",
r = "102,102,102",
o = "153,153,153",
s = "229,229,229",
a = "255,0,0",
l = "255,191,153",
u = "255,51,0",
c = "255,85,0",
d = "255,119,0",
h = "255,101,0",
p = "255,255,255";
e.exports = {
_config: {
barWidth: 2,
gapWidth: 1,
fadeInSteps: 10,
fixedTimeIndicator: !0,
commentLines: !1,
fullHighlight: !0
},
"default": {
progressGradient: [
[0, d],
[.7, u],
[.701, c],
[1, c]
],
loaderGradient: [
[0, i, .5],
[1, i, .5]
],
backgroundGradient: [
[0, r],
[.7, r],
[.701, r, .5],
[1, r, .5]
],
gapGradient: [
[0, o, .5],
[.7, o, .5],
[.701, p, 0],
[1, p, 0]
],
scrubberGradientBackward: [
[0, r, .5],
[.7, r, .5],
[.701, r, 0],
[1, r, 0]
],
scrubberGradientForward: [
[0, c, .5],
[.7, c, .5],
[.701, c, 0],
[1, c, 0]
],
highlightGradientPlayed: [
[0, c],
[.7, c],
[.701, c],
[1, c]
],
highlightGradientUnplayed: [
[0, i, .5],
[1, i, .5]
],
progressIndicatorBg: n(i, 1),
progressIndicatorColor: n(h, 1),
durationIndicatorBg: n(i, 1),
durationIndicatorColor: n(o, 1),
dividerColorPrevious: n(a, 1),
dividerColorUpcoming: n(o, 1)
},
inverted: {
progressGradient: [
[0, d],
[.7, u],
[.701, l],
[1, l]
],
loaderGradient: [
[0, p],
[1, p]
],
backgroundGradient: [
[0, p],
[.7, p],
[.701, s],
[1, s]
],
gapGradient: [
[0, p, 0],
[.28, p, .3],
[.7, p, .5],
[.701, p, .125],
[1, p, .125]
],
scrubberGradientBackward: [
[0, p, .5],
[.7, p, .5],
[.701, p, 0],
[1, p, 0]
],
scrubberGradientForward: [
[0, c, .5],
[.7, c, .5],
[.701, c, 0],
[1, c, 0]
],
highlightGradientPlayed: [
[0, c],
[.7, c],
[.701, c],
[1, c]
],
highlightGradientUnplayed: [
[0, p],
[1, p]
],
progressIndicatorBg: n(i, 1),
progressIndicatorColor: n(h, 1),
durationIndicatorBg: n(i, 1),
durationIndicatorColor: n(o, 1),
dividerColorPrevious: n(a, 1),
dividerColorUpcoming: n(o, 1)
}
}
},
919: function(e, t, n) {
(function(t) {
"use strict";
var i = (new Date).getFullYear();
e.exports = n(80).extend({
fields: {
year: {
defaultValue: null,
datasource: n(3).range(i - 13, i - 100, -1).map(function(e) {
return {
value: e,
label: e
}
})
},
month: {
defaultValue: null,
datasource: n(907).map(function(e, t) {
return {
value: t + 1,
label: e
}
})
}
},
buttons: {
save: {
label: n(52).t("Verify age"),
action: "save"
}
},
actions: {
"default": "save",
save: function() {
var e = this,
t = n(56).defer();
return this.validate().done(function(n) {
n ? e.saveOwnAge().done(t.resolve).fail(t.reject) : t.reject()
}).fail(t.reject), t
}
},
constraints: {
year: [
[n(69), {
message: n(52).t("Select a year.")
}]
],
month: [
[n(69), {
message: n(52).t("Select a month.")
}]
]
},
saveOwnAge: function() {
var e = "/users/" + n(55).get("me").getUrn(),
i = n(63).stringify({
path: e
}, n(55).get("api_v2_host"));
return t.ajax({
type: "PUT",
url: i,
contentType: "application/json",
dataType: "json",
data: JSON.stringify({
date_of_birth: this.pick("year", "month")
})
})
}
}, {
hashFn: function() {
return 1
}
})
}).call(t, n(1))
},
976: function(e, t, n) {
"use strict";
e.exports = n(66).extend({
resource_type: "announcement",
defaults: {
dismissable: !0
},
baseUrl: function() {
return this.getEndpointUrl("announcement", {
id: this.id
})
},
fetch: function() {},
dismiss: function() {
this.destroy()
},
isNew: function() {
return !n(64).isLoggedIn() || !this.get("dismissable")
}
})
},
977: function(e, t, n) {
"use strict";
e.exports = n(66).extend({
resource_type: "app",
baseUrl: function() {
return this.getEndpointUrl("app", {
id: this.id
})
}
})
},
982: function(e, t, n) {
"use strict";
e.exports = n(66).extend({
baseUrl: function() {
return this.getEndpointUrl("territoriesWhichRequireExplicitRightsholder", {}, {
isrc: this.id
})
},
parse: function(e) {
return {
territories: e
}
}
}, {
hashFn: function(e) {
var t = e.id,
n = void 0 === t ? "" : t,
i = e.resource_id;
return i || "isrc:" + n
}
})
},
983: function(e, t, n) {
"use strict";
e.exports = n(233).extend({
maxResults: 1e3,
readOnly: !0,
readEndpoint: "myFollowersIds"
})
},
984: function(e, t, n) {
"use strict";
e.exports = n(233).extend({
readEndpoint: "likedStationIds",
createEndpoint: "likeStation",
deleteEndpoint: "unlikeStation"
})
},
1049: function(e, t) {
"use strict";
e.exports = {
"sc-artwork-placeholder-0": ["#846170", "#70929c"],
"sc-artwork-placeholder-1": ["#846170", "#e6846e"],
"sc-artwork-placeholder-2": ["#846170", "#8e8485"],
"sc-artwork-placeholder-3": ["#70929c", "#846170"],
"sc-artwork-placeholder-4": ["#70929c", "#e6846e"],
"sc-artwork-placeholder-5": ["#70929c", "#8e8485"],
"sc-artwork-placeholder-6": ["#e6846e", "#846170"],
"sc-artwork-placeholder-7": ["#e6846e", "#70929c"],
"sc-artwork-placeholder-8": ["#e6846e", "#8e8485"],
"sc-artwork-placeholder-9": ["#8e8485", "#846170"],
"sc-artwork-placeholder-10": ["#8e8485", "#70929c"],
"sc-artwork-placeholder-11": ["#8e8485", "#e6846e"]
}
},
1050: function(e, t, n) {
"use strict";
function i(e) {
function t(e) {
var t = e.prefix;
return [r(e)].filter(Boolean).concat(e.subroutes).map(function(e) {
var i = e.route,
r = "" === i ? "" : o(e.route).test("") ? "(?:/(?:" + i + "))?" : "/(?:" + i + ")";
return n(3).defaults({
route: t + r
}, e)
})
}
function i(e) {
var t = o(e.route),
n = s(e),
i = null != e.name ? e.name : e.route;
return {
name: i,
route: t,
handler: n,
code: e.code
}
}
var o = n(1177).create({
includeQueryParams: !0,
caseInsensitive: !1,
definitions: {
user: ":alphanum{1,255}",
sound: ":alphanum{1,255}",
playlist: ":alphanum{1,255}",
id: ":num+",
stationType: "track|artist",
stationIdentifier: ":alphanum{1,255}(?:/:alphanum{1,255})?",
secretToken: "s-[a-zA-Z0-9]{5}",
group: ":alphanum{1,255}",
exploreCategory: "[^/]+",
tag: ".+",
conversationId: ":num+:(?::num+|system)",
code: "\\w+",
planName: "pro(?:-unlimited)?",
metric: "\\w+",
date: "[^/]+",
monthYear: "(?:0[1-9]|1[012])-20[0-9]{2}"
}
});
return e.reduce(function(e, n) {
return n.subroutes ? e.concat(t(n)) : e.concat(n)
}, []).map(i)
}
function r(e) {
var t = e.fallThrough;
return t === !0 ? null : {
route: ".*",
handler: t ? s(t) : o
}
}
function o() {
return this.apply("error", {
type: "404"
})
}
function s(e) {
var t = e.redirect,
n = t ? function() {
var e = "string" == typeof t ? t : t.apply(this, arguments);
return this.navigate(l(e, this.getQueryString()), {
replace: !0,
trigger: !0
})
} : e.handler;
return e.requiresLogin ? a(n) : n
}
function a(e) {
return function() {
return this.isLoggedIn() ? e.apply(this, arguments) : this.unauthenticated()
}
}
function l(e, t) {
return t ? e.indexOf("?") > -1 ? e + t.replace(/^\?/, "&") : e + t : e
}
e.exports = i([{
route: "(.*)",
handler: function(e) {
var t = e.replace(/[,.)]+$/, "");
return e !== t ? this.navigate("/" + t, {
trigger: !0,
replace: !0
}) : this.apply("error", {
type: "404"
})
}
}, {
prefix: ":user/:sound",
subroutes: n(1776),
fallThrough: !0
}, {
prefix: ":user/sets/:playlist",
subroutes: n(1772)
}, {
prefix: ":user",
subroutes: n(1781),
fallThrough: !0
}, {
prefix: ":user/stats",
subroutes: n(1780)
}, {
prefix: ":user/(?!sets/):sound/stats",
subroutes: n(1779)
}, {
prefix: "you",
subroutes: n(1782)
}, {
prefix: "you/apps",
subroutes: n(1767)
}, {
prefix: "stations",
subroutes: n(1777)
}, {
route: "(?:you/)?groups(?:/.*)?",
code: 410,
redirect: "/"
}, {
route: "",
handler: function() {
return this.isLoggedIn() ? this.navigate("/stream", {
replace: !0,
trigger: !0
}) : this.apply("front")
}
}, {
prefix: "charts",
subroutes: n(1764)
}, {
route: "(?:(?:explore|tracks)(?:/:exploreCategory)?|tags|hot|latest)",
redirect: function(e) {
return e ? "/charts/top?genre=" + e : "/charts/top"
}
}, {
prefix: "discover",
subroutes: n(1768)
}, {
route: "campaigns/:alphanum+",
code: 410,
redirect: "/"
}, {
prefix: "people",
subroutes: n(1771)
}, {
route: "popular/searches(?:/(:num+))?",
handler: function(e) {
return this.apply("popular-searches", {
subpage: Number(e || "1")
})
}
}, {
route: "(go-terms-of-use|community-guidelines|imprint|law-enforcement-guidelines)",
handler: function(e) {
return this.apply("static-page", {
pageName: e
})
}
}, {
route: "(terms-of-use(?:-pro)?(?:/:monthYear)?)",
handler: function(e) {
return this.apply("static-page", {
pageName: e
})
}
}, {
prefix: "pages",
subroutes: n(1770)
}, {
prefix: "press",
subroutes: n(1773)
}, {
prefix: "tags",
subroutes: n(1778),
fallThrough: {
redirect: "/charts"
}
}, {
route: "search(?:/(sounds|sets|people|groups|go|albums))?",
handler: function(e) {
return this.apply("search", {
category: e
})
}
}, {
route: "notifications",
requiresLogin: !0,
handler: function() {
return this.apply("activity")
}
}, {
route: "stream/activity",
redirect: "/notifications"
}, {
route: "stream",
requiresLogin: !0,
handler: function() {
return this.apply("stream")
}
}, {
route: "logout",
code: 401,
handler: function() {
return this.apply("logout")
}
}, {
prefix: "mobile",
subroutes: n(1769)
}, {
route: "upload",
handler: function() {
return this.apply("upload")
}
}, {
route: "upload-beta",
handler: function() {
return this.apply("upload")
}
}, {
route: "next-upload",
redirect: "/upload"
}, {
route: "messages(?:/:conversationId)?",
requiresLogin: !0,
handler: function(e) {
return this.apply("inbox", {
conversationId: e
})
}
}, {
prefix: "pro",
subroutes: n(1766)
}, {
route: "premium(/.*)?",
redirect: function(e) {
return "/pro" + (e || "")
}
}, {
prefix: "go",
subroutes: n(1765)
}, {
route: "(soundcloudgo|GO)",
redirect: "/go"
}, {
prefix: "settings",
subroutes: n(1774),
fallThrough: {
redirect: "/settings"
}
}, {
route: "dashboard(?:/.*)?",
redirect: "/stream"
}, {
route: "welcome",
requiresLogin: !0,
handler: function() {
return this.apply("onboarding")
}
}, {
route: "creativecommons",
redirect: "/search/sounds/?filter.license=to_share"
}, {
route: "(tracks|people|groups)/search",
redirect: function(e) {
return "tracks" === e && (e = "sounds"), "/search/" + e;
}
}, {
prefix: "signin",
subroutes: n(1775)
}, {
route: "login(?:/(.*))?",
redirect: function(e) {
return this.isLoggedIn() ? "/stream" : ["/signin", e].filter(Boolean).join("/")
}
}, {
route: "signup",
redirect: "/signin"
}, {
route: "(" + ["apps", "settings/(advanced|connections|privacy)(?:/(.*))?", "share", "upload-classic"].join("|") + ")(/.*)?",
handler: function() {
return this.notImplemented()
}
}])
},
1053: function(e, t, n) {
(function(e, i) {
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
"use strict";
function r() {
try {
var e = new Uint8Array(1);
return e.__proto__ = {
__proto__: Uint8Array.prototype,
foo: function() {
return 42
}
}, 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
} catch (t) {
return !1
}
}
function o() {
return e.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
}
function s(t, n) {
if (o() < n) throw new RangeError("Invalid typed array length");
return e.TYPED_ARRAY_SUPPORT ? (t = new Uint8Array(n), t.__proto__ = e.prototype) : (null === t && (t = new e(n)), t.length = n), t
}
function e(t, n, i) {
if (!(e.TYPED_ARRAY_SUPPORT || this instanceof e)) return new e(t, n, i);
if ("number" == typeof t) {
if ("string" == typeof n) throw new Error("If encoding is specified then the first argument must be a string");
return c(this, t)
}
return a(this, t, n, i)
}
function a(e, t, n, i) {
if ("number" == typeof t) throw new TypeError('"value" argument must not be a number');
return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, n, i) : "string" == typeof t ? d(e, t, n) : f(e, t)
}
function l(e) {
if ("number" != typeof e) throw new TypeError('"size" argument must be a number');
if (0 > e) throw new RangeError('"size" argument must not be negative')
}
function u(e, t, n, i) {
return l(t), 0 >= t ? s(e, t) : void 0 !== n ? "string" == typeof i ? s(e, t).fill(n, i) : s(e, t).fill(n) : s(e, t)
}
function c(t, n) {
if (l(n), t = s(t, 0 > n ? 0 : 0 | g(n)), !e.TYPED_ARRAY_SUPPORT)
for (var i = 0; n > i; ++i) t[i] = 0;
return t
}
function d(t, n, i) {
if (("string" != typeof i || "" === i) && (i = "utf8"), !e.isEncoding(i)) throw new TypeError('"encoding" must be a valid string encoding');
var r = 0 | v(n, i);
t = s(t, r);
var o = t.write(n, i);
return o !== r && (t = t.slice(0, o)), t
}
function h(e, t) {
var n = t.length < 0 ? 0 : 0 | g(t.length);
e = s(e, n);
for (var i = 0; n > i; i += 1) e[i] = 255 & t[i];
return e
}
function p(t, n, i, r) {
if (n.byteLength, 0 > i || n.byteLength < i) throw new RangeError("'offset' is out of bounds");
if (n.byteLength < i + (r || 0)) throw new RangeError("'length' is out of bounds");
return n = void 0 === i && void 0 === r ? new Uint8Array(n) : void 0 === r ? new Uint8Array(n, i) : new Uint8Array(n, i, r), e.TYPED_ARRAY_SUPPORT ? (t = n, t.__proto__ = e.prototype) : t = h(t, n), t
}
function f(t, n) {
if (e.isBuffer(n)) {
var i = 0 | g(n.length);
return t = s(t, i), 0 === t.length ? t : (n.copy(t, 0, 0, i), t)
}
if (n) {
if ("undefined" != typeof ArrayBuffer && n.buffer instanceof ArrayBuffer || "length" in n) return "number" != typeof n.length || X(n.length) ? s(t, 0) : h(t, n);
if ("Buffer" === n.type && J(n.data)) return h(t, n.data)
}
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
}
function g(e) {
if (e >= o()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + o().toString(16) + " bytes");
return 0 | e
}
function m(t) {
return +t != t && (t = 0), e.alloc(+t)
}
function v(t, n) {
if (e.isBuffer(t)) return t.length;
if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(t) || t instanceof ArrayBuffer)) return t.byteLength;
"string" != typeof t && (t = "" + t);
var i = t.length;
if (0 === i) return 0;
for (var r = !1;;) switch (n) {
case "ascii":
case "latin1":
case "binary":
return i;
case "utf8":
case "utf-8":
case void 0:
return q(t).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return 2 * i;
case "hex":
return i >>> 1;
case "base64":
return G(t).length;
default:
if (r) return q(t).length;
n = ("" + n).toLowerCase(), r = !0
}
}
function _(e, t, n) {
var i = !1;
if ((void 0 === t || 0 > t) && (t = 0), t > this.length) return "";
if ((void 0 === n || n > this.length) && (n = this.length), 0 >= n) return "";
if (n >>>= 0, t >>>= 0, t >= n) return "";
for (e || (e = "utf8");;) switch (e) {
case "hex":
return R(this, t, n);
case "utf8":
case "utf-8":
return D(this, t, n);
case "ascii":
return M(this, t, n);
case "latin1":
case "binary":
return I(this, t, n);
case "base64":
return C(this, t, n);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return L(this, t, n);
default:
if (i) throw new TypeError("Unknown encoding: " + e);
e = (e + "").toLowerCase(), i = !0
}
}
function y(e, t, n) {
var i = e[t];
e[t] = e[n], e[n] = i
}
function b(t, n, i, r, o) {
if (0 === t.length) return -1;
if ("string" == typeof i ? (r = i, i = 0) : i > 2147483647 ? i = 2147483647 : -2147483648 > i && (i = -2147483648), i = +i, isNaN(i) && (i = o ? 0 : t.length - 1), 0 > i && (i = t.length + i), i >= t.length) {
if (o) return -1;
i = t.length - 1
} else if (0 > i) {
if (!o) return -1;
i = 0
}
if ("string" == typeof n && (n = e.from(n, r)), e.isBuffer(n)) return 0 === n.length ? -1 : w(t, n, i, r, o);
if ("number" == typeof n) return n = 255 & n, e.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? o ? Uint8Array.prototype.indexOf.call(t, n, i) : Uint8Array.prototype.lastIndexOf.call(t, n, i) : w(t, [n], i, r, o);
throw new TypeError("val must be string, number or Buffer")
}
function w(e, t, n, i, r) {
function o(e, t) {
return 1 === s ? e[t] : e.readUInt16BE(t * s)
}
var s = 1,
a = e.length,
l = t.length;
if (void 0 !== i && (i = String(i).toLowerCase(), "ucs2" === i || "ucs-2" === i || "utf16le" === i || "utf-16le" === i)) {
if (e.length < 2 || t.length < 2) return -1;
s = 2, a /= 2, l /= 2, n /= 2
}
var u;
if (r) {
var c = -1;
for (u = n; a > u; u++)
if (o(e, u) === o(t, -1 === c ? 0 : u - c)) {
if (-1 === c && (c = u), u - c + 1 === l) return c * s
} else -1 !== c && (u -= u - c), c = -1
} else
for (n + l > a && (n = a - l), u = n; u >= 0; u--) {
for (var d = !0, h = 0; l > h; h++)
if (o(e, u + h) !== o(t, h)) {
d = !1;
break
}
if (d) return u
}
return -1
}
function x(e, t, n, i) {
n = Number(n) || 0;
var r = e.length - n;
i ? (i = Number(i), i > r && (i = r)) : i = r;
var o = t.length;
if (o % 2 !== 0) throw new TypeError("Invalid hex string");
i > o / 2 && (i = o / 2);
for (var s = 0; i > s; ++s) {
var a = parseInt(t.substr(2 * s, 2), 16);
if (isNaN(a)) return s;
e[n + s] = a
}
return s
}
function k(e, t, n, i) {
return K(q(t, e.length - n), e, n, i)
}
function S(e, t, n, i) {
return K(Y(t), e, n, i)
}
function T(e, t, n, i) {
return S(e, t, n, i)
}
function A(e, t, n, i) {
return K(G(t), e, n, i)
}
function E(e, t, n, i) {
return K(V(t, e.length - n), e, n, i)
}
function C(e, t, n) {
return 0 === t && n === e.length ? Z.fromByteArray(e) : Z.fromByteArray(e.slice(t, n))
}
function D(e, t, n) {
n = Math.min(e.length, n);
for (var i = [], r = t; n > r;) {
var o = e[r],
s = null,
a = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
if (n >= r + a) {
var l, u, c, d;
switch (a) {
case 1:
128 > o && (s = o);
break;
case 2:
l = e[r + 1], 128 === (192 & l) && (d = (31 & o) << 6 | 63 & l, d > 127 && (s = d));
break;
case 3:
l = e[r + 1], u = e[r + 2], 128 === (192 & l) && 128 === (192 & u) && (d = (15 & o) << 12 | (63 & l) << 6 | 63 & u, d > 2047 && (55296 > d || d > 57343) && (s = d));
break;
case 4:
l = e[r + 1], u = e[r + 2], c = e[r + 3], 128 === (192 & l) && 128 === (192 & u) && 128 === (192 & c) && (d = (15 & o) << 18 | (63 & l) << 12 | (63 & u) << 6 | 63 & c, d > 65535 && 1114112 > d && (s = d))
}
}
null === s ? (s = 65533, a = 1) : s > 65535 && (s -= 65536, i.push(s >>> 10 & 1023 | 55296), s = 56320 | 1023 & s), i.push(s), r += a
}
return P(i)
}
function P(e) {
var t = e.length;
if (ee >= t) return String.fromCharCode.apply(String, e);
for (var n = "", i = 0; t > i;) n += String.fromCharCode.apply(String, e.slice(i, i += ee));
return n
}
function M(e, t, n) {
var i = "";
n = Math.min(e.length, n);
for (var r = t; n > r; ++r) i += String.fromCharCode(127 & e[r]);
return i
}
function I(e, t, n) {
var i = "";
n = Math.min(e.length, n);
for (var r = t; n > r; ++r) i += String.fromCharCode(e[r]);
return i
}
function R(e, t, n) {
var i = e.length;
(!t || 0 > t) && (t = 0), (!n || 0 > n || n > i) && (n = i);
for (var r = "", o = t; n > o; ++o) r += W(e[o]);
return r
}
function L(e, t, n) {
for (var i = e.slice(t, n), r = "", o = 0; o < i.length; o += 2) r += String.fromCharCode(i[o] + 256 * i[o + 1]);
return r
}
function O(e, t, n) {
if (e % 1 !== 0 || 0 > e) throw new RangeError("offset is not uint");
if (e + t > n) throw new RangeError("Trying to access beyond buffer length")
}
function F(t, n, i, r, o, s) {
if (!e.isBuffer(t)) throw new TypeError('"buffer" argument must be a Buffer instance');
if (n > o || s > n) throw new RangeError('"value" argument is out of bounds');
if (i + r > t.length) throw new RangeError("Index out of range")
}
function N(e, t, n, i) {
0 > t && (t = 65535 + t + 1);
for (var r = 0, o = Math.min(e.length - n, 2); o > r; ++r) e[n + r] = (t & 255 << 8 * (i ? r : 1 - r)) >>> 8 * (i ? r : 1 - r)
}
function B(e, t, n, i) {
0 > t && (t = 4294967295 + t + 1);
for (var r = 0, o = Math.min(e.length - n, 4); o > r; ++r) e[n + r] = t >>> 8 * (i ? r : 3 - r) & 255
}
function $(e, t, n, i, r, o) {
if (n + i > e.length) throw new RangeError("Index out of range");
if (0 > n) throw new RangeError("Index out of range")
}
function U(e, t, n, i, r) {
return r || $(e, t, n, 4, 3.4028234663852886e38, -3.4028234663852886e38), Q.write(e, t, n, i, 23, 4), n + 4
}
function z(e, t, n, i, r) {
return r || $(e, t, n, 8, 1.7976931348623157e308, -1.7976931348623157e308), Q.write(e, t, n, i, 52, 8), n + 8
}
function H(e) {
if (e = j(e).replace(te, ""), e.length < 2) return "";
for (; e.length % 4 !== 0;) e += "=";
return e
}
function j(e) {
return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
}
function W(e) {
return 16 > e ? "0" + e.toString(16) : e.toString(16)
}
function q(e, t) {
t = t || 1 / 0;
for (var n, i = e.length, r = null, o = [], s = 0; i > s; ++s) {
if (n = e.charCodeAt(s), n > 55295 && 57344 > n) {
if (!r) {
if (n > 56319) {
(t -= 3) > -1 && o.push(239, 191, 189);
continue
}
if (s + 1 === i) {
(t -= 3) > -1 && o.push(239, 191, 189);
continue
}
r = n;
continue
}
if (56320 > n) {
(t -= 3) > -1 && o.push(239, 191, 189), r = n;
continue
}
n = (r - 55296 << 10 | n - 56320) + 65536
} else r && (t -= 3) > -1 && o.push(239, 191, 189);
if (r = null, 128 > n) {
if ((t -= 1) < 0) break;
o.push(n)
} else if (2048 > n) {
if ((t -= 2) < 0) break;
o.push(n >> 6 | 192, 63 & n | 128)
} else if (65536 > n) {
if ((t -= 3) < 0) break;
o.push(n >> 12 | 224, n >> 6 & 63 | 128, 63 & n | 128)
} else {
if (!(1114112 > n)) throw new Error("Invalid code point");
if ((t -= 4) < 0) break;
o.push(n >> 18 | 240, n >> 12 & 63 | 128, n >> 6 & 63 | 128, 63 & n | 128)
}
}
return o
}
function Y(e) {
for (var t = [], n = 0; n < e.length; ++n) t.push(255 & e.charCodeAt(n));
return t
}
function V(e, t) {
for (var n, i, r, o = [], s = 0; s < e.length && !((t -= 2) < 0); ++s) n = e.charCodeAt(s), i = n >> 8, r = n % 256, o.push(r), o.push(i);
return o
}
function G(e) {
return Z.toByteArray(H(e))
}
function K(e, t, n, i) {
for (var r = 0; i > r && !(r + n >= t.length || r >= e.length); ++r) t[r + n] = e[r];
return r
}
function X(e) {
return e !== e
}
var Z = n(1786),
Q = n(2767),
J = n(2768);
t.Buffer = e, t.SlowBuffer = m, t.INSPECT_MAX_BYTES = 50, e.TYPED_ARRAY_SUPPORT = void 0 !== i.TYPED_ARRAY_SUPPORT ? i.TYPED_ARRAY_SUPPORT : r(), t.kMaxLength = o(), e.poolSize = 8192, e._augment = function(t) {
return t.__proto__ = e.prototype, t
}, e.from = function(e, t, n) {
return a(null, e, t, n)
}, e.TYPED_ARRAY_SUPPORT && (e.prototype.__proto__ = Uint8Array.prototype, e.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && e[Symbol.species] === e && Object.defineProperty(e, Symbol.species, {
value: null,
configurable: !0
})), e.alloc = function(e, t, n) {
return u(null, e, t, n)
}, e.allocUnsafe = function(e) {
return c(null, e)
}, e.allocUnsafeSlow = function(e) {
return c(null, e)
}, e.isBuffer = function(e) {
return !(null == e || !e._isBuffer)
}, e.compare = function(t, n) {
if (!e.isBuffer(t) || !e.isBuffer(n)) throw new TypeError("Arguments must be Buffers");
if (t === n) return 0;
for (var i = t.length, r = n.length, o = 0, s = Math.min(i, r); s > o; ++o)
if (t[o] !== n[o]) {
i = t[o], r = n[o];
break
}
return r > i ? -1 : i > r ? 1 : 0
}, e.isEncoding = function(e) {
switch (String(e).toLowerCase()) {
case "hex":
case "utf8":
case "utf-8":
case "ascii":
case "latin1":
case "binary":
case "base64":
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return !0;
default:
return !1
}
}, e.concat = function(t, n) {
if (!J(t)) throw new TypeError('"list" argument must be an Array of Buffers');
if (0 === t.length) return e.alloc(0);
var i;
if (void 0 === n)
for (n = 0, i = 0; i < t.length; ++i) n += t[i].length;
var r = e.allocUnsafe(n),
o = 0;
for (i = 0; i < t.length; ++i) {
var s = t[i];
if (!e.isBuffer(s)) throw new TypeError('"list" argument must be an Array of Buffers');
s.copy(r, o), o += s.length
}
return r
}, e.byteLength = v, e.prototype._isBuffer = !0, e.prototype.swap16 = function() {
var e = this.length;
if (e % 2 !== 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
for (var t = 0; e > t; t += 2) y(this, t, t + 1);
return this
}, e.prototype.swap32 = function() {
var e = this.length;
if (e % 4 !== 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
for (var t = 0; e > t; t += 4) y(this, t, t + 3), y(this, t + 1, t + 2);
return this
}, e.prototype.swap64 = function() {
var e = this.length;
if (e % 8 !== 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
for (var t = 0; e > t; t += 8) y(this, t, t + 7), y(this, t + 1, t + 6), y(this, t + 2, t + 5), y(this, t + 3, t + 4);
return this
}, e.prototype.toString = function() {
var e = 0 | this.length;
return 0 === e ? "" : 0 === arguments.length ? D(this, 0, e) : _.apply(this, arguments)
}, e.prototype.equals = function(t) {
if (!e.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
return this === t ? !0 : 0 === e.compare(this, t)
}, e.prototype.inspect = function() {
var e = "",
n = t.INSPECT_MAX_BYTES;
return this.length > 0 && (e = this.toString("hex", 0, n).match(/.{2}/g).join(" "), this.length > n && (e += " ... ")), "<Buffer " + e + ">"
}, e.prototype.compare = function(t, n, i, r, o) {
if (!e.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
if (void 0 === n && (n = 0), void 0 === i && (i = t ? t.length : 0), void 0 === r && (r = 0), void 0 === o && (o = this.length), 0 > n || i > t.length || 0 > r || o > this.length) throw new RangeError("out of range index");
if (r >= o && n >= i) return 0;
if (r >= o) return -1;
if (n >= i) return 1;
if (n >>>= 0, i >>>= 0, r >>>= 0, o >>>= 0, this === t) return 0;
for (var s = o - r, a = i - n, l = Math.min(s, a), u = this.slice(r, o), c = t.slice(n, i), d = 0; l > d; ++d)
if (u[d] !== c[d]) {
s = u[d], a = c[d];
break
}
return a > s ? -1 : s > a ? 1 : 0
}, e.prototype.includes = function(e, t, n) {
return -1 !== this.indexOf(e, t, n)
}, e.prototype.indexOf = function(e, t, n) {
return b(this, e, t, n, !0)
}, e.prototype.lastIndexOf = function(e, t, n) {
return b(this, e, t, n, !1)
}, e.prototype.write = function(e, t, n, i) {
if (void 0 === t) i = "utf8", n = this.length, t = 0;
else if (void 0 === n && "string" == typeof t) i = t, n = this.length, t = 0;
else {
if (!isFinite(t)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
t = 0 | t, isFinite(n) ? (n = 0 | n, void 0 === i && (i = "utf8")) : (i = n, n = void 0)
}
var r = this.length - t;
if ((void 0 === n || n > r) && (n = r), e.length > 0 && (0 > n || 0 > t) || t > this.length) throw new RangeError("Attempt to write outside buffer bounds");
i || (i = "utf8");
for (var o = !1;;) switch (i) {
case "hex":
return x(this, e, t, n);
case "utf8":
case "utf-8":
return k(this, e, t, n);
case "ascii":
return S(this, e, t, n);
case "latin1":
case "binary":
return T(this, e, t, n);
case "base64":
return A(this, e, t, n);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return E(this, e, t, n);
default:
if (o) throw new TypeError("Unknown encoding: " + i);
i = ("" + i).toLowerCase(), o = !0
}
}, e.prototype.toJSON = function() {
return {
type: "Buffer",
data: Array.prototype.slice.call(this._arr || this, 0)
}
};
var ee = 4096;
e.prototype.slice = function(t, n) {
var i = this.length;
t = ~~t, n = void 0 === n ? i : ~~n, 0 > t ? (t += i, 0 > t && (t = 0)) : t > i && (t = i), 0 > n ? (n += i, 0 > n && (n = 0)) : n > i && (n = i), t > n && (n = t);
var r;
if (e.TYPED_ARRAY_SUPPORT) r = this.subarray(t, n), r.__proto__ = e.prototype;
else {
var o = n - t;
r = new e(o, void 0);
for (var s = 0; o > s; ++s) r[s] = this[s + t]
}
return r
}, e.prototype.readUIntLE = function(e, t, n) {
e = 0 | e, t = 0 | t, n || O(e, t, this.length);
for (var i = this[e], r = 1, o = 0; ++o < t && (r *= 256);) i += this[e + o] * r;
return i
}, e.prototype.readUIntBE = function(e, t, n) {
e = 0 | e, t = 0 | t, n || O(e, t, this.length);
for (var i = this[e + --t], r = 1; t > 0 && (r *= 256);) i += this[e + --t] * r;
return i
}, e.prototype.readUInt8 = function(e, t) {
return t || O(e, 1, this.length), this[e]
}, e.prototype.readUInt16LE = function(e, t) {
return t || O(e, 2, this.length), this[e] | this[e + 1] << 8
}, e.prototype.readUInt16BE = function(e, t) {
return t || O(e, 2, this.length), this[e] << 8 | this[e + 1]
}, e.prototype.readUInt32LE = function(e, t) {
return t || O(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
}, e.prototype.readUInt32BE = function(e, t) {
return t || O(e, 4, this.length), 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
}, e.prototype.readIntLE = function(e, t, n) {
e = 0 | e, t = 0 | t, n || O(e, t, this.length);
for (var i = this[e], r = 1, o = 0; ++o < t && (r *= 256);) i += this[e + o] * r;
return r *= 128, i >= r && (i -= Math.pow(2, 8 * t)), i
}, e.prototype.readIntBE = function(e, t, n) {
e = 0 | e, t = 0 | t, n || O(e, t, this.length);
for (var i = t, r = 1, o = this[e + --i]; i > 0 && (r *= 256);) o += this[e + --i] * r;
return r *= 128, o >= r && (o -= Math.pow(2, 8 * t)), o
}, e.prototype.readInt8 = function(e, t) {
return t || O(e, 1, this.length), 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
}, e.prototype.readInt16LE = function(e, t) {
t || O(e, 2, this.length);
var n = this[e] | this[e + 1] << 8;
return 32768 & n ? 4294901760 | n : n
}, e.prototype.readInt16BE = function(e, t) {
t || O(e, 2, this.length);
var n = this[e + 1] | this[e] << 8;
return 32768 & n ? 4294901760 | n : n
}, e.prototype.readInt32LE = function(e, t) {
return t || O(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
}, e.prototype.readInt32BE = function(e, t) {
return t || O(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
}, e.prototype.readFloatLE = function(e, t) {
return t || O(e, 4, this.length), Q.read(this, e, !0, 23, 4)
}, e.prototype.readFloatBE = function(e, t) {
return t || O(e, 4, this.length), Q.read(this, e, !1, 23, 4)
}, e.prototype.readDoubleLE = function(e, t) {
return t || O(e, 8, this.length), Q.read(this, e, !0, 52, 8)
}, e.prototype.readDoubleBE = function(e, t) {
return t || O(e, 8, this.length), Q.read(this, e, !1, 52, 8)
}, e.prototype.writeUIntLE = function(e, t, n, i) {
if (e = +e, t = 0 | t, n = 0 | n, !i) {
var r = Math.pow(2, 8 * n) - 1;
F(this, e, t, n, r, 0)
}
var o = 1,
s = 0;
for (this[t] = 255 & e; ++s < n && (o *= 256);) this[t + s] = e / o & 255;
return t + n
}, e.prototype.writeUIntBE = function(e, t, n, i) {
if (e = +e, t = 0 | t, n = 0 | n, !i) {
var r = Math.pow(2, 8 * n) - 1;
F(this, e, t, n, r, 0)
}
var o = n - 1,
s = 1;
for (this[t + o] = 255 & e; --o >= 0 && (s *= 256);) this[t + o] = e / s & 255;
return t + n
}, e.prototype.writeUInt8 = function(t, n, i) {
return t = +t, n = 0 | n, i || F(this, t, n, 1, 255, 0), e.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)), this[n] = 255 & t, n + 1
}, e.prototype.writeUInt16LE = function(t, n, i) {
return t = +t, n = 0 | n, i || F(this, t, n, 2, 65535, 0), e.TYPED_ARRAY_SUPPORT ? (this[n] = 255 & t, this[n + 1] = t >>> 8) : N(this, t, n, !0), n + 2
}, e.prototype.writeUInt16BE = function(t, n, i) {
return t = +t, n = 0 | n, i || F(this, t, n, 2, 65535, 0), e.TYPED_ARRAY_SUPPORT ? (this[n] = t >>> 8, this[n + 1] = 255 & t) : N(this, t, n, !1), n + 2
}, e.prototype.writeUInt32LE = function(t, n, i) {
return t = +t, n = 0 | n, i || F(this, t, n, 4, 4294967295, 0), e.TYPED_ARRAY_SUPPORT ? (this[n + 3] = t >>> 24, this[n + 2] = t >>> 16, this[n + 1] = t >>> 8, this[n] = 255 & t) : B(this, t, n, !0), n + 4
}, e.prototype.writeUInt32BE = function(t, n, i) {
return t = +t, n = 0 | n, i || F(this, t, n, 4, 4294967295, 0), e.TYPED_ARRAY_SUPPORT ? (this[n] = t >>> 24, this[n + 1] = t >>> 16, this[n + 2] = t >>> 8, this[n + 3] = 255 & t) : B(this, t, n, !1), n + 4
}, e.prototype.writeIntLE = function(e, t, n, i) {
if (e = +e, t = 0 | t, !i) {
var r = Math.pow(2, 8 * n - 1);
F(this, e, t, n, r - 1, -r)
}
var o = 0,
s = 1,
a = 0;
for (this[t] = 255 & e; ++o < n && (s *= 256);) 0 > e && 0 === a && 0 !== this[t + o - 1] && (a = 1), this[t + o] = (e / s >> 0) - a & 255;
return t + n
}, e.prototype.writeIntBE = function(e, t, n, i) {
if (e = +e, t = 0 | t, !i) {
var r = Math.pow(2, 8 * n - 1);
F(this, e, t, n, r - 1, -r)
}
var o = n - 1,
s = 1,
a = 0;
for (this[t + o] = 255 & e; --o >= 0 && (s *= 256);) 0 > e && 0 === a && 0 !== this[t + o + 1] && (a = 1), this[t + o] = (e / s >> 0) - a & 255;
return t + n
}, e.prototype.writeInt8 = function(t, n, i) {
return t = +t, n = 0 | n, i || F(this, t, n, 1, 127, -128), e.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)), 0 > t && (t = 255 + t + 1), this[n] = 255 & t, n + 1
}, e.prototype.writeInt16LE = function(t, n, i) {
return t = +t, n = 0 | n, i || F(this, t, n, 2, 32767, -32768), e.TYPED_ARRAY_SUPPORT ? (this[n] = 255 & t, this[n + 1] = t >>> 8) : N(this, t, n, !0), n + 2
}, e.prototype.writeInt16BE = function(t, n, i) {
return t = +t, n = 0 | n, i || F(this, t, n, 2, 32767, -32768), e.TYPED_ARRAY_SUPPORT ? (this[n] = t >>> 8, this[n + 1] = 255 & t) : N(this, t, n, !1), n + 2
}, e.prototype.writeInt32LE = function(t, n, i) {
return t = +t, n = 0 | n, i || F(this, t, n, 4, 2147483647, -2147483648), e.TYPED_ARRAY_SUPPORT ? (this[n] = 255 & t, this[n + 1] = t >>> 8, this[n + 2] = t >>> 16, this[n + 3] = t >>> 24) : B(this, t, n, !0), n + 4
}, e.prototype.writeInt32BE = function(t, n, i) {
return t = +t, n = 0 | n, i || F(this, t, n, 4, 2147483647, -2147483648), 0 > t && (t = 4294967295 + t + 1), e.TYPED_ARRAY_SUPPORT ? (this[n] = t >>> 24, this[n + 1] = t >>> 16, this[n + 2] = t >>> 8, this[n + 3] = 255 & t) : B(this, t, n, !1), n + 4
}, e.prototype.writeFloatLE = function(e, t, n) {
return U(this, e, t, !0, n)
}, e.prototype.writeFloatBE = function(e, t, n) {
return U(this, e, t, !1, n)
}, e.prototype.writeDoubleLE = function(e, t, n) {
return z(this, e, t, !0, n)
}, e.prototype.writeDoubleBE = function(e, t, n) {
return z(this, e, t, !1, n)
}, e.prototype.copy = function(t, n, i, r) {
if (i || (i = 0), r || 0 === r || (r = this.length), n >= t.length && (n = t.length), n || (n = 0), r > 0 && i > r && (r = i), r === i) return 0;
if (0 === t.length || 0 === this.length) return 0;
if (0 > n) throw new RangeError("targetStart out of bounds");
if (0 > i || i >= this.length) throw new RangeError("sourceStart out of bounds");
if (0 > r) throw new RangeError("sourceEnd out of bounds");
r > this.length && (r = this.length), t.length - n < r - i && (r = t.length - n + i);
var o, s = r - i;
if (this === t && n > i && r > n)
for (o = s - 1; o >= 0; --o) t[o + n] = this[o + i];
else if (1e3 > s || !e.TYPED_ARRAY_SUPPORT)
for (o = 0; s > o; ++o) t[o + n] = this[o + i];
else Uint8Array.prototype.set.call(t, this.subarray(i, i + s), n);
return s
}, e.prototype.fill = function(t, n, i, r) {
if ("string" == typeof t) {
if ("string" == typeof n ? (r = n, n = 0, i = this.length) : "string" == typeof i && (r = i, i = this.length), 1 === t.length) {
var o = t.charCodeAt(0);
256 > o && (t = o)
}
if (void 0 !== r && "string" != typeof r) throw new TypeError("encoding must be a string");
if ("string" == typeof r && !e.isEncoding(r)) throw new TypeError("Unknown encoding: " + r)
} else "number" == typeof t && (t = 255 & t);
if (0 > n || this.length < n || this.length < i) throw new RangeError("Out of range index");
if (n >= i) return this;
n >>>= 0, i = void 0 === i ? this.length : i >>> 0, t || (t = 0);
var s;
if ("number" == typeof t)
for (s = n; i > s; ++s) this[s] = t;
else {
var a = e.isBuffer(t) ? t : q(new e(t, r).toString()),
l = a.length;
for (s = 0; i - n > s; ++s) this[s + n] = a[s % l]
}
return this
};
var te = /[^+\/0-9A-Za-z-_]/g
}).call(t, n(1053).Buffer, function() {
return this
}())
},
1054: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(22, function(e) {
i = n(1221);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1055: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(32, function(e) {
i = n(1222);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1056: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(23, function(e) {
i = n(1223);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1057: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(7, function(e) {
i = n(1224);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1058: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(27, function(e) {
i = n(1225);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1059: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(35, function(e) {
i = n(1226);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1060: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(40, function(e) {
i = n(1227);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1061: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(9, function(e) {
i = n(1228);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1062: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(20, function(e) {
i = n(1229);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1063: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(29, function(e) {
i = n(1230);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1064: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(6, function(e) {
i = n(1231);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1065: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(15, function(e) {
i = n(1232);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1066: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(38, function(e) {
i = n(1233);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1067: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(16, function(e) {
i = n(1234);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1068: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(28, function(e) {
i = n(1235);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1069: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(31, function(e) {
i = n(1236);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1070: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(8, function(e) {
i = n(1237);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1071: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(44, function(e) {
i = n(1238);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1072: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(43, function(e) {
i = n(1239);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1073: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(34, function(e) {
i = n(1240);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1074: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(21, function(e) {
i = n(1241);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1075: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(42, function(e) {
i = n(1242);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1076: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(14, function(e) {
i = n(1243);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1077: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(33, function(e) {
i = n(1244);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1078: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(25, function(e) {
i = n(1245);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1079: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(13, function(e) {
i = n(1246);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1080: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(19, function(e) {
i = n(1247);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1081: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(37, function(e) {
i = n(1248);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1082: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(30, function(e) {
i = n(1249);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1083: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(12, function(e) {
i = n(1250);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1084: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(26, function(e) {
i = n(1251);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1085: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(11, function(e) {
i = n(1252);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1086: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(39, function(e) {
i = n(1253);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1087: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(10, function(e) {
i = n(1254);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1088: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(17, function(e) {
i = n(1255);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1089: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(41, function(e) {
i = n(1256);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1090: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(18, function(e) {
i = n(1257);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1091: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(24, function(e) {
i = n(1258);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1092: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(5, function(e) {
i = n(1259);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1093: function(e, t, n) {
var i, r = [];
e.exports = function(e) {
r ? r.push(e) : e(i)
}, n.e(36, function(e) {
i = n(1260);
var t = r;
r = null;
for (var o = 0, s = t.length; s > o; o++) t[o](i)
})
},
1100: function(e, t, n) {
e.exports = n.p + "assets/images/drag-handle-a403f9.png"
},
1101: function(e, t, n) {
e.exports = n.p + "assets/images/empty-states/playlists-17e39d.png"
},
1103: function(e, t, n) {
e.exports = n.p + "assets/images/empty-states/stream-d2c2a1.png"
},
1104: function(e, t, n) {
e.exports = n.p + "assets/images/empty-states/stream@2x-fab0f8.png"
},
1105: function(e, t, n) {
e.exports = n.p + "assets/images/empty-states/tracks-b8fba9.png"
},
1106: function(e, t, n) {
e.exports = n.p + "assets/images/empty-states/tracks@2x-59b77a.png"
},
1107: function(e, t, n) {
e.exports = n.p + "assets/images/failed-25974f.png"
},
1108: function(e, t, n) {
e.exports = n.p + "assets/images/failed@2x-0ba158.png"
},
1109: function(e, t, n) {
e.exports = n.p + "assets/images/header/query-suggestion-ed120c.svg"
},
1110: function(e, t, n) {
e.exports = n.p + "assets/images/header/search-dbfe5c.svg"
},
1111: function(e, t, n) {
e.exports = n.p + "assets/images/notifications/error-18e777.png"
},
1112: function(e, t, n) {
e.exports = n.p + "assets/images/notifications/good-248c30.png"
},
1113: function(e, t, n) {
e.exports = n.p + "assets/images/notifications/good@2x-2dda7c.png"
},
1114: function(e, t, n) {
e.exports = n.p + "assets/images/playback/volume-max-7a4115.svg"
},
1115: function(e, t, n) {
e.exports = n.p + "assets/images/playback/volume-medium-ca80e5.svg"
},
1116: function(e, t, n) {
e.exports = n.p + "assets/images/playback/volume-muted-624fac.svg"
},
1117: function(e, t, n) {
var i = n(20);
e.exports = (i["default"] || i).template({
compiler: [7, ">= 4.0.0"],
main: function(e, t, n, i, r) {
return '<div class="l-collection">\n <div class="l-nav">\n\n </div>\n <div class="l-main">\n\n </div>\n</div>\n'
},
useData: !0
})
},
1118: function(e, t, n) {
var i = n(20);
e.exports = (i["default"] || i).template({
compiler: [7, ">= 4.0.0"],
main: function(e, t, n, i, r) {
return '<div class="l-main"></div>\n'
},
useData: !0
})
},
1119: function(e, t, n) {
var i = n(20);
e.exports = (i["default"] || i).template({
compiler: [7, ">= 4.0.0"],
main: function(e, t, n, i, r) {
return '<div class="l-front">\n <div class="l-front-hero l-inner-fullwidth">\n\n </div>\n <div class="l-front-content">\n\n </div>\n <div class="l-front-mobile-teaser">\n\n </div>\n <div class="l-front-osc-teaser">\n\n </div>\n <div class="l-front-signup-teaser">\n\n </div>\n <div class="l-front-footer">\n\n </div>\n</div>\n'
},
useData: !0
})
},
1120: function(e, t, n) {
var i = n(20);
e.exports = (i["default"] || i).template({
compiler: [7, ">= 4.0.0"],
main: function(e, t, n, i, r) {
return '<div class="l-messages-left sc-border-box"></div>\n<div class="l-messages-top g-z-index-content"></div>\n<div class="l-messages-main"></div>\n'
},
useData: !0
})
},
1121: function(e, t, n) {
var i = n(20);
e.exports = (i["default"] || i).template({
compiler: [7, ">= 4.0.0"],
main: function(e, t, n, i, r) {
return '<div class="l-banner l-inner-fullwidth"></div>\n<div class="l-listen-hero"></div>\n<div class="l-engagement"></div>\n<div class="l-main"></div>\n'
},
useData: !0
})
},
1122: function(e, t, n) {
var i = n(20);
e.exports = (i["default"] || i).template({
compiler: [7, ">= 4.0.0"],
main: function(e, t, n, i, r) {
return '<div class="l-banner l-inner-fullwidth">\n\n</div>\n<div class="listen-content">\n\n</div>\n<div class="l-three-column listen-about">\n <div class="l-sidebar-left">\n\n </div>\n <div class="l-main sc-border-light-right">\n\n </div>\n <div class="l-sidebar-right">\n\n </div>\n</div>\n'
},
useData: !0
})
},
1123: function(e, t, n) {
var i = n(20);
e.exports = (i["default"] || i).template({
compiler: [7, ">= 4.0.0"],
main: function(e, t, n, i, r) {
return '<div class="l-oscp m-about">\n <div class="l-oscp-headline">\n\n </div>\n <div class="l-main">\n\n </div>\n</div>\n'
},
useData: !0
})
},
1124: function(e, t, n) {
var i = n(20);
e.exports = (i["default"] || i).template({
compiler: [7, ">= 4.0.0"],
main: function(e, t, n, i, r) {
return '<div class="l-oscp">\n <div class="l-oscp__mainContainer">\n <div class="l-oscp-headline">\n\n </div>\n <div class="l-main">\n\n </div>\n </div>\n <div class="l-sidebar">\n\n </div>\n</div>\n'
},
useData: !0
})
},
1125: function(e, t, n) {
var i = n(20);
e.exports = (i["default"] || i).template({
compiler: [7, ">= 4.0.0"],
main: function(e, t, n, i, r) {
return '<div class="l-search l-fixed-fluid">\n <div class="l-fixed-top">\n\n </div>\n <div class="l-fixed-left">\n\n </div>\n <div class="l-main">\n\n </div>\n</div>\n'
},
useData: !0
})
},
1126: function(e, t, n) {
var i = n(20);
e.exports = (i["default"] || i).template({
compiler: [7, ">= 4.0.0"],
main: function(e, t, n, i, r) {
return '<div class="l-station-hero l-inner-fullwidth">\n\n</div>\n<div class="l-one-column">\n <div class="l-main l-station-main">\n\n </div>\n</div>\n'
},
useData: !0
})
},
1127: function(e, t, n) {
var i = n(20);
e.exports = (i["default"] || i).template({
compiler: [7, ">= 4.0.0"],
main: function(e, t, n, i, r) {
return '<div class="l-banner l-inner-fullwidth">\n\n</div>\n<div class="l-user-hero">\n\n</div>\n<div class="l-vertical-bar">\n\n</div>\n<div class="l-fluid-fixed">\n <div class="l-main l-user-main sc-border-light-right">\n\n </div>\n <div class="l-sidebar-right l-user-sidebar-right">\n\n </div>\n</div>\n'
},
useData: !0
})
},
1129: function(e, t, n) {
(function(t) {
"use strict";
function i(e, t) {
return 1 === arguments.length ? r(e) : o(e, t)
}
function r(e) {
return JSON.parse(c.getItem(e))
}
function o(e, t) {
try {
return c.setItem(e, JSON.stringify(t)), !0
} catch (n) {
return !1
}
}
function s(e) {
return c.removeItem(e)
}
function a() {
return c.clear()
}
var l = n(2769),
u = n(2770),
c = "localStorage" in t && t.localStorage ? t.localStorage : l;
i.set = o, i.get = r, i.remove = s, i.clear = a, i.on = u.on, i.off = u.off, e.exports = i
}).call(t, function() {
return this
}())
},
1130: function(e, t, n) {
function i(e) {
return function(t) {
return null == t ? void 0 : t[e]
}
}
function r(e) {
return null != e && s(_(e))
}
function o(e, t) {
return e = "number" == typeof e || p.test(e) ? +e : -1, t = null == t ? v : t, e > -1 && e % 1 == 0 && t > e
}
function s(e) {
return "number" == typeof e && e > -1 && e % 1 == 0 && v >= e
}
function a(e) {
for (var t = u(e), n = t.length, i = n && e.length, r = !!i && s(i) && (h(e) || d(e)), a = -1, l = []; ++a < n;) {
var c = t[a];
(r && o(c, i) || g.call(e, c)) && l.push(c);
}
return l
}
function l(e) {
var t = typeof e;
return !!e && ("object" == t || "function" == t)
}
function u(e) {
if (null == e) return [];
l(e) || (e = Object(e));
var t = e.length;
t = t && s(t) && (h(e) || d(e)) && t || 0;
for (var n = e.constructor, i = -1, r = "function" == typeof n && n.prototype === e, a = Array(t), u = t > 0; ++i < t;) a[i] = i + "";
for (var c in e) u && o(c, t) || "constructor" == c && (r || !g.call(e, c)) || a.push(c);
return a
}
var c = n(2775),
d = n(2777),
h = n(2778),
p = /^\d+$/,
f = Object.prototype,
g = f.hasOwnProperty,
m = c(Object, "keys"),
v = 9007199254740991,
_ = i("length"),
y = m ? function(e) {
var t = null == e ? void 0 : e.constructor;
return "function" == typeof t && t.prototype === e || "function" != typeof e && r(e) ? a(e) : l(e) ? m(e) : []
} : a;
e.exports = y
},
1131: function(e, t, n) {
var i = n(1787);
"string" == typeof i && (i = [
[e.id, i, ""]
]);
n(7)(i, {})
},
1132: function(e, t, n) {
var i = n(1788);
"string" == typeof i && (i = [
[e.id, i, ""]
]);
n(7)(i, {})
},
1133: function(e, t, n) {
var i = n(1789);
"string" == typeof i && (i = [
[e.id, i, ""]
]);
n(7)(i, {})
},
1134: function(e, t, n) {
var i = n(1790);
"string" == typeof i && (i = [
[e.id, i, ""]
]);
n(7)(i, {})
},
1135: function(e, t, n) {
var i = n(1791);
"string" == typeof i && (i = [
[e.id, i, ""]
]);
n(7)(i, {})
},
1136: function(e, t, n) {
var i = n(1793);
"string" == typeof i && (i = [
[e.id, i, ""]
]);
n(7)(i, {})
},
1137: function(e, t, n) {
var i = n(1794);
"string" == typeof i && (i = [
[e.id, i, ""]
]);
n(7)(i, {})
},
1138: function(e, t, n) {
var i = n(1795);
"string" == typeof i && (i = [
[e.id, i, ""]
]);
n(7)(i, {})
},
1139: function(e, t, n) {
var i = n(1796);
"string" == typeof i && (i = [
[e.id, i, ""]
]);
n(7)(i, {})
},
1140: function(e, t, n) {
var i = n(1797);
"string" == typeof i && (i = [
[e.id, i, ""]
]);
n(7)(i, {})
},
1141: function(e, t, n) {
var i = n(1799);
"string" == typeof i && (i = [
[e.id, i, ""]
]);
n(7)(i, {})
},
1153: function(e, t, n) {
function i(e) {
return n(r(e))
}
function r(e) {
return o[e] || function() {
throw new Error("Cannot find module '" + e + "'.")
}()
}
var o = {
"./activity": 1054,
"./activity.js": 1054,
"./charts": 1055,
"./charts.js": 1055,
"./collection": 1056,
"./collection.css": 1131,
"./collection.js": 1056,
"./collection.tmpl": 1117,
"./consumer-premium": 1057,
"./consumer-premium.js": 1057,
"./consumer-premium.tmpl": 1118,
"./copyright-form": 1058,
"./copyright-form.js": 1058,
"./developer-apps": 1059,
"./developer-apps.js": 1059,
"./error": 1060,
"./error.js": 1060,
"./front": 1061,
"./front.js": 1061,
"./front.tmpl": 1119,
"./inbox": 1062,
"./inbox.css": 1132,
"./inbox.js": 1062,
"./inbox.tmpl": 1120,
"./listen": 1064,
"./listen-blocked.tmpl": 1121,
"./listen-network": 1063,
"./listen-network.js": 1063,
"./listen-promoted.css": 1133,
"./listen-promoted.tmpl": 1122,
"./listen.css": 1134,
"./listen.js": 1064,
"./listen.tmpl": 760,
"./logout": 1065,
"./logout.js": 1065,
"./mobile": 1067,
"./mobile-pulse": 1066,
"./mobile-pulse.js": 1066,
"./mobile.js": 1067,
"./new-for-you": 1068,
"./new-for-you.js": 1068,
"./onboarding": 1069,
"./onboarding.js": 1069,
"./oscp": 1070,
"./oscp-about.tmpl": 1123,
"./oscp.css": 1135,
"./oscp.js": 1070,
"./oscp.tmpl": 1124,
"./password-reset-success": 1071,
"./password-reset-success.js": 1071,
"./people": 1073,
"./people-directory": 1072,
"./people-directory.js": 1072,
"./people.js": 1073,
"./personal-recommended": 1074,
"./personal-recommended.js": 1074,
"./popular-searches": 1075,
"./popular-searches.js": 1075,
"./premium": 1076,
"./premium.css": 824,
"./premium.js": 1076,
"./premium.tmpl": 761,
"./purchased": 1077,
"./purchased.js": 1077,
"./search": 1078,
"./search.css": 1136,
"./search.js": 1078,
"./search.tmpl": 1125,
"./settings": 1079,
"./settings.css": 1137,
"./settings.js": 1079,
"./signin": 1080,
"./signin.css": 1138,
"./signin.js": 1080,
"./static-page": 1081,
"./static-page.js": 1081,
"./station": 1082,
"./station.css": 1139,
"./station.js": 1082,
"./station.tmpl": 1126,
"./stats": 1083,
"./stats.js": 1083,
"./stream": 1084,
"./stream-explore.tmpl": 476,
"./stream.js": 1084,
"./subscriptions": 1085,
"./subscriptions.js": 1085,
"./tags": 1086,
"./tags.js": 1086,
"./track-manager": 1087,
"./track-manager.js": 1087,
"./track-stats": 1088,
"./track-stats.js": 1088,
"./two-column-sound-hero.css": 1140,
"./two-column-sound-hero.tmpl": 2408,
"./unsubscribed": 1089,
"./unsubscribed.js": 1089,
"./upload": 1090,
"./upload.css": 2790,
"./upload.js": 1090,
"./user": 1092,
"./user-network": 1091,
"./user-network.js": 1091,
"./user.css": 1141,
"./user.js": 1092,
"./user.tmpl": 1127,
"./widgets": 1093,
"./widgets.js": 1093
};
i.keys = function() {
return Object.keys(o)
}, i.resolve = r, e.exports = i, i.id = 1153
},
1157: function(e, t, n) {
var i = n(52);
e.exports = function(e, t) {
return i.dateTimeHelper.timecode(e, t.hash)
}
},
1158: function(e, t, n) {
var i = n(46).Deferred,
r = 4;
e.exports = function(e) {
var t, n, o, s, a, l, u, c;
e && (o = e.data || null, n = e.url || "", t = e.type || "GET", s = e.dataType || "text", a = e.async, l = e.timeout, u = e.beforeSend || null);
var d = i();
a = a !== !1;
var h = new XMLHttpRequest;
return h.open(t, n, a), a && (h.responseType = "text"), u && u(h), h.onreadystatechange = function() {
if (h.readyState === r)
if (clearTimeout(c), 0 !== h.status && h.status < 400) {
var e = h.responseText;
if ("json" === s) try {
e = JSON.parse(e)
} catch (t) {
return void d.reject(h)
}
d.resolve(e)
} else d.reject(h)
}, null != l && (c = setTimeout(function() {
h.readyState !== r && (h.abort(), d.reject(h))
}, l)), h.send(o), d.promise()
}
},
1162: function(e, t) {
"use strict";
function n() {
function e(e, n) {
if (p) {
for (var i = arguments.length, r = Array(i > 2 ? i - 2 : 0), o = 2; i > o; o++) r[o - 2] = arguments[o];
"string" == typeof n ? n = " " + n : (r.unshift(n), n = "");
var s = [t() + " | " + A + (k ? "%c" : "") + n].concat(E, r);
m ? T.push({
level: e,
logArgs: s
}) > x && T.shift() : h[e].apply(h, s)
}
}
function t() {
var e = new Date,
t = null === S ? 0 : e - S,
n = k ? "%c" : "";
return S = +e, n + i(e) + (n + " (" + n) + r("+" + t + "ms", " ", 8) + (n + ")")
}
function n(e) {
return e.enable = function() {
p = !0
}, e.disable = function() {
p = !1
}, e.bufferOn = function() {
m = !0
}, e.bufferOff = function() {
m = !1, T.length = 0
}, e.flush = u() ? function() {
T.forEach(function(e) {
var t = e.level,
n = e.logArgs;
h[t].apply(h, n)
}), T.length = 0
} : function() {}, e
}
var o = c.apply(void 0, arguments),
s = o.enabled,
p = void 0 === s ? !0 : s,
g = o.buffer,
m = void 0 === g ? !1 : g,
v = o.label,
_ = void 0 === v ? "" : v,
y = o.plainOutput,
b = void 0 === y ? !1 : y,
w = o.bufferSize,
x = void 0 === w ? 1e3 : w;
if (!u()) return n(d.reduce(function(e, t) {
return e[t] = e
}, function() {}));
h.CL || (h.CL = {
_cssCounter: 0
});
var k = !b && l(),
S = null,
T = [],
A = a(_, k),
E = k ? ["color: green", "color: grey", "color: blue", "color: grey", f(_), ""] : [],
C = h.CL[_] = n(d.reduce(function(t, n) {
return t[n] = e.bind(null, n), t
}, e.bind(null, "log")));
return C
}
function i(e) {
return o(e.getHours()) + ":" + o(e.getMinutes()) + ":" + o(e.getSeconds()) + "." + r(e.getMilliseconds(), "0", 3)
}
function r(e, t, n) {
return s(t, n - ("" + e).length) + e
}
function o(e) {
return r(e, "0", 2)
}
function s(e, t) {
return t > 0 ? new Array(t + 1).join(e) : ""
}
function a(e, t) {
return (t ? "%c" : "") + (e ? e : "")
}
function l() {
if ("undefined" == typeof navigator) return !1;
var e = navigator.userAgent;
return /chrome|firefox|opr/i.test(e) && !/msie|edge/i.test(e)
}
function u() {
return h && d.every(function(e) {
return "function" == typeof h[e]
})
}
function c() {
var e = arguments.length <= 0 || void 0 === arguments[0] ? !0 : arguments[0],
t = arguments.length <= 1 || void 0 === arguments[1] ? "" : arguments[1];
return "object" == typeof e && e || {
enabled: e,
label: t
}
}
e.exports = n;
var d = ["log", "info", "warn", "error"],
h = "undefined" != typeof console ? console : null,
p = ["color:#fff", "border-radius:3px", "padding:2px 4px", "font-family:sans-serif", "text-transform:uppercase", "font-size:9px"].join(";") + ";",
f = function() {
var e = ["#51613C", "#447848", "#486E5F", "#787444", "#6E664E"];
return function(t) {
return t ? "background:" + e[h.CL._cssCounter++ % e.length] + ";" + p : ""
}
}()
},
1163: function(e, t, n) {
(function(t) {
"use strict";
function i() {
return v.call(arguments, function(e, t) {
return t && _(t).forEach(function(n) {
void 0 === e[n] ? e[n] = t[n] : "object" == typeof e[n] && "object" == typeof t[n] && (e[n] = i(e[n], t[n]))
}), e
}, {})
}
function r(e) {
return JSON.parse(JSON.stringify(e))
}
function o(e) {
return "function" == typeof e ? e() : e
}
function s(e, t, n, r) {
if (b.forEach(function(e) {
if (!(e in t)) throw new Error('Endpoint "' + n + '" missing required field: "' + e + '"')
}), e.indexOf(t.service) < 0) throw new Error('Endpoint "' + n + '" references unknown service: "' + t.service + '"');
return i({
name: n
}, t, r, y)
}
function a(e, t, n) {
return x.forEach(function(n) {
if (!(n in e)) throw new Error('Service "' + t + '" missing required field: "' + n + '"')
}), i({
name: t
}, e, n, w)
}
function l(e, t) {
return e.replace(/:([\w-]+)/g, function(e, n) {
return null != t[n] ? t[n] : ""
})
}
function u(e, t) {
var n = e[t];
if (!n) throw new Error('Could not find config for endpoint "' + t + '"');
return r(n)
}
function c(e, t) {
var n = e[t];
if (!n) throw new Error('Could not find config for service "' + t + '"');
return r(n)
}
function d(e, t, n, r, s) {
var a = n.protocol,
u = n.hostname,
c = n.port,
d = l(t.path, r),
h = i(s, o(t.query), n.query);
return e.formatUrl(a, u, c, d, h)
}
function h(e, t) {
var n = arguments.length <= 2 || void 0 === arguments[2] ? {} : arguments[2],
i = arguments.length <= 3 || void 0 === arguments[3] ? {} : arguments[3],
r = arguments.length <= 4 || void 0 === arguments[4] ? {} : arguments[4],
o = arguments[5],
s = arguments.length <= 6 || void 0 === arguments[6] ? [] : arguments[6],
a = u(e.endpoints, t),
l = c(e.services, a.service),
d = {
pathParams: n,
queryParams: i,
headers: r,
data: o,
args: s
};
return g(e.middleware.concat(p.bind(null, e)), e.Promise, {
requestOptions: d,
endpoint: a,
service: l
})
}
function p(e, t) {
var n = t.requestOptions,
r = t.endpoint,
o = t.service,
s = n.pathParams,
a = n.queryParams,
l = n.headers,
u = n.data;
return e.requestTransport({
method: r.method,
url: d(e, r, o, s, a),
dataType: r.dataType,
data: u || null,
headers: i(l, r.headers, o.headers),
timeout: r.timeout
})
}
function f() {
return "undefined" != typeof window ? window.Promise : t.Promise
}
var g = n(1164),
m = Array.prototype,
v = (m.slice, m.reduce),
_ = Object.keys,
y = {
dataType: "json",
method: "get",
query: {},
timeout: 3e3,
customSettings: {}
},
b = ["path", "service"],
w = {
headers: {},
port: null,
protocol: "http",
query: {},
customSettings: {}
},
x = ["hostname"];
e.exports = function(e, t, n) {
var i, r = arguments.length <= 3 || void 0 === arguments[3] ? f() : arguments[3],
o = e.endpoints,
l = e.services,
p = e.defaults || {},
g = {
middleware: []
};
if (g.Promise = r, !o || !l) throw new Error("Cannot create endpoints: invalid config format");
if ("function" != typeof t) throw new Error("Cannot create endpoints: no api transport given");
if (g.requestTransport = t, "function" != typeof n) throw new Error("Cannot create endpoints: no url formatter given");
return g.formatUrl = n, g.services = _(l).reduce(function(e, t) {
return e[t] = a(l[t], t, p.services), e
}, {}), i = _(g.services), g.endpoints = _(o).reduce(function(e, t) {
return e[t] = s(i, o[t], t, p.endpoints), e
}, {}), {
callEndpoint: h.bind(null, g),
getUrlForEndpoint: function(e, t, n) {
var i = u(g.endpoints, e),
r = c(g.services, i.service);
return d(g, i, r, t, n)
},
use: function(e) {
return void g.middleware.push(e)
}
}
}
}).call(t, function() {
return this
}())
},
1165: function(e, t, n) {
e.exports = n(1166)
},
1166: function(e, t) {
function n(e, t) {
return "function" == typeof t.test ? t.test(e) : e === t
}
e.exports = function() {
var e = arguments.length <= 0 || void 0 === arguments[0] ? {} : arguments[0];
return {
get: function(t, i) {
return e[t] && n(e[t].experiment_name, i) ? e[t].variant_name : !1
},
getAll: function() {
return e
},
getVariantIds: function() {
return Object.keys(e).reduce(function(t, n) {
return null != e[n].variant_id && (t[n] = e[n].variant_id), t
}, {})
}
}
}
},
1167: function(e, t) {
function n(e) {
var t = e.data[0],
n = e.data[1];
if (!/https?:\/\/(.+\.|)soundcloud\.(com|dev\:[0-9]{4})/.test(e.origin)) return !1;
switch (t) {
case "i18n-locale:rendered":
return i(n);
case "i18n-locale:set-locale-always":
return o.onLocaleChange()
}
}
function i(e) {
r.style.width = e.width, r.style.height = e.height
}
var r, o = e.exports = {
init: function(e) {
if (!e || !e.selector || !e.host) throw new Error("i18n locale iframe: Missing parameter(s)");
r = window.document.createElement("iframe"), r.src = e.host + "/i18n-locale-switcher.html", r.frameBorder = 0, r.style.border = "none", r.style.backgroundColor = "transparent", window.addEventListener("message", n), window.document.querySelector(e.selector).appendChild(r)
},
onLocaleChange: function() {
window.location.reload()
}
}
},
1168: function(e, t, n) {
function i(e) {
this.phrases = {}, this.setLocale(e)
}
function r() {
var e = o.call(this);
this.number = new f(e), this.dateTime = new p(e, this.number)
}
function o() {
return w[this.locale] || w[b]
}
function s(e, t) {
return t ? e.replace(y, function(e, n, i, r) {
var o = t[n || i || r];
return i ? v(o) : o
}) : e
}
function a(e, t) {
return w[e].pluralForm(t)
}
function l(e) {
return Array.isArray(e) ? e[0] : e.toString()
}
function u(e) {
for (var t, n, i = 1, r = arguments.length; r > i; i++) {
t = arguments[i];
for (n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n])
}
return e
}
function c(e) {
for (var t = 1, n = arguments.length; n > t; t++) {
var i = arguments[t];
for (var r in i) void 0 === e[r] && (e[r] = i[r])
}
return e
}
function d(e) {
var t = e.dates,
n = e.d3;
return {
decimal: e.delimiters.decimal,
thousands: e.delimiters.thousands,
grouping: n.grouping,
currency: n.currency,
dateTime: n.dateTime,
date: n.date,
time: n.time,
periods: n.periods,
days: t.weekdays,
shortDays: t.shortWeekdays,
months: t.months,
shortMonths: t.monthsShort
}
}
function h(e) {
var t = e.datePicker,
n = e.dates;
return {
closeText: t.closeText,
prevText: t.prevText,
nextText: t.nextText,
currentText: t.currentText,
weekHeader: t.weekHeader,
dateFormat: t.dateFormat,
firstDay: t.firstDay,
isRTL: t.isRTL,
showMonthAfterYear: t.showMonthAfterYear,
yearSuffix: t.yearSuffix,
monthNames: n.months,
monthNamesShort: n.monthsShort,
dayNames: n.weekdays,
dayNamesShort: n.shortWeekdays,
dayNamesMin: n.minWeekdays
}
}
var p = n(1169),
f = n(1170),
g = "sclocale",
m = {};
e.exports = i;
var v, _ = "[a-zA-Z0-9_]+",
y = new RegExp("\\[\\[\\[(" + _ + ")\\]\\]\\]|\\[\\[(" + _ + ")\\]\\]|(%d)", "g"),
b = "en",
w = {
en: n(884),
en_GB: n(884),
pt_BR: n(1174),
fr: n(1173),
es: n(1172),
de: n(1171)
};
i.prototype.getLocaleCookieName = function() {
return g
}, i.prototype.setLocale = function(e) {
this.locale = w[e] ? e : b, r.call(this)
}, i.prototype.setPhrases = function(e) {
this.phrases = e || {}
}, i.prototype.extend = function(e) {
u(this.phrases, e)
}, i.prototype.getLocaleDataFor = function(e) {
var t = o.call(this),
n = m;
switch (e) {
case "d3":
return n.d3 = n.d3 || d(t);
case "jquery.datepicker":
return n["jquery.datepicker"] = n["jquery.datepicker"] || h(t);
default:
return t
}
}, i.prototype.t = function(e, t, n, i) {
var r = (n ? n + "::" : "") + e,
o = this.phrases[r] || e;
return s.call(this, l(o), t)
}, i.prototype.tp = function(e, t, n, i, r, o) {
var u = (r ? r + "::" : "") + e,
d = this.phrases[u],
h = this.number.format(n);
return d = d ? d[a(this.locale, n)] : a("en", n) ? t : e, s.call(this, l(d), c({
"%d": h
}, i))
}, v = function() {
function e(e) {
return t[e] || "&amp;"
}
var t = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
"'": "&#x27;",
"`": "&#x60;"
},
n = /[&<>"'`]/g,
i = /[&<>"'`]/;
return function(t) {
return t || 0 === t ? (t = "" + t, i.test(t) ? t.replace(n, e) : t) : ""
}
}()
},
1171: function(e, t) {
function n(e, t) {
return function(t) {
return e[i.pluralForm(t)].replace(/%d/i, t)
}
}
var i = {
delimiters: {
thousands: ".",
decimal: ","
},
relativeTime: {
justNow: "Vor kurzem",
rightNow: "Jetzt",
future: "%s",
past: "%s",
sec: n(["1 Sekunde", "%d Sekunden"]),
min: n(["1 Minute", "%d Minuten"]),
hour: n(["1 Stunde", "%d Stunden"]),
day: n(["1 Tag", "%d Tagen"]),
month: n(["1 Monat", "%d Monaten"]),
year: n(["1 Jahr", "%d Jahren"])
},
dateFormats: {
readable: "DD MMMM YYYY",
readableTime: "DD MMMM YYYY HH:mm",
readableAbbreviated: "DD MMM YYYY",
readableWithWeekday: "DDDD, DD MMMM YYYY",
"default": "DD.MM.YYYY"
},
dates: {
months: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"],
monthsShort: ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"],
weekdays: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"],
shortWeekdays: ["So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."],
minWeekdays: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"]
},
d3: {
grouping: [3],
currency: ["", " €"],
dateTime: "%A, der %e. %B %Y, %X",
date: "%d.%m.%Y",
time: "%H:%M:%S",
periods: ["AM", "PM"]
},
datePicker: {
closeText: "Schließen",
prevText: "Zurück",
nextText: "Weiter",
currentText: "Heute",
weekHeader: "KW",
dateFormat: "dd.mm.yy",
firstDay: 1,
isRTL: !1,
showMonthAfterYear: !1,
yearSuffix: ""
},
pluralForm: function(e) {
return 1 !== e ? 1 : 0
}
};
e.exports = i
},
1172: function(e, t) {
function n(e, t) {
return function(t) {
return e[i.pluralForm(t)].replace(/%d/i, t)
}
}
var i = e.exports = {
delimiters: {
thousands: ".",
decimal: ","
},
relativeTime: {
justNow: "Ahora mismo",
rightNow: "Ahora mismo",
future: "%s",
past: "%s",
sec: n(["1 segundo", "%d segundos"]),
min: n(["1 minuto", "%d minutos"]),
hour: n(["1 hora", "%d horas"]),
day: n(["1 día", "%d días"]),
month: n(["1 mes", "%d meses"]),
year: n(["1 año", "%d años"])
},
dateFormats: {
readable: "DD MMMM YYYY",
readableTime: "DD MMMM YYYY HH:mm",
readableAbbreviated: "DD MMM YYYY",
readableWithWeekday: "DDDD, DD MMMM YYYY",
"default": "DD/MM/YYYY"
},
dates: {
months: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
monthsShort: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"],
weekdays: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"],
shortWeekdays: ["Dom.", "Lun.", "Mar.", "Mié.", "Jue.", "Vie.", "Sáb."],
minWeekdays: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sá"]
},
d3: {
grouping: [3],
currency: ["$", ""],
dateTime: "%A, %e de %B de %Y, %X",
date: "%d/%m/%Y",
time: "%H:%M:%S",
periods: ["AM", "PM"]
},
datePicker: {
closeText: "Cerrar",
prevText: "Ant",
nextText: "Sig",
currentText: "Hoy",
weekHeader: "Sm",
dateFormat: "dd/mm/yy",
firstDay: 1,
isRTL: !1,
showMonthAfterYear: !1,
yearSuffix: ""
},
pluralForm: function(e) {
return 1 !== e ? 1 : 0
}
}
},
1173: function(e, t) {
function n(e, t) {
return function(t) {
return e[i.pluralForm(t)].replace(/%d/i, t)
}
}
var i = e.exports = {
delimiters: {
thousands: ".",
decimal: ","
},
relativeTime: {
justNow: "Récemment",
rightNow: "Maintenant",
future: "%s",
past: "%s",
sec: n(["1 seconde", "%d secondes"]),
min: n(["1 minute", "%d minutes"]),
hour: n(["1 heure", "%d heures"]),
day: n(["1 jour", "%d jours"]),
month: n(["1 mois", "%d mois"]),
year: n(["1 an", "%d ans"])
},
dateFormats: {
readable: "DD MMMM YYYY",
readableTime: "DD MMMM YYYY HH:mm",
readableAbbreviated: "DD MMM YYYY",
readableWithWeekday: "DDDD DD MMMM YYYY",
"default": "DD/MM/YYYY"
},
dates: {
months: ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"],
monthsShort: ["janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc."],
weekdays: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"],
shortWeekdays: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."],
minWeekdays: ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"]
},
d3: {
grouping: [3],
currency: ["$", ""],
dateTime: "%A, le %e %B %Y, %X",
date: "%d/%m/%Y",
time: "%H:%M:%S",
periods: ["AM", "PM"]
},
datePicker: {
closeText: "Fermer",
prevText: "Précédent",
nextText: "Suivant",
currentText: "Aujourd'hui",
weekHeader: "Sem.",
dateFormat: "dd/mm/yy",
firstDay: 1,
isRTL: !1,
showMonthAfterYear: !1,
yearSuffix: ""
},
pluralForm: function(e) {
return e > 1 ? 1 : 0
}
}
},
1174: function(e, t) {
function n(e, t) {
return function(t) {
return e[i.pluralForm(t)].replace(/%d/i, t)
}
}
var i = e.exports = {
delimiters: {
thousands: ".",
decimal: ","
},
relativeTime: {
justNow: "Agora há pouco",
rightNow: "Agora há pouco",
future: "%s",
past: "%s",
sec: n(["1 segundo", "%d segundos"]),
min: n(["1 minuto", "%d minutos"]),
hour: n(["1 hora", "%d horas"]),
day: n(["1 dia", "%d dias"]),
month: n(["1 mês", "%d meses"]),
year: n(["1 ano", "%d anos"])
},
dateFormats: {
readable: "DD MMMM YYYY",
readableTime: "DD MMMM YYYY HH:mm",
readableAbbreviated: "MMM DD, YYYY",
readableWithWeekday: "DDDD, DD MMMM YYYY",
"default": "DD/MM/YYYY"
},
dates: {
months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],
weekdays: ["Domingo", "Segunda-Feira", "Terça-Feira", "Quarta-Feira", "Quinta-Feira", "Sexta-Feira", "Sábado"],
shortWeekdays: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"],
minWeekdays: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"]
},
d3: {
grouping: [3],
currency: ["$", ""],
dateTime: "%A, %e de %B de %Y. %X",
date: "%d/%m/%Y",
time: "%H:%M:%S",
periods: ["AM", "PM"]
},
datePicker: {
closeText: "Fechar",
prevText: "Anterior",
nextText: "Próximo",
currentText: "Hoje",
weekHeader: "Sm",
dateFormat: "dd/mm/yy",
firstDay: 0,
isRTL: !1,
showMonthAfterYear: !1,
yearSuffix: ""
},
pluralForm: function(e) {
return 1 !== e ? 1 : 0
}
}
},
1175: function(e, t, n) {
e.exports = n(1176)
},
1176: function(e, t) {
"use strict";
e.exports = function() {
var e = arguments.length <= 0 || void 0 === arguments[0] ? {} : arguments[0];
return {
get: function(t) {
return !!e[t]
},
getAll: function() {
return e
}
}
}
},
1177: function(e, t) {
"use strict";
function n(e) {
var n = void 0 === e ? {} : e,
r = n.definitions,
l = void 0 === r ? {} : r,
u = n.includeQueryParams,
c = void 0 === u ? !1 : u,
d = n.caseInsensitive,
h = void 0 === d ? !1 : d,
p = i(l),
f = s({}, a, p),
g = o(f, !0),
m = c ? "(?:\\?([\\s\\S]*))?" : "",
v = h ? "i" : "";
return function(e) {
var n = new RegExp("^" + g(e) + m + "$", v);
return n[t.sourceKey] = e, n
}
}
function i(e) {
return Object.keys(e).reduce(function(t, n) {
var i = e[n];
return t[n] = u(i), t
}, {})
}
function r(e, t) {
return t.length - e.length
}
function o(e, t) {
var n = Object.keys(e).sort(r).join("|"),
i = new RegExp("(?:\\(\\?)?:(" + n + ")" + l, "g"),
o = /^\(\?:/,
s = t ? "" : "?:",
a = function(t, n, i) {
if (void 0 === i && (i = ""), o.test(t)) return t;
var r = i ? "(?:" + e[n] + ")" : e[n];
return "(" + s + r + i + ")"
};
return function(e) {
return i.lastIndex = 0, e.replace(i, a)
}
}
function s(e) {
for (var t = [], n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
return t.reduce(function(e, t) {
for (var n in t) e[n] = t[n];
return e
}, e)
}
t.sourceKey = "function" == typeof Symbol ? Symbol("source") : "routeabout.source", t.create = n;
var a = {
alpha: "[a-zA-Z_-]",
alphanum: "[a-zA-Z0-9_-]",
num: "[0-9]"
},
l = "(\\+|\\*|\\?|\\{\\d+,?\\d*\\})?",
u = o(a, !1)
},
1186: function(e, t, n) {
(function(t) {
"use strict";
function i() {
function e(e, t) {}
var t = arguments.length <= 0 || void 0 === arguments[0] ? 2 : arguments[0],
r = n(55).get("me"),
o = arguments[1];
return o || (o = n(56).defer().done(function() {
n(61).instances.add(r), n(57).trigger("connect:hasUserData")
})), r.id ? o.resolve() : r.fetch().done(o.resolve).fail(function(r) {
403 === r.status ? (e("Frozen user account, removing token", r), n(64).logout(), o.reject(r)) : t ? (e("Error fetching user information. Retrying...", r), i(t - 1, o)) : (e("Could not fetch user information. Giving up...", r), n(64).logout().always(function() {
window.location.reload()
}), o.reject(r))
}), o
}
function r() {
var e = 10;
! function i() {
t(window.document).one("ajaxSuccess", function(t, r) {
!n(52).dateTimeHelper.setServerTime(r.getResponseHeader("Date")) && --e && i()
})
}()
}
function o() {
n(921).initialize({
statusCode: n(293)
}), n(331).initialize()
}
function s() {
n(55).set("geoip", new(n(1357)))
}
function a() {
var e, i, r = window.document;
e = new(n(62)), e.setRoutes(n(1050), n(1763)), e.setLoader(n(1294)), n(156) && n(156).initialize(), n(55).set("router", e), n(92).setAudioAd(n(1353)), n(68).initialize(n(92), n(74), n(57), function(e) {
var t = n(100).fromComponents({
collection: "track-stations",
id: e.id
}),
i = new(n(209))(null, {
resource_id: t
}),
r = n(116).getStationPageUrl(e);
return i.release(), {
source: i,
restoreUrl: r
}
}), n(68).setFallbackSource(n(287), function(e) {
return n(62).getRoute("listenNetwork", e, "related")
}), h(), n(59).initialize(t(r)), n(1324).initialize(), g(), i = new(n(1369))({
el: t("#app"),
appVersion: v
}), i.render(), n(22).history.start({
root: "/",
pushState: !0
}), t(window).on("unload", p)
}
function l() {
var e = new(n(61))({
id: n(55).get("systemUserId")
});
e.release = e.hold = n(3).noop
}
function u() {
n(1290)(), n(55).get("me").on("change:consumer_subscription", function() {
if (this.hasHighTier()) {
var e = n(65).instances.filter(function(e) {
return e.isBlocked() || e.isSnippetized()
}).map(function(e) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment